2 This file is part of GNUnet.
3 (C) 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 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 * @file namestore/namestore.h
23 * @brief common internal definitions for namestore service
24 * @author Matthias Wachs
30 * Collect message types here, move to protocols later
32 #define GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_NAME 431
33 #define GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_NAME_RESPONSE 432
34 #define GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_PUT 433
35 #define GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_PUT_RESPONSE 434
36 #define GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_CREATE 435
37 #define GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_CREATE_RESPONSE 436
38 #define GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_REMOVE 437
39 #define GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_REMOVE_RESPONSE 438
41 #define GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_START 439
42 #define GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_RESPONSE 440
43 #define GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_NEXT 441
44 #define GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_STOP 442
47 GNUNET_NETWORK_STRUCT_BEGIN
49 * Connect to namestore service
55 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_START
57 struct GNUNET_MessageHeader header;
60 GNUNET_NETWORK_STRUCT_END
63 GNUNET_NETWORK_STRUCT_BEGIN
65 * Generic namestore message with op id
70 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_*
72 struct GNUNET_MessageHeader header;
79 GNUNET_NETWORK_STRUCT_END
83 * Connect to namestore service
85 GNUNET_NETWORK_STRUCT_BEGIN
86 struct LookupNameMessage
89 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_NAME
91 struct GNUNET_MessageHeader header;
101 /* Requested record type */
102 uint32_t record_type;
104 /* Requested record type */
107 GNUNET_NETWORK_STRUCT_END
113 * [struct LookupNameResponseMessage][struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded][char *name][rc_count * struct GNUNET_NAMESTORE_RecordData][struct GNUNET_CRYPTO_RsaSignature]
115 GNUNET_NETWORK_STRUCT_BEGIN
116 struct LookupNameResponseMessage
119 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_NAME_RESPONSE
121 struct GNUNET_MessageHeader header;
124 * Operation ID in NBO
128 struct GNUNET_TIME_AbsoluteNBO expire;
132 uint16_t contains_sig;
134 /* Requested record type */
137 GNUNET_NETWORK_STRUCT_END
141 * Put a record to the namestore
143 * [struct RecordPutMessage][struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded][char *name][rc_count * struct GNUNET_NAMESTORE_RecordData]
145 GNUNET_NETWORK_STRUCT_BEGIN
146 struct RecordPutMessage
149 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_RECORD_PUT
151 struct GNUNET_MessageHeader header;
154 * Operation ID in NBO
158 /* Contenct starts here */
163 /* Requested record type */
166 struct GNUNET_TIME_AbsoluteNBO expire;
168 struct GNUNET_CRYPTO_RsaSignature signature;
170 GNUNET_NETWORK_STRUCT_END
173 * Put a record to the namestore response
175 GNUNET_NETWORK_STRUCT_BEGIN
176 struct RecordPutResponseMessage
179 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_PUT_RESPONSE
181 struct GNUNET_MessageHeader header;
184 * Operation ID in NBO
188 /* Contenct starts here */
191 * name length: GNUNET_NO (0) on error, GNUNET_OK (1) on success
195 GNUNET_NETWORK_STRUCT_END
199 * Put a record to the namestore
201 * [struct RecordPutMessage][struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded][char *name][rc_count * struct GNUNET_NAMESTORE_RecordData]
203 GNUNET_NETWORK_STRUCT_BEGIN
204 struct RecordCreateMessage
207 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_CREATE
209 struct GNUNET_MessageHeader header;
212 * Operation ID in NBO
216 /* Contenct starts here */
221 struct GNUNET_CRYPTO_RsaSignature signature;
223 GNUNET_NETWORK_STRUCT_END
227 * Create a record to the namestore response
230 GNUNET_NETWORK_STRUCT_BEGIN
231 struct RecordCreateResponseMessage
234 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_CREATE_RESPONSE
236 struct GNUNET_MessageHeader header;
239 * Operation ID in NBO
243 /* Contenct starts here */
246 * name length: GNUNET_NO (0) on error, GNUNET_OK (1) on success
250 GNUNET_NETWORK_STRUCT_END
253 * Remove a record from the namestore
255 * [struct RecordRemoveMessage][char *name][struct GNUNET_NAMESTORE_RecordData]
257 GNUNET_NETWORK_STRUCT_BEGIN
258 struct RecordRemoveMessage
261 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_REMOVE
263 struct GNUNET_MessageHeader header;
266 * Operation ID in NBO
270 /* Contenct starts here */
275 struct GNUNET_CRYPTO_RsaSignature signature;
277 GNUNET_NETWORK_STRUCT_END
281 * Remove a record from the namestore response
283 GNUNET_NETWORK_STRUCT_BEGIN
284 struct RecordRemoveResponseMessage
287 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_REMOVE_RESPONSE
289 struct GNUNET_MessageHeader header;
292 * Operation ID in NBO
296 /* Contenct starts here */
299 * name length: GNUNET_NO (0) on error, GNUNET_OK (1) on success
303 GNUNET_NETWORK_STRUCT_END
307 * Start a zone iteration for the given zone
309 GNUNET_NETWORK_STRUCT_BEGIN
310 struct ZoneIterationStartMessage
313 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_START
315 struct GNUNET_MessageHeader header;
318 * Operation ID in NBO
322 /* Contenct starts here */
324 uint16_t must_have_flags;
325 uint16_t must_not_have_flags;
327 GNUNET_HashCode zone;
329 GNUNET_NETWORK_STRUCT_END
332 * Ask for next result of zone iteration for the given operation
334 GNUNET_NETWORK_STRUCT_BEGIN
335 struct ZoneIterationNextMessage
338 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_NEXT
340 struct GNUNET_MessageHeader header;
343 * Operation ID in NBO
347 GNUNET_NETWORK_STRUCT_END
351 * Stop zone iteration for the given operation
353 GNUNET_NETWORK_STRUCT_BEGIN
354 struct ZoneIterationStopMessage
357 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_STOP
359 struct GNUNET_MessageHeader header;
362 * Operation ID in NBO
366 GNUNET_NETWORK_STRUCT_END
369 * Ask for next result of zone iteration for the given operation
371 GNUNET_NETWORK_STRUCT_BEGIN
372 struct ZoneIterationResponseMessage
375 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_RESPONSE
377 struct GNUNET_MessageHeader header;
380 * Operation ID in NBO
384 GNUNET_NETWORK_STRUCT_END
387 /* end of namestore.h */