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_Message
41 * Type: GNUNET_MESSAGE_TYPE_DHT_MESSAGE
43 struct GNUNET_MessageHeader header;
46 * The key to search for
51 * Replication level for this message
53 uint16_t desired_replication_level;
61 * Is this message uniquely identified? If so it has
62 * a unique_id appended to it.
64 /* uint16_t unique; I don't think we need this, it should be held in the encapsulated message */
66 /* uint64_t unique_id*/
68 /* GNUNET_MessageHeader *enc actual DHT message, copied to end of this dealy do */
73 * Message to insert data into the DHT
75 struct GNUNET_DHT_PutMessage
78 * Type: GNUNET_MESSAGE_TYPE_DHT_PUT
80 struct GNUNET_MessageHeader header;
83 * The type of data to insert.
88 * The size of the data, appended to the end of this message.
93 * How long should this data persist?
95 struct GNUNET_TIME_Absolute expiration;
101 * Message to request data from the DHT
103 struct GNUNET_DHT_GetMessage
106 * Type: GNUNET_MESSAGE_TYPE_DHT_GET
108 struct GNUNET_MessageHeader header;
111 * The type for the data for the GET request
116 * The key to search for
123 * Message to return data from the DHT
125 struct GNUNET_DHT_GetResultMessage
128 * Type: GNUNET_MESSAGE_TYPE_DHT_GET_RESULT
130 struct GNUNET_MessageHeader header;
133 * The type for the data for the GET request
138 * The key to search for
143 * The size of the data, appended to the end of this message.
150 * Message to request data from the DHT
152 struct GNUNET_DHT_FindPeerMessage
155 * Type: GNUNET_MESSAGE_TYPE_DHT_FIND_PEER
157 struct GNUNET_MessageHeader header;
160 * The key being looked up
167 * Message to return data from the DHT
169 struct GNUNET_DHT_FindPeerResultMessage
172 * Type: GNUNET_MESSAGE_TYPE_DHT_FIND_PEER_RESULT
174 struct GNUNET_MessageHeader header;
177 * The peer that was searched for
179 struct GNUNET_PeerIdentity peer;
182 * The size of the HELLO for the returned peer,
183 * appended to the end of this message, 0 if