GNUnet  0.11.x
Data Structures | Macros | Functions
transport-testing2.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-testing2.h"
#include "gnunet_ats_transport_service.h"
#include "gnunet_hello_lib.h"
#include "gnunet_signatures.h"
#include "transport.h"
Include dependency graph for transport-testing2.c:

Go to the source code of this file.

Data Structures

struct  GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle
 Handle to a transport communicator. More...
 
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_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 *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 wont 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 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 transport_communicator_start (struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h)
 Start the communicator part of the transport service. More...
 
static void shutdown_communicator (void *cls)
 Task run at shutdown to kill communicator and clean up. More...
 
static void communicator_start (struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, const char *binary_name)
 Start the communicator. More...
 
struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandleGNUNET_TRANSPORT_TESTING_transport_communicator_service_start (const char *service_name, const char *binary_name, const char *cfg_filename, 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, void *cb_cls)
 Start communicator part of transport service and communicator. More...
 
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...
 
struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorTransmissionGNUNET_TRANSPORT_TESTING_transport_communicator_send (struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue *tc_queue, 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-testing2.c.

Macro Definition Documentation

◆ LOG

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

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 225 of file transport-testing2.c.

References GNUNET_MQ_check_zero_termination, GNUNET_OK, and size.

228 {
229  uint16_t size;
230 
231  size = ntohs (msg->header.size) - sizeof(*msg);
232  if (0 == size)
233  return GNUNET_OK; /* receive-only communicator */
235  return GNUNET_OK;
236 }
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:75
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format...
#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:67

◆ 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 248 of file transport-testing2.c.

References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_addr_prefix, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_characteristics, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cb_cls, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::client, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::communicator_available_cb, GNUNET_ERROR_TYPE_DEBUG, GNUNET_SERVICE_client_continue(), GNUNET_strdup, LOG, and size.

251 {
253  uint16_t size;
254 
255  size = ntohs (msg->header.size) - sizeof(*msg);
256  if (0 == size)
257  return; /* receive-only communicator */
258  tc_h->c_characteristics = ntohl (msg->cc);
259  tc_h->c_addr_prefix = GNUNET_strdup ((const char *) &msg[1]);
260  if (NULL != tc_h->communicator_available_cb)
261  {
262  LOG (GNUNET_ERROR_TYPE_DEBUG, "calling communicator_available_cb()\n");
263  tc_h->communicator_available_cb (tc_h->cb_cls,
264  tc_h,
265  tc_h->c_characteristics,
266  tc_h->c_addr_prefix);
267  }
269 }
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
enum GNUNET_TRANSPORT_CommunicatorCharacteristics c_characteristics
Characteristics of the communicator.
uint16_t size
The length of the struct (in bytes, including the length field itself), in big-endian format...
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
GNUNET_TRANSPORT_TESTING_CommunicatorAvailableCallback communicator_available_cb
Callback called when a new communicator connects.
char * c_addr_prefix
Specifies supported addresses.
static unsigned int size
Size of the "table".
Definition: peer.c:67
struct GNUNET_SERVICE_Client * client
Handle to the client.
void GNUNET_SERVICE_client_continue(struct GNUNET_SERVICE_Client *c)
Continue receiving further messages from the given client.
Definition: service.c:2243
#define LOG(kind,...)
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
aamthe send message that was sent
Returns
GNUNET_OK if message is well-formed

Definition at line 280 of file transport-testing2.c.

References GNUNET_MQ_check_zero_termination, GNUNET_OK, and tc.

282 {
283  struct TransportClient *tc = cls;
284 
285  // if (CT_COMMUNICATOR != tc->type)
286  // {
287  // GNUNET_break (0);
288  // return GNUNET_SYSERR;
289  // }
291  return GNUNET_OK;
292 }
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
static struct GNUNET_SCHEDULER_TaskContext tc
Task context of the current task.
Definition: scheduler.c:418
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:75
#define GNUNET_MQ_check_zero_termination(m)
Insert code for a "check_" function that verifies that a given variable-length message received over ...
Client connected to the transport service.

◆ 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 304 of file transport-testing2.c.

References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::add_address_cb, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_address, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cb_cls, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::client, GNUNET_ERROR_TYPE_DEBUG, GNUNET_SERVICE_client_continue(), GNUNET_strdup, GNUNET_TIME_relative_ntoh(), LOG, and size.

306 {
308  uint16_t size;
309 
310  size = ntohs (msg->header.size) - sizeof(*msg);
311  if (0 == size)
312  return; /* receive-only communicator */
313  tc_h->c_address = GNUNET_strdup ((const char *) &msg[1]);
314  if (NULL != tc_h->add_address_cb)
315  {
316  LOG (GNUNET_ERROR_TYPE_DEBUG, "calling communicator_available()\n");
317  tc_h->add_address_cb (tc_h->cb_cls,
318  tc_h,
319  tc_h->c_address,
320  GNUNET_TIME_relative_ntoh (msg->expiration),
321  msg->aid,
322  ntohl (msg->nt));
323  }
325 }
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...
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
GNUNET_TRANSPORT_TESTING_AddAddressCallback add_address_cb
Callback called when a new communicator connects.
struct GNUNET_TIME_Relative GNUNET_TIME_relative_ntoh(struct GNUNET_TIME_RelativeNBO a)
Convert relative time from network byte order.
Definition: time.c:641
static unsigned int size
Size of the "table".
Definition: peer.c:67
struct GNUNET_SERVICE_Client * client
Handle to the client.
void GNUNET_SERVICE_client_continue(struct GNUNET_SERVICE_Client *c)
Continue receiving further messages from the given client.
Definition: service.c:2243
#define LOG(kind,...)
char * c_address
Specifies supported addresses.
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 336 of file transport-testing2.c.

References GNUNET_MQ_check_boxed_message, and GNUNET_OK.

338 {
339  // struct TransportClient *tc = cls;
340 
341  // if (CT_COMMUNICATOR != tc->type)
342  // {
343  // GNUNET_break (0);
344  // return GNUNET_SYSERR;
345  // }
347  return GNUNET_OK;
348 }
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:75
#define GNUNET_MQ_check_boxed_message(m)
Insert code for a "check_" function that verifies that a given variable-length message received over ...

◆ handle_incoming_msg()

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

Receive an incoming message.

Pass the message to the client.

Parameters
clsClosure - communicator handle
msgMessage

Definition at line 360 of file transport-testing2.c.

References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cb_cls, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::client, GNUNET_ERROR_TYPE_WARNING, GNUNET_SERVICE_client_continue(), GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::incoming_msg_cb, and LOG.

362 {
364 
365  if (NULL != tc_h->incoming_msg_cb)
366  {
367  tc_h->incoming_msg_cb (tc_h->cb_cls,
368  tc_h,
369  (const struct GNUNET_MessageHeader *) msg);
370  }
371  else
372  {
374  "Incoming message from communicator but no handler!\n");
375  }
377 }
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
GNUNET_TRANSPORT_TESTING_IncomingMessageCallback incoming_msg_cb
Callback called when a new communicator connects.
Header for all communications.
struct GNUNET_SERVICE_Client * client
Handle to the client.
void GNUNET_SERVICE_client_continue(struct GNUNET_SERVICE_Client *c)
Continue receiving further messages from the given client.
Definition: service.c:2243
#define LOG(kind,...)
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 387 of file transport-testing2.c.

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

