diff options
Diffstat (limited to 'src/dht')
-rw-r--r-- | src/dht/dht.h | 16 | ||||
-rw-r--r-- | src/dht/dht_api.c | 28 | ||||
-rw-r--r-- | src/dht/gnunet-dht-get.c | 4 | ||||
-rw-r--r-- | src/dht/gnunet-dht-monitor.c | 10 | ||||
-rw-r--r-- | src/dht/gnunet-dht-put.c | 2 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_clients.c | 42 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_clients.h | 8 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_datacache.c | 8 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_datacache.h | 4 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_hello.c | 2 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_neighbours.c | 42 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_neighbours.h | 6 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_routing.c | 12 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_routing.h | 4 | ||||
-rw-r--r-- | src/dht/plugin_block_dht.c | 6 | ||||
-rw-r--r-- | src/dht/test_dht_api.c | 10 | ||||
-rw-r--r-- | src/dht/test_dht_monitor.c | 12 | ||||
-rw-r--r-- | src/dht/test_dht_multipeer.c | 12 | ||||
-rw-r--r-- | src/dht/test_dht_topo.c | 6 | ||||
-rw-r--r-- | src/dht/test_dht_twopeer.c | 4 | ||||
-rw-r--r-- | src/dht/test_dht_twopeer_get_put.c | 20 | ||||
-rw-r--r-- | src/dht/test_dht_twopeer_path_tracking.c | 16 | ||||
-rw-r--r-- | src/dht/test_dht_twopeer_put_get.c | 16 |
23 files changed, 145 insertions, 145 deletions
diff --git a/src/dht/dht.h b/src/dht/dht.h index 8adf49f5c..772471a7c 100644 --- a/src/dht/dht.h +++ b/src/dht/dht.h | |||
@@ -60,7 +60,7 @@ struct GNUNET_DHT_ClientGetStopMessage | |||
60 | /** | 60 | /** |
61 | * Key of this request | 61 | * Key of this request |
62 | */ | 62 | */ |
63 | GNUNET_HashCode key; | 63 | struct GNUNET_HashCode key; |
64 | 64 | ||
65 | }; | 65 | }; |
66 | 66 | ||
@@ -95,7 +95,7 @@ struct GNUNET_DHT_ClientGetMessage | |||
95 | /** | 95 | /** |
96 | * The key to search for | 96 | * The key to search for |
97 | */ | 97 | */ |
98 | GNUNET_HashCode key; | 98 | struct GNUNET_HashCode key; |
99 | 99 | ||
100 | /** | 100 | /** |
101 | * Unique ID identifying this request, if 0 then | 101 | * Unique ID identifying this request, if 0 then |
@@ -148,7 +148,7 @@ struct GNUNET_DHT_ClientResultMessage | |||
148 | /** | 148 | /** |
149 | * The key that was searched for | 149 | * The key that was searched for |
150 | */ | 150 | */ |
151 | GNUNET_HashCode key; | 151 | struct GNUNET_HashCode key; |
152 | 152 | ||
153 | /* put path, get path and actual data are copied to end of this dealy do */ | 153 | /* put path, get path and actual data are copied to end of this dealy do */ |
154 | 154 | ||
@@ -193,7 +193,7 @@ struct GNUNET_DHT_ClientPutMessage | |||
193 | /** | 193 | /** |
194 | * The key to store the value under. | 194 | * The key to store the value under. |
195 | */ | 195 | */ |
196 | GNUNET_HashCode key; | 196 | struct GNUNET_HashCode key; |
197 | 197 | ||
198 | /* DATA copied to end of this message */ | 198 | /* DATA copied to end of this message */ |
199 | 199 | ||
@@ -268,7 +268,7 @@ struct GNUNET_DHT_MonitorPutMessage | |||
268 | /** | 268 | /** |
269 | * The key to store the value under. | 269 | * The key to store the value under. |
270 | */ | 270 | */ |
271 | GNUNET_HashCode key; | 271 | struct GNUNET_HashCode key; |
272 | 272 | ||
273 | /* put path (if tracked) */ | 273 | /* put path (if tracked) */ |
274 | 274 | ||
@@ -315,7 +315,7 @@ struct GNUNET_DHT_MonitorStartStopMessage | |||
315 | /** | 315 | /** |
316 | * The key to filter messages by. | 316 | * The key to filter messages by. |
317 | */ | 317 | */ |
318 | GNUNET_HashCode key; | 318 | struct GNUNET_HashCode key; |
319 | }; | 319 | }; |
320 | 320 | ||
321 | 321 | ||
@@ -358,7 +358,7 @@ struct GNUNET_DHT_MonitorGetMessage | |||
358 | /** | 358 | /** |
359 | * The key to store the value under. | 359 | * The key to store the value under. |
360 | */ | 360 | */ |
361 | GNUNET_HashCode key; | 361 | struct GNUNET_HashCode key; |
362 | 362 | ||
363 | /* get path (if tracked) */ | 363 | /* get path (if tracked) */ |
364 | 364 | ||
@@ -397,7 +397,7 @@ struct GNUNET_DHT_MonitorGetRespMessage | |||
397 | /** | 397 | /** |
398 | * The key of the corresponding GET request. | 398 | * The key of the corresponding GET request. |
399 | */ | 399 | */ |
400 | GNUNET_HashCode key; | 400 | struct GNUNET_HashCode key; |
401 | 401 | ||
402 | /* put path (if tracked) */ | 402 | /* put path (if tracked) */ |
403 | 403 | ||
diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c index 420eacbff..53702fd77 100644 --- a/src/dht/dht_api.c +++ b/src/dht/dht_api.c | |||
@@ -175,7 +175,7 @@ struct GNUNET_DHT_GetHandle | |||
175 | /** | 175 | /** |
176 | * Key that this get request is for | 176 | * Key that this get request is for |
177 | */ | 177 | */ |
178 | GNUNET_HashCode key; | 178 | struct GNUNET_HashCode key; |
179 | 179 | ||
180 | /** | 180 | /** |
181 | * Unique identifier for this request (for key collisions). | 181 | * Unique identifier for this request (for key collisions). |
@@ -213,7 +213,7 @@ struct GNUNET_DHT_MonitorHandle | |||
213 | /** | 213 | /** |
214 | * Key being looked for, NULL == all. | 214 | * Key being looked for, NULL == all. |
215 | */ | 215 | */ |
216 | GNUNET_HashCode *key; | 216 | struct GNUNET_HashCode *key; |
217 | 217 | ||
218 | /** | 218 | /** |
219 | * Callback for each received message of type get. | 219 | * Callback for each received message of type get. |
@@ -362,7 +362,7 @@ try_connect (struct GNUNET_DHT_Handle *handle) | |||
362 | * @return GNUNET_YES (always) | 362 | * @return GNUNET_YES (always) |
363 | */ | 363 | */ |
364 | static int | 364 | static int |
365 | add_request_to_pending (void *cls, const GNUNET_HashCode * key, void *value) | 365 | add_request_to_pending (void *cls, const struct GNUNET_HashCode * key, void *value) |
366 | { | 366 | { |
367 | struct GNUNET_DHT_Handle *handle = cls; | 367 | struct GNUNET_DHT_Handle *handle = cls; |
368 | struct GNUNET_DHT_GetHandle *rh = value; | 368 | struct GNUNET_DHT_GetHandle *rh = value; |
@@ -577,7 +577,7 @@ transmit_pending (void *cls, size_t size, void *buf) | |||
577 | * GNUNET_NO if the reply is malformed | 577 | * GNUNET_NO if the reply is malformed |
578 | */ | 578 | */ |
579 | static int | 579 | static int |
580 | process_reply (void *cls, const GNUNET_HashCode * key, void *value) | 580 | process_reply (void *cls, const struct GNUNET_HashCode * key, void *value) |
581 | { | 581 | { |
582 | const struct GNUNET_DHT_ClientResultMessage *dht_msg = cls; | 582 | const struct GNUNET_DHT_ClientResultMessage *dht_msg = cls; |
583 | struct GNUNET_DHT_GetHandle *get_handle = value; | 583 | struct GNUNET_DHT_GetHandle *get_handle = value; |
@@ -648,7 +648,7 @@ process_monitor_get_message (struct GNUNET_DHT_Handle *handle, | |||
648 | 648 | ||
649 | type_ok = (GNUNET_BLOCK_TYPE_ANY == h->type) || (h->type == ntohl(msg->type)); | 649 | type_ok = (GNUNET_BLOCK_TYPE_ANY == h->type) || (h->type == ntohl(msg->type)); |
650 | key_ok = (NULL == h->key) || (0 == memcmp (h->key, &msg->key, | 650 | key_ok = (NULL == h->key) || (0 == memcmp (h->key, &msg->key, |
651 | sizeof (GNUNET_HashCode))); | 651 | sizeof (struct GNUNET_HashCode))); |
652 | if (type_ok && key_ok && (NULL != h->get_cb)) | 652 | if (type_ok && key_ok && (NULL != h->get_cb)) |
653 | h->get_cb (h->cb_cls, | 653 | h->get_cb (h->cb_cls, |
654 | ntohl (msg->options), | 654 | ntohl (msg->options), |
@@ -699,7 +699,7 @@ process_monitor_get_resp_message (struct GNUNET_DHT_Handle *handle, | |||
699 | 699 | ||
700 | type_ok = (GNUNET_BLOCK_TYPE_ANY == h->type) || (h->type == ntohl(msg->type)); | 700 | type_ok = (GNUNET_BLOCK_TYPE_ANY == h->type) || (h->type == ntohl(msg->type)); |
701 | key_ok = (NULL == h->key) || (0 == memcmp (h->key, &msg->key, | 701 | key_ok = (NULL == h->key) || (0 == memcmp (h->key, &msg->key, |
702 | sizeof (GNUNET_HashCode))); | 702 | sizeof (struct GNUNET_HashCode))); |
703 | if (type_ok && key_ok && (NULL != h->get_resp_cb)) | 703 | if (type_ok && key_ok && (NULL != h->get_resp_cb)) |
704 | h->get_resp_cb (h->cb_cls, | 704 | h->get_resp_cb (h->cb_cls, |
705 | (enum GNUNET_BLOCK_Type) ntohl(msg->type), | 705 | (enum GNUNET_BLOCK_Type) ntohl(msg->type), |
@@ -749,7 +749,7 @@ process_monitor_put_message (struct GNUNET_DHT_Handle *handle, | |||
749 | 749 | ||
750 | type_ok = (GNUNET_BLOCK_TYPE_ANY == h->type) || (h->type == ntohl(msg->type)); | 750 | type_ok = (GNUNET_BLOCK_TYPE_ANY == h->type) || (h->type == ntohl(msg->type)); |
751 | key_ok = (NULL == h->key) || (0 == memcmp (h->key, &msg->key, | 751 | key_ok = (NULL == h->key) || (0 == memcmp (h->key, &msg->key, |
752 | sizeof (GNUNET_HashCode))); | 752 | sizeof (struct GNUNET_HashCode))); |
753 | if (type_ok && key_ok && (NULL != h->put_cb)) | 753 | if (type_ok && key_ok && (NULL != h->put_cb)) |
754 | h->put_cb (h->cb_cls, | 754 | h->put_cb (h->cb_cls, |
755 | ntohl (msg->options), | 755 | ntohl (msg->options), |
@@ -1040,7 +1040,7 @@ mark_put_message_gone (void *cls, | |||
1040 | * @param cont_cls closure for cont | 1040 | * @param cont_cls closure for cont |
1041 | */ | 1041 | */ |
1042 | struct GNUNET_DHT_PutHandle * | 1042 | struct GNUNET_DHT_PutHandle * |
1043 | GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle, const GNUNET_HashCode * key, | 1043 | GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle, const struct GNUNET_HashCode * key, |
1044 | uint32_t desired_replication_level, | 1044 | uint32_t desired_replication_level, |
1045 | enum GNUNET_DHT_RouteOption options, | 1045 | enum GNUNET_DHT_RouteOption options, |
1046 | enum GNUNET_BLOCK_Type type, size_t size, const char *data, | 1046 | enum GNUNET_BLOCK_Type type, size_t size, const char *data, |
@@ -1148,7 +1148,7 @@ GNUNET_DHT_put_cancel (struct GNUNET_DHT_PutHandle *ph) | |||
1148 | */ | 1148 | */ |
1149 | struct GNUNET_DHT_GetHandle * | 1149 | struct GNUNET_DHT_GetHandle * |
1150 | GNUNET_DHT_get_start (struct GNUNET_DHT_Handle *handle, | 1150 | GNUNET_DHT_get_start (struct GNUNET_DHT_Handle *handle, |
1151 | enum GNUNET_BLOCK_Type type, const GNUNET_HashCode * key, | 1151 | enum GNUNET_BLOCK_Type type, const struct GNUNET_HashCode * key, |
1152 | uint32_t desired_replication_level, | 1152 | uint32_t desired_replication_level, |
1153 | enum GNUNET_DHT_RouteOption options, const void *xquery, | 1153 | enum GNUNET_DHT_RouteOption options, const void *xquery, |
1154 | size_t xquery_size, GNUNET_DHT_GetIterator iter, | 1154 | size_t xquery_size, GNUNET_DHT_GetIterator iter, |
@@ -1266,7 +1266,7 @@ GNUNET_DHT_get_stop (struct GNUNET_DHT_GetHandle *get_handle) | |||
1266 | struct GNUNET_DHT_MonitorHandle * | 1266 | struct GNUNET_DHT_MonitorHandle * |
1267 | GNUNET_DHT_monitor_start (struct GNUNET_DHT_Handle *handle, | 1267 | GNUNET_DHT_monitor_start (struct GNUNET_DHT_Handle *handle, |
1268 | enum GNUNET_BLOCK_Type type, | 1268 | enum GNUNET_BLOCK_Type type, |
1269 | const GNUNET_HashCode *key, | 1269 | const struct GNUNET_HashCode *key, |
1270 | GNUNET_DHT_MonitorGetCB get_cb, | 1270 | GNUNET_DHT_MonitorGetCB get_cb, |
1271 | GNUNET_DHT_MonitorGetRespCB get_resp_cb, | 1271 | GNUNET_DHT_MonitorGetRespCB get_resp_cb, |
1272 | GNUNET_DHT_MonitorPutCB put_cb, | 1272 | GNUNET_DHT_MonitorPutCB put_cb, |
@@ -1287,8 +1287,8 @@ GNUNET_DHT_monitor_start (struct GNUNET_DHT_Handle *handle, | |||
1287 | h->dht_handle = handle; | 1287 | h->dht_handle = handle; |
1288 | if (NULL != key) | 1288 | if (NULL != key) |
1289 | { | 1289 | { |
1290 | h->key = GNUNET_malloc (sizeof(GNUNET_HashCode)); | 1290 | h->key = GNUNET_malloc (sizeof(struct GNUNET_HashCode)); |
1291 | memcpy (h->key, key, sizeof(GNUNET_HashCode)); | 1291 | memcpy (h->key, key, sizeof(struct GNUNET_HashCode)); |
1292 | } | 1292 | } |
1293 | 1293 | ||
1294 | pending = GNUNET_malloc (sizeof (struct GNUNET_DHT_MonitorStartStopMessage) + | 1294 | pending = GNUNET_malloc (sizeof (struct GNUNET_DHT_MonitorStartStopMessage) + |
@@ -1305,7 +1305,7 @@ GNUNET_DHT_monitor_start (struct GNUNET_DHT_Handle *handle, | |||
1305 | m->put = htons(NULL != put_cb); | 1305 | m->put = htons(NULL != put_cb); |
1306 | if (NULL != key) { | 1306 | if (NULL != key) { |
1307 | m->filter_key = htons(1); | 1307 | m->filter_key = htons(1); |
1308 | memcpy (&m->key, key, sizeof(GNUNET_HashCode)); | 1308 | memcpy (&m->key, key, sizeof(struct GNUNET_HashCode)); |
1309 | } | 1309 | } |
1310 | GNUNET_CONTAINER_DLL_insert (handle->pending_head, handle->pending_tail, | 1310 | GNUNET_CONTAINER_DLL_insert (handle->pending_head, handle->pending_tail, |
1311 | pending); | 1311 | pending); |
@@ -1347,7 +1347,7 @@ GNUNET_DHT_monitor_stop (struct GNUNET_DHT_MonitorHandle *handle) | |||
1347 | m->put = htons(NULL != handle->put_cb); | 1347 | m->put = htons(NULL != handle->put_cb); |
1348 | if (NULL != handle->key) { | 1348 | if (NULL != handle->key) { |
1349 | m->filter_key = htons(1); | 1349 | m->filter_key = htons(1); |
1350 | memcpy (&m->key, handle->key, sizeof(GNUNET_HashCode)); | 1350 | memcpy (&m->key, handle->key, sizeof(struct GNUNET_HashCode)); |
1351 | } | 1351 | } |
1352 | GNUNET_CONTAINER_DLL_insert (handle->dht_handle->pending_head, | 1352 | GNUNET_CONTAINER_DLL_insert (handle->dht_handle->pending_head, |
1353 | handle->dht_handle->pending_tail, | 1353 | handle->dht_handle->pending_tail, |
diff --git a/src/dht/gnunet-dht-get.c b/src/dht/gnunet-dht-get.c index 7555f9009..959f0b847 100644 --- a/src/dht/gnunet-dht-get.c +++ b/src/dht/gnunet-dht-get.c | |||
@@ -122,7 +122,7 @@ cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
122 | */ | 122 | */ |
123 | static void | 123 | static void |
124 | get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, | 124 | get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, |
125 | const GNUNET_HashCode * key, | 125 | const struct GNUNET_HashCode * key, |
126 | const struct GNUNET_PeerIdentity *get_path, | 126 | const struct GNUNET_PeerIdentity *get_path, |
127 | unsigned int get_path_length, | 127 | unsigned int get_path_length, |
128 | const struct GNUNET_PeerIdentity *put_path, | 128 | const struct GNUNET_PeerIdentity *put_path, |
@@ -148,7 +148,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
148 | const struct GNUNET_CONFIGURATION_Handle *c) | 148 | const struct GNUNET_CONFIGURATION_Handle *c) |
149 | { | 149 | { |
150 | struct GNUNET_TIME_Relative timeout; | 150 | struct GNUNET_TIME_Relative timeout; |
151 | GNUNET_HashCode key; | 151 | struct GNUNET_HashCode key; |
152 | 152 | ||
153 | cfg = c; | 153 | cfg = c; |
154 | 154 | ||
diff --git a/src/dht/gnunet-dht-monitor.c b/src/dht/gnunet-dht-monitor.c index 088874a53..d8f25e58b 100644 --- a/src/dht/gnunet-dht-monitor.c +++ b/src/dht/gnunet-dht-monitor.c | |||
@@ -131,7 +131,7 @@ get_callback (void *cls, | |||
131 | uint32_t desired_replication_level, | 131 | uint32_t desired_replication_level, |
132 | unsigned int path_length, | 132 | unsigned int path_length, |
133 | const struct GNUNET_PeerIdentity *path, | 133 | const struct GNUNET_PeerIdentity *path, |
134 | const GNUNET_HashCode * key) | 134 | const struct GNUNET_HashCode * key) |
135 | { | 135 | { |
136 | FPRINTF (stdout, "Result %d, operation: %s, type %d\n Key: %s", | 136 | FPRINTF (stdout, "Result %d, operation: %s, type %d\n Key: %s", |
137 | result_count, | 137 | result_count, |
@@ -163,7 +163,7 @@ get_resp_callback (void *cls, | |||
163 | const struct GNUNET_PeerIdentity *put_path, | 163 | const struct GNUNET_PeerIdentity *put_path, |
164 | unsigned int put_path_length, | 164 | unsigned int put_path_length, |
165 | struct GNUNET_TIME_Absolute exp, | 165 | struct GNUNET_TIME_Absolute exp, |
166 | const GNUNET_HashCode * key, | 166 | const struct GNUNET_HashCode * key, |
167 | const void *data, | 167 | const void *data, |
168 | size_t size) | 168 | size_t size) |
169 | { | 169 | { |
@@ -201,7 +201,7 @@ put_callback (void *cls, | |||
201 | unsigned int path_length, | 201 | unsigned int path_length, |
202 | const struct GNUNET_PeerIdentity *path, | 202 | const struct GNUNET_PeerIdentity *path, |
203 | struct GNUNET_TIME_Absolute exp, | 203 | struct GNUNET_TIME_Absolute exp, |
204 | const GNUNET_HashCode * key, | 204 | const struct GNUNET_HashCode * key, |
205 | const void *data, | 205 | const void *data, |
206 | size_t size) | 206 | size_t size) |
207 | { | 207 | { |
@@ -228,7 +228,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
228 | const struct GNUNET_CONFIGURATION_Handle *c) | 228 | const struct GNUNET_CONFIGURATION_Handle *c) |
229 | { | 229 | { |
230 | struct GNUNET_TIME_Relative timeout; | 230 | struct GNUNET_TIME_Relative timeout; |
231 | GNUNET_HashCode *key; | 231 | struct GNUNET_HashCode *key; |
232 | 232 | ||
233 | cfg = c; | 233 | cfg = c; |
234 | 234 | ||
@@ -248,7 +248,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
248 | block_type = GNUNET_BLOCK_TYPE_TEST; | 248 | block_type = GNUNET_BLOCK_TYPE_TEST; |
249 | 249 | ||
250 | if (query_key != NULL) { | 250 | if (query_key != NULL) { |
251 | key = GNUNET_malloc (sizeof(GNUNET_HashCode)); | 251 | key = GNUNET_malloc (sizeof(struct GNUNET_HashCode)); |
252 | GNUNET_CRYPTO_hash (query_key, strlen (query_key), key); | 252 | GNUNET_CRYPTO_hash (query_key, strlen (query_key), key); |
253 | } | 253 | } |
254 | else | 254 | else |
diff --git a/src/dht/gnunet-dht-put.c b/src/dht/gnunet-dht-put.c index f6409bdff..155e1f7d3 100644 --- a/src/dht/gnunet-dht-put.c +++ b/src/dht/gnunet-dht-put.c | |||
@@ -135,7 +135,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
135 | { | 135 | { |
136 | struct GNUNET_TIME_Relative timeout; | 136 | struct GNUNET_TIME_Relative timeout; |
137 | struct GNUNET_TIME_Absolute expiration; | 137 | struct GNUNET_TIME_Absolute expiration; |
138 | GNUNET_HashCode key; | 138 | struct GNUNET_HashCode key; |
139 | 139 | ||
140 | cfg = c; | 140 | cfg = c; |
141 | 141 | ||
diff --git a/src/dht/gnunet-service-dht_clients.c b/src/dht/gnunet-service-dht_clients.c index d897d1fd6..173a1c3ef 100644 --- a/src/dht/gnunet-service-dht_clients.c +++ b/src/dht/gnunet-service-dht_clients.c | |||
@@ -111,7 +111,7 @@ struct ClientQueryRecord | |||
111 | /** | 111 | /** |
112 | * The key this request was about | 112 | * The key this request was about |
113 | */ | 113 | */ |
114 | GNUNET_HashCode key; | 114 | struct GNUNET_HashCode key; |
115 | 115 | ||
116 | /** | 116 | /** |
117 | * Client responsible for the request. | 117 | * Client responsible for the request. |
@@ -126,7 +126,7 @@ struct ClientQueryRecord | |||
126 | /** | 126 | /** |
127 | * Replies we have already seen for this request. | 127 | * Replies we have already seen for this request. |
128 | */ | 128 | */ |
129 | GNUNET_HashCode *seen_replies; | 129 | struct GNUNET_HashCode *seen_replies; |
130 | 130 | ||
131 | /** | 131 | /** |
132 | * Pointer to this nodes heap location in the retry-heap (for fast removal) | 132 | * Pointer to this nodes heap location in the retry-heap (for fast removal) |
@@ -201,7 +201,7 @@ struct ClientMonitorRecord | |||
201 | /** | 201 | /** |
202 | * Key of data of interest, NULL for all. | 202 | * Key of data of interest, NULL for all. |
203 | */ | 203 | */ |
204 | GNUNET_HashCode *key; | 204 | struct GNUNET_HashCode *key; |
205 | 205 | ||
206 | /** | 206 | /** |
207 | * Flag whether to notify about GET messages. | 207 | * Flag whether to notify about GET messages. |
@@ -322,7 +322,7 @@ find_active_client (struct GNUNET_SERVER_Client *client) | |||
322 | * @return GNUNET_YES (we should continue to iterate) | 322 | * @return GNUNET_YES (we should continue to iterate) |
323 | */ | 323 | */ |
324 | static int | 324 | static int |
325 | remove_client_records (void *cls, const GNUNET_HashCode * key, void *value) | 325 | remove_client_records (void *cls, const struct GNUNET_HashCode * key, void *value) |
326 | { | 326 | { |
327 | struct ClientList *client = cls; | 327 | struct ClientList *client = cls; |
328 | struct ClientQueryRecord *record = value; | 328 | struct ClientQueryRecord *record = value; |
@@ -646,7 +646,7 @@ struct RemoveByUniqueIdContext | |||
646 | * @return GNUNET_YES (we should continue to iterate) | 646 | * @return GNUNET_YES (we should continue to iterate) |
647 | */ | 647 | */ |
648 | static int | 648 | static int |
649 | remove_by_unique_id (void *cls, const GNUNET_HashCode * key, void *value) | 649 | remove_by_unique_id (void *cls, const struct GNUNET_HashCode * key, void *value) |
650 | { | 650 | { |
651 | const struct RemoveByUniqueIdContext *ctx = cls; | 651 | const struct RemoveByUniqueIdContext *ctx = cls; |
652 | struct ClientQueryRecord *record = value; | 652 | struct ClientQueryRecord *record = value; |
@@ -718,8 +718,8 @@ handle_dht_local_monitor (void *cls, struct GNUNET_SERVER_Client *client, | |||
718 | r->key = NULL; | 718 | r->key = NULL; |
719 | else | 719 | else |
720 | { | 720 | { |
721 | r->key = GNUNET_malloc (sizeof (GNUNET_HashCode)); | 721 | r->key = GNUNET_malloc (sizeof (struct GNUNET_HashCode)); |
722 | memcpy (r->key, &msg->key, sizeof (GNUNET_HashCode)); | 722 | memcpy (r->key, &msg->key, sizeof (struct GNUNET_HashCode)); |
723 | } | 723 | } |
724 | GNUNET_CONTAINER_DLL_insert (monitor_head, monitor_tail, r); | 724 | GNUNET_CONTAINER_DLL_insert (monitor_head, monitor_tail, r); |
725 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 725 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
@@ -751,7 +751,7 @@ handle_dht_local_monitor_stop (void *cls, struct GNUNET_SERVER_Client *client, | |||
751 | else | 751 | else |
752 | { | 752 | { |
753 | keys_match = (0 != ntohs(msg->filter_key) | 753 | keys_match = (0 != ntohs(msg->filter_key) |
754 | && !memcmp(r->key, &msg->key, sizeof(GNUNET_HashCode))); | 754 | && !memcmp(r->key, &msg->key, sizeof(struct GNUNET_HashCode))); |
755 | } | 755 | } |
756 | if (find_active_client(client) == r->client | 756 | if (find_active_client(client) == r->client |
757 | && ntohl(msg->type) == r->type | 757 | && ntohl(msg->type) == r->type |
@@ -898,7 +898,7 @@ struct ForwardReplyContext | |||
898 | * if the result is mal-formed, GNUNET_NO | 898 | * if the result is mal-formed, GNUNET_NO |
899 | */ | 899 | */ |
900 | static int | 900 | static int |
901 | forward_reply (void *cls, const GNUNET_HashCode * key, void *value) | 901 | forward_reply (void *cls, const struct GNUNET_HashCode * key, void *value) |
902 | { | 902 | { |
903 | struct ForwardReplyContext *frc = cls; | 903 | struct ForwardReplyContext *frc = cls; |
904 | struct ClientQueryRecord *record = value; | 904 | struct ClientQueryRecord *record = value; |
@@ -906,7 +906,7 @@ forward_reply (void *cls, const GNUNET_HashCode * key, void *value) | |||
906 | struct GNUNET_DHT_ClientResultMessage *reply; | 906 | struct GNUNET_DHT_ClientResultMessage *reply; |
907 | enum GNUNET_BLOCK_EvaluationResult eval; | 907 | enum GNUNET_BLOCK_EvaluationResult eval; |
908 | int do_free; | 908 | int do_free; |
909 | GNUNET_HashCode ch; | 909 | struct GNUNET_HashCode ch; |
910 | unsigned int i; | 910 | unsigned int i; |
911 | 911 | ||
912 | if ((record->type != GNUNET_BLOCK_TYPE_ANY) && (record->type != frc->type)) | 912 | if ((record->type != GNUNET_BLOCK_TYPE_ANY) && (record->type != frc->type)) |
@@ -922,7 +922,7 @@ forward_reply (void *cls, const GNUNET_HashCode * key, void *value) | |||
922 | } | 922 | } |
923 | GNUNET_CRYPTO_hash (frc->data, frc->data_size, &ch); | 923 | GNUNET_CRYPTO_hash (frc->data, frc->data_size, &ch); |
924 | for (i = 0; i < record->seen_replies_count; i++) | 924 | for (i = 0; i < record->seen_replies_count; i++) |
925 | if (0 == memcmp (&record->seen_replies[i], &ch, sizeof (GNUNET_HashCode))) | 925 | if (0 == memcmp (&record->seen_replies[i], &ch, sizeof (struct GNUNET_HashCode))) |
926 | { | 926 | { |
927 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 927 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
928 | "Duplicate reply, not passing request for key %s to local client\n", | 928 | "Duplicate reply, not passing request for key %s to local client\n", |
@@ -1017,7 +1017,7 @@ forward_reply (void *cls, const GNUNET_HashCode * key, void *value) | |||
1017 | */ | 1017 | */ |
1018 | void | 1018 | void |
1019 | GDS_CLIENTS_handle_reply (struct GNUNET_TIME_Absolute expiration, | 1019 | GDS_CLIENTS_handle_reply (struct GNUNET_TIME_Absolute expiration, |
1020 | const GNUNET_HashCode * key, | 1020 | const struct GNUNET_HashCode * key, |
1021 | unsigned int get_path_length, | 1021 | unsigned int get_path_length, |
1022 | const struct GNUNET_PeerIdentity *get_path, | 1022 | const struct GNUNET_PeerIdentity *get_path, |
1023 | unsigned int put_path_length, | 1023 | unsigned int put_path_length, |
@@ -1104,7 +1104,7 @@ GDS_CLIENTS_process_get (uint32_t options, | |||
1104 | uint32_t desired_replication_level, | 1104 | uint32_t desired_replication_level, |
1105 | unsigned int path_length, | 1105 | unsigned int path_length, |
1106 | const struct GNUNET_PeerIdentity *path, | 1106 | const struct GNUNET_PeerIdentity *path, |
1107 | const GNUNET_HashCode * key) | 1107 | const struct GNUNET_HashCode * key) |
1108 | { | 1108 | { |
1109 | struct ClientMonitorRecord *m; | 1109 | struct ClientMonitorRecord *m; |
1110 | struct ClientList **cl; | 1110 | struct ClientList **cl; |
@@ -1116,7 +1116,7 @@ GDS_CLIENTS_process_get (uint32_t options, | |||
1116 | { | 1116 | { |
1117 | if ((GNUNET_BLOCK_TYPE_ANY == m->type || m->type == type) && | 1117 | if ((GNUNET_BLOCK_TYPE_ANY == m->type || m->type == type) && |
1118 | (NULL == m->key || | 1118 | (NULL == m->key || |
1119 | memcmp (key, m->key, sizeof(GNUNET_HashCode)) == 0)) | 1119 | memcmp (key, m->key, sizeof(struct GNUNET_HashCode)) == 0)) |
1120 | { | 1120 | { |
1121 | struct PendingMessage *pm; | 1121 | struct PendingMessage *pm; |
1122 | struct GNUNET_DHT_MonitorGetMessage *mmsg; | 1122 | struct GNUNET_DHT_MonitorGetMessage *mmsg; |
@@ -1145,7 +1145,7 @@ GDS_CLIENTS_process_get (uint32_t options, | |||
1145 | mmsg->hop_count = htonl(hop_count); | 1145 | mmsg->hop_count = htonl(hop_count); |
1146 | mmsg->desired_replication_level = htonl(desired_replication_level); | 1146 | mmsg->desired_replication_level = htonl(desired_replication_level); |
1147 | mmsg->get_path_length = htonl(path_length); | 1147 | mmsg->get_path_length = htonl(path_length); |
1148 | memcpy (&mmsg->key, key, sizeof (GNUNET_HashCode)); | 1148 | memcpy (&mmsg->key, key, sizeof (struct GNUNET_HashCode)); |
1149 | msg_path = (struct GNUNET_PeerIdentity *) &mmsg[1]; | 1149 | msg_path = (struct GNUNET_PeerIdentity *) &mmsg[1]; |
1150 | if (path_length > 0) | 1150 | if (path_length > 0) |
1151 | memcpy (msg_path, path, | 1151 | memcpy (msg_path, path, |
@@ -1178,7 +1178,7 @@ GDS_CLIENTS_process_get_resp (enum GNUNET_BLOCK_Type type, | |||
1178 | const struct GNUNET_PeerIdentity *put_path, | 1178 | const struct GNUNET_PeerIdentity *put_path, |
1179 | unsigned int put_path_length, | 1179 | unsigned int put_path_length, |
1180 | struct GNUNET_TIME_Absolute exp, | 1180 | struct GNUNET_TIME_Absolute exp, |
1181 | const GNUNET_HashCode * key, | 1181 | const struct GNUNET_HashCode * key, |
1182 | const void *data, | 1182 | const void *data, |
1183 | size_t size) | 1183 | size_t size) |
1184 | { | 1184 | { |
@@ -1192,7 +1192,7 @@ GDS_CLIENTS_process_get_resp (enum GNUNET_BLOCK_Type type, | |||
1192 | { | 1192 | { |
1193 | if ((GNUNET_BLOCK_TYPE_ANY == m->type || m->type == type) && | 1193 | if ((GNUNET_BLOCK_TYPE_ANY == m->type || m->type == type) && |
1194 | (NULL == m->key || | 1194 | (NULL == m->key || |
1195 | memcmp (key, m->key, sizeof(GNUNET_HashCode)) == 0)) | 1195 | memcmp (key, m->key, sizeof(struct GNUNET_HashCode)) == 0)) |
1196 | { | 1196 | { |
1197 | struct PendingMessage *pm; | 1197 | struct PendingMessage *pm; |
1198 | struct GNUNET_DHT_MonitorGetRespMessage *mmsg; | 1198 | struct GNUNET_DHT_MonitorGetRespMessage *mmsg; |
@@ -1232,7 +1232,7 @@ GDS_CLIENTS_process_get_resp (enum GNUNET_BLOCK_Type type, | |||
1232 | memcpy (path, get_path, | 1232 | memcpy (path, get_path, |
1233 | get_path_length * sizeof (struct GNUNET_PeerIdentity)); | 1233 | get_path_length * sizeof (struct GNUNET_PeerIdentity)); |
1234 | mmsg->expiration_time = GNUNET_TIME_absolute_hton(exp); | 1234 | mmsg->expiration_time = GNUNET_TIME_absolute_hton(exp); |
1235 | memcpy (&mmsg->key, key, sizeof (GNUNET_HashCode)); | 1235 | memcpy (&mmsg->key, key, sizeof (struct GNUNET_HashCode)); |
1236 | if (size > 0) | 1236 | if (size > 0) |
1237 | memcpy (&path[get_path_length], data, size); | 1237 | memcpy (&path[get_path_length], data, size); |
1238 | add_pending_message (m->client, pm); | 1238 | add_pending_message (m->client, pm); |
@@ -1265,7 +1265,7 @@ GDS_CLIENTS_process_put (uint32_t options, | |||
1265 | unsigned int path_length, | 1265 | unsigned int path_length, |
1266 | const struct GNUNET_PeerIdentity *path, | 1266 | const struct GNUNET_PeerIdentity *path, |
1267 | struct GNUNET_TIME_Absolute exp, | 1267 | struct GNUNET_TIME_Absolute exp, |
1268 | const GNUNET_HashCode * key, | 1268 | const struct GNUNET_HashCode * key, |
1269 | const void *data, | 1269 | const void *data, |
1270 | size_t size) | 1270 | size_t size) |
1271 | { | 1271 | { |
@@ -1279,7 +1279,7 @@ GDS_CLIENTS_process_put (uint32_t options, | |||
1279 | { | 1279 | { |
1280 | if ((GNUNET_BLOCK_TYPE_ANY == m->type || m->type == type) && | 1280 | if ((GNUNET_BLOCK_TYPE_ANY == m->type || m->type == type) && |
1281 | (NULL == m->key || | 1281 | (NULL == m->key || |
1282 | memcmp (key, m->key, sizeof(GNUNET_HashCode)) == 0)) | 1282 | memcmp (key, m->key, sizeof(struct GNUNET_HashCode)) == 0)) |
1283 | { | 1283 | { |
1284 | struct PendingMessage *pm; | 1284 | struct PendingMessage *pm; |
1285 | struct GNUNET_DHT_MonitorPutMessage *mmsg; | 1285 | struct GNUNET_DHT_MonitorPutMessage *mmsg; |
@@ -1316,7 +1316,7 @@ GDS_CLIENTS_process_put (uint32_t options, | |||
1316 | path_length * sizeof (struct GNUNET_PeerIdentity)); | 1316 | path_length * sizeof (struct GNUNET_PeerIdentity)); |
1317 | } | 1317 | } |
1318 | mmsg->expiration_time = GNUNET_TIME_absolute_hton(exp); | 1318 | mmsg->expiration_time = GNUNET_TIME_absolute_hton(exp); |
1319 | memcpy (&mmsg->key, key, sizeof (GNUNET_HashCode)); | 1319 | memcpy (&mmsg->key, key, sizeof (struct GNUNET_HashCode)); |
1320 | if (size > 0) | 1320 | if (size > 0) |
1321 | memcpy (&msg_path[path_length], data, size); | 1321 | memcpy (&msg_path[path_length], data, size); |
1322 | add_pending_message (m->client, pm); | 1322 | add_pending_message (m->client, pm); |
diff --git a/src/dht/gnunet-service-dht_clients.h b/src/dht/gnunet-service-dht_clients.h index 9f3d2dd83..f6d4253d5 100644 --- a/src/dht/gnunet-service-dht_clients.h +++ b/src/dht/gnunet-service-dht_clients.h | |||
@@ -47,7 +47,7 @@ | |||
47 | */ | 47 | */ |
48 | void | 48 | void |
49 | GDS_CLIENTS_handle_reply (struct GNUNET_TIME_Absolute expiration, | 49 | GDS_CLIENTS_handle_reply (struct GNUNET_TIME_Absolute expiration, |
50 | const GNUNET_HashCode * key, | 50 | const struct GNUNET_HashCode * key, |
51 | unsigned int get_path_length, | 51 | unsigned int get_path_length, |
52 | const struct GNUNET_PeerIdentity *get_path, | 52 | const struct GNUNET_PeerIdentity *get_path, |
53 | unsigned int put_path_length, | 53 | unsigned int put_path_length, |
@@ -75,7 +75,7 @@ GDS_CLIENTS_process_get (uint32_t options, | |||
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 GNUNET_HashCode * key); | 78 | const struct GNUNET_HashCode * key); |
79 | 79 | ||
80 | /** | 80 | /** |
81 | * Check if some client is monitoring GET RESP messages and notify | 81 | * Check if some client is monitoring GET RESP messages and notify |
@@ -98,7 +98,7 @@ GDS_CLIENTS_process_get_resp (enum GNUNET_BLOCK_Type type, | |||
98 | const struct GNUNET_PeerIdentity *put_path, | 98 | const struct GNUNET_PeerIdentity *put_path, |
99 | unsigned int put_path_length, | 99 | unsigned int put_path_length, |
100 | struct GNUNET_TIME_Absolute exp, | 100 | struct GNUNET_TIME_Absolute exp, |
101 | const GNUNET_HashCode * key, | 101 | const struct GNUNET_HashCode * key, |
102 | const void *data, | 102 | const void *data, |
103 | size_t size); | 103 | size_t size); |
104 | 104 | ||
@@ -125,7 +125,7 @@ GDS_CLIENTS_process_put (uint32_t options, | |||
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, |
128 | const GNUNET_HashCode * key, | 128 | const struct GNUNET_HashCode * key, |
129 | const void *data, | 129 | const void *data, |
130 | size_t size); | 130 | size_t size); |
131 | 131 | ||
diff --git a/src/dht/gnunet-service-dht_datacache.c b/src/dht/gnunet-service-dht_datacache.c index 4d1dd6f68..b2cb93d12 100644 --- a/src/dht/gnunet-service-dht_datacache.c +++ b/src/dht/gnunet-service-dht_datacache.c | |||
@@ -74,7 +74,7 @@ struct DHTPutEntry | |||
74 | */ | 74 | */ |
75 | void | 75 | void |
76 | GDS_DATACACHE_handle_put (struct GNUNET_TIME_Absolute expiration, | 76 | GDS_DATACACHE_handle_put (struct GNUNET_TIME_Absolute expiration, |
77 | const GNUNET_HashCode * key, | 77 | const struct GNUNET_HashCode * key, |
78 | unsigned int put_path_length, | 78 | unsigned int put_path_length, |
79 | const struct GNUNET_PeerIdentity *put_path, | 79 | const struct GNUNET_PeerIdentity *put_path, |
80 | enum GNUNET_BLOCK_Type type, size_t data_size, | 80 | enum GNUNET_BLOCK_Type type, size_t data_size, |
@@ -131,7 +131,7 @@ struct GetRequestContext | |||
131 | /** | 131 | /** |
132 | * The key this request was about | 132 | * The key this request was about |
133 | */ | 133 | */ |
134 | GNUNET_HashCode key; | 134 | struct GNUNET_HashCode key; |
135 | 135 | ||
136 | /** | 136 | /** |
137 | * Number of bytes in xquery. | 137 | * Number of bytes in xquery. |
@@ -165,7 +165,7 @@ struct GetRequestContext | |||
165 | */ | 165 | */ |
166 | static int | 166 | static int |
167 | datacache_get_iterator (void *cls, struct GNUNET_TIME_Absolute exp, | 167 | datacache_get_iterator (void *cls, struct GNUNET_TIME_Absolute exp, |
168 | const GNUNET_HashCode * key, size_t size, | 168 | const struct GNUNET_HashCode * key, size_t size, |
169 | const char *data, enum GNUNET_BLOCK_Type type) | 169 | const char *data, enum GNUNET_BLOCK_Type type) |
170 | { | 170 | { |
171 | struct GetRequestContext *ctx = cls; | 171 | struct GetRequestContext *ctx = cls; |
@@ -255,7 +255,7 @@ datacache_get_iterator (void *cls, struct GNUNET_TIME_Absolute exp, | |||
255 | * @return evaluation result for the local replies | 255 | * @return evaluation result for the local replies |
256 | */ | 256 | */ |
257 | enum GNUNET_BLOCK_EvaluationResult | 257 | enum GNUNET_BLOCK_EvaluationResult |
258 | GDS_DATACACHE_handle_get (const GNUNET_HashCode * key, | 258 | GDS_DATACACHE_handle_get (const struct GNUNET_HashCode * key, |
259 | enum GNUNET_BLOCK_Type type, const void *xquery, | 259 | enum GNUNET_BLOCK_Type type, const void *xquery, |
260 | size_t xquery_size, | 260 | size_t xquery_size, |
261 | struct GNUNET_CONTAINER_BloomFilter **reply_bf, | 261 | struct GNUNET_CONTAINER_BloomFilter **reply_bf, |
diff --git a/src/dht/gnunet-service-dht_datacache.h b/src/dht/gnunet-service-dht_datacache.h index 926ad5326..3889883b3 100644 --- a/src/dht/gnunet-service-dht_datacache.h +++ b/src/dht/gnunet-service-dht_datacache.h | |||
@@ -44,7 +44,7 @@ | |||
44 | */ | 44 | */ |
45 | void | 45 | void |
46 | GDS_DATACACHE_handle_put (struct GNUNET_TIME_Absolute expiration, | 46 | GDS_DATACACHE_handle_put (struct GNUNET_TIME_Absolute expiration, |
47 | const GNUNET_HashCode * key, | 47 | const struct GNUNET_HashCode * key, |
48 | unsigned int put_path_length, | 48 | unsigned int put_path_length, |
49 | const struct GNUNET_PeerIdentity *put_path, | 49 | const struct GNUNET_PeerIdentity *put_path, |
50 | enum GNUNET_BLOCK_Type type, size_t data_size, | 50 | enum GNUNET_BLOCK_Type type, size_t data_size, |
@@ -63,7 +63,7 @@ GDS_DATACACHE_handle_put (struct GNUNET_TIME_Absolute expiration, | |||
63 | * @return evaluation result for the local replies | 63 | * @return evaluation result for the local replies |
64 | */ | 64 | */ |
65 | enum GNUNET_BLOCK_EvaluationResult | 65 | enum GNUNET_BLOCK_EvaluationResult |
66 | GDS_DATACACHE_handle_get (const GNUNET_HashCode * key, | 66 | GDS_DATACACHE_handle_get (const struct GNUNET_HashCode * key, |
67 | enum GNUNET_BLOCK_Type type, const void *xquery, | 67 | enum GNUNET_BLOCK_Type type, const void *xquery, |
68 | size_t xquery_size, | 68 | size_t xquery_size, |
69 | struct GNUNET_CONTAINER_BloomFilter **reply_bf, | 69 | struct GNUNET_CONTAINER_BloomFilter **reply_bf, |
diff --git a/src/dht/gnunet-service-dht_hello.c b/src/dht/gnunet-service-dht_hello.c index b9cc45016..b4c5150c9 100644 --- a/src/dht/gnunet-service-dht_hello.c +++ b/src/dht/gnunet-service-dht_hello.c | |||
@@ -107,7 +107,7 @@ GDS_HELLO_init () | |||
107 | * Free memory occopied by the HELLO. | 107 | * Free memory occopied by the HELLO. |
108 | */ | 108 | */ |
109 | static int | 109 | static int |
110 | free_hello (void *cls, const GNUNET_HashCode * key, void *hello) | 110 | free_hello (void *cls, const struct GNUNET_HashCode * key, void *hello) |
111 | { | 111 | { |
112 | GNUNET_free (hello); | 112 | GNUNET_free (hello); |
113 | return GNUNET_OK; | 113 | return GNUNET_OK; |
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c index dc91ac32d..891519314 100644 --- a/src/dht/gnunet-service-dht_neighbours.c +++ b/src/dht/gnunet-service-dht_neighbours.c | |||
@@ -52,7 +52,7 @@ | |||
52 | /** | 52 | /** |
53 | * How many buckets will we allow total. | 53 | * How many buckets will we allow total. |
54 | */ | 54 | */ |
55 | #define MAX_BUCKETS sizeof (GNUNET_HashCode) * 8 | 55 | #define MAX_BUCKETS sizeof (struct GNUNET_HashCode) * 8 |
56 | 56 | ||
57 | /** | 57 | /** |
58 | * What is the maximum number of peers in a given bucket. | 58 | * What is the maximum number of peers in a given bucket. |
@@ -140,7 +140,7 @@ struct PeerPutMessage | |||
140 | /** | 140 | /** |
141 | * The key we are storing under. | 141 | * The key we are storing under. |
142 | */ | 142 | */ |
143 | GNUNET_HashCode key; | 143 | struct GNUNET_HashCode key; |
144 | 144 | ||
145 | /* put path (if tracked) */ | 145 | /* put path (if tracked) */ |
146 | 146 | ||
@@ -182,7 +182,7 @@ struct PeerResultMessage | |||
182 | /** | 182 | /** |
183 | * The key of the corresponding GET request. | 183 | * The key of the corresponding GET request. |
184 | */ | 184 | */ |
185 | GNUNET_HashCode key; | 185 | struct GNUNET_HashCode key; |
186 | 186 | ||
187 | /* put path (if tracked) */ | 187 | /* put path (if tracked) */ |
188 | 188 | ||
@@ -241,7 +241,7 @@ struct PeerGetMessage | |||
241 | /** | 241 | /** |
242 | * The key we are looking for. | 242 | * The key we are looking for. |
243 | */ | 243 | */ |
244 | GNUNET_HashCode key; | 244 | struct GNUNET_HashCode key; |
245 | 245 | ||
246 | /* xquery */ | 246 | /* xquery */ |
247 | 247 | ||
@@ -424,7 +424,7 @@ static struct GNUNET_ATS_PerformanceHandle *atsAPI; | |||
424 | * on error (same hashcode) | 424 | * on error (same hashcode) |
425 | */ | 425 | */ |
426 | static int | 426 | static int |
427 | find_bucket (const GNUNET_HashCode * hc) | 427 | find_bucket (const struct GNUNET_HashCode * hc) |
428 | { | 428 | { |
429 | unsigned int bits; | 429 | unsigned int bits; |
430 | 430 | ||
@@ -518,10 +518,10 @@ struct BloomConstructorContext | |||
518 | * @return GNUNET_YES (we should continue to iterate) | 518 | * @return GNUNET_YES (we should continue to iterate) |
519 | */ | 519 | */ |
520 | static int | 520 | static int |
521 | add_known_to_bloom (void *cls, const GNUNET_HashCode * key, void *value) | 521 | add_known_to_bloom (void *cls, const struct GNUNET_HashCode * key, void *value) |
522 | { | 522 | { |
523 | struct BloomConstructorContext *ctx = cls; | 523 | struct BloomConstructorContext *ctx = cls; |
524 | GNUNET_HashCode mh; | 524 | struct GNUNET_HashCode mh; |
525 | 525 | ||
526 | GNUNET_BLOCK_mingle_hash (key, ctx->bf_mutator, &mh); | 526 | GNUNET_BLOCK_mingle_hash (key, ctx->bf_mutator, &mh); |
527 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 527 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -874,7 +874,7 @@ get_forward_count (uint32_t hop_count, uint32_t target_replication) | |||
874 | * the two hash codes increases | 874 | * the two hash codes increases |
875 | */ | 875 | */ |
876 | static unsigned int | 876 | static unsigned int |
877 | get_distance (const GNUNET_HashCode * target, const GNUNET_HashCode * have) | 877 | get_distance (const struct GNUNET_HashCode * target, const struct GNUNET_HashCode * have) |
878 | { | 878 | { |
879 | unsigned int bucket; | 879 | unsigned int bucket; |
880 | unsigned int msb; | 880 | unsigned int msb; |
@@ -911,7 +911,7 @@ get_distance (const GNUNET_HashCode * target, const GNUNET_HashCode * have) | |||
911 | * mismatching bit at 'bucket' */ | 911 | * mismatching bit at 'bucket' */ |
912 | lsb = 0; | 912 | lsb = 0; |
913 | for (i = bucket + 1; | 913 | for (i = bucket + 1; |
914 | (i < sizeof (GNUNET_HashCode) * 8) && (i < bucket + 1 + 32 - 9); i++) | 914 | (i < sizeof (struct GNUNET_HashCode) * 8) && (i < bucket + 1 + 32 - 9); i++) |
915 | { | 915 | { |
916 | if (GNUNET_CRYPTO_hash_get_bit (target, i) != | 916 | if (GNUNET_CRYPTO_hash_get_bit (target, i) != |
917 | GNUNET_CRYPTO_hash_get_bit (have, i)) | 917 | GNUNET_CRYPTO_hash_get_bit (have, i)) |
@@ -934,7 +934,7 @@ get_distance (const GNUNET_HashCode * target, const GNUNET_HashCode * have) | |||
934 | * GNUNET_NO otherwise. | 934 | * GNUNET_NO otherwise. |
935 | */ | 935 | */ |
936 | static int | 936 | static int |
937 | am_closest_peer (const GNUNET_HashCode * key, | 937 | am_closest_peer (const struct GNUNET_HashCode * key, |
938 | const struct GNUNET_CONTAINER_BloomFilter *bloom) | 938 | const struct GNUNET_CONTAINER_BloomFilter *bloom) |
939 | { | 939 | { |
940 | int bits; | 940 | int bits; |
@@ -943,7 +943,7 @@ am_closest_peer (const GNUNET_HashCode * key, | |||
943 | int count; | 943 | int count; |
944 | struct PeerInfo *pos; | 944 | struct PeerInfo *pos; |
945 | 945 | ||
946 | if (0 == memcmp (&my_identity.hashPubKey, key, sizeof (GNUNET_HashCode))) | 946 | if (0 == memcmp (&my_identity.hashPubKey, key, sizeof (struct GNUNET_HashCode))) |
947 | return GNUNET_YES; | 947 | return GNUNET_YES; |
948 | bucket_num = find_bucket (key); | 948 | bucket_num = find_bucket (key); |
949 | GNUNET_assert (bucket_num >= 0); | 949 | GNUNET_assert (bucket_num >= 0); |
@@ -989,7 +989,7 @@ am_closest_peer (const GNUNET_HashCode * key, | |||
989 | * @return Peer to route to, or NULL on error | 989 | * @return Peer to route to, or NULL on error |
990 | */ | 990 | */ |
991 | static struct PeerInfo * | 991 | static struct PeerInfo * |
992 | select_peer (const GNUNET_HashCode * key, | 992 | select_peer (const struct GNUNET_HashCode * key, |
993 | const struct GNUNET_CONTAINER_BloomFilter *bloom, uint32_t hops) | 993 | const struct GNUNET_CONTAINER_BloomFilter *bloom, uint32_t hops) |
994 | { | 994 | { |
995 | unsigned int bc; | 995 | unsigned int bc; |
@@ -1115,7 +1115,7 @@ select_peer (const GNUNET_HashCode * key, | |||
1115 | * @return number of peers returned in 'targets'. | 1115 | * @return number of peers returned in 'targets'. |
1116 | */ | 1116 | */ |
1117 | static unsigned int | 1117 | static unsigned int |
1118 | get_target_peers (const GNUNET_HashCode * key, | 1118 | get_target_peers (const struct GNUNET_HashCode * key, |
1119 | struct GNUNET_CONTAINER_BloomFilter *bloom, | 1119 | struct GNUNET_CONTAINER_BloomFilter *bloom, |
1120 | uint32_t hop_count, uint32_t target_replication, | 1120 | uint32_t hop_count, uint32_t target_replication, |
1121 | struct PeerInfo ***targets) | 1121 | struct PeerInfo ***targets) |
@@ -1185,7 +1185,7 @@ GDS_NEIGHBOURS_handle_put (enum GNUNET_BLOCK_Type type, | |||
1185 | struct GNUNET_TIME_Absolute expiration_time, | 1185 | struct GNUNET_TIME_Absolute expiration_time, |
1186 | uint32_t hop_count, | 1186 | uint32_t hop_count, |
1187 | struct GNUNET_CONTAINER_BloomFilter *bf, | 1187 | struct GNUNET_CONTAINER_BloomFilter *bf, |
1188 | const GNUNET_HashCode * key, | 1188 | const struct GNUNET_HashCode * key, |
1189 | unsigned int put_path_length, | 1189 | unsigned int put_path_length, |
1190 | struct GNUNET_PeerIdentity *put_path, | 1190 | struct GNUNET_PeerIdentity *put_path, |
1191 | const void *data, size_t data_size) | 1191 | const void *data, size_t data_size) |
@@ -1295,7 +1295,7 @@ void | |||
1295 | GDS_NEIGHBOURS_handle_get (enum GNUNET_BLOCK_Type type, | 1295 | GDS_NEIGHBOURS_handle_get (enum GNUNET_BLOCK_Type type, |
1296 | enum GNUNET_DHT_RouteOption options, | 1296 | enum GNUNET_DHT_RouteOption options, |
1297 | uint32_t desired_replication_level, | 1297 | uint32_t desired_replication_level, |
1298 | uint32_t hop_count, const GNUNET_HashCode * key, | 1298 | uint32_t hop_count, const struct GNUNET_HashCode * key, |
1299 | const void *xquery, size_t xquery_size, | 1299 | const void *xquery, size_t xquery_size, |
1300 | const struct GNUNET_CONTAINER_BloomFilter *reply_bf, | 1300 | const struct GNUNET_CONTAINER_BloomFilter *reply_bf, |
1301 | uint32_t reply_bf_mutator, | 1301 | uint32_t reply_bf_mutator, |
@@ -1405,7 +1405,7 @@ void | |||
1405 | GDS_NEIGHBOURS_handle_reply (const struct GNUNET_PeerIdentity *target, | 1405 | GDS_NEIGHBOURS_handle_reply (const struct GNUNET_PeerIdentity *target, |
1406 | enum GNUNET_BLOCK_Type type, | 1406 | enum GNUNET_BLOCK_Type type, |
1407 | struct GNUNET_TIME_Absolute expiration_time, | 1407 | struct GNUNET_TIME_Absolute expiration_time, |
1408 | const GNUNET_HashCode * key, | 1408 | const struct GNUNET_HashCode * key, |
1409 | unsigned int put_path_length, | 1409 | unsigned int put_path_length, |
1410 | const struct GNUNET_PeerIdentity *put_path, | 1410 | const struct GNUNET_PeerIdentity *put_path, |
1411 | unsigned int get_path_length, | 1411 | unsigned int get_path_length, |
@@ -1508,7 +1508,7 @@ handle_dht_p2p_put (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
1508 | size_t payload_size; | 1508 | size_t payload_size; |
1509 | enum GNUNET_DHT_RouteOption options; | 1509 | enum GNUNET_DHT_RouteOption options; |
1510 | struct GNUNET_CONTAINER_BloomFilter *bf; | 1510 | struct GNUNET_CONTAINER_BloomFilter *bf; |
1511 | GNUNET_HashCode test_key; | 1511 | struct GNUNET_HashCode test_key; |
1512 | 1512 | ||
1513 | msize = ntohs (message->size); | 1513 | msize = ntohs (message->size); |
1514 | if (msize < sizeof (struct PeerPutMessage)) | 1514 | if (msize < sizeof (struct PeerPutMessage)) |
@@ -1541,7 +1541,7 @@ handle_dht_p2p_put (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
1541 | &test_key)) | 1541 | &test_key)) |
1542 | { | 1542 | { |
1543 | case GNUNET_YES: | 1543 | case GNUNET_YES: |
1544 | if (0 != memcmp (&test_key, &put->key, sizeof (GNUNET_HashCode))) | 1544 | if (0 != memcmp (&test_key, &put->key, sizeof (struct GNUNET_HashCode))) |
1545 | { | 1545 | { |
1546 | GNUNET_break_op (0); | 1546 | GNUNET_break_op (0); |
1547 | return GNUNET_YES; | 1547 | return GNUNET_YES; |
@@ -1615,14 +1615,14 @@ handle_dht_p2p_put (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
1615 | */ | 1615 | */ |
1616 | static void | 1616 | static void |
1617 | handle_find_peer (const struct GNUNET_PeerIdentity *sender, | 1617 | handle_find_peer (const struct GNUNET_PeerIdentity *sender, |
1618 | const GNUNET_HashCode * key, | 1618 | const struct GNUNET_HashCode * key, |
1619 | struct GNUNET_CONTAINER_BloomFilter *bf, uint32_t bf_mutator) | 1619 | struct GNUNET_CONTAINER_BloomFilter *bf, uint32_t bf_mutator) |
1620 | { | 1620 | { |
1621 | int bucket_idx; | 1621 | int bucket_idx; |
1622 | struct PeerBucket *bucket; | 1622 | struct PeerBucket *bucket; |
1623 | struct PeerInfo *peer; | 1623 | struct PeerInfo *peer; |
1624 | unsigned int choice; | 1624 | unsigned int choice; |
1625 | GNUNET_HashCode mhash; | 1625 | struct GNUNET_HashCode mhash; |
1626 | const struct GNUNET_HELLO_Message *hello; | 1626 | const struct GNUNET_HELLO_Message *hello; |
1627 | 1627 | ||
1628 | /* first, check about our own HELLO */ | 1628 | /* first, check about our own HELLO */ |
@@ -1657,7 +1657,7 @@ handle_find_peer (const struct GNUNET_PeerIdentity *sender, | |||
1657 | } | 1657 | } |
1658 | 1658 | ||
1659 | /* then, also consider sending a random HELLO from the closest bucket */ | 1659 | /* then, also consider sending a random HELLO from the closest bucket */ |
1660 | if (0 == memcmp (&my_identity.hashPubKey, key, sizeof (GNUNET_HashCode))) | 1660 | if (0 == memcmp (&my_identity.hashPubKey, key, sizeof (struct GNUNET_HashCode))) |
1661 | bucket_idx = closest_bucket; | 1661 | bucket_idx = closest_bucket; |
1662 | else | 1662 | else |
1663 | bucket_idx = GNUNET_MIN (closest_bucket, find_bucket (key)); | 1663 | bucket_idx = GNUNET_MIN (closest_bucket, find_bucket (key)); |
diff --git a/src/dht/gnunet-service-dht_neighbours.h b/src/dht/gnunet-service-dht_neighbours.h index 329763846..b3b33e318 100644 --- a/src/dht/gnunet-service-dht_neighbours.h +++ b/src/dht/gnunet-service-dht_neighbours.h | |||
@@ -57,7 +57,7 @@ GDS_NEIGHBOURS_handle_put (enum GNUNET_BLOCK_Type type, | |||
57 | struct GNUNET_TIME_Absolute expiration_time, | 57 | struct GNUNET_TIME_Absolute expiration_time, |
58 | uint32_t hop_count, | 58 | uint32_t hop_count, |
59 | struct GNUNET_CONTAINER_BloomFilter *bf, | 59 | struct GNUNET_CONTAINER_BloomFilter *bf, |
60 | const GNUNET_HashCode * key, | 60 | const struct GNUNET_HashCode * key, |
61 | unsigned int put_path_length, | 61 | unsigned int put_path_length, |
62 | struct GNUNET_PeerIdentity *put_path, | 62 | struct GNUNET_PeerIdentity *put_path, |
63 | const void *data, size_t data_size); | 63 | const void *data, size_t data_size); |
@@ -84,7 +84,7 @@ void | |||
84 | GDS_NEIGHBOURS_handle_get (enum GNUNET_BLOCK_Type type, | 84 | GDS_NEIGHBOURS_handle_get (enum GNUNET_BLOCK_Type type, |
85 | enum GNUNET_DHT_RouteOption options, | 85 | enum GNUNET_DHT_RouteOption options, |
86 | uint32_t desired_replication_level, | 86 | uint32_t desired_replication_level, |
87 | uint32_t hop_count, const GNUNET_HashCode * key, | 87 | uint32_t hop_count, const struct GNUNET_HashCode * key, |
88 | const void *xquery, size_t xquery_size, | 88 | const void *xquery, size_t xquery_size, |
89 | const struct GNUNET_CONTAINER_BloomFilter *reply_bf, | 89 | const struct GNUNET_CONTAINER_BloomFilter *reply_bf, |
90 | uint32_t reply_bf_mutator, | 90 | uint32_t reply_bf_mutator, |
@@ -111,7 +111,7 @@ void | |||
111 | GDS_NEIGHBOURS_handle_reply (const struct GNUNET_PeerIdentity *target, | 111 | GDS_NEIGHBOURS_handle_reply (const struct GNUNET_PeerIdentity *target, |
112 | enum GNUNET_BLOCK_Type type, | 112 | enum GNUNET_BLOCK_Type type, |
113 | struct GNUNET_TIME_Absolute expiration_time, | 113 | struct GNUNET_TIME_Absolute expiration_time, |
114 | const GNUNET_HashCode * key, | 114 | const struct GNUNET_HashCode * key, |
115 | unsigned int put_path_length, | 115 | unsigned int put_path_length, |
116 | const struct GNUNET_PeerIdentity *put_path, | 116 | const struct GNUNET_PeerIdentity *put_path, |
117 | unsigned int get_path_length, | 117 | unsigned int get_path_length, |
diff --git a/src/dht/gnunet-service-dht_routing.c b/src/dht/gnunet-service-dht_routing.c index 013d8562f..c1dca4e21 100644 --- a/src/dht/gnunet-service-dht_routing.c +++ b/src/dht/gnunet-service-dht_routing.c | |||
@@ -50,7 +50,7 @@ struct RecentRequest | |||
50 | /** | 50 | /** |
51 | * Key of this request. | 51 | * Key of this request. |
52 | */ | 52 | */ |
53 | GNUNET_HashCode key; | 53 | struct GNUNET_HashCode key; |
54 | 54 | ||
55 | /** | 55 | /** |
56 | * Position of this node in the min heap. | 56 | * Position of this node in the min heap. |
@@ -160,15 +160,15 @@ struct ProcessContext | |||
160 | * GNUNET_SYSERR if the result is malformed or type unsupported | 160 | * GNUNET_SYSERR if the result is malformed or type unsupported |
161 | */ | 161 | */ |
162 | static int | 162 | static int |
163 | process (void *cls, const GNUNET_HashCode * key, void *value) | 163 | process (void *cls, const struct GNUNET_HashCode * key, void *value) |
164 | { | 164 | { |
165 | struct ProcessContext *pc = cls; | 165 | struct ProcessContext *pc = cls; |
166 | struct RecentRequest *rr = value; | 166 | struct RecentRequest *rr = value; |
167 | enum GNUNET_BLOCK_EvaluationResult eval; | 167 | enum GNUNET_BLOCK_EvaluationResult eval; |
168 | unsigned int gpl; | 168 | unsigned int gpl; |
169 | unsigned int ppl; | 169 | unsigned int ppl; |
170 | GNUNET_HashCode hc; | 170 | struct GNUNET_HashCode hc; |
171 | const GNUNET_HashCode *eval_key; | 171 | const struct GNUNET_HashCode *eval_key; |
172 | 172 | ||
173 | if ((rr->type != GNUNET_BLOCK_TYPE_ANY) && (rr->type != pc->type)) | 173 | if ((rr->type != GNUNET_BLOCK_TYPE_ANY) && (rr->type != pc->type)) |
174 | return GNUNET_OK; /* type missmatch */ | 174 | return GNUNET_OK; /* type missmatch */ |
@@ -266,7 +266,7 @@ process (void *cls, const GNUNET_HashCode * key, void *value) | |||
266 | void | 266 | void |
267 | GDS_ROUTING_process (enum GNUNET_BLOCK_Type type, | 267 | GDS_ROUTING_process (enum GNUNET_BLOCK_Type type, |
268 | struct GNUNET_TIME_Absolute expiration_time, | 268 | struct GNUNET_TIME_Absolute expiration_time, |
269 | const GNUNET_HashCode * key, unsigned int put_path_length, | 269 | const struct GNUNET_HashCode * key, unsigned int put_path_length, |
270 | const struct GNUNET_PeerIdentity *put_path, | 270 | const struct GNUNET_PeerIdentity *put_path, |
271 | unsigned int get_path_length, | 271 | unsigned int get_path_length, |
272 | const struct GNUNET_PeerIdentity *get_path, | 272 | const struct GNUNET_PeerIdentity *get_path, |
@@ -339,7 +339,7 @@ void | |||
339 | GDS_ROUTING_add (const struct GNUNET_PeerIdentity *sender, | 339 | GDS_ROUTING_add (const struct GNUNET_PeerIdentity *sender, |
340 | enum GNUNET_BLOCK_Type type, | 340 | enum GNUNET_BLOCK_Type type, |
341 | enum GNUNET_DHT_RouteOption options, | 341 | enum GNUNET_DHT_RouteOption options, |
342 | const GNUNET_HashCode * key, const void *xquery, | 342 | const struct GNUNET_HashCode * key, const void *xquery, |
343 | size_t xquery_size, | 343 | size_t xquery_size, |
344 | const struct GNUNET_CONTAINER_BloomFilter *reply_bf, | 344 | const struct GNUNET_CONTAINER_BloomFilter *reply_bf, |
345 | uint32_t reply_bf_mutator) | 345 | uint32_t reply_bf_mutator) |
diff --git a/src/dht/gnunet-service-dht_routing.h b/src/dht/gnunet-service-dht_routing.h index 9b12c71de..56326aa60 100644 --- a/src/dht/gnunet-service-dht_routing.h +++ b/src/dht/gnunet-service-dht_routing.h | |||
@@ -51,7 +51,7 @@ | |||
51 | void | 51 | void |
52 | GDS_ROUTING_process (enum GNUNET_BLOCK_Type type, | 52 | GDS_ROUTING_process (enum GNUNET_BLOCK_Type type, |
53 | struct GNUNET_TIME_Absolute expiration_time, | 53 | struct GNUNET_TIME_Absolute expiration_time, |
54 | const GNUNET_HashCode * key, unsigned int put_path_length, | 54 | const struct GNUNET_HashCode * key, unsigned int put_path_length, |
55 | const struct GNUNET_PeerIdentity *put_path, | 55 | const struct GNUNET_PeerIdentity *put_path, |
56 | unsigned int get_path_length, | 56 | unsigned int get_path_length, |
57 | const struct GNUNET_PeerIdentity *get_path, | 57 | const struct GNUNET_PeerIdentity *get_path, |
@@ -74,7 +74,7 @@ void | |||
74 | GDS_ROUTING_add (const struct GNUNET_PeerIdentity *sender, | 74 | GDS_ROUTING_add (const struct GNUNET_PeerIdentity *sender, |
75 | enum GNUNET_BLOCK_Type type, | 75 | enum GNUNET_BLOCK_Type type, |
76 | enum GNUNET_DHT_RouteOption options, | 76 | enum GNUNET_DHT_RouteOption options, |
77 | const GNUNET_HashCode * key, const void *xquery, | 77 | const struct GNUNET_HashCode * key, const void *xquery, |
78 | size_t xquery_size, | 78 | size_t xquery_size, |
79 | const struct GNUNET_CONTAINER_BloomFilter *reply_bf, | 79 | const struct GNUNET_CONTAINER_BloomFilter *reply_bf, |
80 | uint32_t reply_bf_mutator); | 80 | uint32_t reply_bf_mutator); |
diff --git a/src/dht/plugin_block_dht.c b/src/dht/plugin_block_dht.c index 3c016aedc..ac4732cff 100644 --- a/src/dht/plugin_block_dht.c +++ b/src/dht/plugin_block_dht.c | |||
@@ -51,13 +51,13 @@ | |||
51 | */ | 51 | */ |
52 | static enum GNUNET_BLOCK_EvaluationResult | 52 | static enum GNUNET_BLOCK_EvaluationResult |
53 | block_plugin_dht_evaluate (void *cls, enum GNUNET_BLOCK_Type type, | 53 | block_plugin_dht_evaluate (void *cls, enum GNUNET_BLOCK_Type type, |
54 | const GNUNET_HashCode * query, | 54 | const struct GNUNET_HashCode * query, |
55 | struct GNUNET_CONTAINER_BloomFilter **bf, | 55 | struct GNUNET_CONTAINER_BloomFilter **bf, |
56 | int32_t bf_mutator, const void *xquery, | 56 | int32_t bf_mutator, const void *xquery, |
57 | size_t xquery_size, const void *reply_block, | 57 | size_t xquery_size, const void *reply_block, |
58 | size_t reply_block_size) | 58 | size_t reply_block_size) |
59 | { | 59 | { |
60 | GNUNET_HashCode mhash; | 60 | struct GNUNET_HashCode mhash; |
61 | const struct GNUNET_HELLO_Message *hello; | 61 | const struct GNUNET_HELLO_Message *hello; |
62 | struct GNUNET_PeerIdentity pid; | 62 | struct GNUNET_PeerIdentity pid; |
63 | const struct GNUNET_MessageHeader *msg; | 63 | const struct GNUNET_MessageHeader *msg; |
@@ -122,7 +122,7 @@ block_plugin_dht_evaluate (void *cls, enum GNUNET_BLOCK_Type type, | |||
122 | static int | 122 | static int |
123 | block_plugin_dht_get_key (void *cls, enum GNUNET_BLOCK_Type type, | 123 | block_plugin_dht_get_key (void *cls, enum GNUNET_BLOCK_Type type, |
124 | const void *block, size_t block_size, | 124 | const void *block, size_t block_size, |
125 | GNUNET_HashCode * key) | 125 | struct GNUNET_HashCode * key) |
126 | { | 126 | { |
127 | const struct GNUNET_MessageHeader *msg; | 127 | const struct GNUNET_MessageHeader *msg; |
128 | const struct GNUNET_HELLO_Message *hello; | 128 | const struct GNUNET_HELLO_Message *hello; |
diff --git a/src/dht/test_dht_api.c b/src/dht/test_dht_api.c index 000ad3344..40d7f5b77 100644 --- a/src/dht/test_dht_api.c +++ b/src/dht/test_dht_api.c | |||
@@ -177,7 +177,7 @@ test_get_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
177 | 177 | ||
178 | static void | 178 | static void |
179 | test_get_iterator (void *cls, struct GNUNET_TIME_Absolute exp, | 179 | test_get_iterator (void *cls, struct GNUNET_TIME_Absolute exp, |
180 | const GNUNET_HashCode * key, | 180 | const struct GNUNET_HashCode * key, |
181 | const struct GNUNET_PeerIdentity *get_path, | 181 | const struct GNUNET_PeerIdentity *get_path, |
182 | unsigned int get_path_length, | 182 | unsigned int get_path_length, |
183 | const struct GNUNET_PeerIdentity *put_path, | 183 | const struct GNUNET_PeerIdentity *put_path, |
@@ -201,9 +201,9 @@ static void | |||
201 | test_get (void *cls, int success) | 201 | test_get (void *cls, int success) |
202 | { | 202 | { |
203 | struct PeerContext *peer = cls; | 203 | struct PeerContext *peer = cls; |
204 | GNUNET_HashCode hash; | 204 | struct GNUNET_HashCode hash; |
205 | 205 | ||
206 | memset (&hash, 42, sizeof (GNUNET_HashCode)); | 206 | memset (&hash, 42, sizeof (struct GNUNET_HashCode)); |
207 | 207 | ||
208 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Called test_get!\n"); | 208 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Called test_get!\n"); |
209 | 209 | ||
@@ -238,11 +238,11 @@ static void | |||
238 | test_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 238 | test_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
239 | { | 239 | { |
240 | struct PeerContext *peer = cls; | 240 | struct PeerContext *peer = cls; |
241 | GNUNET_HashCode hash; | 241 | struct GNUNET_HashCode hash; |
242 | char *data; | 242 | char *data; |
243 | size_t data_size = 42; | 243 | size_t data_size = 42; |
244 | 244 | ||
245 | memset (&hash, 42, sizeof (GNUNET_HashCode)); | 245 | memset (&hash, 42, sizeof (struct GNUNET_HashCode)); |
246 | data = GNUNET_malloc (data_size); | 246 | data = GNUNET_malloc (data_size); |
247 | memset (data, 43, data_size); | 247 | memset (data, 43, data_size); |
248 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Called test_put!\n"); | 248 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Called test_put!\n"); |
diff --git a/src/dht/test_dht_monitor.c b/src/dht/test_dht_monitor.c index 31c5e7bc4..77fa6609d 100644 --- a/src/dht/test_dht_monitor.c +++ b/src/dht/test_dht_monitor.c | |||
@@ -184,7 +184,7 @@ disconnect_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
184 | 184 | ||
185 | static void | 185 | static void |
186 | dht_get_id_handler (void *cls, struct GNUNET_TIME_Absolute exp, | 186 | dht_get_id_handler (void *cls, struct GNUNET_TIME_Absolute exp, |
187 | const GNUNET_HashCode * key, | 187 | const struct GNUNET_HashCode * key, |
188 | const struct GNUNET_PeerIdentity *get_path, | 188 | const struct GNUNET_PeerIdentity *get_path, |
189 | unsigned int get_path_length, | 189 | unsigned int get_path_length, |
190 | const struct GNUNET_PeerIdentity *put_path, | 190 | const struct GNUNET_PeerIdentity *put_path, |
@@ -195,9 +195,9 @@ dht_get_id_handler (void *cls, struct GNUNET_TIME_Absolute exp, | |||
195 | 195 | ||
196 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 196 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
197 | "test: ************* FOUND!!! ***********\n"); | 197 | "test: ************* FOUND!!! ***********\n"); |
198 | if (sizeof (GNUNET_HashCode) == size) | 198 | if (sizeof (struct GNUNET_HashCode) == size) |
199 | { | 199 | { |
200 | const GNUNET_HashCode *h = data; | 200 | const struct GNUNET_HashCode *h = data; |
201 | 201 | ||
202 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Contents: %s\n", | 202 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Contents: %s\n", |
203 | GNUNET_h2s_full (h)); | 203 | GNUNET_h2s_full (h)); |
@@ -314,7 +314,7 @@ monitor_get_cb (void *cls, | |||
314 | uint32_t desired_replication_level, | 314 | uint32_t desired_replication_level, |
315 | unsigned int path_length, | 315 | unsigned int path_length, |
316 | const struct GNUNET_PeerIdentity *path, | 316 | const struct GNUNET_PeerIdentity *path, |
317 | const GNUNET_HashCode * key) | 317 | const struct GNUNET_HashCode * key) |
318 | { | 318 | { |
319 | const char *s_key; | 319 | const char *s_key; |
320 | unsigned int i; | 320 | unsigned int i; |
@@ -355,7 +355,7 @@ monitor_put_cb (void *cls, | |||
355 | unsigned int path_length, | 355 | unsigned int path_length, |
356 | const struct GNUNET_PeerIdentity *path, | 356 | const struct GNUNET_PeerIdentity *path, |
357 | struct GNUNET_TIME_Absolute exp, | 357 | struct GNUNET_TIME_Absolute exp, |
358 | const GNUNET_HashCode * key, | 358 | const struct GNUNET_HashCode * key, |
359 | const void *data, | 359 | const void *data, |
360 | size_t size) | 360 | size_t size) |
361 | { | 361 | { |
@@ -397,7 +397,7 @@ monitor_res_cb (void *cls, | |||
397 | const struct GNUNET_PeerIdentity *put_path, | 397 | const struct GNUNET_PeerIdentity *put_path, |
398 | unsigned int put_path_length, | 398 | unsigned int put_path_length, |
399 | struct GNUNET_TIME_Absolute exp, | 399 | struct GNUNET_TIME_Absolute exp, |
400 | const GNUNET_HashCode * key, | 400 | const struct GNUNET_HashCode * key, |
401 | const void *data, | 401 | const void *data, |
402 | size_t size) | 402 | size_t size) |
403 | { | 403 | { |
diff --git a/src/dht/test_dht_multipeer.c b/src/dht/test_dht_multipeer.c index f4f99a633..656b4ac06 100644 --- a/src/dht/test_dht_multipeer.c +++ b/src/dht/test_dht_multipeer.c | |||
@@ -492,7 +492,7 @@ static void | |||
492 | get_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 492 | get_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
493 | { | 493 | { |
494 | struct TestGetContext *test_get = cls; | 494 | struct TestGetContext *test_get = cls; |
495 | GNUNET_HashCode search_key; /* Key stored under */ | 495 | struct GNUNET_HashCode search_key; /* Key stored under */ |
496 | char original_data[TEST_DATA_SIZE]; /* Made up data to store */ | 496 | char original_data[TEST_DATA_SIZE]; /* Made up data to store */ |
497 | 497 | ||
498 | test_get->task = GNUNET_SCHEDULER_NO_TASK; | 498 | test_get->task = GNUNET_SCHEDULER_NO_TASK; |
@@ -548,7 +548,7 @@ get_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
548 | */ | 548 | */ |
549 | static void | 549 | static void |
550 | get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, | 550 | get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, |
551 | const GNUNET_HashCode * key, | 551 | const struct GNUNET_HashCode * key, |
552 | const struct GNUNET_PeerIdentity *get_path, | 552 | const struct GNUNET_PeerIdentity *get_path, |
553 | unsigned int get_path_length, | 553 | unsigned int get_path_length, |
554 | const struct GNUNET_PeerIdentity *put_path, | 554 | const struct GNUNET_PeerIdentity *put_path, |
@@ -556,7 +556,7 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, | |||
556 | size_t size, const void *data) | 556 | size_t size, const void *data) |
557 | { | 557 | { |
558 | struct TestGetContext *test_get = cls; | 558 | struct TestGetContext *test_get = cls; |
559 | GNUNET_HashCode search_key; /* Key stored under */ | 559 | struct GNUNET_HashCode search_key; /* Key stored under */ |
560 | char original_data[TEST_DATA_SIZE]; /* Made up data to store */ | 560 | char original_data[TEST_DATA_SIZE]; /* Made up data to store */ |
561 | 561 | ||
562 | memset (original_data, test_get->uid, sizeof (original_data)); | 562 | memset (original_data, test_get->uid, sizeof (original_data)); |
@@ -586,7 +586,7 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, | |||
586 | } | 586 | } |
587 | #endif | 587 | #endif |
588 | 588 | ||
589 | if ((0 != memcmp (&search_key, key, sizeof (GNUNET_HashCode))) || | 589 | if ((0 != memcmp (&search_key, key, sizeof (struct GNUNET_HashCode))) || |
590 | (0 != memcmp (original_data, data, sizeof (original_data)))) | 590 | (0 != memcmp (original_data, data, sizeof (original_data)))) |
591 | { | 591 | { |
592 | FPRINTF (stderr, "%s", "Key or data is not the same as was inserted!\n"); | 592 | FPRINTF (stderr, "%s", "Key or data is not the same as was inserted!\n"); |
@@ -606,7 +606,7 @@ static void | |||
606 | do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 606 | do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
607 | { | 607 | { |
608 | struct TestGetContext *test_get = cls; | 608 | struct TestGetContext *test_get = cls; |
609 | GNUNET_HashCode key; /* Made up key to store data under */ | 609 | struct GNUNET_HashCode key; /* Made up key to store data under */ |
610 | char data[TEST_DATA_SIZE]; /* Made up data to store */ | 610 | char data[TEST_DATA_SIZE]; /* Made up data to store */ |
611 | 611 | ||
612 | if (outstanding_gets > MAX_OUTSTANDING_GETS) | 612 | if (outstanding_gets > MAX_OUTSTANDING_GETS) |
@@ -700,7 +700,7 @@ static void | |||
700 | do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 700 | do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
701 | { | 701 | { |
702 | struct TestPutContext *test_put = cls; | 702 | struct TestPutContext *test_put = cls; |
703 | GNUNET_HashCode key; /* Made up key to store data under */ | 703 | struct GNUNET_HashCode key; /* Made up key to store data under */ |
704 | char data[TEST_DATA_SIZE]; /* Made up data to store */ | 704 | char data[TEST_DATA_SIZE]; /* Made up data to store */ |
705 | 705 | ||
706 | test_put->task = GNUNET_SCHEDULER_NO_TASK; | 706 | test_put->task = GNUNET_SCHEDULER_NO_TASK; |
diff --git a/src/dht/test_dht_topo.c b/src/dht/test_dht_topo.c index 64918fe26..1dd867f2b 100644 --- a/src/dht/test_dht_topo.c +++ b/src/dht/test_dht_topo.c | |||
@@ -190,7 +190,7 @@ disconnect_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
190 | 190 | ||
191 | static void | 191 | static void |
192 | dht_get_id_handler (void *cls, struct GNUNET_TIME_Absolute exp, | 192 | dht_get_id_handler (void *cls, struct GNUNET_TIME_Absolute exp, |
193 | const GNUNET_HashCode * key, | 193 | const struct GNUNET_HashCode * key, |
194 | const struct GNUNET_PeerIdentity *get_path, | 194 | const struct GNUNET_PeerIdentity *get_path, |
195 | unsigned int get_path_length, | 195 | unsigned int get_path_length, |
196 | const struct GNUNET_PeerIdentity *put_path, | 196 | const struct GNUNET_PeerIdentity *put_path, |
@@ -199,9 +199,9 @@ dht_get_id_handler (void *cls, struct GNUNET_TIME_Absolute exp, | |||
199 | { | 199 | { |
200 | int i; | 200 | int i; |
201 | 201 | ||
202 | if (sizeof (GNUNET_HashCode) == size) | 202 | if (sizeof (struct GNUNET_HashCode) == size) |
203 | { | 203 | { |
204 | const GNUNET_HashCode *h = data; | 204 | const struct GNUNET_HashCode *h = data; |
205 | 205 | ||
206 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " Contents: %s\n", | 206 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " Contents: %s\n", |
207 | GNUNET_h2s_full (h)); | 207 | GNUNET_h2s_full (h)); |
diff --git a/src/dht/test_dht_twopeer.c b/src/dht/test_dht_twopeer.c index a4664946f..8579013e3 100644 --- a/src/dht/test_dht_twopeer.c +++ b/src/dht/test_dht_twopeer.c | |||
@@ -169,7 +169,7 @@ do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | |||
169 | */ | 169 | */ |
170 | static void | 170 | static void |
171 | get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, | 171 | get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, |
172 | const GNUNET_HashCode * key, | 172 | const struct GNUNET_HashCode * key, |
173 | const struct GNUNET_PeerIdentity *get_path, | 173 | const struct GNUNET_PeerIdentity *get_path, |
174 | unsigned int get_path_length, | 174 | unsigned int get_path_length, |
175 | const struct GNUNET_PeerIdentity *put_path, | 175 | const struct GNUNET_PeerIdentity *put_path, |
@@ -179,7 +179,7 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, | |||
179 | struct PeerGetContext *get_context = cls; | 179 | struct PeerGetContext *get_context = cls; |
180 | 180 | ||
181 | if (0 != | 181 | if (0 != |
182 | memcmp (&get_context->peer->hashPubKey, key, sizeof (GNUNET_HashCode))) | 182 | memcmp (&get_context->peer->hashPubKey, key, sizeof (struct GNUNET_HashCode))) |
183 | { | 183 | { |
184 | FPRINTF (stderr, "%s", "??\n"); | 184 | FPRINTF (stderr, "%s", "??\n"); |
185 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 185 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
diff --git a/src/dht/test_dht_twopeer_get_put.c b/src/dht/test_dht_twopeer_get_put.c index 775418fe1..3a27db21b 100644 --- a/src/dht/test_dht_twopeer_get_put.c +++ b/src/dht/test_dht_twopeer_get_put.c | |||
@@ -214,22 +214,22 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
214 | */ | 214 | */ |
215 | void | 215 | void |
216 | get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, | 216 | get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, |
217 | const GNUNET_HashCode * key, | 217 | const struct GNUNET_HashCode * key, |
218 | const struct GNUNET_PeerIdentity *get_path, | 218 | const struct GNUNET_PeerIdentity *get_path, |
219 | unsigned int get_path_size, | 219 | unsigned int get_path_size, |
220 | const struct GNUNET_PeerIdentity *put_path, | 220 | const struct GNUNET_PeerIdentity *put_path, |
221 | unsigned int put_path_size, enum GNUNET_BLOCK_Type type, | 221 | unsigned int put_path_size, enum GNUNET_BLOCK_Type type, |
222 | size_t size, const void *result_data) | 222 | size_t size, const void *result_data) |
223 | { | 223 | { |
224 | GNUNET_HashCode original_key; /* Key data was stored data under */ | 224 | struct GNUNET_HashCode original_key; /* Key data was stored data under */ |
225 | char original_data[4]; /* Made up data that was stored */ | 225 | char original_data[4]; /* Made up data that was stored */ |
226 | 226 | ||
227 | memset (&original_key, 42, sizeof (GNUNET_HashCode)); /* Set the key to what it was set to previously */ | 227 | memset (&original_key, 42, sizeof (struct GNUNET_HashCode)); /* Set the key to what it was set to previously */ |
228 | memset (original_data, 43, sizeof (original_data)); | 228 | memset (original_data, 43, sizeof (original_data)); |
229 | 229 | ||
230 | #if DNS | 230 | #if DNS |
231 | if ((sizeof (original_data) != size) || | 231 | if ((sizeof (original_data) != size) || |
232 | (0 != memcmp (&data.service_descriptor, key, sizeof (GNUNET_HashCode))) || | 232 | (0 != memcmp (&data.service_descriptor, key, sizeof (struct GNUNET_HashCode))) || |
233 | (0 != memcmp ((char *) &data, result_data, sizeof (original_data)))) | 233 | (0 != memcmp ((char *) &data, result_data, sizeof (original_data)))) |
234 | { | 234 | { |
235 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 235 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
@@ -241,7 +241,7 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, | |||
241 | } | 241 | } |
242 | #else | 242 | #else |
243 | if ((sizeof (original_data) != size) || | 243 | if ((sizeof (original_data) != size) || |
244 | (0 != memcmp (&original_key, key, sizeof (GNUNET_HashCode))) || | 244 | (0 != memcmp (&original_key, key, sizeof (struct GNUNET_HashCode))) || |
245 | (0 != memcmp (original_data, result_data, sizeof (original_data)))) | 245 | (0 != memcmp (original_data, result_data, sizeof (original_data)))) |
246 | { | 246 | { |
247 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 247 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
@@ -264,12 +264,12 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, | |||
264 | static void | 264 | static void |
265 | do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 265 | do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
266 | { | 266 | { |
267 | GNUNET_HashCode key; /* Key for data lookup */ | 267 | struct GNUNET_HashCode key; /* Key for data lookup */ |
268 | 268 | ||
269 | #if DNS | 269 | #if DNS |
270 | memcpy (&key, &data.service_descriptor, sizeof (GNUNET_HashCode)); | 270 | memcpy (&key, &data.service_descriptor, sizeof (struct GNUNET_HashCode)); |
271 | #else | 271 | #else |
272 | memset (&key, 42, sizeof (GNUNET_HashCode)); /* Set the key to the same thing as when data was inserted */ | 272 | memset (&key, 42, sizeof (struct GNUNET_HashCode)); /* Set the key to the same thing as when data was inserted */ |
273 | #endif | 273 | #endif |
274 | global_get_handle = | 274 | global_get_handle = |
275 | GNUNET_DHT_get_start (peer2dht, | 275 | GNUNET_DHT_get_start (peer2dht, |
@@ -305,10 +305,10 @@ put_finished (void *cls, int success) | |||
305 | static void | 305 | static void |
306 | do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 306 | do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
307 | { | 307 | { |
308 | GNUNET_HashCode key; /* Made up key to store data under */ | 308 | struct GNUNET_HashCode key; /* Made up key to store data under */ |
309 | char data[4]; /* Made up data to store */ | 309 | char data[4]; /* Made up data to store */ |
310 | 310 | ||
311 | memset (&key, 42, sizeof (GNUNET_HashCode)); /* Set the key to something simple so we can issue GET request */ | 311 | memset (&key, 42, sizeof (struct GNUNET_HashCode)); /* Set the key to something simple so we can issue GET request */ |
312 | memset (data, 43, sizeof (data)); | 312 | memset (data, 43, sizeof (data)); |
313 | 313 | ||
314 | /* Insert the data at the first peer */ | 314 | /* Insert the data at the first peer */ |
diff --git a/src/dht/test_dht_twopeer_path_tracking.c b/src/dht/test_dht_twopeer_path_tracking.c index f45d3b6b7..86086b806 100644 --- a/src/dht/test_dht_twopeer_path_tracking.c +++ b/src/dht/test_dht_twopeer_path_tracking.c | |||
@@ -193,23 +193,23 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
193 | */ | 193 | */ |
194 | static void | 194 | static void |
195 | get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, | 195 | get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, |
196 | const GNUNET_HashCode * key, | 196 | const struct GNUNET_HashCode * key, |
197 | const struct GNUNET_PeerIdentity *get_path, | 197 | const struct GNUNET_PeerIdentity *get_path, |
198 | unsigned int get_path_length, | 198 | unsigned int get_path_length, |
199 | const struct GNUNET_PeerIdentity *put_path, | 199 | const struct GNUNET_PeerIdentity *put_path, |
200 | unsigned int put_path_length, enum GNUNET_BLOCK_Type type, | 200 | unsigned int put_path_length, enum GNUNET_BLOCK_Type type, |
201 | size_t size, const void *data) | 201 | size_t size, const void *data) |
202 | { | 202 | { |
203 | GNUNET_HashCode original_key; /* Key data was stored data under */ | 203 | struct GNUNET_HashCode original_key; /* Key data was stored data under */ |
204 | char original_data[4]; /* Made up data that was stored */ | 204 | char original_data[4]; /* Made up data that was stored */ |
205 | 205 | ||
206 | memset (&original_key, 42, sizeof (GNUNET_HashCode)); /* Set the key to what it was set to previously */ | 206 | memset (&original_key, 42, sizeof (struct GNUNET_HashCode)); /* Set the key to what it was set to previously */ |
207 | memset (original_data, 43, sizeof (original_data)); | 207 | memset (original_data, 43, sizeof (original_data)); |
208 | #if VERBOSE | 208 | #if VERBOSE |
209 | unsigned int i; | 209 | unsigned int i; |
210 | #endif | 210 | #endif |
211 | 211 | ||
212 | if ((0 != memcmp (&original_key, key, sizeof (GNUNET_HashCode))) || | 212 | if ((0 != memcmp (&original_key, key, sizeof (struct GNUNET_HashCode))) || |
213 | (0 != memcmp (original_data, data, sizeof (original_data)))) | 213 | (0 != memcmp (original_data, data, sizeof (original_data)))) |
214 | { | 214 | { |
215 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 215 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -251,13 +251,13 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, | |||
251 | static void | 251 | static void |
252 | put_finished (void *cls, int success) | 252 | put_finished (void *cls, int success) |
253 | { | 253 | { |
254 | GNUNET_HashCode key; /* Key for data lookup */ | 254 | struct GNUNET_HashCode key; /* Key for data lookup */ |
255 | 255 | ||
256 | GNUNET_SCHEDULER_cancel (die_task); | 256 | GNUNET_SCHEDULER_cancel (die_task); |
257 | die_task = | 257 | die_task = |
258 | GNUNET_SCHEDULER_add_delayed (GET_TIMEOUT, &end_badly, | 258 | GNUNET_SCHEDULER_add_delayed (GET_TIMEOUT, &end_badly, |
259 | "waiting for get response (data not found)"); | 259 | "waiting for get response (data not found)"); |
260 | memset (&key, 42, sizeof (GNUNET_HashCode)); /* Set the key to the same thing as when data was inserted */ | 260 | memset (&key, 42, sizeof (struct GNUNET_HashCode)); /* Set the key to the same thing as when data was inserted */ |
261 | global_get_handle = | 261 | global_get_handle = |
262 | GNUNET_DHT_get_start (peer2dht, | 262 | GNUNET_DHT_get_start (peer2dht, |
263 | GNUNET_BLOCK_TYPE_TEST, &key, 1, | 263 | GNUNET_BLOCK_TYPE_TEST, &key, 1, |
@@ -271,10 +271,10 @@ put_finished (void *cls, int success) | |||
271 | static void | 271 | static void |
272 | do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 272 | do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
273 | { | 273 | { |
274 | GNUNET_HashCode key; /* Made up key to store data under */ | 274 | struct GNUNET_HashCode key; /* Made up key to store data under */ |
275 | char data[4]; /* Made up data to store */ | 275 | char data[4]; /* Made up data to store */ |
276 | 276 | ||
277 | memset (&key, 42, sizeof (GNUNET_HashCode)); /* Set the key to something simple so we can issue GET request */ | 277 | memset (&key, 42, sizeof (struct GNUNET_HashCode)); /* Set the key to something simple so we can issue GET request */ |
278 | memset (data, 43, sizeof (data)); | 278 | memset (data, 43, sizeof (data)); |
279 | 279 | ||
280 | /* Insert the data at the first peer */ | 280 | /* Insert the data at the first peer */ |
diff --git a/src/dht/test_dht_twopeer_put_get.c b/src/dht/test_dht_twopeer_put_get.c index 9419194b9..d577a856a 100644 --- a/src/dht/test_dht_twopeer_put_get.c +++ b/src/dht/test_dht_twopeer_put_get.c | |||
@@ -217,21 +217,21 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
217 | */ | 217 | */ |
218 | static void | 218 | static void |
219 | get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, | 219 | get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, |
220 | const GNUNET_HashCode * key, | 220 | const struct GNUNET_HashCode * key, |
221 | const struct GNUNET_PeerIdentity *get_path, | 221 | const struct GNUNET_PeerIdentity *get_path, |
222 | unsigned int get_path_size, | 222 | unsigned int get_path_size, |
223 | const struct GNUNET_PeerIdentity *put_path, | 223 | const struct GNUNET_PeerIdentity *put_path, |
224 | unsigned int put_path_size, enum GNUNET_BLOCK_Type type, | 224 | unsigned int put_path_size, enum GNUNET_BLOCK_Type type, |
225 | size_t size, const void *result_data) | 225 | size_t size, const void *result_data) |
226 | { | 226 | { |
227 | GNUNET_HashCode original_key; /* Key data was stored data under */ | 227 | struct GNUNET_HashCode original_key; /* Key data was stored data under */ |
228 | char original_data[4]; /* Made up data that was stored */ | 228 | char original_data[4]; /* Made up data that was stored */ |
229 | 229 | ||
230 | memset (&original_key, 42, sizeof (GNUNET_HashCode)); /* Set the key to what it was set to previously */ | 230 | memset (&original_key, 42, sizeof (struct GNUNET_HashCode)); /* Set the key to what it was set to previously */ |
231 | memset (original_data, 43, sizeof (original_data)); | 231 | memset (original_data, 43, sizeof (original_data)); |
232 | 232 | ||
233 | if ((sizeof (original_data) != size) || | 233 | if ((sizeof (original_data) != size) || |
234 | (0 != memcmp (&original_key, key, sizeof (GNUNET_HashCode))) || | 234 | (0 != memcmp (&original_key, key, sizeof (struct GNUNET_HashCode))) || |
235 | (0 != memcmp (original_data, result_data, sizeof (original_data)))) | 235 | (0 != memcmp (original_data, result_data, sizeof (original_data)))) |
236 | { | 236 | { |
237 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 237 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
@@ -256,7 +256,7 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, | |||
256 | static void | 256 | static void |
257 | put_finished (void *cls, int success) | 257 | put_finished (void *cls, int success) |
258 | { | 258 | { |
259 | GNUNET_HashCode key; /* Key for data lookup */ | 259 | struct GNUNET_HashCode key; /* Key for data lookup */ |
260 | 260 | ||
261 | put_op = NULL; | 261 | put_op = NULL; |
262 | GNUNET_SCHEDULER_cancel (die_task); | 262 | GNUNET_SCHEDULER_cancel (die_task); |
@@ -264,7 +264,7 @@ put_finished (void *cls, int success) | |||
264 | GNUNET_SCHEDULER_add_delayed (GET_TIMEOUT, &end_badly, | 264 | GNUNET_SCHEDULER_add_delayed (GET_TIMEOUT, &end_badly, |
265 | "waiting for get response (data not found)"); | 265 | "waiting for get response (data not found)"); |
266 | 266 | ||
267 | memset (&key, 42, sizeof (GNUNET_HashCode)); /* Set the key to the same thing as when data was inserted */ | 267 | memset (&key, 42, sizeof (struct GNUNET_HashCode)); /* Set the key to the same thing as when data was inserted */ |
268 | global_get_handle = | 268 | global_get_handle = |
269 | GNUNET_DHT_get_start (peer2dht, | 269 | GNUNET_DHT_get_start (peer2dht, |
270 | GNUNET_BLOCK_TYPE_TEST, &key, 1, GNUNET_DHT_RO_NONE, | 270 | GNUNET_BLOCK_TYPE_TEST, &key, 1, GNUNET_DHT_RO_NONE, |
@@ -278,10 +278,10 @@ put_finished (void *cls, int success) | |||
278 | static void | 278 | static void |
279 | do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 279 | do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
280 | { | 280 | { |
281 | GNUNET_HashCode key; /* Made up key to store data under */ | 281 | struct GNUNET_HashCode key; /* Made up key to store data under */ |
282 | char data[4]; /* Made up data to store */ | 282 | char data[4]; /* Made up data to store */ |
283 | 283 | ||
284 | memset (&key, 42, sizeof (GNUNET_HashCode)); /* Set the key to something simple so we can issue GET request */ | 284 | memset (&key, 42, sizeof (struct GNUNET_HashCode)); /* Set the key to something simple so we can issue GET request */ |
285 | memset (data, 43, sizeof (data)); | 285 | memset (data, 43, sizeof (data)); |
286 | 286 | ||
287 | /* Insert the data at the first peer */ | 287 | /* Insert the data at the first peer */ |