aboutsummaryrefslogtreecommitdiff
path: root/src/dht
diff options
context:
space:
mode:
Diffstat (limited to 'src/dht')
-rw-r--r--src/dht/dht.h4
-rw-r--r--src/dht/dht_api.c56
-rw-r--r--src/dht/dht_test_lib.c16
-rw-r--r--src/dht/dht_test_lib.h2
-rw-r--r--src/dht/gnunet-dht-get.c4
-rw-r--r--src/dht/gnunet-dht-monitor.c12
-rw-r--r--src/dht/gnunet-service-dht_clients.c14
-rw-r--r--src/dht/gnunet-service-dht_clients.h4
-rw-r--r--src/dht/gnunet-service-dht_datacache.c4
-rw-r--r--src/dht/gnunet-service-dht_hello.c4
-rw-r--r--src/dht/gnunet-service-dht_neighbours.c34
-rw-r--r--src/dht/gnunet-service-dht_neighbours.h2
-rw-r--r--src/dht/gnunet-service-dht_routing.c4
-rw-r--r--src/dht/test_dht_api.c2
-rw-r--r--src/dht/test_dht_monitor.c32
-rw-r--r--src/dht/test_dht_topo.c44
16 files changed, 119 insertions, 119 deletions
diff --git a/src/dht/dht.h b/src/dht/dht.h
index a2c83e5ec..86fbc16bb 100644
--- a/src/dht/dht.h
+++ b/src/dht/dht.h
@@ -281,7 +281,7 @@ struct GNUNET_DHT_MonitorPutMessage
281 * Hop count so far. 281 * Hop count so far.
282 */ 282 */
283 uint32_t hop_count GNUNET_PACKED; 283 uint32_t hop_count GNUNET_PACKED;
284 284
285 /** 285 /**
286 * Replication level for this message 286 * Replication level for this message
287 */ 287 */
@@ -377,7 +377,7 @@ struct GNUNET_DHT_MonitorGetMessage
377 * Hop count 377 * Hop count
378 */ 378 */
379 uint32_t hop_count GNUNET_PACKED; 379 uint32_t hop_count GNUNET_PACKED;
380 380
381 /** 381 /**
382 * Replication level for this message 382 * Replication level for this message
383 */ 383 */
diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c
index 3a6fcdc53..7b83c14c3 100644
--- a/src/dht/dht_api.c
+++ b/src/dht/dht_api.c
@@ -115,7 +115,7 @@ struct GNUNET_DHT_PutHandle
115 GNUNET_DHT_PutContinuation cont; 115 GNUNET_DHT_PutContinuation cont;
116 116
117 /** 117 /**
118 * Pending message associated with this PUT operation, 118 * Pending message associated with this PUT operation,
119 * NULL after the message has been transmitted to the service. 119 * NULL after the message has been transmitted to the service.
120 */ 120 */
121 struct PendingMessage *pending; 121 struct PendingMessage *pending;
@@ -181,7 +181,7 @@ struct GNUNET_DHT_GetHandle
181 /** 181 /**
182 * Key that this get request is for 182 * Key that this get request is for
183 */ 183 */
184 struct GNUNET_HashCode key; 184 struct GNUNET_HashCode key;
185 185
186 /** 186 /**
187 * Unique identifier for this request (for key collisions). 187 * Unique identifier for this request (for key collisions).
@@ -201,7 +201,7 @@ struct GNUNET_DHT_GetHandle
201 unsigned int seen_results_end; 201 unsigned int seen_results_end;
202 202
203 /** 203 /**
204 * Offset into the 'seen_results' array marking the 204 * Offset into the 'seen_results' array marking the
205 * position up to where we've send the hash codes to 205 * position up to where we've send the hash codes to
206 * the DHT for blocking (needed as we might not be 206 * the DHT for blocking (needed as we might not be
207 * able to send all hash codes at once). 207 * able to send all hash codes at once).
@@ -226,7 +226,7 @@ struct GNUNET_DHT_MonitorHandle
226 * DLL. 226 * DLL.
227 */ 227 */
228 struct GNUNET_DHT_MonitorHandle *prev; 228 struct GNUNET_DHT_MonitorHandle *prev;
229 229
230 /** 230 /**
231 * Main handle to this DHT api. 231 * Main handle to this DHT api.
232 */ 232 */
@@ -261,7 +261,7 @@ struct GNUNET_DHT_MonitorHandle
261 * Closure for cb. 261 * Closure for cb.
262 */ 262 */
263 void *cb_cls; 263 void *cb_cls;
264 264
265}; 265};
266 266
267 267
@@ -297,7 +297,7 @@ struct GNUNET_DHT_Handle
297 struct PendingMessage *pending_tail; 297 struct PendingMessage *pending_tail;
298 298
299 /** 299 /**
300 * Head of linked list of messages we would like to monitor. 300 * Head of linked list of messages we would like to monitor.
301 */ 301 */
302 struct GNUNET_DHT_MonitorHandle *monitor_head; 302 struct GNUNET_DHT_MonitorHandle *monitor_head;
303 303
@@ -353,7 +353,7 @@ struct GNUNET_DHT_Handle
353 * @param msg the incoming message 353 * @param msg the incoming message
354 */ 354 */
355static void 355static void
356service_message_handler (void *cls, 356service_message_handler (void *cls,
357 const struct GNUNET_MessageHeader *msg); 357 const struct GNUNET_MessageHeader *msg);
358 358
359 359
@@ -401,7 +401,7 @@ queue_filter_messages (struct GNUNET_DHT_GetHandle *get_handle)
401 if (delta > max) 401 if (delta > max)
402 delta = max; 402 delta = max;
403 msize = sizeof (struct GNUNET_DHT_ClientGetResultSeenMessage) + delta * sizeof (struct GNUNET_HashCode); 403 msize = sizeof (struct GNUNET_DHT_ClientGetResultSeenMessage) + delta * sizeof (struct GNUNET_HashCode);
404 404
405 pm = GNUNET_malloc (sizeof (struct PendingMessage) + msize); 405 pm = GNUNET_malloc (sizeof (struct PendingMessage) + msize);
406 msg = (struct GNUNET_DHT_ClientGetResultSeenMessage *) &pm[1]; 406 msg = (struct GNUNET_DHT_ClientGetResultSeenMessage *) &pm[1];
407 pm->msg = &msg->header; 407 pm->msg = &msg->header;
@@ -419,7 +419,7 @@ queue_filter_messages (struct GNUNET_DHT_GetHandle *get_handle)
419 get_handle->seen_results_transmission_offset += delta; 419 get_handle->seen_results_transmission_offset += delta;
420 GNUNET_CONTAINER_DLL_insert_tail (get_handle->dht_handle->pending_head, 420 GNUNET_CONTAINER_DLL_insert_tail (get_handle->dht_handle->pending_head,
421 get_handle->dht_handle->pending_tail, 421 get_handle->dht_handle->pending_tail,
422 pm); 422 pm);
423 } 423 }
424} 424}
425 425
@@ -434,8 +434,8 @@ queue_filter_messages (struct GNUNET_DHT_GetHandle *get_handle)
434 * @return #GNUNET_YES (always) 434 * @return #GNUNET_YES (always)
435 */ 435 */
436static int 436static int
437add_request_to_pending (void *cls, 437add_request_to_pending (void *cls,
438 const struct GNUNET_HashCode *key, 438 const struct GNUNET_HashCode *key,
439 void *value) 439 void *value)
440{ 440{
441 struct GNUNET_DHT_Handle *handle = cls; 441 struct GNUNET_DHT_Handle *handle = cls;
@@ -472,7 +472,7 @@ process_pending_messages (struct GNUNET_DHT_Handle *handle);
472 * @param tc scheduler context 472 * @param tc scheduler context
473 */ 473 */
474static void 474static void
475try_reconnect (void *cls, 475try_reconnect (void *cls,
476 const struct GNUNET_SCHEDULER_TaskContext *tc) 476 const struct GNUNET_SCHEDULER_TaskContext *tc)
477{ 477{
478 struct GNUNET_DHT_Handle *handle = cls; 478 struct GNUNET_DHT_Handle *handle = cls;
@@ -542,8 +542,8 @@ do_disconnect (struct GNUNET_DHT_Handle *handle)
542 * @return number of bytes written to @a buf 542 * @return number of bytes written to @a buf
543 */ 543 */
544static size_t 544static size_t
545transmit_pending (void *cls, 545transmit_pending (void *cls,
546 size_t size, 546 size_t size,
547 void *buf); 547 void *buf);
548 548
549 549
@@ -591,8 +591,8 @@ process_pending_messages (struct GNUNET_DHT_Handle *handle)
591 * @return number of bytes written to @a buf 591 * @return number of bytes written to @a buf
592 */ 592 */
593static size_t 593static size_t
594transmit_pending (void *cls, 594transmit_pending (void *cls,
595 size_t size, 595 size_t size,
596 void *buf) 596 void *buf)
597{ 597{
598 struct GNUNET_DHT_Handle *handle = cls; 598 struct GNUNET_DHT_Handle *handle = cls;
@@ -601,7 +601,7 @@ transmit_pending (void *cls,
601 601
602 handle->th = NULL; 602 handle->th = NULL;
603 if (NULL == buf) 603 if (NULL == buf)
604 { 604 {
605 LOG (GNUNET_ERROR_TYPE_DEBUG, 605 LOG (GNUNET_ERROR_TYPE_DEBUG,
606 "Transmission to DHT service failed! Reconnecting!\n"); 606 "Transmission to DHT service failed! Reconnecting!\n");
607 do_disconnect (handle); 607 do_disconnect (handle);
@@ -653,8 +653,8 @@ transmit_pending (void *cls,
653 * #GNUNET_NO if the reply is malformed or we found a matching request 653 * #GNUNET_NO if the reply is malformed or we found a matching request
654 */ 654 */
655static int 655static int
656process_reply (void *cls, 656process_reply (void *cls,
657 const struct GNUNET_HashCode *key, 657 const struct GNUNET_HashCode *key,
658 void *value) 658 void *value)
659{ 659{
660 const struct GNUNET_DHT_ClientResultMessage *dht_msg = cls; 660 const struct GNUNET_DHT_ClientResultMessage *dht_msg = cls;
@@ -700,14 +700,14 @@ process_reply (void *cls,
700 data = &get_path[get_path_length]; 700 data = &get_path[get_path_length];
701 /* remember that we've seen this result */ 701 /* remember that we've seen this result */
702 GNUNET_CRYPTO_hash (data, data_length, &hc); 702 GNUNET_CRYPTO_hash (data, data_length, &hc);
703 if (get_handle->seen_results_size == get_handle->seen_results_end) 703 if (get_handle->seen_results_size == get_handle->seen_results_end)
704 GNUNET_array_grow (get_handle->seen_results, 704 GNUNET_array_grow (get_handle->seen_results,
705 get_handle->seen_results_size, 705 get_handle->seen_results_size,
706 get_handle->seen_results_size * 2 + 1); 706 get_handle->seen_results_size * 2 + 1);
707 GNUNET_assert (get_handle->seen_results_end == get_handle->seen_results_transmission_offset); 707 GNUNET_assert (get_handle->seen_results_end == get_handle->seen_results_transmission_offset);
708 get_handle->seen_results[get_handle->seen_results_end++] = hc; 708 get_handle->seen_results[get_handle->seen_results_end++] = hc;
709 /* no need to block it explicitly, service already knows about it! */ 709 /* no need to block it explicitly, service already knows about it! */
710 get_handle->seen_results_transmission_offset++; 710 get_handle->seen_results_transmission_offset++;
711 get_handle->iter (get_handle->iter_cls, 711 get_handle->iter (get_handle->iter_cls,
712 GNUNET_TIME_absolute_ntoh (dht_msg->expiration), key, 712 GNUNET_TIME_absolute_ntoh (dht_msg->expiration), key,
713 get_path, get_path_length, put_path, put_path_length, 713 get_path, get_path_length, put_path, put_path_length,
@@ -746,7 +746,7 @@ process_monitor_get_message (struct GNUNET_DHT_Handle *handle,
746 ntohl (msg->desired_replication_level), 746 ntohl (msg->desired_replication_level),
747 ntohl (msg->get_path_length), 747 ntohl (msg->get_path_length),
748 (struct GNUNET_PeerIdentity *) &msg[1], 748 (struct GNUNET_PeerIdentity *) &msg[1],
749 &msg->key); 749 &msg->key);
750 } 750 }
751 return GNUNET_OK; 751 return GNUNET_OK;
752} 752}
@@ -879,7 +879,7 @@ process_put_confirmation_message (struct GNUNET_DHT_Handle *handle,
879 cont = ph->cont; 879 cont = ph->cont;
880 cont_cls = ph->cont_cls; 880 cont_cls = ph->cont_cls;
881 GNUNET_DHT_put_cancel (ph); 881 GNUNET_DHT_put_cancel (ph);
882 if (NULL != cont) 882 if (NULL != cont)
883 cont (cont_cls, GNUNET_OK); 883 cont (cont_cls, GNUNET_OK);
884 return GNUNET_OK; 884 return GNUNET_OK;
885} 885}
@@ -1132,11 +1132,11 @@ mark_put_message_gone (void *cls,
1132 * @param cont_cls closure for @a cont 1132 * @param cont_cls closure for @a cont
1133 */ 1133 */
1134struct GNUNET_DHT_PutHandle * 1134struct GNUNET_DHT_PutHandle *
1135GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle, 1135GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle,
1136 const struct GNUNET_HashCode * key, 1136 const struct GNUNET_HashCode * key,
1137 uint32_t desired_replication_level, 1137 uint32_t desired_replication_level,
1138 enum GNUNET_DHT_RouteOption options, 1138 enum GNUNET_DHT_RouteOption options,
1139 enum GNUNET_BLOCK_Type type, size_t size, 1139 enum GNUNET_BLOCK_Type type, size_t size,
1140 const void *data, 1140 const void *data,
1141 struct GNUNET_TIME_Absolute exp, 1141 struct GNUNET_TIME_Absolute exp,
1142 struct GNUNET_TIME_Relative timeout, 1142 struct GNUNET_TIME_Relative timeout,
@@ -1194,7 +1194,7 @@ GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle,
1194 * go out over the network (we can't stop that); However, if the PUT 1194 * go out over the network (we can't stop that); However, if the PUT
1195 * has not yet been sent to the service, cancelling the PUT will stop 1195 * has not yet been sent to the service, cancelling the PUT will stop
1196 * this from happening (but there is no way for the user of this API 1196 * this from happening (but there is no way for the user of this API
1197 * to tell if that is the case). The only use for this API is to 1197 * to tell if that is the case). The only use for this API is to
1198 * prevent a later call to 'cont' from #GNUNET_DHT_put (i.e. because 1198 * prevent a later call to 'cont' from #GNUNET_DHT_put (i.e. because
1199 * the system is shutting down). 1199 * the system is shutting down).
1200 * 1200 *
@@ -1310,7 +1310,7 @@ GNUNET_DHT_get_filter_known_results (struct GNUNET_DHT_GetHandle *get_handle,
1310 unsigned int needed; 1310 unsigned int needed;
1311 1311
1312 needed = get_handle->seen_results_end + num_results; 1312 needed = get_handle->seen_results_end + num_results;
1313 if (needed > get_handle->seen_results_size) 1313 if (needed > get_handle->seen_results_size)
1314 GNUNET_array_grow (get_handle->seen_results, 1314 GNUNET_array_grow (get_handle->seen_results,
1315 get_handle->seen_results_size, 1315 get_handle->seen_results_size,
1316 needed); 1316 needed);
@@ -1483,7 +1483,7 @@ GNUNET_DHT_monitor_stop (struct GNUNET_DHT_MonitorHandle *handle)
1483 pending); 1483 pending);
1484 pending->in_pending_queue = GNUNET_YES; 1484 pending->in_pending_queue = GNUNET_YES;
1485 process_pending_messages (handle->dht_handle); 1485 process_pending_messages (handle->dht_handle);
1486 1486
1487 GNUNET_free_non_null (handle->key); 1487 GNUNET_free_non_null (handle->key);
1488 GNUNET_free (handle); 1488 GNUNET_free (handle);
1489} 1489}
diff --git a/src/dht/dht_test_lib.c b/src/dht/dht_test_lib.c
index de41b2ecc..9864da949 100644
--- a/src/dht/dht_test_lib.c
+++ b/src/dht/dht_test_lib.c
@@ -49,7 +49,7 @@ struct GNUNET_DHT_TEST_Context
49 * Main function of the test to run once all DHTs are available. 49 * Main function of the test to run once all DHTs are available.
50 */ 50 */
51 GNUNET_DHT_TEST_AppMain app_main; 51 GNUNET_DHT_TEST_AppMain app_main;
52 52
53 /** 53 /**
54 * Closure for 'app_main'. 54 * Closure for 'app_main'.
55 */ 55 */
@@ -73,7 +73,7 @@ struct GNUNET_DHT_TEST_Context
73 * from GNUNET_TESTBED_service_connect() 73 * from GNUNET_TESTBED_service_connect()
74 * @return service handle to return in 'op_result', NULL on error 74 * @return service handle to return in 'op_result', NULL on error
75 */ 75 */
76static void * 76static void *
77dht_connect_adapter (void *cls, 77dht_connect_adapter (void *cls,
78 const struct GNUNET_CONFIGURATION_Handle *cfg) 78 const struct GNUNET_CONFIGURATION_Handle *cfg)
79{ 79{
@@ -88,7 +88,7 @@ dht_connect_adapter (void *cls,
88 * @param cls closure 88 * @param cls closure
89 * @param op_result service handle returned from the connect adapter 89 * @param op_result service handle returned from the connect adapter
90 */ 90 */
91static void 91static void
92dht_disconnect_adapter (void *cls, 92dht_disconnect_adapter (void *cls,
93 void *op_result) 93 void *op_result)
94{ 94{
@@ -107,7 +107,7 @@ dht_disconnect_adapter (void *cls,
107 * @param emsg error message in case the operation has failed; will be NULL if 107 * @param emsg error message in case the operation has failed; will be NULL if
108 * operation has executed successfully. 108 * operation has executed successfully.
109 */ 109 */
110static void 110static void
111dht_connect_cb (void *cls, 111dht_connect_cb (void *cls,
112 struct GNUNET_TESTBED_Operation *op, 112 struct GNUNET_TESTBED_Operation *op,
113 void *ca_result, 113 void *ca_result,
@@ -115,7 +115,7 @@ dht_connect_cb (void *cls,
115{ 115{
116 struct GNUNET_DHT_TEST_Context *ctx = cls; 116 struct GNUNET_DHT_TEST_Context *ctx = cls;
117 unsigned int i; 117 unsigned int i;
118 118
119 if (NULL != emsg) 119 if (NULL != emsg)
120 { 120 {
121 fprintf (stderr, "Failed to connect to DHT service: %s\n", 121 fprintf (stderr, "Failed to connect to DHT service: %s\n",
@@ -134,7 +134,7 @@ dht_connect_cb (void *cls,
134 ctx, 134 ctx,
135 ctx->num_peers, 135 ctx->num_peers,
136 ctx->peers, 136 ctx->peers,
137 ctx->dhts); 137 ctx->dhts);
138} 138}
139 139
140 140
@@ -192,7 +192,7 @@ dht_test_run (void *cls,
192 * @param tmain main function to run once the testbed is ready 192 * @param tmain main function to run once the testbed is ready
193 * @param tmain_cls closure for 'tmain' 193 * @param tmain_cls closure for 'tmain'
194 */ 194 */
195void 195void
196GNUNET_DHT_TEST_run (const char *testname, 196GNUNET_DHT_TEST_run (const char *testname,
197 const char *cfgname, 197 const char *cfgname,
198 unsigned int num_peers, 198 unsigned int num_peers,
@@ -200,7 +200,7 @@ GNUNET_DHT_TEST_run (const char *testname,
200 void *tmain_cls) 200 void *tmain_cls)
201{ 201{
202 struct GNUNET_DHT_TEST_Context *ctx; 202 struct GNUNET_DHT_TEST_Context *ctx;
203 203
204 ctx = GNUNET_malloc (sizeof (struct GNUNET_DHT_TEST_Context)); 204 ctx = GNUNET_malloc (sizeof (struct GNUNET_DHT_TEST_Context));
205 ctx->num_peers = num_peers; 205 ctx->num_peers = num_peers;
206 ctx->ops = GNUNET_malloc (num_peers * sizeof (struct GNUNET_TESTBED_Operation *)); 206 ctx->ops = GNUNET_malloc (num_peers * sizeof (struct GNUNET_TESTBED_Operation *));
diff --git a/src/dht/dht_test_lib.h b/src/dht/dht_test_lib.h
index 061794af4..bfa9c1d85 100644
--- a/src/dht/dht_test_lib.h
+++ b/src/dht/dht_test_lib.h
@@ -68,7 +68,7 @@ typedef void (*GNUNET_DHT_TEST_AppMain) (void *cls,
68 * @param tmain main function to run once the testbed is ready 68 * @param tmain main function to run once the testbed is ready
69 * @param tmain_cls closure for 'tmain' 69 * @param tmain_cls closure for 'tmain'
70 */ 70 */
71void 71void
72GNUNET_DHT_TEST_run (const char *testname, 72GNUNET_DHT_TEST_run (const char *testname,
73 const char *cfgname, 73 const char *cfgname,
74 unsigned int num_peers, 74 unsigned int num_peers,
diff --git a/src/dht/gnunet-dht-get.c b/src/dht/gnunet-dht-get.c
index 345a58a13..e7e809323 100644
--- a/src/dht/gnunet-dht-get.c
+++ b/src/dht/gnunet-dht-get.c
@@ -128,8 +128,8 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp,
128 unsigned int put_path_length, enum GNUNET_BLOCK_Type type, 128 unsigned int put_path_length, enum GNUNET_BLOCK_Type type,
129 size_t size, const void *data) 129 size_t size, const void *data)
130{ 130{
131 FPRINTF (stdout, 131 FPRINTF (stdout,
132 _("Result %d, type %d:\n%.*s\n"), 132 _("Result %d, type %d:\n%.*s\n"),
133 result_count, type, 133 result_count, type,
134 (unsigned int) size, (char *) data); 134 (unsigned int) size, (char *) data);
135 result_count++; 135 result_count++;
diff --git a/src/dht/gnunet-dht-monitor.c b/src/dht/gnunet-dht-monitor.c
index b03c7c7c0..6ec29030d 100644
--- a/src/dht/gnunet-dht-monitor.c
+++ b/src/dht/gnunet-dht-monitor.c
@@ -152,7 +152,7 @@ get_resp_callback (void *cls,
152 const void *data, 152 const void *data,
153 size_t size) 153 size_t size)
154{ 154{
155 FPRINTF (stdout, 155 FPRINTF (stdout,
156 "RESPONSE #%u: type %d, key `%s', data `%.*s'\n", 156 "RESPONSE #%u: type %d, key `%s', data `%.*s'\n",
157 result_count, 157 result_count,
158 (int) type, 158 (int) type,
@@ -191,7 +191,7 @@ put_callback (void *cls,
191 const void *data, 191 const void *data,
192 size_t size) 192 size_t size)
193{ 193{
194 FPRINTF (stdout, 194 FPRINTF (stdout,
195 "PUT %u: type %d, key `%s', data `%.*s'\n", 195 "PUT %u: type %d, key `%s', data `%.*s'\n",
196 result_count, 196 result_count,
197 (int) type, 197 (int) type,
@@ -221,14 +221,14 @@ run (void *cls, char *const *args, const char *cfgfile,
221 221
222 if (NULL == (dht_handle = GNUNET_DHT_connect (cfg, 1))) 222 if (NULL == (dht_handle = GNUNET_DHT_connect (cfg, 1)))
223 { 223 {
224 FPRINTF (stderr, "%s", 224 FPRINTF (stderr, "%s",
225 _("Failed to connect to DHT service!\n")); 225 _("Failed to connect to DHT service!\n"));
226 ret = 1; 226 ret = 1;
227 return; 227 return;
228 } 228 }
229 if (GNUNET_BLOCK_TYPE_ANY == block_type) /* Type of data not set */ 229 if (GNUNET_BLOCK_TYPE_ANY == block_type) /* Type of data not set */
230 block_type = GNUNET_BLOCK_TYPE_TEST; 230 block_type = GNUNET_BLOCK_TYPE_TEST;
231 if (NULL != query_key) 231 if (NULL != query_key)
232 { 232 {
233 key = &hc; 233 key = &hc;
234 if (GNUNET_OK != 234 if (GNUNET_OK !=
@@ -240,8 +240,8 @@ run (void *cls, char *const *args, const char *cfgfile,
240 key = NULL; 240 key = NULL;
241 } 241 }
242 if (verbose) 242 if (verbose)
243 FPRINTF (stderr, 243 FPRINTF (stderr,
244 "Monitoring for %s\n", 244 "Monitoring for %s\n",
245 GNUNET_STRINGS_relative_time_to_string (timeout_request, GNUNET_NO)); 245 GNUNET_STRINGS_relative_time_to_string (timeout_request, GNUNET_NO));
246 GNUNET_SCHEDULER_add_delayed (timeout_request, &cleanup_task, NULL); 246 GNUNET_SCHEDULER_add_delayed (timeout_request, &cleanup_task, NULL);
247 monitor_handle = GNUNET_DHT_monitor_start (dht_handle, 247 monitor_handle = GNUNET_DHT_monitor_start (dht_handle,
diff --git a/src/dht/gnunet-service-dht_clients.c b/src/dht/gnunet-service-dht_clients.c
index 20fbba789..f91311cf3 100644
--- a/src/dht/gnunet-service-dht_clients.c
+++ b/src/dht/gnunet-service-dht_clients.c
@@ -199,7 +199,7 @@ struct ClientMonitorRecord
199 * Previous element in DLL. 199 * Previous element in DLL.
200 */ 200 */
201 struct ClientMonitorRecord *prev; 201 struct ClientMonitorRecord *prev;
202 202
203 /** 203 /**
204 * Type of blocks that are of interest 204 * Type of blocks that are of interest
205 */ 205 */
@@ -367,7 +367,7 @@ handle_client_disconnect (void *cls,
367 struct ClientMonitorRecord *monitor; 367 struct ClientMonitorRecord *monitor;
368 368
369 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 369 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
370 "Local client %p disconnects\n", 370 "Local client %p disconnects\n",
371 client); 371 client);
372 pos = find_active_client (client); 372 pos = find_active_client (client);
373 GNUNET_CONTAINER_DLL_remove (client_head, client_tail, pos); 373 GNUNET_CONTAINER_DLL_remove (client_head, client_tail, pos);
@@ -384,7 +384,7 @@ handle_client_disconnect (void *cls,
384 if (monitor->client == pos) 384 if (monitor->client == pos)
385 { 385 {
386 struct ClientMonitorRecord *next; 386 struct ClientMonitorRecord *next;
387 387
388 GNUNET_free_non_null (monitor->key); 388 GNUNET_free_non_null (monitor->key);
389 next = monitor->next; 389 next = monitor->next;
390 GNUNET_CONTAINER_DLL_remove (monitor_head, monitor_tail, monitor); 390 GNUNET_CONTAINER_DLL_remove (monitor_head, monitor_tail, monitor);
@@ -550,7 +550,7 @@ handle_dht_local_put (void *cls, struct GNUNET_SERVER_Client *client,
550 &dht_msg[1], 550 &dht_msg[1],
551 size - sizeof (struct GNUNET_DHT_ClientPutMessage)); 551 size - sizeof (struct GNUNET_DHT_ClientPutMessage));
552 GNUNET_CONTAINER_bloomfilter_free (peer_bf); 552 GNUNET_CONTAINER_bloomfilter_free (peer_bf);
553 pm = GNUNET_malloc (sizeof (struct PendingMessage) + 553 pm = GNUNET_malloc (sizeof (struct PendingMessage) +
554 sizeof (struct GNUNET_DHT_ClientPutConfirmationMessage)); 554 sizeof (struct GNUNET_DHT_ClientPutConfirmationMessage));
555 conf = (struct GNUNET_DHT_ClientPutConfirmationMessage *) &pm[1]; 555 conf = (struct GNUNET_DHT_ClientPutConfirmationMessage *) &pm[1];
556 conf->header.size = htons (sizeof (struct GNUNET_DHT_ClientPutConfirmationMessage)); 556 conf->header.size = htons (sizeof (struct GNUNET_DHT_ClientPutConfirmationMessage));
@@ -884,7 +884,7 @@ handle_dht_local_monitor_stop (void *cls, struct GNUNET_SERVER_Client *client,
884 } 884 }
885 r = r->next; 885 r = r->next;
886 } 886 }
887 887
888 GNUNET_SERVER_receive_done (client, GNUNET_OK); 888 GNUNET_SERVER_receive_done (client, GNUNET_OK);
889} 889}
890 890
@@ -1226,7 +1226,7 @@ void
1226GDS_CLIENTS_process_get (uint32_t options, 1226GDS_CLIENTS_process_get (uint32_t options,
1227 enum GNUNET_BLOCK_Type type, 1227 enum GNUNET_BLOCK_Type type,
1228 uint32_t hop_count, 1228 uint32_t hop_count,
1229 uint32_t desired_replication_level, 1229 uint32_t desired_replication_level,
1230 unsigned int path_length, 1230 unsigned int path_length,
1231 const struct GNUNET_PeerIdentity *path, 1231 const struct GNUNET_PeerIdentity *path,
1232 const struct GNUNET_HashCode * key) 1232 const struct GNUNET_HashCode * key)
@@ -1386,7 +1386,7 @@ void
1386GDS_CLIENTS_process_put (uint32_t options, 1386GDS_CLIENTS_process_put (uint32_t options,
1387 enum GNUNET_BLOCK_Type type, 1387 enum GNUNET_BLOCK_Type type,
1388 uint32_t hop_count, 1388 uint32_t hop_count,
1389 uint32_t desired_replication_level, 1389 uint32_t desired_replication_level,
1390 unsigned int path_length, 1390 unsigned int path_length,
1391 const struct GNUNET_PeerIdentity *path, 1391 const struct GNUNET_PeerIdentity *path,
1392 struct GNUNET_TIME_Absolute exp, 1392 struct GNUNET_TIME_Absolute exp,
diff --git a/src/dht/gnunet-service-dht_clients.h b/src/dht/gnunet-service-dht_clients.h
index f6d4253d5..44491377e 100644
--- a/src/dht/gnunet-service-dht_clients.h
+++ b/src/dht/gnunet-service-dht_clients.h
@@ -72,7 +72,7 @@ void
72GDS_CLIENTS_process_get (uint32_t options, 72GDS_CLIENTS_process_get (uint32_t options,
73 enum GNUNET_BLOCK_Type type, 73 enum GNUNET_BLOCK_Type type,
74 uint32_t hop_count, 74 uint32_t hop_count,
75 uint32_t desired_replication_level, 75 uint32_t desired_replication_level,
76 unsigned int path_length, 76 unsigned int path_length,
77 const struct GNUNET_PeerIdentity *path, 77 const struct GNUNET_PeerIdentity *path,
78 const struct GNUNET_HashCode * key); 78 const struct GNUNET_HashCode * key);
@@ -121,7 +121,7 @@ void
121GDS_CLIENTS_process_put (uint32_t options, 121GDS_CLIENTS_process_put (uint32_t options,
122 enum GNUNET_BLOCK_Type type, 122 enum GNUNET_BLOCK_Type type,
123 uint32_t hop_count, 123 uint32_t hop_count,
124 uint32_t desired_replication_level, 124 uint32_t desired_replication_level,
125 unsigned int path_length, 125 unsigned int path_length,
126 const struct GNUNET_PeerIdentity *path, 126 const struct GNUNET_PeerIdentity *path,
127 struct GNUNET_TIME_Absolute exp, 127 struct GNUNET_TIME_Absolute exp,
diff --git a/src/dht/gnunet-service-dht_datacache.c b/src/dht/gnunet-service-dht_datacache.c
index 6f25a90d7..0e6daa120 100644
--- a/src/dht/gnunet-service-dht_datacache.c
+++ b/src/dht/gnunet-service-dht_datacache.c
@@ -137,7 +137,7 @@ struct GetRequestContext
137 * to stop iteration. 137 * to stop iteration.
138 */ 138 */
139static int 139static int
140datacache_get_iterator (void *cls, 140datacache_get_iterator (void *cls,
141 const struct GNUNET_HashCode * key, size_t size, 141 const struct GNUNET_HashCode * key, size_t size,
142 const char *data, enum GNUNET_BLOCK_Type type, 142 const char *data, enum GNUNET_BLOCK_Type type,
143 struct GNUNET_TIME_Absolute exp, 143 struct GNUNET_TIME_Absolute exp,
@@ -239,7 +239,7 @@ GDS_DATACACHE_handle_get (const struct GNUNET_HashCode * key,
239 ctx.xquery_size = xquery_size; 239 ctx.xquery_size = xquery_size;
240 ctx.reply_bf = reply_bf; 240 ctx.reply_bf = reply_bf;
241 ctx.reply_bf_mutator = reply_bf_mutator; 241 ctx.reply_bf_mutator = reply_bf_mutator;
242 r = GNUNET_DATACACHE_get (datacache, key, type, &datacache_get_iterator, 242 r = GNUNET_DATACACHE_get (datacache, key, type, &datacache_get_iterator,
243 &ctx); 243 &ctx);
244 LOG (GNUNET_ERROR_TYPE_DEBUG, 244 LOG (GNUNET_ERROR_TYPE_DEBUG,
245 "DATACACHE GET for key %s completed (%d). %u results found.\n", 245 "DATACACHE GET for key %s completed (%d). %u results found.\n",
diff --git a/src/dht/gnunet-service-dht_hello.c b/src/dht/gnunet-service-dht_hello.c
index d3415d11d..bc964b91f 100644
--- a/src/dht/gnunet-service-dht_hello.c
+++ b/src/dht/gnunet-service-dht_hello.c
@@ -107,8 +107,8 @@ GDS_HELLO_init ()
107 * Free memory occopied by the HELLO. 107 * Free memory occopied by the HELLO.
108 */ 108 */
109static int 109static int
110free_hello (void *cls, 110free_hello (void *cls,
111 const struct GNUNET_PeerIdentity *key, 111 const struct GNUNET_PeerIdentity *key,
112 void *hello) 112 void *hello)
113{ 113{
114 GNUNET_free (hello); 114 GNUNET_free (hello);
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c
index 908575735..889ef25ba 100644
--- a/src/dht/gnunet-service-dht_neighbours.c
+++ b/src/dht/gnunet-service-dht_neighbours.c
@@ -313,7 +313,7 @@ struct PeerInfo
313 struct PeerInfo *prev; 313 struct PeerInfo *prev;
314 314
315 /** 315 /**
316 * Count of outstanding messages for peer. 316 * Count of outstanding messages for peer.
317 */ 317 */
318 unsigned int pending_count; 318 unsigned int pending_count;
319 319
@@ -553,8 +553,8 @@ struct BloomConstructorContext
553 * @return #GNUNET_YES (we should continue to iterate) 553 * @return #GNUNET_YES (we should continue to iterate)
554 */ 554 */
555static int 555static int
556add_known_to_bloom (void *cls, 556add_known_to_bloom (void *cls,
557 const struct GNUNET_PeerIdentity *key, 557 const struct GNUNET_PeerIdentity *key,
558 void *value) 558 void *value)
559{ 559{
560 struct BloomConstructorContext *ctx = cls; 560 struct BloomConstructorContext *ctx = cls;
@@ -649,7 +649,7 @@ handle_core_connect (void *cls, const struct GNUNET_PeerIdentity *peer)
649 /* Check for connect to self message */ 649 /* Check for connect to self message */
650 if (0 == memcmp (&my_identity, peer, sizeof (struct GNUNET_PeerIdentity))) 650 if (0 == memcmp (&my_identity, peer, sizeof (struct GNUNET_PeerIdentity)))
651 return; 651 return;
652 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 652 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
653 "Connected to %s\n", 653 "Connected to %s\n",
654 GNUNET_i2s (peer)); 654 GNUNET_i2s (peer));
655 if (GNUNET_YES == 655 if (GNUNET_YES ==
@@ -714,7 +714,7 @@ handle_core_disconnect (void *cls,
714 /* Check for disconnect from self message */ 714 /* Check for disconnect from self message */
715 if (0 == memcmp (&my_identity, peer, sizeof (struct GNUNET_PeerIdentity))) 715 if (0 == memcmp (&my_identity, peer, sizeof (struct GNUNET_PeerIdentity)))
716 return; 716 return;
717 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 717 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
718 "Disconnected %s\n", 718 "Disconnected %s\n",
719 GNUNET_i2s (peer)); 719 GNUNET_i2s (peer));
720 to_remove = 720 to_remove =
@@ -919,14 +919,14 @@ get_forward_count (uint32_t hop_count, uint32_t target_replication)
919 * Differences in the lower bits must count stronger than differences 919 * Differences in the lower bits must count stronger than differences
920 * in the higher bits. 920 * in the higher bits.
921 * 921 *
922 * @param target 922 * @param target
923 * @param have 923 * @param have
924 * @return 0 if have==target, otherwise a number 924 * @return 0 if have==target, otherwise a number
925 * that is larger as the distance between 925 * that is larger as the distance between
926 * the two hash codes increases 926 * the two hash codes increases
927 */ 927 */
928static unsigned int 928static unsigned int
929get_distance (const struct GNUNET_HashCode *target, 929get_distance (const struct GNUNET_HashCode *target,
930 const struct GNUNET_HashCode *have) 930 const struct GNUNET_HashCode *have)
931{ 931{
932 unsigned int bucket; 932 unsigned int bucket;
@@ -1197,7 +1197,7 @@ get_target_peers (const struct GNUNET_HashCode *key,
1197 struct GNUNET_HashCode nhash; 1197 struct GNUNET_HashCode nhash;
1198 1198
1199 GNUNET_assert (NULL != bloom); 1199 GNUNET_assert (NULL != bloom);
1200 ret = get_forward_count (hop_count, target_replication); 1200 ret = get_forward_count (hop_count, target_replication);
1201 if (0 == ret) 1201 if (0 == ret)
1202 { 1202 {
1203 *targets = NULL; 1203 *targets = NULL;
@@ -1231,7 +1231,7 @@ get_target_peers (const struct GNUNET_HashCode *key,
1231 *targets = rtargets; 1231 *targets = rtargets;
1232 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1232 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1233 "Forwarding query `%s' to %u peers (goal was %u peers)\n", 1233 "Forwarding query `%s' to %u peers (goal was %u peers)\n",
1234 GNUNET_h2s (key), 1234 GNUNET_h2s (key),
1235 off, 1235 off,
1236 ret); 1236 ret);
1237 return off; 1237 return off;
@@ -1601,7 +1601,7 @@ core_init (void *cls,
1601 * #GNUNET_SYSERR to close it (signal serious error) 1601 * #GNUNET_SYSERR to close it (signal serious error)
1602 */ 1602 */
1603static int 1603static int
1604handle_dht_p2p_put (void *cls, 1604handle_dht_p2p_put (void *cls,
1605 const struct GNUNET_PeerIdentity *peer, 1605 const struct GNUNET_PeerIdentity *peer,
1606 const struct GNUNET_MessageHeader *message) 1606 const struct GNUNET_MessageHeader *message)
1607{ 1607{
@@ -1654,7 +1654,7 @@ handle_dht_p2p_put (void *cls,
1654 1654
1655 tmp = GNUNET_strdup (GNUNET_i2s (&my_identity)); 1655 tmp = GNUNET_strdup (GNUNET_i2s (&my_identity));
1656 LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG, 1656 LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG,
1657 "XDHT PUT %s: %s->%s (%u, %u=>%u)\n", 1657 "XDHT PUT %s: %s->%s (%u, %u=>%u)\n",
1658 GNUNET_h2s (&put->key), GNUNET_i2s (peer), tmp, 1658 GNUNET_h2s (&put->key), GNUNET_i2s (peer), tmp,
1659 ntohl(put->hop_count), 1659 ntohl(put->hop_count),
1660 GNUNET_CRYPTO_hash_matching_bits (&phash, &put->key), 1660 GNUNET_CRYPTO_hash_matching_bits (&phash, &put->key),
@@ -1913,7 +1913,7 @@ handle_dht_p2p_get (void *cls, const struct GNUNET_PeerIdentity *peer,
1913 1913
1914 tmp = GNUNET_strdup (GNUNET_i2s (&my_identity)); 1914 tmp = GNUNET_strdup (GNUNET_i2s (&my_identity));
1915 LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG, 1915 LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG,
1916 "XDHT GET %s: %s->%s (%u, %u=>%u) xq: %.*s\n", 1916 "XDHT GET %s: %s->%s (%u, %u=>%u) xq: %.*s\n",
1917 GNUNET_h2s (&get->key), GNUNET_i2s (peer), tmp, 1917 GNUNET_h2s (&get->key), GNUNET_i2s (peer), tmp,
1918 ntohl(get->hop_count), 1918 ntohl(get->hop_count),
1919 GNUNET_CRYPTO_hash_matching_bits (&phash, &get->key), 1919 GNUNET_CRYPTO_hash_matching_bits (&phash, &get->key),
@@ -2059,7 +2059,7 @@ handle_dht_p2p_result (void *cls, const struct GNUNET_PeerIdentity *peer,
2059 char *tmp; 2059 char *tmp;
2060 2060
2061 tmp = GNUNET_strdup (GNUNET_i2s (&my_identity)); 2061 tmp = GNUNET_strdup (GNUNET_i2s (&my_identity));
2062 LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG, "XDHT RESULT %s: %s->%s (%u)\n", 2062 LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG, "XDHT RESULT %s: %s->%s (%u)\n",
2063 GNUNET_h2s (&prm->key), GNUNET_i2s (peer), tmp, 2063 GNUNET_h2s (&prm->key), GNUNET_i2s (peer), tmp,
2064 get_path_length + 1); 2064 get_path_length + 1);
2065 GNUNET_free (tmp); 2065 GNUNET_free (tmp);
@@ -2132,10 +2132,10 @@ handle_dht_p2p_result (void *cls, const struct GNUNET_PeerIdentity *peer,
2132 struct GNUNET_PeerIdentity xput_path[get_path_length + 1 + put_path_length]; 2132 struct GNUNET_PeerIdentity xput_path[get_path_length + 1 + put_path_length];
2133 2133
2134 memcpy (xput_path, put_path, put_path_length * sizeof (struct GNUNET_PeerIdentity)); 2134 memcpy (xput_path, put_path, put_path_length * sizeof (struct GNUNET_PeerIdentity));
2135 memcpy (&xput_path[put_path_length], 2135 memcpy (&xput_path[put_path_length],
2136 xget_path, 2136 xget_path,
2137 get_path_length * sizeof (struct GNUNET_PeerIdentity)); 2137 get_path_length * sizeof (struct GNUNET_PeerIdentity));
2138 2138
2139 GDS_DATACACHE_handle_put (GNUNET_TIME_absolute_ntoh (prm->expiration_time), 2139 GDS_DATACACHE_handle_put (GNUNET_TIME_absolute_ntoh (prm->expiration_time),
2140 &prm->key, 2140 &prm->key,
2141 get_path_length + put_path_length, xput_path, 2141 get_path_length + put_path_length, xput_path,
@@ -2214,7 +2214,7 @@ GDS_NEIGHBOURS_done ()
2214 2214
2215/** 2215/**
2216 * Get the ID of the local node. 2216 * Get the ID of the local node.
2217 * 2217 *
2218 * @return identity of the local node 2218 * @return identity of the local node
2219 */ 2219 */
2220struct GNUNET_PeerIdentity * 2220struct GNUNET_PeerIdentity *
diff --git a/src/dht/gnunet-service-dht_neighbours.h b/src/dht/gnunet-service-dht_neighbours.h
index b3b33e318..225c4aae0 100644
--- a/src/dht/gnunet-service-dht_neighbours.h
+++ b/src/dht/gnunet-service-dht_neighbours.h
@@ -137,7 +137,7 @@ GDS_NEIGHBOURS_done (void);
137 137
138/** 138/**
139 * Get the ID of the local node. 139 * Get the ID of the local node.
140 * 140 *
141 * @return identity of the local node 141 * @return identity of the local node
142 */ 142 */
143struct GNUNET_PeerIdentity * 143struct GNUNET_PeerIdentity *
diff --git a/src/dht/gnunet-service-dht_routing.c b/src/dht/gnunet-service-dht_routing.c
index d7e6505b0..e2995bd49 100644
--- a/src/dht/gnunet-service-dht_routing.c
+++ b/src/dht/gnunet-service-dht_routing.c
@@ -321,8 +321,8 @@ expire_oldest_entry ()
321 GNUNET_CONTAINER_heap_remove_node (recent_req->heap_node); 321 GNUNET_CONTAINER_heap_remove_node (recent_req->heap_node);
322 GNUNET_CONTAINER_bloomfilter_free (recent_req->reply_bf); 322 GNUNET_CONTAINER_bloomfilter_free (recent_req->reply_bf);
323 GNUNET_assert (GNUNET_YES == 323 GNUNET_assert (GNUNET_YES ==
324 GNUNET_CONTAINER_multihashmap_remove (recent_map, 324 GNUNET_CONTAINER_multihashmap_remove (recent_map,
325 &recent_req->key, 325 &recent_req->key,
326 recent_req)); 326 recent_req));
327 GNUNET_free (recent_req); 327 GNUNET_free (recent_req);
328} 328}
diff --git a/src/dht/test_dht_api.c b/src/dht/test_dht_api.c
index b1c39e893..2295866d3 100644
--- a/src/dht/test_dht_api.c
+++ b/src/dht/test_dht_api.c
@@ -172,7 +172,7 @@ test_get (void *cls, int success)
172 retry_context.next_timeout = BASE_TIMEOUT; 172 retry_context.next_timeout = BASE_TIMEOUT;
173 173
174 get_handle = 174 get_handle =
175 GNUNET_DHT_get_start (dht_handle, 175 GNUNET_DHT_get_start (dht_handle,
176 GNUNET_BLOCK_TYPE_TEST, &hash, 1, 176 GNUNET_BLOCK_TYPE_TEST, &hash, 1,
177 GNUNET_DHT_RO_NONE, NULL, 0, &test_get_iterator, 177 GNUNET_DHT_RO_NONE, NULL, 0, &test_get_iterator,
178 NULL); 178 NULL);
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 */
45struct GetOperation 45struct 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 */
83static struct GNUNET_TESTBED_Peer **my_peers; 83static 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 */
113static void 113static void
114shutdown_task (void *cls, 114shutdown_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
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 */
46struct GetOperation 46struct 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 */
94static struct GNUNET_TESTBED_Peer **my_peers; 94static 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 */
197static int 197static int
198handle_stats (void *cls, 198handle_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 */
225static void 225static void
226shutdown_task (void *cls, 226shutdown_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 }