peerstore: stress test + minor fix
[oweals/gnunet.git] / src / peerstore / peerstore_api.c
1 /*
2      This file is part of GNUnet.
3      (C) 
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 peerstore/peerstore_api.c
23  * @brief API for peerstore
24  * @author Omar Tarabai
25  */
26 #include "platform.h"
27 #include "gnunet_util_lib.h"
28 #include "peerstore.h"
29 #include "peerstore_common.h"
30
31 #define LOG(kind,...) GNUNET_log_from (kind, "peerstore-api",__VA_ARGS__)
32
33 /******************************************************************************/
34 /************************      DATA STRUCTURES     ****************************/
35 /******************************************************************************/
36
37 /**
38  * Handle to the PEERSTORE service.
39  */
40 struct GNUNET_PEERSTORE_Handle
41 {
42
43   /**
44    * Our configuration.
45    */
46   const struct GNUNET_CONFIGURATION_Handle *cfg;
47
48   /**
49    * Connection to the service.
50    */
51   struct GNUNET_CLIENT_Connection *client;
52
53   /**
54    * Message queue
55    */
56   struct GNUNET_MQ_Handle *mq;
57
58   /**
59    * Head of active STORE requests.
60    */
61   struct GNUNET_PEERSTORE_StoreContext *store_head;
62
63   /**
64    * Tail of active STORE requests.
65    */
66   struct GNUNET_PEERSTORE_StoreContext *store_tail;
67
68   /**
69    * Head of active ITERATE requests.
70    */
71   struct GNUNET_PEERSTORE_IterateContext *iterate_head;
72
73   /**
74    * Tail of active ITERATE requests.
75    */
76   struct GNUNET_PEERSTORE_IterateContext *iterate_tail;
77
78   /**
79    * Hashmap of watch requests
80    */
81   struct GNUNET_CONTAINER_MultiHashMap *watches;
82
83 };
84
85 /**
86  * Context for a store request
87  */
88 struct GNUNET_PEERSTORE_StoreContext
89 {
90   /**
91    * Kept in a DLL.
92    */
93   struct GNUNET_PEERSTORE_StoreContext *next;
94
95   /**
96    * Kept in a DLL.
97    */
98   struct GNUNET_PEERSTORE_StoreContext *prev;
99
100   /**
101    * Handle to the PEERSTORE service.
102    */
103   struct GNUNET_PEERSTORE_Handle *h;
104
105   /**
106    * MQ Envelope with store request message
107    */
108   struct GNUNET_MQ_Envelope *ev;
109
110   /**
111    * Continuation called with service response
112    */
113   GNUNET_PEERSTORE_Continuation cont;
114
115   /**
116    * Closure for 'cont'
117    */
118   void *cont_cls;
119
120 };
121
122 /**
123  * Context for a iterate request
124  */
125 struct GNUNET_PEERSTORE_IterateContext
126 {
127   /**
128    * Kept in a DLL.
129    */
130   struct GNUNET_PEERSTORE_IterateContext *next;
131
132   /**
133    * Kept in a DLL.
134    */
135   struct GNUNET_PEERSTORE_IterateContext *prev;
136
137   /**
138    * Handle to the PEERSTORE service.
139    */
140   struct GNUNET_PEERSTORE_Handle *h;
141
142   /**
143    * MQ Envelope with iterate request message
144    */
145   struct GNUNET_MQ_Envelope *ev;
146
147   /**
148    * Callback with each matching record
149    */
150   GNUNET_PEERSTORE_Processor callback;
151
152   /**
153    * Closure for 'callback'
154    */
155   void *callback_cls;
156
157   /**
158    * #GNUNET_YES / #GNUNET_NO
159    * if sent, cannot be canceled
160    */
161   int request_sent;
162
163   /**
164    * Task identifier for the function called
165    * on iterate request timeout
166    */
167   GNUNET_SCHEDULER_TaskIdentifier timeout_task;
168
169 };
170
171 /**
172  * Context for a watch request
173  */
174 struct GNUNET_PEERSTORE_WatchContext
175 {
176   /**
177    * Kept in a DLL.
178    */
179   struct GNUNET_PEERSTORE_WatchContext *next;
180
181   /**
182    * Kept in a DLL.
183    */
184   struct GNUNET_PEERSTORE_WatchContext *prev;
185
186   /**
187    * Handle to the PEERSTORE service.
188    */
189   struct GNUNET_PEERSTORE_Handle *h;
190
191   /**
192    * MQ Envelope with watch request message
193    */
194   struct GNUNET_MQ_Envelope *ev;
195
196   /**
197    * Callback with each record received
198    */
199   GNUNET_PEERSTORE_Processor callback;
200
201   /**
202    * Closure for 'callback'
203    */
204   void *callback_cls;
205
206   /**
207    * Hash of the combined key
208    */
209   struct GNUNET_HashCode keyhash;
210
211   /**
212    * #GNUNET_YES / #GNUNET_NO
213    * if sent, cannot be canceled
214    */
215   int request_sent;
216
217 };
218
219 /******************************************************************************/
220 /*******************             DECLARATIONS             *********************/
221 /******************************************************************************/
222
223 /**
224  * When a response for iterate request is received
225  *
226  * @param cls a 'struct GNUNET_PEERSTORE_Handle *'
227  * @param msg message received, NULL on timeout or fatal error
228  */
229 void handle_iterate_result (void *cls, const struct GNUNET_MessageHeader *msg);
230
231 /**
232  * When a watch record is received
233  *
234  * @param cls a 'struct GNUNET_PEERSTORE_Handle *'
235  * @param msg message received, NULL on timeout or fatal error
236  */
237 void handle_watch_result (void *cls, const struct GNUNET_MessageHeader *msg);
238
239 /**
240  * Close the existing connection to PEERSTORE and reconnect.
241  *
242  * @param h handle to the service
243  */
244 static void
245 reconnect (struct GNUNET_PEERSTORE_Handle *h);
246
247 /**
248  * MQ message handlers
249  */
250 static const struct GNUNET_MQ_MessageHandler mq_handlers[] = {
251     {&handle_iterate_result, GNUNET_MESSAGE_TYPE_PEERSTORE_ITERATE_RECORD, 0},
252     {&handle_iterate_result, GNUNET_MESSAGE_TYPE_PEERSTORE_ITERATE_END, sizeof(struct GNUNET_MessageHeader)},
253     {&handle_watch_result, GNUNET_MESSAGE_TYPE_PEERSTORE_WATCH_RECORD, 0},
254     GNUNET_MQ_HANDLERS_END
255 };
256
257 /******************************************************************************/
258 /*******************         CONNECTION FUNCTIONS         *********************/
259 /******************************************************************************/
260
261 static void
262 handle_client_error (void *cls, enum GNUNET_MQ_Error error)
263 {
264   struct GNUNET_PEERSTORE_Handle *h = cls;
265
266   LOG(GNUNET_ERROR_TYPE_ERROR, "Received an error notification from MQ of type: %d\n", error);
267   reconnect(h);
268 }
269
270 /**
271  * Close the existing connection to PEERSTORE and reconnect.
272  *
273  * @param h handle to the service
274  */
275 static void
276 reconnect (struct GNUNET_PEERSTORE_Handle *h)
277 {
278   LOG(GNUNET_ERROR_TYPE_DEBUG, "Reconnecting...\n");
279   if (NULL != h->mq)
280   {
281     GNUNET_MQ_destroy(h->mq);
282     h->mq = NULL;
283   }
284   if (NULL != h->client)
285   {
286     GNUNET_CLIENT_disconnect (h->client);
287     h->client = NULL;
288   }
289   h->client = GNUNET_CLIENT_connect ("peerstore", h->cfg);
290   //FIXME: retry connecting if fails again (client == NULL)
291   h->mq = GNUNET_MQ_queue_for_connection_client(h->client,
292       mq_handlers,
293       &handle_client_error,
294       h);
295   //FIXME: resend pending requests after reconnecting
296
297 }
298
299 /**
300  * Connect to the PEERSTORE service.
301  *
302  * @return NULL on error
303  */
304 struct GNUNET_PEERSTORE_Handle *
305 GNUNET_PEERSTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg)
306 {
307   struct GNUNET_PEERSTORE_Handle *h;
308
309   h = GNUNET_new (struct GNUNET_PEERSTORE_Handle);
310   h->client = GNUNET_CLIENT_connect ("peerstore", cfg);
311   if(NULL == h->client)
312   {
313     GNUNET_free(h);
314     return NULL;
315   }
316   h->cfg = cfg;
317   h->mq = GNUNET_MQ_queue_for_connection_client(h->client,
318       mq_handlers,
319       &handle_client_error,
320       h);
321   if(NULL == h->mq)
322   {
323     GNUNET_free(h);
324     return NULL;
325   }
326   LOG(GNUNET_ERROR_TYPE_DEBUG, "New connection created\n");
327   return h;
328 }
329
330 /**
331  * Disconnect from the PEERSTORE service
332  * Do not call in case of pending requests
333  *
334  * @param h handle to disconnect
335  */
336 void
337 GNUNET_PEERSTORE_disconnect(struct GNUNET_PEERSTORE_Handle *h)
338 {
339   if(NULL != h->watches)
340   {
341     GNUNET_CONTAINER_multihashmap_destroy(h->watches);
342     h->watches = NULL;
343   }
344   if(NULL != h->mq)
345   {
346     GNUNET_MQ_destroy(h->mq);
347     h->mq = NULL;
348   }
349   if (NULL != h->client)
350   {
351     GNUNET_CLIENT_disconnect (h->client);
352     h->client = NULL;
353   }
354   GNUNET_free(h);
355   LOG(GNUNET_ERROR_TYPE_DEBUG, "Disconnected, BYE!\n");
356 }
357
358
359 /******************************************************************************/
360 /*******************            STORE FUNCTIONS           *********************/
361 /******************************************************************************/
362
363 /**
364  * Callback after MQ envelope is sent
365  *
366  * @param cls a 'struct GNUNET_PEERSTORE_StoreContext *'
367  */
368 void store_request_sent (void *cls)
369 {
370   struct GNUNET_PEERSTORE_StoreContext *sc = cls;
371   GNUNET_PEERSTORE_Continuation cont;
372   void *cont_cls;
373
374   sc->ev = NULL;
375   cont = sc->cont;
376   cont_cls = sc->cont_cls;
377   GNUNET_PEERSTORE_store_cancel(sc);
378   if(NULL != cont)
379     cont(cont_cls, GNUNET_OK);
380 }
381
382 /**
383  * Cancel a store request
384  *
385  * @param sc Store request context
386  */
387 void
388 GNUNET_PEERSTORE_store_cancel (struct GNUNET_PEERSTORE_StoreContext *sc)
389 {
390   if(NULL != sc->ev)
391   {
392     GNUNET_MQ_send_cancel(sc->ev);
393     sc->ev = NULL;
394   }
395   GNUNET_CONTAINER_DLL_remove(sc->h->store_head, sc->h->store_tail, sc);
396   GNUNET_free(sc);
397 }
398
399 /**
400  * Store a new entry in the PEERSTORE
401  *
402  * @param h Handle to the PEERSTORE service
403  * @param sub_system name of the sub system
404  * @param peer Peer Identity
405  * @param key entry key
406  * @param value entry value BLOB
407  * @param size size of 'value'
408  * @param expiry absolute time after which the entry is (possibly) deleted
409  * @param cont Continuation function after the store request is processed
410  * @param cont_cls Closure for 'cont'
411  */
412 struct GNUNET_PEERSTORE_StoreContext *
413 GNUNET_PEERSTORE_store (struct GNUNET_PEERSTORE_Handle *h,
414     const char *sub_system,
415     const struct GNUNET_PeerIdentity *peer,
416     const char *key,
417     const void *value,
418     size_t size,
419     struct GNUNET_TIME_Absolute expiry,
420     enum GNUNET_PEERSTORE_StoreOption options,
421     GNUNET_PEERSTORE_Continuation cont,
422     void *cont_cls)
423 {
424   struct GNUNET_MQ_Envelope *ev;
425   struct GNUNET_PEERSTORE_StoreContext *sc;
426
427   LOG (GNUNET_ERROR_TYPE_DEBUG,
428       "Storing value (size: %lu) for subsytem `%s', peer `%s', key `%s'\n",
429       size, sub_system, GNUNET_i2s (peer), key);
430   ev = PEERSTORE_create_record_mq_envelope(sub_system,
431       peer,
432       key,
433       value,
434       size,
435       &expiry,
436       options,
437       GNUNET_MESSAGE_TYPE_PEERSTORE_STORE);
438   sc = GNUNET_new(struct GNUNET_PEERSTORE_StoreContext);
439   sc->ev = ev;
440   sc->cont = cont;
441   sc->cont_cls = cont_cls;
442   sc->h = h;
443   GNUNET_CONTAINER_DLL_insert(h->store_head, h->store_tail, sc);
444   GNUNET_MQ_notify_sent(ev, &store_request_sent, sc);
445   GNUNET_MQ_send(h->mq, ev);
446   return sc;
447
448 }
449
450 /******************************************************************************/
451 /*******************           ITERATE FUNCTIONS          *********************/
452 /******************************************************************************/
453
454 /**
455  * When a response for iterate request is received
456  *
457  * @param cls a 'struct GNUNET_PEERSTORE_Handle *'
458  * @param msg message received, NULL on timeout or fatal error
459  */
460 void handle_iterate_result (void *cls, const struct GNUNET_MessageHeader *msg)
461 {
462   struct GNUNET_PEERSTORE_Handle *h = cls;
463   struct GNUNET_PEERSTORE_IterateContext *ic;
464   GNUNET_PEERSTORE_Processor callback;
465   void *callback_cls;
466   uint16_t msg_type;
467   struct GNUNET_PEERSTORE_Record *record;
468   int continue_iter;
469
470   ic = h->iterate_head;
471   if(NULL == ic)
472   {
473     LOG(GNUNET_ERROR_TYPE_ERROR, "Unexpected iteration response, this should not happen.\n");
474     reconnect(h);
475     return;
476   }
477   callback = ic->callback;
478   callback_cls = ic->callback_cls;
479   if(NULL == msg) /* Connection error */
480   {
481
482     if(NULL != callback)
483       callback(callback_cls, NULL,
484           _("Error communicating with `PEERSTORE' service."));
485     reconnect(h);
486     return;
487   }
488   msg_type = ntohs(msg->type);
489   if(GNUNET_MESSAGE_TYPE_PEERSTORE_ITERATE_END == msg_type)
490   {
491     ic->request_sent = GNUNET_NO;
492     GNUNET_PEERSTORE_iterate_cancel(ic);
493     if(NULL != callback)
494       callback(callback_cls, NULL, NULL);
495     return;
496   }
497   if(NULL != callback)
498   {
499     record = PEERSTORE_parse_record_message(msg);
500     if(NULL == record)
501       continue_iter = callback(callback_cls, NULL, _("Received a malformed response from service."));
502     else
503     {
504       continue_iter = callback(callback_cls, record, NULL);
505       PEERSTORE_destroy_record(record);
506     }
507     if(GNUNET_NO == continue_iter)
508       ic->callback = NULL;
509   }
510
511 }
512
513 /**
514  * Callback after MQ envelope is sent
515  *
516  * @param cls a 'struct GNUNET_PEERSTORE_IterateContext *'
517  */
518 void iterate_request_sent (void *cls)
519 {
520   struct GNUNET_PEERSTORE_IterateContext *ic = cls;
521
522   LOG(GNUNET_ERROR_TYPE_DEBUG, "Iterate request sent to service.\n");
523   ic->request_sent = GNUNET_YES;
524   ic->ev = NULL;
525 }
526
527 /**
528  * Called when the iterate request is timedout
529  *
530  * @param cls a 'struct GNUNET_PEERSTORE_IterateContext *'
531  */
532 void iterate_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
533 {
534   struct GNUNET_PEERSTORE_IterateContext *ic = cls;
535
536   ic->timeout_task = GNUNET_SCHEDULER_NO_TASK;
537   GNUNET_PEERSTORE_iterate_cancel(ic);
538 }
539
540 /**
541  * Cancel an iterate request
542  * Please do not call after the iterate request is done
543  *
544  * @param ic Iterate request context as returned by GNUNET_PEERSTORE_iterate()
545  */
546 void
547 GNUNET_PEERSTORE_iterate_cancel (struct GNUNET_PEERSTORE_IterateContext *ic)
548 {
549   if(GNUNET_SCHEDULER_NO_TASK != ic->timeout_task)
550   {
551     GNUNET_SCHEDULER_cancel(ic->timeout_task);
552     ic->timeout_task = GNUNET_SCHEDULER_NO_TASK;
553   }
554   if(GNUNET_NO == ic->request_sent)
555   {
556     if(NULL != ic->ev)
557     {
558       GNUNET_MQ_send_cancel(ic->ev);
559       ic->ev = NULL;
560     }
561     GNUNET_CONTAINER_DLL_remove(ic->h->iterate_head, ic->h->iterate_tail, ic);
562     GNUNET_free(ic);
563   }
564   else
565     ic->callback = NULL;
566 }
567
568 /**
569  * Iterate over records matching supplied key information
570  *
571  * @param h handle to the PEERSTORE service
572  * @param sub_system name of sub system
573  * @param peer Peer identity (can be NULL)
574  * @param key entry key string (can be NULL)
575  * @param timeout time after which the iterate request is canceled
576  * @param callback function called with each matching record, all NULL's on end
577  * @param callback_cls closure for @a callback
578  * @return Handle to iteration request
579  */
580 struct GNUNET_PEERSTORE_IterateContext *
581 GNUNET_PEERSTORE_iterate (struct GNUNET_PEERSTORE_Handle *h,
582     const char *sub_system,
583     const struct GNUNET_PeerIdentity *peer,
584     const char *key,
585     struct GNUNET_TIME_Relative timeout,
586     GNUNET_PEERSTORE_Processor callback, void *callback_cls)
587 {
588   struct GNUNET_MQ_Envelope *ev;
589   struct GNUNET_PEERSTORE_IterateContext *ic;
590
591   ev = PEERSTORE_create_record_mq_envelope(sub_system,
592       peer,
593       key,
594       NULL,
595       0,
596       NULL,
597       0,
598       GNUNET_MESSAGE_TYPE_PEERSTORE_ITERATE);
599   ic = GNUNET_new(struct GNUNET_PEERSTORE_IterateContext);
600   ic->callback = callback;
601   ic->callback_cls = callback_cls;
602   ic->ev = ev;
603   ic->h = h;
604   ic->request_sent = GNUNET_NO;
605   GNUNET_CONTAINER_DLL_insert(h->iterate_head, h->iterate_tail, ic);
606   LOG(GNUNET_ERROR_TYPE_DEBUG,
607         "Sending an iterate request for sub system `%s'\n", sub_system);
608   GNUNET_MQ_notify_sent(ev, &iterate_request_sent, ic);
609   GNUNET_MQ_send(h->mq, ev);
610   ic->timeout_task = GNUNET_SCHEDULER_add_delayed(timeout, &iterate_timeout, ic);
611   return ic;
612 }
613
614 /******************************************************************************/
615 /*******************            WATCH FUNCTIONS           *********************/
616 /******************************************************************************/
617
618 /**
619  * When a watch record is received
620  *
621  * @param cls a 'struct GNUNET_PEERSTORE_Handle *'
622  * @param msg message received, NULL on timeout or fatal error
623  */
624 void handle_watch_result (void *cls, const struct GNUNET_MessageHeader *msg)
625 {
626   struct GNUNET_PEERSTORE_Handle *h = cls;
627   struct GNUNET_PEERSTORE_Record *record;
628   struct GNUNET_HashCode keyhash;
629   struct GNUNET_PEERSTORE_WatchContext *wc;
630
631   if(NULL == msg)
632   {
633     LOG(GNUNET_ERROR_TYPE_ERROR,
634         "Problem receiving a watch response, no way to determine which request.\n");
635     reconnect(h);
636     return;
637   }
638   LOG(GNUNET_ERROR_TYPE_DEBUG, "Received a watch record from service.\n");
639   record = PEERSTORE_parse_record_message(msg);
640   PEERSTORE_hash_key(record->sub_system,
641       record->peer, record->key, &keyhash);
642   wc = GNUNET_CONTAINER_multihashmap_get(h->watches, &keyhash);
643   if(NULL != wc->callback)
644     wc->callback(wc->callback_cls, record, NULL);
645   PEERSTORE_destroy_record(record);
646 }
647
648 /**
649  * Callback after MQ envelope is sent
650  *
651  * @param cls a 'struct GNUNET_PEERSTORE_WatchContext *'
652  */
653 void watch_request_sent (void *cls)
654 {
655   struct GNUNET_PEERSTORE_WatchContext *wc = cls;
656
657   wc->request_sent = GNUNET_YES;
658   wc->ev = NULL;
659 }
660
661 /**
662  * Cancel a watch request
663  *
664  * @wc handle to the watch request
665  */
666 void
667 GNUNET_PEERSTORE_watch_cancel(struct GNUNET_PEERSTORE_WatchContext *wc)
668 {
669   struct GNUNET_PEERSTORE_Handle *h = wc->h;
670   struct GNUNET_MQ_Envelope *ev;
671   struct StoreKeyHashMessage *hm;
672
673   LOG(GNUNET_ERROR_TYPE_DEBUG, "Canceling watch.\n");
674   if(GNUNET_YES == wc->request_sent) /* If request already sent to service, send a cancel request. */
675   {
676     ev = GNUNET_MQ_msg(hm, GNUNET_MESSAGE_TYPE_PEERSTORE_WATCH_CANCEL);
677     GNUNET_MQ_send(h->mq, ev);
678     wc->callback = NULL;
679     wc->callback_cls = NULL;
680   }
681   if(NULL != wc->ev)
682   {
683     GNUNET_MQ_send_cancel(wc->ev);
684     wc->ev = NULL;
685   }
686   GNUNET_CONTAINER_multihashmap_remove(h->watches, &wc->keyhash, wc);
687   GNUNET_free(wc);
688
689 }
690
691 /**
692  * Request watching a given key
693  * User will be notified with any new values added to key
694  *
695  * @param h handle to the PEERSTORE service
696  * @param sub_system name of sub system
697  * @param peer Peer identity
698  * @param key entry key string
699  * @param callback function called with each new value
700  * @param callback_cls closure for @a callback
701  * @return Handle to watch request
702  */
703 struct GNUNET_PEERSTORE_WatchContext *
704 GNUNET_PEERSTORE_watch (struct GNUNET_PEERSTORE_Handle *h,
705     const char *sub_system,
706     const struct GNUNET_PeerIdentity *peer,
707     const char *key,
708     GNUNET_PEERSTORE_Processor callback, void *callback_cls)
709 {
710   struct GNUNET_MQ_Envelope *ev;
711   struct StoreKeyHashMessage *hm;
712   struct GNUNET_PEERSTORE_WatchContext *wc;
713
714   ev = GNUNET_MQ_msg(hm, GNUNET_MESSAGE_TYPE_PEERSTORE_WATCH);
715   PEERSTORE_hash_key(sub_system, peer, key, &hm->keyhash);
716   wc = GNUNET_new(struct GNUNET_PEERSTORE_WatchContext);
717   wc->callback = callback;
718   wc->callback_cls = callback_cls;
719   wc->ev = ev;
720   wc->h = h;
721   wc->request_sent = GNUNET_NO;
722   wc->keyhash = hm->keyhash;
723   if(NULL == h->watches)
724     h->watches = GNUNET_CONTAINER_multihashmap_create(5, GNUNET_NO);
725   GNUNET_CONTAINER_multihashmap_put(h->watches, &wc->keyhash,
726       wc, GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE);
727   LOG(GNUNET_ERROR_TYPE_DEBUG,
728       "Sending a watch request for ss `%s', peer `%s', key `%s'.\n",
729       sub_system, GNUNET_i2s(peer), key);
730   GNUNET_MQ_notify_sent(ev, &watch_request_sent, wc);
731   GNUNET_MQ_send(h->mq, ev);
732   return wc;
733 }
734
735 /* end of peerstore_api.c */