]> jfr.im git - irc/quakenet/snircd-patchqueue.git/blob - statsheader.patch
some more patches: split functionality, make stats output clearer, start to add ...
[irc/quakenet/snircd-patchqueue.git] / statsheader.patch
1 add header to /STATS output and make TOTAL: line in /STATS z more clear.
2
3 diff -r 92f6cb6562e2 include/numeric.h
4 --- a/include/numeric.h Tue Jan 13 22:17:04 2009 +0000
5 +++ b/include/numeric.h Sun Jan 18 17:44:05 2009 +0100
6 @@ -117,6 +117,7 @@
7 RPL_STATSVLINE 227 unreal */
8 #define RPL_STATSALINE 226 /* Hybrid, Undernet */
9 #define RPL_STATSQLINE 228 /* Undernet extension */
10 +#define RPL_STATSHEADER 230 /* QuakeNet extension */
11
12 /* RPL_SERVICEINFO 231 unused */
13 /* RPL_ENDOFSERVICES 232 unused */
14 diff -r 92f6cb6562e2 ircd/ircd_res.c
15 --- a/ircd/ircd_res.c Tue Jan 13 22:17:04 2009 +0000
16 +++ b/ircd/ircd_res.c Sun Jan 18 17:44:05 2009 +0100
17 @@ -917,6 +917,10 @@
18 int i;
19 char ipaddr[128];
20
21 + /* send header so the client knows what we are showing */
22 + send_reply(source_p, SND_EXPLICIT | RPL_STATSHEADER,
23 + "A DNS-server");
24 +
25 for (i = 0; i < irc_nscount; i++)
26 {
27 ircd_ntoa_r(ipaddr, &irc_nsaddr_list[i].addr);
28 diff -r 92f6cb6562e2 ircd/s_debug.c
29 --- a/ircd/s_debug.c Tue Jan 13 22:17:04 2009 +0000
30 +++ b/ircd/s_debug.c Sun Jan 18 17:44:05 2009 +0100
31 @@ -389,7 +389,7 @@
32 #endif
33
34 send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG,
35 - ":Total: ww %zu ch %zu cl %zu co %zu db %zu ms %zu mb %zu",
36 + ":Total: Whowas %zu Channels %zu Clients %zu Config %zu DBufs %zu Msgs %zu MsgBufs %zu",
37 totww, totch, totcl, com, dbufs_allocated, msg_allocated,
38 msgbuf_allocated);
39 }
40 diff -r 92f6cb6562e2 ircd/s_err.c
41 --- a/ircd/s_err.c Tue Jan 13 22:17:04 2009 +0000
42 +++ b/ircd/s_err.c Sun Jan 18 17:44:05 2009 +0100
43 @@ -492,7 +492,7 @@
44 /* 229 */
45 { 0 },
46 /* 230 */
47 - { 0 },
48 + { RPL_STATSHEADER, 0, "230" },
49 /* 231 */
50 { 0 },
51 /* 232 */
52 diff -r 92f6cb6562e2 ircd/s_stats.c
53 --- a/ircd/s_stats.c Tue Jan 13 22:17:04 2009 +0000
54 +++ b/ircd/s_stats.c Sun Jan 18 17:44:05 2009 +0100
55 @@ -92,6 +92,16 @@
56 int maximum;
57 char *host, *pass, *name, *username, *hub_limit;
58
59 + /* send header so the client knows what we are showing */
60 + if (sd->sd_funcdata == CONF_UWORLD)
61 + send_reply(sptr, SND_EXPLICIT | RPL_STATSHEADER, "U server");
62 + else if (sd->sd_funcdata == CONF_SERVER)
63 + send_reply(sptr, SND_EXPLICIT | RPL_STATSHEADER,
64 + "C server * port hoplimit hubmask class");
65 + else if (sd->sd_funcdata == CONF_OPERATOR)
66 + send_reply(sptr, SND_EXPLICIT | RPL_STATSHEADER,
67 + "O user@host * name class");
68 +
69 for (tmp = GlobalConfList; tmp; tmp = tmp->next)
70 {
71 if ((tmp->status & sd->sd_funcdata))
72 @@ -137,6 +147,10 @@
73 {
74 const struct CRuleConf* p = conf_get_crule_list();
75
76 + /* send header so the client knows what we are showing */
77 + send_reply(to, SND_EXPLICIT | RPL_STATSHEADER,
78 + "%c server rule", p->type & CRULE_ALL ? 'D' : 'd');
79 +
80 for ( ; p; p = p->next)
81 {
82 if (p->type & sd->sd_funcdata)
83 @@ -167,6 +181,10 @@
84 int wilds = 0;
85 int count = 1000;
86
87 + /* send header so the client knows what we are showing */
88 + send_reply(to, SND_EXPLICIT | RPL_STATSHEADER,
89 + "I [user@]hostmask maximum IPmask port class");
90 +
91 if (!param)
92 {
93 stats_configured_links(to, sd, param);
94 @@ -204,6 +222,11 @@
95 report_deny_list(struct Client* to)
96 {
97 const struct DenyConf* p = conf_get_deny_list();
98 +
99 + /* send header so the client knows what we are showing */
100 + send_reply(to, SND_EXPLICIT | RPL_STATSHEADER,
101 + "K user@host \"message or path/file\" \"realname\" 0 0");
102 +
103 for ( ; p; p = p->next)
104 send_reply(to, RPL_STATSKLINE, p->bits > 0 ? 'k' : 'K',
105 p->usermask ? p->usermask : "*",
106 @@ -251,6 +274,10 @@
107 }
108 else
109 host = mask;
110 +
111 + /* send header so the client knows what we are showing */
112 + send_reply(sptr, SND_EXPLICIT | RPL_STATSHEADER,
113 + "K user@host \"message or path/file\" \"realname\" 0 0");
114
115 for (conf = conf_get_deny_list(); conf; conf = conf->next)
116 {
117 @@ -377,6 +404,10 @@
118 {
119 struct Message *mptr;
120
121 + /* send header so the client knows what we are showing */
122 + send_reply(to, SND_EXPLICIT | RPL_STATSHEADER,
123 + "m command count bytes");
124 +
125 for (mptr = msgtab; mptr->cmd; mptr++)
126 if (mptr->count)
127 send_reply(to, RPL_STATSCOMMANDS, mptr->cmd, mptr->count, mptr->bytes);
128 @@ -391,6 +422,10 @@
129 stats_quarantine(struct Client* to, const struct StatDesc* sd, char* param)
130 {
131 struct qline *qline;
132 +
133 + /* send header so the client knows what we are showing */
134 + send_reply(to, SND_EXPLICIT | RPL_STATSHEADER,
135 + "Q channel reason");
136
137 for (qline = GlobalQuarantineList; qline; qline = qline->next)
138 {