Committer  : entrope
CVSROOT    : /cvsroot/undernet-ircu
Module     : ircu2.10
Commit time: 2005-03-30 03:48:32 UTC

Modified files:
     ChangeLog doc/example.conf doc/readme.features include/hash.h
     include/ircd_features.h include/numeric.h ircd/hash.c
     ircd/ircd_features.c ircd/s_err.c ircd/s_stats.c

Log message:

Reed Loden's patch to add /stats J, listing nick jupes.  (Plus documentation.)

---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.579 ircu2.10/ChangeLog:1.580
--- ircu2.10/ChangeLog:1.579    Sun Mar 27 18:27:23 2005
+++ ircu2.10/ChangeLog  Tue Mar 29 19:48:21 2005
@@ -1,3 +1,32 @@
+2005-03-29  Michael Poole <[EMAIL PROTECTED]>
+
+       * doc/example.conf: Add HIS_STATS_J entry.
+
+       * doc/readme.features: Likewise.
+
+2005-03-25  Reed Loden <[EMAIL PROTECTED]>
+
+       * include/hash.h: Add needed prototypes for new
+       stats_nickjupes() function.
+
+       * include/ircd_features.h: Add FEAT_HIS_STATS_J.
+
+       * include/numeric.h: Add RPL_STATSJLINE (222) for new nick
+       jupes stats. Correct a typo in a comment.
+
+       * ircd/hash.c: Add stats_nickjupes() function to report all
+       nick jupes to an oper. Because of the nature of hash tables,
+       there is no way to sort this list so the results look weird.
+
+       * ircd/ircd_features.c: Add FEAT_HIS_STATS_J (default: TRUE).
+
+       * ircd/s_err.c: Add RPL_STATSJLINE (222) for new nick jupes
+       stats.
+
+       * ircd/s_stats.c: Add RPL_STATSJLINE (222) for new nick jupes
+       stats. Make 'j' case sensitive. Modify the comment for stats
+       uworld.
+
 2005-03-27  Michael Poole <[EMAIL PROTECTED]>
 
        * ircd/m_burst.c (ms_burst): Do not send numeric oplevels in a -A
Index: ircu2.10/doc/example.conf
diff -u ircu2.10/doc/example.conf:1.49 ircu2.10/doc/example.conf:1.50
--- ircu2.10/doc/example.conf:1.49      Sat Mar 19 15:04:07 2005
+++ ircu2.10/doc/example.conf   Tue Mar 29 19:48:22 2005
@@ -821,6 +821,7 @@
 #  "HIS_STATS_h" = "TRUE";
 #  "HIS_STATS_i" = "TRUE";
 #  "HIS_STATS_j" = "TRUE";
+#  "HIS_STATS_J" = "TRUE";
 #  "HIS_STATS_k" = "TRUE";
 #  "HIS_STATS_l" = "TRUE";
 #  "HIS_STATS_L" = "TRUE";
Index: ircu2.10/doc/readme.features
diff -u ircu2.10/doc/readme.features:1.15 ircu2.10/doc/readme.features:1.16
--- ircu2.10/doc/readme.features:1.15   Fri Jan 14 12:11:49 2005
+++ ircu2.10/doc/readme.features        Tue Mar 29 19:48:22 2005
@@ -549,6 +549,12 @@
 
 As per UnderNet CFV-165, this removes /STATS j from users.
 
+HIS_STATS_J
+ * Type: boolean
+ * Default: TRUE
+
+As per UnderNet CFV-165, this removes /STATS J from users.
+
 HIS_STATS_M
  * Type: boolean
  * Default: TRUE
Index: ircu2.10/include/hash.h
diff -u ircu2.10/include/hash.h:1.6 ircu2.10/include/hash.h:1.7
--- ircu2.10/include/hash.h:1.6 Wed Oct 13 21:02:50 2004
+++ ircu2.10/include/hash.h     Tue Mar 29 19:48:22 2005
@@ -18,7 +18,7 @@
  */
 /** @file
  * @brief Hash table management APIs.
- * @version $Id: hash.h,v 1.6 2004/10/14 04:02:50 entrope Exp $
+ * @version $Id: hash.h,v 1.7 2005/03/30 03:48:22 entrope Exp $
  */
 
 #ifndef INCLUDED_hash_h
@@ -26,6 +26,7 @@
 
 struct Client;
 struct Channel;
+struct StatDesc;
 
 /*
  * general defines
@@ -87,6 +88,8 @@
 extern int isNickJuped(const char *nick);
 extern int addNickJupes(const char *nicks);
 extern void clearNickJupes(void);
+extern void stats_nickjupes(struct Client* to, const struct StatDesc* sd,
+                           char* param);
 extern void list_next_channels(struct Client *cptr);
 
 #endif /* INCLUDED_hash_h */
