GNUnet 0.22.2
gnunet-service-dht.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2009-2016 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
32
33
34#define DEBUG_DHT GNUNET_EXTRA_LOGGING
35
39struct GDS_Underlay;
40
44extern const struct GNUNET_CONFIGURATION_Handle *GDS_cfg;
45
50
55
60
65
70
75
80
81
88void
90 const char *address);
91
92
108void
109GDS_u_send (struct GDS_Underlay *u,
110 struct GNUNET_DHTU_Target *target,
111 const void *msg,
112 size_t msg_size,
114 void *finished_cb_cls);
115
116
123void
124GDS_u_drop (struct GDS_Underlay *u,
126
127
135GDS_u_hold (struct GDS_Underlay *u,
136 struct GNUNET_DHTU_Target *target);
137
138
150bool
152 const struct GNUNET_HashCode *query_hash,
153 unsigned int get_path_length,
154 const struct GNUNET_DHT_PathElement *get_path);
155
156
168void
171 uint32_t hop_count,
172 uint32_t desired_replication_level,
173 const struct GNUNET_HashCode *key);
174
175
184void
186 const struct GNUNET_DHT_PathElement *get_path,
187 unsigned int get_path_length);
188
189
199void
201 uint32_t hop_count,
202 uint32_t desired_replication_level);
203
209double
210GDS_NSE_get (void);
211
212#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.
struct GNUNET_PeerIdentity GDS_my_identity
Identity of this peer.
double GDS_NSE_get(void)
Return the current NSE.
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.
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_CRYPTO_EddsaPrivateKey GDS_my_private_key
Our private key.
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.
struct GNUNET_HELLO_Builder * GDS_my_hello
Our HELLO builder.
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.
struct GNUNET_HashCode GDS_my_identity_hash
Hash of the identity of this peer.
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.
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.
GNUNET_BLOCK_Type
WARNING: This header is generated! In order to add DHT block types, you must register them in GANA,...
Information we keep per underlay.
Handle to an initialized block library.
Definition: block.c:55
Private ECC key encoded for transmission.
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,...
Context for building (or parsing) HELLO URIs.
Definition: hello-uri.c:205
A 512-bit hashcode.
The identity of the host (wraps the signing key of the peer).
Handle to a service.
Definition: service.c:116
Handle for the service.