GNUnet 0.21.1
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, 2022 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#include "gnunet_dhtu_plugin.h"
35
36
37struct PeerInfo;
38
45struct PeerInfo *
47
48
64 uint16_t desired_replication_level,
65 uint16_t hop_count,
67
68
89 uint16_t desired_replication_level,
90 uint16_t hop_count,
91 const struct GNUNET_HashCode *key,
92 const void *xquery,
93 size_t xquery_size,
94 struct GNUNET_BLOCK_Group *bg,
95 struct GNUNET_CONTAINER_BloomFilter *peer_bf);
96
97
110bool
112 const struct GNUNET_DATACACHE_Block *bd,
113 const struct GNUNET_HashCode *query_hash,
114 unsigned int get_path_length,
115 const struct GNUNET_DHT_PathElement *get_path);
116
117
130 const struct GNUNET_CONTAINER_BloomFilter *bloom);
131
132
141void
142GDS_try_connect (void *cls,
143 const struct GNUNET_PeerIdentity *pid,
144 const char *uri);
145
146
158void
159GDS_u_connect (void *cls,
160 struct GNUNET_DHTU_Target *target,
161 const struct GNUNET_PeerIdentity *pid,
162 void **ctx);
163
164
171void
172GDS_u_disconnect (void *ctx);
173
174
184void
185GDS_u_receive (void *cls,
186 void **tctx,
187 void **sctx,
188 const void *message,
189 size_t message_size);
190
191
197void
199
200
208
209
213void
215
216
222struct GNUNET_PeerIdentity *
224
225
226#endif
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
struct GNUNET_HashCode key
The key used in the DHT.
static struct GNUNET_FS_Handle * ctx
static uint32_t type
Type string converted to DNS type value.
static struct GNUNET_FS_Uri * uri
Value of URI provided on command-line (when not publishing a file but just creating UBlocks to refer ...
GNUnet DHT service's datacache integration.
bool GDS_NEIGHBOURS_handle_reply(struct PeerInfo *pi, const struct GNUNET_DATACACHE_Block *bd, const struct GNUNET_HashCode *query_hash, unsigned int get_path_length, const struct GNUNET_DHT_PathElement *get_path)
Handle a reply (route to origin).
enum GNUNET_GenericReturnValue GDS_NEIGHBOURS_handle_put(const struct GNUNET_DATACACHE_Block *bd, uint16_t desired_replication_level, uint16_t hop_count, struct GNUNET_CONTAINER_BloomFilter *bf)
Perform a PUT operation.
void GDS_try_connect(void *cls, const struct GNUNET_PeerIdentity *pid, const char *uri)
Callback function used to extract URIs from a builder.
struct PeerInfo * GDS_NEIGHBOURS_lookup_peer(const struct GNUNET_PeerIdentity *target)
Lookup peer by peer's identity.
enum GNUNET_GenericReturnValue GDS_NEIGHBOURS_init(void)
Initialize neighbours subsystem.
void GDS_u_disconnect(void *ctx)
Function to call when we disconnected from a peer and can henceforth cannot transmit to that peer any...
void GDS_NEIGHBOURS_broadcast(const struct GNUNET_MessageHeader *msg)
Send msg to all peers in our buckets.
struct GNUNET_PeerIdentity * GDS_NEIGHBOURS_get_id(void)
Get the ID of the local node.
void GDS_u_connect(void *cls, struct GNUNET_DHTU_Target *target, const struct GNUNET_PeerIdentity *pid, void **ctx)
Function to call when we connect to a peer and can henceforth transmit to that peer.
void GDS_NEIGHBOURS_done(void)
Shutdown neighbours subsystem.
enum GNUNET_GenericReturnValue 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_u_receive(void *cls, void **tctx, void **sctx, const void *message, size_t message_size)
Function to call when we receive a message.
enum GNUNET_GenericReturnValue GDS_NEIGHBOURS_handle_get(enum GNUNET_BLOCK_Type type, enum GNUNET_DHT_RouteOption options, uint16_t desired_replication_level, uint16_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.
static struct GNUNET_PeerIdentity pid
Identity of the peer we transmit to / connect to.
Library for data block manipulation.
API to the DHT service.
GNUNET_DHT_RouteOption
Options for routing.
GNUNET_GenericReturnValue
Named constants for return values.
GNUNET_BLOCK_Type
WARNING: This header is generated! In order to add DHT block types, you must register them in GANA,...
Block group data.
Information about a block stored in the datacache.
Opaque handle that the underlay offers for the target peer when sending messages to another peer.
A (signed) path tracking a block's flow through the DHT is represented by an array of path elements,...
A 512-bit hashcode.
Header for all communications.
The identity of the host (wraps the signing key of the peer).
Entry for a peer in a bucket.