389 {
391 
392  if (NULL != tc_h->queue_create_reply_cb)
393  {
394  tc_h->queue_create_reply_cb (tc_h->cb_cls, tc_h, GNUNET_YES);
395  }
397 }
#define GNUNET_YES
Definition: gnunet_common.h:77
GNUNET_TRANSPORT_TESTING_QueueCreateReplyCallback queue_create_reply_cb
Callback called when a new communicator connects.
struct GNUNET_SERVICE_Client * client
Handle to the client.
void GNUNET_SERVICE_client_continue(struct GNUNET_SERVICE_Client *c)
Continue receiving further messages from the given client.
Definition: service.c:2243
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 wont 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 410 of file transport-testing2.c.

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

413 {
415 
416  if (NULL != tc_h->queue_create_reply_cb)
417  {
418  tc_h->queue_create_reply_cb (tc_h->cb_cls, tc_h, GNUNET_NO);
419  }
421 }
#define GNUNET_NO
Definition: gnunet_common.h:78
GNUNET_TRANSPORT_TESTING_QueueCreateReplyCallback queue_create_reply_cb
Callback called when a new communicator connects.
struct GNUNET_SERVICE_Client * client
Handle to the client.
void GNUNET_SERVICE_client_continue(struct GNUNET_SERVICE_Client *c)
Continue receiving further messages from the given client.
Definition: service.c:2243
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 431 of file transport-testing2.c.

