aboutsummaryrefslogtreecommitdiff
path: root/src/dht
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-02-28 21:12:03 +0000
committerChristian Grothoff <christian@grothoff.org>2015-02-28 21:12:03 +0000
commit3a2737d76679c68331fad0be0b89d8efdcde5079 (patch)
tree5bd4ef163438954cdcb75558e6368a297629b56d /src/dht
parent9c46ed792caae948fd99cca44deaf5a265af7614 (diff)
downloadgnunet-3a2737d76679c68331fad0be0b89d8efdcde5079.tar.gz
gnunet-3a2737d76679c68331fad0be0b89d8efdcde5079.zip
-extend block API to allow specifying flags, use this to allow reducing checks for replies from local DB
Diffstat (limited to 'src/dht')
-rw-r--r--src/dht/gnunet-service-dht_clients.c14
-rw-r--r--src/dht/gnunet-service-dht_datacache.c16
-rw-r--r--src/dht/gnunet-service-dht_neighbours.c13
-rw-r--r--src/dht/gnunet-service-dht_routing.c13
-rw-r--r--src/dht/gnunet-service-xdht_clients.c31
-rw-r--r--src/dht/gnunet-service-xdht_datacache.c49
-rw-r--r--src/dht/gnunet-service-xdht_neighbours.c1
-rw-r--r--src/dht/plugin_block_dht.c20
8 files changed, 104 insertions, 53 deletions
diff --git a/src/dht/gnunet-service-dht_clients.c b/src/dht/gnunet-service-dht_clients.c
index ae9e3f25d..ec957737f 100644
--- a/src/dht/gnunet-service-dht_clients.c
+++ b/src/dht/gnunet-service-dht_clients.c
@@ -1055,12 +1055,20 @@ forward_reply (void *cls, const struct GNUNET_HashCode * key, void *value)
1055 return GNUNET_YES; /* duplicate */ 1055 return GNUNET_YES; /* duplicate */
1056 } 1056 }
1057 eval = 1057 eval =
1058 GNUNET_BLOCK_evaluate (GDS_block_context, record->type, key, NULL, 0, 1058 GNUNET_BLOCK_evaluate (GDS_block_context,
1059 record->xquery, record->xquery_size, frc->data, 1059 record->type,
1060 GNUNET_BLOCK_EO_NONE,
1061 key,
1062 NULL,
1063 0,
1064 record->xquery,
1065 record->xquery_size,
1066 frc->data,
1060 frc->data_size); 1067 frc->data_size);
1061 LOG (GNUNET_ERROR_TYPE_DEBUG, 1068 LOG (GNUNET_ERROR_TYPE_DEBUG,
1062 "Evaluation result is %d for key %s for local client's query\n", 1069 "Evaluation result is %d for key %s for local client's query\n",
1063 (int) eval, GNUNET_h2s (key)); 1070 (int) eval,
1071 GNUNET_h2s (key));
1064 switch (eval) 1072 switch (eval)
1065 { 1073 {
1066 case GNUNET_BLOCK_EVALUATION_OK_LAST: 1074 case GNUNET_BLOCK_EVALUATION_OK_LAST:
diff --git a/src/dht/gnunet-service-dht_datacache.c b/src/dht/gnunet-service-dht_datacache.c
index 78f863e01..48ce941c1 100644
--- a/src/dht/gnunet-service-dht_datacache.c
+++ b/src/dht/gnunet-service-dht_datacache.c
@@ -148,12 +148,20 @@ datacache_get_iterator (void *cls,
148 enum GNUNET_BLOCK_EvaluationResult eval; 148 enum GNUNET_BLOCK_EvaluationResult eval;
149 149
150 eval = 150 eval =
151 GNUNET_BLOCK_evaluate (GDS_block_context, type, key, ctx->reply_bf, 151 GNUNET_BLOCK_evaluate (GDS_block_context,
152 ctx->reply_bf_mutator, ctx->xquery, 152 type,
153 ctx->xquery_size, data, size); 153 GNUNET_BLOCK_EO_NONE,
154 key,
155 ctx->reply_bf,
156 ctx->reply_bf_mutator,
157 ctx->xquery,
158 ctx->xquery_size,
159 data,
160 size);
154 LOG (GNUNET_ERROR_TYPE_DEBUG, 161 LOG (GNUNET_ERROR_TYPE_DEBUG,
155 "Found reply for query %s in datacache, evaluation result is %d\n", 162 "Found reply for query %s in datacache, evaluation result is %d\n",
156 GNUNET_h2s (key), (int) eval); 163 GNUNET_h2s (key),
164 (int) eval);
157 ctx->eval = eval; 165 ctx->eval = eval;
158 switch (eval) 166 switch (eval)
159 { 167 {
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c
index 9e23be3bc..caa226dad 100644
--- a/src/dht/gnunet-service-dht_neighbours.c
+++ b/src/dht/gnunet-service-dht_neighbours.c
@@ -1708,6 +1708,7 @@ handle_dht_p2p_put (void *cls, const struct GNUNET_PeerIdentity *peer,
1708 { 1708 {
1709 switch (GNUNET_BLOCK_evaluate (GDS_block_context, 1709 switch (GNUNET_BLOCK_evaluate (GDS_block_context,
1710 ntohl (put->type), 1710 ntohl (put->type),
1711 GNUNET_BLOCK_EO_NONE,
1711 NULL, /* query */ 1712 NULL, /* query */
1712 NULL, 0, /* bloom filer */ 1713 NULL, 0, /* bloom filer */
1713 NULL, 0, /* xquery */ 1714 NULL, 0, /* xquery */
@@ -1953,8 +1954,16 @@ handle_dht_p2p_get (void *cls,
1953 GNUNET_CONTAINER_bloomfilter_init (&xquery[xquery_size], reply_bf_size, 1954 GNUNET_CONTAINER_bloomfilter_init (&xquery[xquery_size], reply_bf_size,
1954 GNUNET_CONSTANTS_BLOOMFILTER_K); 1955 GNUNET_CONSTANTS_BLOOMFILTER_K);
1955 eval = 1956 eval =
1956 GNUNET_BLOCK_evaluate (GDS_block_context, type, &get->key, &reply_bf, 1957 GNUNET_BLOCK_evaluate (GDS_block_context,
1957 get->bf_mutator, xquery, xquery_size, NULL, 0); 1958 type,
1959 GNUNET_BLOCK_EO_NONE,
1960 &get->key,
1961 &reply_bf,
1962 get->bf_mutator,
1963 xquery,
1964 xquery_size,
1965 NULL,
1966 0);
1958 if (eval != GNUNET_BLOCK_EVALUATION_REQUEST_VALID) 1967 if (eval != GNUNET_BLOCK_EVALUATION_REQUEST_VALID)
1959 { 1968 {
1960 /* request invalid or block type not supported */ 1969 /* request invalid or block type not supported */
diff --git a/src/dht/gnunet-service-dht_routing.c b/src/dht/gnunet-service-dht_routing.c
index e42db8073..318ebecb2 100644
--- a/src/dht/gnunet-service-dht_routing.c
+++ b/src/dht/gnunet-service-dht_routing.c
@@ -199,9 +199,16 @@ process (void *cls, const struct GNUNET_HashCode * key, void *value)
199 eval_key = key; 199 eval_key = key;
200 } 200 }
201 eval = 201 eval =
202 GNUNET_BLOCK_evaluate (GDS_block_context, pc->type, eval_key, 202 GNUNET_BLOCK_evaluate (GDS_block_context,
203 &rr->reply_bf, rr->reply_bf_mutator, rr->xquery, 203 pc->type,
204 rr->xquery_size, pc->data, pc->data_size); 204 GNUNET_BLOCK_EO_NONE,
205 eval_key,
206 &rr->reply_bf,
207 rr->reply_bf_mutator,
208 rr->xquery,
209 rr->xquery_size,
210 pc->data,
211 pc->data_size);
205 switch (eval) 212 switch (eval)
206 { 213 {
207 case GNUNET_BLOCK_EVALUATION_OK_MORE: 214 case GNUNET_BLOCK_EVALUATION_OK_MORE:
diff --git a/src/dht/gnunet-service-xdht_clients.c b/src/dht/gnunet-service-xdht_clients.c
index c9c9c7134..a055a652c 100644
--- a/src/dht/gnunet-service-xdht_clients.c
+++ b/src/dht/gnunet-service-xdht_clients.c
@@ -487,7 +487,7 @@ forward_reply (void *cls, const struct GNUNET_HashCode * key, void *value)
487 int do_free; 487 int do_free;
488 struct GNUNET_HashCode ch; 488 struct GNUNET_HashCode ch;
489 unsigned int i; 489 unsigned int i;
490 490
491 LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG, 491 LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG,
492 "XVINE CLIENT-RESULT %s\n", 492 "XVINE CLIENT-RESULT %s\n",
493 GNUNET_h2s_full (key)); 493 GNUNET_h2s_full (key));
@@ -519,8 +519,13 @@ forward_reply (void *cls, const struct GNUNET_HashCode * key, void *value)
519 return GNUNET_YES; /* duplicate */ 519 return GNUNET_YES; /* duplicate */
520 } 520 }
521 eval = 521 eval =
522 GNUNET_BLOCK_evaluate (GDS_block_context, record->type, key, NULL, 0, 522 GNUNET_BLOCK_evaluate (GDS_block_context,
523 record->xquery, record->xquery_size, frc->data, 523 record->type,
524 GNUNET_BLOCK_EO_NONE,
525 key, NULL, 0,
526 record->xquery,
527 record->xquery_size,
528 frc->data,
524 frc->data_size); 529 frc->data_size);
525 LOG (GNUNET_ERROR_TYPE_DEBUG, 530 LOG (GNUNET_ERROR_TYPE_DEBUG,
526 "Evaluation result is %d for key %s for local client's query\n", 531 "Evaluation result is %d for key %s for local client's query\n",
@@ -834,7 +839,7 @@ GDS_CLIENTS_process_put (uint32_t options,
834 839
835 840
836/** 841/**
837 * Route the given request via the DHT. 842 * Route the given request via the DHT.
838 */ 843 */
839static void 844static void
840transmit_request (struct ClientQueryRecord *cqr) 845transmit_request (struct ClientQueryRecord *cqr)
@@ -843,16 +848,16 @@ transmit_request (struct ClientQueryRecord *cqr)
843 gettext_noop 848 gettext_noop
844 ("# GET requests from clients injected"), 1, 849 ("# GET requests from clients injected"), 1,
845 GNUNET_NO); 850 GNUNET_NO);
846 851
847 LOG (GNUNET_ERROR_TYPE_DEBUG, 852 LOG (GNUNET_ERROR_TYPE_DEBUG,
848 "Initiating GET for %s, replication %u, already have %u replies\n", 853 "Initiating GET for %s, replication %u, already have %u replies\n",
849 GNUNET_h2s (&cqr->key), 854 GNUNET_h2s (&cqr->key),
850 cqr->replication, 855 cqr->replication,
851 cqr->seen_replies_count); 856 cqr->seen_replies_count);
852 857
853 GDS_NEIGHBOURS_handle_get (&cqr->key, cqr->type, cqr->msg_options, 858 GDS_NEIGHBOURS_handle_get (&cqr->key, cqr->type, cqr->msg_options,
854 cqr->replication); 859 cqr->replication);
855 860
856 /* exponential back-off for retries. 861 /* exponential back-off for retries.
857 * max GNUNET_TIME_STD_EXPONENTIAL_BACKOFF_THRESHOLD (15 min) */ 862 * max GNUNET_TIME_STD_EXPONENTIAL_BACKOFF_THRESHOLD (15 min) */
858 cqr->retry_frequency = GNUNET_TIME_STD_BACKOFF (cqr->retry_frequency); 863 cqr->retry_frequency = GNUNET_TIME_STD_BACKOFF (cqr->retry_frequency);
@@ -941,8 +946,8 @@ handle_dht_local_put (void *cls, struct GNUNET_SERVER_Client *client,
941 ntohl (put_msg->type), 946 ntohl (put_msg->type),
942 size - sizeof (struct GNUNET_DHT_ClientPutMessage), 947 size - sizeof (struct GNUNET_DHT_ClientPutMessage),
943 &put_msg[1]); 948 &put_msg[1]);
944 949
945 GDS_NEIGHBOURS_handle_put (&put_msg->key, 950 GDS_NEIGHBOURS_handle_put (&put_msg->key,
946 ntohl (put_msg->type), ntohl (put_msg->options), 951 ntohl (put_msg->type), ntohl (put_msg->options),
947 ntohl (put_msg->desired_replication_level), 952 ntohl (put_msg->desired_replication_level),
948 GNUNET_TIME_absolute_ntoh (put_msg->expiration), 953 GNUNET_TIME_absolute_ntoh (put_msg->expiration),
@@ -1013,11 +1018,11 @@ handle_dht_local_get (void *cls, struct GNUNET_SERVER_Client *client,
1013 cqr->replication = ntohl (get->desired_replication_level); 1018 cqr->replication = ntohl (get->desired_replication_level);
1014 cqr->msg_options = ntohl (get->options); 1019 cqr->msg_options = ntohl (get->options);
1015 cqr->type = ntohl (get->type); 1020 cqr->type = ntohl (get->type);
1016 1021
1017 // FIXME use cqr->key, set multihashmap create to GNUNET_YES 1022 // FIXME use cqr->key, set multihashmap create to GNUNET_YES
1018 GNUNET_CONTAINER_multihashmap_put (forward_map, &get->key, cqr, 1023 GNUNET_CONTAINER_multihashmap_put (forward_map, &get->key, cqr,
1019 GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); 1024 GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
1020 1025
1021 struct GNUNET_PeerIdentity my_identity; 1026 struct GNUNET_PeerIdentity my_identity;
1022 my_identity = GDS_NEIGHBOURS_get_my_id(); 1027 my_identity = GDS_NEIGHBOURS_get_my_id();
1023 GDS_CLIENTS_process_get (ntohl (get->options), 1028 GDS_CLIENTS_process_get (ntohl (get->options),
@@ -1309,7 +1314,7 @@ handle_dht_act_malicious (void *cls, struct GNUNET_SERVER_Client *client,
1309 1314
1310 msg = (const struct GNUNET_DHT_ActMaliciousMessage *)message; 1315 msg = (const struct GNUNET_DHT_ActMaliciousMessage *)message;
1311 malicious_action = msg->action; 1316 malicious_action = msg->action;
1312 1317
1313 if(GNUNET_OK == GDS_NEIGHBOURS_act_malicious (malicious_action)) 1318 if(GNUNET_OK == GDS_NEIGHBOURS_act_malicious (malicious_action))
1314 { 1319 {
1315 pm = GNUNET_malloc (sizeof (struct PendingMessage) + 1320 pm = GNUNET_malloc (sizeof (struct PendingMessage) +
diff --git a/src/dht/gnunet-service-xdht_datacache.c b/src/dht/gnunet-service-xdht_datacache.c
index 558832e5b..9fbff7dfb 100644
--- a/src/dht/gnunet-service-xdht_datacache.c
+++ b/src/dht/gnunet-service-xdht_datacache.c
@@ -64,7 +64,7 @@ GDS_DATACACHE_handle_put (struct GNUNET_TIME_Absolute expiration,
64 const void *data) 64 const void *data)
65{ 65{
66 int r; 66 int r;
67 67
68 if (NULL == datacache) 68 if (NULL == datacache)
69 { 69 {
70 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 70 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
@@ -76,12 +76,12 @@ GDS_DATACACHE_handle_put (struct GNUNET_TIME_Absolute expiration,
76 GNUNET_break (0); 76 GNUNET_break (0);
77 return; 77 return;
78 } 78 }
79 79
80 /* Put size is actual data size plus struct overhead plus path length (if any) */ 80 /* Put size is actual data size plus struct overhead plus path length (if any) */
81 GNUNET_STATISTICS_update (GDS_stats, 81 GNUNET_STATISTICS_update (GDS_stats,
82 gettext_noop ("# ITEMS stored in datacache"), 1, 82 gettext_noop ("# ITEMS stored in datacache"), 1,
83 GNUNET_NO); 83 GNUNET_NO);
84 84
85 struct GNUNET_PeerIdentity peer = GDS_NEIGHBOURS_get_my_id(); 85 struct GNUNET_PeerIdentity peer = GDS_NEIGHBOURS_get_my_id();
86 DEBUG("DATACACHE_PUT KEY = %s, peer = %s\n",GNUNET_h2s(key),GNUNET_i2s(&peer)); 86 DEBUG("DATACACHE_PUT KEY = %s, peer = %s\n",GNUNET_h2s(key),GNUNET_i2s(&peer));
87 r = GNUNET_DATACACHE_put (datacache, key, data_size, data, type, expiration, 87 r = GNUNET_DATACACHE_put (datacache, key, data_size, data, type, expiration,
@@ -180,32 +180,41 @@ struct GetRequestContext
180/** 180/**
181 * Iterator for local get request results, 181 * Iterator for local get request results,
182 * 182 *
183 * @param cls closure for iterator, a DatacacheGetContext 183 * @param cls closure for iterator, a `struct GetRequestContext`
184 * @param exp when does this value expire?
185 * @param key the key this data is stored under 184 * @param key the key this data is stored under
186 * @param size the size of the data identified by key 185 * @param size the size of the data identified by key
187 * @param data the actual data 186 * @param data the actual data
188 * @param type the type of the data 187 * @param type the type of the data
189 * @param put_path_length number of peers in 'put_path' 188 * @param exp when does this value expire?
189 * @param put_path_length number of peers in @a put_path
190 * @param put_path path the reply took on put 190 * @param put_path path the reply took on put
191 * @return GNUNET_OK to continue iteration, anything else 191 * @return #GNUNET_OK to continue iteration, anything else
192 * to stop iteration. 192 * to stop iteration.
193 */ 193 */
194static int 194static int
195datacache_get_iterator (void *cls, 195datacache_get_iterator (void *cls,
196 const struct GNUNET_HashCode * key, size_t size, 196 const struct GNUNET_HashCode *key,
197 const char *data, enum GNUNET_BLOCK_Type type, 197 size_t size,
198 struct GNUNET_TIME_Absolute exp, 198 const char *data,
199 unsigned int put_path_length, 199 enum GNUNET_BLOCK_Type type,
200 const struct GNUNET_PeerIdentity *put_path) 200 struct GNUNET_TIME_Absolute exp,
201 unsigned int put_path_length,
202 const struct GNUNET_PeerIdentity *put_path)
201{ 203{
202 struct GetRequestContext *ctx = cls; 204 struct GetRequestContext *ctx = cls;
203 enum GNUNET_BLOCK_EvaluationResult eval; 205 enum GNUNET_BLOCK_EvaluationResult eval;
204 206
205 eval = 207 eval =
206 GNUNET_BLOCK_evaluate (GDS_block_context, type, key, ctx->reply_bf, 208 GNUNET_BLOCK_evaluate (GDS_block_context,
207 ctx->reply_bf_mutator, ctx->xquery, 209 type,
208 ctx->xquery_size, data, size); 210 GNUNET_BLOCK_EO_NONE,
211 key,
212 ctx->reply_bf,
213 ctx->reply_bf_mutator,
214 ctx->xquery,
215 ctx->xquery_size,
216 data,
217 size);
209 LOG (GNUNET_ERROR_TYPE_DEBUG, 218 LOG (GNUNET_ERROR_TYPE_DEBUG,
210 "Found reply for query %s in datacache, evaluation result is %d\n", 219 "Found reply for query %s in datacache, evaluation result is %d\n",
211 GNUNET_h2s (key), (int) eval); 220 GNUNET_h2s (key), (int) eval);
@@ -221,7 +230,7 @@ datacache_get_iterator (void *cls,
221 ("# Good RESULTS found in datacache"), 1, 230 ("# Good RESULTS found in datacache"), 1,
222 GNUNET_NO); 231 GNUNET_NO);
223 struct GNUNET_PeerIdentity *get_path; 232 struct GNUNET_PeerIdentity *get_path;
224 get_path = GNUNET_malloc (sizeof (struct GNUNET_PeerIdentity) * 233 get_path = GNUNET_malloc (sizeof (struct GNUNET_PeerIdentity) *
225 ctx->get_path_length); 234 ctx->get_path_length);
226 struct GetPath *iterator; 235 struct GetPath *iterator;
227 iterator = ctx->head; 236 iterator = ctx->head;
@@ -271,7 +280,7 @@ datacache_get_iterator (void *cls,
271 _("Unsupported block type (%u) in local response!\n"), type); 280 _("Unsupported block type (%u) in local response!\n"), type);
272 break; 281 break;
273 } 282 }
274 283
275 return (eval == GNUNET_BLOCK_EVALUATION_OK_LAST) ? GNUNET_NO : GNUNET_OK; 284 return (eval == GNUNET_BLOCK_EVALUATION_OK_LAST) ? GNUNET_NO : GNUNET_OK;
276} 285}
277 286
@@ -315,13 +324,13 @@ GDS_DATACACHE_handle_get (const struct GNUNET_HashCode * key,
315 ctx.reply_bf = reply_bf; 324 ctx.reply_bf = reply_bf;
316 ctx.reply_bf_mutator = reply_bf_mutator; 325 ctx.reply_bf_mutator = reply_bf_mutator;
317 ctx.get_path_length = get_path_length; 326 ctx.get_path_length = get_path_length;
318 327
319 if (next_hop != NULL) 328 if (next_hop != NULL)
320 { 329 {
321 memcpy (&(ctx.next_hop), next_hop, sizeof (struct GNUNET_PeerIdentity)); 330 memcpy (&(ctx.next_hop), next_hop, sizeof (struct GNUNET_PeerIdentity));
322 } 331 }
323 unsigned int i = 0; 332 unsigned int i = 0;
324 333
325 ctx.head = NULL; 334 ctx.head = NULL;
326 ctx.tail = NULL; 335 ctx.tail = NULL;
327 if (get_path != NULL) 336 if (get_path != NULL)
@@ -337,7 +346,7 @@ GDS_DATACACHE_handle_get (const struct GNUNET_HashCode * key,
337 i++; 346 i++;
338 } 347 }
339 } 348 }
340 349
341 r = GNUNET_DATACACHE_get (datacache, key, type, &datacache_get_iterator, 350 r = GNUNET_DATACACHE_get (datacache, key, type, &datacache_get_iterator,
342 &ctx); 351 &ctx);
343 DEBUG ("DATACACHE_GET for key %s completed (%d). %u results found.\n",GNUNET_h2s (key), ctx.eval, r); 352 DEBUG ("DATACACHE_GET for key %s completed (%d). %u results found.\n",GNUNET_h2s (key), ctx.eval, r);
diff --git a/src/dht/gnunet-service-xdht_neighbours.c b/src/dht/gnunet-service-xdht_neighbours.c
index 3d14fbcd4..8339f9ce1 100644
--- a/src/dht/gnunet-service-xdht_neighbours.c
+++ b/src/dht/gnunet-service-xdht_neighbours.c
@@ -3736,6 +3736,7 @@ handle_dht_p2p_put (void *cls, const struct GNUNET_PeerIdentity *peer,
3736 { 3736 {
3737 switch (GNUNET_BLOCK_evaluate (GDS_block_context, 3737 switch (GNUNET_BLOCK_evaluate (GDS_block_context,
3738 ntohl (put->block_type), 3738 ntohl (put->block_type),
3739 GNUNET_BLOCK_EO_NONE,
3739 NULL, /* query */ 3740 NULL, /* query */
3740 NULL, 0, /* bloom filer */ 3741 NULL, 0, /* bloom filer */
3741 NULL, 0, /* xquery */ 3742 NULL, 0, /* xquery */
diff --git a/src/dht/plugin_block_dht.c b/src/dht/plugin_block_dht.c
index dc26e0351..c5d902fa9 100644
--- a/src/dht/plugin_block_dht.c
+++ b/src/dht/plugin_block_dht.c
@@ -36,10 +36,11 @@
36 36
37/** 37/**
38 * Function called to validate a reply or a request. For 38 * Function called to validate a reply or a request. For
39 * request evaluation, simply pass "NULL" for the reply_block. 39 * request evaluation, simply pass "NULL" for the @a reply_block.
40 * 40 *
41 * @param cls closure 41 * @param cls closure
42 * @param type block type 42 * @param type block type
43 * @param eo control flags
43 * @param query original query (hash) 44 * @param query original query (hash)
44 * @param bf pointer to bloom filter associated with query; possibly updated (!) 45 * @param bf pointer to bloom filter associated with query; possibly updated (!)
45 * @param bf_mutator mutation value for @a bf 46 * @param bf_mutator mutation value for @a bf
@@ -50,11 +51,15 @@
50 * @return characterization of result 51 * @return characterization of result
51 */ 52 */
52static enum GNUNET_BLOCK_EvaluationResult 53static enum GNUNET_BLOCK_EvaluationResult
53block_plugin_dht_evaluate (void *cls, enum GNUNET_BLOCK_Type type, 54block_plugin_dht_evaluate (void *cls,
54 const struct GNUNET_HashCode * query, 55 enum GNUNET_BLOCK_Type type,
56 enum GNUNET_BLOCK_EvaluationOptions eo,
57 const struct GNUNET_HashCode *query,
55 struct GNUNET_CONTAINER_BloomFilter **bf, 58 struct GNUNET_CONTAINER_BloomFilter **bf,
56 int32_t bf_mutator, const void *xquery, 59 int32_t bf_mutator,
57 size_t xquery_size, const void *reply_block, 60 const void *xquery,
61 size_t xquery_size,
62 const void *reply_block,
58 size_t reply_block_size) 63 size_t reply_block_size)
59{ 64{
60 struct GNUNET_HashCode mhash; 65 struct GNUNET_HashCode mhash;
@@ -100,9 +105,8 @@ block_plugin_dht_evaluate (void *cls, enum GNUNET_BLOCK_Type type,
100 } 105 }
101 else 106 else
102 { 107 {
103 *bf = 108 *bf = GNUNET_CONTAINER_bloomfilter_init (NULL, 8,
104 GNUNET_CONTAINER_bloomfilter_init (NULL, 8, 109 GNUNET_CONSTANTS_BLOOMFILTER_K);
105 GNUNET_CONSTANTS_BLOOMFILTER_K);
106 } 110 }
107 GNUNET_CONTAINER_bloomfilter_add (*bf, &mhash); 111 GNUNET_CONTAINER_bloomfilter_add (*bf, &mhash);
108 } 112 }