GNUnet  0.11.x
dht.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2001, 2002, 2003, 2004, 2009, 2011 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 DHT_H
28 #define DHT_H
29 
30 
34 #define DHT_BLOOM_SIZE 128
35 
36 
38 
44 {
49 
54 
59 
63  struct GNUNET_HashCode key;
64 };
65 
66 
72 {
77 
82 
87 
92  uint32_t type GNUNET_PACKED;
93 
98 
104 
105  /* Possibly followed by xquery, copied to end of this dealy do */
106 };
107 
108 
114 {
119 
124 
130 
135 
136  /* Followed by an array of the hash codes of known results */
137 };
138 
139 
144 {
149 
153  uint32_t type GNUNET_PACKED;
154 
160 
166 
171 
176 
181 
182  /* put path, get path and actual data are copied to end of this dealy do */
183 };
184 
185 
190 {
195 
199  uint32_t type GNUNET_PACKED;
200 
205 
210 
215 
220 
221  /* DATA copied to end of this message */
222 };
223 
224 
229 {
234 
239 
243  uint32_t type GNUNET_PACKED;
244 
249 
254 
260 
265 
270 
271  /* put path (if tracked) */
272 
273  /* Payload */
274 };
275 
276 
281 {
287 
291  uint32_t type GNUNET_PACKED;
292 
297 
302 
307 
312 
317 };
318 
319 
324 {
329 
334 
338  uint32_t type GNUNET_PACKED;
339 
344 
349 
355 
360 
361  /* get path (if tracked) */
362 };
363 
368 {
373 
377  uint32_t type GNUNET_PACKED;
378 
383 
388 
393 
398 
399  /* put path (if tracked) */
400 
401  /* get path (if tracked) */
402 
403  /* Payload */
404 };
405 
407 
408 #endif
#define GNUNET_NETWORK_STRUCT_BEGIN
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32.
#define GNUNET_NETWORK_STRUCT_END
Define as empty, GNUNET_PACKED should suffice, but this won't work on W32;.
#define GNUNET_PACKED
gcc-ism to get packed structs.
DHT GET message sent from clients to service.
Definition: dht.h:72
uint64_t unique_id
Unique ID identifying this request, if 0 then the client will not expect a response.
Definition: dht.h:103
uint32_t options
Message options, actually an 'enum GNUNET_DHT_RouteOption' value.
Definition: dht.h:81
struct GNUNET_HashCode key
The key to search for.
Definition: dht.h:97
uint32_t type
The type for the data for the GET request; actually an 'enum GNUNET_BLOCK_Type'.
Definition: dht.h:92
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_DHT_CLIENT_GET.
Definition: dht.h:76
uint32_t desired_replication_level
Replication level for this message.
Definition: dht.h:86
DHT GET RESULTS KNOWN message sent from clients to service.
Definition: dht.h:114
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_DHT_CLIENT_GET_RESULTS_KNOWN.
Definition: dht.h:118
struct GNUNET_HashCode key
The key we are searching for (to make it easy to find the corresponding GET inside the service).
Definition: dht.h:129
uint32_t reserved
Reserved, always 0.
Definition: dht.h:123
uint64_t unique_id
Unique ID identifying this request.
Definition: dht.h:134
Message which indicates the DHT should cancel outstanding requests and discard any state.
Definition: dht.h:44
uint64_t unique_id
Unique ID identifying this request.
Definition: dht.h:58
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_DHT_CLIENT_GET_STOP.
Definition: dht.h:48
struct GNUNET_HashCode key
Key of this request.
Definition: dht.h:63
uint32_t reserved
Always zero.
Definition: dht.h:53
Message to insert data into the DHT, sent from clients to DHT service.
Definition: dht.h:190
struct GNUNET_HashCode key
The key to store the value under.
Definition: dht.h:219
uint32_t type
The type of data to insert.
Definition: dht.h:199
uint32_t options
Message options, actually an 'enum GNUNET_DHT_RouteOption' value.
Definition: dht.h:204
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_DHT_CLIENT_PUT.
Definition: dht.h:194
uint32_t desired_replication_level
Replication level for this message.
Definition: dht.h:209
struct GNUNET_TIME_AbsoluteNBO expiration
How long should this data persist?
Definition: dht.h:214
Reply to a GET send from the service to a client.
Definition: dht.h:144
uint32_t put_path_length
Number of peers recorded in the outgoing path from source to the storgage location of this message.
Definition: dht.h:159
uint64_t unique_id
Unique ID of the matching GET request.
Definition: dht.h:170
struct GNUNET_TIME_AbsoluteNBO expiration
When does this entry expire?
Definition: dht.h:175
struct GNUNET_HashCode key
The key that was searched for.
Definition: dht.h:180
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_DHT_CLIENT_RESULT.
Definition: dht.h:148
uint32_t type
The type for the data.
Definition: dht.h:153
uint32_t get_path_length
The number of peer identities recorded from the storage location to this peer.
Definition: dht.h:165
Message to monitor get requests going through peer, DHT service -> clients.
Definition: dht.h:324
uint32_t hop_count
Hop count.
Definition: dht.h:343
uint32_t options
Message options, actually an 'enum GNUNET_DHT_RouteOption' value.
Definition: dht.h:333
uint32_t desired_replication_level
Replication level for this message.
Definition: dht.h:348
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_DHT_MONITOR_GET.
Definition: dht.h:328
struct GNUNET_HashCode key
The key to store the value under.
Definition: dht.h:359
uint32_t type
The type of data in the request.
Definition: dht.h:338
uint32_t get_path_length
Number of peers recorded in the outgoing path from source to the storage location of this message.
Definition: dht.h:354
Message to monitor get results going through peer, DHT service -> clients.
Definition: dht.h:368
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_DHT_P2P_RESULT.
Definition: dht.h:372
struct GNUNET_HashCode key
The key of the corresponding GET request.
Definition: dht.h:397
struct GNUNET_TIME_AbsoluteNBO expiration_time
When does the content expire?
Definition: dht.h:392
uint32_t type
Content type.
Definition: dht.h:377
uint32_t get_path_length
Length of the GET path that follows (if tracked).
Definition: dht.h:387
uint32_t put_path_length
Length of the PUT path that follows (if tracked).
Definition: dht.h:382
Message to monitor put requests going through peer, DHT service -> clients.
Definition: dht.h:229
uint32_t options
Message options, actually an 'enum GNUNET_DHT_RouteOption' value.
Definition: dht.h:238
struct GNUNET_TIME_AbsoluteNBO expiration_time
How long should this data persist?
Definition: dht.h:264
uint32_t desired_replication_level
Replication level for this message.
Definition: dht.h:253
struct GNUNET_HashCode key
The key to store the value under.
Definition: dht.h:269
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_DHT_MONITOR_PUT.
Definition: dht.h:233
uint32_t hop_count
Hop count so far.
Definition: dht.h:248
uint32_t type
The type of data in the request.
Definition: dht.h:243
uint32_t put_path_length
Number of peers recorded in the outgoing path from source to the storage location of this message.
Definition: dht.h:259
Message to request monitoring messages, clients -> DHT service.
Definition: dht.h:281
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_DHT_MONITOR_START or GNUNET_MESSAGE_TYPE_DHT_MONITOR_STOP.
Definition: dht.h:286
int16_t get
Flag whether to notify about GET messages.
Definition: dht.h:296
uint32_t type
The type of data desired, GNUNET_BLOCK_TYPE_ANY for all.
Definition: dht.h:291
int16_t filter_key
Flag whether to use the provided key to filter messages.
Definition: dht.h:311
int16_t get_resp
Flag whether to notify about GET_REPONSE messages.
Definition: dht.h:301
struct GNUNET_HashCode key
The key to filter messages by.
Definition: dht.h:316
int16_t put
Flag whether to notify about PUT messages.
Definition: dht.h:306
A 512-bit hashcode.
Header for all communications.
Time for absolute time used by GNUnet, in microseconds and in network byte order.