diff options
Diffstat (limited to 'src/nat/nat_test.c')
-rw-r--r-- | src/nat/nat_test.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/nat/nat_test.c b/src/nat/nat_test.c index 32cf6c42c..33f81d800 100644 --- a/src/nat/nat_test.c +++ b/src/nat/nat_test.c | |||
@@ -205,15 +205,15 @@ reversal_cb (void *cls, | |||
205 | * incoming connection. | 205 | * incoming connection. |
206 | * | 206 | * |
207 | * @param cls the `struct GNUNET_NAT_Test` | 207 | * @param cls the `struct GNUNET_NAT_Test` |
208 | * @param tc scheduler context | ||
209 | */ | 208 | */ |
210 | static void | 209 | static void |
211 | do_udp_read (void *cls, | 210 | do_udp_read (void *cls) |
212 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
213 | { | 211 | { |
214 | struct GNUNET_NAT_Test *tst = cls; | 212 | struct GNUNET_NAT_Test *tst = cls; |
215 | uint16_t data; | 213 | uint16_t data; |
214 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
216 | 215 | ||
216 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
217 | tst->ltask = | 217 | tst->ltask = |
218 | GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, | 218 | GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, |
219 | tst->lsock, | 219 | tst->lsock, |
@@ -240,16 +240,16 @@ do_udp_read (void *cls, | |||
240 | * incoming connection. | 240 | * incoming connection. |
241 | * | 241 | * |
242 | * @param cls the `struct NatActivity` | 242 | * @param cls the `struct NatActivity` |
243 | * @param tc scheduler context | ||
244 | */ | 243 | */ |
245 | static void | 244 | static void |
246 | do_read (void *cls, | 245 | do_read (void *cls) |
247 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
248 | { | 246 | { |
249 | struct NatActivity *na = cls; | 247 | struct NatActivity *na = cls; |
250 | struct GNUNET_NAT_Test *tst; | 248 | struct GNUNET_NAT_Test *tst; |
251 | uint16_t data; | 249 | uint16_t data; |
250 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
252 | 251 | ||
252 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
253 | na->rtask = NULL; | 253 | na->rtask = NULL; |
254 | tst = na->h; | 254 | tst = na->h; |
255 | GNUNET_CONTAINER_DLL_remove (tst->na_head, tst->na_tail, na); | 255 | GNUNET_CONTAINER_DLL_remove (tst->na_head, tst->na_tail, na); |
@@ -277,17 +277,17 @@ do_read (void *cls, | |||
277 | * incoming connection. | 277 | * incoming connection. |
278 | * | 278 | * |
279 | * @param cls the `struct GNUNET_NAT_Test` | 279 | * @param cls the `struct GNUNET_NAT_Test` |
280 | * @param tc scheduler context | ||
281 | */ | 280 | */ |
282 | static void | 281 | static void |
283 | do_accept (void *cls, | 282 | do_accept (void *cls) |
284 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
285 | { | 283 | { |
286 | struct GNUNET_NAT_Test *tst = cls; | 284 | struct GNUNET_NAT_Test *tst = cls; |
287 | struct GNUNET_NETWORK_Handle *s; | 285 | struct GNUNET_NETWORK_Handle *s; |
288 | struct NatActivity *wl; | 286 | struct NatActivity *wl; |
287 | const struct GNUNET_SCHEDULER_TaskContext *tc; | ||
289 | 288 | ||
290 | tst->ltask = NULL; | 289 | tst->ltask = NULL; |
290 | tc = GNUNET_SCHEDULER_get_task_context (); | ||
291 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 291 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
292 | return; | 292 | return; |
293 | tst->ltask = | 293 | tst->ltask = |
@@ -378,11 +378,9 @@ addr_cb (void *cls, | |||
378 | * Destroys the nat handle after the callback has been processed. | 378 | * Destroys the nat handle after the callback has been processed. |
379 | * | 379 | * |
380 | * @param cls handle to the timed out NAT test | 380 | * @param cls handle to the timed out NAT test |
381 | * @param tc not used | ||
382 | */ | 381 | */ |
383 | static void | 382 | static void |
384 | do_timeout (void *cls, | 383 | do_timeout (void *cls) |
385 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
386 | { | 384 | { |
387 | struct GNUNET_NAT_Test *nh = cls; | 385 | struct GNUNET_NAT_Test *nh = cls; |
388 | 386 | ||
@@ -440,8 +438,8 @@ GNUNET_NAT_test_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
440 | nh->status = GNUNET_NAT_ERROR_SUCCESS; | 438 | nh->status = GNUNET_NAT_ERROR_SUCCESS; |
441 | if (0 == bnd_port) | 439 | if (0 == bnd_port) |
442 | { | 440 | { |
443 | nh->nat | 441 | nh->nat |
444 | = GNUNET_NAT_register (cfg, is_tcp, 0, 0, | 442 | = GNUNET_NAT_register (cfg, is_tcp, 0, 0, |
445 | NULL, NULL, | 443 | NULL, NULL, |
446 | &addr_cb, | 444 | &addr_cb, |
447 | &reversal_cb, nh, NULL); | 445 | &reversal_cb, nh, NULL); |