GNUnet 0.21.1
transport-testing-communicator.c File Reference

functions related to testing-tng More...

#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_protocols.h"
#include "gnunet_constants.h"
#include "transport-testing-communicator.h"
#include "gnunet_signatures.h"
#include "transport.h"
#include "gnunet_hello_uri_lib.h"
#include <inttypes.h>
Include dependency graph for transport-testing-communicator.c:

Go to the source code of this file.

Data Structures

struct  MyClient
 
struct  GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue
 Queue of a communicator and some context. More...
 
struct  GNUNET_TRANSPORT_TESTING_TransportCommunicatorTransmission
 Handle/Context to a single transmission. More...
 

Macros

#define LOG(kind, ...)   GNUNET_log_from (kind, "transport-testing2", __VA_ARGS__)
 

Functions

static int check_communicator_available (void *cls, const struct GNUNET_TRANSPORT_CommunicatorAvailableMessage *msg)
 Check whether incoming msg indicating available communicator is correct. More...
 
static void handle_communicator_available (void *cls, const struct GNUNET_TRANSPORT_CommunicatorAvailableMessage *msg)
 Handle new communicator. More...
 
static int check_communicator_backchannel (void *cls, const struct GNUNET_TRANSPORT_CommunicatorBackchannel *msg)
 Incoming message. More...
 
static void handle_communicator_backchannel (void *cls, const struct GNUNET_TRANSPORT_CommunicatorBackchannel *bc_msg)
 Receive an incoming message. More...
 
static int check_add_address (void *cls, const struct GNUNET_TRANSPORT_AddAddressMessage *msg)
 Address of our peer added. More...
 
static void handle_add_address (void *cls, const struct GNUNET_TRANSPORT_AddAddressMessage *msg)
 The communicator informs about an address. More...
 
static int check_incoming_msg (void *cls, const struct GNUNET_TRANSPORT_IncomingMessage *msg)
 Incoming message. More...
 
static void handle_incoming_msg (void *cls, const struct GNUNET_TRANSPORT_IncomingMessage *inc_msg)
 Receive an incoming message. More...
 
static void handle_queue_create_ok (void *cls, const struct GNUNET_TRANSPORT_CreateQueueResponse *msg)
 Communicator informs that it tries to establish requested queue. More...
 
static void handle_queue_create_fail (void *cls, const struct GNUNET_TRANSPORT_CreateQueueResponse *msg)
 Communicator informs that it won't try establishing requested queue. More...
 
static int check_add_queue_message (void *cls, const struct GNUNET_TRANSPORT_AddQueueMessage *aqm)
 New queue became available. More...
 
static void handle_add_queue_message (void *cls, const struct GNUNET_TRANSPORT_AddQueueMessage *msg)
 Handle new queue. More...
 
static void handle_update_queue_message (void *cls, const struct GNUNET_TRANSPORT_UpdateQueueMessage *msg)
 Handle new queue. More...
 
static void shutdown_service (void *cls)
 Shut down the service. More...
 
static void * connect_cb (void *cls, struct GNUNET_SERVICE_Client *client, struct GNUNET_MQ_Handle *mq)
 Callback called when new Client (Communicator) connects. More...
 
static void disconnect_cb (void *cls, struct GNUNET_SERVICE_Client *client, void *internal_cls)
 Callback called when Client disconnects. More...
 
static void handle_send_message_ack (void *cls, const struct GNUNET_TRANSPORT_SendMessageToAck *sma)
 Message was transmitted. More...
 
static void transport_communicator_start (struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h)
 Start the communicator part of the transport service. More...
 
static void shutdown_process (struct GNUNET_OS_Process *proc)
 Task run at shutdown to kill communicator and clean up. More...
 
static void shutdown_statistics (void *cls)
 Task run at shutdown to kill the statistics process. More...
 
static void shutdown_peerstore (void *cls)
 Task run at shutdown to kill the peerstore process. More...
 
static void shutdown_communicator (void *cls)
 Task run at shutdown to kill a communicator process. More...
 
static void communicator_start (struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, const char *binary_name)
 Start the communicator. More...
 
static void shutdown_nat (void *cls)
 Task run at shutdown to kill communicator and clean up. More...
 
static void shutdown_resolver (void *cls)
 Task run at shutdown to kill the resolver process. More...
 
static void resolver_start (struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h)
 Start Resolver. More...
 
static void statistics_start (struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h)
 Start Statistics. More...
 
static void peerstore_start (struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h)
 Start Peerstore. More...
 
static void nat_start (struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h)
 Start NAT. More...
 
struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandleGNUNET_TRANSPORT_TESTING_transport_communicator_service_start (const char *service_name, const char *binary_name, const char *cfg_filename, const struct GNUNET_PeerIdentity *peer_id, 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. More...
 
void GNUNET_TRANSPORT_TESTING_transport_communicator_service_stop (struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h)
 
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. More...
 
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. More...
 

Detailed Description

functions related to testing-tng

Author
Christian Grothoff
Julius Bünger

Definition in file transport-testing-communicator.c.

Macro Definition Documentation

◆ LOG

#define LOG (   kind,
  ... 
)    GNUNET_log_from (kind, "transport-testing2", __VA_ARGS__)

Definition at line 37 of file transport-testing-communicator.c.

Function Documentation

◆ check_communicator_available()

static int check_communicator_available ( void *  cls,
const struct GNUNET_TRANSPORT_CommunicatorAvailableMessage msg 
)
static

Check whether incoming msg indicating available communicator is correct.

Parameters
clsClosure
msgMessage struct
Returns
GNUNET_YES in case message is correct

Definition at line 149 of file transport-testing-communicator.c.

152{
153 uint16_t size;
154
155 size = ntohs (msg->header.size) - sizeof(*msg);
156 if (0 == size)
157 return GNUNET_OK; /* receive-only communicator */
159 return GNUNET_OK;
160}
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format.
@ GNUNET_OK
#define GNUNET_MQ_check_zero_termination(m)
Insert code for a "check_" function that verifies that a given variable-length message received over ...
static unsigned int size
Size of the "table".
Definition: peer.c:68

References GNUNET_MQ_check_zero_termination, GNUNET_OK, msg, GNUNET_MessageHeader::size, and size.

◆ handle_communicator_available()

static void handle_communicator_available ( void *  cls,
const struct GNUNET_TRANSPORT_CommunicatorAvailableMessage msg 
)
static

Handle new communicator.

Store characteristics of communicator, call respective client callback.

Parameters
clsClosure - communicator handle
msgMessage struct

Definition at line 172 of file transport-testing-communicator.c.

