aboutsummaryrefslogtreecommitdiff
path: root/src/arm
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-06-18 14:09:55 +0000
committerChristian Grothoff <christian@grothoff.org>2010-06-18 14:09:55 +0000
commit200aaa0dd6813f19eb7ed67a0fdc301d091fc2d7 (patch)
treef89388586fbf00a3b7c985b2b28bb74abda3a364 /src/arm
parent640ae593fd34d27034f994a2e945a8942f1a4d5d (diff)
downloadgnunet-200aaa0dd6813f19eb7ed67a0fdc301d091fc2d7.tar.gz
gnunet-200aaa0dd6813f19eb7ed67a0fdc301d091fc2d7.zip
localization
of scopes
Diffstat (limited to 'src/arm')
-rw-r--r--src/arm/gnunet-arm.c45
-rw-r--r--src/arm/gnunet-service-arm.c18
-rw-r--r--src/arm/mockup-service.c18
3 files changed, 32 insertions, 49 deletions
diff --git a/src/arm/gnunet-arm.c b/src/arm/gnunet-arm.c
index c631ec480..4e6d6f965 100644
--- a/src/arm/gnunet-arm.c
+++ b/src/arm/gnunet-arm.c
@@ -357,31 +357,6 @@ cps_loop (void *cls,
357 357
358 358
359/** 359/**
360 * gnunet-arm command line options
361 */
362static struct GNUNET_GETOPT_CommandLineOption options[] = {
363 {'e', "end", NULL, gettext_noop ("stop all GNUnet services"),
364 GNUNET_NO, &GNUNET_GETOPT_set_one, &end},
365 {'i', "init", "SERVICE", gettext_noop ("start a particular service"),
366 GNUNET_YES, &GNUNET_GETOPT_set_string, &init},
367 {'k', "kill", "SERVICE", gettext_noop ("stop a particular service"),
368 GNUNET_YES, &GNUNET_GETOPT_set_string, &term},
369 {'s', "start", NULL, gettext_noop ("start all GNUnet default services"),
370 GNUNET_NO, &GNUNET_GETOPT_set_one, &start},
371 {'r', "restart", NULL, gettext_noop ("stop and start all GNUnet default services"),
372 GNUNET_NO, &GNUNET_GETOPT_set_one, &restart},
373 {'t', "test", "SERVICE",
374 gettext_noop ("test if a particular service is running"),
375 GNUNET_YES, &GNUNET_GETOPT_set_string, &test},
376 {'d', "delete", NULL, gettext_noop ("delete config file and directory on exit"),
377 GNUNET_NO, &GNUNET_GETOPT_set_one, &delete},
378 {'q', "quiet", NULL, gettext_noop ("don't print status messages"),
379 GNUNET_NO, &GNUNET_GETOPT_set_one, &quiet},
380 GNUNET_GETOPT_OPTION_END
381};
382
383
384/**
385 * The main function to obtain arm from gnunetd. 360 * The main function to obtain arm from gnunetd.
386 * 361 *
387 * @param argc number of arguments from the command line 362 * @param argc number of arguments from the command line
@@ -391,6 +366,26 @@ static struct GNUNET_GETOPT_CommandLineOption options[] = {
391int 366int
392main (int argc, char *const *argv) 367main (int argc, char *const *argv)
393{ 368{
369 static const struct GNUNET_GETOPT_CommandLineOption options[] = {
370 {'e', "end", NULL, gettext_noop ("stop all GNUnet services"),
371 GNUNET_NO, &GNUNET_GETOPT_set_one, &end},
372 {'i', "init", "SERVICE", gettext_noop ("start a particular service"),
373 GNUNET_YES, &GNUNET_GETOPT_set_string, &init},
374 {'k', "kill", "SERVICE", gettext_noop ("stop a particular service"),
375 GNUNET_YES, &GNUNET_GETOPT_set_string, &term},
376 {'s', "start", NULL, gettext_noop ("start all GNUnet default services"),
377 GNUNET_NO, &GNUNET_GETOPT_set_one, &start},
378 {'r', "restart", NULL, gettext_noop ("stop and start all GNUnet default services"),
379 GNUNET_NO, &GNUNET_GETOPT_set_one, &restart},
380 {'t', "test", "SERVICE",
381 gettext_noop ("test if a particular service is running"),
382 GNUNET_YES, &GNUNET_GETOPT_set_string, &test},
383 {'d', "delete", NULL, gettext_noop ("delete config file and directory on exit"),
384 GNUNET_NO, &GNUNET_GETOPT_set_one, &delete},
385 {'q', "quiet", NULL, gettext_noop ("don't print status messages"),
386 GNUNET_NO, &GNUNET_GETOPT_set_one, &quiet},
387 GNUNET_GETOPT_OPTION_END
388 };
394 return (GNUNET_OK == 389 return (GNUNET_OK ==
395 GNUNET_PROGRAM_run (argc, 390 GNUNET_PROGRAM_run (argc,
396 argv, 391 argv,
diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c
index 52c7dec20..ab96906a7 100644
--- a/src/arm/gnunet-service-arm.c
+++ b/src/arm/gnunet-service-arm.c
@@ -986,17 +986,6 @@ handle_shutdown (void *cls,
986 986
987 987
988/** 988/**
989 * List of handlers for the messages understood by this service.
990 */
991static struct GNUNET_SERVER_MessageHandler handlers[] = {
992 {&handle_start, NULL, GNUNET_MESSAGE_TYPE_ARM_START, 0},
993 {&handle_stop, NULL, GNUNET_MESSAGE_TYPE_ARM_STOP, 0},
994 {&handle_shutdown, NULL, GNUNET_MESSAGE_TYPE_ARM_SHUTDOWN,
995 sizeof (struct GNUNET_MessageHeader)},
996 {NULL, NULL, 0, 0}
997};
998
999/**
1000 * Signal handler called for SIGCHLD. Triggers the 989 * Signal handler called for SIGCHLD. Triggers the
1001 * respective handler by writing to the trigger pipe. 990 * respective handler by writing to the trigger pipe.
1002 */ 991 */
@@ -1025,6 +1014,13 @@ run (void *cls,
1025 struct GNUNET_SERVER_Handle *serv, 1014 struct GNUNET_SERVER_Handle *serv,
1026 const struct GNUNET_CONFIGURATION_Handle *c) 1015 const struct GNUNET_CONFIGURATION_Handle *c)
1027{ 1016{
1017 static const struct GNUNET_SERVER_MessageHandler handlers[] = {
1018 {&handle_start, NULL, GNUNET_MESSAGE_TYPE_ARM_START, 0},
1019 {&handle_stop, NULL, GNUNET_MESSAGE_TYPE_ARM_STOP, 0},
1020 {&handle_shutdown, NULL, GNUNET_MESSAGE_TYPE_ARM_SHUTDOWN,
1021 sizeof (struct GNUNET_MessageHeader)},
1022 {NULL, NULL, 0, 0}
1023 };
1028 char *defaultservices; 1024 char *defaultservices;
1029 char *pos; 1025 char *pos;
1030 1026
diff --git a/src/arm/mockup-service.c b/src/arm/mockup-service.c
index 8a4940630..2f1baab9c 100644
--- a/src/arm/mockup-service.c
+++ b/src/arm/mockup-service.c
@@ -81,25 +81,17 @@ handle_shutdown (void *cls,
81} 81}
82 82
83 83
84/**
85 * Default handlers for all services. Will be copied and the
86 * "callback_cls" fields will be replaced with the specific service
87 * struct.
88 */
89static const struct GNUNET_SERVER_MessageHandler handlers[] = {
90 {&handle_shutdown, NULL, GNUNET_MESSAGE_TYPE_ARM_SHUTDOWN,
91 sizeof (struct GNUNET_MessageHeader)},
92 {NULL, NULL, 0, 0}
93};
94
95
96
97static void 84static void
98run (void *cls, 85run (void *cls,
99 struct GNUNET_SCHEDULER_Handle *s, 86 struct GNUNET_SCHEDULER_Handle *s,
100 struct GNUNET_SERVER_Handle *server, 87 struct GNUNET_SERVER_Handle *server,
101 const struct GNUNET_CONFIGURATION_Handle *cfg) 88 const struct GNUNET_CONFIGURATION_Handle *cfg)
102{ 89{
90 static const struct GNUNET_SERVER_MessageHandler handlers[] = {
91 {&handle_shutdown, NULL, GNUNET_MESSAGE_TYPE_ARM_SHUTDOWN,
92 sizeof (struct GNUNET_MessageHeader)},
93 {NULL, NULL, 0, 0}
94 };
103 sched = s; 95 sched = s;
104 /* process client requests */ 96 /* process client requests */
105 GNUNET_SERVER_ignore_shutdown (server, GNUNET_YES); 97 GNUNET_SERVER_ignore_shutdown (server, GNUNET_YES);