#ifndef MASTER_INTERFACE_H
#define MASTER_INTERFACE_H
/* We are attempting semi-compatibility with Postfix's master process here.
Whether this is useful or not remains to be seen. */
/* Child processes should send status updates whenever they accept a new
connection (decrease available_count) and when they close existing
connection (increase available_count). */
struct master_status {
unsigned int uid;
/* number of new connections process is currently accepting */
unsigned int available_count;
};
/* When connecting to log service, send this handshake first */
struct log_service_handshake {
/* If magic is invalid, assume the data is already what we want
to log */
unsigned int log_magic;
/* Add this prefix to each logged line */
unsigned int prefix_len;
/* unsigned char prefix[]; */
};
enum master_login_state {
};
/* getenv(MASTER_IS_PARENT_ENV) != NULL if process was started by
Dovecot master */
/* getenv(MASTER_UID_ENV) provides master_status.uid value */
/* getenv(MASTER_CLIENT_LIMIT_ENV) provides maximum
master_status.available_count as specified in configuration file */
/* getenv(MASTER_PROCESS_LIMIT_ENV) specifies how many processes of this type
can be created before reaching the limit */
/* getenv(MASTER_PROCESS_MIN_AVAIL_ENV) specifies how many processes of this
type are created at startup and are kept running all the time */
/* getenv(MASTER_SERVICE_COUNT_ENV) specifies how many client connections the
process can finish handling before it should kill itself. */
/* getenv(MASTER_SERVICE_IDLE_KILL_ENV) specifies service's idle_kill timeout
in seconds. */
/* getenv(MASTER_DOVECOT_VERSION_ENV) provides master's version number
(unset if version_ignore=yes) */
/* getenv(MASTER_SSL_KEY_PASSWORD_ENV) returns manually typed SSL key password,
if dovecot was started with -p parameter. */
/* getenv(DOVECOT_PRESERVE_ENVS_ENV) returns a space separated list of
environments that should be preserved. */
/* getenv(DOVECOT_LOG_DEBUG_ENV) returns the global log_debug setting. This can
be used to initialize debug logging immediately at startup. */
/* Write pipe to anvil. */
/* Anvil reads new log fds from this fd */
/* Master's "all processes full" notification fd for login processes */
/* Shared pipe to master, used to send master_status reports */
/* Pipe to master, used to detect when it dies. (MASTER_STATUS_FD would have
been fine for this, except it's inefficient in Linux) */
/* First file descriptor where process is expected to be listening.
The file descriptor count is given in -s parameter, defaulting to 1.
master_status.available_count reports how many accept()s we're still
accepting. Once no children are listening, master will do it and create
new child processes when needed. */
/* Timeouts: base everything on how long we can wait for login clients. */
/* auth server should abort auth requests before that happens */
/* auth clients should abort auth lookups after server was supposed to have
done that */
#endif