/*
This file is part of GNUnet.
- (C) 2009-2013 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2009-2013 Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
* addresses the server should bind to and listen on; the
* array will be NULL-terminated (on success)
* @param addr_lens set (call by reference) to an array of the lengths
- * of the respective 'struct sockaddr' struct in the @a addrs
+ * of the respective `struct sockaddr` struct in the @a addrs
* array (on success)
* @return number of addresses found on success,
* #GNUNET_SYSERR if the configuration
* @param server the initialized server
* @param cfg configuration to use
*/
-typedef void (*GNUNET_SERVICE_Main) (void *cls,
- struct GNUNET_SERVER_Handle *server,
- const struct GNUNET_CONFIGURATION_Handle *cfg);
+typedef void
+(*GNUNET_SERVICE_Main) (void *cls,
+ struct GNUNET_SERVER_Handle *server,
+ const struct GNUNET_CONFIGURATION_Handle *cfg);
/**
* if we shutdown nicely
*/
int
-GNUNET_SERVICE_run (int argc, char *const *argv,
+GNUNET_SERVICE_run (int argc, char *const *argv,
const char *service_name,
- enum GNUNET_SERVICE_Options options,
- GNUNET_SERVICE_Main task,
+ enum GNUNET_SERVICE_Options options,
+ GNUNET_SERVICE_Main task,
void *task_cls);
GNUNET_SERVICE_get_server (struct GNUNET_SERVICE_Context *ctx);
+/**
+ * Get the NULL-terminated array of listen sockets for this service.
+ *
+ * @param ctx service context to query
+ * @return NULL if there are no listen sockets, otherwise NULL-terminated
+ * array of listen sockets.
+ */
+struct GNUNET_NETWORK_Handle *const *
+GNUNET_SERVICE_get_listen_sockets (struct GNUNET_SERVICE_Context *ctx);
+
+
/**
* Stop a service that was started with #GNUNET_SERVICE_start.
*