diff options
Diffstat (limited to 'src/dht/gnunet-service-dht_neighbours.h')
-rw-r--r-- | src/dht/gnunet-service-dht_neighbours.h | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/src/dht/gnunet-service-dht_neighbours.h b/src/dht/gnunet-service-dht_neighbours.h index 34b76ee8a..fb740c766 100644 --- a/src/dht/gnunet-service-dht_neighbours.h +++ b/src/dht/gnunet-service-dht_neighbours.h | |||
@@ -2,20 +2,18 @@ | |||
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2009, 2010, 2011 GNUnet e.V. | 3 | Copyright (C) 2009, 2010, 2011 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | it under the terms of the GNU General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation; either version 3, or (at your | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with GNUnet; see the file COPYING. If not, write to the | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | Boston, MA 02110-1301, USA. | ||
19 | */ | 17 | */ |
20 | 18 | ||
21 | /** | 19 | /** |
@@ -32,6 +30,12 @@ | |||
32 | #include "gnunet_dht_service.h" | 30 | #include "gnunet_dht_service.h" |
33 | 31 | ||
34 | /** | 32 | /** |
33 | * Hash of the identity of this peer. | ||
34 | */ | ||
35 | extern struct GNUNET_HashCode my_identity_hash; | ||
36 | |||
37 | |||
38 | /** | ||
35 | * Perform a PUT operation. Forwards the given request to other | 39 | * Perform a PUT operation. Forwards the given request to other |
36 | * peers. Does not store the data locally. Does not give the | 40 | * peers. Does not store the data locally. Does not give the |
37 | * data to local clients. May do nothing if this is the only | 41 | * data to local clients. May do nothing if this is the only |
@@ -123,6 +127,22 @@ GDS_NEIGHBOURS_handle_reply (const struct GNUNET_PeerIdentity *target, | |||
123 | 127 | ||
124 | 128 | ||
125 | /** | 129 | /** |
130 | * Check whether my identity is closer than any known peers. If a | ||
131 | * non-null bloomfilter is given, check if this is the closest peer | ||
132 | * that hasn't already been routed to. | ||
133 | * | ||
134 | * @param key hash code to check closeness to | ||
135 | * @param bloom bloomfilter, exclude these entries from the decision | ||
136 | * @return #GNUNET_YES if node location is closest, | ||
137 | * #GNUNET_NO otherwise. | ||
138 | */ | ||
139 | int | ||
140 | GDS_am_closest_peer (const struct GNUNET_HashCode *key, | ||
141 | const struct GNUNET_CONTAINER_BloomFilter *bloom); | ||
142 | |||
143 | |||
144 | |||
145 | /** | ||
126 | * Initialize neighbours subsystem. | 146 | * Initialize neighbours subsystem. |
127 | * | 147 | * |
128 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 148 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |