diff options
Diffstat (limited to 'src/include/gnunet_service_lib.h')
-rw-r--r-- | src/include/gnunet_service_lib.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/include/gnunet_service_lib.h b/src/include/gnunet_service_lib.h index 66e4f0cd9..c17af065f 100644 --- a/src/include/gnunet_service_lib.h +++ b/src/include/gnunet_service_lib.h | |||
@@ -38,6 +38,34 @@ extern "C" | |||
38 | #include "gnunet_configuration_lib.h" | 38 | #include "gnunet_configuration_lib.h" |
39 | #include "gnunet_server_lib.h" | 39 | #include "gnunet_server_lib.h" |
40 | 40 | ||
41 | |||
42 | /** | ||
43 | * Get the list of addresses that a server for the given service | ||
44 | * should bind to. | ||
45 | * | ||
46 | * @param serviceName name of the service | ||
47 | * @param cfg configuration (which specifies the addresses) | ||
48 | * @param addrs set (call by reference) to an array of pointers to the | ||
49 | * addresses the server should bind to and listen on; the | ||
50 | * array will be NULL-terminated (on success) | ||
51 | * @param addr_lens set (call by reference) to an array of the lengths | ||
52 | * of the respective 'struct sockaddr' struct in the 'addrs' | ||
53 | * array (on success) | ||
54 | * @return number of addresses found on success, | ||
55 | * GNUNET_SYSERR if the configuration | ||
56 | * did not specify reasonable finding information or | ||
57 | * if it specified a hostname that could not be resolved; | ||
58 | * GNUNET_NO if the number of addresses configured is | ||
59 | * zero (in this case, '*addrs' and '*addr_lens' will be | ||
60 | * set to NULL). | ||
61 | */ | ||
62 | int | ||
63 | GNUNET_SERVICE_get_server_addresses (const char *serviceName, | ||
64 | const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
65 | struct sockaddr ***addrs, | ||
66 | socklen_t **addr_lens); | ||
67 | |||
68 | |||
41 | /** | 69 | /** |
42 | * Function called by the service's run | 70 | * Function called by the service's run |
43 | * method to run service-specific setup code. | 71 | * method to run service-specific setup code. |