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