X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fs_stats.c;h=7a600ce8f6e66d3636611936f3bb8753ed21900b;hb=refs%2Fheads%2Fupstream;hp=cf5d039cc480286492f4da8be49d32e7d280ede3;hpb=71cc7cba8ab3e34d60d4887eecaaf454aa84a321;p=ircu2.10.12-pk.git diff --git a/ircd/s_stats.c b/ircd/s_stats.c index cf5d039..7a600ce 100644 --- a/ircd/s_stats.c +++ b/ircd/s_stats.c @@ -43,6 +43,7 @@ #include "numnicks.h" #include "querycmds.h" #include "res.h" +#include "s_auth.h" #include "s_bsd.h" #include "s_conf.h" #include "s_debug.h" @@ -89,14 +90,13 @@ stats_configured_links(struct Client *sptr, const struct StatDesc* sd, struct ConfItem *tmp; unsigned short int port; int maximum; - char *host, *pass, *name, *username, *hub_limit; + char *host, *name, *username, *hub_limit; for (tmp = GlobalConfList; tmp; tmp = tmp->next) { if ((tmp->status & sd->sd_funcdata)) { host = BadPtr(tmp->host) ? null : tmp->host; - pass = BadPtr(tmp->passwd) ? null : tmp->passwd; name = BadPtr(tmp->name) ? null : tmp->name; username = BadPtr(tmp->username) ? null : tmp->username; hub_limit = BadPtr(tmp->hub_limit) ? null : tmp->hub_limit; @@ -109,16 +109,18 @@ stats_configured_links(struct Client *sptr, const struct StatDesc* sd, send_reply(sptr, RPL_STATSCLINE, name, port, maximum, hub_limit, get_conf_class(tmp)); else if (tmp->status & CONF_CLIENT) send_reply(sptr, RPL_STATSILINE, + (tmp->username ? tmp->username : ""), (tmp->username ? "@" : ""), (tmp->host ? tmp->host : "*"), maximum, (name[0] == ':' ? "0" : ""), (tmp->name ? tmp->name : "*"), port, get_conf_class(tmp)); else if (tmp->status & CONF_OPERATOR) - send_reply(sptr, RPL_STATSOLINE, - ((FlagHas(&tmp->privs_dirty, PRIV_PROPAGATE) - && FlagHas(&tmp->privs, PRIV_PROPAGATE)) - || (FlagHas(&tmp->conn_class->privs_dirty, PRIV_PROPAGATE) - && FlagHas(&tmp->conn_class->privs, PRIV_PROPAGATE))) - ? 'O' : 'o', username, host, name, get_conf_class(tmp)); + { + int global = FlagHas(&tmp->privs_dirty, PRIV_PROPAGATE) + ? FlagHas(&tmp->privs, PRIV_PROPAGATE) + : FlagHas(&tmp->conn_class->privs, PRIV_PROPAGATE); + send_reply(sptr, RPL_STATSOLINE, global ? 'O' : 'o', + username, host, name, get_conf_class(tmp)); + } } } } @@ -183,6 +185,7 @@ stats_access(struct Client *to, const struct StatDesc *sd, char *param) || (aconf->name && !match(param, aconf->name)))) { send_reply(to, RPL_STATSILINE, + (aconf->username ? aconf->username : ""), (aconf->username ? "@" : ""), (aconf->host ? aconf->host : "*"), aconf->maximum, (aconf->name && aconf->name[0] == ':' ? "0":""), aconf->name ? aconf->name : "*", @@ -455,9 +458,9 @@ stats_servers_verbose(struct Client* sptr, const struct StatDesc* sd, "%-20s %-20s Flags Hops Numeric Lag RTT Up Down " "Clients/Max Proto %-10s :Info", "Servername", "Uplink", "LinkTS"); - fmt = "%-20s %-20s %c%c%c%c %4i %s %-4i %5i %4i %4i %4i %5i %5i P%-2i %Tu :%s"; + fmt = "%-20s %-20s %c%c%c%c%c %4i %s %-4i %5i %4i %4i %4i %5i %5i P%-2i %Tu :%s"; } else { - fmt = "%s %s %c%c%c%c %i %s %i %i %i %i %i %i %i P%i %Tu :%s"; + fmt = "%s %s %c%c%c%c%c %i %s %i %i %i %i %i %i %i P%i %Tu :%s"; } for (acptr = GlobalClientList; acptr; acptr = cli_next(acptr)) @@ -474,6 +477,7 @@ stats_servers_verbose(struct Client* sptr, const struct StatDesc* sd, IsBurstAck(acptr) ? 'A' : '-', IsHub(acptr) ? 'H' : '-', IsService(acptr) ? 'S' : '-', + IsIPv6(acptr) ? '6' : '-', cli_hopcount(acptr), NumServ(acptr), base64toint(cli_yxx(acptr)), @@ -489,7 +493,6 @@ stats_servers_verbose(struct Client* sptr, const struct StatDesc* sd, } } -#ifdef DEBUGMODE /** Display objects allocated (and total memory used by them) for * several types of structures. * @param[in] to Client requesting statistics. @@ -499,10 +502,12 @@ stats_servers_verbose(struct Client* sptr, const struct StatDesc* sd, static void stats_meminfo(struct Client* to, const struct StatDesc* sd, char* param) { + extern void bans_send_meminfo(struct Client *cptr); + class_send_meminfo(to); + bans_send_meminfo(to); send_listinfo(to, 0); } -#endif /** Send a list of available statistics. * @param[in] to Client requesting statistics. @@ -524,7 +529,7 @@ stats_help(struct Client* to, const struct StatDesc* sd, char* param) /** Contains information about all statistics. */ struct StatDesc statsinfo[] = { - { 'a', "nameservers", STAT_FLAG_OPERFEAT, FEAT_HIS_STATS_a, + { 'a', "nameservers", STAT_FLAG_OPERFEAT|STAT_FLAG_LOCONLY, FEAT_HIS_STATS_a, report_dns_servers, 0, "DNS servers." }, { 'c', "connect", STAT_FLAG_OPERFEAT, FEAT_HIS_STATS_c, @@ -539,9 +544,12 @@ struct StatDesc statsinfo[] = { { 'e', "engine", STAT_FLAG_OPERFEAT, FEAT_HIS_STATS_e, stats_engine, 0, "Report server event loop engine." }, - { 'f', "features", STAT_FLAG_OPERFEAT, FEAT_HIS_STATS_f, + { 'f', "features", (STAT_FLAG_OPERFEAT | STAT_FLAG_CASESENS), FEAT_HIS_STATS_f, feature_report, 0, "Feature settings." }, + { 'F', "featuresall", (STAT_FLAG_OPERFEAT | STAT_FLAG_CASESENS), FEAT_HIS_STATS_f, + feature_report, 1, + "All feature settings, including defaulted values." }, { 'g', "glines", STAT_FLAG_OPERFEAT, FEAT_HIS_STATS_g, gline_stats, 0, "Global bans (G-lines)." }, @@ -606,17 +614,21 @@ struct StatDesc statsinfo[] = { { 'w', "userload", STAT_FLAG_OPERFEAT, FEAT_HIS_STATS_w, calc_load, 0, "Userload statistics." }, -#ifdef DEBUGMODE { 'x', "memusage", STAT_FLAG_OPERFEAT, FEAT_HIS_STATS_x, stats_meminfo, 0, - "List usage information (Debug only)." }, -#endif + "List usage information." }, { 'y', "classes", STAT_FLAG_OPERFEAT, FEAT_HIS_STATS_y, report_classes, 0, "Connection classes." }, { 'z', "memory", STAT_FLAG_OPERFEAT, FEAT_HIS_STATS_z, count_memory, 0, "Memory/Structure allocation information." }, + { ' ', "iauth", STAT_FLAG_OPERFEAT, FEAT_HIS_STATS_IAUTH, + report_iauth_stats, 0, + "IAuth statistics." }, + { ' ', "iauthconf", STAT_FLAG_OPERFEAT, FEAT_HIS_STATS_IAUTH, + report_iauth_conf, 0, + "IAuth configuration." }, { '*', "help", STAT_FLAG_CASESENS, FEAT_LAST_F, stats_help, 0, "Send help for stats." },