Make default virtual host work for .12, and make IPv4-only
[ircu2.10.12-pk.git] / ircd / s_debug.c
index a22745406dc7426ff3d9aea03bb6a1b4f55530e0..91639d580737cb06da4855cf1551f4a7aa47a6fe 100644 (file)
@@ -26,6 +26,7 @@
 #include "channel.h"
 #include "class.h"
 #include "client.h"
+#include "gline.h"
 #include "hash.h"
 #include "ircd_alloc.h"
 #include "ircd_features.h"
 #include "ircd_osdep.h"
 #include "ircd_reply.h"
 #include "ircd.h"
+#include "jupe.h"
 #include "list.h"
+#include "motd.h"
 #include "msgq.h"
 #include "numeric.h"
 #include "numnicks.h"
 #include "res.h"
 #include "s_bsd.h"
 #include "s_conf.h"
+#include "s_stats.h"
 #include "send.h"
 #include "struct.h"
 #include "sys.h"
@@ -89,61 +93,19 @@ const char* debug_serveropts(void)
   AddC('D');
 #endif
 
-  if (feature_bool(FEAT_LOCOP_REHASH))
-    AddC('e');
-
-  if (feature_bool(FEAT_OPER_REHASH))
-    AddC('E');
-
-  if (feature_bool(FEAT_OPER_NO_CHAN_LIMIT))
-    AddC('F');
-
-  if (feature_bool(FEAT_OPER_MODE_LCHAN))
-    AddC('f');
-
   if (feature_bool(FEAT_HUB))
     AddC('H');
 
-  if (feature_bool(FEAT_SHOW_ALL_INVISIBLE_USERS))
-    AddC('I');
-  else if (feature_bool(FEAT_SHOW_INVISIBLE_USERS))
-    AddC('i');
-
-  if (feature_bool(FEAT_OPER_KILL)) {
-    if (feature_bool(FEAT_LOCAL_KILL_ONLY))
-      AddC('k');
-    else
-      AddC('K');
-  }
-
-  if (feature_bool(FEAT_OPER_WALK_THROUGH_LMODES))
-    AddC('l');
-
   if (feature_bool(FEAT_IDLE_FROM_MSG))
     AddC('M');
 
-  if (feature_bool(FEAT_NO_OPER_DEOP_LCHAN))
-    AddC('o');
-
-  if (feature_bool(FEAT_CRYPT_OPER_PASSWORD))
-    AddC('p');
-
   if (feature_bool(FEAT_RELIABLE_CLOCK))
     AddC('R');
 
-  if (feature_bool(FEAT_LOCOP_RESTART))
-    AddC('s');
-
-  if (feature_bool(FEAT_OPER_RESTART))
-    AddC('S');
-
 #if defined(USE_POLL) && defined(HAVE_POLL_H)
   AddC('U');
 #endif
 
-  if (feature_bool(FEAT_VIRTUAL_HOST))
-    AddC('v');
-
   serveropts[i] = '\0';
 
   return serveropts;
@@ -205,7 +167,7 @@ static void debug_enumerator(struct Client* cptr, const char* msg)
  * different field names for "struct rusage".
  * -avalon
  */
-void send_usage(struct Client *cptr, struct StatDesc *sd, int stat,
+void send_usage(struct Client *cptr, const struct StatDesc *sd,
                 char *param)
 {
   os_get_rusage(cptr, CurrentTime - cli_since(&me), debug_enumerator);
@@ -215,7 +177,7 @@ void send_usage(struct Client *cptr, struct StatDesc *sd, int stat,
 }
 #endif /* DEBUGMODE */
 
-void count_memory(struct Client *cptr, struct StatDesc *sd, int stat,
+void count_memory(struct Client *cptr, const struct StatDesc *sd,
                   char *param)
 {
   struct Client *acptr;
@@ -357,6 +319,13 @@ void count_memory(struct Client *cptr, struct StatDesc *sd, int stat,
 
   totww = wwu * sizeof(struct User) + wwam + wwm;
 
+  motd_memory_count(cptr);
+
+  gl = gline_memory_count(&glm);
+  ju = jupe_memory_count(&jum);
+  send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG,
+            ":Glines %d(%zu) Jupes %d(%zu)", gl, glm, ju, jum);
+
   send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG,
             ":Hash: client %d(%zu), chan is the same", HASHSIZE,
             sizeof(void *) * HASHSIZE);
@@ -374,6 +343,9 @@ void count_memory(struct Client *cptr, struct StatDesc *sd, int stat,
             ":DBufs allocated %d(%zu) used %d(%zu)", DBufAllocCount,
             dbufs_allocated, DBufUsedCount, dbufs_used);
 
+  /* The DBuf caveats now count for this, but this routine now sends
+   * replies all on its own.
+   */
   msgq_count_memory(cptr, &msg_allocated, &msgbuf_allocated);
 
   rm = cres_mem(cptr);