-
Notifications
You must be signed in to change notification settings - Fork 3
/
client_db.h
45 lines (40 loc) · 1.71 KB
/
client_db.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* LOKI
*
* client_db header file
*
* 1996/7 Guild Corporation Productions [daemon9]
*/
/*
* Client info list.
* MAX_CLIENT of these will be kept in a server-side array
*/
struct client_list
{
#ifdef STRONG_CRYPTO
u_char key[BF_KEYSIZE]; /* unset bf key */
u_short ivec_salt; /* the IV salter */
#endif
u_short client_id; /* client loki_id */
u_long client_ip; /* client IP address */
time_t touchtime; /* last time entry was hit */
u_long packets_sent; /* Packets sent to this client */
u_long bytes_sent; /* Bytes sent to this client */
u_int hits; /* Number of queries from client */
#ifdef PTY
int pty_fd; /* Master PTY file descriptor */
#endif
};
#define IS_GOOD_CLIENT(ldg)\
\
(c_id == client[i].client_id && \
ldg.iph.ip_src == client[i].client_ip) > \
(0) ? (1) : (0) \
void update_client(int, int, u_long); /* Update a client entry */
/* client info into supplied buffer */
int stat_client(int, u_char *, int, time_t);
int add_client(u_char *); /* add a client entry */
int locate_client(int); /* find a client entry */
void age_client(void); /* age a client from the list */
u_short update_client_salt(int); /* update and return salt */
u_long check_client_ip(int, u_short *); /* return ip and id of target */