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_NEXT 439
43 #define GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_STOP 439
44 #define GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_RESPONSE 439
46 GNUNET_NETWORK_STRUCT_BEGIN
48 * Connect to namestore service
54 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_START
56 struct GNUNET_MessageHeader header;
59 GNUNET_NETWORK_STRUCT_END
62 GNUNET_NETWORK_STRUCT_BEGIN
64 * Generic namestore message with op id
69 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_*
71 struct GNUNET_MessageHeader header;
78 GNUNET_NETWORK_STRUCT_END
82 * Connect to namestore service
84 GNUNET_NETWORK_STRUCT_BEGIN
85 struct LookupNameMessage
88 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_NAME
90 struct GNUNET_MessageHeader header;
100 /* Requested record type */
101 uint32_t record_type;
103 /* Requested record type */
106 GNUNET_NETWORK_STRUCT_END
112 * [struct LookupNameResponseMessage][struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded][char *name][rc_count * struct GNUNET_NAMESTORE_RecordData][struct GNUNET_CRYPTO_RsaSignature]
114 GNUNET_NETWORK_STRUCT_BEGIN
115 struct LookupNameResponseMessage
118 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_NAME_RESPONSE
120 struct GNUNET_MessageHeader header;
123 * Operation ID in NBO
127 struct GNUNET_TIME_AbsoluteNBO expire;
131 uint16_t contains_sig;
133 /* Requested record type */
136 GNUNET_NETWORK_STRUCT_END
140 * Put a record to the namestore
142 * [struct RecordPutMessage][struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded][char *name][rc_count * struct GNUNET_NAMESTORE_RecordData]
144 GNUNET_NETWORK_STRUCT_BEGIN
145 struct RecordPutMessage
148 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_RECORD_PUT
150 struct GNUNET_MessageHeader header;
153 * Operation ID in NBO
157 /* Contenct starts here */
162 /* Requested record type */
165 struct GNUNET_TIME_AbsoluteNBO expire;
167 struct GNUNET_CRYPTO_RsaSignature signature;
169 GNUNET_NETWORK_STRUCT_END
172 * Put a record to the namestore response
174 GNUNET_NETWORK_STRUCT_BEGIN
175 struct RecordPutResponseMessage
178 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_PUT_RESPONSE
180 struct GNUNET_MessageHeader header;
183 * Operation ID in NBO
187 /* Contenct starts here */
190 * name length: GNUNET_NO (0) on error, GNUNET_OK (1) on success
194 GNUNET_NETWORK_STRUCT_END
198 * Put a record to the namestore
200 * [struct RecordPutMessage][struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded][char *name][rc_count * struct GNUNET_NAMESTORE_RecordData]
202 GNUNET_NETWORK_STRUCT_BEGIN
203 struct RecordCreateMessage
206 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_CREATE
208 struct GNUNET_MessageHeader header;
211 * Operation ID in NBO
215 /* Contenct starts here */
220 struct GNUNET_CRYPTO_RsaSignature signature;
222 GNUNET_NETWORK_STRUCT_END
226 * Create a record to the namestore response
229 GNUNET_NETWORK_STRUCT_BEGIN
230 struct RecordCreateResponseMessage
233 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_CREATE_RESPONSE
235 struct GNUNET_MessageHeader header;
238 * Operation ID in NBO
242 /* Contenct starts here */
245 * name length: GNUNET_NO (0) on error, GNUNET_OK (1) on success
249 GNUNET_NETWORK_STRUCT_END
252 * Remove a record from the namestore
254 * [struct RecordRemoveMessage][char *name][struct GNUNET_NAMESTORE_RecordData]
256 GNUNET_NETWORK_STRUCT_BEGIN
257 struct RecordRemoveMessage
260 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_REMOVE
262 struct GNUNET_MessageHeader header;
265 * Operation ID in NBO
269 /* Contenct starts here */
274 struct GNUNET_CRYPTO_RsaSignature signature;
276 GNUNET_NETWORK_STRUCT_END
280 * Remove a record from the namestore response
282 GNUNET_NETWORK_STRUCT_BEGIN
283 struct RecordRemoveResponseMessage
286 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_REMOVE_RESPONSE
288 struct GNUNET_MessageHeader header;
291 * Operation ID in NBO
295 /* Contenct starts here */
298 * name length: GNUNET_NO (0) on error, GNUNET_OK (1) on success
302 GNUNET_NETWORK_STRUCT_END
306 * Start a zone iteration for the given zone
308 GNUNET_NETWORK_STRUCT_BEGIN
309 struct ZoneIterationStartMessage
312 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_START
314 struct GNUNET_MessageHeader header;
317 * Operation ID in NBO
321 /* Contenct starts here */
323 uint16_t must_have_flags;
324 uint16_t must_not_have_flags;
326 GNUNET_HashCode zone;
328 GNUNET_NETWORK_STRUCT_END
331 * Ask for next result of zone iteration for the given operation
333 GNUNET_NETWORK_STRUCT_BEGIN
334 struct ZoneIterationNextMessage
337 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_NEXT
339 struct GNUNET_MessageHeader header;
342 * Operation ID in NBO
346 GNUNET_NETWORK_STRUCT_END
350 * Stop zone iteration for the given operation
352 GNUNET_NETWORK_STRUCT_BEGIN
353 struct ZoneIterationStopMessage
356 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_STOP
358 struct GNUNET_MessageHeader header;
361 * Operation ID in NBO
365 GNUNET_NETWORK_STRUCT_END
368 * Ask for next result of zone iteration for the given operation
370 GNUNET_NETWORK_STRUCT_BEGIN
371 struct ZoneIterationResponseMessage
374 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_RESPONSE
376 struct GNUNET_MessageHeader header;
379 * Operation ID in NBO
383 GNUNET_NETWORK_STRUCT_END
386 /* end of namestore.h */