2 This file is part of GNUnet.
3 (C) 2009, 2010, 2011 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.
24 * - Write xquery and block plugin
25 * - The smaller FIXME issues all around
27 * @file gns/gnunet-service-gns.c
28 * @brief GNUnet GNS service
29 * @author Martin Schanzenbach
32 #include "gnunet_util_lib.h"
33 #include "gnunet_transport_service.h"
34 #include "gnunet_dns_service.h"
35 #include "gnunet_dnsparser_lib.h"
36 #include "gnunet_dht_service.h"
37 #include "gnunet_namestore_service.h"
38 #include "gnunet_gns_service.h"
39 #include "block_gns.h"
41 #include "gnunet-service-gns_resolver.h"
42 #include "gnunet-service-gns_interceptor.h"
44 /* FIXME move to proper header in include */
45 #define GNUNET_MESSAGE_TYPE_GNS_LOOKUP 23
46 #define GNUNET_MESSAGE_TYPE_GNS_LOOKUP_RESULT 24
47 #define GNUNET_MESSAGE_TYPE_GNS_SHORTEN 25
48 #define GNUNET_MESSAGE_TYPE_GNS_SHORTEN_RESULT 26
49 #define GNUNET_MESSAGE_TYPE_GNS_GET_AUTH 27
50 #define GNUNET_MESSAGE_TYPE_GNS_GET_AUTH_RESULT 28
54 * Handle to a shorten operation from api
56 struct ClientShortenHandle
58 /* the requesting client that */
59 struct GNUNET_SERVER_Client *client;
65 enum GNUNET_GNS_RecordType type;
74 * Handle to a get auhtority operation from api
76 struct ClientGetAuthHandle
78 /* the requesting client that */
79 struct GNUNET_SERVER_Client *client;
84 /* name to lookup authority */
91 * Handle to a lookup operation from api
93 struct ClientLookupHandle
95 /* the requesting client that */
96 struct GNUNET_SERVER_Client *client;
102 enum GNUNET_GNS_RecordType type;
104 /* the name to look up */
105 char* name; //Needed?
109 * Our handle to the DHT
111 static struct GNUNET_DHT_Handle *dht_handle;
114 * Our zone's private key
116 struct GNUNET_CRYPTO_RsaPrivateKey *zone_key;
119 * Our handle to the namestore service
120 * FIXME maybe need a second handle for iteration
122 struct GNUNET_NAMESTORE_Handle *namestore_handle;
125 * Handle to iterate over our authoritative zone in namestore
127 struct GNUNET_NAMESTORE_ZoneIterator *namestore_iter;
130 * The configuration the GNS service is running with
132 const struct GNUNET_CONFIGURATION_Handle *GNS_cfg;
135 * Our notification context.
137 static struct GNUNET_SERVER_NotificationContext *nc;
142 struct GNUNET_CRYPTO_ShortHashCode zone_hash;
145 * Useful for zone update for DHT put
147 static int num_public_records = 3600;
149 /* dht update interval FIXME define? */
150 static struct GNUNET_TIME_Relative dht_update_interval;
152 /* zone update task */
153 GNUNET_SCHEDULER_TaskIdentifier zone_update_taskid = GNUNET_SCHEDULER_NO_TASK;
155 /* automatic pkey import for name shortening */
156 static int auto_import_pkey;
159 * Task run during shutdown.
165 shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
168 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
170 /* Kill zone task for it may make the scheduler hang */
171 if (zone_update_taskid)
172 GNUNET_SCHEDULER_cancel(zone_update_taskid);
174 GNUNET_SERVER_notification_context_destroy (nc);
176 gns_interceptor_stop();
178 GNUNET_NAMESTORE_disconnect(namestore_handle, 1);
179 GNUNET_DHT_disconnect(dht_handle);
184 * Method called periodicattluy that triggers
185 * iteration over root zone
188 * @param tc task context
191 update_zone_dht_next(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
193 GNUNET_NAMESTORE_zone_iterator_next(namestore_iter);
197 * Continuation for DHT put
200 * @param tc task context
203 record_dht_put(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
205 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "put request transmitted\n");
210 update_zone_dht_start(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
213 * Function used to put all records successively into the DHT.
215 * @param cls the closure (NULL)
216 * @param key the public key of the authority (ours)
217 * @param expiration lifetime of the namestore entry
218 * @param name the name of the records
219 * @param rd_count the number of records in data
220 * @param rd the record data
221 * @param signature the signature for the record data
224 put_gns_record(void *cls,
225 const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *key,
226 struct GNUNET_TIME_Absolute expiration,
228 unsigned int rd_count,
229 const struct GNUNET_NAMESTORE_RecordData *rd,
230 const struct GNUNET_CRYPTO_RsaSignature *signature)
233 struct GNSNameRecordBlock *nrb;
234 struct GNUNET_CRYPTO_ShortHashCode name_hash;
235 GNUNET_HashCode xor_hash;
236 GNUNET_HashCode name_hash_double;
237 GNUNET_HashCode zone_hash_double;
238 struct GNUNET_CRYPTO_HashAsciiEncoded xor_hash_string;
239 uint32_t rd_payload_length;
240 char* nrb_data = NULL;
246 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
247 "Zone iteration finished. Rescheduling put in %ds\n",
248 GNUNET_GNS_DHT_MAX_UPDATE_INTERVAL);
249 zone_update_taskid = GNUNET_SCHEDULER_add_delayed (
250 GNUNET_TIME_relative_multiply(
251 GNUNET_TIME_UNIT_SECONDS,
252 GNUNET_GNS_DHT_MAX_UPDATE_INTERVAL
254 &update_zone_dht_start,
259 namelen = strlen(name) + 1;
261 if (signature == NULL)
263 GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
264 "No signature for %s record data provided! Skipping...\n",
266 zone_update_taskid = GNUNET_SCHEDULER_add_now (&update_zone_dht_next,
272 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
273 "Putting records for %s into the DHT\n", name);
275 rd_payload_length = GNUNET_NAMESTORE_records_get_size (rd_count, rd);
277 nrb = GNUNET_malloc(rd_payload_length + namelen
278 + sizeof(struct GNSNameRecordBlock));
280 nrb->signature = *signature;
282 nrb->public_key = *key;
284 nrb->rd_count = htonl(rd_count);
286 memcpy(&nrb[1], name, namelen);
288 nrb_data = (char*)&nrb[1];
291 rd_payload_length += sizeof(struct GNSNameRecordBlock) + namelen;
293 if (-1 == GNUNET_NAMESTORE_records_serialize (rd_count,
298 GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
299 "Record serialization failed! Skipping...\n");
301 zone_update_taskid = GNUNET_SCHEDULER_add_now (&update_zone_dht_next,
308 * calculate DHT key: H(name) xor H(pubkey)
310 GNUNET_CRYPTO_short_hash(name, strlen(name), &name_hash);
311 GNUNET_CRYPTO_short_hash_double (&name_hash, &name_hash_double);
312 GNUNET_CRYPTO_short_hash_double (&zone_hash, &zone_hash_double);
313 GNUNET_CRYPTO_hash_xor(&zone_hash_double, &name_hash_double, &xor_hash);
314 GNUNET_CRYPTO_hash_to_enc (&xor_hash, &xor_hash_string);
316 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
317 "putting records for %s under key: %s with size %d\n",
318 name, (char*)&xor_hash_string, rd_payload_length);
320 GNUNET_DHT_put (dht_handle, &xor_hash,
321 DHT_GNS_REPLICATION_LEVEL,
323 GNUNET_BLOCK_TYPE_GNS_NAMERECORD,
327 DHT_OPERATION_TIMEOUT,
329 NULL); //cls for cont
331 num_public_records++;
334 * Reschedule periodic put
336 zone_update_taskid = GNUNET_SCHEDULER_add_delayed (dht_update_interval,
337 &update_zone_dht_next,
345 * Periodically iterate over our zone and store everything in dht
348 * @param tc task context
351 update_zone_dht_start(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
353 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Scheduling DHT zone update!\n");
354 if (0 == num_public_records)
356 dht_update_interval = GNUNET_TIME_relative_multiply(
357 GNUNET_TIME_UNIT_SECONDS,
358 GNUNET_GNS_DHT_MAX_UPDATE_INTERVAL);
359 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
360 "No records in db. Adjusted DHT update interval to %ds\n",
361 GNUNET_GNS_DHT_MAX_UPDATE_INTERVAL);
366 dht_update_interval = GNUNET_TIME_relative_multiply(
367 GNUNET_TIME_UNIT_SECONDS,
368 (3600/num_public_records));
369 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
370 "Adjusted DHT update interval to %ds!\n",
371 (3600/num_public_records));
374 /* start counting again */
375 num_public_records = 0;
376 namestore_iter = GNUNET_NAMESTORE_zone_iteration_start (namestore_handle,
378 GNUNET_NAMESTORE_RF_AUTHORITY,
379 GNUNET_NAMESTORE_RF_PRIVATE,
385 /* END DHT ZONE PROPAGATION */
388 * Send shorten response back to client
390 * @param name the shortened name result or NULL if cannot be shortened
391 * @param csh the handle to the shorten request
394 send_shorten_response(void* cls, const char* name)
396 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending `%s' message with %s\n",
397 "SHORTEN_RESULT", name);
398 struct GNUNET_GNS_ClientShortenResultMessage *rmsg;
399 struct ClientShortenHandle *csh = (struct ClientShortenHandle *)cls;
406 rmsg = GNUNET_malloc(sizeof(struct GNUNET_GNS_ClientShortenResultMessage)
409 rmsg->id = csh->unique_id;
410 rmsg->header.type = htons(GNUNET_MESSAGE_TYPE_GNS_SHORTEN_RESULT);
412 htons(sizeof(struct GNUNET_GNS_ClientShortenResultMessage) +
415 strcpy((char*)&rmsg[1], name);
417 GNUNET_SERVER_notification_context_unicast (nc, csh->client,
418 (const struct GNUNET_MessageHeader *) rmsg,
420 GNUNET_SERVER_receive_done (csh->client, GNUNET_OK);
423 GNUNET_free_non_null(csh->name);
429 * Handle a shorten message from the api
431 * @param cls the closure
432 * @param client the client
433 * @param message the message
435 static void handle_shorten(void *cls,
436 struct GNUNET_SERVER_Client * client,
437 const struct GNUNET_MessageHeader * message)
439 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n", "SHORTEN");
442 struct ClientShortenHandle *csh;
445 if (ntohs (message->size) < sizeof (struct GNUNET_GNS_ClientShortenMessage))
448 GNUNET_SERVER_receive_done (client, GNUNET_OK);
452 GNUNET_SERVER_notification_context_add (nc, client);
454 struct GNUNET_GNS_ClientShortenMessage *sh_msg =
455 (struct GNUNET_GNS_ClientShortenMessage *) message;
457 msg_size = ntohs(message->size);
459 if (msg_size > GNUNET_SERVER_MAX_MESSAGE_SIZE)
462 GNUNET_SERVER_receive_done (client, GNUNET_OK);
466 csh = GNUNET_malloc(sizeof(struct ClientShortenHandle));
467 csh->client = client;
468 csh->unique_id = sh_msg->id;
470 name = (char*)&sh_msg[1];
472 if (strlen (name) < strlen(GNUNET_GNS_TLD)) {
474 send_shorten_response(csh, name);
478 if (strcmp(name+strlen(name)-strlen(GNUNET_GNS_TLD),
479 GNUNET_GNS_TLD) != 0)
481 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
482 "%s is not our domain. Returning\n", name);
484 send_shorten_response(csh, name);
488 csh->name = GNUNET_malloc(strlen(name)
489 - strlen(GNUNET_GNS_TLD) + 1);
491 strlen(name)-strlen(GNUNET_GNS_TLD) + 1);
492 memcpy(csh->name, name,
493 strlen(name)-strlen(GNUNET_GNS_TLD));
495 /* Start shortening */
496 gns_resolver_shorten_name(zone_hash, name, &send_shorten_response, csh);
501 * Send get authority response back to client
503 * @param name the shortened name result or NULL if cannot be shortened
504 * @param cah the handle to the get authority request
507 send_get_auth_response(void *cls, const char* name)
509 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending `%s' message with %s\n",
510 "GET_AUTH_RESULT", name);
511 struct GNUNET_GNS_ClientGetAuthResultMessage *rmsg;
512 struct ClientGetAuthHandle *cah = (struct ClientGetAuthHandle *)cls;
519 rmsg = GNUNET_malloc(sizeof(struct GNUNET_GNS_ClientGetAuthResultMessage)
522 rmsg->id = cah->unique_id;
523 rmsg->header.type = htons(GNUNET_MESSAGE_TYPE_GNS_GET_AUTH_RESULT);
525 htons(sizeof(struct GNUNET_GNS_ClientGetAuthResultMessage) +
528 strcpy((char*)&rmsg[1], name);
530 GNUNET_SERVER_notification_context_unicast (nc, cah->client,
531 (const struct GNUNET_MessageHeader *) rmsg,
533 GNUNET_SERVER_receive_done (cah->client, GNUNET_OK);
535 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Cleaning up handles...\n");
538 GNUNET_free_non_null(cah->name);
541 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "done.\n");
547 * Handle a get authority message from the api
549 * @param cls the closure
550 * @param client the client
551 * @param message the message
553 static void handle_get_authority(void *cls,
554 struct GNUNET_SERVER_Client * client,
555 const struct GNUNET_MessageHeader * message)
557 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n", "GET_AUTH");
560 struct ClientGetAuthHandle *cah;
563 if (ntohs (message->size) < sizeof (struct GNUNET_GNS_ClientGetAuthMessage))
566 GNUNET_SERVER_receive_done (client, GNUNET_OK);
570 GNUNET_SERVER_notification_context_add (nc, client);
572 struct GNUNET_GNS_ClientGetAuthMessage *sh_msg =
573 (struct GNUNET_GNS_ClientGetAuthMessage *) message;
575 msg_size = ntohs(message->size);
577 if (msg_size > GNUNET_SERVER_MAX_MESSAGE_SIZE)
580 GNUNET_SERVER_receive_done (client, GNUNET_OK);
584 name = (char*)&sh_msg[1];
586 cah = GNUNET_malloc(sizeof(struct ClientGetAuthHandle));
587 cah->client = client;
588 cah->unique_id = sh_msg->id;
590 if (strlen(name) < strlen(GNUNET_GNS_TLD))
592 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
593 "%s is too short. Returning\n", name);
595 send_get_auth_response(cah, name);
599 if (strcmp(name+strlen(name)-strlen(GNUNET_GNS_TLD),
600 GNUNET_GNS_TLD) != 0)
602 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
603 "%s is not our domain. Returning\n", name);
605 send_get_auth_response(cah, name);
609 if (strcmp(name, GNUNET_GNS_TLD) == 0)
611 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
612 "%s is us. Returning\n", name);
614 send_get_auth_response(cah, name);
618 cah->name = GNUNET_malloc(strlen(name)
619 - strlen(GNUNET_GNS_TLD) + 1);
621 strlen(name)-strlen(GNUNET_GNS_TLD) + 1);
622 memcpy(cah->name, name,
623 strlen(name)-strlen(GNUNET_GNS_TLD));
625 /* Start delegation resolution in our namestore */
626 gns_resolver_get_authority(zone_hash, name, &send_get_auth_response, cah);
631 * Reply to client with the result from our lookup.
633 * @param cls the closure (our client lookup handle)
634 * @param rh the request handle of the lookup
635 * @param rd_count the number of records
636 * @param rd the record data
639 send_lookup_response(void* cls,
641 const struct GNUNET_NAMESTORE_RecordData *rd)
643 struct ClientLookupHandle* clh = (struct ClientLookupHandle*)cls;
644 struct GNUNET_GNS_ClientLookupResultMessage *rmsg;
647 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending `%s' message with %d results\n",
648 "LOOKUP_RESULT", rd_count);
650 len = GNUNET_NAMESTORE_records_get_size (rd_count, rd);
651 rmsg = GNUNET_malloc(len+sizeof(struct GNUNET_GNS_ClientLookupResultMessage));
653 rmsg->id = clh->unique_id;
654 rmsg->rd_count = htonl(rd_count);
655 rmsg->header.type = htons(GNUNET_MESSAGE_TYPE_GNS_LOOKUP_RESULT);
657 htons(len+sizeof(struct GNUNET_GNS_ClientLookupResultMessage));
659 GNUNET_NAMESTORE_records_serialize (rd_count, rd, len, (char*)&rmsg[1]);
661 GNUNET_SERVER_notification_context_unicast (nc, clh->client,
662 (const struct GNUNET_MessageHeader *) rmsg,
664 GNUNET_SERVER_receive_done (clh->client, GNUNET_OK);
667 GNUNET_free(clh->name);
674 * Handle lookup requests from client
676 * @param cls the closure
677 * @param client the client
678 * @param message the message
681 handle_lookup(void *cls,
682 struct GNUNET_SERVER_Client * client,
683 const struct GNUNET_MessageHeader * message)
685 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received `%s' message\n", "LOOKUP");
690 struct ClientLookupHandle *clh;
692 if (ntohs (message->size) < sizeof (struct GNUNET_GNS_ClientLookupMessage))
695 GNUNET_SERVER_receive_done (client, GNUNET_OK);
699 GNUNET_SERVER_notification_context_add (nc, client);
701 struct GNUNET_GNS_ClientLookupMessage *sh_msg =
702 (struct GNUNET_GNS_ClientLookupMessage *) message;
704 msg_size = ntohs(message->size);
706 if (msg_size > GNUNET_SERVER_MAX_MESSAGE_SIZE)
709 GNUNET_SERVER_receive_done (client, GNUNET_OK);
713 name = (char*)&sh_msg[1];
714 namelen = strlen(name)+1;
715 clh = GNUNET_malloc(sizeof(struct ClientLookupHandle));
716 clh->client = client;
717 clh->name = GNUNET_malloc(namelen);
718 strcpy(clh->name, name);
719 clh->unique_id = sh_msg->id;
720 clh->type = ntohl(sh_msg->type);
722 if (GNUNET_YES == auto_import_pkey)
724 gns_resolver_lookup_record(zone_hash, clh->type, name,
726 &send_lookup_response, clh);
730 gns_resolver_lookup_record(zone_hash, clh->type, name,
732 &send_lookup_response, clh);
739 * Process GNS requests.
741 * @param cls closure)
742 * @param server the initialized server
743 * @param c configuration to use
746 run (void *cls, struct GNUNET_SERVER_Handle *server,
747 const struct GNUNET_CONFIGURATION_Handle *c)
750 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Initializing GNS\n");
753 struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pkey;
755 static const struct GNUNET_SERVER_MessageHandler handlers[] = {
756 {&handle_shorten, NULL, GNUNET_MESSAGE_TYPE_GNS_SHORTEN, 0},
757 {&handle_lookup, NULL, GNUNET_MESSAGE_TYPE_GNS_LOOKUP, 0},
758 {&handle_get_authority, NULL, GNUNET_MESSAGE_TYPE_GNS_GET_AUTH, 0}
761 if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (c, "gns",
762 "ZONEKEY", &keyfile))
764 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
765 "No private key for root zone specified!\n");
766 GNUNET_SCHEDULER_shutdown(0);
770 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
771 "Using keyfile %s for root zone.\n", keyfile);
773 zone_key = GNUNET_CRYPTO_rsa_key_create_from_file (keyfile);
774 GNUNET_CRYPTO_rsa_key_get_public (zone_key, &pkey);
776 GNUNET_CRYPTO_short_hash(&pkey,
777 sizeof(struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded),
779 GNUNET_free(keyfile);
782 * handle to our local namestore
784 namestore_handle = GNUNET_NAMESTORE_connect(c);
786 if (NULL == namestore_handle)
788 //FIXME do error handling;
789 GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
790 "Failed to connect to the namestore!\n");
791 GNUNET_SCHEDULER_shutdown(0);
798 dht_handle = GNUNET_DHT_connect(c, 1); //FIXME get ht_len from cfg
800 if (NULL == dht_handle)
802 GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Could not connect to DHT!\n");
806 GNUNET_CONFIGURATION_get_value_yesno (c, "gns",
809 GNUNET_log(GNUNET_ERROR_TYPE_INFO,
810 "Automatic PKEY import is enabled.\n");
811 auto_import_pkey = GNUNET_YES;
815 if (gns_resolver_init(namestore_handle, dht_handle)
818 GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
819 "Unable to initialize resolver!\n");
820 GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
825 GNUNET_CONFIGURATION_get_value_yesno (c, "gns",
828 GNUNET_log(GNUNET_ERROR_TYPE_INFO,
829 "DNS hijacking enabled... connecting to service.\n");
831 if (gns_interceptor_init(zone_hash, zone_key, c) == GNUNET_SYSERR)
833 GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
834 "Failed to enable the dns interceptor!\n");
838 //put_some_records(); //FIXME for testing
841 * Schedule periodic put
843 * We have roughly an hour for all records;
845 dht_update_interval = GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS,
847 zone_update_taskid = GNUNET_SCHEDULER_add_now (&update_zone_dht_start, NULL);
849 GNUNET_SERVER_add_handlers (server, handlers);
852 //GNUNET_SERVER_disconnect_notify (server,
853 // &client_disconnect_notification,
856 nc = GNUNET_SERVER_notification_context_create (server, 1);
858 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
864 * The main function for the GNS service.
866 * @param argc number of arguments from the command line
867 * @param argv command line arguments
868 * @return 0 ok, 1 on error
871 main (int argc, char *const *argv)
877 GNUNET_SERVICE_run (argc, argv, "gns", GNUNET_SERVICE_OPTION_NONE, &run,
882 /* end of gnunet-service-gns.c */