References GNUNET_MQ_check_zero_termination, and GNUNET_OK.

433 {
435  return GNUNET_OK;
436 }
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:75
#define GNUNET_MQ_check_zero_termination(m)
Insert code for a "check_" function that verifies that a given variable-length message received over ...

◆ 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 448 of file transport-testing2.c.

References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::add_queue_cb, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cb_cls, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::client, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::cs, GNUNET_assert, GNUNET_memcmp, GNUNET_SERVICE_client_continue(), 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::qid, and GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::queue_head.

450 {
453 
454  tc_queue = tc_h->queue_head;
455  while (tc_queue->qid != msg->qid)
456  {
457  tc_queue = tc_queue->next;
458  }
459  GNUNET_assert (tc_queue->qid == msg->qid);
460  GNUNET_assert (0 == GNUNET_memcmp (&tc_queue->peer_id, &msg->receiver));
461  tc_queue->nt = msg->nt;
462  tc_queue->mtu = msg->mtu;
463  tc_queue->cs = msg->cs;
464  if (NULL != tc_h->add_queue_cb)
465  {
466  tc_h->add_queue_cb (tc_h->cb_cls, tc_h, tc_queue);
467  }
469 }
struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue * next
Next element inside a DLL.
struct GNUNET_PeerIdentity peer_id
Peer ID of the peer on the other side of the queue.
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
uint32_t cs
An enum GNUNET_TRANSPORT_ConnectionStatus in NBO.
uint32_t nt
An enum GNUNET_NetworkType in NBO.
#define GNUNET_memcmp(a, b)
Compare memory in a and b, where both must be of the same pointer type.
uint32_t mtu
Maximum transmission unit, in NBO.
GNUNET_TRANSPORT_TESTING_AddQueueCallback add_queue_cb
Callback called when a new communicator connects.
struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue * queue_head
Head of the DLL of queues associated with this communicator.
struct GNUNET_SERVICE_Client * client
Handle to the client.
void GNUNET_SERVICE_client_continue(struct GNUNET_SERVICE_Client *c)
Continue receiving further messages from the given client.
Definition: service.c:2243
Queue of a communicator and some context.
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 478 of file transport-testing2.c.

References GNUNET_SERVICE_stop(), and h.

Referenced by transport_communicator_start().

479 {
480  struct GNUNET_SERVICE_Handle *h = cls;
481 
483 }
Handle to a service.
Definition: service.c:116
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:1911
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 496 of file transport-testing2.c.

References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_mq, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::client, GNUNET_ERROR_TYPE_DEBUG, GNUNET_MQ_send(), LOG, mq, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::open_queue_env, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::queue_head, and GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::tc_h.

Referenced by transport_communicator_start().