175{
176 struct MyClient *client = cls;
178 client->tc;
179 uint16_t size;
180 tc_h->c_mq = client->c_mq;
181
182 size = ntohs (msg->header.size) - sizeof(*msg);
183 if (0 == size)
184 {
186 return; /* receive-only communicator */
187 }
188 tc_h->c_characteristics = ntohl (msg->cc);
190 tc_h->c_addr_prefix = GNUNET_strdup ((const char *) &msg[1]);
191 if (NULL != tc_h->communicator_available_cb)
192 {
193 LOG (GNUNET_ERROR_TYPE_DEBUG, "calling communicator_available_cb()\n");
195 tc_h,
196 tc_h->c_characteristics,
197 tc_h->c_addr_prefix);
198 }
200 LOG (GNUNET_ERROR_TYPE_DEBUG, "finished communicator_available_cb()\n");
201
202}
@ GNUNET_ERROR_TYPE_DEBUG
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
#define GNUNET_free(ptr)
Wrapper around free.
void GNUNET_SERVICE_client_continue(struct GNUNET_SERVICE_Client *c)
Continue receiving further messages from the given client.
Definition: service.c:2455
struct GNUNET_MQ_Handle * c_mq
Handle to the client.
GNUNET_TRANSPORT_TESTING_CommunicatorAvailableCallback communicator_available_cb
Callback called when a new communicator connects.
enum GNUNET_TRANSPORT_CommunicatorCharacteristics c_characteristics
Characteristics of the communicator.
struct GNUNET_SERVICE_Client * client
Handle to the client.
struct GNUNET_MQ_Handle * c_mq
Handle to the client.
struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle * tc
The TCH.
#define LOG(kind,...)

References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_addr_prefix, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_characteristics, MyClient::c_mq, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_mq, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cb_cls, MyClient::client, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::communicator_available_cb, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_SERVICE_client_continue(), GNUNET_strdup, LOG, msg, GNUNET_MessageHeader::size, size, and MyClient::tc.

Here is the call graph for this function:

◆ check_communicator_backchannel()

static int check_communicator_backchannel ( void *  cls,
const struct GNUNET_TRANSPORT_CommunicatorBackchannel msg 
)
static

Incoming message.

Test message is well-formed.

Parameters
clsthe client
msgthe send message that was sent
Returns
GNUNET_OK if message is well-formed

Definition at line 213 of file transport-testing-communicator.c.

216{
217 // struct TransportClient *tc = cls;
218
219 // if (CT_COMMUNICATOR != tc->type)
220 // {
221 // GNUNET_break (0);
222 // return GNUNET_SYSERR;
223 // }
224 // GNUNET_MQ_check_boxed_message (msg);
225 return GNUNET_OK;
226}

References GNUNET_OK.

◆ handle_communicator_backchannel()

static void handle_communicator_backchannel ( void *  cls,
const struct GNUNET_TRANSPORT_CommunicatorBackchannel bc_msg 
)
static

Receive an incoming message.

Pass the message to the client.

Parameters
clsClosure - communicator handle
bc_msgMessage

Definition at line 238 of file transport-testing-communicator.c.

242{
243 struct MyClient *client = cls;
245 client->tc;
248 msg = (struct GNUNET_MessageHeader *) &bc_msg[1];
249 uint16_t isize = ntohs (msg->size);
250 const char *target_communicator = ((const char *) msg) + isize;
252 struct GNUNET_MQ_Envelope *env;
253
255 "Received backchannel message\n");
256 if (tc_h->bc_enabled != GNUNET_YES)
257 {
259 return;
260 }
261 /* Find client providing this communicator */
262 /* Finally, deliver backchannel message to communicator */
264 "Delivering backchannel message of type %u to %s\n",
265 ntohs (msg->type),
266 target_communicator);
267 other_tc_h = tc_h->bc_cb (tc_h, msg, (struct
268 GNUNET_PeerIdentity*) &bc_msg->pid);
270 cbi,
271 isize,
273 cbi->pid = tc_h->peer_id;
274 memcpy (&cbi[1], msg, isize);
275
276
277 GNUNET_MQ_send (other_tc_h->c_mq, env);
279}
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
uint16_t type
The type of the message (GNUNET_MESSAGE_TYPE_XXXX), in big-endian format.
@ GNUNET_YES
void GNUNET_MQ_send(struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev)
Send a message with the given message queue.
Definition: mq.c:304
#define GNUNET_MQ_msg_extra(mvar, esize, type)
Allocate an envelope, with extra space allocated after the space needed by the message struct.
Definition: gnunet_mq_lib.h:63
#define GNUNET_MESSAGE_TYPE_TRANSPORT_COMMUNICATOR_BACKCHANNEL_INCOMING
Transport signalling incoming backchannel message to a communicator.
Header for all communications.
The identity of the host (wraps the signing key of the peer).
Message from transport to communicator passing along a backchannel message from the given peer pid.
Definition: transport.h:650
struct GNUNET_PeerIdentity pid
Origin peer.
Definition: transport.h:665
struct GNUNET_PeerIdentity pid
Target peer.
Definition: transport.h:635
GNUNET_TRANSPORT_TESTING_BackchannelCallback bc_cb
Backchannel callback.

References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::bc_cb, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::bc_enabled, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_mq, MyClient::client, env, GNUNET_ERROR_TYPE_DEBUG, GNUNET_MESSAGE_TYPE_TRANSPORT_COMMUNICATOR_BACKCHANNEL_INCOMING, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_SERVICE_client_continue(), GNUNET_YES, LOG, msg, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::peer_id, GNUNET_TRANSPORT_CommunicatorBackchannel::pid, GNUNET_TRANSPORT_CommunicatorBackchannelIncoming::pid, GNUNET_MessageHeader::size, MyClient::tc, and GNUNET_MessageHeader::type.

Here is the call graph for this function:

◆ check_add_address()

static int check_add_address ( void *  cls,
const struct GNUNET_TRANSPORT_AddAddressMessage msg 
)
static

Address of our peer added.

Test message is well-formed.

Parameters
clsthe client
msgthe send message that was sent
Returns
GNUNET_OK if message is well-formed

Definition at line 290 of file transport-testing-communicator.c.

292{
293 // if (CT_COMMUNICATOR != tc->type)
294 // {
295 // GNUNET_break (0);
296 // return GNUNET_SYSERR;
297 // }
299 return GNUNET_OK;
300}

References GNUNET_MQ_check_zero_termination, GNUNET_OK, and msg.

◆ handle_add_address()

static void handle_add_address ( void *  cls,
const struct GNUNET_TRANSPORT_AddAddressMessage msg 
)
static

The communicator informs about an address.

Store address and call client callback.

Parameters
clsClosure - communicator handle
msgMessage

Definition at line 312 of file transport-testing-communicator.c.

314{
315 struct MyClient *client = cls;
317 client->tc;
318 uint16_t size;
319 size = ntohs (msg->header.size) - sizeof(*msg);
320 LOG (GNUNET_ERROR_TYPE_DEBUG, "received add address cb %u\n", size);
321 if (0 == size)
322 return; /* receive-only communicator */
323 LOG (GNUNET_ERROR_TYPE_DEBUG, "received add address cb %u\n", size);
324 GNUNET_free (tc_h->c_address);
325 tc_h->c_address = GNUNET_strdup ((const char *) &msg[1]);
326 if (NULL != tc_h->add_address_cb)
327 {
328 LOG (GNUNET_ERROR_TYPE_DEBUG, "calling add_address_cb()\n");
329 tc_h->add_address_cb (tc_h->cb_cls,
330 tc_h,
331 tc_h->c_address,
332 GNUNET_TIME_relative_ntoh (msg->expiration),
333 msg->aid,
334 ntohl (msg->nt));
335 }
337}
struct GNUNET_TIME_Relative GNUNET_TIME_relative_ntoh(struct GNUNET_TIME_RelativeNBO a)
Convert relative time from network byte order.
Definition: time.c:628
GNUNET_TRANSPORT_TESTING_AddAddressCallback add_address_cb
Callback called when a new communicator connects.

