2 This file is part of GNUnet.
3 (C) 2001, 2002, 2003, 2004, 2009 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 2, 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
30 #define DEBUG_DHT GNUNET_YES
32 typedef void (*GNUNET_DHT_MessageReceivedHandler) (void *cls,
33 struct GNUNET_MessageHeader *msg);
36 * Generic DHT message, wrapper for other message types
38 struct GNUNET_DHT_StopMessage
41 * Type: GNUNET_MESSAGE_TYPE_DHT_MESSAGE
43 struct GNUNET_MessageHeader header;
46 * Unique ID identifying this request
54 * Generic DHT message, wrapper for other message types
56 struct GNUNET_DHT_Message
59 * Type: GNUNET_MESSAGE_TYPE_DHT_MESSAGE
61 struct GNUNET_MessageHeader header;
64 * The key to search for
69 * Replication level for this message
71 uint16_t desired_replication_level;
79 * Is this message uniquely identified? If so it will
80 * be fire and forget, if not we will wait for a receipt
87 * Unique ID identifying this request
92 /* GNUNET_MessageHeader *enc actual DHT message, copied to end of this dealy do */
97 * Message to insert data into the DHT
99 struct GNUNET_DHT_PutMessage
102 * Type: GNUNET_MESSAGE_TYPE_DHT_PUT
104 struct GNUNET_MessageHeader header;
107 * The type of data to insert.
112 * The size of the data, appended to the end of this message.
117 * How long should this data persist?
119 struct GNUNET_TIME_Absolute expiration;
125 * Message to request data from the DHT
127 struct GNUNET_DHT_GetMessage
130 * Type: GNUNET_MESSAGE_TYPE_DHT_GET
132 struct GNUNET_MessageHeader header;
135 * The type for the data for the GET request
142 * Message to return data from the DHT
144 struct GNUNET_DHT_GetResultMessage
147 * Type: GNUNET_MESSAGE_TYPE_DHT_GET_RESULT
149 struct GNUNET_MessageHeader header;
152 * The type for the data for the GET request
157 * The key to search for
162 * The size of the data, appended to the end of this message.
169 * Message to request data from the DHT
171 struct GNUNET_DHT_FindPeerMessage
174 * Type: GNUNET_MESSAGE_TYPE_DHT_FIND_PEER
176 struct GNUNET_MessageHeader header;
181 * Message to return data from the DHT
183 struct GNUNET_DHT_FindPeerResultMessage
186 * Type: GNUNET_MESSAGE_TYPE_DHT_FIND_PEER_RESULT
188 struct GNUNET_MessageHeader header;
191 * The peer that was searched for
193 struct GNUNET_PeerIdentity peer;
196 * The size of the HELLO for the returned peer,
197 * appended to the end of this message, 0 if