Author: Kev <klmitch@mit.edu>
[ircu2.10.12-pk.git] / ircd / s_stats.c
index 38ea8f70e51c5ca62ac173240d5c6ea7ca931ae9..e966e46648e456d6fb0d636281ecd6f7f3ba5b59 100644 (file)
@@ -21,6 +21,7 @@
  *
  * $Id$
  */
+#include "config.h"
 
 #include "s_stats.h"
 #include "class.h"
@@ -72,11 +73,11 @@ const char *statsinfo[] = {
     "g - Global bans (G-lines).",
     "k - Local bans (K-Lines).",
     "o - Operator information.", 
+    "e - Report server event loop engine.",
     "f - Feature settings.",
     "m - Message usage information.",
     "t - Local connection statistics (Total SND/RCV, etc).", 
     "w - Userload statistics.",
-    "v - Connection class information.",
     "M - Memory allocation & leak monitoring.", 
     "z - Memory/Structure allocation information.",
     "r - System resource usage (Debug only).", 
@@ -179,7 +180,7 @@ void report_deny_list(struct Client* to)
  *          thusly once all the hubs have upgraded local opers will be able
  *          to remote stats anywhere on the network.
  */
-int hunt_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[], char stat)
+int hunt_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[], char stat, int MustBeOper)
 {
   switch (stat)
   {
@@ -188,8 +189,8 @@ int hunt_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[],
     case 'u':
     case 'F':
     case 'f':
-      return hunt_server_cmd(sptr, CMD_STATS, cptr, 0, "%s :%C", 2, parc,
-                            parv);
+      return hunt_server_cmd(sptr, CMD_STATS, cptr, MustBeOper, "%s :%C", 2,
+                            parc, parv);
 
     /* open to all, varying # of params */
     case 'k':
@@ -200,9 +201,11 @@ int hunt_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[],
     case 'P':
     {
       if (parc > 3)
-       return hunt_server_cmd(sptr, CMD_STATS, cptr, 0, "%s %C :%s", 2, parc, parv);
+       return hunt_server_cmd(sptr, CMD_STATS, cptr, MustBeOper, "%s %C :%s",
+                              2, parc, parv);
       else
-       return hunt_server_cmd(sptr, CMD_STATS, cptr, 0, "%s :%C", 2, parc, parv);
+       return hunt_server_cmd(sptr, CMD_STATS, cptr, MustBeOper, "%s :%C", 2,
+                              parc, parv);
     }
 
       /* oper only, varying # of params */
@@ -211,16 +214,24 @@ int hunt_stats(struct Client* cptr, struct Client* sptr, int parc, char* parv[],
     case 'M':
     {
       if (parc == 4)
-       return hunt_server_cmd(sptr, CMD_STATS, cptr, MyUser(sptr) ? 1 : 0, "%s %C :%s", 2, parc, parv);
+       return hunt_server_cmd(sptr, CMD_STATS, cptr,
+                              MyUser(sptr) ? 1 : MustBeOper, "%s %C :%s", 2,
+                              parc, parv);
       else if (parc > 4)
-       return hunt_server_cmd(sptr, CMD_STATS, cptr, MyUser(sptr) ? 1 : 0, "%s %C %s :%s", 2, parc, parv);
+       return hunt_server_cmd(sptr, CMD_STATS, cptr,
+                              MyUser(sptr) ? 1 : MustBeOper, "%s %C %s :%s",
+                              2, parc, parv);
       else 
-       return hunt_server_cmd(sptr, CMD_STATS, cptr, MyUser(sptr) ? 1 : 0, "%s :%C", 2, parc, parv);
+       return hunt_server_cmd(sptr, CMD_STATS, cptr,
+                              MyUser(sptr) ? 1 : MustBeOper, "%s :%C", 2,
+                              parc, parv);
     }
 
       /* oper only, standard # of params */
     default:
-      return hunt_server_cmd(sptr, CMD_STATS, cptr, MyUser(sptr) ? 1 : 0, "%s :%C", 2, parc, parv);
+      return hunt_server_cmd(sptr, CMD_STATS, cptr,
+                            MyUser(sptr) ? 1 : MustBeOper, "%s :%C", 2, parc,
+                            parv);
   }
 }