References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::add_address_cb, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_address, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cb_cls, MyClient::client, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_SERVICE_client_continue(), GNUNET_strdup, GNUNET_TIME_relative_ntoh(), LOG, msg, GNUNET_MessageHeader::size, size, and MyClient::tc.

Here is the call graph for this function:

◆ check_incoming_msg()

static int check_incoming_msg ( void *  cls,
const struct GNUNET_TRANSPORT_IncomingMessage msg 
)
static

Incoming message.

Test message is well-formed.

Parameters
clsthe client
msgthe send message that was sent
Returns
GNUNET_OK if message is well-formed

Definition at line 348 of file transport-testing-communicator.c.

350{
351 // struct TransportClient *tc = cls;
352
353 // if (CT_COMMUNICATOR != tc->type)
354 // {
355 // GNUNET_break (0);
356 // return GNUNET_SYSERR;
357 // }
359 return GNUNET_OK;
360}
#define GNUNET_MQ_check_boxed_message(m)
Insert code for a "check_" function that verifies that a given variable-length message received over ...

References GNUNET_MQ_check_boxed_message, GNUNET_OK, and msg.

◆ handle_incoming_msg()

static void handle_incoming_msg ( void *  cls,
const struct GNUNET_TRANSPORT_IncomingMessage inc_msg 
)
static

Receive an incoming message.

Pass the message to the client.

Parameters
clsClosure - communicator handle
inc_msgMessage

Definition at line 372 of file transport-testing-communicator.c.

374{
375 struct MyClient *client = cls;
377 client->tc;
379 msg = (struct GNUNET_MessageHeader *) &inc_msg[1];
380 size_t payload_len = ntohs (msg->size) - sizeof (struct
382 if (NULL != tc_h->incoming_msg_cb)
383 {
384 tc_h->incoming_msg_cb (tc_h->cb_cls,
385 tc_h,
386 (char*) &msg[1],
387 payload_len);
388 }
389 else
390 {
392 "Incoming message from communicator but no handler!\n");
393 }
394 if (GNUNET_YES == ntohl (inc_msg->fc_on))
395 {
396 /* send ACK when done to communicator for flow control! */
397 struct GNUNET_MQ_Envelope *env;
399
401 GNUNET_assert (NULL != env);
402 ack->reserved = htonl (0);
403 ack->fc_id = inc_msg->fc_id;
404 ack->sender = inc_msg->sender;
405 GNUNET_MQ_send (tc_h->c_mq, env);
406 }
407
409}
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
@ GNUNET_ERROR_TYPE_WARNING
#define GNUNET_MQ_msg(mvar, type)
Allocate a GNUNET_MQ_Envelope.
Definition: gnunet_mq_lib.h:78
#define GNUNET_MESSAGE_TYPE_TRANSPORT_INCOMING_MSG_ACK
transport acknowledges processing an incoming message
Transport informs us about being done with an incoming message.
Definition: transport.h:369
struct GNUNET_PeerIdentity sender
Sender identifier of the original message.
Definition: transport.h:388
uint64_t fc_id
Which message is being ACKed?
Definition: transport.h:383
uint32_t reserved
Reserved (0)
Definition: transport.h:378
struct GNUNET_PeerIdentity sender
Sender identifier.
Definition: transport.h:353
uint32_t fc_on
Do we use flow control or not?
Definition: transport.h:337
uint64_t fc_id
64-bit number to identify the matching ACK.
Definition: transport.h:342
GNUNET_TRANSPORT_TESTING_IncomingMessageCallback incoming_msg_cb
Callback called when a new communicator connects.

References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_mq, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cb_cls, MyClient::client, env, GNUNET_TRANSPORT_IncomingMessage::fc_id, GNUNET_TRANSPORT_IncomingMessageAck::fc_id, GNUNET_TRANSPORT_IncomingMessage::fc_on, GNUNET_assert, GNUNET_ERROR_TYPE_WARNING, GNUNET_MESSAGE_TYPE_TRANSPORT_INCOMING_MSG_ACK, GNUNET_MQ_msg, GNUNET_MQ_send(), GNUNET_SERVICE_client_continue(), GNUNET_YES, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::incoming_msg_cb, LOG, msg, GNUNET_TRANSPORT_IncomingMessageAck::reserved, GNUNET_TRANSPORT_IncomingMessage::sender, GNUNET_TRANSPORT_IncomingMessageAck::sender, GNUNET_MessageHeader::size, and MyClient::tc.

Here is the call graph for this function:

◆ handle_queue_create_ok()

static void handle_queue_create_ok ( void *  cls,
const struct GNUNET_TRANSPORT_CreateQueueResponse msg 
)
static

Communicator informs that it tries to establish requested queue.

Parameters
clsClosure - communicator handle
msgMessage

Definition at line 419 of file transport-testing-communicator.c.

421{
422 struct MyClient *client = cls;
424 client->tc;
425
426 if (NULL != tc_h->queue_create_reply_cb)
427 {
428 tc_h->queue_create_reply_cb (tc_h->cb_cls, tc_h, GNUNET_YES);
429 }
431}
GNUNET_TRANSPORT_TESTING_QueueCreateReplyCallback queue_create_reply_cb
Callback called when a new communicator connects.

References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cb_cls, MyClient::client, GNUNET_SERVICE_client_continue(), GNUNET_YES, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::queue_create_reply_cb, and MyClient::tc.

Here is the call graph for this function:

◆ handle_queue_create_fail()

static void handle_queue_create_fail ( void *  cls,
const struct GNUNET_TRANSPORT_CreateQueueResponse msg 
)
static

Communicator informs that it won't try establishing requested queue.

It will not do so probably because the address is bougus (see comment to GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE_FAIL)

Parameters
clsClosure - communicator handle
msgMessage

Definition at line 444 of file transport-testing-communicator.c.

447{
448 struct MyClient *client = cls;
450 client->tc;
451
452 if (NULL != tc_h->queue_create_reply_cb)
453 {
454 tc_h->queue_create_reply_cb (tc_h->cb_cls, tc_h, GNUNET_NO);
455 }
457}
@ GNUNET_NO

References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cb_cls, MyClient::client, GNUNET_NO, GNUNET_SERVICE_client_continue(), GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::queue_create_reply_cb, and MyClient::tc.

Here is the call graph for this function:

◆ check_add_queue_message()

static int check_add_queue_message ( void *  cls,
const struct GNUNET_TRANSPORT_AddQueueMessage aqm 
)
static

New queue became available.

Check message.

Parameters
clsthe client
aqmthe send message that was sent

Definition at line 467 of file transport-testing-communicator.c.

469{
471 return GNUNET_OK;
472}

References GNUNET_MQ_check_zero_termination, and GNUNET_OK.

◆ handle_add_queue_message()

static void handle_add_queue_message ( void *  cls,
const struct GNUNET_TRANSPORT_AddQueueMessage msg 
)
static

Handle new queue.

Store context and call client callback.

Parameters
clsClosure - communicator handle
msgMessage struct

Definition at line 484 of file transport-testing-communicator.c.

