client-common.h revision bdd36cfdba3ff66d25570a9ff568d69e1eb543cf
5f5870385cff47efd2f58e7892f251cf13761528Timo Sirainen#ifndef CLIENT_COMMON_H
2793e3bd31d212d6506686aa70773e13d9d98195Timo Sirainen#define CLIENT_COMMON_H
2793e3bd31d212d6506686aa70773e13d9d98195Timo Sirainen
2793e3bd31d212d6506686aa70773e13d9d98195Timo Sirainen#include "net.h"
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen#include "login-proxy.h"
2793e3bd31d212d6506686aa70773e13d9d98195Timo Sirainen#include "sasl-server.h"
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen#include "master-login.h" /* for LOGIN_MAX_SESSION_ID_LEN */
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen
2793e3bd31d212d6506686aa70773e13d9d98195Timo Sirainen#define LOGIN_MAX_MASTER_PREFIX_LEN 128
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen/* max. size of input buffer. this means:
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen
2793e3bd31d212d6506686aa70773e13d9d98195Timo Sirainen IMAP: Max. length of command's all parameters. SASL-IR is read into
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen a separate larger buffer.
2793e3bd31d212d6506686aa70773e13d9d98195Timo Sirainen POP3: Max. length of a command line (spec says 512 would be enough)
2793e3bd31d212d6506686aa70773e13d9d98195Timo Sirainen*/
2793e3bd31d212d6506686aa70773e13d9d98195Timo Sirainen#define LOGIN_MAX_INBUF_SIZE \
2793e3bd31d212d6506686aa70773e13d9d98195Timo Sirainen (MASTER_AUTH_MAX_DATA_SIZE - LOGIN_MAX_MASTER_PREFIX_LEN - \
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainen LOGIN_MAX_SESSION_ID_LEN)
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainen/* max. size of output buffer. if it gets full, the client is disconnected.
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainen SASL authentication gives the largest output. */
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen#define LOGIN_MAX_OUTBUF_SIZE 4096
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen
2793e3bd31d212d6506686aa70773e13d9d98195Timo Sirainen/* Max. length of SASL authentication buffer. */
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen#define LOGIN_MAX_AUTH_BUF_SIZE 8192
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen/* Disconnect client after this many milliseconds if it hasn't managed
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen to log in yet. */
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen#define CLIENT_LOGIN_TIMEOUT_MSECS (MASTER_LOGIN_TIMEOUT_SECS*1000)
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen
a0c453a8edaec90fb0d945c874de0b1845bc7d7eTimo Sirainen#define AUTH_SERVER_WAITING_MSG \
a0c453a8edaec90fb0d945c874de0b1845bc7d7eTimo Sirainen "Waiting for authentication process to respond.."
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen#define AUTH_MASTER_WAITING_MSG \
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen "Waiting for authentication master process to respond.."
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen
88dc563319efecd6e68bad16b0d92672da05584aTimo Sirainenenum client_disconnect_reason {
88dc563319efecd6e68bad16b0d92672da05584aTimo Sirainen CLIENT_DISCONNECT_TIMEOUT,
85a4ae7e8df7ea45a7665828e5edf48a5fc85730Timo Sirainen CLIENT_DISCONNECT_SYSTEM_SHUTDOWN,
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainen CLIENT_DISCONNECT_RESOURCE_CONSTRAINT,
1b0cfbf3cc77a670b92fff5c30f7b1eb17a63ab1Timo Sirainen CLIENT_DISCONNECT_INTERNAL_ERROR
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen};
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainenenum client_auth_result {
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen CLIENT_AUTH_RESULT_SUCCESS,
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen CLIENT_AUTH_RESULT_REFERRAL_SUCCESS,
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen CLIENT_AUTH_RESULT_REFERRAL_NOLOGIN,
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen CLIENT_AUTH_RESULT_ABORTED,
1b0cfbf3cc77a670b92fff5c30f7b1eb17a63ab1Timo Sirainen CLIENT_AUTH_RESULT_AUTHFAILED,
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen CLIENT_AUTH_RESULT_AUTHFAILED_REASON,
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen CLIENT_AUTH_RESULT_AUTHZFAILED,
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen CLIENT_AUTH_RESULT_TEMPFAIL,
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen CLIENT_AUTH_RESULT_SSL_REQUIRED
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen};
85a4ae7e8df7ea45a7665828e5edf48a5fc85730Timo Sirainen
85a4ae7e8df7ea45a7665828e5edf48a5fc85730Timo Sirainenstruct client_auth_reply {
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainen const char *master_user, *reason;
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainen /* for proxying */
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainen const char *host, *hostip, *destuser, *password;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen unsigned int port;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen unsigned int proxy_timeout_msecs;
2793e3bd31d212d6506686aa70773e13d9d98195Timo Sirainen unsigned int proxy_refresh_secs;
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen enum login_proxy_ssl_flags ssl_flags;
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen unsigned int proxy:1;
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen unsigned int temp:1;
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen unsigned int nologin:1;
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen unsigned int authz_failure:1;
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen};
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainenstruct client_vfuncs {
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen struct client *(*alloc)(pool_t pool);
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen void (*create)(struct client *client, void **other_sets);
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen void (*destroy)(struct client *client);
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen void (*notify_auth_ready)(struct client *client);
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen void (*notify_disconnect)(struct client *client,
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen enum client_disconnect_reason reason,
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen const char *text);
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen void (*notify_status)(struct client *client,
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen bool bad, const char *text);
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen void (*notify_starttls)(struct client *client,
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen bool success, const char *text);
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen void (*starttls)(struct client *client);
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen void (*input)(struct client *client);
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen void (*auth_send_challenge)(struct client *client, const char *data);
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen void (*auth_parse_response)(struct client *client);
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen void (*auth_result)(struct client *client,
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen enum client_auth_result result,
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen const struct client_auth_reply *reply,
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen const char *text);
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen void (*proxy_reset)(struct client *client);
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen int (*proxy_parse_line)(struct client *client, const char *line);
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen void (*proxy_error)(struct client *client, const char *text);
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen};
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainenstruct client {
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen struct client *prev, *next;
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen pool_t pool;
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen struct client_vfuncs v;
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen time_t created;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen int refcount;
88dc563319efecd6e68bad16b0d92672da05584aTimo Sirainen
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen struct ip_addr local_ip;
0fd246126fece57712566c725d6353f255f5fcfaTimo Sirainen struct ip_addr ip;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen unsigned int local_port, remote_port;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen struct ssl_proxy *ssl_proxy;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen const struct login_settings *set;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen const struct master_service_ssl_settings *ssl_set;
d0ef8bc2b961a68dd0f75662c2160bd296b9476bTimo Sirainen const char *session_id;
f4616f1875297fb2f583d913c0f01b075bdecd5bTimo Sirainen
f4616f1875297fb2f583d913c0f01b075bdecd5bTimo Sirainen int fd;
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen struct istream *input;
f4616f1875297fb2f583d913c0f01b075bdecd5bTimo Sirainen struct ostream *output;
bc93929cdd9000ca560a5f42a27f50ab307f1efbTimo Sirainen struct io *io;
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen struct timeout *to_auth_waiting;
bc93929cdd9000ca560a5f42a27f50ab307f1efbTimo Sirainen struct timeout *to_disconnect;
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen unsigned char *master_data_prefix;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen unsigned int master_data_prefix_len;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen struct login_proxy *login_proxy;
bc93929cdd9000ca560a5f42a27f50ab307f1efbTimo Sirainen char *proxy_user, *proxy_master_user, *proxy_password;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen unsigned int proxy_state;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen unsigned int proxy_ttl;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen char *auth_mech_name;
d54ab8987e482a8df250615b44f41fa040c38741Timo Sirainen struct auth_client_request *auth_request;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen string_t *auth_response;
bc93929cdd9000ca560a5f42a27f50ab307f1efbTimo Sirainen time_t auth_first_started, auth_finished;
bc93929cdd9000ca560a5f42a27f50ab307f1efbTimo Sirainen const char *sasl_final_resp;
bc93929cdd9000ca560a5f42a27f50ab307f1efbTimo Sirainen
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen unsigned int master_auth_id;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen unsigned int master_tag;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen sasl_server_callback_t *sasl_callback;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen unsigned int bad_counter;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen unsigned int auth_attempts, auth_successes;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen pid_t mail_pid;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen char *virtual_user;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen unsigned int destroyed:1;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen unsigned int input_blocked:1;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen unsigned int login_success:1;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen unsigned int starttls:1;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen unsigned int tls:1;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen unsigned int secured:1;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen unsigned int trusted:1;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen unsigned int ssl_servername_settings_read:1;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen unsigned int authenticating:1;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen unsigned int auth_tried_disabled_plaintext:1;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen unsigned int auth_tried_unsupported_mech:1;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen unsigned int auth_try_aborted:1;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen unsigned int auth_initializing:1;
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen unsigned int auth_process_comm_fail:1;
88dc563319efecd6e68bad16b0d92672da05584aTimo Sirainen unsigned int proxy_auth_failed:1;
88dc563319efecd6e68bad16b0d92672da05584aTimo Sirainen unsigned int auth_waiting:1;
c4b376dd6e0c423006d7ac83a39253bcaf8e7c47Timo Sirainen unsigned int auth_user_disabled:1;
eef4ba0cc3e78f8c26804c1c9251a76580a41f0cTimo Sirainen unsigned int auth_pass_expired:1;
eef4ba0cc3e78f8c26804c1c9251a76580a41f0cTimo Sirainen unsigned int notified_auth_ready:1;
eef4ba0cc3e78f8c26804c1c9251a76580a41f0cTimo Sirainen unsigned int notified_disconnect:1;
88dc563319efecd6e68bad16b0d92672da05584aTimo Sirainen /* ... */
a0c453a8edaec90fb0d945c874de0b1845bc7d7eTimo Sirainen};
88dc563319efecd6e68bad16b0d92672da05584aTimo Sirainen
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainenextern struct client *clients;
88dc563319efecd6e68bad16b0d92672da05584aTimo Sirainen
88dc563319efecd6e68bad16b0d92672da05584aTimo Sirainenstruct client *
88dc563319efecd6e68bad16b0d92672da05584aTimo Sirainenclient_create(int fd, bool ssl, pool_t pool,
eef4ba0cc3e78f8c26804c1c9251a76580a41f0cTimo Sirainen const struct login_settings *set,
eef4ba0cc3e78f8c26804c1c9251a76580a41f0cTimo Sirainen const struct master_service_ssl_settings *ssl_set,
88dc563319efecd6e68bad16b0d92672da05584aTimo Sirainen void **other_sets,
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen const struct ip_addr *local_ip, const struct ip_addr *remote_ip);
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainenvoid client_destroy(struct client *client, const char *reason);
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainenvoid client_destroy_success(struct client *client, const char *reason);
88dc563319efecd6e68bad16b0d92672da05584aTimo Sirainenvoid client_destroy_internal_failure(struct client *client);
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainenvoid client_ref(struct client *client);
bc93929cdd9000ca560a5f42a27f50ab307f1efbTimo Sirainenbool client_unref(struct client **client) ATTR_NOWARN_UNUSED_RESULT;
88dc563319efecd6e68bad16b0d92672da05584aTimo Sirainen
a5e89374cb2fb2cad575fee6c3b33a9487ab9b3aTimo Sirainenvoid client_cmd_starttls(struct client *client);
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainenunsigned int clients_get_count(void) ATTR_PURE;
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainenvoid client_set_title(struct client *client);
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainenvoid client_log(struct client *client, const char *msg);
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainenvoid client_log_err(struct client *client, const char *msg);
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainenvoid client_log_warn(struct client *client, const char *msg);
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainenconst char *client_get_extra_disconnect_reason(struct client *client);
88dc563319efecd6e68bad16b0d92672da05584aTimo Sirainen
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainenvoid client_auth_respond(struct client *client, const char *response);
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainenvoid client_auth_abort(struct client *client);
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainenbool client_is_tls_enabled(struct client *client);
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainenvoid client_auth_fail(struct client *client, const char *text);
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainenconst char *client_get_session_id(struct client *client);
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen
a0c453a8edaec90fb0d945c874de0b1845bc7d7eTimo Sirainenbool client_read(struct client *client);
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainenvoid client_input(struct client *client);
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainenvoid client_notify_auth_ready(struct client *client);
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainenvoid client_notify_status(struct client *client, bool bad, const char *text);
2793e3bd31d212d6506686aa70773e13d9d98195Timo Sirainenvoid client_notify_disconnect(struct client *client,
2793e3bd31d212d6506686aa70773e13d9d98195Timo Sirainen enum client_disconnect_reason reason,
2793e3bd31d212d6506686aa70773e13d9d98195Timo Sirainen const char *text);
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen
88dc563319efecd6e68bad16b0d92672da05584aTimo Sirainenvoid client_send_raw_data(struct client *client, const void *data, size_t size);
88dc563319efecd6e68bad16b0d92672da05584aTimo Sirainenvoid client_send_raw(struct client *client, const char *data);
6d41944c73171cdb64b0a00bff368d212452e924Timo Sirainen
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainenvoid client_set_auth_waiting(struct client *client);
bc93929cdd9000ca560a5f42a27f50ab307f1efbTimo Sirainenvoid client_auth_send_challenge(struct client *client, const char *data);
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainenvoid client_auth_parse_response(struct client *client);
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainenint client_auth_begin(struct client *client, const char *mech_name,
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainen const char *init_resp);
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainenbool client_check_plaintext_auth(struct client *client, bool pass_sent);
1b0cfbf3cc77a670b92fff5c30f7b1eb17a63ab1Timo Sirainenint client_auth_read_line(struct client *client);
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen
64b61cd24d630223478ccbe1934b9f60f0881f59Timo Sirainenvoid client_proxy_finish_destroy_client(struct client *client);
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainenvoid client_proxy_log_failure(struct client *client, const char *line);
d54ab8987e482a8df250615b44f41fa040c38741Timo Sirainenvoid client_proxy_failed(struct client *client, bool send_line);
421d30619384e72a27e2a5d13ff6525aff4d17feTimo Sirainen
f210ec6b25f80d06419921e9231465bb114ee971Timo Sirainenvoid clients_notify_auth_connected(void);
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainenvoid client_destroy_oldest(void);
8d587838c414c48a331f0b54cd7ffd97e5024abdTimo Sirainenvoid clients_destroy_all(void);
6d41944c73171cdb64b0a00bff368d212452e924Timo Sirainenvoid clients_destroy_all_reason(const char *reason);
6d41944c73171cdb64b0a00bff368d212452e924Timo Sirainen
6d41944c73171cdb64b0a00bff368d212452e924Timo Sirainen#endif
6d41944c73171cdb64b0a00bff368d212452e924Timo Sirainen