Index: ircu2.10/include/ircd_features.h
diff -u ircu2.10/include/ircd_features.h:1.34 
ircu2.10/include/ircd_features.h:1.35
--- ircu2.10/include/ircd_features.h:1.34       Mon Oct  4 21:14:44 2004
+++ ircu2.10/include/ircd_features.h    Tue Mar 29 19:48:22 2005
@@ -20,7 +20,7 @@
  */
 /** @file
  * @brief Public interfaces and declarations for dealing with configurable 
features.
- * @version $Id: ircd_features.h,v 1.34 2004/10/05 04:14:44 entrope Exp $
+ * @version $Id: ircd_features.h,v 1.35 2005/03/30 03:48:22 entrope Exp $
  */
 
 struct Client;
@@ -113,6 +113,7 @@
   FEAT_HIS_STATS_f,
   FEAT_HIS_STATS_i,
   FEAT_HIS_STATS_j,
+  FEAT_HIS_STATS_J,
   FEAT_HIS_STATS_M,
   FEAT_HIS_STATS_m,
   FEAT_HIS_STATS_o,
Index: ircu2.10/include/numeric.h
diff -u ircu2.10/include/numeric.h:1.35 ircu2.10/include/numeric.h:1.36
--- ircu2.10/include/numeric.h:1.35     Sat Dec 18 08:26:26 2004
+++ ircu2.10/include/numeric.h  Tue Mar 29 19:48:22 2005
@@ -18,7 +18,7 @@
  */
 /** @file
  * @brief Declarations of numeric replies and supporting functions.
- * @version $Id: numeric.h,v 1.35 2004/12/18 16:26:26 klmitch Exp $
+ * @version $Id: numeric.h,v 1.36 2005/03/30 03:48:22 entrope Exp $
  */
 #ifndef INCLUDED_numeric_h
 #define INCLUDED_numeric_h
@@ -92,7 +92,7 @@
 #define RPL_STATSNLINE       214 /* unused */
 #define RPL_STATSILINE       215
 #define RPL_STATSKLINE       216
-#define RPL_STATSPLINE       217        /* Undernet extenstion */
+#define RPL_STATSPLINE       217        /* Undernet extension */
 /*      RPL_STATSQLINE       217           Various */
 #define RPL_STATSYLINE       218
 #define RPL_ENDOFSTATS       219        /* See also RPL_STATSDLINE */
@@ -101,6 +101,7 @@
 /*      RPL_STATSBLINE       220          Numerics List: Dalnet,unreal */
 #define RPL_UMODEIS          221
 /*     RPL_SQLINE_NICK      222           Numerics List: Dalnet */
+#define RPL_STATSJLINE       222       /* Undernet extension */
 /*     RPL_STATSELINE       223           dalnet */
 /*     RPL_STATSGLINE       223           unreal */
 /*      RPL_STATSFLINE       224           Hybrid extension,Dalnet */
Index: ircu2.10/ircd/hash.c
diff -u ircu2.10/ircd/hash.c:1.15 ircu2.10/ircd/hash.c:1.16
--- ircu2.10/ircd/hash.c:1.15   Sun Mar 20 08:06:17 2005
+++ ircu2.10/ircd/hash.c        Tue Mar 29 19:48:22 2005
@@ -45,7 +45,7 @@
 
 /** @file
  * @brief Hash table management.
- * @version $Id: hash.c,v 1.15 2005/03/20 16:06:17 entrope Exp $
+ * @version $Id: hash.c,v 1.16 2005/03/30 03:48:22 entrope Exp $
  *
  * This file used to use some very complicated hash function.  Now it
  * uses CRC-32, but effectively remaps each input byte according to a
@@ -408,6 +408,20 @@
     jupeTable[i][0] = '\000';
 }
 
+/** Report all nick jupes to a user.
+ * @param[in] to Client requesting statistics.
+ * @param[in] sd Stats descriptor for request (ignored).
+ * @param[in] param Extra parameter from user (ignored).
+ */
+void
+stats_nickjupes(struct Client* to, const struct StatDesc* sd, char* param)
+{
+  int i;
+  for (i = 0; i < JUPEHASHSIZE; i++)
+    if (jupeTable[i][0])
+      send_reply(to, RPL_STATSJLINE, jupeTable[i]);
+}
+
 /** Send more channels to a client in mid-LIST.
  * @param[in] cptr Client to send the list to.
  */
