2 This file is part of GNUnet.
3 (C) 2001, 2002, 2003, 2004, 2009, 2011 Christian Grothoff (and other contributing authors)
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
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 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
22 * @author Christian Grothoff
23 * @author Nathan Evans
32 * Size of the bloom filter the DHT uses to filter peers.
34 #define DHT_BLOOM_SIZE 128
37 GNUNET_NETWORK_STRUCT_BEGIN
40 * Message which indicates the DHT should cancel outstanding
41 * requests and discard any state.
43 struct GNUNET_DHT_ClientGetStopMessage
46 * Type: GNUNET_MESSAGE_TYPE_DHT_GET_STOP
48 struct GNUNET_MessageHeader header;
53 uint32_t reserved GNUNET_PACKED;
56 * Unique ID identifying this request
58 uint64_t unique_id GNUNET_PACKED;
69 * DHT GET message sent from clients to service. Indicates that a GET
70 * request should be issued.
72 struct GNUNET_DHT_ClientGetMessage
75 * Type: GNUNET_MESSAGE_TYPE_DHT_CLIENT_GET
77 struct GNUNET_MessageHeader header;
80 * Message options, actually an 'enum GNUNET_DHT_RouteOption' value.
82 uint32_t options GNUNET_PACKED;
85 * Replication level for this message
87 uint32_t desired_replication_level GNUNET_PACKED;
90 * The type for the data for the GET request; actually an 'enum
96 * The key to search for
101 * Unique ID identifying this request, if 0 then
102 * the client will not expect a response
104 uint64_t unique_id GNUNET_PACKED;
106 /* Possibly followed by xquery, copied to end of this dealy do */
112 * Reply to a GET send from the service to a client.
114 struct GNUNET_DHT_ClientResultMessage
117 * Type: GNUNET_MESSAGE_TYPE_DHT_CLIENT_RESULT
119 struct GNUNET_MessageHeader header;
122 * The type for the data.
127 * Number of peers recorded in the outgoing path from source to the
128 * storgage location of this message.
130 uint32_t put_path_length GNUNET_PACKED;
133 * The number of peer identities recorded from the storage location
136 uint32_t get_path_length GNUNET_PACKED;
139 * Unique ID of the matching GET request.
141 uint64_t unique_id GNUNET_PACKED;
144 * When does this entry expire?
146 struct GNUNET_TIME_AbsoluteNBO expiration;
149 * The key that was searched for
153 /* put path, get path and actual data are copied to end of this dealy do */
159 * Message to insert data into the DHT, sent from clients to DHT service.
161 struct GNUNET_DHT_ClientPutMessage
164 * Type: GNUNET_MESSAGE_TYPE_DHT_CLIENT_PUT
166 struct GNUNET_MessageHeader header;
169 * The type of data to insert.
171 uint32_t type GNUNET_PACKED;
174 * Message options, actually an 'enum GNUNET_DHT_RouteOption' value.
176 uint32_t options GNUNET_PACKED;
179 * Replication level for this message
181 uint32_t desired_replication_level GNUNET_PACKED;
184 * How long should this data persist?
186 struct GNUNET_TIME_AbsoluteNBO expiration;
189 * The key to store the value under.
193 /* DATA copied to end of this message */
199 * Message to monitor put requests going through peer, DHT service -> clients.
201 struct GNUNET_DHT_MonitorPutMessage
204 * Type: GNUNET_MESSAGE_TYPE_DHT_MONITOR_PUT
206 struct GNUNET_MessageHeader header;
209 * Message options, actually an 'enum GNUNET_DHT_RouteOption' value.
211 uint32_t options GNUNET_PACKED;
214 * The type of data in the request.
216 uint32_t type GNUNET_PACKED;
221 uint32_t hop_count GNUNET_PACKED;
224 * Replication level for this message
226 uint32_t desired_replication_level GNUNET_PACKED;
229 * Number of peers recorded in the outgoing path from source to the
230 * storage location of this message.
232 uint32_t put_path_length GNUNET_PACKED;
235 * How long should this data persist?
237 struct GNUNET_TIME_AbsoluteNBO expiration_time;
240 * The key to store the value under.
244 /* put path (if tracked) */
252 * Message to request monitoring messages, clients -> DHT service.
254 struct GNUNET_DHT_MonitorStartMessage
257 * Type: GNUNET_MESSAGE_TYPE_DHT_MONITOR_START
259 struct GNUNET_MessageHeader header;
262 * The type of data desired, GNUNET_BLOCK_TYPE_ANY for all.
264 uint32_t type GNUNET_PACKED;
267 * Flag whether to notify about GET messages.
269 int16_t get GNUNET_PACKED;
272 * Flag whether to notify about GET_REPONSE messages.
274 int16_t get_resp GNUNET_PACKED;
277 * Flag whether to notify about PUT messages.
279 int16_t put GNUNET_PACKED;
282 * Flag whether to use the provided key to filter messages.
284 int16_t filter_key GNUNET_PACKED;
287 * The key to filter messages by..
294 * Message to monitor get requests going through peer, DHT service -> clients.
296 struct GNUNET_DHT_MonitorGetMessage
299 * Type: GNUNET_MESSAGE_TYPE_DHT_MONITOR_PUT
301 struct GNUNET_MessageHeader header;
304 * Message options, actually an 'enum GNUNET_DHT_RouteOption' value.
306 uint32_t options GNUNET_PACKED;
309 * The type of data in the request.
311 uint32_t type GNUNET_PACKED;
316 uint32_t hop_count GNUNET_PACKED;
319 * Replication level for this message
321 uint32_t desired_replication_level GNUNET_PACKED;
324 * Number of peers recorded in the outgoing path from source to the
325 * storage location of this message.
327 uint32_t get_path_length GNUNET_PACKED;
330 * The key to store the value under.
334 /* get path (if tracked) */
339 * Message to monitor get results going through peer, DHT service -> clients.
341 struct GNUNET_DHT_MonitorGetRespMessage
344 * Type: GNUNET_MESSAGE_TYPE_DHT_P2P_RESULT
346 struct GNUNET_MessageHeader header;
351 uint32_t type GNUNET_PACKED;
354 * Length of the PUT path that follows (if tracked).
356 uint32_t put_path_length GNUNET_PACKED;
359 * Length of the GET path that follows (if tracked).
361 uint32_t get_path_length GNUNET_PACKED;
364 * When does the content expire?
366 struct GNUNET_TIME_AbsoluteNBO expiration_time;
369 * The key of the corresponding GET request.
373 /* put path (if tracked) */
375 /* get path (if tracked) */
381 GNUNET_NETWORK_STRUCT_END