aboutsummaryrefslogtreecommitdiff
path: root/src/namestore/namestore.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/namestore/namestore.h')
-rw-r--r--src/namestore/namestore.h124
1 files changed, 106 insertions, 18 deletions
diff --git a/src/namestore/namestore.h b/src/namestore/namestore.h
index 583ec1e68..d7b6fd13e 100644
--- a/src/namestore/namestore.h
+++ b/src/namestore/namestore.h
@@ -51,23 +51,9 @@ struct GNUNET_NAMESTORE_Header
51 uint32_t r_id GNUNET_PACKED; 51 uint32_t r_id GNUNET_PACKED;
52}; 52};
53 53
54 54struct RecordSet
55/**
56 * Store a record to the namestore (as authority).
57 */
58struct RecordStoreMessage
59{ 55{
60 /** 56 /**
61 * Type will be #GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_STORE
62 */
63 struct GNUNET_NAMESTORE_Header gns_header;
64
65 /**
66 * Expiration time
67 */
68 struct GNUNET_TIME_AbsoluteNBO expire;
69
70 /**
71 * Name length 57 * Name length
72 */ 58 */
73 uint16_t name_len GNUNET_PACKED; 59 uint16_t name_len GNUNET_PACKED;
@@ -87,14 +73,35 @@ struct RecordStoreMessage
87 */ 73 */
88 uint16_t reserved GNUNET_PACKED; 74 uint16_t reserved GNUNET_PACKED;
89 75
76
77 /* followed by:
78 * name with length name_len
79 * serialized record data with rd_count records
80 */
81};
82
83/**
84 * Store a record to the namestore (as authority).
85 */
86struct RecordStoreMessage
87{
88 /**
89 * Type will be #GNUNET_MESSAGE_TYPE_NAMESTORE_RECORD_STORE
90 */
91 struct GNUNET_NAMESTORE_Header gns_header;
92
90 /** 93 /**
91 * The private key of the authority. 94 * The private key of the authority.
92 */ 95 */
93 struct GNUNET_IDENTITY_PrivateKey private_key; 96 struct GNUNET_IDENTITY_PrivateKey private_key;
94 97
95 /* followed by: 98 /**
96 * name with length name_len 99 * Number of record sets
97 * serialized record data with rd_count records 100 */
101 uint16_t rd_set_count;
102
103 /**
104 * Followed by rd_set_count RecordSets
98 */ 105 */
99}; 106};
100 107
@@ -146,6 +153,11 @@ struct LabelLookupMessage
146 uint32_t label_len GNUNET_PACKED; 153 uint32_t label_len GNUNET_PACKED;
147 154
148 /** 155 /**
156 * GNUNET_YES if this lookup corresponds to an edit request
157 */
158 uint32_t is_edit_request GNUNET_PACKED;
159
160 /**
149 * The private key of the zone to look up in 161 * The private key of the zone to look up in
150 */ 162 */
151 struct GNUNET_IDENTITY_PrivateKey zone; 163 struct GNUNET_IDENTITY_PrivateKey zone;
@@ -275,6 +287,12 @@ struct RecordResultMessage
275 struct GNUNET_NAMESTORE_Header gns_header; 287 struct GNUNET_NAMESTORE_Header gns_header;
276 288
277 /** 289 /**
290 * Expiration time if the record result (if any).
291 * Takes TOMBSTONEs into account.
292 */
293 struct GNUNET_TIME_AbsoluteNBO expire;
294
295 /**
278 * Name length 296 * Name length
279 */ 297 */
280 uint16_t name_len GNUNET_PACKED; 298 uint16_t name_len GNUNET_PACKED;
@@ -305,6 +323,54 @@ struct RecordResultMessage
305 */ 323 */
306}; 324};
307 325
326/**
327 * Send a transaction control message.
328 */
329struct TxControlMessage
330{
331 /**
332 * Type will be #GNUNET_MESSAGE_TYPE_NAMESTORE_TX_CONTROL
333 */
334 struct GNUNET_NAMESTORE_Header gns_header;
335
336 /**
337 * The type of control message to send
338 */
339 uint16_t control GNUNET_PACKED;
340
341 /**
342 * always zero (for alignment)
343 */
344 uint16_t reserved GNUNET_PACKED;
345
346};
347
348/**
349 * Result of a transaction control message.
350 */
351struct TxControlResultMessage
352{
353 /**
354 * Type will be #GNUNET_MESSAGE_TYPE_NAMESTORE_TX_CONTROL_RESULT
355 */
356 struct GNUNET_NAMESTORE_Header gns_header;
357
358 /**
359 * The type of control message to send
360 */
361 uint16_t control GNUNET_PACKED;
362
363 /**
364 * Of type GNUNET_GenericReturnValue
365 */
366 uint16_t success GNUNET_PACKED;
367
368 /* followed by:
369 * an error message if status != ntohs(GNUNET_OK)
370 */
371};
372
373
308 374
309/** 375/**
310 * Start monitoring a zone. 376 * Start monitoring a zone.
@@ -323,6 +389,17 @@ struct ZoneMonitorStartMessage
323 uint32_t iterate_first GNUNET_PACKED; 389 uint32_t iterate_first GNUNET_PACKED;
324 390
325 /** 391 /**
392 * Record set filter control flags.
393 * See GNUNET_NAMESTORE_Filter enum.
394 */
395 uint16_t filter;
396
397 /**
398 * Reserved for alignment
399 */
400 uint16_t reserved;
401
402 /**
326 * Zone key. 403 * Zone key.
327 */ 404 */
328 struct GNUNET_IDENTITY_PrivateKey zone; 405 struct GNUNET_IDENTITY_PrivateKey zone;
@@ -367,6 +444,17 @@ struct ZoneIterationStartMessage
367 * Zone key. All zeros for "all zones". 444 * Zone key. All zeros for "all zones".
368 */ 445 */
369 struct GNUNET_IDENTITY_PrivateKey zone; 446 struct GNUNET_IDENTITY_PrivateKey zone;
447
448 /**
449 * Record set filter control flags.
450 * See GNUNET_NAMESTORE_Filter enum.
451 */
452 uint16_t filter;
453
454 /**
455 * Reserved for alignment
456 */
457 uint16_t reserved;
370}; 458};
371 459
372 460