]>
jfr.im git - irc/quakenet/newserv.git/blob - bans/bans.h
4 #include "../lib/flags.h"
5 #include "../lib/sstring.h"
6 #include "../lib/irc_ipv6.h"
9 #define CHANBAN_NICKEXACT 0x0001 /* Ban includes an exact nick (no wildcards) */
10 #define CHANBAN_NICKMASK 0x0002 /* Ban includes a nick mask with wildcards */
11 #define CHANBAN_NICKANY 0x0004 /* Ban is *!.. */
12 #define CHANBAN_NICKNULL 0x0008 /* Ban has no nick */
13 #define CHANBAN_USEREXACT 0x0010 /* Ban includes an exact user (no wildcards) */
14 #define CHANBAN_USERMASK 0x0020 /* Ban includes a user mask with wildcards */
15 #define CHANBAN_USERANY 0x0040 /* Ban is ..!*@.. */
16 #define CHANBAN_USERNULL 0x0080 /* Ban has no user */
17 #define CHANBAN_HOSTEXACT 0x0100 /* Ban includes an exact host */
18 #define CHANBAN_HOSTMASK 0x0200 /* Ban includes a host mask */
19 #define CHANBAN_HOSTANY 0x0400 /* Ban is ..@* */
20 #define CHANBAN_HOSTNULL 0x0800 /* Ban has no host */
21 #define CHANBAN_IP 0x1000 /* Ban could match against IP address */
22 #define CHANBAN_CIDR 0x2000 /* Ban includes a CIDR mask (e.g. 192.168.0.0/16 ) */
23 #define CHANBAN_INVALID 0x4000 /* Ban is nonsensical, i.e. has at least one really NULL component*/
24 #define CHANBAN_HIDDENHOST 0x8000 /* Ban could possibly match hidden host */
27 typedef struct chanban
{
33 struct irc_in_addr ipaddr
;
34 unsigned char prefixlen
;
38 chanban
*getchanban();
39 void freechanban(chanban
*cbp
);
41 chanban
*makeban(const char *mask
);
43 int banoverlap(const chanban
*bana
, const chanban
*banb
);
44 int banequal(chanban
*bana
, chanban
*banb
);
45 char *bantostring(chanban
*bp
);
46 char *bantostringdebug(chanban
*bp
);