GNUnet  0.19.4
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 
33 
34 
35 #define DEBUG_DHT GNUNET_EXTRA_LOGGING
36 
40 struct GDS_Underlay;
41 
45 extern const struct GNUNET_CONFIGURATION_Handle *GDS_cfg;
46 
50 extern struct GNUNET_SERVICE_Handle *GDS_service;
51 
56 
60 extern struct GNUNET_STATISTICS_Handle *GDS_stats;
61 
65 extern struct GNUNET_HELLO_Builder *GDS_my_hello;
66 
71 
76 
81 
82 
89 void
91  const char *address);
92 
93 
109 void
110 GDS_u_send (struct GDS_Underlay *u,
111  struct GNUNET_DHTU_Target *target,
112  const void *msg,
113  size_t msg_size,
115  void *finished_cb_cls);
116 
117 
124 void
125 GDS_u_drop (struct GDS_Underlay *u,
127 
128 
136 GDS_u_hold (struct GDS_Underlay *u,
137  struct GNUNET_DHTU_Target *target);
138 
139 
151 bool
153  const struct GNUNET_HashCode *query_hash,
154  unsigned int get_path_length,
155  const struct GNUNET_DHT_PathElement *get_path);
156 
157 
169 void
171  enum GNUNET_BLOCK_Type type,
172  uint32_t hop_count,
173  uint32_t desired_replication_level,
174  const struct GNUNET_HashCode *key);
175 
176 
185 void
187  const struct GNUNET_DHT_PathElement *get_path,
188  unsigned int get_path_length);
189 
190 
200 void
202  uint32_t hop_count,
203  uint32_t desired_replication_level);
204 
210 double
211 GDS_NSE_get (void);
212 
213 #endif
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
GNUNET_BLOCK_Type
WARNING: This header is generated! In order to add DHT block types, you must register them in GANA,...
static struct GNUNET_ATS_PerformanceHandle * ph
ATS performance handle used.
Definition: gnunet-ats.c:116
static void finished_cb(enum GNUNET_GenericReturnValue rv)
static char * address
GNS address for this phone.
struct GNUNET_HashCode key
The key used in the DHT.
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_DHTU_PreferenceHandle * GDS_u_hold(struct GDS_Underlay *u, struct GNUNET_DHTU_Target *target)
Create a hold on target at underlay u.
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.
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.
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:184
A 512-bit hashcode.
The identity of the host (wraps the signing key of the peer).
Handle to a service.
Definition: service.c:118
Handle for the service.
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model