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 * A GNS record serialized for network transmission.
50 * layout is [struct GNUNET_NAMESTORE_NetworkRecord][char[data_size] data]
52 struct GNUNET_NAMESTORE_NetworkRecord
55 * Expiration time for the DNS record.
57 struct GNUNET_TIME_AbsoluteNBO expiration;
60 * Number of bytes in 'data'.
65 * Type of the GNS/DNS record.
70 * Flags for the record.
78 * Connect to namestore service. FIXME: UNNECESSARY.
84 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_START
86 struct GNUNET_MessageHeader header;
91 * Generic namestore message with op id
93 struct GNUNET_NAMESTORE_Header
96 * header.type will be GNUNET_MESSAGE_TYPE_NAMESTORE_*
97 * header.size will be message size
99 struct GNUNET_MessageHeader header;
109 * Connect to namestore service
111 struct LookupNameMessage
113 struct GNUNET_NAMESTORE_Header gns_header;
116 GNUNET_HashCode zone;
118 /* Requested record type */
119 uint32_t record_type;
121 /* Requested record type */
129 * [struct LookupNameResponseMessage][struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded][char *name][rc_count * struct GNUNET_NAMESTORE_RecordData][struct GNUNET_CRYPTO_RsaSignature]
131 struct LookupNameResponseMessage
134 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_NAME_RESPONSE
136 struct GNUNET_NAMESTORE_Header gns_header;
138 struct GNUNET_TIME_AbsoluteNBO expire;
146 int32_t contains_sig;
148 /* Requested record type */
153 * Put a record to the namestore
155 * [struct RecordPutMessage][struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded][char *name][rc_count * struct GNUNET_NAMESTORE_RecordData]
157 struct RecordPutMessage
160 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_LOOKUP_RECORD_PUT
162 struct GNUNET_NAMESTORE_Header gns_header;
164 /* Contenct starts here */
169 /* Length of serialized rd data */
174 /* Length of pubkey */
177 struct GNUNET_TIME_AbsoluteNBO expire;
179 struct GNUNET_CRYPTO_RsaSignature signature;
184 * Put a record to the namestore response
186 struct RecordPutResponseMessage
189 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_PUT_RESPONSE
191 struct GNUNET_MessageHeader header;
194 * Operation ID in NBO
198 /* Contenct starts here */
201 * name length: GNUNET_NO (0) on error, GNUNET_OK (1) on success
208 * Create a record and put it to the namestore
210 * [struct RecordCreateMessage][char *name][rc_count * struct GNUNET_NAMESTORE_RecordData]
212 struct RecordCreateMessage
215 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_CREATE
217 struct GNUNET_NAMESTORE_Header gns_header;
219 /* Contenct starts here */
224 /* Record data length */
230 /* private key length */
236 * Create a record to the namestore response
239 struct RecordCreateResponseMessage
242 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_CREATE_RESPONSE
244 struct GNUNET_NAMESTORE_Header gns_header;
246 /* Contenct starts here */
249 * name length: GNUNET_NO (0) on error, GNUNET_OK (1) on success
257 * Remove a record from the namestore
259 * [struct RecordRemoveMessage][char *name][struct GNUNET_NAMESTORE_RecordData]
261 struct RecordRemoveMessage
264 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_REMOVE
266 struct GNUNET_NAMESTORE_Header gns_header;
268 /* Contenct starts here */
273 struct GNUNET_CRYPTO_RsaSignature signature;
275 GNUNET_NETWORK_STRUCT_END
279 * Remove a record from the namestore response
281 GNUNET_NETWORK_STRUCT_BEGIN
282 struct RecordRemoveResponseMessage
285 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_REMOVE_RESPONSE
287 struct GNUNET_NAMESTORE_Header gns_header;
289 /* Contenct starts here */
292 * name length: GNUNET_NO (0) on error, GNUNET_OK (1) on success
296 GNUNET_NETWORK_STRUCT_END
300 * Start a zone iteration for the given zone
302 GNUNET_NETWORK_STRUCT_BEGIN
303 struct ZoneIterationStartMessage
306 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_START
308 struct GNUNET_NAMESTORE_Header gns_header;
310 /* Contenct starts here */
312 uint16_t must_have_flags;
313 uint16_t must_not_have_flags;
315 GNUNET_HashCode zone;
317 GNUNET_NETWORK_STRUCT_END
320 * Ask for next result of zone iteration for the given operation
322 GNUNET_NETWORK_STRUCT_BEGIN
323 struct ZoneIterationNextMessage
326 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_NEXT
328 struct GNUNET_NAMESTORE_Header gns_header;
330 GNUNET_NETWORK_STRUCT_END
334 * Stop zone iteration for the given operation
336 GNUNET_NETWORK_STRUCT_BEGIN
337 struct ZoneIterationStopMessage
340 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_STOP
342 struct GNUNET_NAMESTORE_Header gns_header;
344 GNUNET_NETWORK_STRUCT_END
347 * Ask for next result of zone iteration for the given operation
349 GNUNET_NETWORK_STRUCT_BEGIN
350 struct ZoneIterationResponseMessage
353 * Type will be GNUNET_MESSAGE_TYPE_NAMESTORE_ZONE_ITERATION_RESPONSE
355 struct GNUNET_NAMESTORE_Header gns_header;
357 struct GNUNET_TIME_AbsoluteNBO expire;
361 uint16_t contains_sig;
363 /* Record data length */
367 GNUNET_NETWORK_STRUCT_END
370 /* end of namestore.h */