499 {
502 
503  LOG (GNUNET_ERROR_TYPE_DEBUG, "Client connected.\n");
504  tc_h->client = client;
505  tc_h->c_mq = mq;
506 
507  if (NULL == tc_h->queue_head)
508  return tc_h;
509  /* Iterate over queues. They are yet to be opened. Request opening. */
510  while (NULL != (tc_queue_iter = tc_h->queue_head))
511  {
512  if (NULL == tc_queue_iter->open_queue_env)
513  continue;
514  /* Send the previously created mq envelope to request the creation of the
515  * queue. */
516  GNUNET_MQ_send (tc_h->c_mq, tc_queue_iter->open_queue_env);
517  tc_queue_iter->open_queue_env = NULL;
518  }
519  return tc_h;
520 }
struct GNUNET_MQ_Handle * c_mq
Handle to the client.
struct GNUNET_MQ_Handle * mq
Definition: 003.c:5
struct GNUNET_MQ_Envelope * open_queue_env
Envelope to a message that requests the opening of the queue.
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:353
struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue * queue_head
Head of the DLL of queues associated with this communicator.
struct GNUNET_SERVICE_Client * client
Handle to the client.
#define LOG(kind,...)
struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle * tc_h
Handle to the TransportCommunicator.
Queue of a communicator and some context.
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 531 of file transport-testing2.c.

References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::client, GNUNET_ERROR_TYPE_DEBUG, and LOG.

Referenced by transport_communicator_start().

534 {
536 
537  LOG (GNUNET_ERROR_TYPE_DEBUG, "Client disconnected.\n");
538  tc_h->client = NULL;
539 }
struct GNUNET_SERVICE_Client * client
Handle to the client.
#define LOG(kind,...)
Here is the caller 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 550 of file transport-testing2.c.

References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cfg, connect_cb(), disconnect_cb(), GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_MESSAGE_TYPE_TRANSPORT_ADD_ADDRESS, 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_MQ_hd_fixed_size, GNUNET_MQ_hd_var_size, GNUNET_SCHEDULER_add_shutdown(), GNUNET_SERVICE_start(), h, LOG, and shutdown_service().

Referenced by GNUNET_TRANSPORT_TESTING_transport_communicator_service_start().

