Author: Bleep <tomh@inxpress.net>
[ircu2.10.12-pk.git] / include / s_misc.h
1 /*
2  * s_misc.h
3  *
4  * $Id$
5  */
6 #ifndef INCLUDED_s_misc_h
7 #define INCLUDED_s_misc_h
8 #ifndef INCLUDED_stdarg_h
9 #include <stdarg.h>           /* va_list */
10 #define INCLUDED_stdarg_h
11 #endif
12 #ifndef INCLUDED_sys_types_h
13 #include <sys/types.h>        /* time_t */
14 #define INCLUDED_sys_types_h
15 #endif
16
17
18 struct Client;
19 struct ConfItem;
20
21 /*-----------------------------------------------------------------------------
22  * Macros
23  */
24
25 #define CPTR_KILLED     -2
26
27 /*
28  * Structures
29  */
30
31 struct ServerStatistics {
32   unsigned int is_cl;           /* number of client connections */
33   unsigned int is_sv;           /* number of server connections */
34   unsigned int is_ni;           /* connection but no idea who it was */
35   unsigned short int is_cbs;    /* bytes sent to clients */
36   unsigned short int is_cbr;    /* bytes received to clients */
37   unsigned short int is_sbs;    /* bytes sent to servers */
38   unsigned short int is_sbr;    /* bytes received to servers */
39   unsigned int is_cks;          /* k-bytes sent to clients */
40   unsigned int is_ckr;          /* k-bytes received to clients */
41   unsigned int is_sks;          /* k-bytes sent to servers */
42   unsigned int is_skr;          /* k-bytes received to servers */
43   time_t is_cti;                /* time spent connected by clients */
44   time_t is_sti;                /* time spent connected by servers */
45   unsigned int is_ac;           /* connections accepted */
46   unsigned int is_ref;          /* accepts refused */
47   unsigned int is_unco;         /* unknown commands */
48   unsigned int is_wrdi;         /* command going in wrong direction */
49   unsigned int is_unpf;         /* unknown prefix */
50   unsigned int is_empt;         /* empty message */
51   unsigned int is_num;          /* numeric message */
52   unsigned int is_kill;         /* number of kills generated on collisions */
53   unsigned int is_fake;         /* MODE 'fakes' */
54   unsigned int is_asuc;         /* successful auth requests */
55   unsigned int is_abad;         /* bad auth requests */
56   unsigned int is_loc;          /* local connections made */
57   unsigned int uping_recv;      /* UDP Pings received */
58 };
59
60 /*
61  * Prototypes
62  */
63
64 extern int check_registered(struct Client *sptr);
65 extern int check_registered_user(struct Client *sptr);
66 extern int exit_client(struct Client *cptr, struct Client *bcptr,
67     struct Client *sptr, char *comment);
68 extern char *myctime(time_t value);
69 extern int exit_client_msg(struct Client *cptr, struct Client *bcptr,
70                            struct Client *sptr, char *pattern, ...);
71 extern void initstats(void);
72 extern char *date(time_t clock);
73 extern const char* get_client_host(const struct Client *cptr);
74 extern void get_sockhost(struct Client *cptr, char *host);
75 extern int vexit_client_msg(struct Client *cptr, struct Client *bcptr,
76     struct Client *sptr, char *pattern, va_list vl);
77 extern void tstats(struct Client *cptr, char *name);
78
79 extern struct ServerStatistics* ServerStats;
80
81 #endif /* INCLUDED_s_misc_h */
82