aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-service-dht_routing.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-09-27 09:58:15 +0000
committerChristian Grothoff <christian@grothoff.org>2011-09-27 09:58:15 +0000
commitedab319f07cc940f64111b6e89da245a2afcf71a (patch)
tree20124181cbcc8e0e36d98b448369b7e62a1b0192 /src/dht/gnunet-service-dht_routing.c
parent4f3f80d05ac7101b8049c352d70abe97bc81ab23 (diff)
downloadgnunet-edab319f07cc940f64111b6e89da245a2afcf71a.tar.gz
gnunet-edab319f07cc940f64111b6e89da245a2afcf71a.zip
making some files compile
Diffstat (limited to 'src/dht/gnunet-service-dht_routing.c')
-rw-r--r--src/dht/gnunet-service-dht_routing.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/dht/gnunet-service-dht_routing.c b/src/dht/gnunet-service-dht_routing.c
index 1d43cfd3d..4024c61fb 100644
--- a/src/dht/gnunet-service-dht_routing.c
+++ b/src/dht/gnunet-service-dht_routing.c
@@ -23,8 +23,10 @@
23 * @brief GNUnet DHT tracking of requests for routing replies 23 * @brief GNUnet DHT tracking of requests for routing replies
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 */ 25 */
26 26#include "platform.h"
27#include "gnunet-service-dht_neighbours.h"
27#include "gnunet-service-dht_routing.h" 28#include "gnunet-service-dht_routing.h"
29#include "gnunet-service-dht.h"
28 30
29 31
30/** 32/**
@@ -118,7 +120,7 @@ struct ProcessContext
118 /** 120 /**
119 * Expiration time of the result. 121 * Expiration time of the result.
120 */ 122 */
121 GNUNET_TIME_Absolute expiration_time; 123 struct GNUNET_TIME_Absolute expiration_time;
122 124
123 /** 125 /**
124 * Number of entries in 'put_path'. 126 * Number of entries in 'put_path'.
@@ -164,7 +166,7 @@ process (void *cls,
164 if ( (rr->type != GNUNET_BLOCK_TYPE_ANY) && 166 if ( (rr->type != GNUNET_BLOCK_TYPE_ANY) &&
165 (rr->type != pc->type) ) 167 (rr->type != pc->type) )
166 return GNUNET_OK; /* type missmatch */ 168 return GNUNET_OK; /* type missmatch */
167 eval = GNUNET_BLOCK_evaluate (block_context, 169 eval = GNUNET_BLOCK_evaluate (GDS_block_context,
168 pc->type, 170 pc->type,
169 key, 171 key,
170 &rr->reply_bf, 172 &rr->reply_bf,
@@ -177,7 +179,7 @@ process (void *cls,
177 { 179 {
178 case GNUNET_BLOCK_EVALUATION_OK_MORE: 180 case GNUNET_BLOCK_EVALUATION_OK_MORE:
179 case GNUNET_BLOCK_EVALUATION_OK_LAST: 181 case GNUNET_BLOCK_EVALUATION_OK_LAST:
180 GDS_NEIGHBOURS_handle_reply (&rr->target, 182 GDS_NEIGHBOURS_handle_reply (&rr->peer,
181 pc->type, 183 pc->type,
182 pc->expiration_time, 184 pc->expiration_time,
183 key, 185 key,
@@ -194,7 +196,7 @@ process (void *cls,
194 GNUNET_break_op (0); 196 GNUNET_break_op (0);
195 return GNUNET_SYSERR; 197 return GNUNET_SYSERR;
196 case GNUNET_BLOCK_EVALUATION_REQUEST_VALID: 198 case GNUNET_BLOCK_EVALUATION_REQUEST_VALID:
197 case GNUNET_BLOCK_EVALUATION_REQUEST_VALID: 199 case GNUNET_BLOCK_EVALUATION_REQUEST_INVALID:
198 GNUNET_break (0); 200 GNUNET_break (0);
199 return GNUNET_OK; 201 return GNUNET_OK;
200 case GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED: 202 case GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED:
@@ -226,7 +228,7 @@ process (void *cls,
226 */ 228 */
227void 229void
228GDS_ROUTING_process (enum GNUNET_BLOCK_Type type, 230GDS_ROUTING_process (enum GNUNET_BLOCK_Type type,
229 GNUNET_TIME_Absolute expiration_time, 231 struct GNUNET_TIME_Absolute expiration_time,
230 const GNUNET_HashCode *key, 232 const GNUNET_HashCode *key,
231 unsigned int put_path_length, 233 unsigned int put_path_length,
232 const struct GNUNET_PeerIdentity *put_path, 234 const struct GNUNET_PeerIdentity *put_path,
@@ -245,10 +247,10 @@ GDS_ROUTING_process (enum GNUNET_BLOCK_Type type,
245 pc.get_path = get_path; 247 pc.get_path = get_path;
246 pc.data = data; 248 pc.data = data;
247 pc.data_size = data_size; 249 pc.data_size = data_size;
248 GNUNET_CONTAINER_multihashmap_iterate (recent_map, 250 GNUNET_CONTAINER_multihashmap_get_multiple (recent_map,
249 key, 251 key,
250 &process, 252 &process,
251 &pc); 253 &pc);
252} 254}
253 255
254 256
@@ -264,7 +266,7 @@ GDS_ROUTING_process (enum GNUNET_BLOCK_Type type,
264 * @param reply_bf_mutator mutator for reply_bf 266 * @param reply_bf_mutator mutator for reply_bf
265*/ 267*/
266void 268void
267GDS_ROUTING_add (const GNUNET_PeerIdentity *sender, 269GDS_ROUTING_add (const struct GNUNET_PeerIdentity *sender,
268 enum GNUNET_BLOCK_Type type, 270 enum GNUNET_BLOCK_Type type,
269 const GNUNET_HashCode *key, 271 const GNUNET_HashCode *key,
270 const void *xquery, 272 const void *xquery,
@@ -279,7 +281,7 @@ GDS_ROUTING_add (const GNUNET_PeerIdentity *sender,
279 recent_req = GNUNET_CONTAINER_heap_peek (recent_heap); 281 recent_req = GNUNET_CONTAINER_heap_peek (recent_heap);
280 GNUNET_assert (recent_req != NULL); 282 GNUNET_assert (recent_req != NULL);
281 GNUNET_CONTAINER_heap_remove_node (recent_req->heap_node); 283 GNUNET_CONTAINER_heap_remove_node (recent_req->heap_node);
282 GNUNET_CONTAINER_bloomfilter_free (recent_req->bloom); 284 GNUNET_CONTAINER_bloomfilter_free (recent_req->reply_bf);
283 GNUNET_free (recent_req); 285 GNUNET_free (recent_req);
284 } 286 }
285 287
@@ -313,7 +315,7 @@ GDS_ROUTING_init ()
313 recent_heap = 315 recent_heap =
314 GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN); 316 GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN);
315 recent_map = 317 recent_map =
316 GNUNET_CONTAINER_multihashmap_create (MAX_BUCKETS / 8); 318 GNUNET_CONTAINER_multihashmap_create (DHT_MAX_RECENT * 4 / 3);
317} 319}
318 320
319 321
@@ -330,10 +332,10 @@ GDS_ROUTING_done ()
330 recent_req = GNUNET_CONTAINER_heap_peek (recent_heap); 332 recent_req = GNUNET_CONTAINER_heap_peek (recent_heap);
331 GNUNET_assert (recent_req != NULL); 333 GNUNET_assert (recent_req != NULL);
332 GNUNET_CONTAINER_heap_remove_node (recent_req->heap_node); 334 GNUNET_CONTAINER_heap_remove_node (recent_req->heap_node);
333 GNUNET_CONTAINER_bloomfilter_free (recent_req->bloom); 335 GNUNET_CONTAINER_bloomfilter_free (recent_req->reply_bf);
334 GNUNET_free (recent_req); 336 GNUNET_free (recent_req);
335 } 337 }
336 GNUNET_assert (0 == GNUNET_CONTAINER_heap_size (recent_heap)); 338 GNUNET_assert (0 == GNUNET_CONTAINER_heap_get_size (recent_heap));
337 GNUNET_CONTAINER_heap_destroy (recent_heap); 339 GNUNET_CONTAINER_heap_destroy (recent_heap);
338 recent_heap = NULL; 340 recent_heap = NULL;
339 GNUNET_CONTAINER_multihashmap_destroy (recent_map); 341 GNUNET_CONTAINER_multihashmap_destroy (recent_map);