552 {
553  struct GNUNET_MQ_MessageHandler mh[] = {
554  GNUNET_MQ_hd_var_size (communicator_available,
556  struct GNUNET_TRANSPORT_CommunicatorAvailableMessage,
557  &tc_h),
558  // GNUNET_MQ_hd_var_size (communicator_backchannel,
559  // GNUNET_MESSAGE_TYPE_TRANSPORT_COMMUNICATOR_BACKCHANNEL,
560  // struct GNUNET_TRANSPORT_CommunicatorBackchannel,
561  // NULL),
562  GNUNET_MQ_hd_var_size (add_address,
564  struct GNUNET_TRANSPORT_AddAddressMessage,
565  &tc_h),
566  // GNUNET_MQ_hd_fixed_size (del_address,
567  // GNUNET_MESSAGE_TYPE_TRANSPORT_DEL_ADDRESS,
568  // struct GNUNET_TRANSPORT_DelAddressMessage,
569  // NULL),
570  GNUNET_MQ_hd_var_size (incoming_msg,
572  struct GNUNET_TRANSPORT_IncomingMessage,
573  NULL),
574  GNUNET_MQ_hd_fixed_size (queue_create_ok,
576  struct GNUNET_TRANSPORT_CreateQueueResponse,
577  tc_h),
578  GNUNET_MQ_hd_fixed_size (queue_create_fail,
580  struct GNUNET_TRANSPORT_CreateQueueResponse,
581  tc_h),
582  GNUNET_MQ_hd_var_size (add_queue_message,
584  struct GNUNET_TRANSPORT_AddQueueMessage,
585  NULL),
586  // GNUNET_MQ_hd_fixed_size (del_queue_message,
587  // GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_TEARDOWN,
588  // struct GNUNET_TRANSPORT_DelQueueMessage,
589  // NULL),
590  // GNUNET_MQ_hd_fixed_size (send_message_ack,
591  // GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_MSG_ACK,
592  // struct GNUNET_TRANSPORT_SendMessageToAck,
593  // NULL),
594  };
595  struct GNUNET_SERVICE_Handle *h;
596 
597  h = GNUNET_SERVICE_start ("transport",
598  tc_h->cfg,
599  &connect_cb,
600  &disconnect_cb,
601  tc_h,
602  mh);
603  if (NULL == h)
604  LOG (GNUNET_ERROR_TYPE_ERROR, "Failed starting service!\n");
605  else
606  {
607  LOG (GNUNET_ERROR_TYPE_DEBUG, "Started service\n");
609  }
610 }
Handle to a service.
Definition: service.c:116
#define GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE_OK
Response from communicator: will try to create queue.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_shutdown(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run on shutdown, that is when a CTRL-C signal is received, or when GNUNET_SCHEDULER_shutdown() is being invoked.
Definition: scheduler.c:1300
static struct GNUNET_CADET_Handle * mh
Cadet handle.
Definition: gnunet-cadet.c:92
#define GNUNET_MQ_hd_fixed_size(name, code, str, ctx)
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:1878
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:99
#define GNUNET_MESSAGE_TYPE_TRANSPORT_INCOMING_MSG
inform transport about an incoming message
#define GNUNET_MQ_hd_var_size(name, code, str, ctx)
#define GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_SETUP
inform transport that a queue was setup to talk to some peer
Message handler for a specific message type.
struct GNUNET_CONFIGURATION_Handle * cfg
Handle to the configuration.
#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.
static void disconnect_cb(void *cls, struct GNUNET_SERVICE_Client *client, void *internal_cls)
Callback called when Client disconnects.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_ADD_ADDRESS
inform transport to add an address of this peer
static void shutdown_service(void *cls)
Shut down the service.
#define LOG(kind,...)
static void * connect_cb(void *cls, struct GNUNET_SERVICE_Client *client, struct GNUNET_MQ_Handle *mq)
Callback called when new Client (Communicator) connects.
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 communicator and clean up.

Parameters
clsClosure - Process of communicator

Definition at line 619 of file transport-testing2.c.

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

Referenced by communicator_start().

620 {
621  struct GNUNET_OS_Process *proc = cls;
622 
623  if (GNUNET_OK != GNUNET_OS_process_kill (proc, SIGTERM))
624  {
626  "Error shutting down communicator with SIGERM, trying SIGKILL\n");
627  if (GNUNET_OK != GNUNET_OS_process_kill (proc, SIGKILL))
628  {
630  "Error shutting down communicator with SIGERM and SIGKILL\n");
631  }
632  }
634 }
void GNUNET_OS_process_destroy(struct GNUNET_OS_Process *proc)
Cleans up process structure contents (OS-dependent) and deallocates it.
Definition: os_priority.c:287
#define GNUNET_OK
Named constants for return values.
Definition: gnunet_common.h:75
#define LOG(kind,...)
int GNUNET_OS_process_kill(struct GNUNET_OS_Process *proc, int sig)
Sends a signal to the process.
Definition: os_priority.c:225
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 643 of file transport-testing2.c.

References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_proc, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cfg_filename, GNUNET_ERROR_TYPE_DEBUG, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_log, GNUNET_OS_get_libexec_binary_path(), GNUNET_OS_INHERIT_STD_OUT_AND_ERR, GNUNET_OS_start_process(), GNUNET_SCHEDULER_add_shutdown(), GNUNET_YES, LOG, and shutdown_communicator().

Referenced by GNUNET_TRANSPORT_TESTING_transport_communicator_service_start().

