GNUnet  0.10.x
gnunet-service-dht_neighbours.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2009, 2010, 2011 GNUnet e.V.
4 
5  GNUnet is free software: you can redistribute it and/or modify it
6  under the terms of the GNU Affero General Public License as published
7  by the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  GNUnet is distributed in the hope that it will be useful, but
11  WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Affero General Public License for more details.
14 
15  You should have received a copy of the GNU Affero General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19 */
20 
27 #ifndef GNUNET_SERVICE_DHT_NEIGHBOURS_H
28 #define GNUNET_SERVICE_DHT_NEIGHBOURS_H
29 
30 #include "gnunet_util_lib.h"
31 #include "gnunet_block_lib.h"
32 #include "gnunet_dht_service.h"
33 
37 extern struct GNUNET_HashCode my_identity_hash;
38 
39 
60 int
63  uint32_t desired_replication_level,
64  struct GNUNET_TIME_Absolute expiration_time,
65  uint32_t hop_count,
67  const struct GNUNET_HashCode *key,
68  unsigned int put_path_length,
69  struct GNUNET_PeerIdentity *put_path,
70  const void *data, size_t data_size);
71 
72 
90 int
93  uint32_t desired_replication_level,
94  uint32_t hop_count,
95  const struct GNUNET_HashCode *key,
96  const void *xquery,
97  size_t xquery_size,
98  struct GNUNET_BLOCK_Group *bg,
99  struct GNUNET_CONTAINER_BloomFilter *peer_bf);
100 
101 
118 void
120  enum GNUNET_BLOCK_Type type,
121  struct GNUNET_TIME_Absolute expiration_time,
122  const struct GNUNET_HashCode *key,
123  unsigned int put_path_length,
124  const struct GNUNET_PeerIdentity *put_path,
125  unsigned int get_path_length,
126  const struct GNUNET_PeerIdentity *get_path,
127  const void *data,
128  size_t data_size);
129 
130 
141 int
143  const struct GNUNET_CONTAINER_BloomFilter *bloom);
144 
145 
146 
152 int
153 GDS_NEIGHBOURS_init (void);
154 
155 
159 void
160 GDS_NEIGHBOURS_done (void);
161 
162 
168 struct GNUNET_PeerIdentity *
169 GDS_NEIGHBOURS_get_id (void);
170 
171 
172 #endif
void GDS_NEIGHBOURS_handle_reply(const struct GNUNET_PeerIdentity *target, enum GNUNET_BLOCK_Type type, struct GNUNET_TIME_Absolute expiration_time, const struct GNUNET_HashCode *key, unsigned int put_path_length, const struct GNUNET_PeerIdentity *put_path, unsigned int get_path_length, const struct GNUNET_PeerIdentity *get_path, const void *data, size_t data_size)
Handle a reply (route to origin).
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
GNUNET_BLOCK_Type
Blocks in the datastore and the datacache must have a unique type.
int GDS_am_closest_peer(const struct GNUNET_HashCode *key, const struct GNUNET_CONTAINER_BloomFilter *bloom)
Check whether my identity is closer than any known peers.
void GDS_NEIGHBOURS_done(void)
Shutdown neighbours subsystem.
int GDS_NEIGHBOURS_handle_put(enum GNUNET_BLOCK_Type type, enum GNUNET_DHT_RouteOption options, uint32_t desired_replication_level, struct GNUNET_TIME_Absolute expiration_time, uint32_t hop_count, struct GNUNET_CONTAINER_BloomFilter *bf, const struct GNUNET_HashCode *key, unsigned int put_path_length, struct GNUNET_PeerIdentity *put_path, const void *data, size_t data_size)
Perform a PUT operation.
A 512-bit hashcode.
GNUNET_DHT_RouteOption
Options for routing.
struct GNUNET_HashCode key
The key used in the DHT.
The identity of the host (wraps the signing key of the peer).
int GDS_NEIGHBOURS_init(void)
Initialize neighbours subsystem.
struct GNUNET_HashCode my_identity_hash
Hash of the identity of this peer.
Block group data.
int GDS_NEIGHBOURS_handle_get(enum GNUNET_BLOCK_Type type, enum GNUNET_DHT_RouteOption options, uint32_t desired_replication_level, uint32_t hop_count, const struct GNUNET_HashCode *key, const void *xquery, size_t xquery_size, struct GNUNET_BLOCK_Group *bg, struct GNUNET_CONTAINER_BloomFilter *peer_bf)
Perform a GET operation.
struct GNUNET_PeerIdentity * GDS_NEIGHBOURS_get_id(void)
Get the ID of the local node.
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model
Time for absolute times used by GNUnet, in microseconds.
uint32_t data
The data value.
static size_t data_size
Number of bytes in data.