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_NO
32 typedef void (*GNUNET_DHT_MessageReceivedHandler) (void *cls,
33 const struct GNUNET_MessageHeader
39 struct GNUNET_DHT_StopMessage
42 * Type: GNUNET_MESSAGE_TYPE_DHT_MESSAGE
44 struct GNUNET_MessageHeader header;
49 uint32_t reserved GNUNET_PACKED;
52 * Unique ID identifying this request
54 uint64_t unique_id GNUNET_PACKED;
60 * Generic DHT message, wrapper for other message types
62 struct GNUNET_DHT_Message
65 * Type: GNUNET_MESSAGE_TYPE_DHT_MESSAGE
67 struct GNUNET_MessageHeader header;
72 uint32_t options GNUNET_PACKED;
75 * The key to search for
80 * Unique ID identifying this request
82 uint64_t unique_id GNUNET_PACKED;
85 * Replication level for this message
87 uint32_t desired_replication_level GNUNET_PACKED;
90 * Is this message uniquely identified? If so it will
91 * be fire and forget, if not we will wait for a receipt
94 uint32_t unique GNUNET_PACKED;
96 /* GNUNET_MessageHeader *enc actual DHT message, copied to end of this dealy do */
101 * Message to insert data into the DHT
103 struct GNUNET_DHT_PutMessage
106 * Type: GNUNET_MESSAGE_TYPE_DHT_PUT
108 struct GNUNET_MessageHeader header;
111 * The type of data to insert.
113 size_t type GNUNET_PACKED;
116 * How long should this data persist?
118 struct GNUNET_TIME_AbsoluteNBO expiration;
121 * The size of the data, appended to the end of this message.
123 size_t data_size GNUNET_PACKED;
129 * Message to request data from the DHT
131 struct GNUNET_DHT_GetMessage
134 * Type: GNUNET_MESSAGE_TYPE_DHT_GET
136 struct GNUNET_MessageHeader header;
139 * The type for the data for the GET request
146 * Message to return data from the DHT
148 struct GNUNET_DHT_GetResultMessage
151 * Type: GNUNET_MESSAGE_TYPE_DHT_GET_RESULT
153 struct GNUNET_MessageHeader header;
156 * The type for the data for the GET request
161 * The key to search for
166 * When does this entry expire?
168 struct GNUNET_TIME_Absolute expiration;