486{
487 struct MyClient *client = cls;
489 client->tc;
491
493 "Got queue with ID %u\n", msg->qid);
494 for (tc_queue = tc_h->queue_head; NULL != tc_queue; tc_queue = tc_queue->next)
495 {
496 if (tc_queue->qid == msg->qid)
497 break;
498 }
499 if (NULL == tc_queue)
500 {
501 tc_queue =
503 tc_queue->tc_h = tc_h;
504 tc_queue->qid = msg->qid;
505 tc_queue->peer_id = msg->receiver;
507 }
508 GNUNET_assert (tc_queue->qid == msg->qid);
509 GNUNET_assert (0 == GNUNET_memcmp (&tc_queue->peer_id, &msg->receiver));
510 tc_queue->nt = msg->nt;
511 tc_queue->mtu = ntohl (msg->mtu);
512 tc_queue->cs = msg->cs;
513 tc_queue->priority = ntohl (msg->priority);
514 tc_queue->q_len = GNUNET_ntohll (msg->q_len);
515 if (NULL != tc_h->add_queue_cb)
516 {
517 tc_h->add_queue_cb (tc_h->cb_cls, tc_h, tc_queue, tc_queue->mtu);
518 }
520}
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
uint64_t GNUNET_ntohll(uint64_t n)
Convert unsigned 64-bit integer to host byte order.
Definition: common_endian.c:54
#define GNUNET_memcmp(a, b)
Compare memory in a and b, where both must be of the same pointer type.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
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.
GNUNET_TRANSPORT_TESTING_AddQueueCallback add_queue_cb
Callback called when a new communicator connects.
uint32_t cs
An enum GNUNET_TRANSPORT_ConnectionStatus in NBO.
struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue * next
Next element inside a DLL.
struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle * tc_h
Handle to the TransportCommunicator.
struct GNUNET_PeerIdentity peer_id
Peer ID of the peer on the other side of the queue.

References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::add_queue_cb, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cb_cls, MyClient::client, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::cs, GNUNET_assert, GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_memcmp, GNUNET_new, GNUNET_ntohll(), GNUNET_SERVICE_client_continue(), LOG, msg, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::mtu, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::next, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::nt, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::peer_id, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::priority, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::q_len, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::qid, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::queue_head, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::queue_tail, MyClient::tc, and GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::tc_h.

Here is the call graph for this function:

◆ handle_update_queue_message()

static void handle_update_queue_message ( void *  cls,
const struct GNUNET_TRANSPORT_UpdateQueueMessage msg 
)
static

Handle new queue.

Store context and call client callback.

Parameters
clsClosure - communicator handle
msgMessage struct

Definition at line 532 of file transport-testing-communicator.c.

535{
536 struct MyClient *client = cls;
538 client->tc;
540
542 "Received queue update message for %u with q_len %" PRIu64 "\n",
543 msg->qid, GNUNET_ntohll (msg->q_len));
544 tc_queue = tc_h->queue_head;
545 if (NULL != tc_queue)
546 {
547 while (tc_queue->qid != msg->qid)
548 {
549 tc_queue = tc_queue->next;
550 }
551 }
552 if (NULL == tc_queue)
553 {
555 return;
556 }
557 GNUNET_assert (tc_queue->qid == msg->qid);
558 GNUNET_assert (0 == GNUNET_memcmp (&tc_queue->peer_id, &msg->receiver));
559 tc_queue->nt = msg->nt;
560 tc_queue->mtu = ntohl (msg->mtu);
561 tc_queue->cs = msg->cs;
562 tc_queue->priority = ntohl (msg->priority);
563 // Uncomment this for alternativ 1 of backchannel functionality
564 tc_queue->q_len += GNUNET_ntohll (msg->q_len);
565 // Until here for alternativ 1
566 // Uncomment this for alternativ 2 of backchannel functionality
567 // tc_queue->q_len = GNUNET_ntohll (msg->q_len);
568 // Until here for alternativ 2
570}

References MyClient::client, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::cs, GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_memcmp, GNUNET_ntohll(), GNUNET_SERVICE_client_continue(), LOG, msg, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::mtu, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::next, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::nt, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::peer_id, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::priority, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::q_len, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::qid, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::queue_head, MyClient::tc, and GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::tc_h.

Here is the call graph for this function:

◆ shutdown_service()

static void shutdown_service ( void *  cls)
static

Shut down the service.

Parameters
clsClosure - Handle to the service

Definition at line 579 of file transport-testing-communicator.c.

580{
581 struct GNUNET_SERVICE_Handle *h = cls;
582
584 "Shutting down service!\n");
585
587}
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
void GNUNET_SERVICE_stop(struct GNUNET_SERVICE_Handle *srv)
Stops a service that was started with GNUNET_SERVICE_start().
Definition: service.c:1938
Handle to a service.
Definition: service.c:117

References GNUNET_ERROR_TYPE_DEBUG, GNUNET_SERVICE_stop(), h, and LOG.

Referenced by GNUNET_TRANSPORT_TESTING_transport_communicator_service_stop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ connect_cb()

static void * connect_cb ( void *  cls,
struct GNUNET_SERVICE_Client client,
struct GNUNET_MQ_Handle mq 
)
static

Callback called when new Client (Communicator) connects.

Parameters
clsClosure - TransporCommmunicator Handle
clientClient
mqMessagequeue
Returns
TransportCommunicator Handle

Definition at line 600 of file transport-testing-communicator.c.

603{
605 struct MyClient *new_c;
606
607 LOG (GNUNET_ERROR_TYPE_DEBUG, "Client %p connected to %p.\n",
608 client, tc_h);
609 new_c = GNUNET_new (struct MyClient);
610 new_c->client = client;
611 new_c->c_mq = mq;
612 new_c->tc = tc_h;
614 tc_h->client_tail,
615 new_c);
616
617 if (NULL == tc_h->queue_head)
618 return new_c;
619 /* Iterate over queues. They are yet to be opened. Request opening. */
620 for (struct
622 tc_h->queue_head;
623 NULL != tc_queue_iter;
624 tc_queue_iter = tc_queue_iter->next)
625 {
626 if (NULL == tc_queue_iter->open_queue_env)
627 continue;
628 /* Send the previously created mq envelope to request the creation of the
629 * queue. */
630 GNUNET_MQ_send (tc_h->c_mq,
631 tc_queue_iter->open_queue_env);
632 tc_queue_iter->open_queue_env = NULL;
633 }
634 return new_c;
635}
struct GNUNET_MQ_Handle * mq
Definition: 003.c:5

References MyClient::c_mq, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_mq, MyClient::client, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::client_head, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::client_tail, GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_MQ_send(), GNUNET_new, LOG, mq, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::next, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::queue_head, and MyClient::tc.

Referenced by transport_communicator_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ disconnect_cb()

static void disconnect_cb ( void *  cls,
struct GNUNET_SERVICE_Client client,
void *  internal_cls 
)
static

Callback called when Client disconnects.

Parameters
clsClosure - TransportCommunicator Handle
clientClient
internal_clsTransporCommmunicator Handle

Definition at line 646 of file transport-testing-communicator.c.

