2 * @brief Miscellaneous support functions and declarations.
5 #ifndef INCLUDED_s_misc_h
6 #define INCLUDED_s_misc_h
7 #ifndef INCLUDED_stdarg_h
8 #include <stdarg.h> /* va_list */
9 #define INCLUDED_stdarg_h
11 #ifndef INCLUDED_sys_types_h
12 #include <sys/types.h> /* time_t */
13 #define INCLUDED_sys_types_h
21 /*-----------------------------------------------------------------------------
25 /** Return value from various functions to indicate the source has
26 * been disconnected. */
27 #define CPTR_KILLED -2
33 /** Structure used to count many server-wide statistics. */
34 struct ServerStatistics {
35 unsigned int is_cl; /**< number of client connections */
36 unsigned int is_sv; /**< number of server connections */
37 unsigned int is_ni; /**< connection but no idea who it was */
38 unsigned short int is_cbs; /**< bytes sent to clients */
39 unsigned short int is_cbr; /**< bytes received to clients */
40 unsigned short int is_sbs; /**< bytes sent to servers */
41 unsigned short int is_sbr; /**< bytes received to servers */
42 unsigned int is_cks; /**< k-bytes sent to clients */
43 unsigned int is_ckr; /**< k-bytes received to clients */
44 unsigned int is_sks; /**< k-bytes sent to servers */
45 unsigned int is_skr; /**< k-bytes received to servers */
46 time_t is_cti; /**< time spent connected by clients */
47 time_t is_sti; /**< time spent connected by servers */
48 unsigned int is_ac; /**< connections accepted */
49 unsigned int is_ref; /**< accepts refused */
50 unsigned int is_unco; /**< unknown commands */
51 unsigned int is_wrdi; /**< command going in wrong direction */
52 unsigned int is_unpf; /**< unknown prefix */
53 unsigned int is_empt; /**< empty message */
54 unsigned int is_num; /**< numeric message */
55 unsigned int is_kill; /**< number of kills generated on collisions */
56 unsigned int is_fake; /**< MODE 'fakes' */
57 unsigned int is_asuc; /**< successful auth requests */
58 unsigned int is_abad; /**< bad auth requests */
59 unsigned int is_loc; /**< local connections made */
60 unsigned int uping_recv; /**< UDP Pings received */
67 extern int check_registered(struct Client *sptr);
68 extern int check_registered_user(struct Client *sptr);
69 extern int exit_client(struct Client *cptr, struct Client *bcptr,
70 struct Client *sptr, const char *comment);
71 extern char *myctime(time_t value);
72 extern int exit_client_msg(struct Client *cptr, struct Client *bcptr,
73 struct Client *sptr, const char *pattern, ...);
74 extern void initstats(void);
75 extern char *date(time_t clock);
76 extern void get_sockhost(struct Client *cptr, char *host);
77 extern int vexit_client_msg(struct Client *cptr, struct Client *bcptr,
78 struct Client *sptr, const char *pattern, va_list vl);
79 extern void tstats(struct Client *cptr, const struct StatDesc *sd,
82 extern struct ServerStatistics* ServerStats;
84 #endif /* INCLUDED_s_misc_h */