646 {
647  char *binary;
648 
649  LOG (GNUNET_ERROR_TYPE_DEBUG, "communicator_start\n");
650  binary = GNUNET_OS_get_libexec_binary_path (binary_name);
653  NULL,
654  NULL,
655  NULL,
656  binary,
657  binary_name,
658  "-c",
659  tc_h->cfg_filename,
660  NULL);
661  if (NULL == tc_h->c_proc)
662  {
663  GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to start communicator!");
664  return;
665  }
666  LOG (GNUNET_ERROR_TYPE_DEBUG, "started communicator\n");
667  GNUNET_free (binary);
669  tc_h->c_proc);
670 }
char * cfg_filename
File name of configuration file.
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_shutdown(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run on shutdown, that is when a CTRL-C signal is received, or when GNUNET_SCHEDULER_shutdown() is being invoked.
Definition: scheduler.c:1300
static void shutdown_communicator(void *cls)
Task run at shutdown to kill communicator and clean up.
struct GNUNET_OS_Process * GNUNET_OS_start_process(int pipe_control, 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:687
When these flags are set, the child process will inherit stdout and stderr of the parent...
Definition: gnunet_os_lib.h:97
#define GNUNET_log(kind,...)
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 * c_proc
Process of the communicator.
#define GNUNET_YES
Definition: gnunet_common.h:77
#define LOG(kind,...)
#define GNUNET_free(ptr)
Wrapper around free.
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,
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,
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 686 of file transport-testing2.c.

References _, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::add_address_cb, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::add_queue_cb, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cb_cls, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cfg, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::cfg_filename, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::communicator_available_cb, communicator_start(), GNUNET_CONFIGURATION_create(), GNUNET_CONFIGURATION_destroy(), GNUNET_CONFIGURATION_load(), GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_log, GNUNET_new, GNUNET_strdup, GNUNET_SYSERR, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::incoming_msg_cb, GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::queue_create_reply_cb, and transport_communicator_start().

697 {
699 
700  tc_h =
703  tc_h->cfg = GNUNET_CONFIGURATION_create ();
705  {
707  _ ("Malformed configuration file `%s', exit ...\n"),
708  cfg_filename);
709  GNUNET_free (tc_h->cfg_filename);
711  GNUNET_free (tc_h);
712  return NULL;
713  }
717  tc_h->add_queue_cb = add_queue_cb;
718  tc_h->incoming_msg_cb = incoming_message_cb;
719  tc_h->cb_cls = cb_cls;
720 
721  /* Start communicator part of service */
723 
724  /* Schedule start communicator */
725  communicator_start (tc_h,
726  binary_name);
727  return tc_h;
728 }
static char * cfg_filename
Name of the configuration file.
char * cfg_filename
File name of configuration file.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
struct GNUNET_CONFIGURATION_Handle * GNUNET_CONFIGURATION_create(void)
Create a new configuration object.
#define GNUNET_strdup(a)
Wrapper around GNUNET_xstrdup_.
GNUNET_TRANSPORT_TESTING_CommunicatorAvailableCallback communicator_available_cb
Callback called when a new communicator connects.
int GNUNET_CONFIGURATION_load(struct GNUNET_CONFIGURATION_Handle *cfg, const char *filename)
Load configuration.
#define _(String)
GNU gettext support macro.
Definition: platform.h:181
void GNUNET_CONFIGURATION_destroy(struct GNUNET_CONFIGURATION_Handle *cfg)
Destroy configuration object.
GNUNET_TRANSPORT_TESTING_AddAddressCallback add_address_cb
Callback called when a new communicator connects.
struct GNUNET_CONFIGURATION_Handle * cfg
Handle to the configuration.
#define GNUNET_SYSERR
Definition: gnunet_common.h:76
GNUNET_TRANSPORT_TESTING_IncomingMessageCallback incoming_msg_cb
Callback called when a new communicator connects.
static void communicator_start(struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, const char *binary_name)
Start the communicator.
#define GNUNET_log(kind,...)
GNUNET_TRANSPORT_TESTING_AddQueueCallback add_queue_cb
Callback called when a new communicator connects.
GNUNET_TRANSPORT_TESTING_QueueCreateReplyCallback queue_create_reply_cb
Callback called when a new communicator connects.
static void transport_communicator_start(struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h)
Start the communicator part of the transport service.
#define GNUNET_free(ptr)
Wrapper around free.
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 739 of file transport-testing2.c.

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

743 {
745  static uint32_t idgen;
746  char *prefix;
747  struct GNUNET_TRANSPORT_CreateQueue *msg;
748  struct GNUNET_MQ_Envelope *env;
749  size_t alen;
750 
751  tc_queue =
753  tc_queue->tc_h = tc_h;
755  if (NULL == prefix)
756  {
757  GNUNET_break (0); /* We got an invalid address!? */
758  GNUNET_free (tc_queue);
759  return;
760  }
761  GNUNET_free (prefix);
762  alen = strlen (address) + 1;
763  env =
765  msg->request_id = htonl (idgen++);
766  tc_queue->qid = msg->request_id;
767  msg->receiver = *peer_id;
768  tc_queue->peer_id = *peer_id;
769  memcpy (&msg[1], address, alen);
770  if (NULL != tc_h->c_mq)
771  {
772  GNUNET_MQ_send (tc_h->c_mq, env);
773  }
774  else
775  {
776  tc_queue->open_queue_env = env;
777  }
778  GNUNET_CONTAINER_DLL_insert (tc_h->queue_head, tc_h->queue_tail, tc_queue);
779 }
struct GNUNET_PeerIdentity peer_id
Peer ID of the peer on the other side of the queue.
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
#define GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE
transport tells communicator it wants a queue
#define GNUNET_CONTAINER_DLL_insert(head, tail, element)
Insert an element at the head of a DLL.
static char * peer_id
Option –peer.
Definition: gnunet-cadet.c:42
struct GNUNET_MQ_Handle * c_mq
Handle to the client.
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
#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:52
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:191
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue * queue_tail
Tail of the DLL of queues associated with this communicator.
struct GNUNET_MQ_Envelope * open_queue_env
Envelope to a message that requests the opening of the queue.
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:353
struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue * queue_head
Head of the DLL of queues associated with this communicator.
static char * address
GNS address for this phone.
struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle * tc_h
Handle to the TransportCommunicator.
#define GNUNET_free(ptr)
Wrapper around free.
Queue of a communicator and some context.
Here is the call graph for this function:

◆ GNUNET_TRANSPORT_TESTING_transport_communicator_send()

struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorTransmission* GNUNET_TRANSPORT_TESTING_transport_communicator_send ( struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue tc_queue,
const void *  payload,
size_t  payload_size 
)

Instruct communicator to send data.

Parameters
tc_queueThe queue to use for sending
payloadData to send
payload_sizeSize of the payload
Returns
Handle to the transmission

Definition at line 793 of file transport-testing2.c.

References GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle::c_mq, env, GNUNET_free, GNUNET_malloc, GNUNET_MESSAGE_TYPE_DUMMY, GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_MSG, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), mh, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::mid, msg, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::peer_id, GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::qid, and GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue::tc_h.

