+shutdown_task (void *cls)
+{
+ if (NULL != al_task)
+ {
+ GNUNET_SCHEDULER_cancel (al_task);
+ al_task = NULL;
+ }
+ if (NULL != op)
+ {
+ GNUNET_ARM_operation_cancel (op);
+ op = NULL;
+ }
+ if (NULL != h)
+ {
+ GNUNET_ARM_disconnect (h);
+ h = NULL;
+ }
+ if (NULL != m)
+ {
+ GNUNET_ARM_monitor_stop (m);
+ m = NULL;
+ }
+ if ((GNUNET_YES == end) && (GNUNET_YES == delete))
+ delete_files ();
+ GNUNET_CONFIGURATION_destroy (cfg);
+ cfg = NULL;
+}
+
+
+/**
+ * Returns a string interpretation of 'rs'
+ *
+ * @param rs the request status from ARM
+ * @return a string interpretation of the request status
+ */
+static const char *
+req_string (enum GNUNET_ARM_RequestStatus rs)
+{
+ switch (rs)
+ {
+ case GNUNET_ARM_REQUEST_SENT_OK:
+ return _("Message was sent successfully");
+ case GNUNET_ARM_REQUEST_CONFIGURATION_ERROR:
+ return _("Misconfiguration (can not connect to the ARM service)");
+ case GNUNET_ARM_REQUEST_DISCONNECTED:
+ return _("We disconnected from ARM before we could send a request");
+ case GNUNET_ARM_REQUEST_BUSY:
+ return _("ARM API is busy");
+ case GNUNET_ARM_REQUEST_TIMEOUT:
+ return _("Request timed out");
+ }
+ return _("Unknown request status");
+}
+
+
+/**
+ * Returns a string interpretation of the 'result'
+ *
+ * @param result the arm result
+ * @return a string interpretation
+ */
+static const char *
+ret_string (enum GNUNET_ARM_Result result)
+{
+ switch (result)
+ {
+ case GNUNET_ARM_RESULT_STOPPED:
+ return _("%s is stopped");
+ case GNUNET_ARM_RESULT_STARTING:
+ return _("%s is starting");
+ case GNUNET_ARM_RESULT_STOPPING:
+ return _("%s is stopping");
+ case GNUNET_ARM_RESULT_IS_STARTING_ALREADY:
+ return _("%s is starting already");
+ case GNUNET_ARM_RESULT_IS_STOPPING_ALREADY:
+ return _("%s is stopping already");
+ case GNUNET_ARM_RESULT_IS_STARTED_ALREADY:
+ return _("%s is started already");
+ case GNUNET_ARM_RESULT_IS_STOPPED_ALREADY:
+ return _("%s is stopped already");
+ case GNUNET_ARM_RESULT_IS_NOT_KNOWN:
+ return _("%s service is not known to ARM");
+ case GNUNET_ARM_RESULT_START_FAILED:
+ return _("%s service failed to start");
+ case GNUNET_ARM_RESULT_IN_SHUTDOWN:
+ return _("%s service cannot be started because ARM is shutting down");
+ }
+ return _("%.s Unknown result code.");
+}