aboutsummaryrefslogtreecommitdiff
path: root/src/dht
diff options
context:
space:
mode:
authort3sserakt <t3ss@posteo.de>2023-08-24 13:35:13 +0200
committert3sserakt <t3ss@posteo.de>2023-08-24 13:35:13 +0200
commita362cd5a23ebb5c9650e577beb4f24edc55797cb (patch)
tree2975cf0d08e6e227cfa092a11a55f76548c5a3d9 /src/dht
parent86ae84f761725e12b6570d12785b970c88fe16d9 (diff)
downloadgnunet-a362cd5a23ebb5c9650e577beb4f24edc55797cb.tar.gz
gnunet-a362cd5a23ebb5c9650e577beb4f24edc55797cb.zip
NEWS: The old hello design replaced by the new hello design.
Diffstat (limited to 'src/dht')
-rw-r--r--src/dht/dht_api.c1
-rw-r--r--src/dht/gnunet-service-dht.c1
-rw-r--r--src/dht/gnunet-service-dht_neighbours.c1
-rw-r--r--src/dht/plugin_block_dht.c99
4 files changed, 0 insertions, 102 deletions
diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c
index e31ac596c..62a8dd0fd 100644
--- a/src/dht/dht_api.c
+++ b/src/dht/dht_api.c
@@ -26,7 +26,6 @@
26 */ 26 */
27 27
28#include "platform.h" 28#include "platform.h"
29#include "gnunet_util_lib.h"
30#include "gnunet_constants.h" 29#include "gnunet_constants.h"
31#include "gnunet_signatures.h" 30#include "gnunet_signatures.h"
32#include "gnunet_arm_service.h" 31#include "gnunet_arm_service.h"
diff --git a/src/dht/gnunet-service-dht.c b/src/dht/gnunet-service-dht.c
index 0766bea62..c3ce2f284 100644
--- a/src/dht/gnunet-service-dht.c
+++ b/src/dht/gnunet-service-dht.c
@@ -27,7 +27,6 @@
27#include "platform.h" 27#include "platform.h"
28#include "gnunet_block_lib.h" 28#include "gnunet_block_lib.h"
29#include "gnunet_util_lib.h" 29#include "gnunet_util_lib.h"
30#include "gnunet_hello_lib.h"
31#include "gnunet_hello_uri_lib.h" 30#include "gnunet_hello_uri_lib.h"
32#include "gnunet_dht_service.h" 31#include "gnunet_dht_service.h"
33#include "gnunet_statistics_service.h" 32#include "gnunet_statistics_service.h"
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c
index b0a71de95..e3a9bd3a1 100644
--- a/src/dht/gnunet-service-dht_neighbours.c
+++ b/src/dht/gnunet-service-dht_neighbours.c
@@ -28,7 +28,6 @@
28#include "gnunet_constants.h" 28#include "gnunet_constants.h"
29#include "gnunet_protocols.h" 29#include "gnunet_protocols.h"
30#include "gnunet_signatures.h" 30#include "gnunet_signatures.h"
31#include "gnunet_hello_lib.h"
32#include "gnunet_hello_uri_lib.h" 31#include "gnunet_hello_uri_lib.h"
33#include "gnunet-service-dht.h" 32#include "gnunet-service-dht.h"
34#include "gnunet-service-dht_neighbours.h" 33#include "gnunet-service-dht_neighbours.h"
diff --git a/src/dht/plugin_block_dht.c b/src/dht/plugin_block_dht.c
index 6375fa272..aa5ffc719 100644
--- a/src/dht/plugin_block_dht.c
+++ b/src/dht/plugin_block_dht.c
@@ -27,7 +27,6 @@
27 */ 27 */
28#include "platform.h" 28#include "platform.h"
29#include "gnunet_constants.h" 29#include "gnunet_constants.h"
30#include "gnunet_hello_lib.h"
31#include "gnunet_hello_uri_lib.h" 30#include "gnunet_hello_uri_lib.h"
32#include "gnunet_block_plugin.h" 31#include "gnunet_block_plugin.h"
33#include "gnunet_block_group_lib.h" 32#include "gnunet_block_group_lib.h"
@@ -105,13 +104,6 @@ block_plugin_dht_check_query (void *cls,
105{ 104{
106 switch (type) 105 switch (type)
107 { 106 {
108 case GNUNET_BLOCK_TYPE_LEGACY_HELLO:
109 if (0 != xquery_size)
110 {
111 GNUNET_break_op (0);
112 return GNUNET_NO;
113 }
114 return GNUNET_OK;
115 case GNUNET_BLOCK_TYPE_DHT_HELLO: 107 case GNUNET_BLOCK_TYPE_DHT_HELLO:
116 if (0 != xquery_size) 108 if (0 != xquery_size)
117 { 109 {
@@ -143,33 +135,6 @@ block_plugin_dht_check_block (void *cls,
143{ 135{
144 switch (type) 136 switch (type)
145 { 137 {
146 case GNUNET_BLOCK_TYPE_LEGACY_HELLO:
147 {
148 const struct GNUNET_HELLO_Message *hello;
149 struct GNUNET_PeerIdentity pid;
150 const struct GNUNET_MessageHeader *msg;
151
152 if (block_size < sizeof(struct GNUNET_MessageHeader))
153 {
154 GNUNET_break_op (0);
155 return GNUNET_NO;
156 }
157 msg = block;
158 if (block_size != ntohs (msg->size))
159 {
160 GNUNET_break_op (0);
161 return GNUNET_NO;
162 }
163 hello = block;
164 if (GNUNET_OK !=
165 GNUNET_HELLO_get_id (hello,
166 &pid))
167 {
168 GNUNET_break_op (0);
169 return GNUNET_NO;
170 }
171 return GNUNET_OK;
172 }
173 case GNUNET_BLOCK_TYPE_DHT_HELLO: 138 case GNUNET_BLOCK_TYPE_DHT_HELLO:
174 { 139 {
175 struct GNUNET_HELLO_Builder *b; 140 struct GNUNET_HELLO_Builder *b;
@@ -228,28 +193,6 @@ block_plugin_dht_check_reply (
228{ 193{
229 switch (type) 194 switch (type)
230 { 195 {
231 case GNUNET_BLOCK_TYPE_LEGACY_HELLO:
232 {
233 /* LEGACY */
234 const struct GNUNET_MessageHeader *msg = reply_block;
235 const struct GNUNET_HELLO_Message *hello = reply_block;
236 struct GNUNET_PeerIdentity pid;
237 struct GNUNET_HashCode phash;
238
239 GNUNET_assert (reply_block_size >= sizeof(struct GNUNET_MessageHeader));
240 GNUNET_assert (reply_block_size == ntohs (msg->size));
241 GNUNET_assert (GNUNET_OK ==
242 GNUNET_HELLO_get_id (hello,
243 &pid));
244 GNUNET_CRYPTO_hash (&pid,
245 sizeof(pid),
246 &phash);
247 if (GNUNET_YES ==
248 GNUNET_BLOCK_GROUP_bf_test_and_set (group,
249 &phash))
250 return GNUNET_BLOCK_REPLY_OK_DUPLICATE;
251 return GNUNET_BLOCK_REPLY_OK_MORE;
252 }
253 case GNUNET_BLOCK_TYPE_DHT_HELLO: 196 case GNUNET_BLOCK_TYPE_DHT_HELLO:
254 { 197 {
255 struct GNUNET_HELLO_Builder *b; 198 struct GNUNET_HELLO_Builder *b;
@@ -298,47 +241,6 @@ block_plugin_dht_get_key (void *cls,
298{ 241{
299 switch (type) 242 switch (type)
300 { 243 {
301 case GNUNET_BLOCK_TYPE_LEGACY_HELLO:
302 {
303 /* LEGACY */
304 const struct GNUNET_MessageHeader *msg;
305 const struct GNUNET_HELLO_Message *hello;
306 struct GNUNET_PeerIdentity *pid;
307
308 if (block_size < sizeof(struct GNUNET_MessageHeader))
309 {
310 GNUNET_break_op (0);
311 memset (key,
312 0,
313 sizeof (*key));
314 return GNUNET_OK;
315 }
316 msg = block;
317 if (block_size != ntohs (msg->size))
318 {
319 GNUNET_break_op (0);
320 memset (key,
321 0,
322 sizeof (*key));
323 return GNUNET_OK;
324 }
325 hello = block;
326 memset (key,
327 0,
328 sizeof(*key));
329 pid = (struct GNUNET_PeerIdentity *) key;
330 if (GNUNET_OK !=
331 GNUNET_HELLO_get_id (hello,
332 pid))
333 {
334 GNUNET_break_op (0);
335 memset (key,
336 0,
337 sizeof (*key));
338 return GNUNET_OK;
339 }
340 return GNUNET_OK;
341 }
342 case GNUNET_BLOCK_TYPE_DHT_HELLO: 244 case GNUNET_BLOCK_TYPE_DHT_HELLO:
343 { 245 {
344 struct GNUNET_HELLO_Builder *b; 246 struct GNUNET_HELLO_Builder *b;
@@ -377,7 +279,6 @@ void *
377libgnunet_plugin_block_dht_init (void *cls) 279libgnunet_plugin_block_dht_init (void *cls)
378{ 280{
379 static enum GNUNET_BLOCK_Type types[] = { 281 static enum GNUNET_BLOCK_Type types[] = {
380 GNUNET_BLOCK_TYPE_LEGACY_HELLO,
381 GNUNET_BLOCK_TYPE_DHT_HELLO, 282 GNUNET_BLOCK_TYPE_DHT_HELLO,
382 GNUNET_BLOCK_TYPE_ANY /* end of list */ 283 GNUNET_BLOCK_TYPE_ANY /* end of list */
383 }; 284 };