GNUnet  0.10.x
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 
29 #include "gnunet_util_lib.h"
32 #include "gnunet_block_lib.h"
33 
34 #define DEBUG_DHT GNUNET_EXTRA_LOGGING
35 
39 extern const struct GNUNET_CONFIGURATION_Handle *GDS_cfg;
40 
44 extern struct GNUNET_SERVICE_Handle *GDS_service;
45 
50 
54 extern struct GNUNET_STATISTICS_Handle *GDS_stats;
55 
59 extern struct GNUNET_MessageHeader *GDS_my_hello;
60 
61 
62 
78 void
80  const struct GNUNET_HashCode *key,
81  unsigned int get_path_length,
82  const struct GNUNET_PeerIdentity *get_path,
83  unsigned int put_path_length,
84  const struct GNUNET_PeerIdentity *put_path,
86  size_t data_size,
87  const void *data);
88 
89 
102 void
104  enum GNUNET_BLOCK_Type type,
105  uint32_t hop_count,
106  uint32_t desired_replication_level,
107  unsigned int path_length,
108  const struct GNUNET_PeerIdentity *path,
109  const struct GNUNET_HashCode *key);
110 
111 
126 void
128  const struct GNUNET_PeerIdentity *get_path,
129  unsigned int get_path_length,
130  const struct GNUNET_PeerIdentity *put_path,
131  unsigned int put_path_length,
132  struct GNUNET_TIME_Absolute exp,
133  const struct GNUNET_HashCode * key,
134  const void *data,
135  size_t size);
136 
137 
153 void
155  enum GNUNET_BLOCK_Type type,
156  uint32_t hop_count,
157  uint32_t desired_replication_level,
158  unsigned int path_length,
159  const struct GNUNET_PeerIdentity *path,
160  struct GNUNET_TIME_Absolute exp,
161  const struct GNUNET_HashCode *key,
162  const void *data,
163  size_t size);
164 
165 #endif
struct GNUNET_STATISTICS_Handle * GDS_stats
Handle for the statistics service.
Handle to an initialized block library.
Definition: block.c:54
static char * expiration
Credential TTL.
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
Handle to a service.
Definition: service.c:116
GNUNET_BLOCK_Type
Blocks in the datastore and the datacache must have a unique type.
struct GNUNET_SERVICE_Handle * GDS_service
Handle for the service.
void GDS_CLIENTS_process_get(uint32_t options, enum GNUNET_BLOCK_Type type, uint32_t hop_count, uint32_t desired_replication_level, unsigned int path_length, const struct GNUNET_PeerIdentity *path, const struct GNUNET_HashCode *key)
Check if some client is monitoring GET messages and notify them in that case.
Handle for the service.
void GDS_CLIENTS_process_put(uint32_t options, enum GNUNET_BLOCK_Type type, uint32_t hop_count, uint32_t desired_replication_level, unsigned int path_length, const struct GNUNET_PeerIdentity *path, struct GNUNET_TIME_Absolute exp, const struct GNUNET_HashCode *key, const void *data, size_t size)
Check if some client is monitoring PUT messages and notify them in that case.
struct GNUNET_BLOCK_Context * GDS_block_context
Our handle to the BLOCK library.
struct GNUNET_MessageHeader * GDS_my_hello
Our HELLO.
void GDS_CLIENTS_process_get_resp(enum GNUNET_BLOCK_Type type, const struct GNUNET_PeerIdentity *get_path, unsigned int get_path_length, const struct GNUNET_PeerIdentity *put_path, unsigned int put_path_length, struct GNUNET_TIME_Absolute exp, const struct GNUNET_HashCode *key, const void *data, size_t size)
Check if some client is monitoring GET RESP messages and notify them in that case.
A 512-bit hashcode.
struct GNUNET_HashCode key
The key used in the DHT.
static unsigned int size
Size of the "table".
Definition: peer.c:67
The identity of the host (wraps the signing key of the peer).
configuration data
Definition: configuration.c:85
enum GNUNET_TESTBED_UnderlayLinkModelType type
the type of this model
Header for all communications.
Time for absolute times used by GNUnet, in microseconds.
const struct GNUNET_CONFIGURATION_Handle * GDS_cfg
Configuration we use.
uint32_t data
The data value.
static size_t data_size
Number of bytes in data.
void GDS_CLIENTS_handle_reply(struct GNUNET_TIME_Absolute expiration, const struct GNUNET_HashCode *key, unsigned int get_path_length, const struct GNUNET_PeerIdentity *get_path, unsigned int put_path_length, const struct GNUNET_PeerIdentity *put_path, enum GNUNET_BLOCK_Type type, size_t data_size, const void *data)
Handle a reply we&#39;ve received from another peer.