Author: Kev <klmitch@mit.edu>
[ircu2.10.12-pk.git] / include / gline.h
index 24090168b0502ad96423292f8aa496282cfe6dc1..ec10009c3a82f1476081b52cdbc56b199deec311 100644 (file)
  *
  * $Id$
  */
-#ifndef INCLUDED_config_h
-#include "config.h"
-#endif
 #ifndef INCLUDED_sys_types_h
 #include <sys/types.h>
 #define INCLUDED_sys_types_h
 #endif
 
+#include <netinet/in.h>
 
 struct Client;
 
@@ -43,6 +41,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;
   unsigned int gl_flags;
 };
 
@@ -54,6 +54,9 @@ struct Gline {
 #define GLINE_FORCE    0x0020
 #define GLINE_EXACT    0x0040
 #define GLINE_LDEACT   0x0080  /* locally deactivated */
+#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_MASK     (GLINE_ACTIVE | GLINE_BADCHAN | GLINE_LOCAL)
 #define GLINE_ACTMASK  (GLINE_ACTIVE | GLINE_LDEACT)
@@ -70,6 +73,8 @@ struct Gline {
 #define GlineReason(g)         ((g)->gl_reason)
 #define GlineLastMod(g)                ((g)->gl_lastmod)
 
+extern int gline_propagate(struct Client *cptr, struct Client *sptr,
+                          struct Gline *gline);
 extern int gline_add(struct Client *cptr, struct Client *sptr, char *userhost,
                     char *reason, time_t expire, time_t lastmod,
                     unsigned int flags);
@@ -80,7 +85,7 @@ extern int gline_deactivate(struct Client *cptr, struct Client *sptr,
                            struct Gline *gline, time_t lastmod,
                            unsigned int flags);
 extern struct Gline *gline_find(char *userhost, unsigned int flags);
-extern struct Gline *gline_lookup(struct Client *cptr);
+extern struct Gline *gline_lookup(struct Client *cptr, unsigned int flags);
 extern void gline_free(struct Gline *gline);
 extern void gline_burst(struct Client *cptr);
 extern int gline_resend(struct Client *cptr, struct Gline *gline);