GNUnet 0.22.0
gnunet-arm.c
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2009, 2012, 2013 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
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 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20
26#include "platform.h"
27#include "gnunet_arm_service.h"
28#include "gnunet_util_lib.h"
29
33static int end;
34
38static int start;
39
43static int restart;
44
48static int delete;
49
53static int quiet;
54
58static int show_all;
59
63static int monitor;
64
68static int list;
69
73static char *init;
74
78static char *term;
79
83static char *config_file;
84
88static char *dir;
89
93static int ret;
94
98static struct GNUNET_ARM_Handle *h;
99
104
109
113static unsigned int phase;
114
119
124
128static int no_stdout;
129
133static int no_stderr;
134
139
144
150static void
152{
153 GNUNET_log (
155 "Will attempt to remove configuration file %s and service directory %s\n",
157 dir);
158 if (0 != unlink (config_file))
159 {
161 _ ("Failed to remove configuration file %s\n"),
163 }
165 {
167 _ ("Failed to remove servicehome directory %s\n"),
168 dir);
169 }
170}
171
172
179static void
180shutdown_task (void *cls)
181{
182 (void) cls;
183 if (NULL != al_task)
184 {
186 al_task = NULL;
187 }
188 if (NULL != op)
189 {
191 op = NULL;
192 }
193 if (NULL != h)
194 {
196 h = NULL;
197 }
198 if (NULL != m)
199 {
201 m = NULL;
202 }
203 if (NULL != timeout_task)
204 {
206 timeout_task = NULL;
207 }
208 if ( (GNUNET_YES == end) &&
209 (GNUNET_YES == delete) )
210 delete_files ();
212 cfg = NULL;
213}
214
215
222static const char *
224{
225 switch (rs)
226 {
228 return _ ("Message was sent successfully");
229
231 return _ ("We disconnected from ARM before we could send a request");
232 }
233 return _ ("Unknown request status");
234}
235
236
243static const char *
245{
246 switch (result)
247 {
249 return _ ("is stopped");
250
252 return _ ("is starting");
253
255 return _ ("is stopping");
256
258 return _ ("is starting already");
259
261 return _ ("is stopping already");
262
264 return _ ("is started already");
265
267 return _ ("is stopped already");
268
270 return _ ("service is not known to ARM");
271
273 return _ ("service failed to start");
274
276 return _ ("service cannot be manipulated because ARM is shutting down");
277 }
278 return _ ("Unknown result code.");
279}
280
281
287static void
288action_loop (void *cls);
289
290
300static void
301conn_status (void *cls,
302 int connected)
303{
304 static int once;
305
306 (void) cls;
307 if ( (GNUNET_SYSERR == connected) &&
308 (0 == once) )
309 {
311 _ ("Fatal error initializing ARM API.\n"));
313 return;
314 }
315 once = 1;
316}
317
318
330static void
331start_callback (void *cls,
334{
335 (void) cls;
336 op = NULL;
338 {
339 fprintf (stdout,
340 _ ("Failed to start the ARM service: %s\n"),
341 req_string (rs));
343 return;
344 }
347 {
348 fprintf (stdout,
349 _ ("Failed to start the ARM service: %s\n"),
352 return;
353 }
355 "ARM service [re]start successful\n");
356 start = 0;
358 NULL);
359}
360
361
373static void
374stop_callback (void *cls,
377{
378 char *msg;
379
380 (void) cls;
381 op = NULL;
383 {
385 "%s",
386 _ (
387 "Failed to send a stop request to the ARM service: %s\n"));
388 fprintf (stdout, msg, req_string (rs));
391 return;
392 }
396 {
397 fprintf (stdout,
398 _ ("Failed to stop the ARM service: %s\n"),
401 return;
402 }
404 "ARM service shutdown successful\n");
405 end = 0;
406 if (restart)
407 {
408 restart = 0;
409 start = 1;
411 "Initiating an ARM restart\n");
412 }
414 NULL);
415}
416
417
429static void
430init_callback (void *cls,
433{
434 (void) cls;
435 op = NULL;
437 {
438 fprintf (stdout,
439 _ ("Failed to send a request to start the `%s' service: %s\n"),
440 init,
441 req_string (rs));
443 return;
444 }
447 {
448 fprintf (stdout,
449 _ ("Failed to start the `%s' service: %s\n"),
450 init,
453 return;
454 }
456 "Service %s [re]started successfully\n",
457 init);
459 init = NULL;
461 NULL);
462}
463
464
476static void
477term_callback (void *cls,
480{
481 char *msg;
482
483 (void) cls;
484 op = NULL;
486 {
488 _ (
489 "Failed to send a request to kill the `%s' service: %%s\n"),
490 term);
491 fprintf (stdout,
492 msg,
493 req_string (rs));
496 return;
497 }
500 {
501 fprintf (stdout,
502 _ ("Failed to kill the `%s' service: %s\n"),
503 term,
506 return;
507 }
508
510 "Service %s stopped successfully\n",
511 term);
513 term = NULL;
515 NULL);
516}
517
518
529static void
530list_callback (void *cls,
532 unsigned int count,
533 const struct GNUNET_ARM_ServiceInfo *service_info)
534{
535 unsigned int num_stopped = 0;
536 unsigned int num_started = 0;
537 unsigned int num_stopping = 0;
538 unsigned int num_failed = 0;
539 unsigned int num_finished = 0;
540 (void) cls;
541 op = NULL;
543 {
544 char *msg;
545
547 "%s",
548 _ ("Failed to request a list of services: %s\n"));
549 fprintf (stdout,
550 msg,
551 req_string (rs));
553 ret = 3;
555 }
556 if (NULL == service_info)
557 {
558 fprintf (stderr,
559 "%s",
560 _ ("Error communicating with ARM. ARM not running?\n"));
562 ret = 3;
563 return;
564 }
565 for (unsigned int i = 0; i < count; i++)
566 {
567 switch (service_info[i].status)
568 {
570 num_stopped++;
571 break;
573 num_failed++;
574 break;
576 num_finished++;
577 break;
579 num_started++;
580 break;
582 num_stopping++;
583 fprintf (stdout,
584 "%s (binary='%s', status=stopping)\n",
585 service_info[i].name,
586 service_info[i].binary);
587 break;
588 default:
589 GNUNET_break_op (0);
590 fprintf (stdout,
591 "%s (binary='%s', status=unknown)\n",
592 service_info[i].name,
593 service_info[i].binary);
594 break;
595 }
596 }
597 if (! quiet)
598 {
599 if (show_all)
600 fprintf (stdout,
601 "%s",
602 _ ("All services:\n"));
603 else
604 fprintf (stdout,
605 "%s",
606 _ ("Services (excluding stopped services):\n"));
607 if (num_stopped || num_failed || num_finished || num_stopping ||
608 num_started)
609 {
610 int sep = 0;
611 fprintf (stdout, "(");
612 if (0 != num_started)
613 {
614 if (sep)
615 fprintf (stdout, " / ");
616 fprintf (stdout,
617 "started: %u",
618 num_started);
619 sep = 1;
620 }
621 if (0 != num_failed)
622 {
623 if (sep)
624 fprintf (stdout, " / ");
625 fprintf (stdout,
626 "failed: %u",
627 num_failed);
628 sep = 1;
629 }
630 if (0 != num_stopping)
631 {
632 if (sep)
633 fprintf (stdout, " / ");
634 fprintf (stdout,
635 "stopping: %u",
636 num_stopping);
637 sep = 1;
638 }
639 if (0 != num_stopped)
640 {
641 if (sep)
642 fprintf (stdout, " / ");
643 fprintf (stdout,
644 "stopped: %u",
645 num_stopped);
646 sep = 1;
647 }
648 if (0 != num_finished)
649 {
650 if (sep)
651 fprintf (stdout, " / ");
652 fprintf (stdout,
653 "finished: %u",
654 num_finished);
655 sep = 1;
656 }
657 fprintf (stdout, ")\n");
658 }
659 else
660 {
661 fprintf (stdout,
662 "%s",
663 _ ("(No services configured.)\n"));
664 }
665 }
666 for (unsigned int i = 0; i < count; i++)
667 {
668 struct GNUNET_TIME_Relative restart_in;
669 switch (service_info[i].status)
670 {
672 if (show_all)
673 fprintf (stdout,
674 "%s (binary='%s', status=stopped)\n",
675 service_info[i].name,
676 service_info[i].binary);
677 break;
679 restart_in = GNUNET_TIME_absolute_get_remaining (service_info[i].restart_at);
680 fprintf (stdout,
681 "%s (binary='%s', status=failed, exit_status=%d, restart_delay='%s')\n",
682 service_info[i].name,
683 service_info[i].binary,
684 service_info[i].last_exit_status,
686 GNUNET_YES));
687 break;
689 fprintf (stdout,
690 "%s (binary='%s', status=finished)\n",
691 service_info[i].name,
692 service_info[i].binary);
693 break;
695 fprintf (stdout,
696 "%s (binary='%s', status=started)\n",
697 service_info[i].name,
698 service_info[i].binary);
699 break;
701 fprintf (stdout,
702 "%s (binary='%s', status=stopping)\n",
703 service_info[i].name,
704 service_info[i].binary);
705 break;
706 default:
707 GNUNET_break_op (0);
708 fprintf (stdout,
709 "%s (binary='%s', status=unknown)\n",
710 service_info[i].name,
711 service_info[i].binary);
712 break;
713 }
714 }
716 NULL);
717}
718
719
726static void
727action_loop (void *cls)
728{
729 (void) cls;
730 al_task = NULL;
732 "Running requested actions\n");
733 while (1)
734 {
735 switch (phase++)
736 {
737 case 0:
738 if (NULL != term)
739 {
741 "Termination action\n");
743 term,
745 NULL);
746 return;
747 }
748 break;
749
750 case 1:
751 if (end || restart)
752 {
753 if (GNUNET_YES !=
755 "arm"))
756 {
758 "GNUnet not running, cannot stop the peer\n");
759 }
760 else
761 {
763 "End action\n");
765 "arm",
767 NULL);
768 return;
769 }
770 }
771 break;
772
773 case 2:
774 if (start)
775 {
777 "Start action\n");
778 op =
780 "arm",
781 (no_stdout
782 ? 0
784 | (no_stderr
785 ? 0
788 NULL);
789 return;
790 }
791 break;
792
793 case 3:
794 if (NULL != init)
795 {
797 "Initialization action\n");
799 init,
802 NULL);
803 return;
804 }
805 break;
806
807 case 4:
808 if (list)
809 {
811 "Going to list all running services controlled by ARM.\n");
814 &list);
815 return;
816 }
817 break;
818
819 case 5:
820 if (monitor)
821 {
822 if (! quiet)
823 fprintf (stderr,
824 _ ("Now only monitoring, press CTRL-C to stop.\n"));
825 quiet =
826 0; /* does not make sense to stay quiet in monitor mode at this time */
827 return; /* done with tasks, just monitor */
828 }
829 break;
830
831 default: /* last phase */
833 return;
834 }
835 }
836}
837
838
846static void
847srv_status (void *cls,
848 const char *service,
850{
851 const char *msg;
852
853 (void) cls;
854 switch (status)
855 {
857 return; /* this should be done silently */
858
860 msg = _ ("Stopped %s.\n");
861 break;
862
864 msg = _ ("Starting %s...\n");
865 break;
866
868 msg = _ ("Stopping %s...\n");
869 break;
870
871 default:
872 msg = NULL;
873 break;
874 }
875 if (! quiet)
876 {
877 if (NULL != msg)
878 fprintf (stderr,
879 msg,
880 service);
881 else
882 fprintf (stderr,
883 _ ("Unknown status %u for service %s.\n"),
884 status,
885 service);
886 }
888 "Got service %s status %d\n",
889 service,
890 (int) status);
891}
892
893
897static void
899{
900 (void) cls;
901 timeout_task = NULL;
902 ret = 2;
904}
905
906
915static void
916run (void *cls,
917 char *const *args,
918 const char *cfgfile,
919 const struct GNUNET_CONFIGURATION_Handle *c)
920{
921 (void) cls;
922 (void) args;
923 (void) cfgfile;
925 if (GNUNET_OK !=
927 "PATHS",
928 "GNUNET_HOME",
929 &dir))
930 {
932 "PATHS",
933 "GNUNET_HOME");
934 return;
935 }
937 "arm",
938 "CONFIG",
939 &config_file);
940 if (NULL == (h = GNUNET_ARM_connect (cfg,
942 NULL)))
943 return;
944 if (monitor)
946 &srv_status,
947 NULL);
949 NULL);
951 NULL);
952 if (0 != timeout.rel_value_us)
956 NULL);
957}
958
959
967int
968main (int argc, char *const *argv)
969{
972 "end",
973 gettext_noop ("stop all GNUnet services"),
974 &end),
976 "init",
977 "SERVICE",
978 gettext_noop ("start a particular service"),
979 &init),
981 "kill",
982 "SERVICE",
983 gettext_noop ("stop a particular service"),
984 &term),
986 "all",
988 "also show stopped services (used with -I)"),
989 &show_all),
991 "start",
993 "start all GNUnet default services"),
994 &start),
996 "restart",
998 "stop and start all GNUnet default services"),
999 &restart),
1001 "delete",
1002 gettext_noop (
1003 "delete config file and directory on exit"),
1004 &delete),
1006 "monitor",
1007 gettext_noop ("monitor ARM activities"),
1008 &monitor),
1010 "quiet",
1011 gettext_noop ("don't print status messages"),
1012 &quiet),
1014 'T',
1015 "timeout",
1016 "DELAY",
1017 gettext_noop (
1018 "exit with error status if operation does not finish after DELAY"),
1019 &timeout),
1021 "info",
1022 gettext_noop (
1023 "list currently running services"),
1024 &list),
1026 'O',
1027 "no-stdout",
1028 gettext_noop ("don't let gnunet-service-arm inherit standard output"),
1029 &no_stdout),
1031 'E',
1032 "no-stderr",
1033 gettext_noop ("don't let gnunet-service-arm inherit standard error"),
1034 &no_stderr),
1036 };
1037 int lret;
1038
1039 if (GNUNET_OK !=
1041 argv,
1042 &argc,
1043 &argv))
1044 return 2;
1045 if (GNUNET_OK ==
1046 (lret = GNUNET_PROGRAM_run (
1047 argc,
1048 argv,
1049 "gnunet-arm",
1050 gettext_noop (
1051 "Control services and the Automated Restart Manager (ARM)"),
1052 options,
1053 &run,
1054 NULL)))
1055 {
1056 GNUNET_free_nz ((void *) argv);
1057 return ret;
1058 }
1059 GNUNET_free_nz ((void *) argv);
1060 return lret;
1061}
1062
1063
1064/* end of gnunet-arm.c */
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_OPTION_END
Definition: 002.c:13
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
#define gettext_noop(String)
Definition: gettext.h:74
static int once
Global to mark if we've run the initialization.
Definition: gnsrecord.c:65
static int no_stdout
Do we want to give our stdout to gnunet-service-arm?
Definition: gnunet-arm.c:128
static void timeout_task_cb(void *cls)
Task run on timeout (if -T is given).
Definition: gnunet-arm.c:898
static struct GNUNET_ARM_Operation * op
Current operation.
Definition: gnunet-arm.c:143
static const char * req_string(enum GNUNET_ARM_RequestStatus rs)
Returns a string interpretation of rs.
Definition: gnunet-arm.c:223
static struct GNUNET_ARM_MonitorHandle * m
Monitor connection with ARM.
Definition: gnunet-arm.c:103
static struct GNUNET_ARM_Handle * h
Connection with ARM.
Definition: gnunet-arm.c:98
static void term_callback(void *cls, enum GNUNET_ARM_RequestStatus rs, enum GNUNET_ARM_Result result)
We have requested a service to be stopped, this function is called with the result of the operation.
Definition: gnunet-arm.c:477
static void delete_files()
Attempts to delete configuration file and GNUNET_HOME on ARM shutdown provided the end and delete opt...
Definition: gnunet-arm.c:151
static int start
Set if we are to start default services (including ARM).
Definition: gnunet-arm.c:38
static int monitor
Monitor ARM activity.
Definition: gnunet-arm.c:63
static int show_all
Set if we should print all services, including stopped ones.
Definition: gnunet-arm.c:58
static int list
Set if we should print a list of currently running services.
Definition: gnunet-arm.c:68
static int quiet
Set if we should not print status messages.
Definition: gnunet-arm.c:53
static void stop_callback(void *cls, enum GNUNET_ARM_RequestStatus rs, enum GNUNET_ARM_Result result)
We have requested ARM to be stopped, this function is called with the result of the operation.
Definition: gnunet-arm.c:374
static void shutdown_task(void *cls)
Main continuation-passing-style loop.
Definition: gnunet-arm.c:180
static int ret
Final status code.
Definition: gnunet-arm.c:93
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition: gnunet-arm.c:108
static char * dir
Set to the directory where runtime files are stored.
Definition: gnunet-arm.c:88
static char * term
Set to the name of a service to kill.
Definition: gnunet-arm.c:78
static char * init
Set to the name of a service to start.
Definition: gnunet-arm.c:73
static void run(void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c)
Main function that will be run by the scheduler.
Definition: gnunet-arm.c:916
static void action_loop(void *cls)
Main task that runs our various operations in order.
Definition: gnunet-arm.c:727
static int restart
Set if we are to stop/start default services (including ARM).
Definition: gnunet-arm.c:43
static const char * ret_string(enum GNUNET_ARM_Result result)
Returns a string interpretation of the result.
Definition: gnunet-arm.c:244
static void conn_status(void *cls, int connected)
Function called whenever we connect to or disconnect from ARM.
Definition: gnunet-arm.c:301
static struct GNUNET_TIME_Relative timeout
User defined timestamp for completing operations.
Definition: gnunet-arm.c:118
static void list_callback(void *cls, enum GNUNET_ARM_RequestStatus rs, unsigned int count, const struct GNUNET_ARM_ServiceInfo *service_info)
Function called with the list of running services.
Definition: gnunet-arm.c:530
static unsigned int phase
Processing stage that we are in.
Definition: gnunet-arm.c:113
static struct GNUNET_SCHEDULER_Task * al_task
Handle for the task running the action_loop().
Definition: gnunet-arm.c:138
static void srv_status(void *cls, const char *service, enum GNUNET_ARM_ServiceMonitorStatus status)
Function called when a service starts or stops.
Definition: gnunet-arm.c:847
static int end
Set if we are to shutdown all services (including ARM).
Definition: gnunet-arm.c:33
static char * config_file
Set to the name of the config file used.
Definition: gnunet-arm.c:83
static struct GNUNET_SCHEDULER_Task * timeout_task
Task to be run on timeout.
Definition: gnunet-arm.c:123
int main(int argc, char *const *argv)
The main function to obtain arm from gnunetd.
Definition: gnunet-arm.c:968
static int no_stderr
Do we want to give our stderr to gnunet-service-arm?
Definition: gnunet-arm.c:133
static void init_callback(void *cls, enum GNUNET_ARM_RequestStatus rs, enum GNUNET_ARM_Result result)
We have requested a service to be started, this function is called with the result of the operation.
Definition: gnunet-arm.c:430
static void start_callback(void *cls, enum GNUNET_ARM_RequestStatus rs, enum GNUNET_ARM_Result result)
We have requested ARM to be started, this function is called with the result of the operation.
Definition: gnunet-arm.c:331
static char * name
Name (label) of the records to list.
static int status
The program status; 0 for success.
Definition: gnunet-nse.c:39
static int result
Global testing status.
static struct GNUNET_SERVICE_Handle * service
Handle to our service instance.
GNUNET_ARM_ServiceMonitorStatus
Statuses of services.
struct GNUNET_ARM_Handle * GNUNET_ARM_connect(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_ARM_ConnectionStatusCallback conn_status, void *conn_status_cls)
Set up a context for communicating with ARM, then start connecting to the ARM service using that cont...
Definition: arm_api.c:577
struct GNUNET_ARM_Operation * GNUNET_ARM_request_service_start(struct GNUNET_ARM_Handle *h, const char *service_name, enum GNUNET_OS_InheritStdioFlags std_inheritance, GNUNET_ARM_ResultCallback cont, void *cont_cls)
Request for a service to be started.
Definition: arm_api.c:935
struct GNUNET_ARM_MonitorHandle * GNUNET_ARM_monitor_start(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_ARM_ServiceMonitorCallback cont, void *cont_cls)
Setup a context for monitoring ARM, then start connecting to the ARM service for monitoring using tha...
struct GNUNET_ARM_Operation * GNUNET_ARM_request_service_list(struct GNUNET_ARM_Handle *h, GNUNET_ARM_ServiceListCallback cont, void *cont_cls)
Request a list of running services.
Definition: arm_api.c:1085
struct GNUNET_ARM_Operation * GNUNET_ARM_request_service_stop(struct GNUNET_ARM_Handle *h, const char *service_name, GNUNET_ARM_ResultCallback cont, void *cont_cls)
Request a service to be stopped.
Definition: arm_api.c:1049
void GNUNET_ARM_monitor_stop(struct GNUNET_ARM_MonitorHandle *h)
Disconnect from the ARM service and destroy the handle.
void GNUNET_ARM_disconnect(struct GNUNET_ARM_Handle *h)
Disconnect from the ARM service and destroy the handle.
Definition: arm_api.c:603
GNUNET_ARM_Result
Replies to ARM requests.
GNUNET_ARM_RequestStatus
Statuses of the requests that client can send to ARM.
void GNUNET_ARM_operation_cancel(struct GNUNET_ARM_Operation *op)
Abort an operation.
Definition: arm_api.c:794
@ GNUNET_ARM_SERVICE_STATUS_FINISHED
The service was started, but then exited normally.
@ GNUNET_ARM_SERVICE_STATUS_FAILED
The service has previously failed, and will be restarted.
@ GNUNET_ARM_SERVICE_STATUS_STOPPED
Service is stopped.
@ GNUNET_ARM_SERVICE_STATUS_STOPPING
The service was started, and we're currently waiting for it to be stopped.
@ GNUNET_ARM_SERVICE_STATUS_STARTED
Service has been started and is currently running.
@ GNUNET_ARM_SERVICE_STOPPING
Service stopping was initiated.
@ GNUNET_ARM_SERVICE_STOPPED
Service was stopped.
@ GNUNET_ARM_SERVICE_STARTING
Service starting was initiated.
@ GNUNET_ARM_SERVICE_MONITORING_STARTED
Dummy message.
@ GNUNET_ARM_RESULT_IS_NOT_KNOWN
Asked to start or stop a service, but it's not known.
@ GNUNET_ARM_RESULT_IS_STARTING_ALREADY
Asked to start it, but it's already starting.
@ GNUNET_ARM_RESULT_IS_STOPPED_ALREADY
Asked to stop it, but it's already stopped.
@ GNUNET_ARM_RESULT_STARTING
Service starting was initiated.
@ GNUNET_ARM_RESULT_IS_STARTED_ALREADY
Asked to start it, but it's already started.
@ GNUNET_ARM_RESULT_STOPPING
ARM stopping was initiated (there's no "stopped" for ARM itself).
@ GNUNET_ARM_RESULT_IS_STOPPING_ALREADY
Asked to stop it, but it's already stopping.
@ GNUNET_ARM_RESULT_STOPPED
Service was stopped (never sent for ARM itself).
@ GNUNET_ARM_RESULT_START_FAILED
Tried to start a service, but that failed for some reason.
@ GNUNET_ARM_RESULT_IN_SHUTDOWN
Asked to start something, but ARM is shutting down and can't comply.
@ GNUNET_ARM_REQUEST_DISCONNECTED
We disconnected from ARM, and request was not sent.
@ GNUNET_ARM_REQUEST_SENT_OK
Message was sent successfully.
enum GNUNET_GenericReturnValue GNUNET_CLIENT_test(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *service_name)
Test if the port or UNIXPATH of the given service_name is in use and thus (most likely) the respectiv...
Definition: client.c:903
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_filename(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value)
Get a configuration value that should be the name of a file or directory.
struct GNUNET_CONFIGURATION_Handle * GNUNET_CONFIGURATION_dup(const struct GNUNET_CONFIGURATION_Handle *cfg)
Duplicate an existing configuration object.
void GNUNET_CONFIGURATION_destroy(struct GNUNET_CONFIGURATION_Handle *cfg)
Destroy configuration object.
enum GNUNET_GenericReturnValue GNUNET_CONFIGURATION_get_value_string(const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value)
Get a configuration value that should be a string.
enum GNUNET_GenericReturnValue GNUNET_DISK_directory_remove(const char *filename)
Remove all files in a directory (rm -rf).
Definition: disk.c:1088
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_relative_time(char shortName, const char *name, const char *argumentHelp, const char *description, struct GNUNET_TIME_Relative *val)
Allow user to specify a struct GNUNET_TIME_Relative (using human-readable "fancy" time).
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_flag(char shortName, const char *name, const char *description, int *val)
Allow user to specify a flag (which internally means setting an integer to 1/GNUNET_YES/GNUNET_OK.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_string(char shortName, const char *name, const char *argumentHelp, const char *description, char **str)
Allow user to specify a string.
#define GNUNET_log(kind,...)
@ GNUNET_OK
@ GNUNET_YES
@ GNUNET_SYSERR
#define GNUNET_break_op(cond)
Use this for assertion violations caused by other peers (i.e.
void GNUNET_log_config_missing(enum GNUNET_ErrorType kind, const char *section, const char *option)
Log error message about missing configuration option.
@ GNUNET_ERROR_TYPE_WARNING
@ GNUNET_ERROR_TYPE_ERROR
@ GNUNET_ERROR_TYPE_DEBUG
int int GNUNET_asprintf(char **buf, const char *format,...) __attribute__((format(printf
Like asprintf, just portable.
#define GNUNET_free(ptr)
Wrapper around free.
#define GNUNET_free_nz(ptr)
Wrapper around free.
@ GNUNET_OS_INHERIT_STD_OUT
When this flag is set, the child process will inherit stdout of the parent.
Definition: gnunet_os_lib.h:89
@ GNUNET_OS_INHERIT_STD_ERR
When this flag is set, the child process will inherit stderr of the parent.
Definition: gnunet_os_lib.h:95
@ GNUNET_OS_INHERIT_STD_NONE
No standard streams should be inherited.
Definition: gnunet_os_lib.h:77
enum GNUNET_GenericReturnValue GNUNET_PROGRAM_run(int argc, char *const *argv, const char *binaryName, const char *binaryHelp, const struct GNUNET_GETOPT_CommandLineOption *options, GNUNET_PROGRAM_Main task, void *task_cls)
Run a standard GNUnet command startup sequence (initialize loggers and configuration,...
Definition: program.c:400
void GNUNET_SCHEDULER_shutdown(void)
Request the shutdown of a scheduler.
Definition: scheduler.c:566
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_shutdown(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run on shutdown, that is when a CTRL-C signal is received,...
Definition: scheduler.c:1338
void * GNUNET_SCHEDULER_cancel(struct GNUNET_SCHEDULER_Task *task)
Cancel the task with the specified identifier.
Definition: scheduler.c:979
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_now(GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run as soon as possible.
Definition: scheduler.c:1303
struct GNUNET_SCHEDULER_Task * GNUNET_SCHEDULER_add_delayed(struct GNUNET_TIME_Relative delay, GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
Schedule a new task to be run with a specified delay.
Definition: scheduler.c:1276
enum GNUNET_GenericReturnValue GNUNET_STRINGS_get_utf8_args(int argc, char *const *argv, int *u8argc, char *const **u8argv)
Returns utf-8 encoded arguments.
Definition: strings.c:1230
struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_remaining(struct GNUNET_TIME_Absolute future)
Given a timestamp in the future, how much time remains until then?
Definition: time.c:406
const char * GNUNET_STRINGS_relative_time_to_string(struct GNUNET_TIME_Relative delta, int do_round)
Give relative time in human-readable fancy format.
Definition: strings.c:570
#define _(String)
GNU gettext support macro.
Definition: platform.h:178
Handle for interacting with ARM.
Definition: arm_api.c:103
Handle for interacting with ARM.
Entry in a doubly-linked list of operations awaiting for replies (in-order) from the ARM service.
Definition: arm_api.c:41
Information about a service managed by ARM.
Definition of a command line option.
Entry in list of pending tasks.
Definition: scheduler.c:135
Time for relative time used by GNUnet, in microseconds.
uint64_t rel_value_us
The actual value.