649{
650 struct MyClient *cl = cls;
652
653 for (cl = tc_h->client_head; NULL != cl; cl = cl->next)
654 {
655 if (cl->client != client)
656 continue;
658 tc_h->client_tail,
659 cl);
660 if (cl->c_mq == tc_h->c_mq)
661 tc_h->c_mq = NULL;
662 GNUNET_free (cl);
663 break;
664 }
665 LOG (GNUNET_ERROR_TYPE_DEBUG, "Client disconnected.\n");
666}
#define GNUNET_CONTAINER_DLL_remove(head, tail, element)
Remove an element from a DLL.
struct MyClient * next

References MyClient::c_mq, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_mq, MyClient::client, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::client_head, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::client_tail, GNUNET_CONTAINER_DLL_remove, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, LOG, and MyClient::next.

Referenced by transport_communicator_start().

Here is the caller graph for this function:

◆ handle_send_message_ack()

static void handle_send_message_ack ( void *  cls,
const struct GNUNET_TRANSPORT_SendMessageToAck sma 
)
static

Message was transmitted.

Process the request.

Parameters
clsthe client
smathe send message that was sent

Definition at line 676 of file transport-testing-communicator.c.

678{
679 struct MyClient *client = cls;
681 client->tc;
682 static int mtr = 0;
683 mtr++;
684 if (tc_h->cont != NULL)
685 tc_h->cont (tc_h->cont_cls);
687}
GNUNET_SCHEDULER_TaskCallback cont
Callback to call when message ack received.

References MyClient::client, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cont, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cont_cls, GNUNET_SERVICE_client_continue(), and MyClient::tc.

Here is the call graph for this function:

◆ transport_communicator_start()

static void transport_communicator_start ( struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle tc_h)
static

Start the communicator part of the transport service.

Parameters
communicator_availableCallback to be called when a new communicator becomes available
cfgConfiguration

Definition at line 698 of file transport-testing-communicator.c.

700{
701 struct GNUNET_MQ_MessageHandler mh[] = {
702 GNUNET_MQ_hd_var_size (communicator_available,
705 tc_h),
706 GNUNET_MQ_hd_var_size (communicator_backchannel,
709 tc_h),
710 GNUNET_MQ_hd_var_size (add_address,
713 tc_h),
714 // GNUNET_MQ_hd_fixed_size (del_address,
715 // GNUNET_MESSAGE_TYPE_TRANSPORT_DEL_ADDRESS,
716 // struct GNUNET_TRANSPORT_DelAddressMessage,
717 // NULL),
718 GNUNET_MQ_hd_var_size (incoming_msg,
721 tc_h),
722 GNUNET_MQ_hd_fixed_size (queue_create_ok,
725 tc_h),
726 GNUNET_MQ_hd_fixed_size (queue_create_fail,
729 tc_h),
730 GNUNET_MQ_hd_var_size (add_queue_message,
733 tc_h),
734 GNUNET_MQ_hd_fixed_size (update_queue_message,
737 tc_h),
738 // GNUNET_MQ_hd_fixed_size (del_queue_message,
739 // GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_TEARDOWN,
740 // struct GNUNET_TRANSPORT_DelQueueMessage,
741 // NULL),
742 GNUNET_MQ_hd_fixed_size (send_message_ack,
745 tc_h),
747 };
748
749
750 tc_h->sh = GNUNET_SERVICE_start ("transport",
751 tc_h->cfg,
752 &connect_cb,
754 tc_h,
755 mh);
756 GNUNET_assert (NULL != tc_h->sh);
757}
static struct GNUNET_CADET_Handle * mh
Cadet handle.
Definition: gnunet-cadet.c:92
#define GNUNET_MQ_handler_end()
End-marker for the handlers array.
#define GNUNET_MQ_hd_var_size(name, code, str, ctx)
#define GNUNET_MQ_hd_fixed_size(name, code, str, ctx)
#define GNUNET_MESSAGE_TYPE_TRANSPORT_NEW_COMMUNICATOR
Message sent to indicate to the transport which address prefix is supported by a communicator.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE_FAIL
Response from communicator: address bogus, will not try to create queue.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_COMMUNICATOR_BACKCHANNEL
Tell transport that it should assist with exchanging a message between communicators.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_INCOMING_MSG
inform transport about an incoming message
#define GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE_OK
Response from communicator: will try to create queue.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_MSG_ACK
communicator tells transports that message was sent
#define GNUNET_MESSAGE_TYPE_TRANSPORT_ADD_ADDRESS
inform transport to add an address of this peer
#define GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_SETUP
inform transport that a queue was setup to talk to some peer
#define GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_UPDATE
inform transport that a queue was updated
struct GNUNET_SERVICE_Handle * GNUNET_SERVICE_start(const char *service_name, const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_SERVICE_ConnectHandler connect_cb, GNUNET_SERVICE_DisconnectHandler disconnect_cb, void *cls, const struct GNUNET_MQ_MessageHandler *handlers)
Low-level function to start a service if the scheduler is already running.
Definition: service.c:1867
Message handler for a specific message type.
Add address to the list.
Definition: transport.h:282
Add queue to the transport.
Definition: transport.h:396
Message from communicator to transport service asking for transmission of a backchannel message with ...
Definition: transport.h:621
Communicator tells transport how queue creation went down.
Definition: transport.h:540
Inform transport about an incoming message.
Definition: transport.h:328
Inform transport that message was sent.
Definition: transport.h:587
struct GNUNET_SERVICE_Handle * sh
Our service handle.
struct GNUNET_CONFIGURATION_Handle * cfg
Handle to the configuration.
static void disconnect_cb(void *cls, struct GNUNET_SERVICE_Client *client, void *internal_cls)
Callback called when Client disconnects.
static void * connect_cb(void *cls, struct GNUNET_SERVICE_Client *client, struct GNUNET_MQ_Handle *mq)
Callback called when new Client (Communicator) connects.

References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cfg, connect_cb(), disconnect_cb(), GNUNET_assert, GNUNET_MESSAGE_TYPE_TRANSPORT_ADD_ADDRESS, GNUNET_MESSAGE_TYPE_TRANSPORT_COMMUNICATOR_BACKCHANNEL, GNUNET_MESSAGE_TYPE_TRANSPORT_INCOMING_MSG, GNUNET_MESSAGE_TYPE_TRANSPORT_NEW_COMMUNICATOR, GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE_FAIL, GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE_OK, GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_SETUP, GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_UPDATE, GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_MSG_ACK, GNUNET_MQ_handler_end, GNUNET_MQ_hd_fixed_size, GNUNET_MQ_hd_var_size, GNUNET_SERVICE_start(), mh, and GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::sh.

Referenced by GNUNET_TRANSPORT_TESTING_transport_communicator_service_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shutdown_process()

static void shutdown_process ( struct GNUNET_OS_Process proc)
static

Task run at shutdown to kill communicator and clean up.

Parameters
clsClosure - Process of communicator

Definition at line 766 of file transport-testing-communicator.c.

767{
768 if (0 != GNUNET_OS_process_kill (proc, SIGTERM))
769 {
771 "Error shutting down process with SIGERM, trying SIGKILL\n");
772 if (0 != GNUNET_OS_process_kill (proc, SIGKILL))
773 {
775 "Error shutting down process with SIGERM and SIGKILL\n");
776 }
777 }
780}
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur.
@ GNUNET_ERROR_TYPE_ERROR
void GNUNET_OS_process_destroy(struct GNUNET_OS_Process *proc)
Cleans up process structure contents (OS-dependent) and deallocates it.
Definition: os_priority.c:260
int GNUNET_OS_process_kill(struct GNUNET_OS_Process *proc, int sig)
Sends a signal to the process.
Definition: os_priority.c:210
enum GNUNET_GenericReturnValue GNUNET_OS_process_wait(struct GNUNET_OS_Process *proc)
Wait for a process to terminate.
Definition: os_priority.c:877

