client.h revision 64e244defe74f513ce94f33d000a048ddbe2ea23
02c335c23bf5fa225a467c19f2c063fb0dc7b8c3Timo Sirainen#ifndef __CLIENT_H
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen#define __CLIENT_H
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen#include "network.h"
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen#include "master.h"
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen#include "client-common.h"
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainenstruct pop3_client {
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen struct client common;
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen time_t created;
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen int refcount;
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen struct istream *input;
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen struct ostream *output;
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen time_t last_input;
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen unsigned int bad_counter;
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen char *last_user;
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen unsigned int tls:1;
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen unsigned int secured:1;
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen unsigned int input_blocked:1;
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen unsigned int destroyed:1;
2a325b952fe47346d76221d2c07a3fe02faf8800Timo Sirainen};
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainenvoid client_destroy(struct pop3_client *client, const char *reason);
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainenvoid client_send_line(struct pop3_client *client, const char *line);
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainenvoid client_syslog(struct pop3_client *client, const char *text);
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainenint client_read(struct pop3_client *client);
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainenvoid client_input(void *context);
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainenvoid client_ref(struct pop3_client *client);
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainenint client_unref(struct pop3_client *client);
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainenvoid clients_init(void);
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainenvoid clients_deinit(void);
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen#endif
169b1488b6eea7a968021afa4f929b2e26d75d98Timo Sirainen