Allow /stats to accept long names for the displayed statistics.
[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 StatDesc;
20 struct ConfItem;
21
22 /*-----------------------------------------------------------------------------
23  * Macros
24  */
25
26 #define CPTR_KILLED     -2
27
28 /*
29  * Structures
30  */
31
32 struct ServerStatistics {
33   unsigned int is_cl;           /* number of client connections */
34   unsigned int is_sv;           /* number of server connections */
35   unsigned int is_ni;           /* connection but no idea who it was */
36   unsigned short int is_cbs;    /* bytes sent to clients */
37   unsigned short int is_cbr;    /* bytes received to clients */
38   unsigned short int is_sbs;    /* bytes sent to servers */
39   unsigned short int is_sbr;    /* bytes received to servers */
40   unsigned int is_cks;          /* k-bytes sent to clients */
41   unsigned int is_ckr;          /* k-bytes received to clients */
42   unsigned int is_sks;          /* k-bytes sent to servers */
43   unsigned int is_skr;          /* k-bytes received to servers */
44   time_t is_cti;                /* time spent connected by clients */
45   time_t is_sti;                /* time spent connected by servers */
46   unsigned int is_ac;           /* connections accepted */
47   unsigned int is_ref;          /* accepts refused */
48   unsigned int is_unco;         /* unknown commands */
49   unsigned int is_wrdi;         /* command going in wrong direction */
50   unsigned int is_unpf;         /* unknown prefix */
51   unsigned int is_empt;         /* empty message */
52   unsigned int is_num;          /* numeric message */
53   unsigned int is_kill;         /* number of kills generated on collisions */
54   unsigned int is_fake;         /* MODE 'fakes' */
55   unsigned int is_asuc;         /* successful auth requests */
56   unsigned int is_abad;         /* bad auth requests */
57   unsigned int is_loc;          /* local connections made */
58   unsigned int uping_recv;      /* UDP Pings received */
59 };
60
61 /*
62  * Prototypes
63  */
64
65 extern int check_registered(struct Client *sptr);
66 extern int check_registered_user(struct Client *sptr);
67 extern int exit_client(struct Client *cptr, struct Client *bcptr,
68     struct Client *sptr, const char *comment);
69 extern char *myctime(time_t value);
70 extern int exit_client_msg(struct Client *cptr, struct Client *bcptr,
71                            struct Client *sptr, const char *pattern, ...);
72 extern void initstats(void);
73 extern char *date(time_t clock);
74 extern const char* get_client_host(const struct Client *cptr);
75 extern void get_sockhost(struct Client *cptr, char *host);
76 extern int vexit_client_msg(struct Client *cptr, struct Client *bcptr,
77     struct Client *sptr, const char *pattern, va_list vl);
78 extern void tstats(struct Client *cptr, const struct StatDesc *sd,
79                    char *param);
80
81 extern struct ServerStatistics* ServerStats;
82
83 #endif /* INCLUDED_s_misc_h */
84