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
38 * Message which indicates the DHT should cancel outstanding
39 * requests and discard any state.
41 struct GNUNET_DHT_ClientGetStopMessage
44 * Type: GNUNET_MESSAGE_TYPE_DHT_GET_STOP
46 struct GNUNET_MessageHeader header;
51 uint32_t reserved GNUNET_PACKED;
54 * Unique ID identifying this request
56 uint64_t unique_id GNUNET_PACKED;
67 * DHT GET message sent from clients to service. Indicates that a GET
68 * request should be issued.
70 struct GNUNET_DHT_ClientGetMessage
73 * Type: GNUNET_MESSAGE_TYPE_DHT_CLIENT_GET
75 struct GNUNET_MessageHeader header;
78 * Message options, actually an 'enum GNUNET_DHT_RouteOption' value.
80 uint32_t options GNUNET_PACKED;
83 * Replication level for this message
85 uint32_t desired_replication_level GNUNET_PACKED;
88 * The type for the data for the GET request; actually an 'enum
94 * The key to search for
99 * Unique ID identifying this request, if 0 then
100 * the client will not expect a response
102 uint64_t unique_id GNUNET_PACKED;
104 /* Possibly followed by xquery, copied to end of this dealy do */
110 * Reply to a GET send from the service to a client.
112 struct GNUNET_DHT_ClientResultMessage
115 * Type: GNUNET_MESSAGE_TYPE_DHT_CLIENT_RESULT
117 struct GNUNET_MessageHeader header;
120 * The type for the data.
125 * Number of peers recorded in the outgoing path from source to the
126 * storgage location of this message.
128 uint32_t put_path_length GNUNET_PACKED;
131 * The number of peer identities recorded from the storage location
134 uint32_t get_path_length GNUNET_PACKED;
137 * Unique ID of the matching GET request.
139 uint64_t unique_id GNUNET_PACKED;
142 * When does this entry expire?
144 struct GNUNET_TIME_AbsoluteNBO expiration;
147 * The key that was searched for
151 /* put path, get path and actual data are copied to end of this dealy do */
157 * Message to insert data into the DHT, sent from clients to DHT service.
159 struct GNUNET_DHT_ClientPutMessage
162 * Type: GNUNET_MESSAGE_TYPE_DHT_CLIENT_PUT
164 struct GNUNET_MessageHeader header;
167 * The type of data to insert.
169 uint32_t type GNUNET_PACKED;
172 * Message options, actually an 'enum GNUNET_DHT_RouteOption' value.
174 uint32_t options GNUNET_PACKED;
177 * Replication level for this message
179 uint32_t desired_replication_level GNUNET_PACKED;
182 * How long should this data persist?
184 struct GNUNET_TIME_AbsoluteNBO expiration;
187 * The key to store the value under.
191 /* DATA copied to end of this message */