References GNUNET_break, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_WARNING, GNUNET_OK, GNUNET_OS_process_destroy(), GNUNET_OS_process_kill(), GNUNET_OS_process_wait(), and LOG.

Referenced by shutdown_communicator(), shutdown_nat(), shutdown_peerstore(), shutdown_resolver(), and shutdown_statistics().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shutdown_statistics()

static void shutdown_statistics ( void *  cls)
static

Task run at shutdown to kill the statistics process.

Parameters
clsClosure - Process of communicator

Definition at line 789 of file transport-testing-communicator.c.

790{
791 struct GNUNET_OS_Process *proc = cls;
792 shutdown_process (proc);
793}
static void shutdown_process(struct GNUNET_OS_Process *proc)
Task run at shutdown to kill communicator and clean up.

References shutdown_process().

Referenced by GNUNET_TRANSPORT_TESTING_transport_communicator_service_stop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shutdown_peerstore()

static void shutdown_peerstore ( void *  cls)
static

Task run at shutdown to kill the peerstore process.

Parameters
clsClosure - Process of communicator

Definition at line 802 of file transport-testing-communicator.c.

803{
804 struct GNUNET_OS_Process *proc = cls;
805 shutdown_process (proc);
806}

References shutdown_process().

Referenced by GNUNET_TRANSPORT_TESTING_transport_communicator_service_stop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shutdown_communicator()

static void shutdown_communicator ( void *  cls)
static

Task run at shutdown to kill a communicator process.

Parameters
clsClosure - Process of communicator

Definition at line 815 of file transport-testing-communicator.c.

816{
817 struct GNUNET_OS_Process *proc = cls;
818 shutdown_process (proc);
819}

References shutdown_process().

Referenced by GNUNET_TRANSPORT_TESTING_transport_communicator_service_stop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ communicator_start()

static void communicator_start ( struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle tc_h,
const char *  binary_name 
)
static

Start the communicator.

Parameters
cfgnameName of the communicator

Definition at line 828 of file transport-testing-communicator.c.

831{
832 char *binary;
833 char *loprefix;
834 char *section_name;
835
836 LOG (GNUNET_ERROR_TYPE_DEBUG, "communicator_start\n");
837
838 section_name = strchr (binary_name, '-');
839 section_name++;
840
843 "PREFIX",
844 &loprefix))
845 loprefix = GNUNET_strdup ("");
846
847
848 binary = GNUNET_OS_get_libexec_binary_path (binary_name);
850 NULL,
851 loprefix,
852 binary,
853 binary_name,
854 "-c",
855 tc_h->cfg_filename,
856 NULL);
857 GNUNET_free (loprefix);
858 if (NULL == tc_h->c_proc)
859 {
860 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to start communicator!");
861 return;
862 }
863 LOG (GNUNET_ERROR_TYPE_INFO, "started communicator\n");
864 GNUNET_free (binary);
865}
static char * section_name
Adapter we are supposed to test.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_string(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value)
Get a configuration value that should be a string.
#define GNUNET_log(kind,...)
@ GNUNET_ERROR_TYPE_INFO
char * GNUNET_OS_get_libexec_binary_path(const char *progname)
Given the name of a gnunet-helper, gnunet-service or gnunet-daemon binary, try to prefix it with the ...
struct GNUNET_OS_Process * GNUNET_OS_start_process_s(enum GNUNET_OS_InheritStdioFlags std_inheritance, const int *lsocks, const char *filename,...)
Start a process.
Definition: os_priority.c:665
@ GNUNET_OS_INHERIT_STD_OUT_AND_ERR
When these flags are set, the child process will inherit stdout and stderr of the parent.
struct GNUNET_OS_Process * c_proc
Process of the communicator.

References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_proc, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cfg, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cfg_filename, GNUNET_CONFIGURATION_get_value_string(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_INFO, GNUNET_free, GNUNET_log, GNUNET_OK, GNUNET_OS_get_libexec_binary_path(), GNUNET_OS_INHERIT_STD_OUT_AND_ERR, GNUNET_OS_start_process_s(), GNUNET_strdup, LOG, and section_name.

Referenced by GNUNET_TRANSPORT_TESTING_transport_communicator_service_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shutdown_nat()

static void shutdown_nat ( void *  cls)
static

Task run at shutdown to kill communicator and clean up.

Parameters
clsClosure - Process of communicator

Definition at line 874 of file transport-testing-communicator.c.

875{
876 struct GNUNET_OS_Process *proc = cls;
877 shutdown_process (proc);
878}

References shutdown_process().

Referenced by GNUNET_TRANSPORT_TESTING_transport_communicator_service_stop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shutdown_resolver()

static void shutdown_resolver ( void *  cls)
static

Task run at shutdown to kill the resolver process.

Parameters
clsClosure - Process of communicator

Definition at line 887 of file transport-testing-communicator.c.

888{
889 struct GNUNET_OS_Process *proc = cls;
890 shutdown_process (proc);
891}

References shutdown_process().

Referenced by GNUNET_TRANSPORT_TESTING_transport_communicator_service_stop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resolver_start()

static void resolver_start ( struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle tc_h)
static

Start Resolver.

Definition at line 899 of file transport-testing-communicator.c.

901{
902 char *binary;
903
904 LOG (GNUNET_ERROR_TYPE_DEBUG, "resolver_start\n");
905 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver");
909 NULL,
910 NULL,
911 NULL,
912 binary,
913 "gnunet-service-resolver",
914 "-c",
915 tc_h->cfg_filename,
916 NULL);
917 if (NULL == tc_h->resolver_proc)
918 {
919 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to start resolver service!");
920 return;
921 }
922 LOG (GNUNET_ERROR_TYPE_INFO, "started resolver service\n");
923 GNUNET_free (binary);
924
925}
struct GNUNET_OS_Process * GNUNET_OS_start_process(enum GNUNET_OS_InheritStdioFlags std_inheritance, struct GNUNET_DISK_PipeHandle *pipe_stdin, struct GNUNET_DISK_PipeHandle *pipe_stdout, struct GNUNET_DISK_PipeHandle *pipe_stderr, const char *filename,...)
Start a process.
Definition: os_priority.c:626
@ GNUNET_OS_USE_PIPE_CONTROL
Should a pipe be used to send signals to the child?
struct GNUNET_OS_Process * resolver_proc
resolver service process

References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cfg_filename, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_INFO, GNUNET_free, GNUNET_log, GNUNET_OS_get_libexec_binary_path(), GNUNET_OS_INHERIT_STD_OUT_AND_ERR, GNUNET_OS_start_process(), GNUNET_OS_USE_PIPE_CONTROL, LOG, and GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::resolver_proc.

Referenced by GNUNET_TRANSPORT_TESTING_transport_communicator_service_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ statistics_start()

static void statistics_start ( struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle tc_h)
static

Start Statistics.