Referenced by GNUNET_TRANSPORT_TESTING_transport_communicator_open_queue().

798 {
800  struct GNUNET_MessageHeader *mh;
801  struct GNUNET_TRANSPORT_SendMessageTo *msg;
802  struct GNUNET_MQ_Envelope *env;
803  size_t inbox_size;
804 
805  inbox_size = sizeof(struct GNUNET_MessageHeader) + payload_size;
806  mh = GNUNET_malloc (inbox_size);
807  mh->size = htons (inbox_size);
808  mh->type = GNUNET_MESSAGE_TYPE_DUMMY;
809  memcpy (&mh[1],
810  payload,
811  payload_size);
812  env = GNUNET_MQ_msg_extra (msg,
813  inbox_size,
815  msg->qid = htonl (tc_queue->qid);
816  msg->mid = tc_queue->mid++;
817  msg->receiver = tc_queue->peer_id;
818  memcpy (&msg[1], mh, inbox_size);
819  GNUNET_free (mh);
820  GNUNET_MQ_send (tc_queue->tc_h->c_mq, env);
821  return tc_t;
822 }
struct GNUNET_PeerIdentity peer_id
Peer ID of the peer on the other side of the queue.
#define GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_MSG
transport tells communicator it wants to transmit
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
static struct GNUNET_CADET_Handle * mh
Cadet handle.
Definition: gnunet-cadet.c:92
#define GNUNET_MESSAGE_TYPE_DUMMY
Dummy messages for testing / benchmarking.
struct GNUNET_MQ_Handle * c_mq
Handle to the client.
#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:52
struct GNUNET_MQ_Envelope * env
Definition: 005.c:1
static unsigned long long payload
How much data are we currently storing in the database?
Header for all communications.
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:353
#define GNUNET_malloc(size)
Wrapper around malloc.
struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle * tc_h
Handle to the TransportCommunicator.
#define GNUNET_free(ptr)
Wrapper around free.
Here is the call graph for this function:
Here is the caller graph for this function: