diff options
author | Christian Grothoff <grothoff@gnunet.org> | 2022-12-24 18:38:14 +0100 |
---|---|---|
committer | Christian Grothoff <grothoff@gnunet.org> | 2022-12-24 18:38:14 +0100 |
commit | a448889bdabd46de4e0308ae791c343639da8dff (patch) | |
tree | e2d2dcf9e00a27174fe0efd62d7805230be0a3a2 /src | |
parent | 1557a73295e29a74d4b2bb66775a4b367184a69b (diff) | |
download | gnunet-a448889bdabd46de4e0308ae791c343639da8dff.tar.gz gnunet-a448889bdabd46de4e0308ae791c343639da8dff.zip |
-rename to deconfuse Martin about which block type is actually used these days, hopefully
Diffstat (limited to 'src')
-rw-r--r-- | src/cadet/gnunet-service-cadet_dht.c | 4 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_neighbours.c | 18 | ||||
-rw-r--r-- | src/dht/plugin_block_dht.c | 20 | ||||
-rw-r--r-- | src/include/gnunet_dht_block_types.h | 4 |
4 files changed, 24 insertions, 22 deletions
diff --git a/src/cadet/gnunet-service-cadet_dht.c b/src/cadet/gnunet-service-cadet_dht.c index 82ba326b4..576753a38 100644 --- a/src/cadet/gnunet-service-cadet_dht.c +++ b/src/cadet/gnunet-service-cadet_dht.c | |||
@@ -203,7 +203,7 @@ announce_id (void *cls) | |||
203 | dht_replication_level, /* Replication level */ | 203 | dht_replication_level, /* Replication level */ |
204 | GNUNET_DHT_RO_RECORD_ROUTE | 204 | GNUNET_DHT_RO_RECORD_ROUTE |
205 | | GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE, /* DHT options */ | 205 | | GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE, /* DHT options */ |
206 | GNUNET_BLOCK_TYPE_DHT_HELLO, /* Block type */ | 206 | GNUNET_BLOCK_TYPE_LEGACY_HELLO, /* Block type */ |
207 | size, /* Size of the data */ | 207 | size, /* Size of the data */ |
208 | (const char *) hello, /* Data itself */ | 208 | (const char *) hello, /* Data itself */ |
209 | expiration, /* Data expiration */ | 209 | expiration, /* Data expiration */ |
@@ -300,7 +300,7 @@ GCD_search (const struct GNUNET_PeerIdentity *peer_id) | |||
300 | 300 | ||
301 | h = GNUNET_new (struct GCD_search_handle); | 301 | h = GNUNET_new (struct GCD_search_handle); |
302 | h->dhtget = GNUNET_DHT_get_start (dht_handle, /* handle */ | 302 | h->dhtget = GNUNET_DHT_get_start (dht_handle, /* handle */ |
303 | GNUNET_BLOCK_TYPE_DHT_HELLO, /* type */ | 303 | GNUNET_BLOCK_TYPE_LEGACY_HELLO, /* type */ |
304 | &phash, /* key to search */ | 304 | &phash, /* key to search */ |
305 | dht_replication_level, /* replication level */ | 305 | dht_replication_level, /* replication level */ |
306 | GNUNET_DHT_RO_RECORD_ROUTE | 306 | GNUNET_DHT_RO_RECORD_ROUTE |
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c index 25d69ac65..b55a28929 100644 --- a/src/dht/gnunet-service-dht_neighbours.c +++ b/src/dht/gnunet-service-dht_neighbours.c | |||
@@ -662,7 +662,7 @@ send_find_peer_message (void *cls) | |||
662 | struct GNUNET_CONTAINER_BloomFilter *peer_bf; | 662 | struct GNUNET_CONTAINER_BloomFilter *peer_bf; |
663 | 663 | ||
664 | bg = GNUNET_BLOCK_group_create (GDS_block_context, | 664 | bg = GNUNET_BLOCK_group_create (GDS_block_context, |
665 | GNUNET_BLOCK_TYPE_DHT_URL_HELLO, | 665 | GNUNET_BLOCK_TYPE_DHT_HELLO, |
666 | NULL, | 666 | NULL, |
667 | 0, | 667 | 0, |
668 | "filter-size", | 668 | "filter-size", |
@@ -676,7 +676,7 @@ send_find_peer_message (void *cls) | |||
676 | DHT_BLOOM_SIZE, | 676 | DHT_BLOOM_SIZE, |
677 | GNUNET_CONSTANTS_BLOOMFILTER_K); | 677 | GNUNET_CONSTANTS_BLOOMFILTER_K); |
678 | if (GNUNET_OK != | 678 | if (GNUNET_OK != |
679 | GDS_NEIGHBOURS_handle_get (GNUNET_BLOCK_TYPE_DHT_URL_HELLO, | 679 | GDS_NEIGHBOURS_handle_get (GNUNET_BLOCK_TYPE_DHT_HELLO, |
680 | GNUNET_DHT_RO_FIND_APPROXIMATE | 680 | GNUNET_DHT_RO_FIND_APPROXIMATE |
681 | | GNUNET_DHT_RO_RECORD_ROUTE, | 681 | | GNUNET_DHT_RO_RECORD_ROUTE, |
682 | FIND_PEER_REPLICATION_LEVEL, | 682 | FIND_PEER_REPLICATION_LEVEL, |
@@ -1303,7 +1303,7 @@ hello_check (const struct GNUNET_DATACACHE_Block *bd) | |||
1303 | struct GNUNET_PeerIdentity pid; | 1303 | struct GNUNET_PeerIdentity pid; |
1304 | struct GNUNET_HELLO_Builder *b; | 1304 | struct GNUNET_HELLO_Builder *b; |
1305 | 1305 | ||
1306 | if (GNUNET_BLOCK_TYPE_DHT_URL_HELLO != bd->type) | 1306 | if (GNUNET_BLOCK_TYPE_DHT_HELLO != bd->type) |
1307 | return; | 1307 | return; |
1308 | 1308 | ||
1309 | b = GNUNET_HELLO_builder_from_block (bd->data, | 1309 | b = GNUNET_HELLO_builder_from_block (bd->data, |
@@ -2168,7 +2168,7 @@ handle_find_my_hello (struct PeerInfo *pi, | |||
2168 | } | 2168 | } |
2169 | else if (GNUNET_BLOCK_REPLY_OK_MORE == | 2169 | else if (GNUNET_BLOCK_REPLY_OK_MORE == |
2170 | GNUNET_BLOCK_check_reply (GDS_block_context, | 2170 | GNUNET_BLOCK_check_reply (GDS_block_context, |
2171 | GNUNET_BLOCK_TYPE_DHT_URL_HELLO, | 2171 | GNUNET_BLOCK_TYPE_DHT_HELLO, |
2172 | bg, | 2172 | bg, |
2173 | &GDS_my_identity_hash, | 2173 | &GDS_my_identity_hash, |
2174 | NULL, 0, | 2174 | NULL, 0, |
@@ -2176,7 +2176,7 @@ handle_find_my_hello (struct PeerInfo *pi, | |||
2176 | block_size)) | 2176 | block_size)) |
2177 | { | 2177 | { |
2178 | struct GNUNET_DATACACHE_Block bd = { | 2178 | struct GNUNET_DATACACHE_Block bd = { |
2179 | .type = GNUNET_BLOCK_TYPE_DHT_URL_HELLO, | 2179 | .type = GNUNET_BLOCK_TYPE_DHT_HELLO, |
2180 | .expiration_time | 2180 | .expiration_time |
2181 | = GNUNET_TIME_relative_to_absolute ( | 2181 | = GNUNET_TIME_relative_to_absolute ( |
2182 | GNUNET_HELLO_ADDRESS_EXPIRATION), | 2182 | GNUNET_HELLO_ADDRESS_EXPIRATION), |
@@ -2225,7 +2225,7 @@ handle_find_local_hello (struct PeerInfo *pi, | |||
2225 | (GNUNET_BLOCK_REPLY_OK_MORE == | 2225 | (GNUNET_BLOCK_REPLY_OK_MORE == |
2226 | GNUNET_BLOCK_check_reply ( | 2226 | GNUNET_BLOCK_check_reply ( |
2227 | GDS_block_context, | 2227 | GDS_block_context, |
2228 | GNUNET_BLOCK_TYPE_DHT_URL_HELLO, | 2228 | GNUNET_BLOCK_TYPE_DHT_HELLO, |
2229 | bg, | 2229 | bg, |
2230 | &peer->phash, | 2230 | &peer->phash, |
2231 | NULL, 0, /* xquery */ | 2231 | NULL, 0, /* xquery */ |
@@ -2233,7 +2233,7 @@ handle_find_local_hello (struct PeerInfo *pi, | |||
2233 | peer->hello_size)) ) | 2233 | peer->hello_size)) ) |
2234 | { | 2234 | { |
2235 | struct GNUNET_DATACACHE_Block bd = { | 2235 | struct GNUNET_DATACACHE_Block bd = { |
2236 | .type = GNUNET_BLOCK_TYPE_DHT_URL_HELLO, | 2236 | .type = GNUNET_BLOCK_TYPE_DHT_HELLO, |
2237 | .expiration_time = peer->hello_expiration, | 2237 | .expiration_time = peer->hello_expiration, |
2238 | .key = peer->phash, | 2238 | .key = peer->phash, |
2239 | .data = peer->hello, | 2239 | .data = peer->hello, |
@@ -2362,7 +2362,7 @@ handle_dht_p2p_get (void *cls, | |||
2362 | (GDS_am_closest_peer (&get->key, | 2362 | (GDS_am_closest_peer (&get->key, |
2363 | peer_bf)) ) | 2363 | peer_bf)) ) |
2364 | { | 2364 | { |
2365 | if ( (GNUNET_BLOCK_TYPE_DHT_URL_HELLO == type) || | 2365 | if ( (GNUNET_BLOCK_TYPE_DHT_HELLO == type) || |
2366 | (GNUNET_BLOCK_TYPE_ANY == type) ) | 2366 | (GNUNET_BLOCK_TYPE_ANY == type) ) |
2367 | { | 2367 | { |
2368 | GNUNET_STATISTICS_update (GDS_stats, | 2368 | GNUNET_STATISTICS_update (GDS_stats, |
@@ -2377,7 +2377,7 @@ handle_dht_p2p_get (void *cls, | |||
2377 | &get->key, | 2377 | &get->key, |
2378 | bg); | 2378 | bg); |
2379 | } | 2379 | } |
2380 | if (GNUNET_BLOCK_TYPE_DHT_URL_HELLO != type) | 2380 | if (GNUNET_BLOCK_TYPE_DHT_HELLO != type) |
2381 | { | 2381 | { |
2382 | if (0 != (options & GNUNET_DHT_RO_FIND_APPROXIMATE)) | 2382 | if (0 != (options & GNUNET_DHT_RO_FIND_APPROXIMATE)) |
2383 | eval = GDS_DATACACHE_get_closest (&get->key, | 2383 | eval = GDS_DATACACHE_get_closest (&get->key, |
diff --git a/src/dht/plugin_block_dht.c b/src/dht/plugin_block_dht.c index bee16736c..6375fa272 100644 --- a/src/dht/plugin_block_dht.c +++ b/src/dht/plugin_block_dht.c | |||
@@ -105,14 +105,14 @@ block_plugin_dht_check_query (void *cls, | |||
105 | { | 105 | { |
106 | switch (type) | 106 | switch (type) |
107 | { | 107 | { |
108 | case GNUNET_BLOCK_TYPE_DHT_HELLO: | 108 | case GNUNET_BLOCK_TYPE_LEGACY_HELLO: |
109 | if (0 != xquery_size) | 109 | if (0 != xquery_size) |
110 | { | 110 | { |
111 | GNUNET_break_op (0); | 111 | GNUNET_break_op (0); |
112 | return GNUNET_NO; | 112 | return GNUNET_NO; |
113 | } | 113 | } |
114 | return GNUNET_OK; | 114 | return GNUNET_OK; |
115 | case GNUNET_BLOCK_TYPE_DHT_URL_HELLO: | 115 | case GNUNET_BLOCK_TYPE_DHT_HELLO: |
116 | if (0 != xquery_size) | 116 | if (0 != xquery_size) |
117 | { | 117 | { |
118 | GNUNET_break_op (0); | 118 | GNUNET_break_op (0); |
@@ -143,7 +143,7 @@ block_plugin_dht_check_block (void *cls, | |||
143 | { | 143 | { |
144 | switch (type) | 144 | switch (type) |
145 | { | 145 | { |
146 | case GNUNET_BLOCK_TYPE_DHT_HELLO: | 146 | case GNUNET_BLOCK_TYPE_LEGACY_HELLO: |
147 | { | 147 | { |
148 | const struct GNUNET_HELLO_Message *hello; | 148 | const struct GNUNET_HELLO_Message *hello; |
149 | struct GNUNET_PeerIdentity pid; | 149 | struct GNUNET_PeerIdentity pid; |
@@ -170,7 +170,7 @@ block_plugin_dht_check_block (void *cls, | |||
170 | } | 170 | } |
171 | return GNUNET_OK; | 171 | return GNUNET_OK; |
172 | } | 172 | } |
173 | case GNUNET_BLOCK_TYPE_DHT_URL_HELLO: | 173 | case GNUNET_BLOCK_TYPE_DHT_HELLO: |
174 | { | 174 | { |
175 | struct GNUNET_HELLO_Builder *b; | 175 | struct GNUNET_HELLO_Builder *b; |
176 | struct GNUNET_PeerIdentity pid; | 176 | struct GNUNET_PeerIdentity pid; |
@@ -228,8 +228,9 @@ block_plugin_dht_check_reply ( | |||
228 | { | 228 | { |
229 | switch (type) | 229 | switch (type) |
230 | { | 230 | { |
231 | case GNUNET_BLOCK_TYPE_DHT_HELLO: | 231 | case GNUNET_BLOCK_TYPE_LEGACY_HELLO: |
232 | { | 232 | { |
233 | /* LEGACY */ | ||
233 | const struct GNUNET_MessageHeader *msg = reply_block; | 234 | const struct GNUNET_MessageHeader *msg = reply_block; |
234 | const struct GNUNET_HELLO_Message *hello = reply_block; | 235 | const struct GNUNET_HELLO_Message *hello = reply_block; |
235 | struct GNUNET_PeerIdentity pid; | 236 | struct GNUNET_PeerIdentity pid; |
@@ -249,7 +250,7 @@ block_plugin_dht_check_reply ( | |||
249 | return GNUNET_BLOCK_REPLY_OK_DUPLICATE; | 250 | return GNUNET_BLOCK_REPLY_OK_DUPLICATE; |
250 | return GNUNET_BLOCK_REPLY_OK_MORE; | 251 | return GNUNET_BLOCK_REPLY_OK_MORE; |
251 | } | 252 | } |
252 | case GNUNET_BLOCK_TYPE_DHT_URL_HELLO: | 253 | case GNUNET_BLOCK_TYPE_DHT_HELLO: |
253 | { | 254 | { |
254 | struct GNUNET_HELLO_Builder *b; | 255 | struct GNUNET_HELLO_Builder *b; |
255 | struct GNUNET_PeerIdentity pid; | 256 | struct GNUNET_PeerIdentity pid; |
@@ -297,8 +298,9 @@ block_plugin_dht_get_key (void *cls, | |||
297 | { | 298 | { |
298 | switch (type) | 299 | switch (type) |
299 | { | 300 | { |
300 | case GNUNET_BLOCK_TYPE_DHT_HELLO: | 301 | case GNUNET_BLOCK_TYPE_LEGACY_HELLO: |
301 | { | 302 | { |
303 | /* LEGACY */ | ||
302 | const struct GNUNET_MessageHeader *msg; | 304 | const struct GNUNET_MessageHeader *msg; |
303 | const struct GNUNET_HELLO_Message *hello; | 305 | const struct GNUNET_HELLO_Message *hello; |
304 | struct GNUNET_PeerIdentity *pid; | 306 | struct GNUNET_PeerIdentity *pid; |
@@ -337,7 +339,7 @@ block_plugin_dht_get_key (void *cls, | |||
337 | } | 339 | } |
338 | return GNUNET_OK; | 340 | return GNUNET_OK; |
339 | } | 341 | } |
340 | case GNUNET_BLOCK_TYPE_DHT_URL_HELLO: | 342 | case GNUNET_BLOCK_TYPE_DHT_HELLO: |
341 | { | 343 | { |
342 | struct GNUNET_HELLO_Builder *b; | 344 | struct GNUNET_HELLO_Builder *b; |
343 | struct GNUNET_PeerIdentity pid; | 345 | struct GNUNET_PeerIdentity pid; |
@@ -375,8 +377,8 @@ void * | |||
375 | libgnunet_plugin_block_dht_init (void *cls) | 377 | libgnunet_plugin_block_dht_init (void *cls) |
376 | { | 378 | { |
377 | static enum GNUNET_BLOCK_Type types[] = { | 379 | static enum GNUNET_BLOCK_Type types[] = { |
380 | GNUNET_BLOCK_TYPE_LEGACY_HELLO, | ||
378 | GNUNET_BLOCK_TYPE_DHT_HELLO, | 381 | GNUNET_BLOCK_TYPE_DHT_HELLO, |
379 | GNUNET_BLOCK_TYPE_DHT_URL_HELLO, | ||
380 | GNUNET_BLOCK_TYPE_ANY /* end of list */ | 382 | GNUNET_BLOCK_TYPE_ANY /* end of list */ |
381 | }; | 383 | }; |
382 | struct GNUNET_BLOCK_PluginFunctions *api; | 384 | struct GNUNET_BLOCK_PluginFunctions *api; |
diff --git a/src/include/gnunet_dht_block_types.h b/src/include/gnunet_dht_block_types.h index 1829897ca..40f2900f9 100644 --- a/src/include/gnunet_dht_block_types.h +++ b/src/include/gnunet_dht_block_types.h | |||
@@ -70,7 +70,7 @@ enum GNUNET_BLOCK_Type | |||
70 | /** | 70 | /** |
71 | * Type of a block that contains a HELLO for a peer. | 71 | * Type of a block that contains a HELLO for a peer. |
72 | */ | 72 | */ |
73 | GNUNET_BLOCK_TYPE_DHT_HELLO = 7, | 73 | GNUNET_BLOCK_TYPE_LEGACY_HELLO = 7, |
74 | 74 | ||
75 | 75 | ||
76 | /** | 76 | /** |
@@ -106,7 +106,7 @@ enum GNUNET_BLOCK_Type | |||
106 | /** | 106 | /** |
107 | * Type of a block that contains a DHT-NG HELLO for a peer. | 107 | * Type of a block that contains a DHT-NG HELLO for a peer. |
108 | */ | 108 | */ |
109 | GNUNET_BLOCK_TYPE_DHT_URL_HELLO = 13, | 109 | GNUNET_BLOCK_TYPE_DHT_HELLO = 13, |
110 | 110 | ||
111 | 111 | ||
112 | /** | 112 | /** |