Definition at line 933 of file transport-testing-communicator.c.

935{
936 char *binary;
937
938 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics");
940 NULL,
941 NULL,
942 NULL,
943 binary,
944 "gnunet-service-statistics",
945 "-c",
946 tc_h->cfg_filename,
947 NULL);
948 if (NULL == tc_h->stat_proc)
949 {
950 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to start Statistics!");
951 return;
952 }
953 LOG (GNUNET_ERROR_TYPE_INFO, "started Statistics\n");
954 GNUNET_free (binary);
955}
struct GNUNET_OS_Process * stat_proc
statistics service process

References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cfg_filename, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_INFO, GNUNET_free, GNUNET_log, GNUNET_OS_get_libexec_binary_path(), GNUNET_OS_INHERIT_STD_OUT_AND_ERR, GNUNET_OS_start_process(), LOG, and GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::stat_proc.

Referenced by GNUNET_TRANSPORT_TESTING_transport_communicator_service_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ peerstore_start()

static void peerstore_start ( struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle tc_h)
static

Start Peerstore.

Definition at line 963 of file transport-testing-communicator.c.

965{
966 char *binary;
967
968 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-peerstore");
970 NULL,
971 NULL,
972 NULL,
973 binary,
974 "gnunet-service-peerstore",
975 "-c",
976 tc_h->cfg_filename,
977 NULL);
978 if (NULL == tc_h->ps_proc)
979 {
980 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to start Peerstore!");
981 return;
982 }
983 LOG (GNUNET_ERROR_TYPE_INFO, "started Peerstore\n");
984 GNUNET_free (binary);
985}
struct GNUNET_OS_Process * ps_proc
peerstore service process

References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cfg_filename, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_INFO, GNUNET_free, GNUNET_log, GNUNET_OS_get_libexec_binary_path(), GNUNET_OS_INHERIT_STD_OUT_AND_ERR, GNUNET_OS_start_process(), LOG, and GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::ps_proc.

Referenced by GNUNET_TRANSPORT_TESTING_transport_communicator_service_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nat_start()

static void nat_start ( struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle tc_h)
static

Start NAT.

Definition at line 993 of file transport-testing-communicator.c.

995{
996 char *binary;
997
998 LOG (GNUNET_ERROR_TYPE_DEBUG, "nat_start\n");
999 binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-nat");
1002 NULL,
1003 NULL,
1004 NULL,
1005 binary,
1006 "gnunet-service-nat",
1007 "-c",
1008 tc_h->cfg_filename,
1009 NULL);
1010 if (NULL == tc_h->nat_proc)
1011 {
1012 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to start NAT!");
1013 return;
1014 }
1015 LOG (GNUNET_ERROR_TYPE_INFO, "started NAT\n");
1016 GNUNET_free (binary);
1017}

References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cfg_filename, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_ERROR_TYPE_INFO, GNUNET_free, GNUNET_log, GNUNET_OS_get_libexec_binary_path(), GNUNET_OS_INHERIT_STD_OUT_AND_ERR, GNUNET_OS_start_process(), GNUNET_OS_USE_PIPE_CONTROL, LOG, and GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::nat_proc.

Referenced by GNUNET_TRANSPORT_TESTING_transport_communicator_service_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_TRANSPORT_TESTING_transport_communicator_service_start()

struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle * GNUNET_TRANSPORT_TESTING_transport_communicator_service_start ( const char *  service_name,
const char *  binary_name,
const char *  cfg_filename,
const struct GNUNET_PeerIdentity peer_id,
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.

Parameters
service_nameName of the service
cfgConfiguration handle
communicator_available_cbCallback that is called when a new
add_address_cbCallback that is called when a new communicator becomes available
cb_clsClosure to communicator_available_cb and
Returns
Handle to the communicator duo

Definition at line 1033 of file transport-testing-communicator.c.

1046{
1048
1050 "Starting new transport/communicator combo with config %s\n",
1051 cfg_filename);
1052 tc_h =
1057 {
1059 _ ("Malformed configuration file `%s', exit ...\n"),
1060 cfg_filename);
1061 GNUNET_free (tc_h->cfg_filename);
1063 GNUNET_free (tc_h);
1064 return NULL;
1065 }
1067 "communicator-test",
1068 "BACKCHANNEL_ENABLED");
1072 tc_h->add_queue_cb = add_queue_cb;
1073 tc_h->incoming_msg_cb = incoming_message_cb;
1074 tc_h->bc_cb = bc_cb;
1075 tc_h->peer_id = *peer_id;
1076 tc_h->cb_cls = cb_cls;
1077
1078 /* Start communicator part of service */
1080 /* Start NAT */
1081 nat_start (tc_h);
1082 /* Start resolver service */
1083 resolver_start (tc_h);
1084 /* Start peerstore service */
1085 peerstore_start (tc_h);
1086 /* Start statistic service */
1087 statistics_start (tc_h);
1088 /* Schedule start communicator */
1089 communicator_start (tc_h,
1090 binary_name);
1091 return tc_h;
1092}
static char * cfg_filename
Name of the configuration file.
static char * peer_id
Option –peer.
Definition: gnunet-cadet.c:42
void GNUNET_CONFIGURATION_destroy(struct GNUNET_CONFIGURATION_Handle *cfg)
Destroy configuration object.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_yesno(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option)
Get a configuration value that should be in a set of "YES" or "NO".
struct GNUNET_CONFIGURATION_Handle * GNUNET_CONFIGURATION_create(void)
Create a new configuration object.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_load(struct GNUNET_CONFIGURATION_Handle *cfg, const char *filename)
Load configuration.
@ GNUNET_SYSERR
#define _(String)
GNU gettext support macro.
Definition: platform.h:178
static void nat_start(struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h)
Start NAT.
static void resolver_start(struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h)
Start Resolver.
static void transport_communicator_start(struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h)
Start the communicator part of the transport service.
static void statistics_start(struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h)
Start Statistics.
static void communicator_start(struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, const char *binary_name)
Start the communicator.
static void peerstore_start(struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h)
Start Peerstore.

