diff options
Diffstat (limited to 'src/dht/test_dht_topo.c')
-rw-r--r-- | src/dht/test_dht_topo.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/dht/test_dht_topo.c b/src/dht/test_dht_topo.c index 1ab580d5b..1fd61129b 100644 --- a/src/dht/test_dht_topo.c +++ b/src/dht/test_dht_topo.c | |||
@@ -43,7 +43,7 @@ | |||
43 | /** | 43 | /** |
44 | * Information we keep for each GET operation. | 44 | * Information we keep for each GET operation. |
45 | */ | 45 | */ |
46 | struct GetOperation | 46 | struct GetOperation |
47 | { | 47 | { |
48 | /** | 48 | /** |
49 | * DLL. | 49 | * DLL. |
@@ -90,7 +90,7 @@ static struct GetOperation *get_tail; | |||
90 | 90 | ||
91 | /** | 91 | /** |
92 | * Array of the testbed's peers. | 92 | * Array of the testbed's peers. |
93 | */ | 93 | */ |
94 | static struct GNUNET_TESTBED_Peer **my_peers; | 94 | static struct GNUNET_TESTBED_Peer **my_peers; |
95 | 95 | ||
96 | /** | 96 | /** |
@@ -173,10 +173,10 @@ stats_finished (void *cls, | |||
173 | return; | 173 | return; |
174 | } | 174 | } |
175 | for (i = 0; NULL != stats[i].name; i++) | 175 | for (i = 0; NULL != stats[i].name; i++) |
176 | FPRINTF (stderr, | 176 | FPRINTF (stderr, |
177 | "%6s/%60s = %12llu\n", | 177 | "%6s/%60s = %12llu\n", |
178 | stats[i].subsystem, | 178 | stats[i].subsystem, |
179 | stats[i].name, | 179 | stats[i].name, |
180 | stats[i].total); | 180 | stats[i].total); |
181 | GNUNET_SCHEDULER_cancel (put_task); | 181 | GNUNET_SCHEDULER_cancel (put_task); |
182 | GNUNET_DHT_TEST_cleanup (ctx); | 182 | GNUNET_DHT_TEST_cleanup (ctx); |
@@ -194,7 +194,7 @@ stats_finished (void *cls, | |||
194 | * @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if not | 194 | * @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if not |
195 | * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration | 195 | * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration |
196 | */ | 196 | */ |
197 | static int | 197 | static int |
198 | handle_stats (void *cls, | 198 | handle_stats (void *cls, |
199 | const struct GNUNET_TESTBED_Peer *peer, | 199 | const struct GNUNET_TESTBED_Peer *peer, |
200 | const char *subsystem, | 200 | const char *subsystem, |
@@ -221,9 +221,9 @@ handle_stats (void *cls, | |||
221 | * | 221 | * |
222 | * @param cls the 'struct GNUNET_DHT_TestContext' | 222 | * @param cls the 'struct GNUNET_DHT_TestContext' |
223 | * @param tc scheduler context | 223 | * @param tc scheduler context |
224 | */ | 224 | */ |
225 | static void | 225 | static void |
226 | shutdown_task (void *cls, | 226 | shutdown_task (void *cls, |
227 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 227 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
228 | { | 228 | { |
229 | struct GNUNET_DHT_TEST_Context *ctx = cls; | 229 | struct GNUNET_DHT_TEST_Context *ctx = cls; |
@@ -285,7 +285,7 @@ dht_get_handler (void *cls, struct GNUNET_TIME_Absolute exp, | |||
285 | GNUNET_break (0); | 285 | GNUNET_break (0); |
286 | return; | 286 | return; |
287 | } | 287 | } |
288 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 288 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
289 | "Get successful\n"); | 289 | "Get successful\n"); |
290 | #if 0 | 290 | #if 0 |
291 | { | 291 | { |
@@ -318,7 +318,7 @@ dht_get_handler (void *cls, struct GNUNET_TIME_Absolute exp, | |||
318 | 318 | ||
319 | /** | 319 | /** |
320 | * Task to put the id of each peer into the DHT. | 320 | * Task to put the id of each peer into the DHT. |
321 | * | 321 | * |
322 | * @param cls array with NUM_PEERS DHT handles | 322 | * @param cls array with NUM_PEERS DHT handles |
323 | * @param tc Task context | 323 | * @param tc Task context |
324 | */ | 324 | */ |
@@ -331,7 +331,7 @@ do_puts (void *cls, | |||
331 | struct GNUNET_HashCode value; | 331 | struct GNUNET_HashCode value; |
332 | unsigned int i; | 332 | unsigned int i; |
333 | 333 | ||
334 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 334 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
335 | "Putting values into DHT\n"); | 335 | "Putting values into DHT\n"); |
336 | for (i = 0; i < NUM_PEERS; i++) | 336 | for (i = 0; i < NUM_PEERS; i++) |
337 | { | 337 | { |
@@ -340,13 +340,13 @@ do_puts (void *cls, | |||
340 | GNUNET_DHT_put (hs[i], &key, 10U, | 340 | GNUNET_DHT_put (hs[i], &key, 10U, |
341 | GNUNET_DHT_RO_RECORD_ROUTE | | 341 | GNUNET_DHT_RO_RECORD_ROUTE | |
342 | GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE, | 342 | GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE, |
343 | GNUNET_BLOCK_TYPE_TEST, | 343 | GNUNET_BLOCK_TYPE_TEST, |
344 | sizeof (value), &value, | 344 | sizeof (value), &value, |
345 | GNUNET_TIME_UNIT_FOREVER_ABS, | 345 | GNUNET_TIME_UNIT_FOREVER_ABS, |
346 | GNUNET_TIME_UNIT_FOREVER_REL, | 346 | GNUNET_TIME_UNIT_FOREVER_REL, |
347 | NULL, NULL); | 347 | NULL, NULL); |
348 | } | 348 | } |
349 | put_task = GNUNET_SCHEDULER_add_delayed (PUT_FREQUENCY, | 349 | put_task = GNUNET_SCHEDULER_add_delayed (PUT_FREQUENCY, |
350 | &do_puts, hs); | 350 | &do_puts, hs); |
351 | } | 351 | } |
352 | 352 | ||
@@ -374,7 +374,7 @@ run (void *cls, | |||
374 | 374 | ||
375 | GNUNET_assert (NUM_PEERS == num_peers); | 375 | GNUNET_assert (NUM_PEERS == num_peers); |
376 | my_peers = peers; | 376 | my_peers = peers; |
377 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 377 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
378 | "Peers setup, starting test\n"); | 378 | "Peers setup, starting test\n"); |
379 | put_task = GNUNET_SCHEDULER_add_now (&do_puts, dhts); | 379 | put_task = GNUNET_SCHEDULER_add_now (&do_puts, dhts); |
380 | for (i=0;i<num_peers;i++) | 380 | for (i=0;i<num_peers;i++) |
@@ -386,7 +386,7 @@ run (void *cls, | |||
386 | GNUNET_CONTAINER_DLL_insert (get_head, | 386 | GNUNET_CONTAINER_DLL_insert (get_head, |
387 | get_tail, | 387 | get_tail, |
388 | get_op); | 388 | get_op); |
389 | get_op->get = GNUNET_DHT_get_start (dhts[j], | 389 | get_op->get = GNUNET_DHT_get_start (dhts[j], |
390 | GNUNET_BLOCK_TYPE_TEST, /* type */ | 390 | GNUNET_BLOCK_TYPE_TEST, /* type */ |
391 | &key, /*key to search */ | 391 | &key, /*key to search */ |
392 | 4U, /* replication level */ | 392 | 4U, /* replication level */ |
@@ -396,7 +396,7 @@ run (void *cls, | |||
396 | &dht_get_handler, get_op); | 396 | &dht_get_handler, get_op); |
397 | } | 397 | } |
398 | } | 398 | } |
399 | timeout_task = GNUNET_SCHEDULER_add_delayed (GET_TIMEOUT, | 399 | timeout_task = GNUNET_SCHEDULER_add_delayed (GET_TIMEOUT, |
400 | &shutdown_task, ctx); | 400 | &shutdown_task, ctx); |
401 | } | 401 | } |
402 | 402 | ||
@@ -409,7 +409,7 @@ main (int xargc, char *xargv[]) | |||
409 | { | 409 | { |
410 | const char *cfg_filename; | 410 | const char *cfg_filename; |
411 | const char *test_name; | 411 | const char *test_name; |
412 | 412 | ||
413 | if (NULL != strstr (xargv[0], "test_dht_2dtorus")) | 413 | if (NULL != strstr (xargv[0], "test_dht_2dtorus")) |
414 | { | 414 | { |
415 | cfg_filename = "test_dht_2dtorus.conf"; | 415 | cfg_filename = "test_dht_2dtorus.conf"; |
@@ -418,19 +418,19 @@ main (int xargc, char *xargv[]) | |||
418 | } | 418 | } |
419 | else if (NULL != strstr (xargv[0], "test_dht_line")) | 419 | else if (NULL != strstr (xargv[0], "test_dht_line")) |
420 | { | 420 | { |
421 | cfg_filename = "test_dht_line.conf"; | 421 | cfg_filename = "test_dht_line.conf"; |
422 | test_name = "test-dht-line"; | 422 | test_name = "test-dht-line"; |
423 | NUM_PEERS = 5; | 423 | NUM_PEERS = 5; |
424 | } | 424 | } |
425 | else if (NULL != strstr (xargv[0], "test_dht_twopeer")) | 425 | else if (NULL != strstr (xargv[0], "test_dht_twopeer")) |
426 | { | 426 | { |
427 | cfg_filename = "test_dht_line.conf"; | 427 | cfg_filename = "test_dht_line.conf"; |
428 | test_name = "test-dht-twopeer"; | 428 | test_name = "test-dht-twopeer"; |
429 | NUM_PEERS = 2; | 429 | NUM_PEERS = 2; |
430 | } | 430 | } |
431 | else if (NULL != strstr (xargv[0], "test_dht_multipeer")) | 431 | else if (NULL != strstr (xargv[0], "test_dht_multipeer")) |
432 | { | 432 | { |
433 | cfg_filename = "test_dht_multipeer.conf"; | 433 | cfg_filename = "test_dht_multipeer.conf"; |
434 | test_name = "test-dht-multipeer"; | 434 | test_name = "test-dht-multipeer"; |
435 | NUM_PEERS = 10; | 435 | NUM_PEERS = 10; |
436 | } | 436 | } |