diff options
Diffstat (limited to 'src/dht/gnunet-service-dht_neighbours.h')
-rw-r--r-- | src/dht/gnunet-service-dht_neighbours.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/dht/gnunet-service-dht_neighbours.h b/src/dht/gnunet-service-dht_neighbours.h index 34b76ee8a..bf3ed80a2 100644 --- a/src/dht/gnunet-service-dht_neighbours.h +++ b/src/dht/gnunet-service-dht_neighbours.h | |||
@@ -32,6 +32,12 @@ | |||
32 | #include "gnunet_dht_service.h" | 32 | #include "gnunet_dht_service.h" |
33 | 33 | ||
34 | /** | 34 | /** |
35 | * Hash of the identity of this peer. | ||
36 | */ | ||
37 | extern struct GNUNET_HashCode my_identity_hash; | ||
38 | |||
39 | |||
40 | /** | ||
35 | * Perform a PUT operation. Forwards the given request to other | 41 | * Perform a PUT operation. Forwards the given request to other |
36 | * peers. Does not store the data locally. Does not give the | 42 | * peers. Does not store the data locally. Does not give the |
37 | * data to local clients. May do nothing if this is the only | 43 | * data to local clients. May do nothing if this is the only |
@@ -123,6 +129,22 @@ GDS_NEIGHBOURS_handle_reply (const struct GNUNET_PeerIdentity *target, | |||
123 | 129 | ||
124 | 130 | ||
125 | /** | 131 | /** |
132 | * Check whether my identity is closer than any known peers. If a | ||
133 | * non-null bloomfilter is given, check if this is the closest peer | ||
134 | * that hasn't already been routed to. | ||
135 | * | ||
136 | * @param key hash code to check closeness to | ||
137 | * @param bloom bloomfilter, exclude these entries from the decision | ||
138 | * @return #GNUNET_YES if node location is closest, | ||
139 | * #GNUNET_NO otherwise. | ||
140 | */ | ||
141 | int | ||
142 | GDS_am_closest_peer (const struct GNUNET_HashCode *key, | ||
143 | const struct GNUNET_CONTAINER_BloomFilter *bloom); | ||
144 | |||
145 | |||
146 | |||
147 | /** | ||
126 | * Initialize neighbours subsystem. | 148 | * Initialize neighbours subsystem. |
127 | * | 149 | * |
128 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 150 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |