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 * Message to insert data into the DHT
38 struct GNUNET_DHT_PutMessage
41 * Type: GNUNET_MESSAGE_TYPE_DHT_PUT
43 struct GNUNET_MessageHeader header;
46 * The type of data to insert.
51 * The key to insert data under.
56 * The size of the data, appended to the end of this message.
61 * How long should this data persist?
63 struct GNUNET_TIME_Relative timeout;
69 * Message to request data from the DHT
71 struct GNUNET_DHT_GetMessage
74 * Type: GNUNET_MESSAGE_TYPE_DHT_GET
76 struct GNUNET_MessageHeader header;
79 * The type for the data for the GET request
84 * The key to search for
91 * Message to return data from the DHT
93 struct GNUNET_DHT_GetResultMessage
96 * Type: GNUNET_MESSAGE_TYPE_DHT_GET_RESULT
98 struct GNUNET_MessageHeader header;
101 * The type for the data for the GET request
106 * The key to search for
111 * The size of the data, appended to the end of this message.
118 * Response to PUT request from the DHT
120 struct GNUNET_DHT_PutResultMessage
123 * Type: GNUNET_MESSAGE_TYPE_DHT_PUT_RESULT
125 struct GNUNET_MessageHeader header;
128 * The type for the data for the GET request
133 * The key to search for
138 * Was the put successful? GNUNET_YES or GNUNET_NO