1 Add header to /STATS output and make TOTAL: line in /STATS z more clear,
2 so that we do not need to guess or lookup what exactly some of the output means.
4 diff -r d93ebdf15bd2 include/numeric.h
5 --- a/include/numeric.h Wed Feb 11 13:52:40 2009 +0100
6 +++ b/include/numeric.h Wed Feb 11 14:27:58 2009 +0100
8 RPL_STATSVLINE 227 unreal */
9 #define RPL_STATSALINE 226 /* Hybrid, Undernet */
10 #define RPL_STATSQLINE 228 /* Undernet extension */
11 +#define RPL_STATSHEADER 230 /* QuakeNet extension */
13 /* RPL_SERVICEINFO 231 unused */
14 /* RPL_ENDOFSERVICES 232 unused */
15 diff -r d93ebdf15bd2 ircd/class.c
16 --- a/ircd/class.c Wed Feb 11 13:52:40 2009 +0100
17 +++ b/ircd/class.c Wed Feb 11 14:27:58 2009 +0100
20 struct ConnectionClass *cltmp;
22 + /* send header so the client knows what we are showing */
23 + send_reply(sptr, SND_EXPLICIT | RPL_STATSHEADER,
24 + "Y ConnClass PingFreq ConnFreq MaxLinks MaxSendQ Links");
26 for (cltmp = connClassList; cltmp; cltmp = cltmp->next)
27 send_reply(sptr, RPL_STATSYLINE, (cltmp->valid ? 'Y' : 'y'),
28 ConClass(cltmp), PingFreq(cltmp), ConFreq(cltmp),
29 diff -r d93ebdf15bd2 ircd/gline.c
30 --- a/ircd/gline.c Wed Feb 11 13:52:40 2009 +0100
31 +++ b/ircd/gline.c Wed Feb 11 14:27:58 2009 +0100
32 @@ -1295,6 +1295,10 @@
36 + /* send header so the client knows what we are showing */
37 + send_reply(sptr, SND_EXPLICIT | RPL_STATSHEADER,
38 + "G Mask Expire Lastmod Lifetime Status :Reason");
40 gliter(GlobalGlineList, gline, sgline) {
41 send_reply(sptr, RPL_STATSGLINE, 'G',
42 gline->gl_nick ? gline->gl_nick : "",
43 diff -r d93ebdf15bd2 ircd/hash.c
44 --- a/ircd/hash.c Wed Feb 11 13:52:40 2009 +0100
45 +++ b/ircd/hash.c Wed Feb 11 14:27:58 2009 +0100
47 stats_nickjupes(struct Client* to, const struct StatDesc* sd, char* param)
51 + /* send header so the client knows what we are showing */
52 + send_reply(to, SND_EXPLICIT | RPL_STATSHEADER, "J Nick");
54 for (i = 0; i < JUPEHASHSIZE; i++)
56 send_reply(to, RPL_STATSJLINE, jupeTable[i]);
57 diff -r d93ebdf15bd2 ircd/ircd_features.c
58 --- a/ircd/ircd_features.c Wed Feb 11 13:52:40 2009 +0100
59 +++ b/ircd/ircd_features.c Wed Feb 11 14:27:58 2009 +0100
64 + /* send header so the client knows what we are showing */
65 + send_reply(to, SND_EXPLICIT | RPL_STATSHEADER,
66 + "F Feature/Log Value");
68 for (i = 0; features[i].type; i++) {
69 if ((features[i].flags & FEAT_NODISP) ||
70 (features[i].flags & FEAT_MYOPER && !MyOper(to)) ||
71 diff -r d93ebdf15bd2 ircd/ircd_res.c
72 --- a/ircd/ircd_res.c Wed Feb 11 13:52:40 2009 +0100
73 +++ b/ircd/ircd_res.c Wed Feb 11 14:27:58 2009 +0100
78 + /* send header so the client knows what we are showing */
79 + send_reply(source_p, SND_EXPLICIT | RPL_STATSHEADER,
82 for (i = 0; i < irc_nscount; i++)
84 ircd_ntoa_r(ipaddr, &irc_nsaddr_list[i].addr);
85 diff -r d93ebdf15bd2 ircd/listener.c
86 --- a/ircd/listener.c Wed Feb 11 13:52:40 2009 +0100
87 +++ b/ircd/listener.c Wed Feb 11 14:27:58 2009 +0100
92 + /* send header so the client knows what we are showing */
93 + send_reply(sptr, SND_EXPLICIT | RPL_STATSHEADER,
94 + "P Port Conns Flags Status");
99 diff -r d93ebdf15bd2 ircd/motd.c
100 --- a/ircd/motd.c Wed Feb 11 13:52:40 2009 +0100
101 +++ b/ircd/motd.c Wed Feb 11 14:27:58 2009 +0100
106 + /* send header so the client knows what we are showing */
107 + send_reply(to, SND_EXPLICIT | RPL_STATSHEADER,
108 + "T Hostmask/Class File");
110 for (ptr = MotdList.other; ptr; ptr = ptr->next)
111 send_reply(to, SND_EXPLICIT | RPL_STATSTLINE, "T %s %s",
112 ptr->hostmask, ptr->path);
113 diff -r d93ebdf15bd2 ircd/s_auth.c
114 --- a/ircd/s_auth.c Wed Feb 11 13:52:40 2009 +0100
115 +++ b/ircd/s_auth.c Wed Feb 11 14:27:58 2009 +0100
116 @@ -2189,6 +2189,10 @@
120 + /* send header so the client knows what we are showing */
121 + send_reply(cptr, SND_EXPLICIT | RPL_STATSHEADER,
122 + "IAUTHCONF config");
124 if (iauth) for (link = iauth->i_config; link; link = link->next)
126 send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":%s",
127 @@ -2205,6 +2209,10 @@
131 + /* send header so the client knows what we are showing */
132 + send_reply(cptr, SND_EXPLICIT | RPL_STATSHEADER,
135 if (iauth) for (link = iauth->i_stats; link; link = link->next)
137 send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":%s",
138 diff -r d93ebdf15bd2 ircd/s_debug.c
139 --- a/ircd/s_debug.c Wed Feb 11 13:52:40 2009 +0100
140 +++ b/ircd/s_debug.c Wed Feb 11 14:27:58 2009 +0100
144 send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG,
145 - ":Total: ww %zu ch %zu cl %zu co %zu db %zu ms %zu mb %zu",
146 + ":Total: Whowas %zu Channels %zu Clients %zu Config %zu DBufs %zu Msgs %zu MsgBufs %zu",
147 totww, totch, totcl, com, dbufs_allocated, msg_allocated,
150 diff -r d93ebdf15bd2 ircd/s_err.c
151 --- a/ircd/s_err.c Wed Feb 11 13:52:40 2009 +0100
152 +++ b/ircd/s_err.c Wed Feb 11 14:27:58 2009 +0100
158 + { RPL_STATSHEADER, 0, "230" },
162 diff -r d93ebdf15bd2 ircd/s_stats.c
163 --- a/ircd/s_stats.c Wed Feb 11 13:52:40 2009 +0100
164 +++ b/ircd/s_stats.c Wed Feb 11 14:27:58 2009 +0100
167 char *host, *pass, *name, *username, *hub_limit;
169 + /* send header so the client knows what we are showing */
170 + if (sd->sd_funcdata == CONF_UWORLD)
171 + send_reply(sptr, SND_EXPLICIT | RPL_STATSHEADER, "U Server");
172 + else if (sd->sd_funcdata == CONF_SERVER)
173 + send_reply(sptr, SND_EXPLICIT | RPL_STATSHEADER,
174 + "C Server * Port Hoplimit Hubmask Class");
175 + else if (sd->sd_funcdata == CONF_OPERATOR)
176 + send_reply(sptr, SND_EXPLICIT | RPL_STATSHEADER,
177 + "O Mask * Name Class");
179 for (tmp = GlobalConfList; tmp; tmp = tmp->next)
181 if ((tmp->status & sd->sd_funcdata))
184 const struct CRuleConf* p = conf_get_crule_list();
186 + /* send header so the client knows what we are showing */
187 + send_reply(to, SND_EXPLICIT | RPL_STATSHEADER,
190 for ( ; p; p = p->next)
192 if (p->type & sd->sd_funcdata)
197 + /* send header so the client knows what we are showing */
198 + send_reply(to, SND_EXPLICIT | RPL_STATSHEADER,
199 + "I Hostmask Maximum IPmask Port Class");
203 stats_configured_links(to, sd, param);
205 report_deny_list(struct Client* to)
207 const struct DenyConf* p = conf_get_deny_list();
209 + /* send header so the client knows what we are showing */
210 + send_reply(to, SND_EXPLICIT | RPL_STATSHEADER,
211 + "K Mask \"Message/File\" \"Realname\" 0 0");
213 for ( ; p; p = p->next)
214 send_reply(to, RPL_STATSKLINE, p->bits > 0 ? 'k' : 'K',
215 p->usermask ? p->usermask : "*",
220 + /* send header so the client knows what we are showing */
221 + send_reply(sptr, SND_EXPLICIT | RPL_STATSHEADER,
222 + "K Mask \"Message/File\" \"Realname\" 0 0");
224 for (conf = conf_get_deny_list(); conf; conf = conf->next)
226 /* Skip this block if the user is searching for a user-matching
229 struct Message *mptr;
231 + /* send header so the client knows what we are showing */
232 + send_reply(to, SND_EXPLICIT | RPL_STATSHEADER,
233 + "Command Count Bytes");
235 for (mptr = msgtab; mptr->cmd; mptr++)
237 send_reply(to, RPL_STATSCOMMANDS, mptr->cmd, mptr->count, mptr->bytes);
242 + /* send header so the client knows what we are showing */
243 + send_reply(to, SND_EXPLICIT | RPL_STATSHEADER,
244 + "Q Channel :Reason");
246 for (qline = GlobalQuarantineList; qline; qline = qline->next)
248 if (param && match(param, qline->chname)) /* narrow search */
254 + /* TODO: use RPL_STATSHEADER here too instead of RPL_TEXT? */
256 send_reply(to, SND_EXPLICIT | RPL_TEXT, "# Type Spoofhost Realhost Ident");