client-common.h revision fe791e96fdf796f7d8997ee0515b163dc5eddd72
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen#include "master-login.h" /* for LOGIN_MAX_SESSION_ID_LEN */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen/* max. size of input buffer. this means:
04c3ac276103b56185119bcff9a66de7a8bb0e68Timo Sirainen IMAP: Max. length of command's all parameters. SASL-IR is read into
04c3ac276103b56185119bcff9a66de7a8bb0e68Timo Sirainen a separate larger buffer.
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen POP3: Max. length of a command line (spec says 512 would be enough)
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen (MASTER_AUTH_MAX_DATA_SIZE - LOGIN_MAX_MASTER_PREFIX_LEN - \
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen/* max. size of output buffer. if it gets full, the client is disconnected.
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen SASL authentication gives the largest output. */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen/* Max. length of SASL authentication buffer. */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen/* Disconnect client after this many milliseconds if it hasn't managed
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen to log in yet. */
c18ff860dc22960fd37c272d929f889c7939a2c8Timo Sirainen#define CLIENT_LOGIN_TIMEOUT_MSECS (MASTER_LOGIN_TIMEOUT_SECS*1000)
04c3ac276103b56185119bcff9a66de7a8bb0e68Timo Sirainen "Waiting for authentication process to respond.."
5fb3f13537dffd15a31e997da133a721c0728af8Timo Sirainen "Waiting for authentication master process to respond.."
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen /* for proxying */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen /* all the key=value fields returned by passdb */
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen const char *const *all_fields;
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen void (*create)(struct client *client, void **other_sets);
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen void (*notify_auth_ready)(struct client *client);
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen void (*notify_disconnect)(struct client *client,
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen const char *text);
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen void (*notify_starttls)(struct client *client,
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen void (*auth_send_challenge)(struct client *client, const char *data);
9f19a50d5966643c4d1c5ca06868ac2ad31bc4d5Timo Sirainen void (*auth_parse_response)(struct client *client);
1ac7c8e9040e0d0b7e9f849e45b94bfe919595a9Timo Sirainen const char *text);
5fb3f13537dffd15a31e997da133a721c0728af8Timo Sirainen int (*proxy_parse_line)(struct client *client, const char *line);
5fb3f13537dffd15a31e997da133a721c0728af8Timo Sirainen void (*proxy_error)(struct client *client, const char *text);
struct client_vfuncs v;
int refcount;
const char *local_name;
int fd;
unsigned char *master_data_prefix;
unsigned int master_data_prefix_len;
unsigned int proxy_state;
unsigned int proxy_ttl;
char *auth_mech_name;
const char *sasl_final_resp;
const char *const *auth_passdb_args;
unsigned int master_auth_id;
unsigned int master_tag;
unsigned int bad_counter;
const char **alt_usernames;
union login_client_module_context {
struct client *
void **other_sets);
const char *text);
const char *init_resp);
void clients_notify_auth_connected(void);
void client_destroy_oldest(void);
void clients_destroy_all(void);