#ifndef MASTER_AUTH_H
#define MASTER_AUTH_H
#include "net.h"
struct master_service;
/* Major version changes are not backwards compatible,
minor version numbers can be ignored. */
/* Authentication client process's cookie size */
/* LOGIN_MAX_INBUF_SIZE should be based on this. Keep this large enough so that
LOGIN_MAX_INBUF_SIZE will be 1024+2 bytes. This is because IMAP ID command's
values may be max. 1024 bytes plus 2 for "" quotes. (Although it could be
even double of that when value is full of \" quotes, but for now lets not
make it too easy to waste memory..) */
#define MASTER_AUTH_ERRMSG_INTERNAL_FAILURE \
"Internal error occurred. Refer to server log for more information."
enum mail_auth_request_flags {
/* Connection has TLS compression enabled */
/* Connection is secure (SSL or just trusted) */
/* Connection is secured using SSL specifically */
};
/* Authentication request. File descriptor may be sent along with the
request. */
struct master_auth_request {
/* Request tag. Reply is sent back using same tag. */
unsigned int tag;
/* Authentication process, authentication ID and auth cookie. */
unsigned int auth_id;
unsigned int client_pid;
/* Properties of the connection. The file descriptor
itself may be a local socketpair. */
/* request follows this many bytes of client input */
/* inode of the transferred fd. verified just to be sure that the
correct fd is mapped to the correct struct. */
};
enum master_auth_status {
};
struct master_auth_reply {
/* tag=0 are notifications from master */
unsigned int tag;
/* PID of the post-login mail process handling this connection */
};
struct master_auth_request_params {
/* Client fd to transfer to post-login process or -1 if no fd is
wanted to be transferred. */
int client_fd;
/* Override master_auth->default_path if non-NULL */
const char *socket_path;
/* Authentication request that is sent to post-login process.
tag is ignored. */
/* Client input of size request.data_size */
const unsigned char *data;
};
/* reply=NULL if the auth lookup was cancelled due to some error */
void *context);
struct master_auth *
/* Send an authentication request. Returns tag which can be used to abort the
request (ie. ignore the reply from master). */
const struct master_auth_request_params *params,
unsigned int *tag_r);
/* For backwards compatibility: */
const struct master_auth_request *request,
const unsigned char *data,
#endif