GNUnet 0.28.1-dev.5-1-gae1c02d74
 
Loading...
Searching...
No Matches
transport-testing-communicator.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2019 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20
27#include "platform.h"
28#include "gnunet_util_lib.h"
29#include "gnunet_pils_service.h"
31#include "transport.h"
32
37
38
43
53(*GNUNET_TRANSPORT_TESTING_BackchannelCallback)(void *cls,
55 ,
56 struct GNUNET_PeerIdentity *pid)
57;
58
59
72typedef void
74 struct
76 *tc_h,
77 const struct GNUNET_PeerIdentity *
78 peer_id);
79
80
90typedef void
92 struct
94 *tc_h,
95 enum
97 cc,
98 char *address_prefix);
99
100
111typedef void
113 struct
115 *tc_h,
116 const char *address,
119 uint32_t aid,
121
122
130typedef void
132 struct
134 *tc_h,
135 int will_try);
136
137
145typedef void
147 struct
149 *tc_h,
150 struct
152 *tc_queue,
153 size_t mtu);
154
155
163typedef void
165 struct
167 *tc_h,
168 const char*payload,
169 size_t payload_len);
170
175{
181
186
191
196
203
208
213
218
223
229
230
235
240
245
250
255
260
265
270
275
280
285
286 /* Callbacks + Closures */
291
297
302
307
312
317
322
327
331 void *cb_cls;
332
337
341 void *cont_cls;
342
347};
348
370 const char *service_name,
371 const char *binary_name,
372 const char *cfg_filename,
381 void *cb_cls);
382
383
384void
387
388
396void
399 *tc_h,
400 const struct
402 *peer_id,
403 const char *address)
404;
405
406
416void
419 *tc_h,
421 cont,
422 void *cont_cls,
423 const void *payload,
424 size_t payload_size);
struct GNUNET_MessageHeader * msg
Definition 005.c:2
static char * cfg_filename
Name of the configuration file.
static char * peer_id
Option –peer.
static char * address
GNS address for this phone.
static struct GNUNET_TIME_Relative expiration
User supplied expiration value.
static struct GNUNET_NAT_AUTO_Test * nt
Handle to a NAT test operation.
static unsigned long long payload
How much data are we currently storing in the database?
static char * service_name
Option -s: service name (hash to get service descriptor)
Definition gnunet-vpn.c:50
API of the transport service towards the communicator processes.
GNUNET_TRANSPORT_CommunicatorCharacteristics
What characteristics does this communicator have?
GNUNET_NetworkType
Types of networks (with separate quotas) we support.
void(* GNUNET_SCHEDULER_TaskCallback)(void *cls)
Signature of the main function of a task.
Handle to a message queue.
Definition mq.c:87
Header for all communications.
A handle for the PILS service.
Definition pils_api.c:86
The identity of the host (wraps the signing key of the peer).
Entry in list of pending tasks.
Definition scheduler.c:141
Handle to a service.
Definition service.c:116
Time for relative time used by GNUnet, in microseconds.
struct GNUNET_Process * stat_proc
statistics service process
struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue * queue_head
Head of the DLL of queues associated with this communicator.
struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue * queue_tail
Tail of the DLL of queues associated with this communicator.
struct GNUNET_Process * resolver_proc
resolver service process
struct GNUNET_SERVICE_Handle * sh
Our service handle.
GNUNET_TRANSPORT_TESTING_BackchannelCallback bc_cb
Backchannel callback.
struct GNUNET_PeerIdentity peer_id
Our peer identity, as reported by PILS.
GNUNET_TRANSPORT_TESTING_QueueCreateReplyCallback queue_create_reply_cb
Callback called when a new communicator connects.
struct GNUNET_PILS_Handle * pils
Handle to the PILS service of this peer.
struct GNUNET_SCHEDULER_Task * c_shutdown_task
Task that will be run on shutdown to stop and clean communicator.
GNUNET_TRANSPORT_TESTING_PeerIdCallback peer_id_cb
Callback called when PILS assigned us a peer identity.
GNUNET_TRANSPORT_TESTING_AddAddressCallback add_address_cb
Callback called when a new communicator connects.
struct GNUNET_SCHEDULER_Task * ts_shutdown_task
Task that will be run on shutdown to stop and clean transport service.
struct GNUNET_CONFIGURATION_Handle * cfg
Handle to the configuration.
struct GNUNET_Process * c_proc
Process of the communicator.
GNUNET_TRANSPORT_TESTING_CommunicatorAvailableCallback communicator_available_cb
Callback called when a new communicator connects.
GNUNET_TRANSPORT_TESTING_AddQueueCallback add_queue_cb
Callback called when a new communicator connects.
struct GNUNET_SERVICE_Handle * tsh
Handle to the transport service.
enum GNUNET_TRANSPORT_CommunicatorCharacteristics c_characteristics
Characteristics of the communicator.
GNUNET_TRANSPORT_TESTING_IncomingMessageCallback incoming_msg_cb
Callback called when a new communicator connects.
GNUNET_SCHEDULER_TaskCallback cont
Callback to call when message ack received.
struct GNUNET_Process * ps_proc
peerstore service process
void GNUNET_TRANSPORT_TESTING_transport_communicator_send(struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, GNUNET_SCHEDULER_TaskCallback cont, void *cont_cls, const void *payload, size_t payload_size)
Instruct communicator to send data.
void(* GNUNET_TRANSPORT_TESTING_IncomingMessageCallback)(void *cls, struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, const char *payload, size_t payload_len)
Handle an incoming message.
void(* GNUNET_TRANSPORT_TESTING_AddQueueCallback)(void *cls, struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue *tc_queue, size_t mtu)
Handle opening of queue.
void GNUNET_TRANSPORT_TESTING_transport_communicator_open_queue(struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, const struct GNUNET_PeerIdentity *peer_id, const char *address)
Instruct communicator to open a queue.
struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *(* GNUNET_TRANSPORT_TESTING_BackchannelCallback)(void *cls, struct GNUNET_MessageHeader *msg, struct GNUNET_PeerIdentity *pid)
Function signature for callbacks that are called when new backchannel message arrived.
void(* GNUNET_TRANSPORT_TESTING_QueueCreateReplyCallback)(void *cls, struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, int will_try)
Get informed about the success of a queue request.
struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle * GNUNET_TRANSPORT_TESTING_transport_communicator_service_start(const char *service_name, const char *binary_name, const char *cfg_filename, GNUNET_TRANSPORT_TESTING_PeerIdCallback peer_id_cb, GNUNET_TRANSPORT_TESTING_CommunicatorAvailableCallback communicator_available_cb, GNUNET_TRANSPORT_TESTING_AddAddressCallback add_address_cb, GNUNET_TRANSPORT_TESTING_QueueCreateReplyCallback queue_create_reply_cb, GNUNET_TRANSPORT_TESTING_AddQueueCallback add_queue_cb, GNUNET_TRANSPORT_TESTING_IncomingMessageCallback incoming_message_cb, GNUNET_TRANSPORT_TESTING_BackchannelCallback bc_cb, void *cb_cls)
Start communicator part of transport service and communicator.
void GNUNET_TRANSPORT_TESTING_transport_communicator_service_stop(struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h)
void(* GNUNET_TRANSPORT_TESTING_AddAddressCallback)(void *cls, struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, const char *address, struct GNUNET_TIME_Relative expiration, uint32_t aid, enum GNUNET_NetworkType nt)
Receive information about the address of a communicator.
void(* GNUNET_TRANSPORT_TESTING_PeerIdCallback)(void *cls, struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, const struct GNUNET_PeerIdentity *peer_id)
Function signature for callbacks that are called once the peer identity of the peer this communicator...
void(* GNUNET_TRANSPORT_TESTING_CommunicatorAvailableCallback)(void *cls, struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, enum GNUNET_TRANSPORT_CommunicatorCharacteristics cc, char *address_prefix)
Function signature for callbacks that are called when new communicators become available.
common internal definitions for transport service