Functions related to starting services. More...
Go to the source code of this file.
Macros | |
#define | GNUNET_SERVICE_MAIN(pd, service_name, service_options, init_cb, connect_cb, disconnect_cb, cls, ...) |
Creates the "main" function for a GNUnet service. | |
Typedefs | |
typedef void(* | GNUNET_SERVICE_InitCallback) (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_SERVICE_Handle *sh) |
Callback to initialize a service, called exactly once when the service is run. | |
typedef void *(* | GNUNET_SERVICE_ConnectHandler) (void *cls, struct GNUNET_SERVICE_Client *c, struct GNUNET_MQ_Handle *mq) |
Callback to be called when a client connects to the service. | |
typedef void(* | GNUNET_SERVICE_DisconnectHandler) (void *cls, struct GNUNET_SERVICE_Client *c, void *internal_cls) |
Callback to be called when a client disconnected from the service. | |
Enumerations | |
enum | GNUNET_SERVICE_Options { GNUNET_SERVICE_OPTION_NONE = 0 , GNUNET_SERVICE_OPTION_MANUAL_SHUTDOWN = 1 , GNUNET_SERVICE_OPTION_SOFT_SHUTDOWN = 2 , GNUNET_SERVICE_OPTION_SHUTDOWN_BITMASK = 3 , GNUNET_SERVICE_OPTION_CLOSE_LSOCKS = 4 } |
Options for the service (bitmask). More... | |
Functions | |
struct GNUNET_SERVICE_Handle * | GNUNET_SERVICE_start (const struct GNUNET_OS_ProjectData *pd, const char *service_name, const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_SERVICE_ConnectHandler connect_cb, GNUNET_SERVICE_DisconnectHandler disconnect_cb, void *cls, const struct GNUNET_MQ_MessageHandler *handlers) |
Low-level function to start a service if the scheduler is already running. | |
void | GNUNET_SERVICE_stop (struct GNUNET_SERVICE_Handle *srv) |
Stops a service that was started with GNUNET_SERVICE_start(). | |
int | GNUNET_SERVICE_run_ (const struct GNUNET_OS_ProjectData *pd, int argc, char *const *argv, const char *service_name, enum GNUNET_SERVICE_Options options, GNUNET_SERVICE_InitCallback service_init_cb, GNUNET_SERVICE_ConnectHandler connect_cb, GNUNET_SERVICE_DisconnectHandler disconnect_cb, void *cls, const struct GNUNET_MQ_MessageHandler *handlers) |
Creates the "main" function for a GNUnet service. | |
int | GNUNET_SERVICE_register_ (const struct GNUNET_OS_ProjectData *pd, const char *service_name, enum GNUNET_SERVICE_Options options, GNUNET_SERVICE_InitCallback service_init_cb, GNUNET_SERVICE_ConnectHandler connect_cb, GNUNET_SERVICE_DisconnectHandler disconnect_cb, void *cls, const struct GNUNET_MQ_MessageHandler *handlers) |
Registers the GNUnet service to be scheduled as part of a monilithic libgnunet. | |
void | GNUNET_SERVICE_main (const struct GNUNET_OS_ProjectData *pd, int argc, char *const *argv, struct GNUNET_CONFIGURATION_Handle *cfg, enum GNUNET_GenericReturnValue with_scheduler) |
Run the mainloop in a monolithic libgnunet. | |
void | GNUNET_SERVICE_suspend (struct GNUNET_SERVICE_Handle *sh) |
Suspend accepting connections from the listen socket temporarily. | |
void | GNUNET_SERVICE_resume (struct GNUNET_SERVICE_Handle *sh) |
Resume accepting connections from the listen socket. | |
void | GNUNET_SERVICE_client_continue (struct GNUNET_SERVICE_Client *c) |
Continue receiving further messages from the given client. | |
struct GNUNET_MQ_Handle * | GNUNET_SERVICE_client_get_mq (struct GNUNET_SERVICE_Client *c) |
Obtain the message queue of c. | |
void | GNUNET_SERVICE_client_disable_continue_warning (struct GNUNET_SERVICE_Client *c) |
Disable the warning the server issues if a message is not acknowledged in a timely fashion. | |
void | GNUNET_SERVICE_client_drop (struct GNUNET_SERVICE_Client *c) |
Ask the server to disconnect from the given client. | |
void | GNUNET_SERVICE_shutdown (struct GNUNET_SERVICE_Handle *sh) |
Explicitly stops the service. | |
void | GNUNET_SERVICE_client_mark_monitor (struct GNUNET_SERVICE_Client *c) |
Set the 'monitor' flag on this client. | |
void | GNUNET_SERVICE_client_persist (struct GNUNET_SERVICE_Client *c) |
Set the persist option on this client. | |
Functions related to starting services.
Definition in file gnunet_service_lib.h.