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