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 2, 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 set/gnunet-service-set.c
23 * @brief two-peer set operations
24 * @author Florian Dold
26 #include "gnunet-service-set.h"
27 #include "set_protocol.h"
31 * Peer that has connected to us, but is not yet evaluating a set operation.
32 * Once the peer has sent a request, and the client has
33 * accepted or rejected it, this information will be deleted.
38 * Incoming peers are held in a linked list
40 struct Incoming *next;
43 * Incoming peers are held in a linked list
45 struct Incoming *prev;
48 * Detail information about the operation.
50 struct OperationSpecification *spec;
53 * The identity of the requesting peer.
55 struct GNUNET_PeerIdentity peer;
60 struct GNUNET_MESH_Tunnel *tunnel;
63 * Unique request id for the request from
64 * a remote peer, sent to the client, which will
65 * accept or reject the request.
66 * Set to '0' iff the request has not been
72 * Timeout task, if the incoming peer has not been accepted
73 * after the timeout, it will be disconnected.
75 GNUNET_SCHEDULER_TaskIdentifier timeout_task;
78 * Tunnel context, needs to be stored here as a client's accept will change
81 struct TunnelContext *tc;
86 * Configuration of our local peer.
87 * (Not declared 'static' as also needed in gnunet-service-set_union.c)
89 const struct GNUNET_CONFIGURATION_Handle *configuration;
92 * Handle to the mesh service, used
93 * to listen for and connect to remote peers.
94 * (Not declared 'static' as also needed in gnunet-service-set_union.c)
96 struct GNUNET_MESH_Handle *mesh;
99 * Sets are held in a doubly linked list.
101 static struct Set *sets_head;
104 * Sets are held in a doubly linked list.
106 static struct Set *sets_tail;
109 * Listeners are held in a doubly linked list.
111 static struct Listener *listeners_head;
114 * Listeners are held in a doubly linked list.
116 static struct Listener *listeners_tail;
119 * Incoming sockets from remote peers are
120 * held in a doubly linked list.
122 static struct Incoming *incoming_head;
125 * Incoming sockets from remote peers are
126 * held in a doubly linked list.
128 static struct Incoming *incoming_tail;
131 * Counter for allocating unique IDs for clients,
132 * used to identify incoming operation requests from remote peers,
133 * that the client can choose to accept or refuse.
135 static uint32_t suggest_id = 1;
139 * Get set that is owned by the given client, if any.
141 * @param client client to look for
142 * @return set that the client owns, NULL if the client
146 set_get (struct GNUNET_SERVER_Client *client)
150 for (set = sets_head; NULL != set; set = set->next)
151 if (set->client == client)
158 * Get the listener associated with the given client, if any.
160 * @param client the client
161 * @return listener associated with the client, NULL
164 static struct Listener *
165 listener_get (struct GNUNET_SERVER_Client *client)
167 struct Listener *listener;
169 for (listener = listeners_head; NULL != listener; listener = listener->next)
170 if (listener->client == client)
177 * Get the incoming socket associated with the given id.
179 * @param id id to look for
180 * @return the incoming socket associated with the id,
181 * or NULL if there is none
183 static struct Incoming *
184 get_incoming (uint32_t id)
186 struct Incoming *incoming;
188 for (incoming = incoming_head; NULL != incoming; incoming = incoming->next)
189 if (incoming->suggest_id == id)
196 * Destroy a listener, free all resources associated with it.
198 * @param listener listener to destroy
201 listener_destroy (struct Listener *listener)
203 /* If the client is not dead yet, destroy it.
204 * The client's destroy callback will destroy the listener again. */
205 if (NULL != listener->client)
207 GNUNET_SERVER_client_disconnect (listener->client);
208 listener->client = NULL;
211 if (NULL != listener->client_mq)
213 GNUNET_MQ_destroy (listener->client_mq);
214 listener->client_mq = NULL;
216 GNUNET_CONTAINER_DLL_remove (listeners_head, listeners_tail, listener);
217 GNUNET_free (listener);
222 * Destroy a set, and free all resources associated with it.
224 * @param set the set to destroy
227 set_destroy (struct Set *set)
229 /* If the client is not dead yet, destroy it.
230 * The client's destroy callback will destroy the set again. */
231 if (NULL != set->client)
233 GNUNET_SERVER_client_disconnect (set->client);
237 switch (set->operation)
239 case GNUNET_SET_OPERATION_INTERSECTION:
242 case GNUNET_SET_OPERATION_UNION:
243 _GSS_union_set_destroy (set);
249 GNUNET_CONTAINER_DLL_remove (sets_head, sets_tail, set);
255 * Clean up after a client after it is
256 * disconnected (either by us or by itself)
258 * @param cls closure, unused
259 * @param client the client to clean up after
262 handle_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client)
265 struct Listener *listener;
267 set = set_get (client);
273 listener = listener_get (client);
274 if (NULL != listener)
276 listener->client = NULL;
277 listener_destroy (listener);
283 * Destroy an incoming request from a remote peer
285 * @param incoming remote request to destroy
288 incoming_destroy (struct Incoming *incoming)
290 if (NULL != incoming->tunnel)
292 struct GNUNET_MESH_Tunnel *t = incoming->tunnel;
293 incoming->tunnel = NULL;
294 GNUNET_MESH_tunnel_destroy (t);
297 GNUNET_CONTAINER_DLL_remove (incoming_head, incoming_tail, incoming);
298 GNUNET_free (incoming);
302 static struct Listener *
303 listener_get_by_target (enum GNUNET_SET_OperationType op,
304 const struct GNUNET_HashCode *app_id)
308 for (l = listeners_head; NULL != l; l = l->next)
310 if (l->operation != op)
312 if (0 != GNUNET_CRYPTO_hash_cmp (app_id, &l->app_id))
321 * Suggest the given request to the listener,
322 * who can accept or reject the request.
324 * @param incoming the incoming peer with the request to suggest
325 * @param listener the listener to suggest the request to
328 incoming_suggest (struct Incoming *incoming, struct Listener *listener)
330 struct GNUNET_MQ_Envelope *mqm;
331 struct GNUNET_SET_RequestMessage *cmsg;
333 GNUNET_assert (0 == incoming->suggest_id);
334 GNUNET_assert (NULL != incoming->spec);
335 incoming->suggest_id = suggest_id++;
337 GNUNET_SCHEDULER_cancel (incoming->timeout_task);
338 mqm = GNUNET_MQ_msg_nested_mh (cmsg, GNUNET_MESSAGE_TYPE_SET_REQUEST,
339 incoming->spec->context_msg);
340 GNUNET_assert (NULL != mqm);
341 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "suggesting request with accept id %u\n", incoming->suggest_id);
342 cmsg->accept_id = htonl (incoming->suggest_id);
343 cmsg->peer_id = incoming->spec->peer;
344 GNUNET_MQ_send (listener->client_mq, mqm);
350 * Handle a request for a set operation from
353 * @param cls the incoming socket
354 * @param tunnel the tunnel that sent the message
355 * @param tunnel_ctx the tunnel context
356 * @param mh the message
359 handle_p2p_operation_request (void *cls,
360 struct GNUNET_MESH_Tunnel *tunnel,
362 const struct GNUNET_MessageHeader *mh)
364 struct TunnelContext *tc = *tunnel_ctx;
365 struct Incoming *incoming;
366 const struct OperationRequestMessage *msg = (const struct OperationRequestMessage *) mh;
367 struct Listener *listener;
368 struct OperationSpecification *spec;
370 if (CONTEXT_INCOMING != tc->type)
372 /* unexpected request */
374 /* kill the tunnel, cleaner will be called */
375 return GNUNET_SYSERR;
378 incoming = tc->data.incoming;
380 if (NULL != incoming->spec)
382 /* double operation request */
384 return GNUNET_SYSERR;
387 spec = GNUNET_new (struct OperationSpecification);
389 GNUNET_copy_message (GNUNET_MQ_extract_nested_mh (msg));
390 spec->operation = ntohl (msg->operation);
391 spec->app_id = msg->app_id;
392 spec->salt = ntohl (msg->salt);
393 spec->peer = incoming->peer;
395 incoming->spec = spec;
397 if ( (NULL != spec->context_msg) &&
398 (ntohs (spec->context_msg->size) > GNUNET_SET_CONTEXT_MESSAGE_MAX_SIZE) )
401 return GNUNET_SYSERR;
404 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "received P2P operation request (op %u, app %s)\n",
405 ntohs (msg->operation), GNUNET_h2s (&msg->app_id));
406 listener = listener_get_by_target (ntohs (msg->operation), &msg->app_id);
407 if (NULL == listener)
409 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
410 "no listener matches incoming request, waiting with timeout\n");
413 incoming_suggest (incoming, listener);
419 * Called when a client wants to create a new set.
422 * @param client client that sent the message
423 * @param m message sent by the client
426 handle_client_create (void *cls,
427 struct GNUNET_SERVER_Client *client,
428 const struct GNUNET_MessageHeader *m)
430 struct GNUNET_SET_CreateMessage *msg = (struct GNUNET_SET_CreateMessage *) m;
433 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "client created new set (operation %u)\n",
434 ntohs (msg->operation));
436 if (NULL != set_get (client))
439 GNUNET_SERVER_client_disconnect (client);
445 switch (ntohs (msg->operation))
447 case GNUNET_SET_OPERATION_INTERSECTION:
448 //set = _GSS_intersection_set_create ();
450 case GNUNET_SET_OPERATION_UNION:
451 set = _GSS_union_set_create ();
455 GNUNET_SERVER_client_disconnect (client);
459 GNUNET_assert (NULL != set);
461 set->client = client;
462 set->client_mq = GNUNET_MQ_queue_for_server_client (client);
463 GNUNET_CONTAINER_DLL_insert (sets_head, sets_tail, set);
464 GNUNET_SERVER_receive_done (client, GNUNET_OK);
469 * Called when a client wants to create a new listener.
472 * @param client client that sent the message
473 * @param m message sent by the client
476 handle_client_listen (void *cls,
477 struct GNUNET_SERVER_Client *client,
478 const struct GNUNET_MessageHeader *m)
480 struct GNUNET_SET_ListenMessage *msg = (struct GNUNET_SET_ListenMessage *) m;
481 struct Listener *listener;
482 struct Incoming *incoming;
484 if (NULL != listener_get (client))
487 GNUNET_SERVER_client_disconnect (client);
490 listener = GNUNET_new (struct Listener);
491 listener->client = client;
492 listener->client_mq = GNUNET_MQ_queue_for_server_client (client);
493 listener->app_id = msg->app_id;
494 listener->operation = ntohs (msg->operation);
495 GNUNET_CONTAINER_DLL_insert_tail (listeners_head, listeners_tail, listener);
496 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "new listener created (op %u, app %s)\n",
497 listener->operation, GNUNET_h2s (&listener->app_id));
498 for (incoming = incoming_head; NULL != incoming; incoming = incoming->next)
500 if ( (NULL == incoming->spec) ||
501 (0 != incoming->suggest_id) )
503 if (listener->operation != incoming->spec->operation)
505 if (0 != GNUNET_CRYPTO_hash_cmp (&listener->app_id, &incoming->spec->app_id))
507 incoming_suggest (incoming, listener);
509 GNUNET_SERVER_receive_done (client, GNUNET_OK);
514 * Called when a client wants to remove an element
515 * from the set it inhabits.
518 * @param client client that sent the message
519 * @param m message sent by the client
522 handle_client_remove (void *cls,
523 struct GNUNET_SERVER_Client *client,
524 const struct GNUNET_MessageHeader *m)
528 set = set_get (client);
532 GNUNET_SERVER_client_disconnect (client);
535 switch (set->operation)
537 case GNUNET_SET_OPERATION_UNION:
538 _GSS_union_remove ((struct GNUNET_SET_ElementMessage *) m, set);
540 case GNUNET_SET_OPERATION_INTERSECTION:
541 //_GSS_intersection_remove ((struct GNUNET_SET_ElementMessage *) m, set);
548 GNUNET_SERVER_receive_done (client, GNUNET_OK);
554 * Called when the client wants to reject an operation
555 * request from another peer.
558 * @param client client that sent the message
559 * @param m message sent by the client
562 handle_client_reject (void *cls,
563 struct GNUNET_SERVER_Client *client,
564 const struct GNUNET_MessageHeader *m)
566 struct Incoming *incoming;
567 struct GNUNET_SET_AcceptRejectMessage *msg = (struct GNUNET_SET_AcceptRejectMessage *) m;
569 GNUNET_break (0 == ntohl (msg->request_id));
571 incoming = get_incoming (ntohl (msg->accept_reject_id));
572 if (NULL == incoming)
574 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
577 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "peer request rejected by client\n");
578 GNUNET_MESH_tunnel_destroy (incoming->tunnel);
579 GNUNET_SERVER_receive_done (client, GNUNET_OK);
585 * Called when a client wants to add an element to a
589 * @param client client that sent the message
590 * @param m message sent by the client
593 handle_client_add (void *cls,
594 struct GNUNET_SERVER_Client *client,
595 const struct GNUNET_MessageHeader *m)
599 set = set_get (client);
603 GNUNET_SERVER_client_disconnect (client);
606 switch (set->operation)
608 case GNUNET_SET_OPERATION_UNION:
609 _GSS_union_add ((struct GNUNET_SET_ElementMessage *) m, set);
611 case GNUNET_SET_OPERATION_INTERSECTION:
612 //_GSS_intersection_add ((struct GNUNET_SET_ElementMessage *) m, set);
619 GNUNET_SERVER_receive_done (client, GNUNET_OK);
624 * Called when a client wants to evaluate a set operation with another peer.
627 * @param client client that sent the message
628 * @param m message sent by the client
631 handle_client_evaluate (void *cls,
632 struct GNUNET_SERVER_Client *client,
633 const struct GNUNET_MessageHeader *m)
636 struct TunnelContext *tc;
637 struct GNUNET_MESH_Tunnel *tunnel;
638 struct GNUNET_SET_EvaluateMessage *msg;
639 struct OperationSpecification *spec;
641 set = set_get (client);
645 GNUNET_SERVER_client_disconnect (client);
649 msg = (struct GNUNET_SET_EvaluateMessage *) m;
650 tc = GNUNET_new (struct TunnelContext);
651 spec = GNUNET_new (struct OperationSpecification);
652 spec->operation = set->operation;
653 spec->app_id = msg->app_id;
654 spec->salt = ntohl (msg->salt);
655 spec->peer = msg->target_peer;
657 tunnel = GNUNET_MESH_tunnel_create (mesh, tc, &msg->target_peer,
658 GNUNET_APPLICATION_TYPE_SET,
662 switch (set->operation)
664 case GNUNET_SET_OPERATION_INTERSECTION:
665 tc->type = CONTEXT_OPERATION_INTERSECTION;
666 //_GSS_intersection_evaluate ((struct GNUNET_SET_EvaluateMessage *) m, set);
668 case GNUNET_SET_OPERATION_UNION:
669 tc->type = CONTEXT_OPERATION_UNION;
671 _GSS_union_evaluate (spec, tunnel);
678 GNUNET_SERVER_receive_done (client, GNUNET_OK);
683 * Handle an ack from a client.
686 * @param client the client
687 * @param m the message
690 handle_client_ack (void *cls,
691 struct GNUNET_SERVER_Client *client,
692 const struct GNUNET_MessageHeader *m)
694 /* FIXME: implement */
695 GNUNET_SERVER_receive_done (client, GNUNET_OK);
700 * Handle a request from the client to accept
701 * a set operation that came from a remote peer.
704 * @param client the client
705 * @param mh the message
708 handle_client_accept (void *cls,
709 struct GNUNET_SERVER_Client *client,
710 const struct GNUNET_MessageHeader *mh)
713 struct Incoming *incoming;
714 struct GNUNET_SET_AcceptRejectMessage *msg = (struct GNUNET_SET_AcceptRejectMessage *) mh;
715 struct OperationSpecification *spec;
716 struct TunnelContext *tc;
718 incoming = get_incoming (ntohl (msg->accept_reject_id));
720 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "client accepting %u\n", ntohl (msg->accept_reject_id));
722 if (NULL == incoming)
726 GNUNET_SERVER_client_disconnect (client);
730 set = set_get (client);
735 GNUNET_SERVER_client_disconnect (client);
739 spec = GNUNET_new (struct OperationSpecification);
742 switch (set->operation)
744 case GNUNET_SET_OPERATION_INTERSECTION:
745 tc->type = CONTEXT_OPERATION_INTERSECTION;
746 // _GSS_intersection_accept (msg, set, incoming);
748 case GNUNET_SET_OPERATION_UNION:
749 tc->type = CONTEXT_OPERATION_UNION;
750 tc->data.union_op = _GSS_union_accept (spec, incoming->tunnel);
757 /* tunnel ownership goes to operation */
758 incoming->tunnel = NULL;
759 incoming_destroy (incoming);
760 GNUNET_SERVER_receive_done (client, GNUNET_OK);
765 * Called to clean up, after a shutdown has been requested.
768 * @param tc context information (why was this task triggered now)
771 shutdown_task (void *cls,
772 const struct GNUNET_SCHEDULER_TaskContext *tc)
776 GNUNET_MESH_disconnect (mesh);
780 while (NULL != incoming_head)
781 incoming_destroy (incoming_head);
783 while (NULL != listeners_head)
784 listener_destroy (listeners_head);
786 while (NULL != sets_head)
787 set_destroy (sets_head);
789 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "handled shutdown request\n");
795 * Signature of the main function of a task.
798 * @param tc context information (why was this task triggered now)
801 incoming_timeout_cb (void *cls,
802 const struct GNUNET_SCHEDULER_TaskContext *tc)
804 struct Incoming *incoming = cls;
806 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "remote peer timed out\n");
807 incoming_destroy (incoming);
812 * Method called whenever another peer has added us to a tunnel
813 * the other peer initiated.
814 * Only called (once) upon reception of data with a message type which was
815 * subscribed to in GNUNET_MESH_connect. A call to GNUNET_MESH_tunnel_destroy
816 * causes te tunnel to be ignored and no further notifications are sent about
820 * @param tunnel new handle to the tunnel
821 * @param initiator peer that started the tunnel
822 * @param port Port this tunnel is for.
823 * @return initial tunnel context for the tunnel
824 * (can be NULL -- that's not an error)
827 tunnel_new_cb (void *cls,
828 struct GNUNET_MESH_Tunnel *tunnel,
829 const struct GNUNET_PeerIdentity *initiator,
832 struct Incoming *incoming;
833 struct TunnelContext *tc;
835 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "new incoming tunnel\n");
837 GNUNET_assert (port == GNUNET_APPLICATION_TYPE_SET);
838 tc = GNUNET_new (struct TunnelContext);
839 incoming = GNUNET_new (struct Incoming);
840 incoming->peer = *initiator;
841 incoming->tunnel = tunnel;
843 tc->data.incoming = incoming;
844 tc->type = CONTEXT_INCOMING;
845 incoming->timeout_task =
846 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, incoming_timeout_cb, incoming);
847 GNUNET_CONTAINER_DLL_insert_tail (incoming_head, incoming_tail, incoming);
854 * Function called whenever a tunnel is destroyed. Should clean up
855 * any associated state.
856 * GNUNET_MESH_tunnel_destroy. It must NOT call GNUNET_MESH_tunnel_destroy on
859 * @param cls closure (set from GNUNET_MESH_connect)
860 * @param tunnel connection to the other end (henceforth invalid)
861 * @param tunnel_ctx place where local state associated
862 * with the tunnel is stored
865 tunnel_end_cb (void *cls,
866 const struct GNUNET_MESH_Tunnel *tunnel, void *tunnel_ctx)
868 struct TunnelContext *ctx = tunnel_ctx;
872 case CONTEXT_INCOMING:
873 incoming_destroy (ctx->data.incoming);
875 case CONTEXT_OPERATION_UNION:
876 _GSS_union_operation_destroy (ctx->data.union_op);
878 case CONTEXT_OPERATION_INTERSECTION:
886 GNUNET_free (tunnel_ctx);
891 * Function called by the service's run
892 * method to run service-specific setup code.
895 * @param server the initialized server
896 * @param cfg configuration to use
899 run (void *cls, struct GNUNET_SERVER_Handle *server,
900 const struct GNUNET_CONFIGURATION_Handle *cfg)
902 static const struct GNUNET_SERVER_MessageHandler server_handlers[] = {
903 {handle_client_accept, NULL, GNUNET_MESSAGE_TYPE_SET_ACCEPT, 0},
904 {handle_client_ack, NULL, GNUNET_MESSAGE_TYPE_SET_ACK, 0},
905 {handle_client_add, NULL, GNUNET_MESSAGE_TYPE_SET_ADD, 0},
906 {handle_client_create, NULL, GNUNET_MESSAGE_TYPE_SET_CREATE, 0},
907 {handle_client_evaluate, NULL, GNUNET_MESSAGE_TYPE_SET_EVALUATE, 0},
908 {handle_client_listen, NULL, GNUNET_MESSAGE_TYPE_SET_LISTEN, 0},
909 {handle_client_reject, NULL, GNUNET_MESSAGE_TYPE_SET_REJECT, 0},
910 {handle_client_remove, NULL, GNUNET_MESSAGE_TYPE_SET_REMOVE, 0},
913 static const struct GNUNET_MESH_MessageHandler mesh_handlers[] = {
914 {handle_p2p_operation_request,
915 GNUNET_MESSAGE_TYPE_SET_P2P_OPERATION_REQUEST, 0},
916 /* messages for the union operation */
917 {_GSS_union_handle_p2p_message,
918 GNUNET_MESSAGE_TYPE_SET_P2P_IBF, 0},
919 {_GSS_union_handle_p2p_message,
920 GNUNET_MESSAGE_TYPE_SET_P2P_ELEMENTS, 0},
921 {_GSS_union_handle_p2p_message,
922 GNUNET_MESSAGE_TYPE_SET_P2P_DONE, 0},
923 {_GSS_union_handle_p2p_message,
924 GNUNET_MESSAGE_TYPE_SET_P2P_ELEMENT_REQUESTS, 0},
925 {_GSS_union_handle_p2p_message,
926 GNUNET_MESSAGE_TYPE_SET_P2P_SE, 0},
927 /* FIXME: messages for intersection operation */
930 static const uint32_t mesh_ports[] = {GNUNET_APPLICATION_TYPE_SET, 0};
933 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
934 &shutdown_task, NULL);
935 GNUNET_SERVER_disconnect_notify (server, &handle_client_disconnect, NULL);
936 GNUNET_SERVER_add_handlers (server, server_handlers);
938 mesh = GNUNET_MESH_connect (cfg, NULL, tunnel_new_cb, tunnel_end_cb,
939 mesh_handlers, mesh_ports);
942 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "could not connect to mesh\n");
946 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "service started\n");
951 * The main function for the set service.
953 * @param argc number of arguments from the command line
954 * @param argv command line arguments
955 * @return 0 ok, 1 on error
958 main (int argc, char *const *argv)
961 ret = GNUNET_SERVICE_run (argc, argv, "set",
962 GNUNET_SERVICE_OPTION_NONE, &run, NULL);
963 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "exit\n");
964 return (GNUNET_OK == ret) ? 0 : 1;