client-common.h revision bdd36cfdba3ff66d25570a9ff568d69e1eb543cf
72388282bf6718c39af34cfcf51438910f9d62daTimo Sirainen#include "master-login.h" /* for LOGIN_MAX_SESSION_ID_LEN */
812ac1e2570c600a086c09b24d250224a822a97dTimo Sirainen/* max. size of input buffer. this means:
812ac1e2570c600a086c09b24d250224a822a97dTimo Sirainen IMAP: Max. length of command's all parameters. SASL-IR is read into
847aeef259d42e2f14cf126699e28291e6e1fb53Timo Sirainen a separate larger buffer.
812ac1e2570c600a086c09b24d250224a822a97dTimo Sirainen POP3: Max. length of a command line (spec says 512 would be enough)
812ac1e2570c600a086c09b24d250224a822a97dTimo Sirainen (MASTER_AUTH_MAX_DATA_SIZE - LOGIN_MAX_MASTER_PREFIX_LEN - \
812ac1e2570c600a086c09b24d250224a822a97dTimo Sirainen/* max. size of output buffer. if it gets full, the client is disconnected.
812ac1e2570c600a086c09b24d250224a822a97dTimo Sirainen SASL authentication gives the largest output. */
812ac1e2570c600a086c09b24d250224a822a97dTimo Sirainen/* Max. length of SASL authentication buffer. */
812ac1e2570c600a086c09b24d250224a822a97dTimo Sirainen/* Disconnect client after this many milliseconds if it hasn't managed
812ac1e2570c600a086c09b24d250224a822a97dTimo Sirainen to log in yet. */
812ac1e2570c600a086c09b24d250224a822a97dTimo Sirainen#define CLIENT_LOGIN_TIMEOUT_MSECS (MASTER_LOGIN_TIMEOUT_SECS*1000)
812ac1e2570c600a086c09b24d250224a822a97dTimo Sirainen "Waiting for authentication process to respond.."
812ac1e2570c600a086c09b24d250224a822a97dTimo Sirainen "Waiting for authentication master process to respond.."
847aeef259d42e2f14cf126699e28291e6e1fb53Timo Sirainen /* for proxying */
847aeef259d42e2f14cf126699e28291e6e1fb53Timo Sirainen const char *host, *hostip, *destuser, *password;
847aeef259d42e2f14cf126699e28291e6e1fb53Timo Sirainen unsigned int port;
812ac1e2570c600a086c09b24d250224a822a97dTimo Sirainen void (*create)(struct client *client, void **other_sets);
847aeef259d42e2f14cf126699e28291e6e1fb53Timo Sirainen void (*notify_auth_ready)(struct client *client);
812ac1e2570c600a086c09b24d250224a822a97dTimo Sirainen void (*notify_disconnect)(struct client *client,
812ac1e2570c600a086c09b24d250224a822a97dTimo Sirainen const char *text);
812ac1e2570c600a086c09b24d250224a822a97dTimo Sirainen void (*notify_starttls)(struct client *client,
847aeef259d42e2f14cf126699e28291e6e1fb53Timo Sirainen void (*auth_send_challenge)(struct client *client, const char *data);
812ac1e2570c600a086c09b24d250224a822a97dTimo Sirainen void (*auth_parse_response)(struct client *client);
812ac1e2570c600a086c09b24d250224a822a97dTimo Sirainen const char *text);
812ac1e2570c600a086c09b24d250224a822a97dTimo Sirainen int (*proxy_parse_line)(struct client *client, const char *line);
812ac1e2570c600a086c09b24d250224a822a97dTimo Sirainen void (*proxy_error)(struct client *client, const char *text);
812ac1e2570c600a086c09b24d250224a822a97dTimo Sirainen const struct master_service_ssl_settings *ssl_set;
72388282bf6718c39af34cfcf51438910f9d62daTimo Sirainen char *proxy_user, *proxy_master_user, *proxy_password;
72388282bf6718c39af34cfcf51438910f9d62daTimo Sirainen const struct master_service_ssl_settings *ssl_set,
a93de780c3b78cfaace287026e468f3c3e34683aTimo Sirainen const struct ip_addr *local_ip, const struct ip_addr *remote_ip);
72388282bf6718c39af34cfcf51438910f9d62daTimo Sirainenvoid client_destroy(struct client *client, const char *reason);
bc2d4f1c18222a3bd2a6b2b8b5f6abb560a865b3Timo Sirainenvoid client_destroy_success(struct client *client, const char *reason);
72388282bf6718c39af34cfcf51438910f9d62daTimo Sirainenvoid client_destroy_internal_failure(struct client *client);
a93de780c3b78cfaace287026e468f3c3e34683aTimo Sirainenbool client_unref(struct client **client) ATTR_NOWARN_UNUSED_RESULT;
const char *text);
const char *init_resp);
void clients_notify_auth_connected(void);
void client_destroy_oldest(void);
void clients_destroy_all(void);