aboutsummaryrefslogtreecommitdiff
path: root/src/transport/test_communicator_unix.c
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2019-06-06 12:30:11 +0200
committerJulius Bünger <buenger@mytum.de>2019-06-06 12:31:15 +0200
commit2cc12edbeaaab5ad8181cf84f76035183114b492 (patch)
tree55807aa44d36fccb83a536590fe43b2bacca7436 /src/transport/test_communicator_unix.c
parent94eb76c41311d00f2a44c103e0c4536343b3a4c8 (diff)
downloadgnunet-2cc12edbeaaab5ad8181cf84f76035183114b492.tar.gz
gnunet-2cc12edbeaaab5ad8181cf84f76035183114b492.zip
TNG testing: Improve comments and logging
Diffstat (limited to 'src/transport/test_communicator_unix.c')
-rw-r--r--src/transport/test_communicator_unix.c55
1 files changed, 50 insertions, 5 deletions
diff --git a/src/transport/test_communicator_unix.c b/src/transport/test_communicator_unix.c
index 459af116a..0fdbe4b99 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",