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);
333 if (GNUNET_GNSRECORD_TYPE_PKEY != rd->record_type)
335 GNUNET_NAMESTORE_zone_iterator_next (zr->list_it);
339 bytes_free = zr->buf_len - zr->write_offset;
340 pkey = GNUNET_GNSRECORD_value_to_string (rd->record_type,
346 GNUNET_NAMESTORE_zone_iterator_next (zr->list_it);
349 if (bytes_free < (strlen (name) + strlen (pkey) + 40))
351 new_buf = GNUNET_malloc (zr->buf_len * 2);
352 GNUNET_memcpy (new_buf, zr->zoneinfo, zr->write_offset);
353 GNUNET_free (zr->zoneinfo);
354 zr->zoneinfo = new_buf;
357 sprintf (zr->zoneinfo + zr->write_offset,
358 "<tr><td>%s</td><td>%s</td></tr>",
361 zr->write_offset = strlen (zr->zoneinfo);
362 GNUNET_NAMESTORE_zone_iterator_next (zr->list_it);
368 * Handler that returns FCFS zoneinfo page.
370 * @param connection connection to use
371 * @return MHD_YES on success
374 serve_zoneinfo_page (struct MHD_Connection *connection)
376 struct ZoneinfoRequest *zr;
378 zr = GNUNET_new (struct ZoneinfoRequest);
379 zr->zoneinfo = GNUNET_malloc (DEFAULT_ZONEINFO_BUFSIZE);
380 zr->buf_len = DEFAULT_ZONEINFO_BUFSIZE;
381 zr->connection = connection;
382 zr->write_offset = 0;
383 zr->list_it = GNUNET_NAMESTORE_zone_iteration_start (ns,
385 &zone_iteration_error,
396 * Handler that returns a simple static HTTP page.
398 * @param connection connection to use
399 * @return MHD_YES on success
402 serve_main_page (struct MHD_Connection *connection)
405 struct MHD_Response *response;
407 /* return static form */
408 response = MHD_create_response_from_buffer (strlen (MAIN_PAGE),
410 MHD_RESPMEM_PERSISTENT);
411 MHD_add_response_header (response,
412 MHD_HTTP_HEADER_CONTENT_TYPE,
414 ret = MHD_queue_response (connection,
417 MHD_destroy_response (response);
423 * Send the 'SUBMIT_PAGE'.
425 * @param info information string to send to the user
426 * @param request request information
427 * @param connection connection to use
430 fill_s_reply (const char *info,
431 struct Request *request,
432 struct MHD_Connection *connection)
436 struct MHD_Response *response;
438 GNUNET_asprintf (&reply,
442 /* return static form */
443 response = MHD_create_response_from_buffer (strlen (reply),
445 MHD_RESPMEM_MUST_FREE);
446 MHD_add_response_header (response,
447 MHD_HTTP_HEADER_CONTENT_TYPE,
449 ret = MHD_queue_response (connection,
452 MHD_destroy_response (response);
458 * Iterator over key-value pairs where the value
459 * maybe made available in increments and/or may
460 * not be zero-terminated. Used for processing
463 * @param cls user-specified closure
464 * @param kind type of the value
465 * @param key 0-terminated key for the value
466 * @param filename name of the uploaded file, NULL if not known
467 * @param content_type mime-type of the data, NULL if not known
468 * @param transfer_encoding encoding of the data, NULL if not known
469 * @param data pointer to size bytes of data at the
471 * @param off offset of data in the overall value
472 * @param size number of bytes in data available
473 * @return MHD_YES to continue iterating,
474 * MHD_NO to abort the iteration
477 post_iterator (void *cls,
478 enum MHD_ValueKind kind,
480 const char *filename,
481 const char *content_type,
482 const char *transfer_encoding,
487 struct Request *request = cls;
492 (void) transfer_encoding;
493 if (0 == strcmp ("domain", key))
495 if (size + off >= sizeof(request->domain_name))
496 size = sizeof (request->domain_name) - off - 1;
497 GNUNET_memcpy (&request->domain_name[off],
500 request->domain_name[size+off] = '\0';
503 if (0 == strcmp ("pkey", key))
505 if (size + off >= sizeof(request->public_key))
506 size = sizeof (request->public_key) - off - 1;
507 GNUNET_memcpy (&request->public_key[off],
510 request->public_key[size+off] = '\0';
513 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
514 _("Unsupported form value `%s'\n"),
521 * Continuation called to notify client about result of the
525 * @param success #GNUNET_SYSERR on failure (including timeout/queue drop/failure to validate)
526 * #GNUNET_NO if content was already there
527 * #GNUNET_YES (or other positive value) on success
528 * @param emsg NULL on success, otherwise an error message
531 put_continuation (void *cls,
535 struct Request *request = cls;
540 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
541 _("Failed to create record for domain `%s': %s\n"),
542 request->domain_name,
544 request->phase = RP_FAIL;
547 request->phase = RP_SUCCESS;
553 * Function called if we had an error in zone-to-name mapping.
556 zone_to_name_error (void *cls)
558 struct Request *request = cls;
560 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
561 _("Error when mapping zone to name\n"));
562 request->phase = RP_FAIL;
568 * Test if a name mapping was found, if so, refuse. If not, initiate storing of the record.
571 * @param zone_key public key of the zone
572 * @param name name that is being mapped (at most 255 characters long)
573 * @param rd_count number of entries in @a rd array
574 * @param rd array of records with data to store
577 zone_to_name_cb (void *cls,
578 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key,
580 unsigned int rd_count,
581 const struct GNUNET_GNSRECORD_Data *rd)
583 struct Request *request = cls;
584 struct GNUNET_GNSRECORD_Data r;
589 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
590 _("Found existing name `%s' for the given key\n"),
592 request->phase = RP_FAIL;
596 r.data = &request->pub;
597 r.data_size = sizeof (request->pub);
598 r.expiration_time = UINT64_MAX;
599 r.record_type = GNUNET_GNSRECORD_TYPE_PKEY;
600 r.flags = GNUNET_GNSRECORD_RF_NONE;
601 request->qe = GNUNET_NAMESTORE_records_store (ns,
603 request->domain_name,
611 * We encountered an error in the name lookup.
614 lookup_block_error (void *cls)
616 struct Request *request = cls;
619 request->phase = RP_FAIL;
625 * We got a block back from the namestore. Decrypt it
626 * and continue to process the result.
628 * @param cls the 'struct Request' we are processing
629 * @param zone private key of the zone; NULL on disconnect
630 * @param label label of the records; NULL on disconnect
631 * @param rd_count number of entries in @a rd array, 0 if label was deleted
632 * @param rd array of records with data to store
635 lookup_block_processor (void *cls,
636 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
638 unsigned int rd_count,
639 const struct GNUNET_GNSRECORD_Data *rd)
641 struct Request *request = cls;
647 GNUNET_CRYPTO_ecdsa_public_key_from_string (request->public_key,
648 strlen (request->public_key),
652 request->phase = RP_FAIL;
656 request->qe = GNUNET_NAMESTORE_zone_to_name (ns,
665 GNUNET_break (0 != rd_count);
666 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
667 _("Found %u existing records for domain `%s'\n"),
669 request->domain_name);
670 request->phase = RP_FAIL;
677 * Main MHD callback for handling requests.
680 * @param connection MHD connection handle
681 * @param url the requested url
682 * @param method the HTTP method used ("GET", "PUT", etc.)
683 * @param version the HTTP version string (i.e. "HTTP/1.1")
684 * @param upload_data the data being uploaded (excluding HEADERS,
685 * for a POST that fits into memory and that is encoded
686 * with a supported encoding, the POST data will NOT be
687 * given in upload_data and is instead available as
688 * part of MHD_get_connection_values; very large POST
689 * data *will* be made available incrementally in
691 * @param upload_data_size set initially to the size of the
692 * @a upload_data provided; the method must update this
693 * value to the number of bytes NOT processed;
694 * @param ptr pointer to location where we store the 'struct Request'
695 * @return MHD_YES if the connection was handled successfully,
696 * MHD_NO if the socket must be closed due to a serious
697 * error while handling the request
700 create_response (void *cls,
701 struct MHD_Connection *connection,
705 const char *upload_data,
706 size_t *upload_data_size,
709 struct MHD_Response *response;
710 struct Request *request;
711 struct GNUNET_CRYPTO_EcdsaPublicKey pub;
714 if ( (0 == strcmp (method, MHD_HTTP_METHOD_GET)) ||
715 (0 == strcmp (method, MHD_HTTP_METHOD_HEAD)) )
717 if (0 == strcmp (url, FCFS_ZONEINFO_URL))
718 ret = serve_zoneinfo_page (connection);
720 ret = serve_main_page (connection);
722 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
723 _("Failed to create page for `%s'\n"),
727 if (0 == strcmp (method, MHD_HTTP_METHOD_POST))
732 request = GNUNET_new (struct Request);
734 request->pp = MHD_create_post_processor (connection,
738 if (NULL == request->pp)
740 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
741 _("Failed to setup post processor for `%s'\n"),
743 return MHD_NO; /* internal error */
747 if (NULL != request->pp)
749 /* evaluate POST data */
750 MHD_post_process (request->pp,
753 if (0 != *upload_data_size)
755 *upload_data_size = 0;
758 /* done with POST data, serve response */
759 MHD_destroy_post_processor (request->pp);
763 GNUNET_CRYPTO_ecdsa_public_key_from_string (request->public_key,
764 strlen (request->public_key),
768 return fill_s_reply ("Failed to parse given public key",
769 request, connection);
771 switch (request->phase)
774 if (NULL != strchr (request->domain_name, (int) '.'))
776 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
777 _("Domain name must not contain `.'\n"));
778 request->phase = RP_FAIL;
779 return fill_s_reply ("Domain name must not contain `.', sorry.",
783 if (NULL != strchr (request->domain_name, (int) '+'))
785 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
786 _("Domain name must not contain `+'\n"));
787 request->phase = RP_FAIL;
788 return fill_s_reply ("Domain name must not contain `+', sorry.",
789 request, connection);
791 request->phase = RP_LOOKUP;
793 = GNUNET_NAMESTORE_records_lookup (ns,
795 request->domain_name,
798 &lookup_block_processor,
806 return fill_s_reply ("Request failed, sorry.",
807 request, connection);
809 return fill_s_reply ("Success.",
810 request, connection);
815 return MHD_YES; /* will have a reply later... */
817 /* unsupported HTTP method */
818 response = MHD_create_response_from_buffer (strlen (METHOD_ERROR),
819 (void *) METHOD_ERROR,
820 MHD_RESPMEM_PERSISTENT);
821 ret = MHD_queue_response (connection,
822 MHD_HTTP_NOT_ACCEPTABLE,
824 MHD_destroy_response (response);
830 * Callback called upon completion of a request.
831 * Decrements session reference counter.
833 * @param cls not used
834 * @param connection connection that completed
835 * @param con_cls session handle
836 * @param toe status code
839 request_completed_callback (void *cls,
840 struct MHD_Connection *connection,
842 enum MHD_RequestTerminationCode toe)
844 struct Request *request = *con_cls;
851 if (NULL != request->pp)
852 MHD_destroy_post_processor (request->pp);
853 if (NULL != request->qe)
854 GNUNET_NAMESTORE_cancel (request->qe);
855 GNUNET_free (request);
859 #define UNSIGNED_MHD_LONG_LONG unsigned MHD_LONG_LONG
863 * Schedule tasks to run MHD server.
871 struct GNUNET_NETWORK_FDSet *wrs;
872 struct GNUNET_NETWORK_FDSet *wws;
873 struct GNUNET_NETWORK_FDSet *wes;
876 UNSIGNED_MHD_LONG_LONG timeout;
877 struct GNUNET_TIME_Relative tv;
882 wrs = GNUNET_NETWORK_fdset_create ();
883 wes = GNUNET_NETWORK_fdset_create ();
884 wws = GNUNET_NETWORK_fdset_create ();
886 GNUNET_assert (MHD_YES ==
887 MHD_get_fdset (httpd,
892 haveto = MHD_get_timeout (httpd,
894 if (haveto == MHD_YES)
895 tv.rel_value_us = (uint64_t) timeout * 1000LL;
897 tv = GNUNET_TIME_UNIT_FOREVER_REL;
898 GNUNET_NETWORK_fdset_copy_native (wrs,
901 GNUNET_NETWORK_fdset_copy_native (wws,
904 GNUNET_NETWORK_fdset_copy_native (wes,
908 GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_HIGH,
914 GNUNET_NETWORK_fdset_destroy (wrs);
915 GNUNET_NETWORK_fdset_destroy (wws);
916 GNUNET_NETWORK_fdset_destroy (wes);
921 * Task run whenever HTTP server operations are pending.
936 * Task run on shutdown. Cleans up everything.
941 do_shutdown (void *cls)
944 if (NULL != httpd_task)
946 GNUNET_SCHEDULER_cancel (httpd_task);
951 GNUNET_NAMESTORE_disconnect (ns);
956 MHD_stop_daemon (httpd);
961 GNUNET_IDENTITY_cancel (id_op);
964 if (NULL != identity)
966 GNUNET_IDENTITY_disconnect (identity);
973 * Method called to inform about the egos of this peer.
975 * When used with #GNUNET_IDENTITY_create or #GNUNET_IDENTITY_get,
976 * this function is only called ONCE, and 'NULL' being passed in
977 * @a ego does indicate an error (i.e. name is taken or no default
978 * value is known). If @a ego is non-NULL and if '*ctx'
979 * is set in those callbacks, the value WILL be passed to a subsequent
980 * call to the identity callback of #GNUNET_IDENTITY_connect (if
981 * that one was not NULL).
983 * @param cls closure, NULL
984 * @param ego ego handle
985 * @param ctx context for application to store data for this ego
986 * (during the lifetime of this process, initially NULL)
987 * @param name name assigned by the user for this ego,
988 * NULL if the user just deleted the ego and it
989 * must thus no longer be used
992 identity_cb (void *cls,
993 struct GNUNET_IDENTITY_Ego *ego,
1005 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1006 _("No ego configured for `fcfsd` subsystem\n"));
1009 fcfs_zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (ego);
1011 options = MHD_USE_DUAL_STACK | MHD_USE_DEBUG;
1014 httpd = MHD_start_daemon (options,
1017 &create_response, NULL,
1018 MHD_OPTION_CONNECTION_LIMIT, (unsigned int) 128,
1019 MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) 1,
1020 MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 16,
1021 MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t) (4 * 1024),
1022 MHD_OPTION_NOTIFY_COMPLETED, &request_completed_callback, NULL,
1024 if (MHD_USE_DEBUG == options)
1026 options = MHD_USE_DEBUG;
1028 while (NULL == httpd);
1031 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1032 _("Failed to start HTTP server\n"));
1033 GNUNET_SCHEDULER_shutdown ();
1041 * Main function that will be run.
1043 * @param cls closure
1044 * @param args remaining command-line arguments
1045 * @param cfgfile name of the configuration file used (for saving, can be NULL!)
1046 * @param cfg configuration
1051 const char *cfgfile,
1052 const struct GNUNET_CONFIGURATION_Handle *cfg)
1058 GNUNET_CONFIGURATION_get_value_number (cfg,
1063 GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
1064 "fcfsd", "HTTPPORT");
1067 ns = GNUNET_NAMESTORE_connect (cfg);
1070 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1071 _("Failed to connect to namestore\n"));
1074 identity = GNUNET_IDENTITY_connect (cfg,
1076 if (NULL == identity)
1078 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1079 _("Failed to connect to identity\n"));
1082 id_op = GNUNET_IDENTITY_get (identity, "fcfsd",
1083 &identity_cb, NULL);
1084 GNUNET_SCHEDULER_add_shutdown (&do_shutdown, NULL);
1089 * The main function for the fcfs daemon.
1091 * @param argc number of arguments from the command line
1092 * @param argv command line arguments
1093 * @return 0 ok, 1 on error
1099 static const struct GNUNET_GETOPT_CommandLineOption options[] = {
1100 GNUNET_GETOPT_OPTION_END
1105 GNUNET_STRINGS_get_utf8_args (argc, argv,
1109 GNUNET_log_setup ("fcfsd",
1114 GNUNET_PROGRAM_run (argc,
1116 "gnunet-namestore-fcfsd",
1117 _("GNU Name System First Come First Serve name registration service"),
1119 &run, NULL)) ? 0 : 1;
1120 GNUNET_free ((void*) argv);
1121 GNUNET_CRYPTO_ecdsa_key_clear (&fcfs_zone_pkey);
1125 /* end of gnunet-namestore-fcfsd.c */