2 This file is part of GNUnet.
3 Copyright (C) 2012-2014 GNUnet e.V.
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., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
21 * @file gnunet-namestore-fcfsd.c
22 * @brief HTTP daemon that offers first-come-first-serve GNS domain registration
23 * @author Christian Grothoff
26 * - need to track active zone info requests so we can cancel them
27 * during shutdown, right?
28 * - the code currently contains a 'race' between checking that the
29 * domain name is available and allocating it to the new public key
30 * (should this race be solved by namestore or by fcfsd?)
31 * - nicer error reporting to browser
34 #include <microhttpd.h>
35 #include "gnunet_util_lib.h"
36 #include "gnunet_identity_service.h"
37 #include "gnunet_gnsrecord_lib.h"
38 #include "gnunet_namestore_service.h"
41 * Invalid method page.
43 #define METHOD_ERROR "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\"><html><head><title>Illegal request</title></head><body>Go away.</body></html>"
48 #define MAIN_PAGE "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\"><html><head><title>GNUnet FCFS Authority Name Registration Service</title></head><body><form action=\"S\" method=\"post\">What is your desired domain name? (at most 63 lowercase characters, no dots allowed.) <input type=\"text\" name=\"domain\" /> <p> What is your public key? (Copy from gnunet-setup.) <input type=\"text\" name=\"pkey\" /> <input type=\"submit\" value=\"Next\" /><br/><a href=./Zoneinfo> List of all registered names </a></body></html>"
53 #define SUBMIT_PAGE "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\"><html><head><title>%s</title></head><body>%s</body></html>"
56 * Fcfs zoneinfo page (/Zoneinfo)
58 #define ZONEINFO_PAGE "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\"><html><head><title>FCFS Zoneinfo</title></head><body><h1> FCFS Zoneinfo </h1><table border=\"1\"><th>name</th><th>PKEY</th>%s</table></body></html>"
60 #define FCFS_ZONEINFO_URL "/Zoneinfo"
63 * Mime type for HTML pages.
65 #define MIME_HTML "text/html"
70 #define COOKIE_NAME "namestore-fcfsd"
72 #define DEFAULT_ZONEINFO_BUFSIZE 2048
75 * Phases a request goes through.
80 * Start phase (parsing POST, checking).
85 * Lookup to see if the domain name is taken.
90 * Storing of the record.
95 * We're done with success.
100 * Send failure message.
107 * Data kept per request.
113 * Associated session.
115 // FIXME: struct Session *session;
118 * Post processor handling form data (IF this is
121 struct MHD_PostProcessor *pp;
124 * URL to serve in response to this POST (if this request
127 const char *post_url;
130 * Active request with the namestore.
132 struct GNUNET_NAMESTORE_QueueEntry *qe;
135 * Active iteration with the namestore.
137 struct GNUNET_NAMESTORE_ZoneIterator *zi;
140 * Current processing phase.
145 * Domain name submitted via form.
147 char domain_name[64];
150 * Public key submitted via form.
152 char public_key[128];
154 struct GNUNET_CRYPTO_EcdsaPublicKey pub;
161 struct ZoneinfoRequest
166 struct MHD_Connection *connection;
171 struct GNUNET_NAMESTORE_ZoneIterator *list_it;
184 * Buffer write offset
190 * MHD deamon reference.
192 static struct MHD_Daemon *httpd;
197 static struct GNUNET_SCHEDULER_Task * httpd_task;
200 * Handle to the namestore.
202 static struct GNUNET_NAMESTORE_Handle *ns;
205 * Private key for the fcfsd zone.
207 static struct GNUNET_CRYPTO_EcdsaPrivateKey fcfs_zone_pkey;
210 * Connection to identity service.
212 static struct GNUNET_IDENTITY_Handle *identity;
215 * Request for our ego.
217 static struct GNUNET_IDENTITY_Operation *id_op;
220 * Port we use for the HTTP server.
222 static unsigned long long port;
226 * Task run whenever HTTP server operations are pending.
231 do_httpd (void *cls);
235 * Schedule task to run MHD server now.
240 if (NULL != httpd_task)
242 GNUNET_SCHEDULER_cancel (httpd_task);
245 httpd_task = GNUNET_SCHEDULER_add_now (&do_httpd, NULL);
250 * Function called on error in zone iteration.
253 zone_iteration_error (void *cls)
255 struct ZoneinfoRequest *zr = cls;
256 struct MHD_Response *response;
259 response = MHD_create_response_from_buffer (strlen ("internal error"),
260 (void *) "internal error",
261 MHD_RESPMEM_PERSISTENT);
262 MHD_queue_response (zr->connection,
263 MHD_HTTP_INTERNAL_SERVER_ERROR,
265 MHD_destroy_response (response);
266 GNUNET_free (zr->zoneinfo);
273 * Function called once the zone iteration is done.
276 zone_iteration_end (void *cls)
278 struct ZoneinfoRequest *zr = cls;
279 struct MHD_Response *response;
284 /* return static form */
285 GNUNET_asprintf (&full_page,
289 response = MHD_create_response_from_buffer (strlen (full_page),
291 MHD_RESPMEM_MUST_FREE);
292 MHD_add_response_header (response,
293 MHD_HTTP_HEADER_CONTENT_TYPE,
295 MHD_queue_response (zr->connection,
298 MHD_destroy_response (response);
299 GNUNET_free (zr->zoneinfo);
306 * Process a record that was stored in the namestore, adding
307 * the information to the HTML.
309 * @param cls closure with the `struct ZoneinfoRequest *`
310 * @param zone_key private key of the zone; NULL on disconnect
311 * @param name label of the records; NULL on disconnect
312 * @param rd_len number of entries in @a rd array, 0 if label was deleted
313 * @param rd array of records with data to store
316 iterate_cb (void *cls,
317 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
320 const struct GNUNET_GNSRECORD_Data *rd)
322 struct ZoneinfoRequest *zr = cls;
329 GNUNET_NAMESTORE_zone_iterator_next (zr->list_it,
334 if (GNUNET_GNSRECORD_TYPE_PKEY != rd->record_type)
336 GNUNET_NAMESTORE_zone_iterator_next (zr->list_it,
341 bytes_free = zr->buf_len - zr->write_offset;
342 pkey = GNUNET_GNSRECORD_value_to_string (rd->record_type,
348 GNUNET_NAMESTORE_zone_iterator_next (zr->list_it,
352 if (bytes_free < (strlen (name) + strlen (pkey) + 40))
354 new_buf = GNUNET_malloc (zr->buf_len * 2);
355 GNUNET_memcpy (new_buf, zr->zoneinfo, zr->write_offset);
356 GNUNET_free (zr->zoneinfo);
357 zr->zoneinfo = new_buf;
360 sprintf (zr->zoneinfo + zr->write_offset,
361 "<tr><td>%s</td><td>%s</td></tr>",
364 zr->write_offset = strlen (zr->zoneinfo);
365 GNUNET_NAMESTORE_zone_iterator_next (zr->list_it,
372 * Handler that returns FCFS zoneinfo page.
374 * @param connection connection to use
375 * @return MHD_YES on success
378 serve_zoneinfo_page (struct MHD_Connection *connection)
380 struct ZoneinfoRequest *zr;
382 zr = GNUNET_new (struct ZoneinfoRequest);
383 zr->zoneinfo = GNUNET_malloc (DEFAULT_ZONEINFO_BUFSIZE);
384 zr->buf_len = DEFAULT_ZONEINFO_BUFSIZE;
385 zr->connection = connection;
386 zr->write_offset = 0;
387 zr->list_it = GNUNET_NAMESTORE_zone_iteration_start (ns,
389 &zone_iteration_error,
400 * Handler that returns a simple static HTTP page.
402 * @param connection connection to use
403 * @return MHD_YES on success
406 serve_main_page (struct MHD_Connection *connection)
409 struct MHD_Response *response;
411 /* return static form */
412 response = MHD_create_response_from_buffer (strlen (MAIN_PAGE),
414 MHD_RESPMEM_PERSISTENT);
415 MHD_add_response_header (response,
416 MHD_HTTP_HEADER_CONTENT_TYPE,
418 ret = MHD_queue_response (connection,
421 MHD_destroy_response (response);
427 * Send the 'SUBMIT_PAGE'.
429 * @param info information string to send to the user
430 * @param request request information
431 * @param connection connection to use
434 fill_s_reply (const char *info,
435 struct Request *request,
436 struct MHD_Connection *connection)
440 struct MHD_Response *response;
442 GNUNET_asprintf (&reply,
446 /* return static form */
447 response = MHD_create_response_from_buffer (strlen (reply),
449 MHD_RESPMEM_MUST_FREE);
450 MHD_add_response_header (response,
451 MHD_HTTP_HEADER_CONTENT_TYPE,
453 ret = MHD_queue_response (connection,
456 MHD_destroy_response (response);
462 * Iterator over key-value pairs where the value
463 * maybe made available in increments and/or may
464 * not be zero-terminated. Used for processing
467 * @param cls user-specified closure
468 * @param kind type of the value
469 * @param key 0-terminated key for the value
470 * @param filename name of the uploaded file, NULL if not known
471 * @param content_type mime-type of the data, NULL if not known
472 * @param transfer_encoding encoding of the data, NULL if not known
473 * @param data pointer to size bytes of data at the
475 * @param off offset of data in the overall value
476 * @param size number of bytes in data available
477 * @return MHD_YES to continue iterating,
478 * MHD_NO to abort the iteration
481 post_iterator (void *cls,
482 enum MHD_ValueKind kind,
484 const char *filename,
485 const char *content_type,
486 const char *transfer_encoding,
491 struct Request *request = cls;
496 (void) transfer_encoding;
497 if (0 == strcmp ("domain", key))
499 if (size + off >= sizeof(request->domain_name))
500 size = sizeof (request->domain_name) - off - 1;
501 GNUNET_memcpy (&request->domain_name[off],
504 request->domain_name[size+off] = '\0';
507 if (0 == strcmp ("pkey", key))
509 if (size + off >= sizeof(request->public_key))
510 size = sizeof (request->public_key) - off - 1;
511 GNUNET_memcpy (&request->public_key[off],
514 request->public_key[size+off] = '\0';
517 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
518 _("Unsupported form value `%s'\n"),
525 * Continuation called to notify client about result of the
529 * @param success #GNUNET_SYSERR on failure (including timeout/queue drop/failure to validate)
530 * #GNUNET_NO if content was already there
531 * #GNUNET_YES (or other positive value) on success
532 * @param emsg NULL on success, otherwise an error message
535 put_continuation (void *cls,
539 struct Request *request = cls;
544 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
545 _("Failed to create record for domain `%s': %s\n"),
546 request->domain_name,
548 request->phase = RP_FAIL;
551 request->phase = RP_SUCCESS;
557 * Function called if we had an error in zone-to-name mapping.
560 zone_to_name_error (void *cls)
562 struct Request *request = cls;
564 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
565 _("Error when mapping zone to name\n"));
566 request->phase = RP_FAIL;
572 * Test if a name mapping was found, if so, refuse. If not, initiate storing of the record.
575 * @param zone_key public key of the zone
576 * @param name name that is being mapped (at most 255 characters long)
577 * @param rd_count number of entries in @a rd array
578 * @param rd array of records with data to store
581 zone_to_name_cb (void *cls,
582 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
584 unsigned int rd_count,
585 const struct GNUNET_GNSRECORD_Data *rd)
587 struct Request *request = cls;
588 struct GNUNET_GNSRECORD_Data r;
593 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
594 _("Found existing name `%s' for the given key\n"),
596 request->phase = RP_FAIL;
600 r.data = &request->pub;
601 r.data_size = sizeof (request->pub);
602 r.expiration_time = UINT64_MAX;
603 r.record_type = GNUNET_GNSRECORD_TYPE_PKEY;
604 r.flags = GNUNET_GNSRECORD_RF_NONE;
605 request->qe = GNUNET_NAMESTORE_records_store (ns,
607 request->domain_name,
615 * We encountered an error in the name lookup.
618 lookup_block_error (void *cls)
620 struct Request *request = cls;
623 request->phase = RP_FAIL;
629 * We got a block back from the namestore. Decrypt it
630 * and continue to process the result.
632 * @param cls the 'struct Request' we are processing
633 * @param zone private key of the zone; NULL on disconnect
634 * @param label label of the records; NULL on disconnect
635 * @param rd_count number of entries in @a rd array, 0 if label was deleted
636 * @param rd array of records with data to store
639 lookup_block_processor (void *cls,
640 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
642 unsigned int rd_count,
643 const struct GNUNET_GNSRECORD_Data *rd)
645 struct Request *request = cls;
651 GNUNET_CRYPTO_ecdsa_public_key_from_string (request->public_key,
652 strlen (request->public_key),
656 request->phase = RP_FAIL;
660 request->qe = GNUNET_NAMESTORE_zone_to_name (ns,
669 GNUNET_break (0 != rd_count);
670 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
671 _("Found %u existing records for domain `%s'\n"),
673 request->domain_name);
674 request->phase = RP_FAIL;
681 * Main MHD callback for handling requests.
684 * @param connection MHD connection handle
685 * @param url the requested url
686 * @param method the HTTP method used ("GET", "PUT", etc.)
687 * @param version the HTTP version string (i.e. "HTTP/1.1")
688 * @param upload_data the data being uploaded (excluding HEADERS,
689 * for a POST that fits into memory and that is encoded
690 * with a supported encoding, the POST data will NOT be
691 * given in upload_data and is instead available as
692 * part of MHD_get_connection_values; very large POST
693 * data *will* be made available incrementally in
695 * @param upload_data_size set initially to the size of the
696 * @a upload_data provided; the method must update this
697 * value to the number of bytes NOT processed;
698 * @param ptr pointer to location where we store the 'struct Request'
699 * @return MHD_YES if the connection was handled successfully,
700 * MHD_NO if the socket must be closed due to a serious
701 * error while handling the request
704 create_response (void *cls,
705 struct MHD_Connection *connection,
709 const char *upload_data,
710 size_t *upload_data_size,
713 struct MHD_Response *response;
714 struct Request *request;
715 struct GNUNET_CRYPTO_EcdsaPublicKey pub;
718 if ( (0 == strcmp (method, MHD_HTTP_METHOD_GET)) ||
719 (0 == strcmp (method, MHD_HTTP_METHOD_HEAD)) )
721 if (0 == strcmp (url, FCFS_ZONEINFO_URL))
722 ret = serve_zoneinfo_page (connection);
724 ret = serve_main_page (connection);
726 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
727 _("Failed to create page for `%s'\n"),
731 if (0 == strcmp (method, MHD_HTTP_METHOD_POST))
736 request = GNUNET_new (struct Request);
738 request->pp = MHD_create_post_processor (connection,
742 if (NULL == request->pp)
744 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
745 _("Failed to setup post processor for `%s'\n"),
747 return MHD_NO; /* internal error */
751 if (NULL != request->pp)
753 /* evaluate POST data */
754 MHD_post_process (request->pp,
757 if (0 != *upload_data_size)
759 *upload_data_size = 0;
762 /* done with POST data, serve response */
763 MHD_destroy_post_processor (request->pp);
767 GNUNET_CRYPTO_ecdsa_public_key_from_string (request->public_key,
768 strlen (request->public_key),
772 return fill_s_reply ("Failed to parse given public key",
773 request, connection);
775 switch (request->phase)
778 if (NULL != strchr (request->domain_name, (int) '.'))
780 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
781 _("Domain name must not contain `.'\n"));
782 request->phase = RP_FAIL;
783 return fill_s_reply ("Domain name must not contain `.', sorry.",
787 if (NULL != strchr (request->domain_name, (int) '+'))
789 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
790 _("Domain name must not contain `+'\n"));
791 request->phase = RP_FAIL;
792 return fill_s_reply ("Domain name must not contain `+', sorry.",
793 request, connection);
795 request->phase = RP_LOOKUP;
797 = GNUNET_NAMESTORE_records_lookup (ns,
799 request->domain_name,
802 &lookup_block_processor,
810 return fill_s_reply ("Request failed, sorry.",
811 request, connection);
813 return fill_s_reply ("Success.",
814 request, connection);
819 return MHD_YES; /* will have a reply later... */
821 /* unsupported HTTP method */
822 response = MHD_create_response_from_buffer (strlen (METHOD_ERROR),
823 (void *) METHOD_ERROR,
824 MHD_RESPMEM_PERSISTENT);
825 ret = MHD_queue_response (connection,
826 MHD_HTTP_NOT_ACCEPTABLE,
828 MHD_destroy_response (response);
834 * Callback called upon completion of a request.
835 * Decrements session reference counter.
837 * @param cls not used
838 * @param connection connection that completed
839 * @param con_cls session handle
840 * @param toe status code
843 request_completed_callback (void *cls,
844 struct MHD_Connection *connection,
846 enum MHD_RequestTerminationCode toe)
848 struct Request *request = *con_cls;
855 if (NULL != request->pp)
856 MHD_destroy_post_processor (request->pp);
857 if (NULL != request->qe)
858 GNUNET_NAMESTORE_cancel (request->qe);
859 GNUNET_free (request);
863 #define UNSIGNED_MHD_LONG_LONG unsigned MHD_LONG_LONG
867 * Schedule tasks to run MHD server.
875 struct GNUNET_NETWORK_FDSet *wrs;
876 struct GNUNET_NETWORK_FDSet *wws;
877 struct GNUNET_NETWORK_FDSet *wes;
880 UNSIGNED_MHD_LONG_LONG timeout;
881 struct GNUNET_TIME_Relative tv;
886 wrs = GNUNET_NETWORK_fdset_create ();
887 wes = GNUNET_NETWORK_fdset_create ();
888 wws = GNUNET_NETWORK_fdset_create ();
890 GNUNET_assert (MHD_YES ==
891 MHD_get_fdset (httpd,
896 haveto = MHD_get_timeout (httpd,
898 if (haveto == MHD_YES)
899 tv.rel_value_us = (uint64_t) timeout * 1000LL;
901 tv = GNUNET_TIME_UNIT_FOREVER_REL;
902 GNUNET_NETWORK_fdset_copy_native (wrs,
905 GNUNET_NETWORK_fdset_copy_native (wws,
908 GNUNET_NETWORK_fdset_copy_native (wes,
912 GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_HIGH,
918 GNUNET_NETWORK_fdset_destroy (wrs);
919 GNUNET_NETWORK_fdset_destroy (wws);
920 GNUNET_NETWORK_fdset_destroy (wes);
925 * Task run whenever HTTP server operations are pending.
940 * Task run on shutdown. Cleans up everything.
945 do_shutdown (void *cls)
948 if (NULL != httpd_task)
950 GNUNET_SCHEDULER_cancel (httpd_task);
955 GNUNET_NAMESTORE_disconnect (ns);
960 MHD_stop_daemon (httpd);
965 GNUNET_IDENTITY_cancel (id_op);
968 if (NULL != identity)
970 GNUNET_IDENTITY_disconnect (identity);
977 * Method called to inform about the egos of this peer.
979 * When used with #GNUNET_IDENTITY_create or #GNUNET_IDENTITY_get,
980 * this function is only called ONCE, and 'NULL' being passed in
981 * @a ego does indicate an error (i.e. name is taken or no default
982 * value is known). If @a ego is non-NULL and if '*ctx'
983 * is set in those callbacks, the value WILL be passed to a subsequent
984 * call to the identity callback of #GNUNET_IDENTITY_connect (if
985 * that one was not NULL).
987 * @param cls closure, NULL
988 * @param ego ego handle
989 * @param ctx context for application to store data for this ego
990 * (during the lifetime of this process, initially NULL)
991 * @param name name assigned by the user for this ego,
992 * NULL if the user just deleted the ego and it
993 * must thus no longer be used
996 identity_cb (void *cls,
997 struct GNUNET_IDENTITY_Ego *ego,
1009 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1010 _("No ego configured for `fcfsd` subsystem\n"));
1013 fcfs_zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (ego);
1015 options = MHD_USE_DUAL_STACK | MHD_USE_DEBUG;
1018 httpd = MHD_start_daemon (options,
1021 &create_response, NULL,
1022 MHD_OPTION_CONNECTION_LIMIT, (unsigned int) 128,
1023 MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) 1,
1024 MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 16,
1025 MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t) (4 * 1024),
1026 MHD_OPTION_NOTIFY_COMPLETED, &request_completed_callback, NULL,
1028 if (MHD_USE_DEBUG == options)
1030 options = MHD_USE_DEBUG;
1032 while (NULL == httpd);
1035 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1036 _("Failed to start HTTP server\n"));
1037 GNUNET_SCHEDULER_shutdown ();
1045 * Main function that will be run.
1047 * @param cls closure
1048 * @param args remaining command-line arguments
1049 * @param cfgfile name of the configuration file used (for saving, can be NULL!)
1050 * @param cfg configuration
1055 const char *cfgfile,
1056 const struct GNUNET_CONFIGURATION_Handle *cfg)
1062 GNUNET_CONFIGURATION_get_value_number (cfg,
1067 GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
1068 "fcfsd", "HTTPPORT");
1071 ns = GNUNET_NAMESTORE_connect (cfg);
1074 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1075 _("Failed to connect to namestore\n"));
1078 identity = GNUNET_IDENTITY_connect (cfg,
1080 if (NULL == identity)
1082 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1083 _("Failed to connect to identity\n"));
1086 id_op = GNUNET_IDENTITY_get (identity, "fcfsd",
1087 &identity_cb, NULL);
1088 GNUNET_SCHEDULER_add_shutdown (&do_shutdown, NULL);
1093 * The main function for the fcfs daemon.
1095 * @param argc number of arguments from the command line
1096 * @param argv command line arguments
1097 * @return 0 ok, 1 on error
1103 static const struct GNUNET_GETOPT_CommandLineOption options[] = {
1104 GNUNET_GETOPT_OPTION_END
1109 GNUNET_STRINGS_get_utf8_args (argc, argv,
1113 GNUNET_log_setup ("fcfsd",
1118 GNUNET_PROGRAM_run (argc,
1120 "gnunet-namestore-fcfsd",
1121 _("GNU Name System First Come First Serve name registration service"),
1123 &run, NULL)) ? 0 : 1;
1124 GNUNET_free ((void*) argv);
1125 GNUNET_CRYPTO_ecdsa_key_clear (&fcfs_zone_pkey);
1129 /* end of gnunet-namestore-fcfsd.c */