client-common.h revision 38cb3d139aefb7c65919cf4aba5ded7b5fd50e6f
4eb418849d5c6bf77b2721e4e6aef2e97deaa197Timo Sirainen/* max. size of input buffer. this means:
d9fdacd5fb3e07997e5c389739d2054f0c8441d8Timo Sirainen IMAP: Max. length of a single parameter
d9fdacd5fb3e07997e5c389739d2054f0c8441d8Timo Sirainen POP3: Max. length of a command line (spec says 512 would be enough)
d9fdacd5fb3e07997e5c389739d2054f0c8441d8Timo Sirainen/* max. size of output buffer. if it gets full, the client is disconnected.
d9fdacd5fb3e07997e5c389739d2054f0c8441d8Timo Sirainen SASL authentication gives the largest output. */
1ea0aa8e14e843f2776746776a429b0a1aae299dTimo Sirainen/* Disconnect client after this many milliseconds if it hasn't managed
d9fdacd5fb3e07997e5c389739d2054f0c8441d8Timo Sirainen to log in yet. */
d9fdacd5fb3e07997e5c389739d2054f0c8441d8Timo Sirainen#define CLIENT_LOGIN_TIMEOUT_MSECS (MASTER_LOGIN_TIMEOUT_SECS*1000)
48f78a48f2e1cf299026544444666471ae16ad97Timo Sirainen "Waiting for authentication process to respond.."
4a7e04d325db0c03f575f98f045246fceb0de279Timo Sirainen "Waiting for authentication master process to respond.."
6e77746e501c2b45850b1c530836058ed75e09eeTimo Sirainen /* for proxying */
8c8f7ac580b661aee3d8b8dd37df4a9b41c77000Timo Sirainen unsigned int port;
d9fdacd5fb3e07997e5c389739d2054f0c8441d8Timo Sirainen void (*create)(struct client *client, void **other_sets);
48f78a48f2e1cf299026544444666471ae16ad97Timo Sirainen void (*send_line)(struct client *client, enum client_cmd_reply reply,
0dc7891233a973829f00371b27810f849b987c66Timo Sirainen const char *text);
0dc7891233a973829f00371b27810f849b987c66Timo Sirainen bool (*auth_handle_reply)(struct client *client,
0dc7891233a973829f00371b27810f849b987c66Timo Sirainen void (*auth_send_challenge)(struct client *client, const char *data);
0dc7891233a973829f00371b27810f849b987c66Timo Sirainen int (*auth_parse_response)(struct client *client);
0dc7891233a973829f00371b27810f849b987c66Timo Sirainen int (*proxy_parse_line)(struct client *client, const char *line);
b5ff746939712c6a9bef71405fa786d5471cf177Timo Sirainen char *proxy_user, *proxy_master_user, *proxy_password;
b5ff746939712c6a9bef71405fa786d5471cf177Timo Sirainen const struct login_settings *set, void **other_sets,
b5ff746939712c6a9bef71405fa786d5471cf177Timo Sirainen const struct ip_addr *local_ip, const struct ip_addr *remote_ip);
b5ff746939712c6a9bef71405fa786d5471cf177Timo Sirainenvoid client_destroy(struct client *client, const char *reason);
b5ff746939712c6a9bef71405fa786d5471cf177Timo Sirainenvoid client_destroy_success(struct client *client, const char *reason);
b5ff746939712c6a9bef71405fa786d5471cf177Timo Sirainenvoid client_destroy_internal_failure(struct client *client);
b5ff746939712c6a9bef71405fa786d5471cf177Timo Sirainenvoid client_cmd_starttls(struct client *client);
1107c86ff3fa4f29796c2e76134b78d0b4a0db50Timo Sirainenunsigned int clients_get_count(void) ATTR_PURE;
b5ff746939712c6a9bef71405fa786d5471cf177Timo Sirainenvoid client_log(struct client *client, const char *msg);
b5ff746939712c6a9bef71405fa786d5471cf177Timo Sirainenvoid client_log_err(struct client *client, const char *msg);
b5ff746939712c6a9bef71405fa786d5471cf177Timo Sirainenconst char *client_get_extra_disconnect_reason(struct client *client);
b5ff746939712c6a9bef71405fa786d5471cf177Timo Sirainenvoid client_auth_failed(struct client *client);
4eb418849d5c6bf77b2721e4e6aef2e97deaa197Timo Sirainenvoid client_send_line(struct client *client, enum client_cmd_reply reply,
4eb418849d5c6bf77b2721e4e6aef2e97deaa197Timo Sirainen const char *text);
4eb418849d5c6bf77b2721e4e6aef2e97deaa197Timo Sirainenvoid client_send_raw_data(struct client *client, const void *data, size_t size);
4eb418849d5c6bf77b2721e4e6aef2e97deaa197Timo Sirainenvoid client_send_raw(struct client *client, const char *data);
4eb418849d5c6bf77b2721e4e6aef2e97deaa197Timo Sirainenvoid client_set_auth_waiting(struct client *client);
a8b37b688ceaa3ed3d40b3ccbdba5bb75cfb64b0Timo Sirainenvoid client_auth_send_challenge(struct client *client, const char *data);
a8b37b688ceaa3ed3d40b3ccbdba5bb75cfb64b0Timo Sirainenint client_auth_parse_response(struct client *client);
4eb418849d5c6bf77b2721e4e6aef2e97deaa197Timo Sirainenint client_auth_begin(struct client *client, const char *mech_name,
d9fdacd5fb3e07997e5c389739d2054f0c8441d8Timo Sirainenbool client_check_plaintext_auth(struct client *client, bool pass_sent);
0dc7891233a973829f00371b27810f849b987c66Timo Sirainenvoid client_proxy_finish_destroy_client(struct client *client);
02b32cf39a098edf60981fc228e4b034f11f3b90Timo Sirainenvoid client_proxy_log_failure(struct client *client, const char *line);
0dc7891233a973829f00371b27810f849b987c66Timo Sirainenvoid client_proxy_failed(struct client *client, bool send_line);