aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_service_lib.h
diff options
context:
space:
mode:
authorBertrand Marc <beberking@gmail.com>2012-06-06 20:47:48 +0200
committerBertrand Marc <beberking@gmail.com>2012-06-06 20:47:48 +0200
commit740b30688bd745a527f96f9116c19acb3480971a (patch)
tree2709a3f4dba11c174aa9e1ba3612e30c578e76a9 /src/include/gnunet_service_lib.h
parent2b81464a43485fcc8ce079fafdee7b7a171835f4 (diff)
Imported Upstream version 0.9.3upstream/0.9.3
Diffstat (limited to 'src/include/gnunet_service_lib.h')
-rw-r--r--src/include/gnunet_service_lib.h45
1 files changed, 28 insertions, 17 deletions
diff --git a/src/include/gnunet_service_lib.h b/src/include/gnunet_service_lib.h
index 1641e0f..39e6a80 100644
--- a/src/include/gnunet_service_lib.h
+++ b/src/include/gnunet_service_lib.h
@@ -43,7 +43,7 @@ extern "C"
* Get the list of addresses that a server for the given service
* should bind to.
*
- * @param serviceName name of the service
+ * @param service_name name of the service
* @param cfg configuration (which specifies the addresses)
* @param addrs set (call by reference) to an array of pointers to the
* addresses the server should bind to and listen on; the
@@ -60,7 +60,7 @@ extern "C"
* set to NULL).
*/
int
-GNUNET_SERVICE_get_server_addresses (const char *serviceName,
+GNUNET_SERVICE_get_server_addresses (const char *service_name,
const struct GNUNET_CONFIGURATION_Handle
*cfg, struct sockaddr ***addrs,
socklen_t ** addr_lens);
@@ -85,16 +85,22 @@ typedef void (*GNUNET_SERVICE_Main) (void *cls,
*/
enum GNUNET_SERVICE_Options
{
- /**
- * Use defaults.
- */
+ /**
+ * Use defaults.
+ */
GNUNET_SERVICE_OPTION_NONE = 0,
- /**
- * Do not trigger server shutdown on signals, allow for the user
- * to terminate the server explicitly when needed.
- */
- GNUNET_SERVICE_OPTION_MANUAL_SHUTDOWN = 1
+ /**
+ * Do not trigger server shutdown on signals, allow for the user
+ * to terminate the server explicitly when needed.
+ */
+ GNUNET_SERVICE_OPTION_MANUAL_SHUTDOWN = 1,
+
+ /**
+ * Trigger a SOFT server shutdown on signals, allowing active
+ * non-monitor clients to complete their transactions.
+ */
+ GNUNET_SERVICE_OPTION_SOFT_SHUTDOWN = 2
};
@@ -104,32 +110,37 @@ enum GNUNET_SERVICE_Options
*
* @param argc number of command line arguments
* @param argv command line arguments
- * @param serviceName our service name
- * @param opt service options
+ * @param service_name our service name
+ * @param options service options
* @param task main task of the service
* @param task_cls closure for task
* @return GNUNET_SYSERR on error, GNUNET_OK
* if we shutdown nicely
*/
int
-GNUNET_SERVICE_run (int argc, char *const *argv, const char *serviceName,
- enum GNUNET_SERVICE_Options opt, GNUNET_SERVICE_Main task,
+GNUNET_SERVICE_run (int argc, char *const *argv, const char *service_name,
+ enum GNUNET_SERVICE_Options options, GNUNET_SERVICE_Main task,
void *task_cls);
+/**
+ * Opaque handle for a service.
+ */
struct GNUNET_SERVICE_Context;
/**
* Run a service startup sequence within an existing
* initialized system.
*
- * @param serviceName our service name
+ * @param service_name our service name
* @param cfg configuration to use
+ * @param options service options
* @return NULL on error, service handle
*/
struct GNUNET_SERVICE_Context *
-GNUNET_SERVICE_start (const char *serviceName,
- const struct GNUNET_CONFIGURATION_Handle *cfg);
+GNUNET_SERVICE_start (const char *service_name,
+ const struct GNUNET_CONFIGURATION_Handle *cfg,
+ enum GNUNET_SERVICE_Options options);
/**