aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSchanzenbach, Martin <mschanzenbach@posteo.de>2019-06-07 16:47:58 +0200
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2019-06-07 16:47:58 +0200
commit02438237bf09dfd6dd95e130025c8431f0596bae (patch)
tree72a29c898d749013744ac63611edd808b2ff66fb
parent4c1ef8149081635778c52c0be9ca49aadaea137c (diff)
parent1a0c0c0d17662b39b8c736d80edbf486a00348eb (diff)
downloadgnunet-02438237bf09dfd6dd95e130025c8431f0596bae.tar.gz
gnunet-02438237bf09dfd6dd95e130025c8431f0596bae.zip
Merge branch 'master' of git+ssh://gnunet.org/gnunet
-rw-r--r--src/transport/test_communicator_unix.c56
-rw-r--r--src/transport/transport-testing2.c137
-rw-r--r--src/transport/transport-testing2.h87
3 files changed, 259 insertions, 21 deletions
diff --git a/src/transport/test_communicator_unix.c b/src/transport/test_communicator_unix.c
index 459af116a..fed15b236 100644
--- a/src/transport/test_communicator_unix.c
+++ b/src/transport/test_communicator_unix.c
@@ -85,20 +85,42 @@ add_address_cb (void *cls,
85} 85}
86 86
87 87
88/**
89 * @brief Callback that informs whether the requested queue will be
90 * established
91 *
92 * Implements #GNUNET_TRANSPORT_TESTING_QueueCreateReplyCallback.
93 *
94 * @param cls Closure - unused
95 * @param tc_h Communicator handle - unused
96 * @param will_try #GNUNET_YES if queue will be established
97 * #GNUNET_NO if queue will not be established (bogous address)
98 */
88static void 99static void
89queue_create_reply_cb (void *cls, 100queue_create_reply_cb (void *cls,
90 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, 101 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h,
91 int success) 102 int will_try)
92{ 103{
93 if (GNUNET_YES == success) 104 if (GNUNET_YES == will_try)
94 LOG (GNUNET_ERROR_TYPE_DEBUG, 105 LOG (GNUNET_ERROR_TYPE_DEBUG,
95 "Got Queue!\n"); 106 "Queue will be established!\n");
96 else 107 else
97 LOG (GNUNET_ERROR_TYPE_DEBUG, 108 LOG (GNUNET_ERROR_TYPE_WARNING,
98 "Failed getting queue!\n"); 109 "Queue won't be established (bougus address?)!\n");
99} 110}
100 111
101 112
113/**
114 * @brief Handle opening of queue
115 *
116 * Issues sending of test data
117 *
118 * Implements #GNUNET_TRANSPORT_TESTING_AddQueueCallback
119 *
120 * @param cls Closure
121 * @param tc_h Communicator handle
122 * @param tc_queue Handle to newly opened queue
123 */
102static void 124static void
103add_queue_cb (void *cls, 125add_queue_cb (void *cls,
104 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, 126 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h,
@@ -112,6 +134,28 @@ add_queue_cb (void *cls,
112} 134}
113 135
114 136
137/**
138 * @brief Handle an incoming message
139 *
140 * Implements #GNUNET_TRANSPORT_TESTING_IncomingMessageCallback
141
142 * @param cls Closure
143 * @param tc_h Handle to the receiving communicator
144 * @param msg Received message
145 */
146void
147incoming_message_cb (void *cls,
148 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h,
149 const struct GNUNET_MessageHeader *msg)
150{
151}
152
153
154/**
155 * @brief Main function called by the scheduler
156 *
157 * @param cls Closure - Handle to configuration
158 */
115static void 159static void
116run (void *cls) 160run (void *cls)
117{ 161{
@@ -125,6 +169,7 @@ run (void *cls)
125 NULL, 169 NULL,
126 &queue_create_reply_cb, 170 &queue_create_reply_cb,
127 &add_queue_cb, 171 &add_queue_cb,
172 NULL,
128 NULL); /* cls */ 173 NULL); /* cls */
129 tc_hs[1] = GNUNET_TRANSPORT_TESTING_transport_communicator_service_start ( 174 tc_hs[1] = GNUNET_TRANSPORT_TESTING_transport_communicator_service_start (
130 "transport", 175 "transport",
@@ -134,6 +179,7 @@ run (void *cls)
134 &add_address_cb, 179 &add_address_cb,
135 NULL, 180 NULL,
136 &add_queue_cb, 181 &add_queue_cb,
182 NULL,
137 NULL); /* cls */ 183 NULL); /* cls */
138} 184}
139 185
diff --git a/src/transport/transport-testing2.c b/src/transport/transport-testing2.c
index ff8e15719..ae5a65f2a 100644
--- a/src/transport/transport-testing2.c
+++ b/src/transport/transport-testing2.c
@@ -38,6 +38,9 @@
38#define LOG(kind, ...) GNUNET_log_from (kind, "transport-testing2", __VA_ARGS__) 38#define LOG(kind, ...) GNUNET_log_from (kind, "transport-testing2", __VA_ARGS__)
39 39
40 40
41/**
42 * @brief Handle to a transport communicator
43 */
41struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle 44struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle
42{ 45{
43 /** 46 /**
@@ -97,12 +100,12 @@ struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle
97 char *c_address; 100 char *c_address;
98 101
99 /** 102 /**
100 * @brief Head of the queues 103 * @brief Head of the DLL of queues associated with this communicator
101 */ 104 */
102 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue *queue_head; 105 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue *queue_head;
103 106
104 /** 107 /**
105 * @brief Tail of the queues 108 * @brief Tail of the DLL of queues associated with this communicator
106 */ 109 */
107 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue *queue_tail; 110 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue *queue_tail;
108 111
@@ -129,12 +132,20 @@ struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle
129 GNUNET_TRANSPORT_TESTING_AddQueueCallback add_queue_cb; 132 GNUNET_TRANSPORT_TESTING_AddQueueCallback add_queue_cb;
130 133
131 /** 134 /**
135 * @brief Callback called when a new communicator connects
136 */
137 GNUNET_TRANSPORT_TESTING_IncomingMessageCallback incoming_msg_cb;
138
139 /**
132 * @brief Closure to the callback 140 * @brief Closure to the callback
133 */ 141 */
134 void *cb_cls; 142 void *cb_cls;
135}; 143};
136 144
137 145
146/**
147 * @brief Queue of a communicator and some context
148 */
138struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue 149struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue
139{ 150{
140 /** 151 /**
@@ -143,7 +154,11 @@ struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue
143 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h; 154 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h;
144 155
145 /** 156 /**
146 * @brief Task to request the opening of a view 157 * @brief Envelope to a message that requests the opening of the queue.
158 *
159 * If the client already requests queue(s), but the communicator is not yet
160 * connected, we cannot send the request to open the queue. Save it until the
161 * communicator becomes available and send it then.
147 */ 162 */
148 struct GNUNET_MQ_Envelope *open_queue_env; 163 struct GNUNET_MQ_Envelope *open_queue_env;
149 164
@@ -189,6 +204,9 @@ struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue
189}; 204};
190 205
191 206
207/**
208 * @brief Handle/Context to a single transmission
209 */
192struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorTransmission 210struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorTransmission
193{ 211{
194}; 212};
@@ -221,7 +239,9 @@ check_communicator_available (
221/** 239/**
222 * @brief Handle new communicator 240 * @brief Handle new communicator
223 * 241 *
224 * @param cls Closure 242 * Store characteristics of communicator, call respective client callback.
243 *
244 * @param cls Closure - communicator handle
225 * @param msg Message struct 245 * @param msg Message struct
226 */ 246 */
227static void 247static void
@@ -272,6 +292,14 @@ check_add_address (void *cls,
272} 292}
273 293
274 294
295/**
296 * @brief The communicator informs about an address.
297 *
298 * Store address and call client callback.
299 *
300 * @param cls Closure - communicator handle
301 * @param msg Message
302 */
275static void 303static void
276handle_add_address (void *cls, 304handle_add_address (void *cls,
277 const struct GNUNET_TRANSPORT_AddAddressMessage *msg) 305 const struct GNUNET_TRANSPORT_AddAddressMessage *msg)
@@ -297,6 +325,63 @@ handle_add_address (void *cls,
297} 325}
298 326
299 327
328/**
329 * Incoming message. Test message is well-formed.
330 *
331 * @param cls the client
332 * @param msg the send message that was sent
333 * @return #GNUNET_OK if message is well-formed
334 */
335static int
336check_incoming_msg (void *cls,
337 const struct GNUNET_TRANSPORT_IncomingMessage *msg)
338{
339 //struct TransportClient *tc = cls;
340
341 //if (CT_COMMUNICATOR != tc->type)
342 //{
343 // GNUNET_break (0);
344 // return GNUNET_SYSERR;
345 //}
346 GNUNET_MQ_check_boxed_message (msg);
347 return GNUNET_OK;
348}
349
350
351/**
352 * @brief Receive an incoming message.
353 *
354 * Pass the message to the client.
355 *
356 * @param cls Closure - communicator handle
357 * @param msg Message
358 */
359static void
360handle_incoming_msg (void *cls,
361 const struct GNUNET_TRANSPORT_IncomingMessage *msg)
362{
363 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h = cls;
364
365 if (NULL != tc_h->incoming_msg_cb) {
366 tc_h->incoming_msg_cb (tc_h->cb_cls,
367 tc_h,
368 (const struct GNUNET_MessageHeader *) msg);
369 }
370 else
371 {
372 LOG (GNUNET_ERROR_TYPE_WARNING,
373 "Incoming message from communicator but no handler!\n");
374 }
375 GNUNET_SERVICE_client_continue (tc_h->client);
376}
377
378
379/**
380 * @brief Communicator informs that it tries to establish requested queue
381 *
382 * @param cls Closure - communicator handle
383 * @param msg Message
384 */
300static void 385static void
301handle_queue_create_ok (void *cls, 386handle_queue_create_ok (void *cls,
302 const struct GNUNET_TRANSPORT_CreateQueueResponse *msg) 387 const struct GNUNET_TRANSPORT_CreateQueueResponse *msg)
@@ -311,6 +396,15 @@ handle_queue_create_ok (void *cls,
311} 396}
312 397
313 398
399/**
400 * @brief Communicator informs that it wont try establishing requested queue.
401 *
402 * It will not do so probably because the address is bougus (see comment to
403 * #GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE_FAIL)
404 *
405 * @param cls Closure - communicator handle
406 * @param msg Message
407 */
314static void 408static void
315handle_queue_create_fail ( 409handle_queue_create_fail (
316 void *cls, 410 void *cls,
@@ -342,9 +436,11 @@ check_add_queue_message (void *cls,
342 436
343 437
344/** 438/**
345 * @brief Handle new communicator 439 * @brief Handle new queue
346 * 440 *
347 * @param cls Closure 441 * Store context and call client callback.
442 *
443 * @param cls Closure - communicator handle
348 * @param msg Message struct 444 * @param msg Message struct
349 */ 445 */
350static void 446static void
@@ -409,10 +505,13 @@ connect_cb (void *cls,
409 505
410 if (NULL == tc_h->queue_head) 506 if (NULL == tc_h->queue_head)
411 return tc_h; 507 return tc_h;
508 /* Iterate over queues. They are yet to be opened. Request opening. */
412 while (NULL != (tc_queue_iter = tc_h->queue_head)) 509 while (NULL != (tc_queue_iter = tc_h->queue_head))
413 { 510 {
414 if (NULL == tc_queue_iter->open_queue_env) 511 if (NULL == tc_queue_iter->open_queue_env)
415 continue; 512 continue;
513 /* Send the previously created mq envelope to request the creation of the
514 * queue. */
416 GNUNET_MQ_send (tc_h->c_mq, tc_queue_iter->open_queue_env); 515 GNUNET_MQ_send (tc_h->c_mq, tc_queue_iter->open_queue_env);
417 tc_queue_iter->open_queue_env = NULL; 516 tc_queue_iter->open_queue_env = NULL;
418 } 517 }
@@ -467,10 +566,10 @@ transport_communicator_start (
467 // GNUNET_MESSAGE_TYPE_TRANSPORT_DEL_ADDRESS, 566 // GNUNET_MESSAGE_TYPE_TRANSPORT_DEL_ADDRESS,
468 // struct GNUNET_TRANSPORT_DelAddressMessage, 567 // struct GNUNET_TRANSPORT_DelAddressMessage,
469 // NULL), 568 // NULL),
470 //GNUNET_MQ_hd_var_size (incoming_msg, 569 GNUNET_MQ_hd_var_size (incoming_msg,
471 // GNUNET_MESSAGE_TYPE_TRANSPORT_INCOMING_MSG, 570 GNUNET_MESSAGE_TYPE_TRANSPORT_INCOMING_MSG,
472 // struct GNUNET_TRANSPORT_IncomingMessage, 571 struct GNUNET_TRANSPORT_IncomingMessage,
473 // NULL), 572 NULL),
474 GNUNET_MQ_hd_fixed_size (queue_create_ok, 573 GNUNET_MQ_hd_fixed_size (queue_create_ok,
475 GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE_OK, 574 GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE_OK,
476 struct GNUNET_TRANSPORT_CreateQueueResponse, 575 struct GNUNET_TRANSPORT_CreateQueueResponse,
@@ -592,6 +691,7 @@ GNUNET_TRANSPORT_TESTING_transport_communicator_service_start (
592 GNUNET_TRANSPORT_TESTING_AddAddressCallback add_address_cb, 691 GNUNET_TRANSPORT_TESTING_AddAddressCallback add_address_cb,
593 GNUNET_TRANSPORT_TESTING_QueueCreateReplyCallback queue_create_reply_cb, 692 GNUNET_TRANSPORT_TESTING_QueueCreateReplyCallback queue_create_reply_cb,
594 GNUNET_TRANSPORT_TESTING_AddQueueCallback add_queue_cb, 693 GNUNET_TRANSPORT_TESTING_AddQueueCallback add_queue_cb,
694 GNUNET_TRANSPORT_TESTING_IncomingMessageCallback incoming_message_cb,
595 void *cb_cls) 695 void *cb_cls)
596{ 696{
597 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h; 697 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h;
@@ -614,6 +714,7 @@ GNUNET_TRANSPORT_TESTING_transport_communicator_service_start (
614 tc_h->add_address_cb = add_address_cb; 714 tc_h->add_address_cb = add_address_cb;
615 tc_h->queue_create_reply_cb = queue_create_reply_cb; 715 tc_h->queue_create_reply_cb = queue_create_reply_cb;
616 tc_h->add_queue_cb = add_queue_cb; 716 tc_h->add_queue_cb = add_queue_cb;
717 tc_h->incoming_msg_cb = incoming_message_cb;
617 tc_h->cb_cls = cb_cls; 718 tc_h->cb_cls = cb_cls;
618 719
619 /* Start communicator part of service */ 720 /* Start communicator part of service */
@@ -626,6 +727,13 @@ GNUNET_TRANSPORT_TESTING_transport_communicator_service_start (
626} 727}
627 728
628 729
730/**
731 * @brief Instruct communicator to open a queue
732 *
733 * @param tc_h Handle to communicator which shall open queue
734 * @param peer_id Towards which peer
735 * @param address For which address
736 */
629void 737void
630GNUNET_TRANSPORT_TESTING_transport_communicator_open_queue ( 738GNUNET_TRANSPORT_TESTING_transport_communicator_open_queue (
631 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, 739 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h,
@@ -670,6 +778,15 @@ GNUNET_TRANSPORT_TESTING_transport_communicator_open_queue (
670} 778}
671 779
672 780
781/**
782 * @brief Instruct communicator to send data
783 *
784 * @param tc_queue The queue to use for sending
785 * @param payload Data to send
786 * @param payload_size Size of the payload
787 *
788 * @return Handle to the transmission
789 */
673struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorTransmission * 790struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorTransmission *
674GNUNET_TRANSPORT_TESTING_transport_communicator_send 791GNUNET_TRANSPORT_TESTING_transport_communicator_send
675 (struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue *tc_queue, 792 (struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue *tc_queue,
diff --git a/src/transport/transport-testing2.h b/src/transport/transport-testing2.h
index 83d98baab..fbc1927d9 100644
--- a/src/transport/transport-testing2.h
+++ b/src/transport/transport-testing2.h
@@ -20,7 +20,7 @@
20 20
21/** 21/**
22 * @file transport/transport-testing2.h 22 * @file transport/transport-testing2.h
23 * @brief functions related to testing-tng 23 * @brief functions and structures related to testing-tng
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 * @author Julius Bünger 25 * @author Julius Bünger
26 */ 26 */
@@ -30,17 +30,32 @@
30#include "transport.h" 30#include "transport.h"
31 31
32 32
33/**
34 * @brief Handle to a transport communicator
35 */
33struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle; 36struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle;
34 37
38
39/**
40 * @brief Queue of a communicator and some context
41 */
35struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue; 42struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue;
36 43
44
45/**
46 * @brief Handle/Context to a single transmission
47 */
37struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorTransmission; 48struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorTransmission;
38 49
50
39/** 51/**
40 * @brief Function signature for callbacks that are called when new communicators become available 52 * @brief Function signature for callbacks that are called when new
53 * communicators become available
41 * 54 *
42 * @param Closure 55 * @param cls Closure
43 * @param msg Message 56 * @param tc_h Communicator handle
57 * @param cc Characteristics of communicator
58 * @param address_prefix Prefix of the address
44 */ 59 */
45typedef void 60typedef void
46(*GNUNET_TRANSPORT_TESTING_CommunicatorAvailableCallback)(void *cls, 61(*GNUNET_TRANSPORT_TESTING_CommunicatorAvailableCallback)(void *cls,
@@ -49,6 +64,16 @@ typedef void
49 char *address_prefix); 64 char *address_prefix);
50 65
51 66
67/**
68 * @brief Receive information about the address of a communicator.
69 *
70 * @param cls Closure
71 * @param tc_h Communicator handle
72 * @param address Address represented as string
73 * @param expiration Expiration
74 * @param aid Aid
75 * @param nt Network Type
76 */
52typedef void 77typedef void
53(*GNUNET_TRANSPORT_TESTING_AddAddressCallback)(void *cls, 78(*GNUNET_TRANSPORT_TESTING_AddAddressCallback)(void *cls,
54 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, 79 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h,
@@ -58,12 +83,26 @@ typedef void
58 enum GNUNET_NetworkType nt); 83 enum GNUNET_NetworkType nt);
59 84
60 85
86/**
87 * @brief Get informed about the success of a queue request.
88 *
89 * @param cls Closure
90 * @param tc_h Communicator handle
91 * @param will_try #GNUNET_YES if communicator will try to create queue
92 */
61typedef void 93typedef void
62(*GNUNET_TRANSPORT_TESTING_QueueCreateReplyCallback)(void *cls, 94(*GNUNET_TRANSPORT_TESTING_QueueCreateReplyCallback)(void *cls,
63 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, 95 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h,
64 int will_try); 96 int will_try);
65 97
66 98
99/**
100 * @brief Handle opening of queue
101 *
102 * @param cls Closure
103 * @param tc_h Communicator handle
104 * @param tc_queue Handle to newly opened queue
105 */
67typedef void 106typedef void
68(*GNUNET_TRANSPORT_TESTING_AddQueueCallback)(void *cls, 107(*GNUNET_TRANSPORT_TESTING_AddQueueCallback)(void *cls,
69 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, 108 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h,
@@ -71,33 +110,69 @@ typedef void
71 110
72 111
73/** 112/**
113 * @brief Handle an incoming message
114 *
115 * @param cls Closure
116 * @param tc_h Handle to the receiving communicator
117 * @param msg Received message
118 */
119typedef void
120(*GNUNET_TRANSPORT_TESTING_IncomingMessageCallback)(void *cls,
121 struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h,
122 const struct GNUNET_MessageHeader *msg);
123
124
125/**
74 * @brief Start communicator part of transport service and communicator 126 * @brief Start communicator part of transport service and communicator
75 * 127 *
76 * @param service_name Name of the service 128 * @param service_name Name of the service
77 * @param cfg Configuration handle 129 * @param cfg Configuration handle
78 * @param communicator_available Callback that is called when a new 130 * @param communicator_available Callback that is called when a new
79 * communicator becomes available 131 * communicator becomes available
132 * @param add_address_cb Callback handling new addresses
133 * @param queue_create_reply_cb Callback handling success of queue requests
134 * @param add_queue_cb Callback handling freshly created queues
135 * @param incoming_message_cb Callback handling incoming messages
80 * @param cb_cls Closure to @p communicator_available 136 * @param cb_cls Closure to @p communicator_available
81 * 137 *
82 * @return Handle to the communicator duo 138 * @return Handle to the communicator duo
83 */ 139 */
84struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle * 140struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *
85GNUNET_TRANSPORT_TESTING_transport_communicator_service_start 141GNUNET_TRANSPORT_TESTING_transport_communicator_service_start (
86 (const char *service_name, 142 const char *service_name,
87 const char *binary_name, 143 const char *binary_name,
88 const char *cfg_filename, 144 const char *cfg_filename,
89 GNUNET_TRANSPORT_TESTING_CommunicatorAvailableCallback communicator_available_cb, 145 GNUNET_TRANSPORT_TESTING_CommunicatorAvailableCallback communicator_available_cb,
90 GNUNET_TRANSPORT_TESTING_AddAddressCallback add_address_cb, 146 GNUNET_TRANSPORT_TESTING_AddAddressCallback add_address_cb,
91 GNUNET_TRANSPORT_TESTING_QueueCreateReplyCallback queue_create_reply_cb, 147 GNUNET_TRANSPORT_TESTING_QueueCreateReplyCallback queue_create_reply_cb,
92 GNUNET_TRANSPORT_TESTING_AddQueueCallback add_queue_cb, 148 GNUNET_TRANSPORT_TESTING_AddQueueCallback add_queue_cb,
149 GNUNET_TRANSPORT_TESTING_IncomingMessageCallback incoming_message_cb,
93 void *cb_cls); 150 void *cb_cls);
94 151
152
153/**
154 * @brief Instruct communicator to open a queue
155 *
156 * @param tc_h Handle to communicator which shall open queue
157 * @param peer_id Towards which peer
158 * @param address For which address
159 */
95void 160void
96GNUNET_TRANSPORT_TESTING_transport_communicator_open_queue 161GNUNET_TRANSPORT_TESTING_transport_communicator_open_queue
97 (struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, 162 (struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h,
98 const struct GNUNET_PeerIdentity *peer_id, 163 const struct GNUNET_PeerIdentity *peer_id,
99 const char *address); 164 const char *address);
100 165
166
167/**
168 * @brief Instruct communicator to send data
169 *
170 * @param tc_queue The queue to use for sending
171 * @param payload Data to send
172 * @param payload_size Size of the payload
173 *
174 * @return Handle to the transmission
175 */
101struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorTransmission * 176struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorTransmission *
102GNUNET_TRANSPORT_TESTING_transport_communicator_send 177GNUNET_TRANSPORT_TESTING_transport_communicator_send
103 (struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue *tc_queue, 178 (struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue *tc_queue,