2 This file is part of GNUnet.
3 Copyright (C) 2013 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.
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 * - auto-initialze default egos; maybe trigger default
31 * initializations (such as gnunet-gns-import.sh?)
34 #include "gnunet_util_lib.h"
35 #include "gnunet_constants.h"
36 #include "gnunet_protocols.h"
37 #include "gnunet_statistics_service.h"
38 #include "gnunet_identity_service.h"
43 * Information we keep about each ego.
49 * We keep egos in a DLL.
54 * We keep egos in a DLL.
59 * Private key of the ego.
61 struct GNUNET_CRYPTO_EcdsaPrivateKey *pk;
64 * String identifier for the ego.
72 * Handle to our current configuration.
74 static const struct GNUNET_CONFIGURATION_Handle *cfg;
77 * Handle to subsystem configuration which for each subsystem contains
78 * the name of the default ego.
80 static struct GNUNET_CONFIGURATION_Handle *subsystem_cfg;
83 * Handle to the statistics service.
85 static struct GNUNET_STATISTICS_Handle *stats;
88 * Notification context, simplifies client broadcasts.
90 static struct GNUNET_NotificationContext *nc;
93 * Directory where we store the identities.
95 static char *ego_directory;
98 * Configuration file name where subsystem information is kept.
100 static char *subsystem_cfg_file;
103 * Head of DLL of all egos.
105 static struct Ego *ego_head;
108 * Tail of DLL of all egos.
110 static struct Ego *ego_tail;
114 * Get the name of the file we use to store a given ego.
116 * @param ego ego for which we need the filename
117 * @return full filename for the given ego
120 get_ego_filename (struct Ego *ego)
124 GNUNET_asprintf (&filename,
133 * Called whenever a client is disconnected.
136 * @param client identification of the client
137 * @param app_ctx @a client
140 client_disconnect_cb (void *cls,
141 struct GNUNET_SERVICE_Client *client,
144 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
145 "Client %p disconnected\n",
151 * Add a client to our list of active clients.
154 * @param client client to add
155 * @param mq message queue for @a client
156 * @return internal namestore client structure for this client
159 client_connect_cb (void *cls,
160 struct GNUNET_SERVICE_Client *client,
161 struct GNUNET_MQ_Handle *mq)
167 * Task run during shutdown.
172 shutdown_task (void *cls)
178 GNUNET_notification_context_destroy (nc);
183 GNUNET_STATISTICS_destroy (stats, GNUNET_NO);
186 GNUNET_CONFIGURATION_destroy (subsystem_cfg);
187 subsystem_cfg = NULL;
188 GNUNET_free (subsystem_cfg_file);
189 subsystem_cfg_file = NULL;
190 GNUNET_free (ego_directory);
191 ego_directory = NULL;
192 while (NULL != (e = ego_head))
194 GNUNET_CONTAINER_DLL_remove (ego_head, ego_tail, e);
196 GNUNET_free (e->identifier);
203 * Send a result code back to the client.
205 * @param client client that should receive the result code
206 * @param result_code code to transmit
207 * @param emsg error message to include (or NULL for none)
210 send_result_code (struct GNUNET_SERVICE_Client *client,
211 uint32_t result_code,
214 struct ResultCodeMessage *rcm;
215 struct GNUNET_MQ_Envelope *env;
221 elen = strlen (emsg) + 1;
222 env = GNUNET_MQ_msg_extra (rcm,
224 GNUNET_MESSAGE_TYPE_IDENTITY_RESULT_CODE);
225 rcm->result_code = htonl (result_code);
227 GNUNET_memcpy (&rcm[1], emsg, elen);
228 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
229 "Sending result %d (%s) to client\n",
232 GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq (client), env);
237 * Create an update message with information about the current state of an ego.
239 * @param ego ego to create message for
240 * @return corresponding update message
242 static struct GNUNET_MQ_Envelope *
243 create_update_message (struct Ego *ego)
245 struct UpdateMessage *um;
246 struct GNUNET_MQ_Envelope *env;
249 name_len = (NULL == ego->identifier) ? 0 : (strlen (ego->identifier) + 1);
250 env = GNUNET_MQ_msg_extra (um,
252 GNUNET_MESSAGE_TYPE_IDENTITY_UPDATE);
253 um->name_len = htons (name_len);
254 um->end_of_list = htons (GNUNET_NO);
255 um->private_key = *ego->pk;
256 GNUNET_memcpy (&um[1], ego->identifier, name_len);
262 * Create a set default message with information about the current state of an ego.
264 * @param ego ego to create message for
265 * @param servicename name of the service to provide in the message
266 * @return corresponding set default message
268 static struct GNUNET_MQ_Envelope *
269 create_set_default_message (struct Ego *ego,
270 const char *servicename)
272 struct SetDefaultMessage *sdm;
273 struct GNUNET_MQ_Envelope *env;
276 name_len = (NULL == servicename) ? 0 : (strlen (servicename) + 1);
277 env = GNUNET_MQ_msg_extra (sdm,
279 GNUNET_MESSAGE_TYPE_IDENTITY_SET_DEFAULT);
280 sdm->name_len = htons (name_len);
281 sdm->reserved = htons (0);
282 sdm->private_key = *ego->pk;
283 GNUNET_memcpy (&sdm[1], servicename, name_len);
289 * Handler for START message from client, sends information
290 * about all identities to the client immediately and
291 * adds the client to the notification context for future
295 * @param client who sent the message
296 * @param message the message received
299 handle_start_message (void *cls,
300 const struct GNUNET_MessageHeader *message)
302 struct UpdateMessage *ume;
303 struct GNUNET_SERVICE_Client *client = cls;
304 struct GNUNET_MQ_Envelope *env;
307 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
308 "Received START message from client\n");
309 GNUNET_SERVICE_client_mark_monitor (client);
310 GNUNET_SERVICE_client_disable_continue_warning (client);
311 GNUNET_notification_context_add (nc,
312 GNUNET_SERVICE_client_get_mq(client));
313 for (ego = ego_head; NULL != ego; ego = ego->next)
315 env = create_update_message (ego);
316 GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq(client), env);
318 env = GNUNET_MQ_msg_extra (ume,
320 GNUNET_MESSAGE_TYPE_IDENTITY_UPDATE);
321 ume->end_of_list = htons (GNUNET_YES);
322 ume->name_len = htons (0);
323 GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq(client), env);
324 GNUNET_SERVICE_client_continue (client);
328 * Checks a #GNUNET_MESSAGE_TYPE_IDENTITY_GET_DEFAULT message
330 * @param cls client sending the message
331 * @param msg message of type `struct GetDefaultMessage`
332 * @return #GNUNET_OK if @a msg is well-formed
335 check_get_default_message (void *cls,
336 const struct GetDefaultMessage *msg)
342 size = ntohs (msg->header.size);
343 if (size <= sizeof (struct GetDefaultMessage))
346 return GNUNET_SYSERR;
348 name = (const char *) &msg[1];
349 name_len = ntohs (msg->name_len);
350 if ( (name_len + sizeof (struct GetDefaultMessage) != size) ||
351 (0 != ntohs (msg->reserved)) ||
352 ('\0' != name[name_len - 1]) )
355 return GNUNET_SYSERR;
362 * Handler for GET_DEFAULT message from client, returns
363 * default identity for some service.
366 * @param client who sent the message
367 * @param message the message received
370 handle_get_default_message (void *cls,
371 const struct GetDefaultMessage *gdm)
373 struct GNUNET_MQ_Envelope *env;
374 struct GNUNET_SERVICE_Client *client = cls;
380 name = (const char *) &gdm[1];
381 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
382 "Received GET_DEFAULT for service `%s' from client\n",
385 GNUNET_CONFIGURATION_get_value_string (subsystem_cfg,
387 "DEFAULT_IDENTIFIER",
390 send_result_code (client, 1, gettext_noop ("no default known"));
391 GNUNET_SERVICE_client_continue (client);
394 for (ego = ego_head; NULL != ego; ego = ego->next)
396 if (0 == strcmp (ego->identifier,
399 env = create_set_default_message (ego,
401 GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq (client), env);
402 GNUNET_SERVICE_client_continue (client);
403 GNUNET_free (identifier);
407 GNUNET_free (identifier);
408 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
409 "Failed to find ego `%s'\n",
411 send_result_code (client, 1,
412 gettext_noop ("default configured, but ego unknown (internal error)"));
413 GNUNET_SERVICE_client_continue (client);
418 * Compare the given two private keys for equality.
420 * @param pk1 one private key
421 * @param pk2 another private key
422 * @return 0 if the keys are equal
425 key_cmp (const struct GNUNET_CRYPTO_EcdsaPrivateKey *pk1,
426 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pk2)
428 return memcmp (pk1, pk2, sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey));
432 * Checks a #GNUNET_MESSAGE_TYPE_IDENTITY_SET_DEFAULT message
434 * @param cls client sending the message
435 * @param msg message of type `struct SetDefaultMessage`
436 * @return #GNUNET_OK if @a msg is well-formed
439 check_set_default_message (void *cls,
440 const struct SetDefaultMessage *msg)
446 size = ntohs (msg->header.size);
447 if (size <= sizeof (struct SetDefaultMessage))
450 return GNUNET_SYSERR;
452 name_len = ntohs (msg->name_len);
453 GNUNET_break (0 == ntohs (msg->reserved));
454 if (name_len + sizeof (struct SetDefaultMessage) != size)
457 return GNUNET_SYSERR;
459 str = (const char *) &msg[1];
460 if ('\0' != str[name_len - 1])
463 return GNUNET_SYSERR;
469 * Handler for SET_DEFAULT message from client, updates
470 * default identity for some service.
473 * @param client who sent the message
474 * @param message the message received
477 handle_set_default_message (void *cls,
478 const struct SetDefaultMessage *sdm)
481 struct GNUNET_SERVICE_Client *client = cls;
484 str = (const char *) &sdm[1];
485 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
486 "Received SET_DEFAULT for service `%s' from client\n",
488 for (ego = ego_head; NULL != ego; ego = ego->next)
490 if (0 == key_cmp (ego->pk,
493 GNUNET_CONFIGURATION_set_value_string (subsystem_cfg,
495 "DEFAULT_IDENTIFIER",
498 GNUNET_CONFIGURATION_write (subsystem_cfg,
500 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
501 _("Failed to write subsystem default identifier map to `%s'.\n"),
503 send_result_code (client, 0, NULL);
504 GNUNET_SERVICE_client_continue (client);
508 send_result_code (client, 1, _("Unknown ego specified for service (internal error)"));
509 GNUNET_SERVICE_client_continue (client);
514 * Send an updated message for the given ego to all listeners.
516 * @param ego ego to send the update for
519 notify_listeners (struct Ego *ego)
521 struct UpdateMessage *um;
524 name_len = (NULL == ego->identifier) ? 0 : (strlen (ego->identifier) + 1);
525 um = GNUNET_malloc (sizeof (struct UpdateMessage) + name_len);
526 um->header.type = htons (GNUNET_MESSAGE_TYPE_IDENTITY_UPDATE);
527 um->header.size = htons (sizeof (struct UpdateMessage) + name_len);
528 um->name_len = htons (name_len);
529 um->end_of_list = htons (GNUNET_NO);
530 um->private_key = *ego->pk;
531 GNUNET_memcpy (&um[1], ego->identifier, name_len);
532 GNUNET_notification_context_broadcast (nc,
539 * Checks a #GNUNET_MESSAGE_TYPE_IDENTITY_CREATE message
541 * @param cls client sending the message
542 * @param msg message of type `struct CreateRequestMessage`
543 * @return #GNUNET_OK if @a msg is well-formed
546 check_create_message (void *cls,
547 const struct CreateRequestMessage *msg)
554 size = ntohs (msg->header.size);
555 if (size <= sizeof (struct CreateRequestMessage))
558 return GNUNET_SYSERR;
560 name_len = ntohs (msg->name_len);
561 GNUNET_break (0 == ntohs (msg->reserved));
562 if (name_len + sizeof (struct CreateRequestMessage) != size)
565 return GNUNET_SYSERR;
567 str = (const char *) &msg[1];
568 if ('\0' != str[name_len - 1])
571 return GNUNET_SYSERR;
577 * Handler for CREATE message from client, creates
581 * @param client who sent the message
582 * @param message the message received
585 handle_create_message (void *cls,
586 const struct CreateRequestMessage *crm)
588 struct GNUNET_SERVICE_Client *client = cls;
593 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
594 "Received CREATE message from client\n");
595 str = (const char *) &crm[1];
596 for (ego = ego_head; NULL != ego; ego = ego->next)
598 if (0 == strcmp (ego->identifier,
601 send_result_code (client, 1, gettext_noop ("identifier already in use for another ego"));
602 GNUNET_SERVICE_client_continue (client);
606 ego = GNUNET_new (struct Ego);
607 ego->pk = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPrivateKey);
608 *ego->pk = crm->private_key;
609 ego->identifier = GNUNET_strdup (str);
610 GNUNET_CONTAINER_DLL_insert (ego_head,
613 send_result_code (client, 0, NULL);
614 fn = get_ego_filename (ego);
615 (void) GNUNET_DISK_directory_create_for_file (fn);
616 if (sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey) !=
617 GNUNET_DISK_fn_write (fn,
619 sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey),
620 GNUNET_DISK_PERM_USER_READ |
621 GNUNET_DISK_PERM_USER_WRITE))
622 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
625 notify_listeners (ego);
626 GNUNET_SERVICE_client_continue (client);
631 * Closure for 'handle_ego_rename'.
638 const char *old_name;
643 const char *new_name;
647 * An ego was renamed; rename it in all subsystems where it is
648 * currently set as the default.
650 * @param cls the 'struct RenameContext'
651 * @param section a section in the configuration to process
654 handle_ego_rename (void *cls,
657 struct RenameContext *rc = cls;
661 GNUNET_CONFIGURATION_get_value_string (subsystem_cfg,
663 "DEFAULT_IDENTIFIER",
666 if (0 != strcmp (id, rc->old_name))
671 GNUNET_CONFIGURATION_set_value_string (subsystem_cfg,
673 "DEFAULT_IDENTIFIER",
679 * Checks a #GNUNET_MESSAGE_TYPE_IDENTITY_RENAME message
681 * @param cls client sending the message
682 * @param msg message of type `struct RenameMessage`
683 * @return #GNUNET_OK if @a msg is well-formed
686 check_rename_message (void *cls,
687 const struct RenameMessage *msg)
690 uint16_t old_name_len;
691 uint16_t new_name_len;
692 const char *old_name;
693 const char *new_name;
695 size = ntohs (msg->header.size);
696 if (size <= sizeof (struct RenameMessage))
699 return GNUNET_SYSERR;
701 old_name_len = ntohs (msg->old_name_len);
702 new_name_len = ntohs (msg->new_name_len);
703 old_name = (const char *) &msg[1];
704 new_name = &old_name[old_name_len];
705 if ( (old_name_len + new_name_len + sizeof (struct RenameMessage) != size) ||
706 ('\0' != old_name[old_name_len - 1]) ||
707 ('\0' != new_name[new_name_len - 1]) )
710 return GNUNET_SYSERR;
718 * Handler for RENAME message from client, creates
722 * @param client who sent the message
723 * @param message the message received
726 handle_rename_message (void *cls,
727 const struct RenameMessage *rm)
729 uint16_t old_name_len;
731 const char *old_name;
732 const char *new_name;
733 struct RenameContext rename_ctx;
734 struct GNUNET_SERVICE_Client *client = cls;
738 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
739 "Received RENAME message from client\n");
740 old_name_len = ntohs (rm->old_name_len);
741 old_name = (const char *) &rm[1];
742 new_name = &old_name[old_name_len];
744 /* check if new name is already in use */
745 for (ego = ego_head; NULL != ego; ego = ego->next)
747 if (0 == strcmp (ego->identifier,
750 send_result_code (client, 1, gettext_noop ("target name already exists"));
751 GNUNET_SERVICE_client_continue (client);
756 /* locate old name and, if found, perform rename */
757 for (ego = ego_head; NULL != ego; ego = ego->next)
759 if (0 == strcmp (ego->identifier,
762 fn_old = get_ego_filename (ego);
763 GNUNET_free (ego->identifier);
764 rename_ctx.old_name = old_name;
765 rename_ctx.new_name = new_name;
766 GNUNET_CONFIGURATION_iterate_sections (subsystem_cfg,
770 GNUNET_CONFIGURATION_write (subsystem_cfg,
772 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
773 _("Failed to write subsystem default identifier map to `%s'.\n"),
775 ego->identifier = GNUNET_strdup (new_name);
776 fn_new = get_ego_filename (ego);
777 if (0 != RENAME (fn_old, fn_new))
778 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "rename", fn_old);
779 GNUNET_free (fn_old);
780 GNUNET_free (fn_new);
781 notify_listeners (ego);
782 send_result_code (client, 0, NULL);
783 GNUNET_SERVICE_client_continue (client);
788 /* failed to locate old name */
789 send_result_code (client, 1, gettext_noop ("no matching ego found"));
790 GNUNET_SERVICE_client_continue (client);
795 * An ego was removed, remove it from all subsystems where it is
796 * currently set as the default.
798 * @param cls name of the removed ego (const char *)
799 * @param section a section in the configuration to process
802 handle_ego_delete (void *cls,
805 const char *identifier = cls;
809 GNUNET_CONFIGURATION_get_value_string (subsystem_cfg,
811 "DEFAULT_IDENTIFIER",
814 if (0 != strcmp (id, identifier))
819 GNUNET_CONFIGURATION_set_value_string (subsystem_cfg,
821 "DEFAULT_IDENTIFIER",
827 * Checks a #GNUNET_MESSAGE_TYPE_IDENTITY_DELETE message
829 * @param cls client sending the message
830 * @param msg message of type `struct DeleteMessage`
831 * @return #GNUNET_OK if @a msg is well-formed
834 check_delete_message (void *cls,
835 const struct DeleteMessage *msg)
841 size = ntohs (msg->header.size);
842 if (size <= sizeof (struct DeleteMessage))
845 return GNUNET_SYSERR;
847 name = (const char *) &msg[1];
848 name_len = ntohs (msg->name_len);
849 if ( (name_len + sizeof (struct DeleteMessage) != size) ||
850 (0 != ntohs (msg->reserved)) ||
851 ('\0' != name[name_len - 1]) )
854 return GNUNET_SYSERR;
861 * Handler for DELETE message from client, creates
865 * @param client who sent the message
866 * @param message the message received
869 handle_delete_message (void *cls,
870 const struct DeleteMessage *dm)
875 struct GNUNET_SERVICE_Client *client = cls;
877 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
878 "Received DELETE message from client\n");
879 name = (const char *) &dm[1];
880 for (ego = ego_head; NULL != ego; ego = ego->next)
882 if (0 == strcmp (ego->identifier,
885 GNUNET_CONTAINER_DLL_remove (ego_head,
888 GNUNET_CONFIGURATION_iterate_sections (subsystem_cfg,
892 GNUNET_CONFIGURATION_write (subsystem_cfg,
894 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
895 _("Failed to write subsystem default identifier map to `%s'.\n"),
897 fn = get_ego_filename (ego);
898 if (0 != UNLINK (fn))
899 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "unlink", fn);
901 GNUNET_free (ego->identifier);
902 ego->identifier = NULL;
903 notify_listeners (ego);
904 GNUNET_free (ego->pk);
906 send_result_code (client, 0, NULL);
907 GNUNET_SERVICE_client_continue (client);
912 send_result_code (client, 1, gettext_noop ("no matching ego found"));
913 GNUNET_SERVICE_client_continue (client);
918 * Process the given file from the "EGODIR". Parses the file
919 * and creates the respective 'struct Ego' in memory.
922 * @param filename name of the file to parse
923 * @return #GNUNET_OK to continue to iterate,
924 * #GNUNET_NO to stop iteration with no error,
925 * #GNUNET_SYSERR to abort iteration with error!
928 process_ego_file (void *cls,
929 const char *filename)
934 fn = strrchr (filename, (int) DIR_SEPARATOR);
940 ego = GNUNET_new (struct Ego);
941 ego->pk = GNUNET_CRYPTO_ecdsa_key_create_from_file (filename);
945 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
946 _("Failed to parse ego information in `%s'\n"),
950 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
953 ego->identifier = GNUNET_strdup (fn + 1);
954 GNUNET_CONTAINER_DLL_insert (ego_head,
962 * Handle network size estimate clients.
965 * @param server the initialized server
966 * @param c configuration to use
970 const struct GNUNET_CONFIGURATION_Handle *c,
971 struct GNUNET_SERVICE_Handle *service)
974 nc = GNUNET_notification_context_create (1);
976 GNUNET_CONFIGURATION_get_value_filename (cfg, "identity",
980 GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "identity", "EGODIR");
981 GNUNET_SCHEDULER_shutdown ();
985 GNUNET_CONFIGURATION_get_value_filename (cfg, "identity",
987 &subsystem_cfg_file))
989 GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "identity", "SUBSYSTEM_CFG");
990 GNUNET_SCHEDULER_shutdown ();
993 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
994 "Loading subsystem configuration `%s'\n",
996 subsystem_cfg = GNUNET_CONFIGURATION_create ();
998 GNUNET_DISK_file_test (subsystem_cfg_file)) &&
1000 GNUNET_CONFIGURATION_parse (subsystem_cfg,
1001 subsystem_cfg_file)) )
1003 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1004 _("Failed to parse subsystem identity configuration file `%s'\n"),
1005 subsystem_cfg_file);
1006 GNUNET_SCHEDULER_shutdown ();
1009 stats = GNUNET_STATISTICS_create ("identity", cfg);
1011 GNUNET_DISK_directory_create (ego_directory))
1013 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1014 _("Failed to create directory `%s' for storing egos\n"),
1017 GNUNET_DISK_directory_scan (ego_directory,
1020 GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
1026 * Define "main" method using service macro.
1030 GNUNET_SERVICE_OPTION_NONE,
1033 &client_disconnect_cb,
1035 GNUNET_MQ_hd_fixed_size (start_message,
1036 GNUNET_MESSAGE_TYPE_IDENTITY_START,
1037 struct GNUNET_MessageHeader,
1039 GNUNET_MQ_hd_var_size (get_default_message,
1040 GNUNET_MESSAGE_TYPE_IDENTITY_GET_DEFAULT,
1041 struct GetDefaultMessage,
1043 GNUNET_MQ_hd_var_size (set_default_message,
1044 GNUNET_MESSAGE_TYPE_IDENTITY_SET_DEFAULT,
1045 struct SetDefaultMessage,
1047 GNUNET_MQ_hd_var_size (create_message,
1048 GNUNET_MESSAGE_TYPE_IDENTITY_CREATE,
1049 struct CreateRequestMessage,
1051 GNUNET_MQ_hd_var_size (rename_message,
1052 GNUNET_MESSAGE_TYPE_IDENTITY_RENAME,
1053 struct RenameMessage,
1055 GNUNET_MQ_hd_var_size (delete_message,
1056 GNUNET_MESSAGE_TYPE_IDENTITY_DELETE,
1057 struct DeleteMessage,
1059 GNUNET_MQ_handler_end());
1063 /* end of gnunet-service-identity.c */