Allow /stats to accept long names for the displayed statistics.
[ircu2.10.12-pk.git] / include / gline.h
index ec10009c3a82f1476081b52cdbc56b199deec311..f3f88eb172c4be74cfa2afd3116c6345180c1200 100644 (file)
 #define INCLUDED_sys_types_h
 #endif
 
-#include <netinet/in.h>
+#ifndef INCLUDED_res_h
+#include "res.h"
+#endif
 
 struct Client;
+struct StatDesc;
 
 #define GLINE_MAX_EXPIRE 604800        /* max expire: 7 days */
 
@@ -41,8 +44,8 @@ struct Gline {
   char        *gl_reason;
   time_t       gl_expire;
   time_t       gl_lastmod;
-  struct in_addr ipnum;  /* We store the IP in binary for ip glines */
-  char                 bits;
+  struct irc_in_addr gl_addr;  /* We store the IP in binary for ip glines */
+  unsigned char gl_bits;
   unsigned int gl_flags;
 };
 
@@ -57,14 +60,16 @@ struct Gline {
 #define GLINE_GLOBAL   0x0100  /* find only global glines */
 #define GLINE_LASTMOD  0x0200  /* find only glines with non-zero lastmod */
 #define GLINE_OPERFORCE        0x0400  /* oper forcing gline to be set */
+#define GLINE_REALNAME  0x0800  /* gline matches only the realname field */
 
-#define GLINE_MASK     (GLINE_ACTIVE | GLINE_BADCHAN | GLINE_LOCAL)
+#define GLINE_MASK     (GLINE_ACTIVE | GLINE_BADCHAN | GLINE_LOCAL | GLINE_REALNAME)
 #define GLINE_ACTMASK  (GLINE_ACTIVE | GLINE_LDEACT)
 
 #define GlineIsActive(g)       (((g)->gl_flags & GLINE_ACTMASK) == \
                                 GLINE_ACTIVE)
 #define GlineIsRemActive(g)    ((g)->gl_flags & GLINE_ACTIVE)
 #define GlineIsIpMask(g)       ((g)->gl_flags & GLINE_IPMASK)
+#define GlineIsRealName(g)      ((g)->gl_flags & GLINE_REALNAME)
 #define GlineIsBadChan(g)      ((g)->gl_flags & GLINE_BADCHAN)
 #define GlineIsLocal(g)                ((g)->gl_flags & GLINE_LOCAL)
 
@@ -90,6 +95,8 @@ extern void gline_free(struct Gline *gline);
 extern void gline_burst(struct Client *cptr);
 extern int gline_resend(struct Client *cptr, struct Gline *gline);
 extern int gline_list(struct Client *sptr, char *userhost);
-extern void gline_stats(struct Client *sptr);
+extern void gline_stats(struct Client *sptr, const struct StatDesc *sd,
+                        char *param);
+extern int gline_memory_count(size_t *gl_size);
 
 #endif /* INCLUDED_gline_h */