GNUnet 0.27.0
 
Loading...
Searching...
No Matches
gnunet-service-dht.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2009-2016, 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
26#ifndef GNUNET_SERVICE_DHT_H
27#define GNUNET_SERVICE_DHT_H
28
31#include "gnunet_pils_service.h"
33
34
35#define DEBUG_DHT GNUNET_EXTRA_LOGGING
36
40struct GDS_Underlay;
41
45extern const struct GNUNET_CONFIGURATION_Handle *GDS_cfg;
46
51
56
61
65extern struct GNUNET_PILS_Handle *GDS_pils;
66
71
72
79void
81 const char *address);
82
83
99void
100GDS_u_send (struct GDS_Underlay *u,
101 struct GNUNET_DHTU_Target *target,
102 const void *msg,
103 size_t msg_size,
105 void *finished_cb_cls);
106
107
114void
115GDS_u_drop (struct GDS_Underlay *u,
117
118
126GDS_u_hold (struct GDS_Underlay *u,
127 struct GNUNET_DHTU_Target *target);
128
129
141bool
143 const struct GNUNET_HashCode *query_hash,
144 unsigned int get_path_length,
145 const struct GNUNET_DHT_PathElement *get_path);
146
147
159void
162 uint32_t hop_count,
163 uint32_t desired_replication_level,
164 const struct GNUNET_HashCode *key);
165
166
175void
177 const struct GNUNET_DHT_PathElement *get_path,
178 unsigned int get_path_length);
179
180
190void
192 uint32_t hop_count,
193 uint32_t desired_replication_level);
194
200double
201GDS_NSE_get (void);
202
203#endif
struct GNUNET_GETOPT_CommandLineOption options[]
Definition 002.c:5
struct GNUNET_MessageHeader * msg
Definition 005.c:2
static mp_limb_t u[(((256)+GMP_NUMB_BITS - 1)/GMP_NUMB_BITS)]
static void finished_cb(void *cls, enum GNUNET_GenericReturnValue rv)
static char * address
GNS address for this phone.
struct GNUNET_HashCode key
The key used in the DHT.
static uint32_t type
Type string converted to DNS type value.
double GDS_NSE_get(void)
Return the current NSE.
struct GNUNET_MessageHeader * GDS_my_hello
Our HELLO parser.
void GDS_CLIENTS_process_get(enum GNUNET_DHT_RouteOption options, enum GNUNET_BLOCK_Type type, uint32_t hop_count, uint32_t desired_replication_level, const struct GNUNET_HashCode *key)
Check if some client is monitoring GET messages and notify them in that case.
struct GNUNET_PILS_Handle * GDS_pils
Handle for the pils service.
void GDS_CLIENTS_process_get_resp(const struct GNUNET_DATACACHE_Block *bd, const struct GNUNET_DHT_PathElement *get_path, unsigned int get_path_length)
Check if some client is monitoring GET RESP messages and notify them in that case.
struct GNUNET_STATISTICS_Handle * GDS_stats
Handle for the statistics service.
struct GNUNET_BLOCK_Context * GDS_block_context
Our handle to the BLOCK library.
struct GNUNET_SERVICE_Handle * GDS_service
Handle for the service.
struct GNUNET_DHTU_PreferenceHandle * GDS_u_hold(struct GDS_Underlay *u, struct GNUNET_DHTU_Target *target)
Create a hold on target at underlay u.
void GDS_u_send(struct GDS_Underlay *u, struct GNUNET_DHTU_Target *target, const void *msg, size_t msg_size, GNUNET_SCHEDULER_TaskCallback finished_cb, void *finished_cb_cls)
Send message to some other participant over the network.
void GDS_CLIENTS_process_put(const struct GNUNET_DATACACHE_Block *bd, uint32_t hop_count, uint32_t desired_replication_level)
Check if some client is monitoring PUT messages and notify them in that case.
void GDS_u_drop(struct GDS_Underlay *u, struct GNUNET_DHTU_PreferenceHandle *ph)
Drop a hold ph from underlay u.
bool GDS_CLIENTS_handle_reply(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 we've received from another peer.
void GDS_u_try_connect(const struct GNUNET_PeerIdentity *pid, const char *address)
Ask all underlays to connect to peer pid at address.
const struct GNUNET_CONFIGURATION_Handle * GDS_cfg
Configuration we use.
GNUnet DHT service's datacache integration.
GNUnet DHT routing code.
static struct GNUNET_PeerIdentity pid
Identity of the peer we transmit to / connect to.
GNUNET_BLOCK_Type
WARNING: This header is generated! In order to add DHT block types, you must register them in GANA,...
API to create, modify and access statistics.
GNUNET_DHT_RouteOption
Options for routing.
void(* GNUNET_SCHEDULER_TaskCallback)(void *cls)
Signature of the main function of a task.
Information we keep per underlay.
Handle to an initialized block library.
Definition block.c:55
Information about a block stored in the datacache.
Opaque handle expressing a preference of the DHT to keep a particular target connected.
struct GNUNET_DHTU_Target * target
Target a preference was expressed for.
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.
A handle for the PILS service.
Definition pils_api.c:82
The identity of the host (wraps the signing key of the peer).
Handle to a service.
Definition service.c:116
Handle for the service.