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