References _, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::add_address_cb, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::add_queue_cb, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::bc_cb, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::bc_enabled, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cb_cls, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cfg, cfg_filename, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cfg_filename, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::communicator_available_cb, communicator_start(), GNUNET_CONFIGURATION_create(), GNUNET_CONFIGURATION_destroy(), GNUNET_CONFIGURATION_get_value_yesno(), GNUNET_CONFIGURATION_load(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_log, GNUNET_new, GNUNET_strdup, GNUNET_SYSERR, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::incoming_msg_cb, LOG, nat_start(), peer_id, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::peer_id, peerstore_start(), GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::queue_create_reply_cb, resolver_start(), statistics_start(), and transport_communicator_start().

Here is the call graph for this function:

◆ GNUNET_TRANSPORT_TESTING_transport_communicator_service_stop()

void GNUNET_TRANSPORT_TESTING_transport_communicator_service_stop ( struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle tc_h)

Definition at line 1096 of file transport-testing-communicator.c.

1098{
1107 while (NULL != (queue = tc_h->queue_head))
1108 {
1111 }
1115 GNUNET_free (tc_h);
1116}
static void queue(const char *hostname)
Add hostname to the list of requests to be made.
static void shutdown_peerstore(void *cls)
Task run at shutdown to kill the peerstore process.
static void shutdown_communicator(void *cls)
Task run at shutdown to kill a communicator process.
static void shutdown_statistics(void *cls)
Task run at shutdown to kill the statistics process.
static void shutdown_resolver(void *cls)
Task run at shutdown to kill the resolver process.
static void shutdown_nat(void *cls)
Task run at shutdown to kill communicator and clean up.
static void shutdown_service(void *cls)
Shut down the service.

References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_addr_prefix, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_address, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_proc, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cfg, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cfg_filename, GNUNET_CONFIGURATION_destroy(), GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::nat_proc, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::ps_proc, queue(), GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::queue_head, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::queue_tail, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::resolver_proc, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::sh, shutdown_communicator(), shutdown_nat(), shutdown_peerstore(), shutdown_resolver(), shutdown_service(), shutdown_statistics(), GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::stat_proc, and GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::tc_h.

Here is the call graph for this function:

◆ GNUNET_TRANSPORT_TESTING_transport_communicator_open_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.

Parameters
tc_hHandle to communicator which shall open queue
peer_idTowards which peer
addressFor which address

Definition at line 1127 of file transport-testing-communicator.c.

1131{
1133 static uint32_t idgen;
1134 char *prefix;
1136 struct GNUNET_MQ_Envelope *env;
1137 size_t alen;
1138
1139 tc_queue =
1141 tc_queue->tc_h = tc_h;
1143 if (NULL == prefix)
1144 {
1145 GNUNET_break (0); /* We got an invalid address!? */
1146 GNUNET_free (tc_queue);
1147 return;
1148 }
1150 alen = strlen (address) + 1;
1151 env =
1153 msg->request_id = htonl (idgen++);
1154 tc_queue->qid = msg->request_id;
1155 msg->receiver = *peer_id;
1156 tc_queue->peer_id = *peer_id;
1157 memcpy (&msg[1], address, alen);
1158 if (NULL != tc_h->c_mq)
1159 {
1161 "Sending queue create immediately\n");
1162 GNUNET_MQ_send (tc_h->c_mq, env);
1163 }
1164 else
1165 {
1166 tc_queue->open_queue_env = env;
1167 }
1168 GNUNET_CONTAINER_DLL_insert (tc_h->queue_head, tc_h->queue_tail, tc_queue);
1169}
static int prefix
If printing the value of PREFIX has been requested.
Definition: gnunet-config.c:66
static char * address
GNS address for this phone.
char * GNUNET_HELLO_address_to_prefix(const char *address)
Given an address as a string, extract the prefix that identifies the communicator offering transmissi...
Definition: hello-ng.c:190
#define GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE
transport tells communicator it wants a queue
Transport tells communicator that it wants a new queue.
Definition: transport.h:516
struct GNUNET_MQ_Envelope * open_queue_env
Envelope to a message that requests the opening of the queue.

References address, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_mq, env, GNUNET_break, GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_free, GNUNET_HELLO_address_to_prefix(), GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_new, LOG, msg, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::open_queue_env, peer_id, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::peer_id, prefix, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::qid, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::queue_head, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::queue_tail, and GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::tc_h.

Here is the call graph for this function:

◆ GNUNET_TRANSPORT_TESTING_transport_communicator_send()

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.

Parameters
tc_queueThe queue to use for sending
contfunction to call when done sending
cont_clsclosure for cont
payloadData to send
payload_sizeSize of the payload

Definition at line 1173 of file transport-testing-communicator.c.

1179{
1180 struct GNUNET_MessageHeader *mh;
1182 struct GNUNET_MQ_Envelope *env;
1183 size_t inbox_size;
1187 tc_queue = NULL;
1188
1189 for (tc_queue_tmp = tc_h->queue_head;
1190 NULL != tc_queue_tmp;
1191 tc_queue_tmp = tc_queue_tmp->next)
1192 {
1193 if (tc_queue_tmp->q_len <= 0)
1194 continue;
1195 if (NULL == tc_queue)
1196 {
1198 "Selecting queue with prio %u, len %" PRIu64 " and MTU %u\n",
1199 tc_queue_tmp->priority,
1200 tc_queue_tmp->q_len,
1201 tc_queue_tmp->mtu);
1202 tc_queue = tc_queue_tmp;
1203 continue;
1204 }
1205 if (tc_queue->priority < tc_queue_tmp->priority)
1206 {
1208 "Selecting queue with prio %u, len %" PRIu64 " and MTU %u\n",
1209 tc_queue_tmp->priority,
1210 tc_queue_tmp->q_len,
1211 tc_queue_tmp->mtu);
1212 tc_queue = tc_queue_tmp;
1213 }
1214 }
1215 if (last_queue != tc_queue)
1217 "Selected sending queue changed to %u with length %lu and MTU %u\n",
1218 ntohl (tc_queue->qid), (unsigned long) tc_queue->q_len, tc_queue->mtu);
1219 GNUNET_assert (NULL != tc_queue);
1220 last_queue = tc_queue;
1221 // Uncomment this for alternativ 1 of backchannel functionality
1223 tc_queue->q_len--;
1224 // Until here for alternativ 1
1225 static int msg_count = 0;
1226 msg_count++;
1227 if (msg_count % 100 == 0)
1229 "Sending %u-th (%lu-th for queue) message on queue %u\n",
1230 msg_count, (unsigned long) tc_queue->mid, ntohl (tc_queue->qid));
1231 inbox_size = sizeof (struct GNUNET_MessageHeader) + payload_size;
1233 inbox_size,
1235 GNUNET_assert (NULL != env);
1236 msg->qid = tc_queue->qid;
1237 msg->mid = tc_queue->mid++;
1238 msg->receiver = tc_queue->peer_id;
1239 mh = (struct GNUNET_MessageHeader *) &msg[1];
1240 mh->size = htons (inbox_size);
1242 memcpy (&mh[1],
1243 payload,
1244 payload_size);
1245 if (NULL != cont)
1247 cont,
1248 cont_cls);
1249 GNUNET_MQ_send (tc_queue->tc_h->c_mq,
1250 env);
1251}
static unsigned long long payload
How much data are we currently storing in the database?
#define GNUNET_TRANSPORT_QUEUE_LENGTH_UNLIMITED
Queue length.
void GNUNET_MQ_notify_sent(struct GNUNET_MQ_Envelope *ev, GNUNET_SCHEDULER_TaskCallback cb, void *cb_cls)
Call a callback once the envelope has been sent, that is, sending it can not be canceled anymore.
Definition: mq.c:638
#define GNUNET_MESSAGE_TYPE_DUMMY
Dummy messages for testing / benchmarking.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_MSG
transport tells communicator it wants to transmit
Inform communicator about transport's desire to send a message.
Definition: transport.h:558

References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_mq, env, GNUNET_assert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_log, GNUNET_MESSAGE_TYPE_DUMMY, GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_MSG, GNUNET_MQ_msg_extra, GNUNET_MQ_notify_sent(), GNUNET_MQ_send(), GNUNET_TRANSPORT_QUEUE_LENGTH_UNLIMITED, LOG, mh, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::mid, msg, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::mtu, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::next, payload, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::peer_id, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::priority, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::q_len, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::qid, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::queue_head, and GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::tc_h.

Here is the call graph for this function: