diff options
25 files changed, 455 insertions, 588 deletions
diff --git a/src/arm/gnunet-arm.c b/src/arm/gnunet-arm.c index c631ec4808..4e6d6f9651 100644 --- a/src/arm/gnunet-arm.c +++ b/src/arm/gnunet-arm.c @@ -357,31 +357,6 @@ cps_loop (void *cls, /** - * gnunet-arm command line options - */ -static struct GNUNET_GETOPT_CommandLineOption options[] = { - {'e', "end", NULL, gettext_noop ("stop all GNUnet services"), - GNUNET_NO, &GNUNET_GETOPT_set_one, &end}, - {'i', "init", "SERVICE", gettext_noop ("start a particular service"), - GNUNET_YES, &GNUNET_GETOPT_set_string, &init}, - {'k', "kill", "SERVICE", gettext_noop ("stop a particular service"), - GNUNET_YES, &GNUNET_GETOPT_set_string, &term}, - {'s', "start", NULL, gettext_noop ("start all GNUnet default services"), - GNUNET_NO, &GNUNET_GETOPT_set_one, &start}, - {'r', "restart", NULL, gettext_noop ("stop and start all GNUnet default services"), - GNUNET_NO, &GNUNET_GETOPT_set_one, &restart}, - {'t', "test", "SERVICE", - gettext_noop ("test if a particular service is running"), - GNUNET_YES, &GNUNET_GETOPT_set_string, &test}, - {'d', "delete", NULL, gettext_noop ("delete config file and directory on exit"), - GNUNET_NO, &GNUNET_GETOPT_set_one, &delete}, - {'q', "quiet", NULL, gettext_noop ("don't print status messages"), - GNUNET_NO, &GNUNET_GETOPT_set_one, &quiet}, - GNUNET_GETOPT_OPTION_END -}; - - -/** * The main function to obtain arm from gnunetd. * * @param argc number of arguments from the command line @@ -391,6 +366,26 @@ static struct GNUNET_GETOPT_CommandLineOption options[] = { int main (int argc, char *const *argv) { + static const struct GNUNET_GETOPT_CommandLineOption options[] = { + {'e', "end", NULL, gettext_noop ("stop all GNUnet services"), + GNUNET_NO, &GNUNET_GETOPT_set_one, &end}, + {'i', "init", "SERVICE", gettext_noop ("start a particular service"), + GNUNET_YES, &GNUNET_GETOPT_set_string, &init}, + {'k', "kill", "SERVICE", gettext_noop ("stop a particular service"), + GNUNET_YES, &GNUNET_GETOPT_set_string, &term}, + {'s', "start", NULL, gettext_noop ("start all GNUnet default services"), + GNUNET_NO, &GNUNET_GETOPT_set_one, &start}, + {'r', "restart", NULL, gettext_noop ("stop and start all GNUnet default services"), + GNUNET_NO, &GNUNET_GETOPT_set_one, &restart}, + {'t', "test", "SERVICE", + gettext_noop ("test if a particular service is running"), + GNUNET_YES, &GNUNET_GETOPT_set_string, &test}, + {'d', "delete", NULL, gettext_noop ("delete config file and directory on exit"), + GNUNET_NO, &GNUNET_GETOPT_set_one, &delete}, + {'q', "quiet", NULL, gettext_noop ("don't print status messages"), + GNUNET_NO, &GNUNET_GETOPT_set_one, &quiet}, + GNUNET_GETOPT_OPTION_END + }; return (GNUNET_OK == GNUNET_PROGRAM_run (argc, argv, diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c index 52c7dec209..ab96906a72 100644 --- a/src/arm/gnunet-service-arm.c +++ b/src/arm/gnunet-service-arm.c @@ -986,17 +986,6 @@ handle_shutdown (void *cls, /** - * List of handlers for the messages understood by this service. - */ -static struct GNUNET_SERVER_MessageHandler handlers[] = { - {&handle_start, NULL, GNUNET_MESSAGE_TYPE_ARM_START, 0}, - {&handle_stop, NULL, GNUNET_MESSAGE_TYPE_ARM_STOP, 0}, - {&handle_shutdown, NULL, GNUNET_MESSAGE_TYPE_ARM_SHUTDOWN, - sizeof (struct GNUNET_MessageHeader)}, - {NULL, NULL, 0, 0} -}; - -/** * Signal handler called for SIGCHLD. Triggers the * respective handler by writing to the trigger pipe. */ @@ -1025,6 +1014,13 @@ run (void *cls, struct GNUNET_SERVER_Handle *serv, const struct GNUNET_CONFIGURATION_Handle *c) { + static const struct GNUNET_SERVER_MessageHandler handlers[] = { + {&handle_start, NULL, GNUNET_MESSAGE_TYPE_ARM_START, 0}, + {&handle_stop, NULL, GNUNET_MESSAGE_TYPE_ARM_STOP, 0}, + {&handle_shutdown, NULL, GNUNET_MESSAGE_TYPE_ARM_SHUTDOWN, + sizeof (struct GNUNET_MessageHeader)}, + {NULL, NULL, 0, 0} + }; char *defaultservices; char *pos; diff --git a/src/arm/mockup-service.c b/src/arm/mockup-service.c index 8a49406301..2f1baab9c4 100644 --- a/src/arm/mockup-service.c +++ b/src/arm/mockup-service.c @@ -81,25 +81,17 @@ handle_shutdown (void *cls, } -/** - * Default handlers for all services. Will be copied and the - * "callback_cls" fields will be replaced with the specific service - * struct. - */ -static const struct GNUNET_SERVER_MessageHandler handlers[] = { - {&handle_shutdown, NULL, GNUNET_MESSAGE_TYPE_ARM_SHUTDOWN, - sizeof (struct GNUNET_MessageHeader)}, - {NULL, NULL, 0, 0} -}; - - - static void run (void *cls, struct GNUNET_SCHEDULER_Handle *s, struct GNUNET_SERVER_Handle *server, const struct GNUNET_CONFIGURATION_Handle *cfg) { + static const struct GNUNET_SERVER_MessageHandler handlers[] = { + {&handle_shutdown, NULL, GNUNET_MESSAGE_TYPE_ARM_SHUTDOWN, + sizeof (struct GNUNET_MessageHeader)}, + {NULL, NULL, 0, 0} + }; sched = s; /* process client requests */ GNUNET_SERVER_ignore_shutdown (server, GNUNET_YES); diff --git a/src/core/gnunet-service-core.c b/src/core/gnunet-service-core.c index 97ed573605..7a2111e0e0 100644 --- a/src/core/gnunet-service-core.c +++ b/src/core/gnunet-service-core.c @@ -2351,25 +2351,6 @@ handle_client_request_connect (void *cls, /** - * List of handlers for the messages understood by this - * service. - */ -static struct GNUNET_SERVER_MessageHandler handlers[] = { - {&handle_client_init, NULL, - GNUNET_MESSAGE_TYPE_CORE_INIT, 0}, - {&handle_client_request_info, NULL, - GNUNET_MESSAGE_TYPE_CORE_REQUEST_INFO, - sizeof (struct RequestInfoMessage)}, - {&handle_client_send, NULL, - GNUNET_MESSAGE_TYPE_CORE_SEND, 0}, - {&handle_client_request_connect, NULL, - GNUNET_MESSAGE_TYPE_CORE_REQUEST_CONNECT, - sizeof (struct ConnectMessage)}, - {NULL, NULL, 0, 0} -}; - - -/** * PEERINFO is giving us a HELLO for a peer. Add the public key to * the neighbour's struct and retry send_key. Or, if we did not get a * HELLO, just do nothing. @@ -3834,6 +3815,19 @@ run (void *cls, struct GNUNET_SERVER_Handle *serv, const struct GNUNET_CONFIGURATION_Handle *c) { + static const struct GNUNET_SERVER_MessageHandler handlers[] = { + {&handle_client_init, NULL, + GNUNET_MESSAGE_TYPE_CORE_INIT, 0}, + {&handle_client_request_info, NULL, + GNUNET_MESSAGE_TYPE_CORE_REQUEST_INFO, + sizeof (struct RequestInfoMessage)}, + {&handle_client_send, NULL, + GNUNET_MESSAGE_TYPE_CORE_SEND, 0}, + {&handle_client_request_connect, NULL, + GNUNET_MESSAGE_TYPE_CORE_REQUEST_CONNECT, + sizeof (struct ConnectMessage)}, + {NULL, NULL, 0, 0} + }; char *keyfile; sched = s; diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c index 64d1ce3637..ddab5cdf39 100644 --- a/src/datastore/gnunet-service-datastore.c +++ b/src/datastore/gnunet-service-datastore.c @@ -1239,29 +1239,6 @@ handle_drop (void *cls, /** - * List of handlers for the messages understood by this - * service. - */ -static struct GNUNET_SERVER_MessageHandler handlers[] = { - {&handle_reserve, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_RESERVE, - sizeof(struct ReserveMessage) }, - {&handle_release_reserve, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_RELEASE_RESERVE, - sizeof(struct ReleaseReserveMessage) }, - {&handle_put, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_PUT, 0 }, - {&handle_update, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_UPDATE, - sizeof (struct UpdateMessage) }, - {&handle_get, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_GET, 0 }, - {&handle_get_random, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_GET_RANDOM, - sizeof(struct GNUNET_MessageHeader) }, - {&handle_remove, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_REMOVE, 0 }, - {&handle_drop, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_DROP, - sizeof(struct GNUNET_MessageHeader) }, - {NULL, NULL, 0, 0} -}; - - - -/** * Load the datastore plugin. */ static struct DatastorePlugin * @@ -1443,6 +1420,22 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, const struct GNUNET_CONFIGURATION_Handle *c) { + static const struct GNUNET_SERVER_MessageHandler handlers[] = { + {&handle_reserve, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_RESERVE, + sizeof(struct ReserveMessage) }, + {&handle_release_reserve, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_RELEASE_RESERVE, + sizeof(struct ReleaseReserveMessage) }, + {&handle_put, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_PUT, 0 }, + {&handle_update, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_UPDATE, + sizeof (struct UpdateMessage) }, + {&handle_get, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_GET, 0 }, + {&handle_get_random, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_GET_RANDOM, + sizeof(struct GNUNET_MessageHeader) }, + {&handle_remove, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_REMOVE, 0 }, + {&handle_drop, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_DROP, + sizeof(struct GNUNET_MessageHeader) }, + {NULL, NULL, 0, 0} + }; char *fn; unsigned int bf_size; diff --git a/src/fs/gnunet-directory.c b/src/fs/gnunet-directory.c index c1a7c78f37..1b17f69d24 100644 --- a/src/fs/gnunet-directory.c +++ b/src/fs/gnunet-directory.c @@ -167,14 +167,6 @@ run (void *cls, } /** - * gnunet-directory command line options - */ -static struct GNUNET_GETOPT_CommandLineOption options[] = { - GNUNET_GETOPT_OPTION_END -}; - - -/** * The main function to inspect GNUnet directories. * * @param argc number of arguments from the command line @@ -184,6 +176,9 @@ static struct GNUNET_GETOPT_CommandLineOption options[] = { int main (int argc, char *const *argv) { + static struct GNUNET_GETOPT_CommandLineOption options[] = { + GNUNET_GETOPT_OPTION_END + }; return (GNUNET_OK == GNUNET_PROGRAM_run (argc, argv, diff --git a/src/fs/gnunet-download.c b/src/fs/gnunet-download.c index fde254d7ca..a171006cb5 100644 --- a/src/fs/gnunet-download.c +++ b/src/fs/gnunet-download.c @@ -253,40 +253,6 @@ run (void *cls, /** - * gnunet-download command line options - */ -static struct GNUNET_GETOPT_CommandLineOption options[] = { - {'a', "anonymity", "LEVEL", - gettext_noop ("set the desired LEVEL of receiver-anonymity"), - 1, &GNUNET_GETOPT_set_uint, &anonymity}, - {'D', "delete-incomplete", NULL, - gettext_noop ("delete incomplete downloads (when aborted with CTRL-C)"), - 0, &GNUNET_GETOPT_set_one, &delete_incomplete}, - {'n', "no-network", NULL, - gettext_noop ("only search the local peer (no P2P network search)"), - 1, &GNUNET_GETOPT_set_uint, &local_only}, - {'o', "output", "FILENAME", - gettext_noop ("write the file to FILENAME"), - 1, &GNUNET_GETOPT_set_string, &filename}, - {'p', "parallelism", "DOWNLOADS", - gettext_noop - ("set the maximum number of parallel downloads that is allowed"), - 1, &GNUNET_GETOPT_set_uint, ¶llelism}, - {'r', "request-parallelism", "REQUESTS", - gettext_noop - ("set the maximum number of parallel requests for blocks that is allowed"), - 1, &GNUNET_GETOPT_set_uint, &request_parallelism}, - {'R', "recursive", NULL, - gettext_noop ("download a GNUnet directory recursively"), - 0, &GNUNET_GETOPT_set_one, &do_recursive}, - {'V', "verbose", NULL, - gettext_noop ("be verbose (print progress information)"), - 0, &GNUNET_GETOPT_set_one, &verbose}, - GNUNET_GETOPT_OPTION_END -}; - - -/** * The main function to download GNUnet. * * @param argc number of arguments from the command line @@ -296,6 +262,35 @@ static struct GNUNET_GETOPT_CommandLineOption options[] = { int main (int argc, char *const *argv) { + static const struct GNUNET_GETOPT_CommandLineOption options[] = { + {'a', "anonymity", "LEVEL", + gettext_noop ("set the desired LEVEL of receiver-anonymity"), + 1, &GNUNET_GETOPT_set_uint, &anonymity}, + {'D', "delete-incomplete", NULL, + gettext_noop ("delete incomplete downloads (when aborted with CTRL-C)"), + 0, &GNUNET_GETOPT_set_one, &delete_incomplete}, + {'n', "no-network", NULL, + gettext_noop ("only search the local peer (no P2P network search)"), + 1, &GNUNET_GETOPT_set_uint, &local_only}, + {'o', "output", "FILENAME", + gettext_noop ("write the file to FILENAME"), + 1, &GNUNET_GETOPT_set_string, &filename}, + {'p', "parallelism", "DOWNLOADS", + gettext_noop + ("set the maximum number of parallel downloads that is allowed"), + 1, &GNUNET_GETOPT_set_uint, ¶llelism}, + {'r', "request-parallelism", "REQUESTS", + gettext_noop + ("set the maximum number of parallel requests for blocks that is allowed"), + 1, &GNUNET_GETOPT_set_uint, &request_parallelism}, + {'R', "recursive", NULL, + gettext_noop ("download a GNUnet directory recursively"), + 0, &GNUNET_GETOPT_set_one, &do_recursive}, + {'V', "verbose", NULL, + gettext_noop ("be verbose (print progress information)"), + 0, &GNUNET_GETOPT_set_one, &verbose}, + GNUNET_GETOPT_OPTION_END + }; return (GNUNET_OK == GNUNET_PROGRAM_run (argc, argv, diff --git a/src/fs/gnunet-pseudonym.c b/src/fs/gnunet-pseudonym.c index 9f85f05457..465cbdd684 100644 --- a/src/fs/gnunet-pseudonym.c +++ b/src/fs/gnunet-pseudonym.c @@ -326,55 +326,6 @@ run (void *cls, post_advertising (NULL, NULL, NULL); } -/** - * gnunet-pseudonym command line options - */ -static struct GNUNET_GETOPT_CommandLineOption options[] = { - {'a', "anonymity", "LEVEL", - gettext_noop ("set the desired LEVEL of sender-anonymity"), - 1, &GNUNET_GETOPT_set_uint, &anonymity}, - {'A', "automate", NULL, - gettext_noop ("start a collection"), - 0, &GNUNET_GETOPT_set_one, &start_automate}, - {'C', "create", "NAME", - gettext_noop - ("create or advertise namespace NAME"), - 1, &GNUNET_GETOPT_set_string, &create_ns}, - {'D', "delete", "NAME", - gettext_noop - ("delete namespace NAME "), - 1, &GNUNET_GETOPT_set_string, &delete_ns}, - {'e', "end", NULL, - gettext_noop ("end current collection"), - 0, &GNUNET_GETOPT_set_one, &stop_automate}, - {'k', "keyword", "VALUE", - gettext_noop - ("add an additional keyword for the advertisment" - " (this option can be specified multiple times)"), - 1, &GNUNET_FS_getopt_set_keywords, &ksk_uri}, - {'m', "meta", "TYPE:VALUE", - gettext_noop ("set the meta-data for the given TYPE to the given VALUE"), - 1, &GNUNET_FS_getopt_set_metadata, &adv_metadata}, - {'o', "only-local", NULL, - gettext_noop ("print names of local namespaces"), - 0, &GNUNET_GETOPT_set_one, &print_local_only}, - {'p', "priority", "PRIORITY", - gettext_noop ("use the given PRIORITY for the advertisments"), - 1, &GNUNET_GETOPT_set_uint, &priority}, - {'q', "quiet", NULL, - gettext_noop ("do not print names of remote namespaces"), - 0, &GNUNET_GETOPT_set_one, &no_remote_printing}, - {'r', "root", "ID", - gettext_noop - ("specify ID of the root of the namespace"), - 1, &GNUNET_GETOPT_set_string, &root_identifier}, - {'s', "set-rating", "ID:VALUE", - gettext_noop - ("change rating of namespace ID by VALUE"), - 1, &GNUNET_GETOPT_set_string, &rating_change}, - GNUNET_GETOPT_OPTION_END -}; - /** * The main function to inspect GNUnet directories. @@ -386,6 +337,51 @@ static struct GNUNET_GETOPT_CommandLineOption options[] = { int main (int argc, char *const *argv) { + static const struct GNUNET_GETOPT_CommandLineOption options[] = { + {'a', "anonymity", "LEVEL", + gettext_noop ("set the desired LEVEL of sender-anonymity"), + 1, &GNUNET_GETOPT_set_uint, &anonymity}, + {'A', "automate", NULL, + gettext_noop ("start a collection"), + 0, &GNUNET_GETOPT_set_one, &start_automate}, + {'C', "create", "NAME", + gettext_noop + ("create or advertise namespace NAME"), + 1, &GNUNET_GETOPT_set_string, &create_ns}, + {'D', "delete", "NAME", + gettext_noop + ("delete namespace NAME "), + 1, &GNUNET_GETOPT_set_string, &delete_ns}, + {'e', "end", NULL, + gettext_noop ("end current collection"), + 0, &GNUNET_GETOPT_set_one, &stop_automate}, + {'k', "keyword", "VALUE", + gettext_noop + ("add an additional keyword for the advertisment" + " (this option can be specified multiple times)"), + 1, &GNUNET_FS_getopt_set_keywords, &ksk_uri}, + {'m', "meta", "TYPE:VALUE", + gettext_noop ("set the meta-data for the given TYPE to the given VALUE"), + 1, &GNUNET_FS_getopt_set_metadata, &adv_metadata}, + {'o', "only-local", NULL, + gettext_noop ("print names of local namespaces"), + 0, &GNUNET_GETOPT_set_one, &print_local_only}, + {'p', "priority", "PRIORITY", + gettext_noop ("use the given PRIORITY for the advertisments"), + 1, &GNUNET_GETOPT_set_uint, &priority}, + {'q', "quiet", NULL, + gettext_noop ("do not print names of remote namespaces"), + 0, &GNUNET_GETOPT_set_one, &no_remote_printing}, + {'r', "root", "ID", + gettext_noop + ("specify ID of the root of the namespace"), + 1, &GNUNET_GETOPT_set_string, &root_identifier}, + {'s', "set-rating", "ID:VALUE", + gettext_noop + ("change rating of namespace ID by VALUE"), + 1, &GNUNET_GETOPT_set_string, &rating_change}, + GNUNET_GETOPT_OPTION_END + }; return (GNUNET_OK == GNUNET_PROGRAM_run (argc, argv, diff --git a/src/fs/gnunet-publish.c b/src/fs/gnunet-publish.c index 8313c2467e..18c4fd78e3 100644 --- a/src/fs/gnunet-publish.c +++ b/src/fs/gnunet-publish.c @@ -524,7 +524,7 @@ run (void *cls, &ex)) { if (strlen (ex) > 0) - l = EXTRACTOR_plugin_add_config (l, ex, EXTRACTOR_OPTION_DEFAULT_POLICY); + plugins = EXTRACTOR_plugin_add_config (plugins, ex, EXTRACTOR_OPTION_DEFAULT_POLICY); GNUNET_free (ex); } } @@ -555,7 +555,7 @@ run (void *cls, meta = GNUNET_CONTAINER_meta_data_create (); GNUNET_FS_meta_data_extract_from_file (meta, args[0], - l); + plugins); fi = GNUNET_FS_file_information_create_from_file (ctx, NULL, args[0], @@ -615,66 +615,6 @@ run (void *cls, } -/** - * gnunet-publish command line options - */ -static struct GNUNET_GETOPT_CommandLineOption options[] = { - {'a', "anonymity", "LEVEL", - gettext_noop ("set the desired LEVEL of sender-anonymity"), - 1, &GNUNET_GETOPT_set_uint, &anonymity}, - {'d', "disable-creation-time", NULL, - gettext_noop - ("disable adding the creation time to the metadata of the uploaded file"), - 0, &GNUNET_GETOPT_set_one, &do_disable_creation_time}, - {'D', "disable-extractor", NULL, - gettext_noop - ("do not use libextractor to add keywords or metadata"), - 0, &GNUNET_GETOPT_set_one, &disable_extractor}, - {'e', "extract", NULL, - gettext_noop - ("print list of extracted keywords that would be used, but do not perform upload"), - 0, &GNUNET_GETOPT_set_one, &extract_only}, - {'k', "key", "KEYWORD", - gettext_noop - ("add an additional keyword for the top-level file or directory" - " (this option can be specified multiple times)"), - 1, &GNUNET_FS_getopt_set_keywords, &topKeywords}, - {'m', "meta", "TYPE:VALUE", - gettext_noop ("set the meta-data for the given TYPE to the given VALUE"), - 1, &GNUNET_FS_getopt_set_metadata, &meta}, - {'n', "noindex", NULL, - gettext_noop ("do not index, perform full insertion (stores entire " - "file in encrypted form in GNUnet database)"), - 0, &GNUNET_GETOPT_set_one, &do_insert}, - {'N', "next", "ID", - gettext_noop - ("specify ID of an updated version to be published in the future" - " (for namespace insertions only)"), - 1, &GNUNET_GETOPT_set_string, &next_id}, - {'p', "priority", "PRIORITY", - gettext_noop ("specify the priority of the content"), - 1, &GNUNET_GETOPT_set_uint, &priority}, - {'P', "pseudonym", "NAME", - gettext_noop - ("publish the files under the pseudonym NAME (place file into namespace)"), - 1, &GNUNET_GETOPT_set_string, &pseudonym}, - {'s', "simulate-only", NULL, - gettext_noop ("only simulate the process but do not do any " - "actual publishing (useful to compute URIs)"), - 0, &GNUNET_GETOPT_set_one, &do_simulate}, - {'t', "this", "ID", - gettext_noop ("set the ID of this version of the publication" - " (for namespace insertions only)"), - 1, &GNUNET_GETOPT_set_string, &this_id}, - {'u', "uri", "URI", - gettext_noop ("URI to be published (can be used instead of passing a " - "file to add keywords to the file with the respective URI)"), - 1, &GNUNET_GETOPT_set_string, &uri_string}, - {'V', "verbose", NULL, - gettext_noop ("be verbose (print progress information)"), - 0, &GNUNET_GETOPT_set_one, &verbose}, - GNUNET_GETOPT_OPTION_END -}; /** @@ -687,6 +627,63 @@ static struct GNUNET_GETOPT_CommandLineOption options[] = { int main (int argc, char *const *argv) { + static const struct GNUNET_GETOPT_CommandLineOption options[] = { + {'a', "anonymity", "LEVEL", + gettext_noop ("set the desired LEVEL of sender-anonymity"), + 1, &GNUNET_GETOPT_set_uint, &anonymity}, + {'d', "disable-creation-time", NULL, + gettext_noop + ("disable adding the creation time to the metadata of the uploaded file"), + 0, &GNUNET_GETOPT_set_one, &do_disable_creation_time}, + {'D', "disable-extractor", NULL, + gettext_noop + ("do not use libextractor to add keywords or metadata"), + 0, &GNUNET_GETOPT_set_one, &disable_extractor}, + {'e', "extract", NULL, + gettext_noop + ("print list of extracted keywords that would be used, but do not perform upload"), + 0, &GNUNET_GETOPT_set_one, &extract_only}, + {'k', "key", "KEYWORD", + gettext_noop + ("add an additional keyword for the top-level file or directory" + " (this option can be specified multiple times)"), + 1, &GNUNET_FS_getopt_set_keywords, &topKeywords}, + {'m', "meta", "TYPE:VALUE", + gettext_noop ("set the meta-data for the given TYPE to the given VALUE"), + 1, &GNUNET_FS_getopt_set_metadata, &meta}, + {'n', "noindex", NULL, + gettext_noop ("do not index, perform full insertion (stores entire " + "file in encrypted form in GNUnet database)"), + 0, &GNUNET_GETOPT_set_one, &do_insert}, + {'N', "next", "ID", + gettext_noop + ("specify ID of an updated version to be published in the future" + " (for namespace insertions only)"), + 1, &GNUNET_GETOPT_set_string, &next_id}, + {'p', "priority", "PRIORITY", + gettext_noop ("specify the priority of the content"), + 1, &GNUNET_GETOPT_set_uint, &priority}, + {'P', "pseudonym", "NAME", + gettext_noop + ("publish the files under the pseudonym NAME (place file into namespace)"), + 1, &GNUNET_GETOPT_set_string, &pseudonym}, + {'s', "simulate-only", NULL, + gettext_noop ("only simulate the process but do not do any " + "actual publishing (useful to compute URIs)"), + 0, &GNUNET_GETOPT_set_one, &do_simulate}, + {'t', "this", "ID", + gettext_noop ("set the ID of this version of the publication" + " (for namespace insertions only)"), + 1, &GNUNET_GETOPT_set_string, &this_id}, + {'u', "uri", "URI", + gettext_noop ("URI to be published (can be used instead of passing a " + "file to add keywords to the file with the respective URI)"), + 1, &GNUNET_GETOPT_set_string, &uri_string}, + {'V', "verbose", NULL, + gettext_noop ("be verbose (print progress information)"), + 0, &GNUNET_GETOPT_set_one, &verbose}, + GNUNET_GETOPT_OPTION_END + }; return (GNUNET_OK == GNUNET_PROGRAM_run (argc, argv, diff --git a/src/fs/gnunet-search.c b/src/fs/gnunet-search.c index 6123ecfef1..3fbe2a27eb 100644 --- a/src/fs/gnunet-search.c +++ b/src/fs/gnunet-search.c @@ -293,27 +293,6 @@ run (void *cls, /** - * gnunet-search command line options - */ -static struct GNUNET_GETOPT_CommandLineOption options[] = { - {'a', "anonymity", "LEVEL", - gettext_noop ("set the desired LEVEL of receiver-anonymity"), - 1, &GNUNET_GETOPT_set_uint, &anonymity}, - {'n', "no-network", NULL, - gettext_noop ("only search the local peer (no P2P network search)"), - 1, &GNUNET_GETOPT_set_uint, &local_only}, - {'o', "output", "PREFIX", - gettext_noop - ("write search results to file starting with PREFIX"), - 1, &GNUNET_GETOPT_set_string, &output_filename}, - {'V', "verbose", NULL, - gettext_noop ("be verbose (print progress information)"), - 0, &GNUNET_GETOPT_set_one, &verbose}, - GNUNET_GETOPT_OPTION_END -}; - - -/** * The main function to search GNUnet. * * @param argc number of arguments from the command line @@ -323,6 +302,22 @@ static struct GNUNET_GETOPT_CommandLineOption options[] = { int main (int argc, char *const *argv) { + static const struct GNUNET_GETOPT_CommandLineOption options[] = { + {'a', "anonymity", "LEVEL", + gettext_noop ("set the desired LEVEL of receiver-anonymity"), + 1, &GNUNET_GETOPT_set_uint, &anonymity}, + {'n', "no-network", NULL, + gettext_noop ("only search the local peer (no P2P network search)"), + 1, &GNUNET_GETOPT_set_uint, &local_only}, + {'o', "output", "PREFIX", + gettext_noop + ("write search results to file starting with PREFIX"), + 1, &GNUNET_GETOPT_set_string, &output_filename}, + {'V', "verbose", NULL, + gettext_noop ("be verbose (print progress information)"), + 0, &GNUNET_GETOPT_set_one, &verbose}, + GNUNET_GETOPT_OPTION_END + }; return (GNUNET_OK == GNUNET_PROGRAM_run (argc, argv, diff --git a/src/fs/gnunet-unindex.c b/src/fs/gnunet-unindex.c index e934bf5211..bc7a2434b7 100644 --- a/src/fs/gnunet-unindex.c +++ b/src/fs/gnunet-unindex.c @@ -185,17 +185,6 @@ run (void *cls, /** - * gnunet-unindex command line options - */ -static struct GNUNET_GETOPT_CommandLineOption options[] = { - {'V', "verbose", NULL, - gettext_noop ("be verbose (print progress information)"), - 0, &GNUNET_GETOPT_set_one, &verbose}, - GNUNET_GETOPT_OPTION_END -}; - - -/** * The main function to unindex content. * * @param argc number of arguments from the command line @@ -205,6 +194,12 @@ static struct GNUNET_GETOPT_CommandLineOption options[] = { int main (int argc, char *const *argv) { + static const struct GNUNET_GETOPT_CommandLineOption options[] = { + {'V', "verbose", NULL, + gettext_noop ("be verbose (print progress information)"), + 0, &GNUNET_GETOPT_set_one, &verbose}, + GNUNET_GETOPT_OPTION_END + }; return (GNUNET_OK == GNUNET_PROGRAM_run (argc, argv, diff --git a/src/hostlist/gnunet-daemon-hostlist.c b/src/hostlist/gnunet-daemon-hostlist.c index bbc0d7e088..300a767b59 100644 --- a/src/hostlist/gnunet-daemon-hostlist.c +++ b/src/hostlist/gnunet-daemon-hostlist.c @@ -87,40 +87,17 @@ static struct GNUNET_CORE_Handle *core; /** * Handle to the hostlist client's advertisement handler */ -static GNUNET_CORE_MessageCallback client_adv_handler = NULL; +static GNUNET_CORE_MessageCallback client_adv_handler; /** * Handle to hostlist client's connect handler */ -static GNUNET_CORE_ConnectEventHandler client_ch = NULL; +static GNUNET_CORE_ConnectEventHandler client_ch; /** * Handle to hostlist client's disconnect handler */ -static GNUNET_CORE_DisconnectEventHandler client_dh = NULL; - -/** - * gnunet-daemon-hostlist command line options. - */ -static struct GNUNET_GETOPT_CommandLineOption options[] = { -#if HAVE_MHD - { 'a', "advertise", NULL, - gettext_noop ("advertise our hostlist to other peers"), - GNUNET_NO, &GNUNET_GETOPT_set_one, &advertising }, -#endif - { 'b', "bootstrap", NULL, - gettext_noop ("bootstrap using hostlists (it is highly recommended that you always use this option)"), - GNUNET_NO, &GNUNET_GETOPT_set_one, &bootstrapping }, - { 'e', "enable-learning", NULL, - gettext_noop ("enable learning about hostlist servers from other peers"), - GNUNET_NO, &GNUNET_GETOPT_set_one, &learning}, -#if HAVE_MHD - { 'p', "provide-hostlist", NULL, - gettext_noop ("provide a hostlist server"), - GNUNET_NO, &GNUNET_GETOPT_set_one, &provide_hostlist}, -#endif - GNUNET_GETOPT_OPTION_END -}; +static GNUNET_CORE_DisconnectEventHandler client_dh; /** * A HOSTLIST_ADV message is used to exchange information about @@ -253,22 +230,6 @@ cleaning_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) } } -/** - * List of handlers if we are learning. - */ -static struct GNUNET_CORE_MessageHandler learn_handlers[] = { - { &advertisement_handler, GNUNET_MESSAGE_TYPE_HOSTLIST_ADVERTISEMENT, 0}, - { NULL, 0, 0 } -}; - - -/** - * List of handlers if we are not learning. - */ -static struct GNUNET_CORE_MessageHandler no_learn_handlers[] = { - { NULL, 0, 0 } -}; - /** * Main function that will be run. @@ -286,6 +247,13 @@ run (void *cls, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle * cfg) { + static const struct GNUNET_CORE_MessageHandler learn_handlers[] = { + { &advertisement_handler, GNUNET_MESSAGE_TYPE_HOSTLIST_ADVERTISEMENT, 0}, + { NULL, 0, 0 } + }; + static const struct GNUNET_CORE_MessageHandler no_learn_handlers[] = { + { NULL, 0, 0 } + }; if ( (! bootstrapping) && (! learning) #if HAVE_MHD @@ -348,9 +316,28 @@ run (void *cls, int main (int argc, char *const *argv) { - int ret; - GNUNET_log_setup ("hostlist","DEBUG",NULL); + static const struct GNUNET_GETOPT_CommandLineOption options[] = { +#if HAVE_MHD + { 'a', "advertise", NULL, + gettext_noop ("advertise our hostlist to other peers"), + GNUNET_NO, &GNUNET_GETOPT_set_one, &advertising }, +#endif + { 'b', "bootstrap", NULL, + gettext_noop ("bootstrap using hostlists (it is highly recommended that you always use this option)"), + GNUNET_NO, &GNUNET_GETOPT_set_one, &bootstrapping }, + { 'e', "enable-learning", NULL, + gettext_noop ("enable learning about hostlist servers from other peers"), + GNUNET_NO, &GNUNET_GETOPT_set_one, &learning}, +#if HAVE_MHD + { 'p', "provide-hostlist", NULL, + gettext_noop ("provide a hostlist server"), + GNUNET_NO, &GNUNET_GETOPT_set_one, &provide_hostlist}, +#endif + GNUNET_GETOPT_OPTION_END + }; + int ret; + GNUNET_log_setup ("hostlist", "WARNING", NULL); ret = (GNUNET_OK == GNUNET_PROGRAM_run (argc, argv, diff --git a/src/hostlist/hostlist-client.c b/src/hostlist/hostlist-client.c index 4d006c2bdf..f08bb2e5db 100644 --- a/src/hostlist/hostlist-client.c +++ b/src/hostlist/hostlist-client.c @@ -116,12 +116,12 @@ static struct GNUNET_SCHEDULER_Handle *sched; /** * Statistics handle. */ -struct GNUNET_STATISTICS_Handle *stats; +static struct GNUNET_STATISTICS_Handle *stats; /** * Transport handle. */ -struct GNUNET_TRANSPORT_Handle *transport; +static struct GNUNET_TRANSPORT_Handle *transport; /** * Proxy that we are using (can be NULL). diff --git a/src/peerinfo-tool/gnunet-peerinfo.c b/src/peerinfo-tool/gnunet-peerinfo.c index a3fa98fa92..ab3eff83bc 100644 --- a/src/peerinfo-tool/gnunet-peerinfo.c +++ b/src/peerinfo-tool/gnunet-peerinfo.c @@ -305,22 +305,6 @@ run (void *cls, /** - * gnunet-peerinfo command line options - */ -static struct GNUNET_GETOPT_CommandLineOption options[] = { - {'n', "numeric", NULL, - gettext_noop ("don't resolve host names"), - 0, &GNUNET_GETOPT_set_one, &no_resolve}, - {'q', "quiet", NULL, - gettext_noop ("output only the identity strings"), - 0, &GNUNET_GETOPT_set_one, &be_quiet}, - {'s', "self", NULL, - gettext_noop ("output our own identity only"), - 0, &GNUNET_GETOPT_set_one, &get_self}, - GNUNET_GETOPT_OPTION_END -}; - -/** * The main function to obtain peer information. * * @param argc number of arguments from the command line @@ -330,6 +314,18 @@ static struct GNUNET_GETOPT_CommandLineOption options[] = { int main (int argc, char *const *argv) { + static const struct GNUNET_GETOPT_CommandLineOption options[] = { + {'n', "numeric", NULL, + gettext_noop ("don't resolve host names"), + 0, &GNUNET_GETOPT_set_one, &no_resolve}, + {'q', "quiet", NULL, + gettext_noop ("output only the identity strings"), + 0, &GNUNET_GETOPT_set_one, &be_quiet}, + {'s', "self", NULL, + gettext_noop ("output our own identity only"), + 0, &GNUNET_GETOPT_set_one, &get_self}, + GNUNET_GETOPT_OPTION_END + }; return (GNUNET_OK == GNUNET_PROGRAM_run (argc, argv, diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c index 63c6057057..ae8a0dfe32 100644 --- a/src/peerinfo/gnunet-service-peerinfo.c +++ b/src/peerinfo/gnunet-service-peerinfo.c @@ -776,22 +776,6 @@ handle_notify (void *cls, /** - * List of handlers for the messages understood by this - * service. - */ -static struct GNUNET_SERVER_MessageHandler handlers[] = { - {&handle_hello, NULL, GNUNET_MESSAGE_TYPE_HELLO, 0}, - {&handle_get, NULL, GNUNET_MESSAGE_TYPE_PEERINFO_GET, - sizeof (struct ListPeerMessage)}, - {&handle_get_all, NULL, GNUNET_MESSAGE_TYPE_PEERINFO_GET_ALL, - sizeof (struct ListAllPeersMessage)}, - {&handle_notify, NULL, GNUNET_MESSAGE_TYPE_PEERINFO_NOTIFY, - sizeof (struct GNUNET_MessageHeader)}, - {NULL, NULL, 0, 0} -}; - - -/** * Clean up our state. Called during shutdown. * * @param cls unused @@ -825,6 +809,16 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, const struct GNUNET_CONFIGURATION_Handle *cfg) { + static const struct GNUNET_SERVER_MessageHandler handlers[] = { + {&handle_hello, NULL, GNUNET_MESSAGE_TYPE_HELLO, 0}, + {&handle_get, NULL, GNUNET_MESSAGE_TYPE_PEERINFO_GET, + sizeof (struct ListPeerMessage)}, + {&handle_get_all, NULL, GNUNET_MESSAGE_TYPE_PEERINFO_GET_ALL, + sizeof (struct ListAllPeersMessage)}, + {&handle_notify, NULL, GNUNET_MESSAGE_TYPE_PEERINFO_NOTIFY, + sizeof (struct GNUNET_MessageHeader)}, + {NULL, NULL, 0, 0} + }; stats = GNUNET_STATISTICS_create (sched, "peerinfo", cfg); notify_list = GNUNET_SERVER_notification_context_create (server, 0); GNUNET_assert (GNUNET_OK == diff --git a/src/statistics/gnunet-service-statistics.c b/src/statistics/gnunet-service-statistics.c index 428ce932f3..efc6ce1289 100644 --- a/src/statistics/gnunet-service-statistics.c +++ b/src/statistics/gnunet-service-statistics.c @@ -420,17 +420,6 @@ handle_set (void *cls, /** - * List of handlers for the messages understood by this - * service. - */ -static struct GNUNET_SERVER_MessageHandler handlers[] = { - {&handle_set, NULL, GNUNET_MESSAGE_TYPE_STATISTICS_SET, 0}, - {&handle_get, NULL, GNUNET_MESSAGE_TYPE_STATISTICS_GET, 0}, - {NULL, NULL, 0, 0} -}; - - -/** * Task run during shutdown. * * @param cls unused @@ -458,6 +447,11 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, const struct GNUNET_CONFIGURATION_Handle *c) { + static const struct GNUNET_SERVER_MessageHandler handlers[] = { + {&handle_set, NULL, GNUNET_MESSAGE_TYPE_STATISTICS_SET, 0}, + {&handle_get, NULL, GNUNET_MESSAGE_TYPE_STATISTICS_GET, 0}, + {NULL, NULL, 0, 0} + }; cfg = c; GNUNET_SERVER_add_handlers (server, handlers); load (server); diff --git a/src/statistics/gnunet-statistics.c b/src/statistics/gnunet-statistics.c index 4fc8d84352..159a7548df 100644 --- a/src/statistics/gnunet-statistics.c +++ b/src/statistics/gnunet-statistics.c @@ -150,23 +150,6 @@ run (void *cls, } /** - * gnunet-statistics command line options - */ -static struct GNUNET_GETOPT_CommandLineOption options[] = { - {'n', "name", "NAME", - gettext_noop ("limit output to statistcs for the given NAME"), 1, - &GNUNET_GETOPT_set_string, &name}, - {'p', "persistent", NULL, - gettext_noop ("make the value being set persistent"), 0, - &GNUNET_GETOPT_set_one, &persistent}, - {'s', "subsystem", "SUBSYSTEM", - gettext_noop ("limit output to the given SUBSYSTEM"), 1, - &GNUNET_GETOPT_set_string, &subsystem}, - GNUNET_GETOPT_OPTION_END -}; - - -/** * The main function to obtain statistics in GNUnet. * * @param argc number of arguments from the command line @@ -176,6 +159,18 @@ static struct GNUNET_GETOPT_CommandLineOption options[] = { int main (int argc, char *const *argv) { + static const struct GNUNET_GETOPT_CommandLineOption options[] = { + {'n', "name", "NAME", + gettext_noop ("limit output to statistcs for the given NAME"), 1, + &GNUNET_GETOPT_set_string, &name}, + {'p', "persistent", NULL, + gettext_noop ("make the value being set persistent"), 0, + &GNUNET_GETOPT_set_one, &persistent}, + {'s', "subsystem", "SUBSYSTEM", + gettext_noop ("limit output to the given SUBSYSTEM"), 1, + &GNUNET_GETOPT_set_string, &subsystem}, + GNUNET_GETOPT_OPTION_END + }; return (GNUNET_OK == GNUNET_PROGRAM_run (argc, argv, diff --git a/src/template/gnunet-service-template.c b/src/template/gnunet-service-template.c index 39d332226c..e815398fcf 100644 --- a/src/template/gnunet-service-template.c +++ b/src/template/gnunet-service-template.c @@ -29,16 +29,6 @@ /** - * List of handlers for the messages understood by this - * service. - */ -static struct GNUNET_SERVER_MessageHandler handlers[] = { - /* FIXME: add handlers here! */ - {NULL, NULL, 0, 0} -}; - - -/** * Task run during shutdown. * * @param cls unused @@ -66,6 +56,10 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, const struct GNUNET_CONFIGURATION_Handle *cfg) { + static const struct GNUNET_SERVER_MessageHandler handlers[] = { + /* FIXME: add handlers here! */ + {NULL, NULL, 0, 0} + }; /* FIXME: do setup here */ GNUNET_SERVER_add_handlers (server, handlers); GNUNET_SCHEDULER_add_delayed (sched, diff --git a/src/template/gnunet-template.c b/src/template/gnunet-template.c index ad0da8159b..a32b42379f 100644 --- a/src/template/gnunet-template.c +++ b/src/template/gnunet-template.c @@ -52,14 +52,6 @@ run (void *cls, /* main code here */ } -/** - * gnunet-template command line options - */ -static struct GNUNET_GETOPT_CommandLineOption options[] = { - /* FIMXE: add options here */ - GNUNET_GETOPT_OPTION_END -}; - /** * The main function to obtain template from gnunetd. @@ -71,6 +63,10 @@ static struct GNUNET_GETOPT_CommandLineOption options[] = { int main (int argc, char *const *argv) { + static const struct GNUNET_GETOPT_CommandLineOption options[] = { + /* FIMXE: add options here */ + GNUNET_GETOPT_OPTION_END + }; return (GNUNET_OK == GNUNET_PROGRAM_run (argc, argv, diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c index e1c9046227..9700450937 100644 --- a/src/topology/gnunet-daemon-topology.c +++ b/src/topology/gnunet-daemon-topology.c @@ -1431,14 +1431,6 @@ run (void *cls, /** - * gnunet-daemon-topology command line options. - */ -static struct GNUNET_GETOPT_CommandLineOption options[] = { - GNUNET_GETOPT_OPTION_END -}; - - -/** * The main function for the topology daemon. * * @param argc number of arguments from the command line @@ -1448,6 +1440,9 @@ static struct GNUNET_GETOPT_CommandLineOption options[] = { int main (int argc, char *const *argv) { + static const struct GNUNET_GETOPT_CommandLineOption options[] = { + GNUNET_GETOPT_OPTION_END + }; int ret; ret = (GNUNET_OK == diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index 4ad9f23390..2d6a1cbb01 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c @@ -4656,29 +4656,6 @@ handle_address_lookup (void *cls, &transmit_address_to_client, tc); } -/** - * List of handlers for the messages understood by this - * service. - */ -static struct GNUNET_SERVER_MessageHandler handlers[] = { - {&handle_start, NULL, - GNUNET_MESSAGE_TYPE_TRANSPORT_START, 0}, - {&handle_hello, NULL, - GNUNET_MESSAGE_TYPE_HELLO, 0}, - {&handle_send, NULL, - GNUNET_MESSAGE_TYPE_TRANSPORT_SEND, 0}, - {&handle_set_quota, NULL, - GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA, sizeof (struct QuotaSetMessage)}, - {&handle_address_lookup, NULL, - GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_LOOKUP, - 0}, - {&handle_blacklist_init, NULL, - GNUNET_MESSAGE_TYPE_TRANSPORT_BLACKLIST_INIT, sizeof (struct GNUNET_MessageHeader)}, - {&handle_blacklist_reply, NULL, - GNUNET_MESSAGE_TYPE_TRANSPORT_BLACKLIST_REPLY, sizeof (struct BlacklistMessage)}, - {NULL, NULL, 0, 0} -}; - /** * Setup the environment for this plugin. @@ -4917,6 +4894,24 @@ run (void *cls, struct GNUNET_SERVER_Handle *serv, const struct GNUNET_CONFIGURATION_Handle *c) { + static const struct GNUNET_SERVER_MessageHandler handlers[] = { + {&handle_start, NULL, + GNUNET_MESSAGE_TYPE_TRANSPORT_START, 0}, + {&handle_hello, NULL, + GNUNET_MESSAGE_TYPE_HELLO, 0}, + {&handle_send, NULL, + GNUNET_MESSAGE_TYPE_TRANSPORT_SEND, 0}, + {&handle_set_quota, NULL, + GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA, sizeof (struct QuotaSetMessage)}, + {&handle_address_lookup, NULL, + GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_LOOKUP, + 0}, + {&handle_blacklist_init, NULL, + GNUNET_MESSAGE_TYPE_TRANSPORT_BLACKLIST_INIT, sizeof (struct GNUNET_MessageHeader)}, + {&handle_blacklist_reply, NULL, + GNUNET_MESSAGE_TYPE_TRANSPORT_BLACKLIST_REPLY, sizeof (struct BlacklistMessage)}, + {NULL, NULL, 0, 0} + }; char *plugs; char *pos; int no_transports; diff --git a/src/util/crypto_hash.c b/src/util/crypto_hash.c index 73b9c96549..74ea72de4e 100644 --- a/src/util/crypto_hash.c +++ b/src/util/crypto_hash.c @@ -63,36 +63,6 @@ RORu64 (unsigned long long x, unsigned long long y) return (x >> y) | (x << (64 - y)); } -const unsigned long long sha512_K[80] = { - 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, 0xb5c0fbcfec4d3b2fULL, - 0xe9b5dba58189dbbcULL, 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, - 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, 0xd807aa98a3030242ULL, - 0x12835b0145706fbeULL, 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL, - 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, 0x9bdc06a725c71235ULL, - 0xc19bf174cf692694ULL, 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL, - 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, 0x2de92c6f592b0275ULL, - 0x4a7484aa6ea6e483ULL, 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL, - 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, 0xb00327c898fb213fULL, - 0xbf597fc7beef0ee4ULL, 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL, - 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, 0x27b70a8546d22ffcULL, - 0x2e1b21385c26c926ULL, 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL, - 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, 0x81c2c92e47edaee6ULL, - 0x92722c851482353bULL, 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL, - 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, 0xd192e819d6ef5218ULL, - 0xd69906245565a910ULL, 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL, - 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, 0x2748774cdf8eeb99ULL, - 0x34b0bcb5e19b48a8ULL, 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL, - 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, 0x748f82ee5defb2fcULL, - 0x78a5636f43172f60ULL, 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL, - 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, 0xbef9a3f7b2c67915ULL, - 0xc67178f2e372532bULL, 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL, - 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, 0x06f067aa72176fbaULL, - 0x0a637dc5a2c898a6ULL, 0x113f9804bef90daeULL, 0x1b710b35131c471bULL, - 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, 0x3c9ebe0a15c9bebcULL, - 0x431d67c49c100d4cULL, 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL, - 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL, -}; - #define e0(x) (RORu64(x,28) ^ RORu64(x,34) ^ RORu64(x,39)) #define e1(x) (RORu64(x,14) ^ RORu64(x,18) ^ RORu64(x,41)) #define s0(x) (RORu64(x, 1) ^ RORu64(x, 8) ^ (x >> 7)) @@ -143,6 +113,36 @@ const unsigned long long sha512_K[80] = { static void sha512_transform (unsigned long long *state, const unsigned char *input) { + static const unsigned long long sha512_K[80] = { + 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, 0xb5c0fbcfec4d3b2fULL, + 0xe9b5dba58189dbbcULL, 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, + 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, 0xd807aa98a3030242ULL, + 0x12835b0145706fbeULL, 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL, + 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, 0x9bdc06a725c71235ULL, + 0xc19bf174cf692694ULL, 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL, + 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, 0x2de92c6f592b0275ULL, + 0x4a7484aa6ea6e483ULL, 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL, + 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, 0xb00327c898fb213fULL, + 0xbf597fc7beef0ee4ULL, 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL, + 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, 0x27b70a8546d22ffcULL, + 0x2e1b21385c26c926ULL, 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL, + 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, 0x81c2c92e47edaee6ULL, + 0x92722c851482353bULL, 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL, + 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, 0xd192e819d6ef5218ULL, + 0xd69906245565a910ULL, 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL, + 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, 0x2748774cdf8eeb99ULL, + 0x34b0bcb5e19b48a8ULL, 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL, + 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, 0x748f82ee5defb2fcULL, + 0x78a5636f43172f60ULL, 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL, + 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, 0xbef9a3f7b2c67915ULL, + 0xc67178f2e372532bULL, 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL, + 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, 0x06f067aa72176fbaULL, + 0x0a637dc5a2c898a6ULL, 0x113f9804bef90daeULL, 0x1b710b35131c471bULL, + 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, 0x3c9ebe0a15c9bebcULL, + 0x431d67c49c100d4cULL, 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL, + 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL, + }; + unsigned long long a, b, c, d, e, f, g, h, t1, t2; unsigned long long W[80]; unsigned long long t0; @@ -561,11 +561,6 @@ GNUNET_CRYPTO_hash_file_cancel (struct GNUNET_CRYPTO_FileHashContext *fhc) /* ***************** binary-ASCII encoding *************** */ -/** - * 32 characters for encoding (GNUNET_CRYPTO_hash => 32 characters) - */ -static char *encTable__ = "0123456789ABCDEFGHIJKLMNOPQRSTUV"; - static unsigned int getValue__ (unsigned char a) { @@ -591,6 +586,10 @@ void GNUNET_CRYPTO_hash_to_enc (const GNUNET_HashCode * block, struct GNUNET_CRYPTO_HashAsciiEncoded *result) { + /** + * 32 characters for encoding (GNUNET_CRYPTO_hash => 32 characters) + */ + static char *encTable__ = "0123456789ABCDEFGHIJKLMNOPQRSTUV"; unsigned int wpos; unsigned int rpos; unsigned int bits; diff --git a/src/util/crypto_ksk.c b/src/util/crypto_ksk.c index 4960df9e2e..888c08384d 100644 --- a/src/util/crypto_ksk.c +++ b/src/util/crypto_ksk.c @@ -67,95 +67,6 @@ struct GNUNET_CRYPTO_RsaPrivateKey }; -/* Note: 2 is not included because it can be tested more easily by - looking at bit 0. The last entry in this list is marked by a zero */ -static uint16_t small_prime_numbers[] = { - 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, - 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, - 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, - 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, - 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, - 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, - 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, - 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, - 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, - 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, - 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, - 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, - 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, - 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, - 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, - 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, - 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, - 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, - 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, - 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, - 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, - 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, - 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, - 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, - 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, - 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, - 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, - 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, - 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, - 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, - 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, - 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, - 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, - 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, - 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, - 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, - 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, - 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, - 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, - 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, - 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, - 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, - 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, - 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, - 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, - 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, - 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, - 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, - 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, - 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, - 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, - 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, - 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, - 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, - 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, - 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, - 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, - 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, - 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, - 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, - 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, - 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, - 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, - 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, - 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, - 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, - 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, - 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, - 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, - 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, - 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, - 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, - 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, - 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, - 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, - 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, - 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, - 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, - 4957, 4967, 4969, 4973, 4987, 4993, 4999, - 0 -}; - -#define DIM(v) (sizeof(v)/sizeof((v)[0])) -static int no_of_small_prime_numbers = DIM (small_prime_numbers) - 1; - - static unsigned int get_nbits (mpz_t a) { @@ -258,6 +169,93 @@ leave: static void gen_prime (mpz_t ptest, unsigned int nbits, GNUNET_HashCode * hc) { + /* Note: 2 is not included because it can be tested more easily by + looking at bit 0. The last entry in this list is marked by a zero */ + static const uint16_t small_prime_numbers[] = { + 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, + 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, + 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, + 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, + 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, + 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, + 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, + 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, + 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, + 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, + 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, + 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, + 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, + 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, + 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, + 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, + 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, + 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, + 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, + 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, + 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, + 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, + 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, + 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, + 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, + 1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559, + 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, + 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, + 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, + 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, + 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, + 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, + 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, + 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, + 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, + 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, + 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, + 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, + 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, + 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, + 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, + 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, + 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, + 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, + 2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729, + 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, + 2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851, + 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, + 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, + 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, + 3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137, + 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, + 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, + 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, + 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, + 3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467, + 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, + 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, + 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, + 3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709, + 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, + 3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851, + 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, + 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, + 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, + 4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111, + 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, + 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, + 4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297, + 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, + 4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457, + 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, + 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, + 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, + 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, + 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, + 4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889, + 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, + 4957, 4967, 4969, 4973, 4987, 4993, 4999, + 0 + }; +#define DIM(v) (sizeof(v)/sizeof((v)[0])) + static int no_of_small_prime_numbers = DIM (small_prime_numbers) - 1; + mpz_t prime, pminus1, val_2, val_3, result; int i; unsigned x, step; diff --git a/src/util/getopt.c b/src/util/getopt.c index 63caa0346f..60673af082 100644 --- a/src/util/getopt.c +++ b/src/util/getopt.c @@ -135,12 +135,6 @@ static char *GNoptarg = NULL; /* 1003.2 says this must be 1 before any call. */ static int GNoptind = 1; -/* Formerly, initialization of getopt depended on GNoptind==0, which - causes problems with re-calling getopt as programs generally don't - know that. */ - -static int __getopt_initialized = 0; - /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. @@ -150,16 +144,6 @@ static int __getopt_initialized = 0; static char *nextchar; -/* Callers store zero here to inhibit the error message - for unrecognized options. */ - -static int GNopterr = 1; - -/* Set to an option character which was unrecognized. - This must be initialized on some systems to avoid linking in the - system's own getopt implementation. */ - -static int GNoptopt = '?'; /* Describe how to deal with options that follow non-option ARGV-elements. @@ -513,14 +497,17 @@ _getopt_initialize (argc, argv, optstring) long-named options. */ static int -GN_getopt_internal (argc, argv, optstring, longopts, longind, long_only) - int argc; - char *const *argv; - const char *optstring; - const struct GNoption *longopts; - int *longind; - int long_only; +GN_getopt_internal (int argc, + char *const *argv, + const char *optstring, + const struct GNoption *longopts, + int *longind, + int long_only) { + static int __getopt_initialized = 0; + static int GNopterr = 1; + static int GNoptopt = '?'; + GNoptarg = NULL; if (GNoptind == 0 || !__getopt_initialized) diff --git a/src/util/gnunet-service-resolver.c b/src/util/gnunet-service-resolver.c index 59d4c1d975..5739571aef 100644 --- a/src/util/gnunet-service-resolver.c +++ b/src/util/gnunet-service-resolver.c @@ -473,16 +473,6 @@ handle_get (void *cls, /** - * List of handlers for the messages understood by this - * service. - */ -static struct GNUNET_SERVER_MessageHandler handlers[] = { - {&handle_get, NULL, GNUNET_MESSAGE_TYPE_RESOLVER_REQUEST, 0}, - {NULL, NULL, 0, 0} -}; - - -/** * Process resolver requests. * * @param cls closure @@ -496,6 +486,10 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, const struct GNUNET_CONFIGURATION_Handle *cfg) { + static const struct GNUNET_SERVER_MessageHandler handlers[] = { + {&handle_get, NULL, GNUNET_MESSAGE_TYPE_RESOLVER_REQUEST, 0}, + {NULL, NULL, 0, 0} + }; GNUNET_SERVER_add_handlers (server, handlers); } |