GNUnet 0.26.2-114-g7c6b613e3
 
Loading...
Searching...
No Matches
gnunet-service-dht_neighbours.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2009-2011, 2022, 2026 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_common.h"
31#include "gnunet_util_lib.h"
32#include "gnunet_block_lib.h"
33#include "gnunet_dht_service.h"
34#include "gnunet_dhtu_plugin.h"
36
37
38struct PeerInfo;
39
40typedef void (* GDS_PutOperationCallback) (void *cls,
42 forwarded);
43
50struct PeerInfo *
52
53
67void
69 uint16_t desired_replication_level,
70 uint16_t hop_count,
73 void *cb_cls);
74
75
96 uint16_t desired_replication_level,
97 uint16_t hop_count,
98 const struct GNUNET_HashCode *key,
99 const void *xquery,
100 size_t xquery_size,
101 struct GNUNET_BLOCK_Group *bg,
102 struct GNUNET_CONTAINER_BloomFilter *peer_bf);
103
104
117void
119 const struct GNUNET_DATACACHE_Block *bd,
120 const struct GNUNET_HashCode *query_hash,
121 unsigned int get_path_length,
122 const struct GNUNET_DHT_PathElement *get_path,
124 void *cb_cls);
125
126
139 const struct GNUNET_CONTAINER_BloomFilter *bloom);
140
141
150void
151GDS_try_connect (void *cls,
152 const struct GNUNET_PeerIdentity *pid,
153 const char *uri);
154
155
167void
168GDS_u_connect (void *cls,
169 struct GNUNET_DHTU_Target *target,
170 const struct GNUNET_PeerIdentity *pid,
171 void **ctx);
172
173
180void
181GDS_u_disconnect (void *ctx);
182
183
193void
194GDS_u_receive (void *cls,
195 void **tctx,
196 void **sctx,
197 const void *message,
198 size_t message_size);
199
200
206void
208
209
217
218
222void
224
225
231const struct GNUNET_PeerIdentity *
233
234
235#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.
void 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, GNUNET_SCHEDULER_TaskCallback cb, void *cb_cls)
Handle a reply (route to origin).
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.
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.
const struct GNUNET_PeerIdentity * GDS_NEIGHBOURS_get_id(void)
Get the ID of the local node.
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.
void(* GDS_PutOperationCallback)(void *cls, enum GNUNET_GenericReturnValue forwarded)
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.
void GDS_NEIGHBOURS_handle_put(const struct GNUNET_DATACACHE_Block *bd, uint16_t desired_replication_level, uint16_t hop_count, struct GNUNET_CONTAINER_BloomFilter *bf, GDS_PutOperationCallback cb, void *cb_cls)
Perform a PUT operation.
static struct GNUNET_PeerIdentity pid
Identity of the peer we transmit to / connect to.
Library for data block manipulation.
commonly used definitions; globals in this file are exempt from the rule that the module name ("commo...
GNUNET_BLOCK_Type
WARNING: This header is generated! In order to add DHT block types, you must register them in GANA,...
API to the DHT service.
GNUNET_DHT_RouteOption
Options for routing.
GNUNET_GenericReturnValue
Named constants for return values.
void(* GNUNET_SCHEDULER_TaskCallback)(void *cls)
Signature of the main function of a task.
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.