client-common.h revision 6303191abcb37164f435ccdc56e9dbddf1288851
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainen/* max. size of input buffer. this means:
8cb72c59d5ea4e9e5f638d7ec840bb853f5a188eTimo Sirainen IMAP: Max. length of a single parameter
8cb72c59d5ea4e9e5f638d7ec840bb853f5a188eTimo Sirainen POP3: Max. length of a command line (spec says 512 would be enough)
8cb72c59d5ea4e9e5f638d7ec840bb853f5a188eTimo Sirainen/* max. size of output buffer. if it gets full, the client is disconnected.
8cb72c59d5ea4e9e5f638d7ec840bb853f5a188eTimo Sirainen SASL authentication gives the largest output. */
8cb72c59d5ea4e9e5f638d7ec840bb853f5a188eTimo Sirainen/* Disconnect client after this many milliseconds if it hasn't managed
8cb72c59d5ea4e9e5f638d7ec840bb853f5a188eTimo Sirainen to log in yet. */
8cb72c59d5ea4e9e5f638d7ec840bb853f5a188eTimo Sirainen#define CLIENT_LOGIN_TIMEOUT_MSECS (MASTER_LOGIN_TIMEOUT_SECS*1000)
8cb72c59d5ea4e9e5f638d7ec840bb853f5a188eTimo Sirainen "Waiting for authentication process to respond.."
e2ce8d4a6ac5d82a906178148453e7613fab9ba0Timo Sirainen "Waiting for authentication master process to respond.."
252db51b6c0a605163326b3ea5d09e9936ca3b29Timo Sirainen /* for proxying */
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainen unsigned int port;
1a0ece3e873e3864269ed7eaed957dc10c56d25fTimo Sirainen void (*create)(struct client *client, void **other_sets);
1a0ece3e873e3864269ed7eaed957dc10c56d25fTimo Sirainen void (*send_line)(struct client *client, enum client_cmd_reply reply,
5ac0b0bf32898c63da086ae169674ecac151a31eTimo Sirainen const char *text);
1a0ece3e873e3864269ed7eaed957dc10c56d25fTimo Sirainen bool (*auth_handle_reply)(struct client *client,
1a0ece3e873e3864269ed7eaed957dc10c56d25fTimo Sirainen void (*auth_send_challenge)(struct client *client, const char *data);
1a0ece3e873e3864269ed7eaed957dc10c56d25fTimo Sirainen int (*auth_parse_response)(struct client *client);
5ac0b0bf32898c63da086ae169674ecac151a31eTimo Sirainen int (*proxy_parse_line)(struct client *client, const char *line);
862ec874f9373e3e499e237d3b9f71fdf1413feeTimo Sirainen char *proxy_user, *proxy_master_user, *proxy_password;
0a49b316fc729e5d57268ffa63c7122ac73f994cTimo Sirainen const struct login_settings *set, void **other_sets,
51e1a1c280ccb461a15827f7987d09cb9708b6e3Timo Sirainen const struct ip_addr *local_ip, const struct ip_addr *remote_ip);
51e1a1c280ccb461a15827f7987d09cb9708b6e3Timo Sirainenvoid client_destroy(struct client *client, const char *reason);
51e1a1c280ccb461a15827f7987d09cb9708b6e3Timo Sirainenvoid client_destroy_success(struct client *client, const char *reason);
51e1a1c280ccb461a15827f7987d09cb9708b6e3Timo Sirainenvoid client_destroy_internal_failure(struct client *client);
4334b9b032298defd4d3906f5357698ff016ead0Timo Sirainenvoid client_cmd_starttls(struct client *client);
4334b9b032298defd4d3906f5357698ff016ead0Timo Sirainenunsigned int clients_get_count(void) ATTR_PURE;
4334b9b032298defd4d3906f5357698ff016ead0Timo Sirainenvoid client_log(struct client *client, const char *msg);
4334b9b032298defd4d3906f5357698ff016ead0Timo Sirainenvoid client_log_err(struct client *client, const char *msg);
4334b9b032298defd4d3906f5357698ff016ead0Timo Sirainenconst char *client_get_extra_disconnect_reason(struct client *client);
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainenvoid client_auth_failed(struct client *client);
a2738cdb6d2733fb3e186331d68009421a19ea00Timo Sirainenvoid client_send_line(struct client *client, enum client_cmd_reply reply,
d66ef20c30fee728899ee168c75fcc5ff8fbdac1Timo Sirainen const char *text);
ecc81625167ed96c04c02aa190a1ea5baa65b474Timo Sirainenvoid client_send_raw_data(struct client *client, const void *data, size_t size);
d66ef20c30fee728899ee168c75fcc5ff8fbdac1Timo Sirainenvoid client_send_raw(struct client *client, const char *data);
9e095dd6a77097356aca8216356d4d71ef1bea45Timo Sirainenvoid client_set_auth_waiting(struct client *client);
c09f9f95db314e7482c95e502e1c56ed6c555797Timo Sirainenvoid client_auth_send_challenge(struct client *client, const char *data);
4334b9b032298defd4d3906f5357698ff016ead0Timo Sirainenint client_auth_parse_response(struct client *client);
4334b9b032298defd4d3906f5357698ff016ead0Timo Sirainenint client_auth_begin(struct client *client, const char *mech_name,
0892446b45c195461bb7be6599f02d97e1e2c9b2Timo Sirainenbool client_check_plaintext_auth(struct client *client, bool pass_sent);
7af4788b402346c94496095dd819f95ce03fe431Timo Sirainenvoid client_proxy_finish_destroy_client(struct client *client);
0a0cd45a633112a2ae6aad801c1e6afe53ab95deTimo Sirainenvoid client_proxy_log_failure(struct client *client, const char *line);
0a0cd45a633112a2ae6aad801c1e6afe53ab95deTimo Sirainenvoid client_proxy_failed(struct client *client, bool send_line);