master-service.h revision 89237470342ea6d4bbdf4cff9764037cfb3f6f45
#ifndef MASTER_SERVICE_H
#define MASTER_SERVICE_H
#include "network.h"
enum master_service_flags {
MASTER_SERVICE_FLAG_STD_CLIENT = 0x01,
/* this process is currently running standalone without a master */
MASTER_SERVICE_FLAG_STANDALONE = 0x02,
/* Log to configured log file instead of stderr. By default when
_FLAG_STANDALONE is set, logging is done to stderr. */
/* Service is going to do multiple configuration lookups,
keep the connection to config service open. */
};
struct master_service_connection {
int fd;
int listen_fd;
unsigned int remote_port;
unsigned int fifo:1;
unsigned int ssl:1;
};
typedef void
extern struct master_service *master_service;
const char *master_service_getopt_string(void);
/* Start service initialization. */
struct master_service *
/* Parser command line option. Returns TRUE if processed. */
/* Finish service initialization. The caller should drop privileges
before calling this. */
/* Clean environment from everything except TZ, USER and optionally HOME. */
void master_service_env_clean(bool preserve_home);
/* Initialize logging. */
unsigned int max_lines_per_sec);
/* Set maximum number of clients we can handle. Default is given by master. */
unsigned int client_limit);
/* Returns the maximum number of clients we can handle. */
/* Set maximum number of client connections we will handle before shutting
down. */
unsigned int count);
/* Returns the number of client connections we will handle before shutting
down. The value is decreased only after connection has been closed. */
/* Return the number of listener sockets. */
/* Returns configuration file path. */
/* Returns PACKAGE_VERSION or NULL if version_ignore=yes. This function is
useful mostly as parameter to module_dir_load(). */
/* Returns name of the service, as given in name parameter to _init(). */
/* Start the service. Blocks until finished */
/* Stop a running service. */
/* Send command to anvil process, if we have fd to it. */
/* Call whenever a client connection is destroyed. */
/* Deinitialize the service. */
#endif