77da67312901f7e91f5fdd2073282a917785fd71
[oweals/gnunet.git] / src / include / gnunet_namestore_service.h
1 /*
2      This file is part of GNUnet
3      (C) 2012, 2013 Christian Grothoff (and other contributing authors)
4
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.
9
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.
14
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.
19 */
20
21 /**
22  * @file include/gnunet_namestore_service.h
23  * @brief API that can be used to store naming information on a GNUnet node;
24  * @author Christian Grothoff
25  *
26  * Other functions we might want:
27  * - enumerate all known zones
28  */
29
30 #ifndef GNUNET_NAMESTORE_SERVICE_H
31 #define GNUNET_NAMESTORE_SERVICE_H
32
33 #include "gnunet_util_lib.h"
34 #include "gnunet_block_lib.h"
35
36 #ifdef __cplusplus
37 extern "C"
38 {
39 #if 0                           /* keep Emacsens' auto-indent happy */
40 }
41 #endif
42 #endif
43
44 /**
45  * Record type indicating any record/'*'
46  */
47 #define GNUNET_NAMESTORE_TYPE_ANY 0
48
49 /**
50  * Record type for GNS zone transfer ("PKEY").
51  */
52 #define GNUNET_NAMESTORE_TYPE_PKEY 65536
53
54 /**
55  * Record type for GNS zone transfer ("PSEU").
56  */
57 #define GNUNET_NAMESTORE_TYPE_PSEU 65537
58
59 /**
60  * Record type for GNS legacy hostnames ("LEHO").
61  */
62 #define GNUNET_NAMESTORE_TYPE_LEHO 65538
63
64 /**
65  * Record type for VPN resolution
66  */
67 #define GNUNET_NAMESTORE_TYPE_VPN 65539
68
69 /**
70  * Record type for zone revocation
71  */
72 #define GNUNET_NAMESTORE_TYPE_REV 65540
73
74 /**
75  * Record type for a social place.
76  */
77 #define GNUNET_NAMESTORE_TYPE_PLACE 65541
78
79 /**
80  * Entry in the queue.
81  */
82 struct GNUNET_NAMESTORE_QueueEntry;
83
84 /**
85  * Handle to the namestore service.
86  */
87 struct GNUNET_NAMESTORE_Handle;
88
89 /**
90  * Handle to the namestore zone iterator.
91  */
92 struct GNUNET_NAMESTORE_ZoneIterator;
93
94 /**
95  * Maximum size of a value that can be stored in the namestore.
96  */
97 #define GNUNET_NAMESTORE_MAX_VALUE_SIZE (63 * 1024)
98
99
100
101 /**
102  * Connect to the namestore service.
103  *
104  * @param cfg configuration to use
105  * @return handle to use to access the service
106  */
107 struct GNUNET_NAMESTORE_Handle *
108 GNUNET_NAMESTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
109
110
111 /**
112  * Disconnect from the namestore service (and free associated
113  * resources).
114  *
115  * @param h handle to the namestore
116  */
117 void
118 GNUNET_NAMESTORE_disconnect (struct GNUNET_NAMESTORE_Handle *h);
119
120
121 /**
122  * Continuation called to notify client about result of the
123  * operation.
124  *
125  * @param cls closure
126  * @param success GNUNET_SYSERR on failure (including timeout/queue drop/failure to validate)
127  *                GNUNET_NO if content was already there or not found
128  *                GNUNET_YES (or other positive value) on success
129  * @param emsg NULL on success, otherwise an error message
130  */
131 typedef void (*GNUNET_NAMESTORE_ContinuationWithStatus) (void *cls,
132                                                          int32_t success,
133                                                          const char *emsg);
134
135
136 /**
137  * Flags that can be set for a record.
138  */
139 enum GNUNET_NAMESTORE_RecordFlags
140 {
141   
142   /**
143    * No special options.
144    */
145   GNUNET_NAMESTORE_RF_NONE = 0,
146
147   /**
148    * This peer is the authority for this record; it must thus
149    * not be deleted (other records can be deleted if we run
150    * out of space).
151    */
152   GNUNET_NAMESTORE_RF_AUTHORITY = 1,
153
154   /**
155    * This is a private record of this peer and it should
156    * thus not be handed out to other peers.
157    */
158   GNUNET_NAMESTORE_RF_PRIVATE = 2,
159
160   /**
161    * This record was added by the system
162    * and is pending user confimation
163    */
164   GNUNET_NAMESTORE_RF_PENDING = 4,
165
166   /**
167    * This expiration time of the record is a relative
168    * time (not an absolute time).
169    */
170   GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION = 8,
171
172   /**
173    * This record should not be used unless all (other) records with an absolute
174    * expiration time have expired.
175    */
176   GNUNET_NAMESTORE_RF_SHADOW_RECORD = 16
177
178   /**
179    * When comparing flags for record equality for removal,
180    * which flags should must match (in addition to the type,
181    * name, expiration value and data of the record)?  All flags
182    * that are not listed here will be ignored for this purpose.
183    * (for example, we don't expect that users will remember to
184    * pass the '--private' option when removing a record from
185    * the namestore, hence we don't require this particular option
186    * to match upon removal).  See also
187    * 'GNUNET_NAMESTORE_records_cmp'.
188    */
189 #define GNUNET_NAMESTORE_RF_RCMP_FLAGS (GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION)
190 };
191
192
193 /**
194  * A GNS record.
195  */
196 struct GNUNET_NAMESTORE_RecordData
197 {
198
199   /**
200    * Binary value stored in the DNS record.
201    * FIXME: goofy API: sometimes 'data' is individually
202    * 'malloc'ed, sometimes it points into some existing
203    * data area (so sometimes this should be a 'void *',
204    * sometimes a 'const void *').  This is unclean.
205    */
206   const void *data;
207
208   /**
209    * Expiration time for the DNS record.  Can be relative
210    * or absolute, depending on 'flags'.
211    */
212   uint64_t expiration_time;
213
214   /**
215    * Number of bytes in 'data'.
216    */
217   size_t data_size;
218
219   /**
220    * Type of the GNS/DNS record.
221    */
222   uint32_t record_type;
223
224   /**
225    * Flags for the record.
226    */
227   enum GNUNET_NAMESTORE_RecordFlags flags;
228 };
229
230
231 /**
232  * Store an item in the namestore.  If the item is already present,
233  * it is replaced with the new record.  Use an empty array to
234  * remove all records under the given name.
235  *
236  * @param h handle to the namestore
237  * @param zone_key public key of the zone
238  * @param name name that is being mapped (at most 255 characters long)
239  * @param freshness when does the corresponding block in the DHT expire (until
240  *               when should we never do a DHT lookup for the same name again)?
241  * @param rd_count number of entries in 'rd' array
242  * @param rd array of records with data to store
243  * @param signature signature for all the records in the zone under the given name
244  * @param cont continuation to call when done
245  * @param cont_cls closure for cont
246  * @return handle to abort the request
247  */
248 struct GNUNET_NAMESTORE_QueueEntry *
249 GNUNET_NAMESTORE_record_put (struct GNUNET_NAMESTORE_Handle *h,
250                              const struct GNUNET_CRYPTO_EccPublicKey *zone_key,
251                              const char *name,
252                              struct GNUNET_TIME_Absolute freshness,
253                              unsigned int rd_count,
254                              const struct GNUNET_NAMESTORE_RecordData *rd,
255                              const struct GNUNET_CRYPTO_EccSignature *signature,
256                              GNUNET_NAMESTORE_ContinuationWithStatus cont,
257                              void *cont_cls);
258
259
260 /**
261  * Check if a signature is valid.  This API is used by the GNS Block
262  * to validate signatures received from the network.
263  *
264  * @param public_key public key of the zone
265  * @param freshness time set for block expiration
266  * @param name name that is being mapped (at most 255 characters long)
267  * @param rd_count number of entries in 'rd' array
268  * @param rd array of records with data to store
269  * @param signature signature for all the records in the zone under the given name
270  * @return GNUNET_OK if the signature is valid
271  */
272 int
273 GNUNET_NAMESTORE_verify_signature (const struct GNUNET_CRYPTO_EccPublicKey *public_key,
274                                    const struct GNUNET_TIME_Absolute freshness,
275                                    const char *name,
276                                    unsigned int rd_count,
277                                    const struct GNUNET_NAMESTORE_RecordData *rd,
278                                    const struct GNUNET_CRYPTO_EccSignature *signature);
279
280
281 /**
282  * Store an item in the namestore.  If the item is already present,
283  * it is replaced with the new record.  Use an empty array to
284  * remove all records under the given name.
285  *
286  * @param h handle to the namestore
287  * @param pkey private key of the zone
288  * @param name name that is being mapped (at most 255 characters long)
289  * @param rd_count number of records in the 'rd' array
290  * @param rd array of records with data to store
291  * @param cont continuation to call when done
292  * @param cont_cls closure for 'cont'
293  * @return handle to abort the request
294  */
295 struct GNUNET_NAMESTORE_QueueEntry *
296 GNUNET_NAMESTORE_record_put_by_authority (struct GNUNET_NAMESTORE_Handle *h,
297                                           const struct GNUNET_CRYPTO_EccPrivateKey *pkey,
298                                           const char *name,
299                                           unsigned int rd_count,
300                                           const struct GNUNET_NAMESTORE_RecordData *rd,
301                                           GNUNET_NAMESTORE_ContinuationWithStatus cont,
302                                           void *cont_cls);
303
304
305 /**
306  * Process a record that was stored in the namestore.
307  *
308  * @param cls closure
309  * @param zone_key public key of the zone
310  * @param freshness when does the corresponding block in the DHT expire (until
311  *               when should we never do a DHT lookup for the same name again)?; 
312  *               GNUNET_TIME_UNIT_ZERO_ABS if there are no records of any type in the namestore,
313  *               or the expiration time of the block in the namestore (even if there are zero
314  *               records matching the desired record type)
315  * @param name name that is being mapped (at most 255 characters long)
316  * @param rd_count number of entries in 'rd' array
317  * @param rd array of records with data to store
318  * @param signature signature of the record block, NULL if signature is unavailable (i.e. 
319  *        because the user queried for a particular record type only)
320  */
321 typedef void (*GNUNET_NAMESTORE_RecordProcessor) (void *cls,
322                                                   const struct GNUNET_CRYPTO_EccPublicKey *zone_key,
323                                                   struct GNUNET_TIME_Absolute freshness,                            
324                                                   const char *name,
325                                                   unsigned int rd_count,
326                                                   const struct GNUNET_NAMESTORE_RecordData *rd,
327                                                   const struct GNUNET_CRYPTO_EccSignature *signature);
328
329
330 /**
331  * Get a result for a particular key from the namestore.  The processor
332  * will only be called once.  When using this functions, relative expiration
333  * times will be converted to absolute expiration times and a signature
334  * will be created if we are the authority.  The record data and signature
335  * passed to 'proc' is thus always suitable for passing on to other peers
336  * (if we are the authority).  If the record type is NOT set to 'ANY' and
337  * if we are NOT the authority, then non-matching records may be omitted
338  * from the result and no valid signature can be created; in this case,
339  * 'signature' will be NULL and the result cannot be given to other peers.
340  *
341  * @param h handle to the namestore
342  * @param zone zone to look up a record from
343  * @param name name to look up
344  * @param record_type desired record type, 0 for all
345  * @param proc function to call on the matching records, or with
346  *        NULL (rd_count == 0) if there are no matching records
347  * @param proc_cls closure for proc
348  * @return a handle that can be used to
349  *         cancel
350  */
351 struct GNUNET_NAMESTORE_QueueEntry *
352 GNUNET_NAMESTORE_lookup_record (struct GNUNET_NAMESTORE_Handle *h, 
353                                 const struct GNUNET_CRYPTO_ShortHashCode *zone,
354                                 const char *name,
355                                 uint32_t record_type,
356                                 GNUNET_NAMESTORE_RecordProcessor proc, void *proc_cls);
357
358
359 /**
360  * Look for an existing PKEY delegation record for a given public key.
361  * Returns at most one result to the processor.
362  *
363  * @param h handle to the namestore
364  * @param zone hash of public key of the zone to look up in, never NULL
365  * @param value_zone hash of the public key of the target zone (value), never NULL
366  * @param proc function to call on the matching records, or with
367  *        NULL (rd_count == 0) if there are no matching records
368  * @param proc_cls closure for proc
369  * @return a handle that can be used to
370  *         cancel
371  */
372 struct GNUNET_NAMESTORE_QueueEntry *
373 GNUNET_NAMESTORE_zone_to_name (struct GNUNET_NAMESTORE_Handle *h, 
374                                const struct GNUNET_CRYPTO_ShortHashCode *zone,
375                                const struct GNUNET_CRYPTO_ShortHashCode *value_zone,
376                                GNUNET_NAMESTORE_RecordProcessor proc, void *proc_cls);
377
378
379 /**
380  * Cancel a namestore operation.  The final callback from the
381  * operation must not have been done yet.  Must be called on any
382  * namestore operation that has not yet completed prior to calling
383  * 'GNUNET_NAMESTORE_disconnect'.
384  *
385  * @param qe operation to cancel
386  */
387 void
388 GNUNET_NAMESTORE_cancel (struct GNUNET_NAMESTORE_QueueEntry *qe);
389
390
391 /**
392  * Starts a new zone iteration (used to periodically PUT all of our
393  * records into our DHT). "proc" will be called once immediately, and
394  * then again after "GNUNET_NAMESTORE_zone_iterator_next" is invoked.
395  *
396  * By specifying a 'zone' of NULL and setting 'GNUNET_NAMESTORE_RF_AUTHORITY'
397  * in 'must_have_flags', we can iterate over all records for which we are
398  * the authority (the 'authority' flag will NOT be set in the returned
399  * records anyway).  
400  *
401  * The 'GNUNET_NAMESTORE_RF_RELATIVE_EXPIRATION'
402  * bit in 'must_have_flags' has a special meaning:
403  *
404  * 0) If the bit is clear, all relative expriation times are converted to
405  *    absolute expiration times.  This is useful for performing DHT PUT
406  *    operations (and zone transfers) of our zone.  The generated signatures
407  *    will be valid for other peers.
408  * 1) if it is set, it means that relative expiration times should be
409  *    preserved when returned (this is useful for the zone editor user 
410  *    interface).  No signatures will be created in this case, as 
411  *    signatures must not cover records with relative expiration times.
412  *
413  * Note that not all queries against this interface are equally performant
414  * as for some combinations no efficient index may exist.
415  *
416  * @param h handle to the namestore
417  * @param zone zone to access, NULL for all zones
418  * @param must_have_flags flags that must be set for the record to be returned
419  * @param must_not_have_flags flags that must NOT be set for the record to be returned
420  * @param proc function to call on each name from the zone; it
421  *        will be called repeatedly with a value (if available)
422  *        and always once at the end with a name of NULL.
423  * @param proc_cls closure for proc
424  * @return an iterator handle to use for iteration
425  */
426 struct GNUNET_NAMESTORE_ZoneIterator *
427 GNUNET_NAMESTORE_zone_iteration_start (struct GNUNET_NAMESTORE_Handle *h,
428                                        const struct GNUNET_CRYPTO_ShortHashCode *zone,
429                                        enum GNUNET_NAMESTORE_RecordFlags must_have_flags,
430                                        enum GNUNET_NAMESTORE_RecordFlags must_not_have_flags,
431                                        GNUNET_NAMESTORE_RecordProcessor proc,
432                                        void *proc_cls);
433
434
435 /**
436  * Calls the record processor specified in GNUNET_NAMESTORE_zone_iteration_start
437  * for the next record.
438  *
439  * @param it the iterator
440  */
441 void
442 GNUNET_NAMESTORE_zone_iterator_next (struct GNUNET_NAMESTORE_ZoneIterator *it);
443
444
445 /**
446  * Stops iteration and releases the namestore handle for further calls.  Must
447  * be called on any iteration that has not yet completed prior to calling
448  * 'GNUNET_NAMESTORE_disconnect'.
449  *
450  * @param it the iterator
451  */
452 void
453 GNUNET_NAMESTORE_zone_iteration_stop (struct GNUNET_NAMESTORE_ZoneIterator *it);
454
455
456 /**
457  * Handle for a monitoring activity.
458  */
459 struct GNUNET_NAMESTORE_ZoneMonitor;
460
461
462 /**
463  * Function called whenever the records for a given name changed.
464  *
465  * @param cls closure
466  * @param zone_key NULL if the communication with the namestore broke down
467  *                    (and thus all entries should be 'cleared' until the communication
468  *                     can be re-established, at which point the monitor will 
469  *                     re-add all records that are (still) in the namestore after
470  *                     the reconnect); if this value is NULL, all other arguments
471  *                     will also be 0/NULL.
472  * @param freshness when does the corresponding block in the DHT expire (until
473  *               when should we never do a DHT lookup for the same name again)?; 
474  *               GNUNET_TIME_UNIT_ZERO_ABS if there are no records of any type in the namestore,
475  *               or the expiration time of the block in the namestore (even if there are zero
476  *               records matching the desired record type)
477  * @param name name that is being mapped (at most 255 characters long)
478  * @param rd_count number of entries in 'rd' array
479  * @param rd array of records with data to store
480  * @param signature signature of the record block
481  */
482 typedef void (*GNUNET_NAMESTORE_RecordMonitor)(void *cls,
483                                                const struct GNUNET_CRYPTO_EccPublicKey *zone_key,
484                                                struct GNUNET_TIME_Absolute freshness,                       
485                                                const char *name,
486                                                unsigned int rd_len,
487                                                const struct GNUNET_NAMESTORE_RecordData *rd,
488                                                const struct GNUNET_CRYPTO_EccSignature *signature);
489
490
491 /**
492  * Function called once the monitor has caught up with the current 
493  * state of the database.  Will be called AGAIN after each disconnect
494  * (record monitor called with 'NULL' for zone_key) once we're again
495  * in sync.
496  *
497  * @param cls closure
498  */
499 typedef void (*GNUNET_NAMESTORE_RecordsSynchronizedCallback)(void *cls);
500
501
502 /**
503  * Begin monitoring a zone for changes.  Will first call the 'monitor' function
504  * on all existing records in the selected zone(s), then calls 'sync_cb',
505  * and then calls the 'monitor' whenever a record changes.  If the namestore
506  * disconnects, the 'monitor' function is called with a disconnect event; if
507  * the connection is re-established, the process begins from the start (all
508  * existing records, sync, then updates).
509  *
510  * Note that the 'signature' in the 'monitor' callback will always be
511  * NULL (as signatures are usually not valuable to monitoring clients,
512  * the service does not bother to generate a valid signature for
513  * monitoring).
514  *
515  * @param cfg configuration to use to connect to namestore
516  * @param zone zone to monitor, NULL for all zones
517  * @param monitor function to call on zone changes
518  * @param sync_cb function called when we're in sync with the namestore
519  * @param cls closure for 'monitor' and 'sync_cb'
520  * @return handle to stop monitoring
521  */
522 struct GNUNET_NAMESTORE_ZoneMonitor *
523 GNUNET_NAMESTORE_zone_monitor_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
524                                      const struct GNUNET_CRYPTO_ShortHashCode *zone,
525                                      GNUNET_NAMESTORE_RecordMonitor monitor,
526                                      GNUNET_NAMESTORE_RecordsSynchronizedCallback sync_cb,
527                                      void *cls);
528
529
530 /**
531  * Stop monitoring a zone for changes.
532  *
533  * @param zm handle to the monitor activity to stop
534  */
535 void
536 GNUNET_NAMESTORE_zone_monitor_stop (struct GNUNET_NAMESTORE_ZoneMonitor *zm);
537
538
539 /* convenience APIs for serializing / deserializing GNS records */
540
541 /**
542  * Calculate how many bytes we will need to serialize the given
543  * records.
544  *
545  * @param rd_count number of records in the rd array
546  * @param rd array of GNUNET_NAMESTORE_RecordData with rd_count elements
547  *
548  * @return the required size to serialize
549  *
550  */
551 size_t
552 GNUNET_NAMESTORE_records_get_size (unsigned int rd_count,
553                                    const struct GNUNET_NAMESTORE_RecordData *rd);
554
555
556 /**
557  * Serialize the given records to the given destination buffer.
558  *
559  * @param rd_count number of records in the rd array
560  * @param rd array of GNUNET_NAMESTORE_RecordData with rd_count elements
561  * @param dest_size size of the destination array
562  * @param dest where to write the result
563  *
564  * @return the size of serialized records, -1 if records do not fit
565  */
566 ssize_t
567 GNUNET_NAMESTORE_records_serialize (unsigned int rd_count,
568                                     const struct GNUNET_NAMESTORE_RecordData *rd,
569                                     size_t dest_size,
570                                     char *dest);
571
572
573 /**
574  * Deserialize the given records to the given destination.
575  *
576  * @param len size of the serialized record data
577  * @param src the serialized record data
578  * @param rd_count number of records in the rd array
579  * @param dest where to put the data
580  *
581  * @return GNUNET_OK on success, GNUNET_SYSERR on error
582  */
583 int
584 GNUNET_NAMESTORE_records_deserialize (size_t len,
585                                       const char *src,
586                                       unsigned int rd_count,
587                                       struct GNUNET_NAMESTORE_RecordData *dest);
588
589
590 /**
591  * Convert the 'value' of a record to a string.
592  *
593  * @param type type of the record
594  * @param data value in binary encoding
595  * @param data_size number of bytes in data
596  * @return NULL on error, otherwise human-readable representation of the value
597  */
598 char *
599 GNUNET_NAMESTORE_value_to_string (uint32_t type,
600                                   const void *data,
601                                   size_t data_size);
602
603
604 /**
605  * Convert human-readable version of a 'value' of a record to the binary
606  * representation.
607  *
608  * @param type type of the record
609  * @param s human-readable string
610  * @param data set to value in binary encoding (will be allocated)
611  * @param data_size set to number of bytes in data
612  * @return GNUNET_OK on success
613  */
614 int
615 GNUNET_NAMESTORE_string_to_value (uint32_t type,
616                                   const char *s,
617                                   void **data,
618                                   size_t *data_size);
619
620
621 /**
622  * Convert a type name (i.e. "AAAA") to the corresponding number.
623  *
624  * @param typename name to convert
625  * @return corresponding number, UINT32_MAX on error
626  */
627 uint32_t
628 GNUNET_NAMESTORE_typename_to_number (const char *typename);
629
630
631 /**
632  * Convert a type number (i.e. 1) to the corresponding type string (i.e. "A")
633  *
634  * @param type number of a type to convert
635  * @return corresponding typestring, NULL on error
636  */
637 const char *
638 GNUNET_NAMESTORE_number_to_typename (uint32_t type);
639
640
641 /**
642  * Test if a given record is expired.
643  * 
644  * @param rd record to test
645  * @return GNUNET_YES if the record is expired,
646  *         GNUNET_NO if not
647  */
648 int
649 GNUNET_NAMESTORE_is_expired (const struct GNUNET_NAMESTORE_RecordData *rd);
650
651
652 /**
653  * Convert a UTF-8 string to UTF-8 lowercase
654  * @param src source string
655  * @return converted result
656  */
657 char *
658 GNUNET_NAMESTORE_normalize_string (const char *src);
659
660
661 /**
662  * Convert a short hash to a string (for printing debug messages).
663  * This is one of the very few calls in the entire API that is
664  * NOT reentrant!
665  *
666  * @param hc the short hash code
667  * @return string form; will be overwritten by next call to GNUNET_h2s.
668  */
669 const char *
670 GNUNET_NAMESTORE_short_h2s (const struct GNUNET_CRYPTO_ShortHashCode * hc);
671
672
673 /**
674  * Sign name and records
675  *
676  * @param key the private key
677  * @param expire block expiration
678  * @param name the name
679  * @param rd record data
680  * @param rd_count number of records
681  *
682  * @return the signature
683  */
684 struct GNUNET_CRYPTO_EccSignature *
685 GNUNET_NAMESTORE_create_signature (const struct GNUNET_CRYPTO_EccPrivateKey *key,
686                                    struct GNUNET_TIME_Absolute expire,
687                                    const char *name,
688                                    const struct GNUNET_NAMESTORE_RecordData *rd,
689                                    unsigned int rd_count);
690
691
692 /**
693  * Compares if two records are equal
694  *
695  * @param a Record a
696  * @param b Record b
697  *
698  * @return GNUNET_YES or GNUNET_NO
699  */
700 int
701 GNUNET_NAMESTORE_records_cmp (const struct GNUNET_NAMESTORE_RecordData *a,
702                               const struct GNUNET_NAMESTORE_RecordData *b);
703
704
705
706
707 #if 0                           /* keep Emacsens' auto-indent happy */
708 {
709 #endif
710 #ifdef __cplusplus
711 }
712 #endif
713
714 /* end of gnunet_namestore_service.h */
715 #endif