Author: Perry Lorier <isomer@undernet.org>
[ircu2.10.12-pk.git] / ircd / s_stats.c
index 84b804bfef37d85d4732799a30b13a885c8ef008..9fdb35d65b1059a53e23b7f9258c30869363f955 100644 (file)
@@ -87,7 +87,7 @@ stats_configured_links(struct Client *sptr, const struct StatDesc* sd,
   struct ConfItem *tmp;
   unsigned short int port;
   int maximum;
-  char *host, *pass, *name, *hub_limit;
+  char *host, *pass, *name, *username, *hub_limit;
 
   for (tmp = GlobalConfList; tmp; tmp = tmp->next)
   {
@@ -96,17 +96,22 @@ stats_configured_links(struct Client *sptr, const struct StatDesc* sd,
       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;
       maximum = tmp->maximum;
       port = tmp->address.port;
+
       if (tmp->status & CONF_UWORLD)
-       send_reply(sptr, RPL_STATSULINE, name);
+       send_reply(sptr, RPL_STATSULINE, host);
       else if (tmp->status & CONF_SERVER)
-       send_reply(sptr, RPL_STATSCLINE, name, host, port, maximum, hub_limit, get_conf_class(tmp));
+       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, host, maximum, name, port, get_conf_class(tmp));
+        send_reply(sptr, RPL_STATSILINE,
+                   (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, host, name, port, get_conf_class(tmp));
+       send_reply(sptr, RPL_STATSOLINE, username, host, name, get_conf_class(tmp));
     }
   }
 }
@@ -289,11 +294,11 @@ stats_links(struct Client* sptr, const struct StatDesc* sd, char* name)
       if (!(!name || wilds) && 0 != ircd_strcmp(name, cli_name(acptr)))
         continue;
       send_reply(sptr, SND_EXPLICIT | RPL_STATSLINKINFO,
-                 "%s %u %u %u %u %u :%Tu",
+                 "%s %u %u %Lu %u %Lu :%Tu",
                  (*(cli_name(acptr))) ? cli_name(acptr) : "<unregistered>",
                  (int)MsgQLength(&(cli_sendQ(acptr))), (int)cli_sendM(acptr),
-                 (int)cli_sendK(acptr), (int)cli_receiveM(acptr),
-                 (int)cli_receiveK(acptr), CurrentTime - cli_firsttime(acptr));
+                 (cli_sendB(acptr) >> 10), (int)cli_receiveM(acptr),
+                 (cli_receiveB(acptr) >> 10), CurrentTime - cli_firsttime(acptr));
     }
 }