0
|
1 #ifndef __CLIENT_H
|
|
2 #define __CLIENT_H
|
|
3
|
|
4 #include "network.h"
|
|
5
|
|
6 struct _Client {
|
|
7 time_t created;
|
|
8 int refcount;
|
|
9 IPADDR ip;
|
|
10
|
|
11 int fd;
|
|
12 IO io;
|
|
13 IOBuffer *inbuf, *outbuf;
|
|
14
|
|
15 time_t last_input;
|
|
16 char *tag;
|
|
17
|
|
18 char *plain_login;
|
|
19 unsigned int plain_login_len;
|
|
20
|
|
21 AuthRequest *auth_request;
|
|
22
|
|
23 unsigned int tls:1;
|
|
24 };
|
|
25
|
|
26 Client *client_create(int fd, IPADDR *ip);
|
|
27 void client_destroy(Client *client, const char *reason);
|
|
28
|
|
29 void client_ref(Client *client);
|
|
30 int client_unref(Client *client);
|
|
31
|
|
32 void client_send_line(Client *client, const char *line);
|
|
33 void client_send_tagline(Client *client, const char *line);
|
|
34 void client_syslog(Client *client, const char *text);
|
|
35
|
|
36 int client_read(Client *client);
|
|
37 void client_input(void *user_data, int fd, IO io);
|
|
38
|
|
39 void clients_init(void);
|
|
40 void clients_deinit(void);
|
|
41
|
|
42 #endif
|