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 identity/gnunet-service-identity.c
23 * @brief identity management service
24 * @author Christian Grothoff
26 * The purpose of this service is to manage private keys that
27 * represent the various egos/pseudonyms/identities of a GNUnet user.
30 #include "gnunet_util_lib.h"
31 #include "gnunet_constants.h"
32 #include "gnunet_protocols.h"
33 #include "gnunet_statistics_service.h"
34 #include "gnunet_identity_service.h"
39 * Information we keep about each ego.
45 * We keep egos in a DLL.
50 * We keep egos in a DLL.
55 * Private key of the ego.
57 struct GNUNET_CRYPTO_EccPrivateKey *pk;
60 * String identifier for the ego.
68 * Handle to our current configuration.
70 static const struct GNUNET_CONFIGURATION_Handle *cfg;
73 * Handle to subsystem configuration which for each subsystem contains
74 * the name of the default ego.
76 static struct GNUNET_CONFIGURATION_Handle *subsystem_cfg;
79 * Handle to the statistics service.
81 static struct GNUNET_STATISTICS_Handle *stats;
84 * Notification context, simplifies client broadcasts.
86 static struct GNUNET_SERVER_NotificationContext *nc;
89 * Directory where we store the identities.
91 static char *ego_directory;
94 * Configuration file name where subsystem information is kept.
96 static char *subsystem_cfg_file;
99 * Head of DLL of all egos.
101 static struct Ego *ego_head;
104 * Tail of DLL of all egos.
106 static struct Ego *ego_tail;
110 * Get the name of the file we use to store a given ego.
112 * @param ego ego for which we need the filename
113 * @return full filename for the given ego
116 get_ego_filename (struct Ego *ego)
120 GNUNET_asprintf (&filename,
130 * Task run during shutdown.
136 shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
142 GNUNET_SERVER_notification_context_destroy (nc);
147 GNUNET_STATISTICS_destroy (stats, GNUNET_NO);
150 GNUNET_CONFIGURATION_destroy (subsystem_cfg);
151 subsystem_cfg = NULL;
152 GNUNET_free (subsystem_cfg_file);
153 subsystem_cfg_file = NULL;
154 GNUNET_free (ego_directory);
155 ego_directory = NULL;
156 while (NULL != (e = ego_head))
158 GNUNET_CONTAINER_DLL_remove (ego_head, ego_tail, e);
159 GNUNET_CRYPTO_ecc_key_free (e->pk);
166 * Send a result code back to the client.
168 * @param client client that should receive the result code
169 * @param result_code code to transmit
170 * @param emsg error message to include (or NULL for none)
173 send_result_code (struct GNUNET_SERVER_Client *client,
174 uint32_t result_code,
177 struct GNUNET_IDENTITY_ResultCodeMessage *rcm;
183 elen = strlen (emsg) + 1;
184 rcm = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_ResultCodeMessage) + elen);
185 rcm->header.type = htons (GNUNET_MESSAGE_TYPE_IDENTITY_RESULT_CODE);
186 rcm->header.size = htons (sizeof (struct GNUNET_IDENTITY_ResultCodeMessage) + elen);
187 rcm->result_code = htonl (result_code);
188 memcpy (&rcm[1], emsg, elen);
189 GNUNET_SERVER_notification_context_unicast (nc, client, &rcm->header, GNUNET_YES);
195 * Create an update message with information about the current state of an ego.
197 * @param ego ego to create message for
198 * @return corresponding update message
200 static struct GNUNET_IDENTITY_UpdateMessage *
201 create_update_message (struct Ego *ego)
203 struct GNUNET_IDENTITY_UpdateMessage *um;
207 struct GNUNET_CRYPTO_EccPrivateKeyBinaryEncoded *enc;
209 name_len = (NULL == ego->identifier) ? 0 : (strlen (ego->identifier) + 1);
210 enc = GNUNET_CRYPTO_ecc_encode_key (ego->pk);
211 pk_len = ntohs (enc->size);
212 um = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_UpdateMessage) + pk_len + name_len);
213 um->header.type = htons (GNUNET_MESSAGE_TYPE_IDENTITY_UPDATE);
214 um->header.size = htons (sizeof (struct GNUNET_IDENTITY_UpdateMessage) + pk_len + name_len);
215 um->name_len = htons (name_len);
216 um->pk_len = htons (pk_len);
217 str = (char *) &um[1];
218 memcpy (str, enc, pk_len);
219 memcpy (&str[pk_len], ego->identifier, name_len);
226 * Create a set default message with information about the current state of an ego.
228 * @param ego ego to create message for
229 * @param servicename name of the service to provide in the message
230 * @return corresponding set default message
232 static struct GNUNET_IDENTITY_SetDefaultMessage *
233 create_set_default_message (struct Ego *ego,
234 const char *servicename)
236 struct GNUNET_IDENTITY_SetDefaultMessage *sdm;
240 struct GNUNET_CRYPTO_EccPrivateKeyBinaryEncoded *enc;
242 name_len = (NULL == servicename) ? 0 : (strlen (servicename) + 1);
243 enc = GNUNET_CRYPTO_ecc_encode_key (ego->pk);
244 pk_len = ntohs (enc->size);
245 sdm = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_SetDefaultMessage) + pk_len + name_len);
246 sdm->header.type = htons (GNUNET_MESSAGE_TYPE_IDENTITY_SET_DEFAULT);
247 sdm->header.size = htons (sizeof (struct GNUNET_IDENTITY_SetDefaultMessage) + pk_len + name_len);
248 sdm->name_len = htons (name_len);
249 sdm->pk_len = htons (pk_len);
250 str = (char *) &sdm[1];
251 memcpy (str, enc, pk_len);
252 memcpy (&str[pk_len], servicename, name_len);
259 * Handler for START message from client, sends information
260 * about all identities to the client immediately and
261 * adds the client to the notification context for future
265 * @param client who sent the message
266 * @param message the message received
269 handle_start_message (void *cls, struct GNUNET_SERVER_Client *client,
270 const struct GNUNET_MessageHeader *message)
272 struct GNUNET_IDENTITY_UpdateMessage *um;
275 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
276 "Received START message from client\n");
277 GNUNET_SERVER_notification_context_add (nc, client);
278 for (ego = ego_head; NULL != ego; ego = ego->next)
280 um = create_update_message (ego);
281 GNUNET_SERVER_notification_context_unicast (nc, client, &um->header, GNUNET_YES);
284 GNUNET_SERVER_receive_done (client, GNUNET_OK);
289 * Handler for GET_DEFAULT message from client, returns
290 * default identity for some service.
293 * @param client who sent the message
294 * @param message the message received
297 handle_get_default_message (void *cls, struct GNUNET_SERVER_Client *client,
298 const struct GNUNET_MessageHeader *message)
300 const struct GNUNET_IDENTITY_GetDefaultMessage *gdm;
301 struct GNUNET_IDENTITY_SetDefaultMessage *sdm;
308 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
309 "Received GET_DEFAULT message from client\n");
310 size = ntohs (message->size);
311 if (size <= sizeof (struct GNUNET_IDENTITY_GetDefaultMessage))
314 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
317 gdm = (const struct GNUNET_IDENTITY_GetDefaultMessage *) message;
318 name = (const char *) &gdm[1];
319 name_len = ntohs (gdm->name_len);
320 if ( (name_len + sizeof (struct GNUNET_IDENTITY_GetDefaultMessage) != size) ||
321 (0 != ntohs (gdm->reserved)) ||
322 ('\0' != name[name_len - 1]) )
325 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
329 GNUNET_CONFIGURATION_get_value_string (subsystem_cfg,
331 "DEFAULT_IDENTIFIER",
334 send_result_code (client, 1, gettext_noop ("no default known"));
335 GNUNET_SERVER_receive_done (client, GNUNET_OK);
338 for (ego = ego_head; NULL != ego; ego = ego->next)
340 if (0 == strcmp (ego->identifier,
343 sdm = create_set_default_message (ego,
345 GNUNET_SERVER_notification_context_broadcast (nc, &sdm->header, GNUNET_YES);
347 GNUNET_SERVER_receive_done (client, GNUNET_OK);
351 send_result_code (client, 1,
352 gettext_noop ("default configured, but ego unknown (internal error)"));
353 GNUNET_SERVER_receive_done (client, GNUNET_OK);
358 * Compare the given two private keys for equality.
360 * @param pk1 one private key
361 * @param pk2 another private key
362 * @return 0 if the keys are equal
365 key_cmp (const struct GNUNET_CRYPTO_EccPrivateKey *pk1,
366 const struct GNUNET_CRYPTO_EccPrivateKey *pk2)
368 struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded p1;
369 struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded p2;
371 GNUNET_CRYPTO_ecc_key_get_public (pk1, &p1);
372 GNUNET_CRYPTO_ecc_key_get_public (pk2, &p2);
373 return memcmp (&p1, &p2, sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded));
378 * Handler for SET_DEFAULT message from client, updates
379 * default identity for some service.
382 * @param client who sent the message
383 * @param message the message received
386 handle_set_default_message (void *cls, struct GNUNET_SERVER_Client *client,
387 const struct GNUNET_MessageHeader *message)
389 const struct GNUNET_IDENTITY_SetDefaultMessage *sdm;
395 struct GNUNET_CRYPTO_EccPrivateKey *pk;
397 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
398 "Received SET_DEFAULT message from client\n");
399 size = ntohs (message->size);
400 if (size <= sizeof (struct GNUNET_IDENTITY_SetDefaultMessage))
403 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
406 sdm = (const struct GNUNET_IDENTITY_SetDefaultMessage *) message;
407 name_len = ntohs (sdm->name_len);
408 pk_len = ntohs (sdm->pk_len);
409 str = (const char *) &sdm[1];
410 if ( (name_len + pk_len + sizeof (struct GNUNET_IDENTITY_SetDefaultMessage) != size) ||
411 (NULL == (pk = GNUNET_CRYPTO_ecc_decode_key (str, pk_len, GNUNET_YES))) )
414 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
418 if ('\0' != str[name_len - 1])
421 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
424 for (ego = ego_head; NULL != ego; ego = ego->next)
426 if (0 == key_cmp (ego->pk,
429 GNUNET_CONFIGURATION_set_value_string (subsystem_cfg,
431 "DEFAULT_IDENTIFIER",
434 GNUNET_CONFIGURATION_write (subsystem_cfg,
436 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
437 _("Failed to write subsystem default identifier map to `%s'.\n"),
439 send_result_code (client, 0, NULL);
440 GNUNET_SERVER_receive_done (client, GNUNET_OK);
441 GNUNET_CRYPTO_ecc_key_free (pk);
445 send_result_code (client, 1, _("Unknown ego specified for service (internal error)"));
446 GNUNET_SERVER_receive_done (client, GNUNET_OK);
447 GNUNET_CRYPTO_ecc_key_free (pk);
452 * Send an updated message for the given ego to all listeners.
454 * @param ego ego to send the update for
457 notify_listeners (struct Ego *ego)
459 struct GNUNET_IDENTITY_UpdateMessage *um;
461 um = create_update_message (ego);
462 GNUNET_SERVER_notification_context_broadcast (nc, &um->header, GNUNET_YES);
468 * Handler for CREATE message from client, creates
472 * @param client who sent the message
473 * @param message the message received
476 handle_create_message (void *cls, struct GNUNET_SERVER_Client *client,
477 const struct GNUNET_MessageHeader *message)
479 const struct GNUNET_IDENTITY_CreateRequestMessage *crm;
486 struct GNUNET_CRYPTO_EccPrivateKey *pk;
489 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
490 "Received CREATE message from client\n");
491 size = ntohs (message->size);
492 if (size <= sizeof (struct GNUNET_IDENTITY_CreateRequestMessage))
495 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
498 crm = (const struct GNUNET_IDENTITY_CreateRequestMessage *) message;
499 name_len = ntohs (crm->name_len);
500 pk_len = ntohs (crm->pk_len);
501 pks = (const char *) &crm[1];
502 if ( (name_len + pk_len + sizeof (struct GNUNET_IDENTITY_CreateRequestMessage) != size) ||
503 (NULL == (pk = GNUNET_CRYPTO_ecc_decode_key (pks, pk_len, GNUNET_YES))) )
506 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
510 if ('\0' != str[name_len - 1])
513 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
516 for (ego = ego_head; NULL != ego; ego = ego->next)
518 if (0 == strcmp (ego->identifier,
521 send_result_code (client, 1, gettext_noop ("identifier already in use for another ego"));
522 GNUNET_SERVER_receive_done (client, GNUNET_OK);
523 GNUNET_CRYPTO_ecc_key_free (pk);
527 ego = GNUNET_new (struct Ego);
529 ego->identifier = GNUNET_strdup (str);
530 GNUNET_CONTAINER_DLL_insert (ego_head,
533 send_result_code (client, 0, NULL);
534 fn = get_ego_filename (ego);
535 (void) GNUNET_DISK_directory_create_for_file (fn);
537 GNUNET_DISK_fn_write (fn, pks, pk_len,
538 GNUNET_DISK_PERM_USER_READ |
539 GNUNET_DISK_PERM_USER_WRITE))
540 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
543 notify_listeners (ego);
544 GNUNET_SERVER_receive_done (client, GNUNET_OK);
549 * Closure for 'handle_ego_rename'.
556 const char *old_name;
561 const char *new_name;
566 * An ego was renamed; rename it in all subsystems where it is
567 * currently set as the default.
569 * @param cls the 'struct RenameContext'
570 * @param section a section in the configuration to process
573 handle_ego_rename (void *cls,
576 struct RenameContext *rc = cls;
580 GNUNET_CONFIGURATION_get_value_string (subsystem_cfg,
582 "DEFAULT_IDENTIFIER",
585 if (0 != strcmp (id, rc->old_name))
590 GNUNET_CONFIGURATION_set_value_string (subsystem_cfg,
592 "DEFAULT_IDENTIFIER",
599 * Handler for RENAME message from client, creates
603 * @param client who sent the message
604 * @param message the message received
607 handle_rename_message (void *cls, struct GNUNET_SERVER_Client *client,
608 const struct GNUNET_MessageHeader *message)
610 const struct GNUNET_IDENTITY_RenameMessage *rm;
612 uint16_t old_name_len;
613 uint16_t new_name_len;
615 const char *old_name;
616 const char *new_name;
617 struct RenameContext rename_ctx;
621 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
622 "Received RENAME message from client\n");
623 size = ntohs (message->size);
624 if (size <= sizeof (struct GNUNET_IDENTITY_RenameMessage))
627 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
630 rm = (const struct GNUNET_IDENTITY_RenameMessage *) message;
631 old_name_len = ntohs (rm->old_name_len);
632 new_name_len = ntohs (rm->new_name_len);
633 old_name = (const char *) &rm[1];
634 new_name = &old_name[old_name_len];
635 if ( (old_name_len + new_name_len + sizeof (struct GNUNET_IDENTITY_RenameMessage) != size) ||
636 ('\0' != old_name[old_name_len - 1]) ||
637 ('\0' != new_name[new_name_len - 1]) )
640 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
644 /* check if new name is already in use */
645 for (ego = ego_head; NULL != ego; ego = ego->next)
647 if (0 == strcmp (ego->identifier,
650 send_result_code (client, 1, gettext_noop ("target name already exists"));
651 GNUNET_SERVER_receive_done (client, GNUNET_OK);
656 /* locate old name and, if found, perform rename */
657 for (ego = ego_head; NULL != ego; ego = ego->next)
659 if (0 == strcmp (ego->identifier,
662 fn_old = get_ego_filename (ego);
663 GNUNET_free (ego->identifier);
664 rename_ctx.old_name = old_name;
665 rename_ctx.new_name = new_name;
666 GNUNET_CONFIGURATION_iterate_sections (subsystem_cfg,
670 GNUNET_CONFIGURATION_write (subsystem_cfg,
672 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
673 _("Failed to write subsystem default identifier map to `%s'.\n"),
675 ego->identifier = GNUNET_strdup (new_name);
676 fn_new = get_ego_filename (ego);
677 if (0 != RENAME (fn_old, fn_new))
678 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "rename", fn_old);
679 GNUNET_free (fn_old);
680 GNUNET_free (fn_new);
681 notify_listeners (ego);
682 send_result_code (client, 0, NULL);
683 GNUNET_SERVER_receive_done (client, GNUNET_OK);
688 /* failed to locate old name */
689 send_result_code (client, 1, gettext_noop ("no matching ego found"));
690 GNUNET_SERVER_receive_done (client, GNUNET_OK);
695 * An ego was removed, remove it from all subsystems where it is
696 * currently set as the default.
698 * @param cls name of the removed ego (const char *)
699 * @param section a section in the configuration to process
702 handle_ego_delete (void *cls,
705 const char *identifier = cls;
709 GNUNET_CONFIGURATION_get_value_string (subsystem_cfg,
711 "DEFAULT_IDENTIFIER",
714 if (0 != strcmp (id, identifier))
719 GNUNET_CONFIGURATION_set_value_string (subsystem_cfg,
721 "DEFAULT_IDENTIFIER",
728 * Handler for DELETE message from client, creates
732 * @param client who sent the message
733 * @param message the message received
736 handle_delete_message (void *cls, struct GNUNET_SERVER_Client *client,
737 const struct GNUNET_MessageHeader *message)
739 const struct GNUNET_IDENTITY_DeleteMessage *dm;
746 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
747 "Received DELETE message from client\n");
748 size = ntohs (message->size);
749 if (size <= sizeof (struct GNUNET_IDENTITY_DeleteMessage))
752 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
755 dm = (const struct GNUNET_IDENTITY_DeleteMessage *) message;
756 name = (const char *) &dm[1];
757 name_len = ntohs (dm->name_len);
758 if ( (name_len + sizeof (struct GNUNET_IDENTITY_DeleteMessage) != size) ||
759 (0 != ntohs (dm->reserved)) ||
760 ('\0' != name[name_len - 1]) )
763 GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
766 for (ego = ego_head; NULL != ego; ego = ego->next)
768 if (0 == strcmp (ego->identifier,
771 GNUNET_CONTAINER_DLL_remove (ego_head,
774 GNUNET_CONFIGURATION_iterate_sections (subsystem_cfg,
778 GNUNET_CONFIGURATION_write (subsystem_cfg,
780 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
781 _("Failed to write subsystem default identifier map to `%s'.\n"),
783 fn = get_ego_filename (ego);
784 if (0 != UNLINK (fn))
785 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "unlink", fn);
787 GNUNET_free (ego->identifier);
788 ego->identifier = NULL;
789 notify_listeners (ego);
790 GNUNET_CRYPTO_ecc_key_free (ego->pk);
792 send_result_code (client, 0, NULL);
793 GNUNET_SERVER_receive_done (client, GNUNET_OK);
798 send_result_code (client, 1, gettext_noop ("no matching ego found"));
799 GNUNET_SERVER_receive_done (client, GNUNET_OK);
804 * Process the given file from the "EGODIR". Parses the file
805 * and creates the respective 'struct Ego' in memory.
808 * @param filename name of the file to parse
809 * @return GNUNET_OK to continue to iterate,
810 * GNUNET_NO to stop iteration with no error,
811 * GNUNET_SYSERR to abort iteration with error!
814 process_ego_file (void *cls,
815 const char *filename)
820 fn = strrchr (filename, (int) DIR_SEPARATOR);
826 ego = GNUNET_new (struct Ego);
827 ego->pk = GNUNET_CRYPTO_ecc_key_create_from_file (filename);
831 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
832 _("Failed to parse ego information in `%s'\n"),
837 ego->identifier = GNUNET_strdup (fn);
838 GNUNET_CONTAINER_DLL_insert (ego_head,
846 * Handle network size estimate clients.
849 * @param server the initialized server
850 * @param c configuration to use
854 struct GNUNET_SERVER_Handle *server,
855 const struct GNUNET_CONFIGURATION_Handle *c)
857 static const struct GNUNET_SERVER_MessageHandler handlers[] = {
858 {&handle_start_message, NULL,
859 GNUNET_MESSAGE_TYPE_IDENTITY_START, sizeof (struct GNUNET_MessageHeader)},
860 {&handle_get_default_message, NULL,
861 GNUNET_MESSAGE_TYPE_IDENTITY_GET_DEFAULT, 0},
862 {&handle_set_default_message, NULL,
863 GNUNET_MESSAGE_TYPE_IDENTITY_SET_DEFAULT, 0},
864 {&handle_create_message, NULL,
865 GNUNET_MESSAGE_TYPE_IDENTITY_CREATE, 0},
866 {&handle_rename_message, NULL,
867 GNUNET_MESSAGE_TYPE_IDENTITY_RENAME, 0},
868 {&handle_delete_message, NULL,
869 GNUNET_MESSAGE_TYPE_IDENTITY_DELETE, 0},
875 GNUNET_CONFIGURATION_get_value_filename (cfg, "identity",
879 GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "identity", "EGODIR");
880 GNUNET_SCHEDULER_shutdown ();
884 GNUNET_CONFIGURATION_get_value_filename (cfg, "identity",
886 &subsystem_cfg_file))
888 GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "identity", "SUBSYSTEM_CFG");
889 GNUNET_SCHEDULER_shutdown ();
892 subsystem_cfg = GNUNET_CONFIGURATION_create ();
894 GNUNET_DISK_file_test (subsystem_cfg_file)) &&
896 GNUNET_CONFIGURATION_parse (subsystem_cfg,
897 subsystem_cfg_file)) )
899 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
900 _("Failed to parse subsystem identity configuration file `%s'\n"),
902 GNUNET_SCHEDULER_shutdown ();
905 stats = GNUNET_STATISTICS_create ("identity", cfg);
906 GNUNET_SERVER_add_handlers (server, handlers);
907 nc = GNUNET_SERVER_notification_context_create (server, 1);
908 GNUNET_DISK_directory_scan (ego_directory,
911 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
917 * The main function for the network size estimation service.
919 * @param argc number of arguments from the command line
920 * @param argv command line arguments
921 * @return 0 ok, 1 on error
924 main (int argc, char *const *argv)
927 GNUNET_SERVICE_run (argc, argv, "identity",
928 GNUNET_SERVICE_OPTION_NONE,
929 &run, NULL)) ? 0 : 1;
933 /* end of gnunet-service-identity.c */