From a6e9356357a9dfe0c01871531eba58f6fdce92ea Mon Sep 17 00:00:00 2001 From: "geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b" Date: Sun, 5 Jun 2005 10:46:25 +0000 Subject: BUILD : 1.7.10 (828) BUGS : NOTES : Added a new ban system which should be faster than what we have now and also supports CIDR bans -- not yet in use, but will be used for akills andeventually channel bans -- hashing and cidr bans are not tested yet git-svn-id: svn://svn.anope.org/anope/trunk@828 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@581 5417fbe8-f217-4b02-8779-1006273d7864 --- include/services.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'include/services.h') diff --git a/include/services.h b/include/services.h index e0017256e..31684577c 100644 --- a/include/services.h +++ b/include/services.h @@ -1317,6 +1317,44 @@ typedef struct ircd_modes_ { /*************************************************************************/ +/* UserBan support structures */ + +typedef struct baninfo_ BanInfo; +typedef struct banlist_ BanList; + +struct baninfo_ { + uint32 id; /* Ban ID, can be used to look it up */ + uint16 type; /* See BANTYPE_ below */ + + uint32 cidr_mask; /* Netmask for CIDR matching */ + uint32 cidr_ip; /* IP mask for CIDR matching */ + char *user; /* User value, NULL when not matched */ + char *host; /* Host value, NULL when not matched */ + + char *mask; /* String version of the ban mask, for displaying */ + + BanInfo *next; + BanInfo *prev; +}; + +struct banlist_ { + uint16 flags; /* See BANLIST_ below */ + BanInfo **bans; /* Ban data lists */ + uint32 next_id; /* Next ID to use for a ban */ +}; + +#define BANTYPE_NONE 0x0000 +#define BANTYPE_CIDR4 0x0001 +#define BANTYPE_USER 0x0002 +#define BANTYPE_USER_WILD 0x0004 +#define BANTYPE_HOST 0x0008 +#define BANTYPE_HOST_WILD 0x0010 + +#define BANLIST_NONE 0x0000 +#define BANLIST_HASHED 0x0001 + +/*************************************************************************/ + #include "extern.h" /*************************************************************************/ -- cgit