2 * This file is part of GNUnet
3 * (C) 2013 Christian Grothoff (and other contributing authors)
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.
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.
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.
22 * @file psycstore/gnunet-service-psycstore.c
23 * @brief PSYCstore service
24 * @author Gabor X Toth
25 * @author Christian Grothoff
31 #include "gnunet_util_lib.h"
32 #include "gnunet_constants.h"
33 #include "gnunet_protocols.h"
34 #include "gnunet_statistics_service.h"
35 #include "gnunet_psycstore_service.h"
36 #include "gnunet_psycstore_plugin.h"
37 #include "psycstore.h"
41 * Handle to our current configuration.
43 static const struct GNUNET_CONFIGURATION_Handle *cfg;
46 * Handle to the statistics service.
48 static struct GNUNET_STATISTICS_Handle *stats;
51 * Notification context, simplifies client broadcasts.
53 static struct GNUNET_SERVER_NotificationContext *nc;
58 static struct GNUNET_PSYCSTORE_PluginFunctions *db;
61 * Name of the database plugin
63 static char *db_lib_name;
67 * Task run during shutdown.
73 shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
77 GNUNET_SERVER_notification_context_destroy (nc);
82 GNUNET_STATISTICS_destroy (stats, GNUNET_NO);
85 GNUNET_break (NULL == GNUNET_PLUGIN_unload (db_lib_name, db));
86 GNUNET_free (db_lib_name);
92 * Send a result code back to the client.
95 * Client that should receive the result code.
99 * Operation ID in network byte order.
101 * Error message to include (or NULL for none).
104 send_result_code (struct GNUNET_SERVER_Client *client, uint64_t op_id,
105 int64_t result_code, const char *err_msg)
107 struct OperationResult *res;
111 err_size = strnlen (err_msg,
112 GNUNET_SERVER_MAX_MESSAGE_SIZE - sizeof (*res)) + 1;
113 res = GNUNET_malloc (sizeof (struct OperationResult) + err_size);
114 res->header.type = htons (GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_CODE);
115 res->header.size = htons (sizeof (struct OperationResult) + err_size);
116 res->result_code = GNUNET_htonll (result_code - INT64_MIN);
120 memcpy (&res[1], err_msg, err_size);
121 ((char *) &res[1])[err_size - 1] = '\0';
123 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
124 "Sending result to client: %" PRId64 " (%s)\n",
125 result_code, err_msg);
126 GNUNET_SERVER_notification_context_add (nc, client);
127 GNUNET_SERVER_notification_context_unicast (nc, client, &res->header,
135 MEMBERSHIP_TEST_NOT_NEEDED = 0,
136 MEMBERSHIP_TEST_NEEDED = 1,
137 MEMBERSHIP_TEST_DONE = 2,
138 } MessageMembershipTest;
143 struct GNUNET_SERVER_Client *client;
146 * Channel's public key.
148 struct GNUNET_CRYPTO_EddsaPublicKey channel_key;
151 * Slave's public key.
153 struct GNUNET_CRYPTO_EcdsaPublicKey slave_key;
161 * Membership test result.
163 int membership_test_result;
166 * Do membership test with @a slave_key before returning fragment?
167 * @see enum MessageMembershipTest
169 uint8_t membership_test;
174 send_fragment (void *cls, struct GNUNET_MULTICAST_MessageHeader *msg,
175 enum GNUNET_PSYCSTORE_MessageFlags flags)
177 struct SendClosure *sc = cls;
178 struct FragmentResult *res;
180 if (MEMBERSHIP_TEST_NEEDED == sc->membership_test)
182 sc->membership_test = MEMBERSHIP_TEST_DONE;
183 sc->membership_test_result
184 = db->membership_test (db->cls, &sc->channel_key, &sc->slave_key,
185 GNUNET_ntohll (msg->message_id));
186 switch (sc->membership_test_result)
197 size_t msg_size = ntohs (msg->header.size);
199 res = GNUNET_malloc (sizeof (struct FragmentResult) + msg_size);
200 res->header.type = htons (GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_FRAGMENT);
201 res->header.size = htons (sizeof (struct FragmentResult) + msg_size);
202 res->op_id = sc->op_id;
203 res->psycstore_flags = htonl (flags);
204 memcpy (&res[1], msg, msg_size);
205 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
206 "Sending fragment %ld to client\n",
207 GNUNET_ntohll (msg->fragment_id));
209 GNUNET_SERVER_notification_context_add (nc, sc->client);
210 GNUNET_SERVER_notification_context_unicast (nc, sc->client, &res->header,
218 send_state_var (void *cls, const char *name,
219 const void *value, size_t value_size)
221 struct SendClosure *sc = cls;
222 struct StateResult *res;
223 size_t name_size = strlen (name) + 1;
225 /* FIXME: split up value into 64k chunks */
227 res = GNUNET_malloc (sizeof (struct StateResult) + name_size + value_size);
228 res->header.type = htons (GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_STATE);
229 res->header.size = htons (sizeof (struct StateResult) + name_size + value_size);
230 res->op_id = sc->op_id;
231 res->name_size = htons (name_size);
232 memcpy (&res[1], name, name_size);
233 memcpy ((char *) &res[1] + name_size, value, value_size);
234 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
235 "Sending state variable %s to client\n", name);
236 GNUNET_SERVER_notification_context_add (nc, sc->client);
237 GNUNET_SERVER_notification_context_unicast (nc, sc->client, &res->header,
245 handle_membership_store (void *cls,
246 struct GNUNET_SERVER_Client *client,
247 const struct GNUNET_MessageHeader *msg)
249 const struct MembershipStoreRequest *req =
250 (const struct MembershipStoreRequest *) msg;
252 int ret = db->membership_store (db->cls, &req->channel_key, &req->slave_key,
254 GNUNET_ntohll (req->announced_at),
255 GNUNET_ntohll (req->effective_since),
256 GNUNET_ntohll (req->group_generation));
258 if (ret != GNUNET_OK)
259 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
260 _("Failed to store membership information!\n"));
262 send_result_code (client, req->op_id, ret, NULL);
263 GNUNET_SERVER_receive_done (client, GNUNET_OK);
268 handle_membership_test (void *cls,
269 struct GNUNET_SERVER_Client *client,
270 const struct GNUNET_MessageHeader *msg)
272 const struct MembershipTestRequest *req =
273 (const struct MembershipTestRequest *) msg;
275 int ret = db->membership_test (db->cls, &req->channel_key, &req->slave_key,
276 GNUNET_ntohll (req->message_id));
283 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
284 _("Failed to test membership!\n"));
287 send_result_code (client, req->op_id, ret, NULL);
288 GNUNET_SERVER_receive_done (client, GNUNET_OK);
293 handle_fragment_store (void *cls,
294 struct GNUNET_SERVER_Client *client,
295 const struct GNUNET_MessageHeader *msg)
297 const struct FragmentStoreRequest *req =
298 (const struct FragmentStoreRequest *) msg;
300 int ret = db->fragment_store (db->cls, &req->channel_key,
301 (const struct GNUNET_MULTICAST_MessageHeader *)
302 &req[1], ntohl (req->psycstore_flags));
304 if (ret != GNUNET_OK)
305 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
306 _("Failed to store fragment!\n"));
308 send_result_code (client, req->op_id, ret, NULL);
309 GNUNET_SERVER_receive_done (client, GNUNET_OK);
314 handle_fragment_get (void *cls,
315 struct GNUNET_SERVER_Client *client,
316 const struct GNUNET_MessageHeader *msg)
318 const struct FragmentGetRequest *
319 req = (const struct FragmentGetRequest *) msg;
321 sc = { .op_id = req->op_id, .client = client,
322 .channel_key = req->channel_key, .slave_key = req->slave_key,
323 .membership_test = req->do_membership_test };
326 uint64_t ret_frags = 0;
327 uint64_t first_fragment_id = GNUNET_ntohll (req->first_fragment_id);
328 uint64_t last_fragment_id = GNUNET_ntohll (req->last_fragment_id);
329 uint64_t limit = GNUNET_ntohll (req->fragment_limit);
332 ret = db->fragment_get (db->cls, &req->channel_key,
333 first_fragment_id, last_fragment_id,
334 &ret_frags, &send_fragment, &sc);
336 ret = db->fragment_get_latest (db->cls, &req->channel_key, limit,
337 &ret_frags, &send_fragment, &sc);
343 if (MEMBERSHIP_TEST_DONE == sc.membership_test)
345 switch (sc.membership_test_result)
351 ret = GNUNET_PSYCSTORE_MEMBERSHIP_TEST_FAILED;
361 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
362 _("Failed to get fragment!\n"));
364 send_result_code (client, req->op_id, (ret < 0) ? ret : ret_frags, NULL);
365 GNUNET_SERVER_receive_done (client, GNUNET_OK);
370 handle_message_get (void *cls,
371 struct GNUNET_SERVER_Client *client,
372 const struct GNUNET_MessageHeader *msg)
374 const struct MessageGetRequest *
375 req = (const struct MessageGetRequest *) msg;
377 sc = { .op_id = req->op_id, .client = client,
378 .channel_key = req->channel_key, .slave_key = req->slave_key,
379 .membership_test = req->do_membership_test };
382 uint64_t ret_frags = 0;
383 uint64_t first_message_id = GNUNET_ntohll (req->first_message_id);
384 uint64_t last_message_id = GNUNET_ntohll (req->last_message_id);
385 uint64_t limit = GNUNET_ntohll (req->message_limit);
388 ret = db->message_get (db->cls, &req->channel_key,
389 first_message_id, last_message_id,
390 &ret_frags, &send_fragment, &sc);
392 ret = db->message_get_latest (db->cls, &req->channel_key, limit,
393 &ret_frags, &send_fragment, &sc);
401 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
402 _("Failed to get message!\n"));
405 send_result_code (client, req->op_id, (ret < 0) ? ret : ret_frags, NULL);
406 GNUNET_SERVER_receive_done (client, GNUNET_OK);
411 handle_message_get_fragment (void *cls,
412 struct GNUNET_SERVER_Client *client,
413 const struct GNUNET_MessageHeader *msg)
415 const struct MessageGetFragmentRequest *
416 req = (const struct MessageGetFragmentRequest *) msg;
418 sc = { .op_id = req->op_id, .client = client,
419 .channel_key = req->channel_key, .slave_key = req->slave_key,
420 .membership_test = req->do_membership_test };
422 int ret = db->message_get_fragment (db->cls, &req->channel_key,
423 GNUNET_ntohll (req->message_id),
424 GNUNET_ntohll (req->fragment_offset),
425 &send_fragment, &sc);
432 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
433 _("Failed to get message fragment!\n"));
436 send_result_code (client, req->op_id, ret, NULL);
437 GNUNET_SERVER_receive_done (client, GNUNET_OK);
442 handle_counters_get (void *cls,
443 struct GNUNET_SERVER_Client *client,
444 const struct GNUNET_MessageHeader *msg)
446 const struct OperationRequest *req = (const struct OperationRequest *) msg;
447 struct CountersResult res = { {0} };
449 int ret = db->counters_message_get (db->cls, &req->channel_key,
450 &res.max_fragment_id, &res.max_message_id,
451 &res.max_group_generation);
455 ret = db->counters_state_get (db->cls, &req->channel_key,
456 &res.max_state_message_id);
460 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
461 _("Failed to get master counters!\n"));
464 res.header.type = htons (GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_COUNTERS);
465 res.header.size = htons (sizeof (res));
466 res.result_code = htonl (ret - INT32_MIN);
467 res.op_id = req->op_id;
468 res.max_fragment_id = GNUNET_htonll (res.max_fragment_id);
469 res.max_message_id = GNUNET_htonll (res.max_message_id);
470 res.max_group_generation = GNUNET_htonll (res.max_group_generation);
471 res.max_state_message_id = GNUNET_htonll (res.max_state_message_id);
473 GNUNET_SERVER_notification_context_add (nc, client);
474 GNUNET_SERVER_notification_context_unicast (nc, client, &res.header,
477 GNUNET_SERVER_receive_done (client, GNUNET_OK);
481 /* FIXME: stop processing further state modify messages after an error */
483 handle_state_modify (void *cls,
484 struct GNUNET_SERVER_Client *client,
485 const struct GNUNET_MessageHeader *msg)
487 const struct StateModifyRequest *req
488 = (const struct StateModifyRequest *) msg;
490 int ret = GNUNET_SYSERR;
491 const char *name = (const char *) &req[1];
492 uint16_t name_size = ntohs (req->name_size);
494 if (name_size <= 2 || '\0' != name[name_size - 1])
496 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
497 _("Tried to set invalid state variable name!\n"));
504 if (req->flags & STATE_OP_FIRST)
506 ret = db->state_modify_begin (db->cls, &req->channel_key,
507 GNUNET_ntohll (req->message_id),
508 GNUNET_ntohll (req->state_delta));
510 if (ret != GNUNET_OK)
512 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
513 _("Failed to begin modifying state!\n"));
519 case GNUNET_ENV_OP_ASSIGN:
520 ret = db->state_modify_set (db->cls, &req->channel_key,
521 (const char *) &req[1],
522 name + ntohs (req->name_size),
523 ntohs (req->header.size) - sizeof (*req)
524 - ntohs (req->name_size));
528 ret = GNUNET_ENV_operation ((const char *) &req[1],
529 current_value, current_value_size,
530 req->oper, name + ntohs (req->name_size),
531 ntohs (req->header.size) - sizeof (*req)
532 - ntohs (req->name_size), &value, &value_size);
535 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
536 _("Unknown operator: %c\n"), req->oper);
540 if (GNUNET_OK == ret && req->flags & STATE_OP_LAST)
542 ret = db->state_modify_end (db->cls, &req->channel_key,
543 GNUNET_ntohll (req->message_id));
544 if (ret != GNUNET_OK)
545 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
546 _("Failed to end modifying state!\n"));
549 send_result_code (client, req->op_id, ret, NULL);
550 GNUNET_SERVER_receive_done (client, GNUNET_OK);
554 /* FIXME: stop processing further state sync messages after an error */
556 handle_state_sync (void *cls,
557 struct GNUNET_SERVER_Client *client,
558 const struct GNUNET_MessageHeader *msg)
560 const struct StateSyncRequest *req
561 = (const struct StateSyncRequest *) msg;
563 int ret = GNUNET_SYSERR;
564 const char *name = (const char *) &req[1];
565 uint16_t name_size = ntohs (req->name_size);
567 if (name_size <= 2 || '\0' != name[name_size - 1])
569 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
570 _("Tried to set invalid state variable name!\n"));
577 if (req->flags & STATE_OP_FIRST)
579 ret = db->state_sync_begin (db->cls, &req->channel_key);
581 if (ret != GNUNET_OK)
583 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
584 _("Failed to begin synchronizing state!\n"));
588 ret = db->state_sync_set (db->cls, &req->channel_key, name,
589 name + ntohs (req->name_size),
590 ntohs (req->header.size) - sizeof (*req)
591 - ntohs (req->name_size));
594 if (GNUNET_OK == ret && req->flags & STATE_OP_LAST)
596 ret = db->state_sync_end (db->cls, &req->channel_key,
597 GNUNET_ntohll (req->message_id));
598 if (ret != GNUNET_OK)
599 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
600 _("Failed to end synchronizing state!\n"));
603 send_result_code (client, req->op_id, ret, NULL);
604 GNUNET_SERVER_receive_done (client, GNUNET_OK);
609 handle_state_reset (void *cls,
610 struct GNUNET_SERVER_Client *client,
611 const struct GNUNET_MessageHeader *msg)
613 const struct OperationRequest *req =
614 (const struct OperationRequest *) msg;
616 int ret = db->state_reset (db->cls, &req->channel_key);
618 if (ret != GNUNET_OK)
619 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
620 _("Failed to reset state!\n"));
622 send_result_code (client, req->op_id, ret, NULL);
623 GNUNET_SERVER_receive_done (client, GNUNET_OK);
628 handle_state_hash_update (void *cls,
629 struct GNUNET_SERVER_Client *client,
630 const struct GNUNET_MessageHeader *msg)
632 const struct OperationRequest *req =
633 (const struct OperationRequest *) msg;
635 int ret = db->state_reset (db->cls, &req->channel_key);
637 if (ret != GNUNET_OK)
638 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
639 _("Failed to reset state!\n"));
641 send_result_code (client, req->op_id, ret, NULL);
642 GNUNET_SERVER_receive_done (client, GNUNET_OK);
647 handle_state_get (void *cls,
648 struct GNUNET_SERVER_Client *client,
649 const struct GNUNET_MessageHeader *msg)
651 const struct OperationRequest *req =
652 (const struct OperationRequest *) msg;
654 struct SendClosure sc = { .op_id = req->op_id, .client = client };
655 int64_t ret = GNUNET_SYSERR;
656 const char *name = (const char *) &req[1];
657 uint16_t name_size = ntohs (req->header.size) - sizeof (*req);
659 if (name_size <= 2 || '\0' != name[name_size - 1])
661 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
662 _("Tried to get invalid state variable name!\n"));
667 ret = db->state_get (db->cls, &req->channel_key, name,
668 &send_state_var, &sc);
669 if (GNUNET_NO == ret && name_size >= 5) /* min: _a_b\0 */
671 char *p, *n = GNUNET_malloc (name_size);
672 memcpy (n, name, name_size);
673 while (&n[1] < (p = strrchr (n, '_')) && GNUNET_NO == ret)
676 ret = db->state_get (db->cls, &req->channel_key, n,
677 &send_state_var, &sc);
688 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
689 _("Failed to get state variable!\n"));
692 send_result_code (client, req->op_id, ret, NULL);
693 GNUNET_SERVER_receive_done (client, GNUNET_OK);
698 handle_state_get_prefix (void *cls,
699 struct GNUNET_SERVER_Client *client,
700 const struct GNUNET_MessageHeader *msg)
702 const struct OperationRequest *req =
703 (const struct OperationRequest *) msg;
705 struct SendClosure sc = { .op_id = req->op_id, .client = client };
706 int64_t ret = GNUNET_SYSERR;
707 const char *name = (const char *) &req[1];
708 uint16_t name_size = ntohs (req->header.size) - sizeof (*req);
710 if (name_size <= 1 || '\0' != name[name_size - 1])
712 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
713 _("Tried to get invalid state variable name!\n"));
718 ret = db->state_get_prefix (db->cls, &req->channel_key, name,
719 &send_state_var, &sc);
727 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
728 _("Failed to get state variable!\n"));
731 send_result_code (client, req->op_id, ret, NULL);
732 GNUNET_SERVER_receive_done (client, GNUNET_OK);
737 * Initialize the PSYCstore service.
739 * @param cls Closure.
740 * @param server The initialized server.
741 * @param c Configuration to use.
744 run (void *cls, struct GNUNET_SERVER_Handle *server,
745 const struct GNUNET_CONFIGURATION_Handle *c)
747 static const struct GNUNET_SERVER_MessageHandler handlers[] = {
748 { &handle_membership_store, NULL,
749 GNUNET_MESSAGE_TYPE_PSYCSTORE_MEMBERSHIP_STORE,
750 sizeof (struct MembershipStoreRequest) },
752 { &handle_membership_test, NULL,
753 GNUNET_MESSAGE_TYPE_PSYCSTORE_MEMBERSHIP_TEST,
754 sizeof (struct MembershipTestRequest) },
756 { &handle_fragment_store, NULL,
757 GNUNET_MESSAGE_TYPE_PSYCSTORE_FRAGMENT_STORE, 0, },
759 { &handle_fragment_get, NULL,
760 GNUNET_MESSAGE_TYPE_PSYCSTORE_FRAGMENT_GET,
761 sizeof (struct FragmentGetRequest) },
763 { &handle_message_get, NULL,
764 GNUNET_MESSAGE_TYPE_PSYCSTORE_MESSAGE_GET,
765 sizeof (struct MessageGetRequest) },
767 { &handle_message_get_fragment, NULL,
768 GNUNET_MESSAGE_TYPE_PSYCSTORE_MESSAGE_GET_FRAGMENT,
769 sizeof (struct MessageGetFragmentRequest) },
771 { &handle_counters_get, NULL,
772 GNUNET_MESSAGE_TYPE_PSYCSTORE_COUNTERS_GET,
773 sizeof (struct OperationRequest) },
775 { &handle_state_modify, NULL,
776 GNUNET_MESSAGE_TYPE_PSYCSTORE_STATE_MODIFY, 0 },
778 { &handle_state_sync, NULL,
779 GNUNET_MESSAGE_TYPE_PSYCSTORE_STATE_SYNC, 0 },
781 { &handle_state_reset, NULL,
782 GNUNET_MESSAGE_TYPE_PSYCSTORE_STATE_RESET,
783 sizeof (struct OperationRequest) },
785 { &handle_state_hash_update, NULL,
786 GNUNET_MESSAGE_TYPE_PSYCSTORE_STATE_HASH_UPDATE,
787 sizeof (struct StateHashUpdateRequest) },
789 { &handle_state_get, NULL,
790 GNUNET_MESSAGE_TYPE_PSYCSTORE_STATE_GET, 0 },
792 { &handle_state_get_prefix, NULL,
793 GNUNET_MESSAGE_TYPE_PSYCSTORE_STATE_GET_PREFIX, 0 },
800 /* Loading database plugin */
803 GNUNET_CONFIGURATION_get_value_string (cfg, "psycstore", "database",
806 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No database backend configured\n");
810 GNUNET_asprintf (&db_lib_name, "libgnunet_plugin_psycstore_%s", database);
811 db = GNUNET_PLUGIN_load (db_lib_name, (void *) cfg);
812 GNUNET_free (database);
816 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
817 "Could not load database backend `%s'\n",
819 GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
823 stats = GNUNET_STATISTICS_create ("psycstore", cfg);
824 GNUNET_SERVER_add_handlers (server, handlers);
825 nc = GNUNET_SERVER_notification_context_create (server, 1);
826 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
832 * The main function for the service.
834 * @param argc number of arguments from the command line
835 * @param argv command line arguments
836 * @return 0 ok, 1 on error
839 main (int argc, char *const *argv)
842 GNUNET_SERVICE_run (argc, argv, "psycstore",
843 GNUNET_SERVICE_OPTION_NONE,
844 &run, NULL)) ? 0 : 1;
848 /* end of gnunet-service-psycstore.c */