aboutsummaryrefslogtreecommitdiff
path: root/src/dht
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-09-30 21:03:31 +0000
committerChristian Grothoff <christian@grothoff.org>2013-09-30 21:03:31 +0000
commit6d5b099541c60303b664547f18f4aaa864e33d68 (patch)
tree3169f571d3f66ec23ab540d17c012f00103688f2 /src/dht
parenta0ba5b741b56036bd35bd9ba88164324b2ff7ada (diff)
downloadgnunet-6d5b099541c60303b664547f18f4aaa864e33d68.tar.gz
gnunet-6d5b099541c60303b664547f18f4aaa864e33d68.zip
-getting core, nse, testbed, ats-tool and peerinfo-tool to compile again (part of #3047)
Diffstat (limited to 'src/dht')
-rw-r--r--src/dht/gnunet-service-dht_hello.c20
-rw-r--r--src/dht/gnunet-service-dht_neighbours.c2
-rw-r--r--src/dht/plugin_block_dht.c14
3 files changed, 20 insertions, 16 deletions
diff --git a/src/dht/gnunet-service-dht_hello.c b/src/dht/gnunet-service-dht_hello.c
index 2ce7f1925..d3415d11d 100644
--- a/src/dht/gnunet-service-dht_hello.c
+++ b/src/dht/gnunet-service-dht_hello.c
@@ -40,7 +40,7 @@ static struct GNUNET_PEERINFO_NotifyContext *pnc;
40/** 40/**
41 * Hash map of peers to HELLOs. 41 * Hash map of peers to HELLOs.
42 */ 42 */
43static struct GNUNET_CONTAINER_MultiHashMap *peer_to_hello; 43static struct GNUNET_CONTAINER_MultiPeerMap *peer_to_hello;
44 44
45 45
46/** 46/**
@@ -54,7 +54,7 @@ GDS_HELLO_get (const struct GNUNET_PeerIdentity *peer)
54{ 54{
55 if (NULL == peer_to_hello) 55 if (NULL == peer_to_hello)
56 return NULL; 56 return NULL;
57 return GNUNET_CONTAINER_multihashmap_get (peer_to_hello, &peer->hashPubKey); 57 return GNUNET_CONTAINER_multipeermap_get (peer_to_hello, peer);
58} 58}
59 59
60 60
@@ -81,13 +81,13 @@ process_hello (void *cls, const struct GNUNET_PeerIdentity *peer,
81 GNUNET_STATISTICS_update (GDS_stats, 81 GNUNET_STATISTICS_update (GDS_stats,
82 gettext_noop ("# HELLOs obtained from peerinfo"), 1, 82 gettext_noop ("# HELLOs obtained from peerinfo"), 1,
83 GNUNET_NO); 83 GNUNET_NO);
84 hm = GNUNET_CONTAINER_multihashmap_get (peer_to_hello, &peer->hashPubKey); 84 hm = GNUNET_CONTAINER_multipeermap_get (peer_to_hello, peer);
85 GNUNET_free_non_null (hm); 85 GNUNET_free_non_null (hm);
86 hm = GNUNET_malloc (GNUNET_HELLO_size (hello)); 86 hm = GNUNET_malloc (GNUNET_HELLO_size (hello));
87 memcpy (hm, hello, GNUNET_HELLO_size (hello)); 87 memcpy (hm, hello, GNUNET_HELLO_size (hello));
88 GNUNET_assert (GNUNET_SYSERR != 88 GNUNET_assert (GNUNET_SYSERR !=
89 GNUNET_CONTAINER_multihashmap_put (peer_to_hello, 89 GNUNET_CONTAINER_multipeermap_put (peer_to_hello,
90 &peer->hashPubKey, hm, 90 peer, hm,
91 GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE)); 91 GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE));
92} 92}
93 93
@@ -99,7 +99,7 @@ void
99GDS_HELLO_init () 99GDS_HELLO_init ()
100{ 100{
101 pnc = GNUNET_PEERINFO_notify (GDS_cfg, GNUNET_NO, &process_hello, NULL); 101 pnc = GNUNET_PEERINFO_notify (GDS_cfg, GNUNET_NO, &process_hello, NULL);
102 peer_to_hello = GNUNET_CONTAINER_multihashmap_create (256, GNUNET_NO); 102 peer_to_hello = GNUNET_CONTAINER_multipeermap_create (256, GNUNET_NO);
103} 103}
104 104
105 105
@@ -107,7 +107,9 @@ GDS_HELLO_init ()
107 * Free memory occopied by the HELLO. 107 * Free memory occopied by the HELLO.
108 */ 108 */
109static int 109static int
110free_hello (void *cls, const struct GNUNET_HashCode * key, void *hello) 110free_hello (void *cls,
111 const struct GNUNET_PeerIdentity *key,
112 void *hello)
111{ 113{
112 GNUNET_free (hello); 114 GNUNET_free (hello);
113 return GNUNET_OK; 115 return GNUNET_OK;
@@ -127,8 +129,8 @@ GDS_HELLO_done ()
127 } 129 }
128 if (NULL != peer_to_hello) 130 if (NULL != peer_to_hello)
129 { 131 {
130 GNUNET_CONTAINER_multihashmap_iterate (peer_to_hello, &free_hello, NULL); 132 GNUNET_CONTAINER_multipeermap_iterate (peer_to_hello, &free_hello, NULL);
131 GNUNET_CONTAINER_multihashmap_destroy (peer_to_hello); 133 GNUNET_CONTAINER_multipeermap_destroy (peer_to_hello);
132 } 134 }
133} 135}
134 136
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c
index 11ba71aef..62c29e421 100644
--- a/src/dht/gnunet-service-dht_neighbours.c
+++ b/src/dht/gnunet-service-dht_neighbours.c
@@ -26,8 +26,8 @@
26 */ 26 */
27 27
28#include "platform.h" 28#include "platform.h"
29#include "gnunet_block_lib.h"
30#include "gnunet_util_lib.h" 29#include "gnunet_util_lib.h"
30#include "gnunet_block_lib.h"
31#include "gnunet_hello_lib.h" 31#include "gnunet_hello_lib.h"
32#include "gnunet_constants.h" 32#include "gnunet_constants.h"
33#include "gnunet_protocols.h" 33#include "gnunet_protocols.h"
diff --git a/src/dht/plugin_block_dht.c b/src/dht/plugin_block_dht.c
index ac4732cff..a21167fb0 100644
--- a/src/dht/plugin_block_dht.c
+++ b/src/dht/plugin_block_dht.c
@@ -42,11 +42,11 @@
42 * @param type block type 42 * @param type block type
43 * @param query original query (hash) 43 * @param query original query (hash)
44 * @param bf pointer to bloom filter associated with query; possibly updated (!) 44 * @param bf pointer to bloom filter associated with query; possibly updated (!)
45 * @param bf_mutator mutation value for bf 45 * @param bf_mutator mutation value for @a bf
46 * @param xquery extended query data (can be NULL, depending on type) 46 * @param xquery extended query data (can be NULL, depending on type)
47 * @param xquery_size number of bytes in xquery 47 * @param xquery_size number of bytes in @a xquery
48 * @param reply_block response to validate 48 * @param reply_block response to validate
49 * @param reply_block_size number of bytes in reply block 49 * @param reply_block_size number of bytes in @a reply_block
50 * @return characterization of result 50 * @return characterization of result
51 */ 51 */
52static enum GNUNET_BLOCK_EvaluationResult 52static enum GNUNET_BLOCK_EvaluationResult
@@ -61,6 +61,7 @@ block_plugin_dht_evaluate (void *cls, enum GNUNET_BLOCK_Type type,
61 const struct GNUNET_HELLO_Message *hello; 61 const struct GNUNET_HELLO_Message *hello;
62 struct GNUNET_PeerIdentity pid; 62 struct GNUNET_PeerIdentity pid;
63 const struct GNUNET_MessageHeader *msg; 63 const struct GNUNET_MessageHeader *msg;
64 struct GNUNET_HashCode phash;
64 65
65 if (type != GNUNET_BLOCK_TYPE_DHT_HELLO) 66 if (type != GNUNET_BLOCK_TYPE_DHT_HELLO)
66 return GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED; 67 return GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED;
@@ -90,7 +91,8 @@ block_plugin_dht_evaluate (void *cls, enum GNUNET_BLOCK_Type type,
90 } 91 }
91 if (NULL != bf) 92 if (NULL != bf)
92 { 93 {
93 GNUNET_BLOCK_mingle_hash (&pid.hashPubKey, bf_mutator, &mhash); 94 GNUNET_CRYPTO_hash (&pid, sizeof (pid), &phash);
95 GNUNET_BLOCK_mingle_hash (&phash, bf_mutator, &mhash);
94 if (NULL != *bf) 96 if (NULL != *bf)
95 { 97 {
96 if (GNUNET_YES == GNUNET_CONTAINER_bloomfilter_test (*bf, &mhash)) 98 if (GNUNET_YES == GNUNET_CONTAINER_bloomfilter_test (*bf, &mhash))
@@ -114,9 +116,9 @@ block_plugin_dht_evaluate (void *cls, enum GNUNET_BLOCK_Type type,
114 * @param cls closure 116 * @param cls closure
115 * @param type block type 117 * @param type block type
116 * @param block block to get the key for 118 * @param block block to get the key for
117 * @param block_size number of bytes in block 119 * @param block_size number of bytes @a block
118 * @param key set to the key (query) for the given block 120 * @param key set to the key (query) for the given block
119 * @return GNUNET_OK on success, GNUNET_SYSERR if type not supported 121 * @return #GNUNET_OK on success, #GNUNET_SYSERR if type not supported
120 * (or if extracting a key from a block of this type does not work) 122 * (or if extracting a key from a block of this type does not work)
121 */ 123 */
122static int 124static int