diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-05-31 23:43:05 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-05-31 23:43:05 +0200 |
commit | edddc9384e9bc4331d57291de7318bbe401e49b0 (patch) | |
tree | be9387df3a4fa4e8cb71590501fb3740920c5bb6 /src/fs | |
parent | 02a2c3560aa08c3c7f389706b0e24007e2010bc5 (diff) | |
download | gnunet-edddc9384e9bc4331d57291de7318bbe401e49b0.tar.gz gnunet-edddc9384e9bc4331d57291de7318bbe401e49b0.zip |
protocol change: swap xquery and result filter, integrate mutator with result filter
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/gnunet-service-fs.c | 2 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs.h | 8 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_cp.c | 1 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_pr.c | 10 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_pr.h | 2 | ||||
-rw-r--r-- | src/fs/plugin_block_fs.c | 11 |
6 files changed, 7 insertions, 27 deletions
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c index 8c6c39885..05c7e2192 100644 --- a/src/fs/gnunet-service-fs.c +++ b/src/fs/gnunet-service-fs.c | |||
@@ -893,7 +893,7 @@ handle_client_start_search (void *cls, | |||
893 | &all_zeros, | 893 | &all_zeros, |
894 | sizeof(struct | 894 | sizeof(struct |
895 | GNUNET_PeerIdentity))) | 895 | GNUNET_PeerIdentity))) |
896 | ? &sm->target : NULL, NULL, 0, | 896 | ? &sm->target : NULL, NULL, |
897 | 0 /* bf */, | 897 | 0 /* bf */, |
898 | ntohl (sm->anonymity_level), | 898 | ntohl (sm->anonymity_level), |
899 | 0 /* priority */, | 899 | 0 /* priority */, |
diff --git a/src/fs/gnunet-service-fs.h b/src/fs/gnunet-service-fs.h index a6b73db09..56d102673 100644 --- a/src/fs/gnunet-service-fs.h +++ b/src/fs/gnunet-service-fs.h | |||
@@ -103,13 +103,9 @@ struct GetMessage | |||
103 | int32_t ttl GNUNET_PACKED; | 103 | int32_t ttl GNUNET_PACKED; |
104 | 104 | ||
105 | /** | 105 | /** |
106 | * The content hash should be mutated using this value | 106 | * These days not used. |
107 | * before checking against the bloomfilter (used to | ||
108 | * get many different filters for the same hash codes). | ||
109 | * The number should be in big-endian format when used | ||
110 | * for mingling. | ||
111 | */ | 107 | */ |
112 | uint32_t filter_mutator GNUNET_PACKED; | 108 | uint32_t reserved GNUNET_PACKED; |
113 | 109 | ||
114 | /** | 110 | /** |
115 | * Which of the optional hash codes are present at the end of the | 111 | * Which of the optional hash codes are present at the end of the |
diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c index 5476aa2be..30b895752 100644 --- a/src/fs/gnunet-service-fs_cp.c +++ b/src/fs/gnunet-service-fs_cp.c | |||
@@ -1317,7 +1317,6 @@ handle_p2p_get (void *cls, | |||
1317 | ? (const char *) &opt[bits] | 1317 | ? (const char *) &opt[bits] |
1318 | : NULL, | 1318 | : NULL, |
1319 | bfsize, | 1319 | bfsize, |
1320 | ntohl (gm->filter_mutator), | ||
1321 | 1 /* anonymity */, | 1320 | 1 /* anonymity */, |
1322 | (uint32_t) tec.priority, | 1321 | (uint32_t) tec.priority, |
1323 | tec.ttl, | 1322 | tec.ttl, |
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c index 154c454ca..f05194907 100644 --- a/src/fs/gnunet-service-fs_pr.c +++ b/src/fs/gnunet-service-fs_pr.c | |||
@@ -260,9 +260,6 @@ refresh_bloomfilter (enum GNUNET_BLOCK_Type type, | |||
260 | pr->bg = | 260 | pr->bg = |
261 | GNUNET_BLOCK_group_create (GSF_block_ctx, | 261 | GNUNET_BLOCK_group_create (GSF_block_ctx, |
262 | type, | 262 | type, |
263 | GNUNET_CRYPTO_random_u32 ( | ||
264 | GNUNET_CRYPTO_QUALITY_WEAK, | ||
265 | UINT32_MAX), | ||
266 | NULL, | 263 | NULL, |
267 | 0, | 264 | 0, |
268 | "seen-set-size", | 265 | "seen-set-size", |
@@ -286,7 +283,6 @@ refresh_bloomfilter (enum GNUNET_BLOCK_Type type, | |||
286 | * @param target preferred target for the request, NULL for none | 283 | * @param target preferred target for the request, NULL for none |
287 | * @param bf_data raw data for bloom filter for known replies, can be NULL | 284 | * @param bf_data raw data for bloom filter for known replies, can be NULL |
288 | * @param bf_size number of bytes in @a bf_data | 285 | * @param bf_size number of bytes in @a bf_data |
289 | * @param mingle mingle value for bf | ||
290 | * @param anonymity_level desired anonymity level | 286 | * @param anonymity_level desired anonymity level |
291 | * @param priority maximum outgoing cumulative request priority to use | 287 | * @param priority maximum outgoing cumulative request priority to use |
292 | * @param ttl current time-to-live for the request | 288 | * @param ttl current time-to-live for the request |
@@ -305,7 +301,6 @@ GSF_pending_request_create_ (enum GSF_PendingRequestOptions options, | |||
305 | const struct GNUNET_PeerIdentity *target, | 301 | const struct GNUNET_PeerIdentity *target, |
306 | const char *bf_data, | 302 | const char *bf_data, |
307 | size_t bf_size, | 303 | size_t bf_size, |
308 | uint32_t mingle, | ||
309 | uint32_t anonymity_level, | 304 | uint32_t anonymity_level, |
310 | uint32_t priority, | 305 | uint32_t priority, |
311 | int32_t ttl, | 306 | int32_t ttl, |
@@ -376,7 +371,6 @@ GSF_pending_request_create_ (enum GSF_PendingRequestOptions options, | |||
376 | { | 371 | { |
377 | pr->bg = GNUNET_BLOCK_group_create (GSF_block_ctx, | 372 | pr->bg = GNUNET_BLOCK_group_create (GSF_block_ctx, |
378 | pr->public_data.type, | 373 | pr->public_data.type, |
379 | mingle, | ||
380 | bf_data, | 374 | bf_data, |
381 | bf_size, | 375 | bf_size, |
382 | "seen-set-size", | 376 | "seen-set-size", |
@@ -533,7 +527,6 @@ GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr) | |||
533 | int64_t ttl; | 527 | int64_t ttl; |
534 | int do_route; | 528 | int do_route; |
535 | void *bf_data; | 529 | void *bf_data; |
536 | uint32_t bf_nonce; | ||
537 | 530 | ||
538 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 531 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
539 | "Building request message for `%s' of type %d\n", | 532 | "Building request message for `%s' of type %d\n", |
@@ -559,7 +552,6 @@ GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr) | |||
559 | } | 552 | } |
560 | if (GNUNET_OK != | 553 | if (GNUNET_OK != |
561 | GNUNET_BLOCK_group_serialize (pr->bg, | 554 | GNUNET_BLOCK_group_serialize (pr->bg, |
562 | &bf_nonce, | ||
563 | &bf_data, | 555 | &bf_data, |
564 | &bf_size)) | 556 | &bf_size)) |
565 | { | 557 | { |
@@ -582,7 +574,7 @@ GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr) | |||
582 | now = GNUNET_TIME_absolute_get (); | 574 | now = GNUNET_TIME_absolute_get (); |
583 | ttl = (int64_t) (pr->public_data.ttl.abs_value_us - now.abs_value_us); | 575 | ttl = (int64_t) (pr->public_data.ttl.abs_value_us - now.abs_value_us); |
584 | gm->ttl = htonl (ttl / 1000LL / 1000LL); | 576 | gm->ttl = htonl (ttl / 1000LL / 1000LL); |
585 | gm->filter_mutator = htonl (bf_nonce); | 577 | gm->reserved = htonl (0); |
586 | gm->hash_bitmap = htonl (bm); | 578 | gm->hash_bitmap = htonl (bm); |
587 | gm->query = pr->public_data.query; | 579 | gm->query = pr->public_data.query; |
588 | ext = (struct GNUNET_PeerIdentity *) &gm[1]; | 580 | ext = (struct GNUNET_PeerIdentity *) &gm[1]; |
diff --git a/src/fs/gnunet-service-fs_pr.h b/src/fs/gnunet-service-fs_pr.h index a10fb9b4c..339e409c5 100644 --- a/src/fs/gnunet-service-fs_pr.h +++ b/src/fs/gnunet-service-fs_pr.h | |||
@@ -206,7 +206,6 @@ typedef void | |||
206 | * @param target preferred target for the request, NULL for none | 206 | * @param target preferred target for the request, NULL for none |
207 | * @param bf_data raw data for bloom filter for known replies, can be NULL | 207 | * @param bf_data raw data for bloom filter for known replies, can be NULL |
208 | * @param bf_size number of bytes in bf_data | 208 | * @param bf_size number of bytes in bf_data |
209 | * @param mingle mingle value for bf | ||
210 | * @param anonymity_level desired anonymity level | 209 | * @param anonymity_level desired anonymity level |
211 | * @param priority maximum outgoing cumulative request priority to use | 210 | * @param priority maximum outgoing cumulative request priority to use |
212 | * @param ttl current time-to-live for the request | 211 | * @param ttl current time-to-live for the request |
@@ -226,7 +225,6 @@ GSF_pending_request_create_ (enum GSF_PendingRequestOptions options, | |||
226 | const struct GNUNET_PeerIdentity *target, | 225 | const struct GNUNET_PeerIdentity *target, |
227 | const char *bf_data, | 226 | const char *bf_data, |
228 | size_t bf_size, | 227 | size_t bf_size, |
229 | uint32_t mingle, | ||
230 | uint32_t anonymity_level, | 228 | uint32_t anonymity_level, |
231 | uint32_t priority, | 229 | uint32_t priority, |
232 | int32_t ttl, | 230 | int32_t ttl, |
diff --git a/src/fs/plugin_block_fs.c b/src/fs/plugin_block_fs.c index 029f95bc5..18aa289ef 100644 --- a/src/fs/plugin_block_fs.c +++ b/src/fs/plugin_block_fs.c | |||
@@ -43,7 +43,6 @@ | |||
43 | * | 43 | * |
44 | * @param ctx block context in which the block group is created | 44 | * @param ctx block context in which the block group is created |
45 | * @param type type of the block for which we are creating the group | 45 | * @param type type of the block for which we are creating the group |
46 | * @param nonce random value used to seed the group creation | ||
47 | * @param raw_data optional serialized prior state of the group, NULL if unavailable/fresh | 46 | * @param raw_data optional serialized prior state of the group, NULL if unavailable/fresh |
48 | * @param raw_data_size number of bytes in @a raw_data, 0 if unavailable/fresh | 47 | * @param raw_data_size number of bytes in @a raw_data, 0 if unavailable/fresh |
49 | * @param va variable arguments specific to @a type | 48 | * @param va variable arguments specific to @a type |
@@ -53,7 +52,6 @@ | |||
53 | static struct GNUNET_BLOCK_Group * | 52 | static struct GNUNET_BLOCK_Group * |
54 | block_plugin_fs_create_group (void *cls, | 53 | block_plugin_fs_create_group (void *cls, |
55 | enum GNUNET_BLOCK_Type type, | 54 | enum GNUNET_BLOCK_Type type, |
56 | uint32_t nonce, | ||
57 | const void *raw_data, | 55 | const void *raw_data, |
58 | size_t raw_data_size, | 56 | size_t raw_data_size, |
59 | va_list va) | 57 | va_list va) |
@@ -66,11 +64,9 @@ block_plugin_fs_create_group (void *cls, | |||
66 | case GNUNET_BLOCK_TYPE_FS_DBLOCK: | 64 | case GNUNET_BLOCK_TYPE_FS_DBLOCK: |
67 | GNUNET_break (NULL == va_arg (va, const char *)); | 65 | GNUNET_break (NULL == va_arg (va, const char *)); |
68 | return NULL; | 66 | return NULL; |
69 | |||
70 | case GNUNET_BLOCK_TYPE_FS_IBLOCK: | 67 | case GNUNET_BLOCK_TYPE_FS_IBLOCK: |
71 | GNUNET_break (NULL == va_arg (va, const char *)); | 68 | GNUNET_break (NULL == va_arg (va, const char *)); |
72 | return NULL; | 69 | return NULL; |
73 | |||
74 | case GNUNET_BLOCK_TYPE_FS_UBLOCK: | 70 | case GNUNET_BLOCK_TYPE_FS_UBLOCK: |
75 | guard = va_arg (va, const char *); | 71 | guard = va_arg (va, const char *); |
76 | if (0 == strcmp (guard, | 72 | if (0 == strcmp (guard, |
@@ -98,7 +94,6 @@ block_plugin_fs_create_group (void *cls, | |||
98 | size, | 94 | size, |
99 | BLOOMFILTER_K, | 95 | BLOOMFILTER_K, |
100 | type, | 96 | type, |
101 | nonce, | ||
102 | raw_data, | 97 | raw_data, |
103 | raw_data_size); | 98 | raw_data_size); |
104 | 99 | ||
@@ -218,7 +213,7 @@ block_plugin_fs_check_block (void *cls, | |||
218 | case GNUNET_BLOCK_TYPE_FS_UBLOCK: | 213 | case GNUNET_BLOCK_TYPE_FS_UBLOCK: |
219 | { | 214 | { |
220 | const struct UBlock *ub; | 215 | const struct UBlock *ub; |
221 | 216 | ||
222 | if (block_size < sizeof(struct UBlock)) | 217 | if (block_size < sizeof(struct UBlock)) |
223 | { | 218 | { |
224 | GNUNET_break_op (0); | 219 | GNUNET_break_op (0); |
@@ -226,8 +221,8 @@ block_plugin_fs_check_block (void *cls, | |||
226 | } | 221 | } |
227 | ub = block; | 222 | ub = block; |
228 | if (block_size != | 223 | if (block_size != |
229 | ntohl (ub->purpose.size) + | 224 | ntohl (ub->purpose.size) |
230 | sizeof (struct GNUNET_CRYPTO_EcdsaSignature)) | 225 | + sizeof (struct GNUNET_CRYPTO_EcdsaSignature)) |
231 | { | 226 | { |
232 | GNUNET_break_op (0); | 227 | GNUNET_break_op (0); |
233 | return GNUNET_NO; | 228 | return GNUNET_NO; |