Index: ircu2.10/ircd/ircd_features.c
diff -u ircu2.10/ircd/ircd_features.c:1.45 ircu2.10/ircd/ircd_features.c:1.46
--- ircu2.10/ircd/ircd_features.c:1.45  Sun Mar 20 08:06:17 2005
+++ ircu2.10/ircd/ircd_features.c       Tue Mar 29 19:48:22 2005
@@ -18,7 +18,7 @@
  */
 /** @file
  * @brief Implementation of configurable feature support.
- * @version $Id: ircd_features.c,v 1.45 2005/03/20 16:06:17 entrope Exp $
+ * @version $Id: ircd_features.c,v 1.46 2005/03/30 03:48:22 entrope Exp $
  */
 #include "config.h"
 
@@ -352,6 +352,7 @@
   F_B(HIS_STATS_f, 0, 1, 0),
   F_B(HIS_STATS_i, 0, 1, 0),
   F_B(HIS_STATS_j, 0, 1, 0),
+  F_B(HIS_STATS_J, 0, 1, 0),
   F_B(HIS_STATS_M, 0, 1, 0),
   F_B(HIS_STATS_m, 0, 1, 0),
   F_B(HIS_STATS_o, 0, 1, 0),
Index: ircu2.10/ircd/s_err.c
diff -u ircu2.10/ircd/s_err.c:1.63 ircu2.10/ircd/s_err.c:1.64
--- ircu2.10/ircd/s_err.c:1.63  Sat Feb 19 09:15:38 2005
+++ ircu2.10/ircd/s_err.c       Tue Mar 29 19:48:22 2005
@@ -18,7 +18,7 @@
  */
 /** @file
  * @brief Error handling support.
- * @version $Id: s_err.c,v 1.63 2005/02/19 17:15:38 entrope Exp $
+ * @version $Id: s_err.c,v 1.64 2005/03/30 03:48:22 entrope Exp $
  */
 #include "config.h"
 
@@ -476,7 +476,7 @@
 /* 221 */
   { RPL_UMODEIS, "%s", "221" },
 /* 222 */
-  { 0 },
+  { RPL_STATSJLINE, "J %s", "222" },
 /* 223 */
   { 0 },
 /* 224 */
Index: ircu2.10/ircd/s_stats.c
diff -u ircu2.10/ircd/s_stats.c:1.35 ircu2.10/ircd/s_stats.c:1.36
--- ircu2.10/ircd/s_stats.c:1.35        Sun Mar 20 08:06:30 2005
+++ ircu2.10/ircd/s_stats.c     Tue Mar 29 19:48:22 2005
@@ -24,6 +24,7 @@
 #include "class.h"
 #include "client.h"
 #include "gline.h"
+#include "hash.h"
 #include "ircd.h"
 #include "ircd_chattr.h"
 #include "ircd_events.h"
@@ -60,7 +61,7 @@
 /** @file
  * @brief Report configuration lines and other statistics from this
  * server.
- * @version $Id: s_stats.c,v 1.35 2005/03/20 16:06:30 entrope Exp $
+ * @version $Id: s_stats.c,v 1.36 2005/03/30 03:48:22 entrope Exp $
  *
  * Note: The info is reported in the order the server uses
  *       it--not reversed as in ircd.conf!
@@ -523,9 +524,12 @@
   { 'i', "access", (STAT_FLAG_OPERFEAT | STAT_FLAG_VARPARAM), FEAT_HIS_STATS_i,
     stats_access, CONF_CLIENT,
     "Connection authorization lines." },
-  { 'j', "histogram", STAT_FLAG_OPERFEAT, FEAT_HIS_STATS_j,
+  { 'j', "histogram", (STAT_FLAG_OPERFEAT | STAT_FLAG_CASESENS), 
FEAT_HIS_STATS_j,
     msgq_histogram, 0,
     "Message length histogram." },
+  { 'J', "jupes", (STAT_FLAG_OPERFEAT | STAT_FLAG_CASESENS), FEAT_HIS_STATS_J,
+    stats_nickjupes, 0,
+    "Nickname jupes." },
   { 'k', "klines", (STAT_FLAG_OPERFEAT | STAT_FLAG_VARPARAM), FEAT_HIS_STATS_k,
     stats_klines, 0,
     "Local bans (K-Lines)." },
@@ -565,7 +569,7 @@
     "Local connection statistics (Total SND/RCV, etc)." },
   { 'U', "uworld", (STAT_FLAG_OPERFEAT | STAT_FLAG_CASESENS), FEAT_HIS_STATS_U,
     stats_configured_links, CONF_UWORLD,
-    "Service server & nick jupes information." },
+    "Service server information." },
   { 'u', "uptime", (STAT_FLAG_OPERFEAT | STAT_FLAG_CASESENS), FEAT_HIS_STATS_u,
     stats_uptime, 0,
     "Current uptime & highest connection count." },
----------------------- End of diff -----------------------

Reply via email to