diff options
Diffstat (limited to 'src/dht/test_dht_monitor.c')
-rw-r--r-- | src/dht/test_dht_monitor.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/dht/test_dht_monitor.c b/src/dht/test_dht_monitor.c index 74024edf2..303fe8f87 100644 --- a/src/dht/test_dht_monitor.c +++ b/src/dht/test_dht_monitor.c | |||
@@ -42,7 +42,7 @@ | |||
42 | /** | 42 | /** |
43 | * Information we keep for each GET operation. | 43 | * Information we keep for each GET operation. |
44 | */ | 44 | */ |
45 | struct GetOperation | 45 | struct GetOperation |
46 | { | 46 | { |
47 | /** | 47 | /** |
48 | * DLL. | 48 | * DLL. |
@@ -79,7 +79,7 @@ static struct GetOperation *get_tail; | |||
79 | 79 | ||
80 | /** | 80 | /** |
81 | * Array of the testbed's peers. | 81 | * Array of the testbed's peers. |
82 | */ | 82 | */ |
83 | static struct GNUNET_TESTBED_Peer **my_peers; | 83 | static struct GNUNET_TESTBED_Peer **my_peers; |
84 | 84 | ||
85 | /** | 85 | /** |
@@ -109,9 +109,9 @@ static unsigned int monitor_counter; | |||
109 | * | 109 | * |
110 | * @param cls the 'struct GNUNET_DHT_TestContext' | 110 | * @param cls the 'struct GNUNET_DHT_TestContext' |
111 | * @param tc scheduler context | 111 | * @param tc scheduler context |
112 | */ | 112 | */ |
113 | static void | 113 | static void |
114 | shutdown_task (void *cls, | 114 | shutdown_task (void *cls, |
115 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 115 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
116 | { | 116 | { |
117 | struct GNUNET_DHT_TEST_Context *ctx = cls; | 117 | struct GNUNET_DHT_TEST_Context *ctx = cls; |
@@ -177,7 +177,7 @@ dht_get_handler (void *cls, struct GNUNET_TIME_Absolute exp, | |||
177 | GNUNET_break (0); | 177 | GNUNET_break (0); |
178 | return; | 178 | return; |
179 | } | 179 | } |
180 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 180 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
181 | "Get successful\n"); | 181 | "Get successful\n"); |
182 | GNUNET_DHT_get_stop (get_op->get); | 182 | GNUNET_DHT_get_stop (get_op->get); |
183 | GNUNET_CONTAINER_DLL_remove (get_head, | 183 | GNUNET_CONTAINER_DLL_remove (get_head, |
@@ -195,7 +195,7 @@ dht_get_handler (void *cls, struct GNUNET_TIME_Absolute exp, | |||
195 | 195 | ||
196 | /** | 196 | /** |
197 | * Task to put the id of each peer into the DHT. | 197 | * Task to put the id of each peer into the DHT. |
198 | * | 198 | * |
199 | * @param cls array with NUM_PEERS DHT handles | 199 | * @param cls array with NUM_PEERS DHT handles |
200 | * @param tc Task context | 200 | * @param tc Task context |
201 | */ | 201 | */ |
@@ -208,7 +208,7 @@ do_puts (void *cls, | |||
208 | struct GNUNET_HashCode value; | 208 | struct GNUNET_HashCode value; |
209 | unsigned int i; | 209 | unsigned int i; |
210 | 210 | ||
211 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 211 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
212 | "Putting values into DHT\n"); | 212 | "Putting values into DHT\n"); |
213 | for (i = 0; i < NUM_PEERS; i++) | 213 | for (i = 0; i < NUM_PEERS; i++) |
214 | { | 214 | { |
@@ -217,13 +217,13 @@ do_puts (void *cls, | |||
217 | GNUNET_DHT_put (hs[i], &key, 10U, | 217 | GNUNET_DHT_put (hs[i], &key, 10U, |
218 | GNUNET_DHT_RO_RECORD_ROUTE | | 218 | GNUNET_DHT_RO_RECORD_ROUTE | |
219 | GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE, | 219 | GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE, |
220 | GNUNET_BLOCK_TYPE_TEST, | 220 | GNUNET_BLOCK_TYPE_TEST, |
221 | sizeof (value), &value, | 221 | sizeof (value), &value, |
222 | GNUNET_TIME_UNIT_FOREVER_ABS, | 222 | GNUNET_TIME_UNIT_FOREVER_ABS, |
223 | GNUNET_TIME_UNIT_FOREVER_REL, | 223 | GNUNET_TIME_UNIT_FOREVER_REL, |
224 | NULL, NULL); | 224 | NULL, NULL); |
225 | } | 225 | } |
226 | put_task = GNUNET_SCHEDULER_add_delayed (PUT_FREQUENCY, | 226 | put_task = GNUNET_SCHEDULER_add_delayed (PUT_FREQUENCY, |
227 | &do_puts, hs); | 227 | &do_puts, hs); |
228 | } | 228 | } |
229 | 229 | ||
@@ -296,7 +296,7 @@ monitor_put_cb (void *cls, | |||
296 | i = (unsigned int) (long) cls; | 296 | i = (unsigned int) (long) cls; |
297 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 297 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
298 | "%u got a PUT message for key %s with %u bytes\n", | 298 | "%u got a PUT message for key %s with %u bytes\n", |
299 | i, | 299 | i, |
300 | GNUNET_h2s (key), size); | 300 | GNUNET_h2s (key), size); |
301 | monitor_counter++; | 301 | monitor_counter++; |
302 | } | 302 | } |
@@ -334,7 +334,7 @@ monitor_res_cb (void *cls, | |||
334 | i = (unsigned int) (long) cls; | 334 | i = (unsigned int) (long) cls; |
335 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 335 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
336 | "%u got a REPLY message for key %s with %u bytes\n", | 336 | "%u got a REPLY message for key %s with %u bytes\n", |
337 | i, | 337 | i, |
338 | GNUNET_h2s (key), size); | 338 | GNUNET_h2s (key), size); |
339 | monitor_counter++; | 339 | monitor_counter++; |
340 | } | 340 | } |
@@ -372,7 +372,7 @@ run (void *cls, | |||
372 | &monitor_res_cb, | 372 | &monitor_res_cb, |
373 | &monitor_put_cb, | 373 | &monitor_put_cb, |
374 | (void *)(long)i); | 374 | (void *)(long)i); |
375 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 375 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
376 | "Peers setup, starting test\n"); | 376 | "Peers setup, starting test\n"); |
377 | put_task = GNUNET_SCHEDULER_add_now (&do_puts, dhts); | 377 | put_task = GNUNET_SCHEDULER_add_now (&do_puts, dhts); |
378 | for (i=0;i<num_peers;i++) | 378 | for (i=0;i<num_peers;i++) |
@@ -384,7 +384,7 @@ run (void *cls, | |||
384 | GNUNET_CONTAINER_DLL_insert (get_head, | 384 | GNUNET_CONTAINER_DLL_insert (get_head, |
385 | get_tail, | 385 | get_tail, |
386 | get_op); | 386 | get_op); |
387 | get_op->get = GNUNET_DHT_get_start (dhts[j], | 387 | get_op->get = GNUNET_DHT_get_start (dhts[j], |
388 | GNUNET_BLOCK_TYPE_TEST, /* type */ | 388 | GNUNET_BLOCK_TYPE_TEST, /* type */ |
389 | &key, /*key to search */ | 389 | &key, /*key to search */ |
390 | 4U, /* replication level */ | 390 | 4U, /* replication level */ |
@@ -394,7 +394,7 @@ run (void *cls, | |||
394 | &dht_get_handler, get_op); | 394 | &dht_get_handler, get_op); |
395 | } | 395 | } |
396 | } | 396 | } |
397 | timeout_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, | 397 | timeout_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, |
398 | &shutdown_task, ctx); | 398 | &shutdown_task, ctx); |
399 | } | 399 | } |
400 | 400 | ||