0aec6bb8ec6906ae724f12992d1155c7ba26e11e
[oweals/gnunet.git] / src / namestore / namestore_api.c
1 /*
2      This file is part of GNUnet.
3      (C) 2009, 2010 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 gns/namestore_api.c
23  * @brief API to access the NAMESTORE service
24  * @author Martin Schanzenbach
25  * @author Matthias Wachs
26  */
27
28 #include "platform.h"
29 #include "gnunet_util_lib.h"
30 #include "gnunet_constants.h"
31 #include "gnunet_arm_service.h"
32 #include "gnunet_namestore_service.h"
33 #include "namestore.h"
34 #define DEBUG_GNS_API GNUNET_EXTRA_LOGGING
35
36 #define LOG(kind,...) GNUNET_log_from (kind, "gns-api",__VA_ARGS__)
37
38 /**
39  * A QueueEntry.
40  */
41 struct GNUNET_NAMESTORE_QueueEntry
42 {
43   char *data; /*stub data pointer*/
44 };
45
46
47 /**
48  * Message in linked list we should send to the service.  The
49  * actual binary message follows this struct.
50  */
51 struct PendingMessage
52 {
53
54   /**
55    * Kept in a DLL.
56    */
57   struct PendingMessage *next;
58
59   /**
60    * Kept in a DLL.
61    */
62   struct PendingMessage *prev;
63
64   /**
65    * Size of the message.
66    */
67   size_t size;
68
69   /**
70    * Is this the 'START' message?
71    */
72   int is_init;
73 };
74
75
76 /**
77  * Connection to the NAMESTORE service.
78  */
79 struct GNUNET_NAMESTORE_Handle
80 {
81
82   /**
83    * Configuration to use.
84    */
85   const struct GNUNET_CONFIGURATION_Handle *cfg;
86
87   /**
88    * Socket (if available).
89    */
90   struct GNUNET_CLIENT_Connection *client;
91
92   /**
93    * Currently pending transmission request (or NULL).
94    */
95   struct GNUNET_CLIENT_TransmitHandle *th;
96
97   /**
98    * Reconnect task
99    */
100   GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
101
102   /**
103    * Pending messages to send to the service
104    */
105
106   struct PendingMessage * pending_head;
107   struct PendingMessage * pending_tail;
108
109   /**
110    * Should we reconnect to service due to some serious error?
111    */
112   int reconnect;
113 };
114
115 struct GNUNET_NAMESTORE_SimpleRecord
116 {
117   /**
118    * DLL
119    */
120   struct GNUNET_NAMESTORE_SimpleRecord *next;
121
122   /**
123    * DLL
124    */
125   struct GNUNET_NAMESTORE_SimpleRecord *prev;
126   
127   const char *name;
128   const GNUNET_HashCode *zone;
129   uint32_t record_type;
130   struct GNUNET_TIME_Absolute expiration;
131   enum GNUNET_NAMESTORE_RecordFlags flags;
132   size_t data_size;
133   const void *data;
134 };
135
136 /**
137  * Disconnect from service and then reconnect.
138  *
139  * @param nsh our handle
140  */
141 static void
142 force_reconnect (struct GNUNET_NAMESTORE_Handle *nsh);
143
144
145 /**
146  * Type of a function to call when we receive a message
147  * from the service.
148  *
149  * @param cls the 'struct GNUNET_NAMESTORE_SchedulingHandle'
150  * @param msg message received, NULL on timeout or fatal error
151  */
152 static void
153 process_namestore_message (void *cls, const struct GNUNET_MessageHeader *msg)
154 {
155   struct GNUNET_NAMESTORE_Handle *nsh = cls;
156   uint16_t size;
157   uint16_t type;
158
159   if (NULL == msg)
160   {
161     force_reconnect (nsh);
162     return;
163   }
164
165   size = ntohs (msg->size);
166   type = ntohs (msg->type);
167
168   switch (type) {
169     case GNUNET_MESSAGE_TYPE_TEST:
170       /* handle message here */
171       break;
172     default:
173       break;
174   }
175
176   GNUNET_CLIENT_receive (nsh->client, &process_namestore_message, nsh,
177                          GNUNET_TIME_UNIT_FOREVER_REL);
178
179   if (GNUNET_YES == nsh->reconnect)
180     force_reconnect (nsh);
181 }
182
183
184 /**
185  * Transmit messages from the message queue to the service
186  * (if there are any, and if we are not already trying).
187  *
188  * @param nsh handle to use
189  */
190 static void
191 do_transmit (struct GNUNET_NAMESTORE_Handle *nsh);
192
193
194 /**
195  * We can now transmit a message to NAMESTORE. Do it.
196  *
197  * @param cls the 'struct GNUNET_NAMESTORE_Handle'
198  * @param size number of bytes we can transmit
199  * @param buf where to copy the messages
200  * @return number of bytes copied into buf
201  */
202 static size_t
203 transmit_message_to_namestore (void *cls, size_t size, void *buf)
204 {
205   struct GNUNET_NAMESTORE_Handle *nsh = cls;
206   struct PendingMessage *p;
207   size_t ret;
208   char *cbuf;
209
210   nsh->th = NULL;
211   if ((size == 0) || (buf == NULL))
212   {
213     force_reconnect (nsh);
214     return 0;
215   }
216   ret = 0;
217   cbuf = buf;
218   while ((NULL != (p = nsh->pending_head)) && (p->size <= size))
219   {
220     memcpy (&cbuf[ret], &p[1], p->size);
221     ret += p->size;
222     size -= p->size;
223     GNUNET_CONTAINER_DLL_remove (nsh->pending_head, nsh->pending_tail, p);
224     if (GNUNET_YES == p->is_init)
225       GNUNET_CLIENT_receive (nsh->client, &process_namestore_message, nsh,
226                              GNUNET_TIME_UNIT_FOREVER_REL);
227     GNUNET_free (p);
228   }
229   do_transmit (nsh);
230   return ret;
231 }
232
233
234 /**
235  * Transmit messages from the message queue to the service
236  * (if there are any, and if we are not already trying).
237  *
238  * @param nsh handle to use
239  */
240 static void
241 do_transmit (struct GNUNET_NAMESTORE_Handle *nsh)
242 {
243   struct PendingMessage *p;
244
245   if (NULL != nsh->th)
246     return;
247   if (NULL == (p = nsh->pending_head))
248     return;
249   if (NULL == nsh->client)
250     return;                     /* currently reconnecting */
251   nsh->th = GNUNET_CLIENT_notify_transmit_ready (nsh->client, p->size,
252                                            GNUNET_TIME_UNIT_FOREVER_REL,
253                                            GNUNET_NO, &transmit_message_to_namestore,
254                                            nsh);
255 }
256
257
258 /**
259  * Try again to connect to namestore service.
260  *
261  * @param cls the handle to the namestore service
262  * @param tc scheduler context
263  */
264 static void
265 reconnect (struct GNUNET_NAMESTORE_Handle *nsh)
266 {
267   struct PendingMessage *p;
268   struct StartMessage *init;
269
270   GNUNET_assert (NULL == nsh->client);
271   nsh->client = GNUNET_CLIENT_connect ("namestore", nsh->cfg);
272   GNUNET_assert (NULL != nsh->client);
273
274   if ((NULL == (p = nsh->pending_head)) || (GNUNET_YES != p->is_init))
275   {
276     p = GNUNET_malloc (sizeof (struct PendingMessage) +
277                        sizeof (struct StartMessage));
278     p->size = sizeof (struct StartMessage);
279     p->is_init = GNUNET_YES;
280     init = (struct StartMessage *) &p[1];
281     init->header.type = htons (GNUNET_MESSAGE_TYPE_NAMESTORE_START);
282     init->header.size = htons (sizeof (struct StartMessage));
283     GNUNET_CONTAINER_DLL_insert (nsh->pending_head, nsh->pending_tail, p);
284   }
285   do_transmit (nsh);
286 }
287
288 /**
289  * Re-establish the connection to the service.
290  *
291  * @param cls handle to use to re-connect.
292  * @param tc scheduler context
293  */
294 static void
295 reconnect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
296 {
297   struct GNUNET_NAMESTORE_Handle *nsh = cls;
298
299   nsh->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
300   reconnect (nsh);
301 }
302
303
304 /**
305  * Disconnect from service and then reconnect.
306  *
307  * @param nsh our handle
308  */
309 static void
310 force_reconnect (struct GNUNET_NAMESTORE_Handle *nsh)
311 {
312   nsh->reconnect = GNUNET_NO;
313   GNUNET_CLIENT_disconnect (nsh->client, GNUNET_NO);
314   nsh->client = NULL;
315   nsh->reconnect_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
316                                     &reconnect_task,
317                                     nsh);
318 }
319
320
321
322 /**
323  * Initialize the connection with the NAMESTORE service.
324  *
325  * @param cfg configuration to use
326  * @return handle to the GNS service, or NULL on error
327  */
328 struct GNUNET_NAMESTORE_Handle *
329 GNUNET_NAMESTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg)
330 {
331   struct GNUNET_NAMESTORE_Handle *nsh;
332
333   nsh = GNUNET_malloc (sizeof (struct GNUNET_NAMESTORE_Handle));
334   nsh->cfg = cfg;
335   nsh->reconnect_task = GNUNET_SCHEDULER_add_now (&reconnect_task, nsh);
336   return nsh;
337 }
338
339
340 /**
341  * Shutdown connection with the NAMESTORE service.
342  *
343  * @param handle handle of the NAMESTORE connection to stop
344  */
345 void
346 GNUNET_NAMESTORE_disconnect (struct GNUNET_NAMESTORE_Handle *nsh, int drop)
347 {
348   struct PendingMessage *p;
349
350   while (NULL != (p = nsh->pending_head))
351   {
352     GNUNET_CONTAINER_DLL_remove (nsh->pending_head, nsh->pending_tail, p);
353     GNUNET_free (p);
354   }
355   if (NULL != nsh->client)
356   {
357     GNUNET_CLIENT_disconnect (nsh->client, GNUNET_NO);
358     nsh->client = NULL;
359   }
360   if (GNUNET_SCHEDULER_NO_TASK != nsh->reconnect_task)
361   {
362     GNUNET_SCHEDULER_cancel (nsh->reconnect_task);
363     nsh->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
364   }
365   GNUNET_free(nsh);
366   nsh = NULL;
367 }
368
369 /**
370  * Sign a record.  This function is used by the authority of the zone
371  * to add a record.
372  *
373  * @param h handle to the namestore
374  * @param zone_privkey private key of the zone
375  * @param record_hash hash of the record to be signed
376  * @param cont continuation to call when done
377  * @param cont_cls closure for cont
378  * @return handle to abort the request
379  */
380 struct GNUNET_NAMESTORE_QueueEntry *
381 GNUNET_NAMESTORE_stree_extend (struct GNUNET_NAMESTORE_Handle *h,
382              const struct GNUNET_CRYPTO_RsaPrivateKey *zone_privkey,
383              const GNUNET_HashCode *record_hash,
384              GNUNET_NAMESTORE_ContinuationWithSignature cont,
385              void *cont_cls)
386 {
387   struct GNUNET_NAMESTORE_QueueEntry *qe;
388   qe = GNUNET_malloc(sizeof (struct GNUNET_NAMESTORE_QueueEntry));
389   return qe;
390 }
391
392 /**
393  * Rebalance the signature tree of our zone.  This function should
394  * be called "rarely" to rebalance the tree.
395  *
396  * @param h handle to the namestore
397  * @param zone_privkey private key for the zone to rebalance
398  * @param cont continuation to call when done
399  * @param cont_cls closure for cont
400  * @return handle to abort the request
401  */
402 struct GNUNET_NAMESTORE_QueueEntry *
403 GNUNET_NAMESTORE_stree_rebalance (struct GNUNET_NAMESTORE_Handle *h,
404           const struct GNUNET_CRYPTO_RsaPrivateKey *zone_privkey,
405           GNUNET_NAMESTORE_ContinuationWithStatus cont,
406           void *cont_cls)
407 {
408   struct GNUNET_NAMESTORE_QueueEntry *qe;
409   qe = GNUNET_malloc(sizeof (struct GNUNET_NAMESTORE_QueueEntry));
410   return qe;
411 }
412
413 /**
414  * Provide the root of a signature tree.  This function is 
415  * used by non-authorities as the first operation when 
416  * adding a foreign zone.
417  *
418  * @param h handle to the namestore
419  * @param zone_key public key of the zone
420  * @param signature signature of the top-level entry of the zone
421  * @param revision revision number of the zone
422  * @param top_hash top-level hash of the zone
423  * @param cont continuation to call when done
424  * @param cont_cls closure for cont
425  * @return handle to abort the request
426  */
427 struct GNUNET_NAMESTORE_QueueEntry *
428 GNUNET_NAMESTORE_stree_start (struct GNUNET_NAMESTORE_Handle *h,
429                               const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key,
430                               const struct GNUNET_CRYPTO_RsaSignature *signature,
431                               uint32_t revision,
432                               const GNUNET_HashCode *top_hash,
433                               GNUNET_NAMESTORE_ContinuationWithSignature cont,
434                               void *cont_cls)
435 {
436   struct GNUNET_NAMESTORE_QueueEntry *qe;
437   qe = GNUNET_malloc(sizeof (struct GNUNET_NAMESTORE_QueueEntry));
438   return qe;
439 }
440
441 /**
442  * Store part of a signature B-tree in the namestore.  This function
443  * is used by non-authorities to cache parts of a zone's signature tree.
444  * Note that the tree must be build top-down.  This function must check
445  * that the nodes being added are valid, and if not refuse the operation.
446  *
447  * @param h handle to the namestore
448  * @param zone_key public key of the zone
449  * @param loc location in the B-tree
450  * @param ploc parent's location in the B-tree (must have depth = loc.depth - 1)
451  * @param num_entries number of entries at this node in the B-tree
452  * @param entries the 'num_entries' entries to store (hashes over the
453  *                records)
454  * @param cont continuation to call when done
455  * @param cont_cls closure for cont
456  * @return handle to abort the request
457  */
458 struct GNUNET_NAMESTORE_QueueEntry *
459 GNUNET_NAMESTORE_stree_put (struct GNUNET_NAMESTORE_Handle *h,
460                             const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key,
461                             const struct GNUNET_NAMESTORE_SignatureLocation *loc,
462                             const struct GNUNET_NAMESTORE_SignatureLocation *ploc,
463                             unsigned int num_entries,
464                             const GNUNET_HashCode *entries,
465                             GNUNET_NAMESTORE_ContinuationWithStatus cont,
466                             void *cont_cls)
467 {
468   struct GNUNET_NAMESTORE_QueueEntry *qe;
469   qe = GNUNET_malloc(sizeof (struct GNUNET_NAMESTORE_QueueEntry));
470   return qe;
471 }
472
473 /**
474  * Store an item in the namestore.  If the item is already present,
475  * the expiration time is updated to the max of the existing time and
476  * the new time.  The operation must fail if there is no matching
477  * entry in the signature tree.
478  *
479  * @param h handle to the namestore
480  * @param zone hash of the public key of the zone
481  * @param name name that is being mapped (at most 255 characters long)
482  * @param record_type type of the record (A, AAAA, PKEY, etc.)
483  * @param expiration expiration time for the content
484  * @param flags flags for the content
485  * @param sig_loc where is the information about the signature for this record stored?
486  * @param data_size number of bytes in data
487  * @param data value, semantics depend on 'record_type' (see RFCs for DNS and 
488  *             GNS specification for GNS extensions)
489  * @param cont continuation to call when done
490  * @param cont_cls closure for cont
491  * @return handle to abort the request
492  */
493 struct GNUNET_NAMESTORE_QueueEntry *
494 GNUNET_NAMESTORE_record_put (struct GNUNET_NAMESTORE_Handle *h,
495                              const GNUNET_HashCode *zone,
496                              const char *name,
497                              uint32_t record_type,
498                              struct GNUNET_TIME_Absolute expiration,
499                              enum GNUNET_NAMESTORE_RecordFlags flags,
500                              const struct GNUNET_NAMESTORE_SignatureLocation *sig_loc,
501                              size_t data_size,
502                              const void *data,
503                              GNUNET_NAMESTORE_ContinuationWithStatus cont,
504                              void *cont_cls)
505 {
506   struct GNUNET_NAMESTORE_QueueEntry *qe;
507   qe = GNUNET_malloc(sizeof (struct GNUNET_NAMESTORE_QueueEntry));
508 #if 0
509   struct GNUNET_NAMESTORE_SimpleRecord *sr;
510   sr = GNUNET_malloc(sizeof(struct GNUNET_NAMESTORE_SimpleRecord));
511   sr->name = name;
512   sr->record_type = record_type;
513   sr->expiration = expiration;
514   sr->flags = flags;
515   sr->data_size = data_size;
516   sr->data = data;
517   GNUNET_CONTAINER_DLL_insert(h->records_head, h->records_tail, sr);
518 #endif
519   return qe;
520 }
521
522 /**
523  * Explicitly remove some content from the database.  The
524  * "cont"inuation will be called with status "GNUNET_OK" if content
525  * was removed, "GNUNET_NO" if no matching entry was found and
526  * "GNUNET_SYSERR" on all other types of errors.
527  *
528  * @param h handle to the namestore
529  * @param zone hash of the public key of the zone
530  * @param name name that is being mapped (at most 255 characters long)
531  * @param record_type type of the record (A, AAAA, PKEY, etc.)
532  * @param size number of bytes in data
533  * @param data content stored
534  * @param cont continuation to call when done
535  * @param cont_cls closure for cont
536  * @return handle to abort the request
537  */
538 struct GNUNET_NAMESTORE_QueueEntry *
539 GNUNET_NAMESTORE_record_remove (struct GNUNET_NAMESTORE_Handle *h,
540                                 const GNUNET_HashCode *zone,
541                                 const char *name,
542                                 uint32_t record_type,
543                                 size_t size,
544                                 const void *data,
545                                 GNUNET_NAMESTORE_ContinuationWithStatus cont,
546                                 void *cont_cls)
547 {
548   struct GNUNET_NAMESTORE_QueueEntry *qe;
549   qe = GNUNET_malloc(sizeof (struct GNUNET_NAMESTORE_QueueEntry));
550 #if 0
551   struct GNUNET_NAMESTORE_SimpleRecord *iter;
552   for (iter=h->records_head; iter != NULL; iter=iter->next)
553   {
554     if (strcmp ( iter->name, name ) &&
555         iter->record_type == record_type &&
556         GNUNET_CRYPTO_hash_cmp (iter->zone, zone))
557       break;
558   }
559   if (iter)
560     GNUNET_CONTAINER_DLL_remove(h->records_head,
561                                 h->records_tail,
562                                 iter);
563 #endif
564   return qe;
565 }
566
567 /**
568  * Get a result for a particular key from the namestore.  The processor
569  * will only be called once.
570  *
571  * @param h handle to the namestore
572  * @param zone zone to look up a record from
573  * @param name name to look up
574  * @param record_type desired record type
575  * @param proc function to call on each matching value;
576  *        will be called once with a NULL value at the end
577  * @param proc_cls closure for proc
578  * @return a handle that can be used to
579  *         cancel
580  */
581 struct GNUNET_NAMESTORE_QueueEntry *
582 GNUNET_NAMESTORE_lookup_name (struct GNUNET_NAMESTORE_Handle *h, 
583                               const GNUNET_HashCode *zone,
584                               const char *name,
585                               uint32_t record_type,
586                               GNUNET_NAMESTORE_RecordProcessor proc, void *proc_cls)
587 {
588   struct GNUNET_NAMESTORE_QueueEntry *qe;
589   qe = GNUNET_malloc(sizeof (struct GNUNET_NAMESTORE_QueueEntry));
590 #if 0
591   struct GNUNET_NAMESTORE_SimpleRecord *iter;
592   for (iter=h->records_head; iter != NULL; iter=iter->next)
593   {
594     proc(proc_cls, iter->zone, iter->name, iter->record_type,
595        iter->expiration,
596        iter->flags,
597        NULL /*sig loc*/,
598        iter->data_size /*size*/,
599        iter->data /* data */);
600   }
601   proc(proc_cls, zone, name, record_type,
602        GNUNET_TIME_absolute_get_forever(), 0, NULL, 0, NULL); /*TERMINATE*/
603 #endif
604   return qe;
605 }
606
607
608 /**
609  * Get the hash of a record (what will be signed in the Stree for
610  * the record).
611  *
612  * @param zone hash of the public key of the zone
613  * @param name name that is being mapped (at most 255 characters long)
614  * @param record_type type of the record (A, AAAA, PKEY, etc.)
615  * @param expiration expiration time for the content
616  * @param flags flags for the content
617  * @param data_size number of bytes in data
618  * @param data value, semantics depend on 'record_type' (see RFCs for DNS and.
619  *             GNS specification for GNS extensions)
620  * @param record_hash hash of the record (set)
621  */
622 void
623 GNUNET_NAMESTORE_record_hash (struct GNUNET_NAMESTORE_Handle *h,
624                               const GNUNET_HashCode *zone,
625                               const char *name,
626                               uint32_t record_type,
627                               struct GNUNET_TIME_Absolute expiration,
628                               enum GNUNET_NAMESTORE_RecordFlags flags,
629                               size_t data_size,
630                               const void *data,
631                               GNUNET_HashCode *record_hash)
632 {
633   char* teststring = "namestore-stub";
634   GNUNET_CRYPTO_hash(teststring, strlen(teststring), record_hash);
635 }
636
637 /**
638  * Obtain part of a signature B-tree.  The processor
639  * will only be called once.
640  *
641  * @param h handle to the namestore
642  * @param zone zone to look up a record from
643  * @param sig_loc location to look up
644  * @param proc function to call on each matching value;
645  *        will be called once with a NULL value at the end
646  * @param proc_cls closure for proc
647  * @return a handle that can be used to
648  *         cancel
649  */
650 struct GNUNET_NAMESTORE_QueueEntry *
651 GNUNET_NAMESTORE_lookup_stree (struct GNUNET_NAMESTORE_Handle *h,
652                       const GNUNET_HashCode *zone,
653                       const struct GNUNET_NAMESTORE_SignatureLocation *sig_loc,
654                       GNUNET_NAMESTORE_StreeProcessor proc, void *proc_cls)
655 {
656   struct GNUNET_NAMESTORE_QueueEntry *qe;
657   qe = GNUNET_malloc(sizeof (struct GNUNET_NAMESTORE_QueueEntry));
658   return qe;
659 }
660
661
662 /**
663  * Get all records of a zone.
664  *
665  * @param h handle to the namestore
666  * @param zone zone to access
667  * @param proc function to call on a random value; it
668  *        will be called repeatedly with a value (if available)
669  *        and always once at the end with a zone and name of NULL.
670  * @param proc_cls closure for proc
671  * @return a handle that can be used to
672  *         cancel
673  */
674 struct GNUNET_NAMESTORE_QueueEntry *
675 GNUNET_NAMESTORE_zone_transfer (struct GNUNET_NAMESTORE_Handle *h,
676                                 const GNUNET_HashCode *zone,
677                                 GNUNET_NAMESTORE_RecordProcessor proc,
678                                 void *proc_cls)
679 {
680   struct GNUNET_NAMESTORE_QueueEntry *qe;
681   qe = GNUNET_malloc(sizeof (struct GNUNET_NAMESTORE_QueueEntry));
682   return qe;
683 }
684
685
686
687
688 /**
689  * Cancel a namestore operation.  The final callback from the
690  * operation must not have been done yet.
691  *
692  * @param qe operation to cancel
693  */
694 void
695 GNUNET_NAMESTORE_cancel (struct GNUNET_NAMESTORE_QueueEntry *qe)
696 {
697   if (qe)
698     GNUNET_free(qe);
699 }
700
701 /* end of namestore_api.c */