GNUnet  0.20.0
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, 2021 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 
159 
164 
170 
176 
181 
186 
191 
192  /* trunc_peer, put path, get path and actual data are copied to end of this dealy do */
193 };
194 
195 
200 {
205 
209  uint32_t type GNUNET_PACKED;
210 
215 
220 
225 
230 
231  /* DATA copied to end of this message */
232 };
233 
234 
239 {
244 
249 
253  uint32_t type GNUNET_PACKED;
254 
259 
264 
270 
275 
280 
281  /* put path (if tracked) */
282 
283  /* Payload */
284 };
285 
286 
291 {
297 
301  uint32_t type GNUNET_PACKED;
302 
307 
312 
317 
322 
327 };
328 
329 
334 {
339 
344 
348  uint32_t type GNUNET_PACKED;
349 
354 
359 
364 
369 
370  /* get path (if tracked) */
371 };
372 
377 {
382 
386  uint32_t type GNUNET_PACKED;
387 
392 
397 
402 
407 
412 
417 
418  /* put path (if tracked) */
419 
420  /* get path (if tracked) */
421 
422  /* Payload */
423 };
424 
426 
427 #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:200
struct GNUNET_HashCode key
The key to store the value under.
Definition: dht.h:229
uint32_t type
The type of data to insert.
Definition: dht.h:209
uint32_t options
Message options, actually an 'enum GNUNET_DHT_RouteOption' value.
Definition: dht.h:214
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_DHT_CLIENT_PUT.
Definition: dht.h:204
uint32_t desired_replication_level
Replication level for this message.
Definition: dht.h:219
struct GNUNET_TIME_AbsoluteNBO expiration
How long should this data persist?
Definition: dht.h:224
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:169
uint64_t unique_id
Unique ID of the matching GET request.
Definition: dht.h:180
struct GNUNET_TIME_AbsoluteNBO expiration
When does this entry expire?
Definition: dht.h:185
uint32_t reserved
Reserved, always 0.
Definition: dht.h:158
struct GNUNET_HashCode key
The key that was searched for.
Definition: dht.h:190
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 options
Message options, actually an 'enum GNUNET_DHT_RouteOption' value.
Definition: dht.h:163
uint32_t get_path_length
The number of peer identities recorded from the storage location to this peer.
Definition: dht.h:175
Message to monitor get requests going through peer, DHT service -> clients.
Definition: dht.h:334
uint32_t hop_count
Hop count.
Definition: dht.h:353
uint32_t options
Message options, actually an 'enum GNUNET_DHT_RouteOption' value.
Definition: dht.h:343
uint32_t desired_replication_level
Replication level for this message.
Definition: dht.h:358
uint32_t reserved
Always zero.
Definition: dht.h:363
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_DHT_MONITOR_GET.
Definition: dht.h:338
struct GNUNET_HashCode key
The key to store the value under.
Definition: dht.h:368
uint32_t type
The type of data in the request.
Definition: dht.h:348
Message to monitor get results going through peer, DHT service -> clients.
Definition: dht.h:377
uint32_t reserved
Reserved, always 0.
Definition: dht.h:391
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_DHT_P2P_RESULT.
Definition: dht.h:381
struct GNUNET_HashCode key
The key of the corresponding GET request.
Definition: dht.h:416
uint32_t options
Message options, actually an 'enum GNUNET_DHT_RouteOption' value.
Definition: dht.h:396
struct GNUNET_TIME_AbsoluteNBO expiration_time
When does the content expire?
Definition: dht.h:411
uint32_t type
Content type.
Definition: dht.h:386
uint32_t get_path_length
Length of the GET path that follows (if tracked).
Definition: dht.h:406
uint32_t put_path_length
Length of the PUT path that follows (if tracked).
Definition: dht.h:401
Message to monitor put requests going through peer, DHT service -> clients.
Definition: dht.h:239
uint32_t options
Message options, actually an 'enum GNUNET_DHT_RouteOption' value.
Definition: dht.h:248
struct GNUNET_TIME_AbsoluteNBO expiration_time
How long should this data persist?
Definition: dht.h:274
uint32_t desired_replication_level
Replication level for this message.
Definition: dht.h:263
struct GNUNET_HashCode key
The key to store the value under.
Definition: dht.h:279
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_DHT_MONITOR_PUT.
Definition: dht.h:243
uint32_t hop_count
Hop count so far.
Definition: dht.h:258
uint32_t type
The type of data in the request.
Definition: dht.h:253
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:269
Message to request monitoring messages, clients -> DHT service.
Definition: dht.h:291
struct GNUNET_MessageHeader header
Type: GNUNET_MESSAGE_TYPE_DHT_MONITOR_START or GNUNET_MESSAGE_TYPE_DHT_MONITOR_STOP.
Definition: dht.h:296
int16_t get
Flag whether to notify about GET messages.
Definition: dht.h:306
uint32_t type
The type of data desired, GNUNET_BLOCK_TYPE_ANY for all.
Definition: dht.h:301
int16_t filter_key
Flag whether to use the provided key to filter messages.
Definition: dht.h:321
int16_t get_resp
Flag whether to notify about GET_REPONSE messages.
Definition: dht.h:311
struct GNUNET_HashCode key
The key to filter messages by.
Definition: dht.h:326
int16_t put
Flag whether to notify about PUT messages.
Definition: dht.h:316
A 512-bit hashcode.
Header for all communications.
Time for absolute time used by GNUnet, in microseconds and in network byte order.