client-common.h revision 660b99a7059824676b2b8d6f79b8e15d47df25a2
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainen/* max. size of input buffer. this means:
fa2a11210f20fb8998ed656f75e163191c8047e6Timo Sirainen IMAP: Max. length of a single parameter
fa2a11210f20fb8998ed656f75e163191c8047e6Timo Sirainen POP3: Max. length of a command line (spec says 512 would be enough)
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainen/* max. size of output buffer. if it gets full, the client is disconnected.
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainen SASL authentication gives the largest output. */
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainen/* Disconnect client after idling this many milliseconds */
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainen#define CLIENT_LOGIN_IDLE_TIMEOUT_MSECS (3*60*1000)
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainen "Waiting for authentication process to respond.."
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainen "Waiting for authentication master process to respond.."
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainen /* for proxying */
fa2433aebcf3fccfa30ca9eed9b1a9166cf92ee2Timo Sirainen unsigned int port;
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainen void (*create)(struct client *client, void **other_sets);
367e28a16854ee9f7247b2518f36f5e9163fcc10Timo Sirainen void (*send_line)(struct client *client, enum client_cmd_reply reply,
367e28a16854ee9f7247b2518f36f5e9163fcc10Timo Sirainen const char *text);
2fb9ae42f9e36388ec6db24188b9108434043fd0Timo Sirainen bool (*auth_handle_reply)(struct client *client,
367e28a16854ee9f7247b2518f36f5e9163fcc10Timo Sirainen void (*auth_send_challenge)(struct client *client, const char *data);
367e28a16854ee9f7247b2518f36f5e9163fcc10Timo Sirainen int (*auth_parse_response)(struct client *client);
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainen int (*proxy_parse_line)(struct client *client, const char *line);
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainen char *proxy_user, *proxy_master_user, *proxy_password;
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainen const struct login_settings *set, void **other_sets,
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainen const struct ip_addr *local_ip, const struct ip_addr *remote_ip);
367e28a16854ee9f7247b2518f36f5e9163fcc10Timo Sirainenvoid client_destroy(struct client *client, const char *reason);
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainenvoid client_destroy_success(struct client *client, const char *reason);
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainenvoid client_destroy_internal_failure(struct client *client);
4da8c6cdefabd31262318c32da3c13de1d9ea953Timo Sirainenvoid client_cmd_starttls(struct client *client);
542e28b384a6b26695f3e8de38fd5727d06f3333Timo Sirainenunsigned int clients_get_count(void) ATTR_PURE;
542e28b384a6b26695f3e8de38fd5727d06f3333Timo Sirainenvoid client_log(struct client *client, const char *msg);
542e28b384a6b26695f3e8de38fd5727d06f3333Timo Sirainenvoid client_log_err(struct client *client, const char *msg);
542e28b384a6b26695f3e8de38fd5727d06f3333Timo Sirainenconst char *client_get_extra_disconnect_reason(struct client *client);
542e28b384a6b26695f3e8de38fd5727d06f3333Timo Sirainenvoid client_auth_failed(struct client *client);
18c209a06941ef583b08b173dadfbe4571995bf9Timo Sirainenvoid client_send_line(struct client *client, enum client_cmd_reply reply,
18c209a06941ef583b08b173dadfbe4571995bf9Timo Sirainen const char *text);
18c209a06941ef583b08b173dadfbe4571995bf9Timo Sirainenvoid client_send_raw_data(struct client *client, const void *data, size_t size);
18c209a06941ef583b08b173dadfbe4571995bf9Timo Sirainenvoid client_send_raw(struct client *client, const char *data);
18c209a06941ef583b08b173dadfbe4571995bf9Timo Sirainenvoid client_set_auth_waiting(struct client *client);
18c209a06941ef583b08b173dadfbe4571995bf9Timo Sirainenvoid client_auth_send_challenge(struct client *client, const char *data);
18c209a06941ef583b08b173dadfbe4571995bf9Timo Sirainenint client_auth_parse_response(struct client *client);
18c209a06941ef583b08b173dadfbe4571995bf9Timo Sirainenint client_auth_begin(struct client *client, const char *mech_name,
18c209a06941ef583b08b173dadfbe4571995bf9Timo Sirainenbool client_check_plaintext_auth(struct client *client, bool pass_sent);
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainenvoid client_proxy_finish_destroy_client(struct client *client);
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainenvoid client_proxy_log_failure(struct client *client, const char *line);
8d3278a82b964217d95c340ec6f82037cdc59d19Timo Sirainenvoid client_proxy_failed(struct client *client, bool send_line);