]> jfr.im git - solanum.git/blob - extensions/extb_hostmask.c
Merge pull request #288 from edk0/umode-o-split
[solanum.git] / extensions / extb_hostmask.c
1 /*
2 * Hostmask extban type: bans all users matching a given hostmask, used for stacked extbans
3 * -- kaniini
4 */
5
6 #include "stdinc.h"
7 #include "modules.h"
8 #include "client.h"
9 #include "ircd.h"
10
11 static const char extb_desc[] = "Hostmask ($m) extban type";
12
13 static int _modinit(void);
14 static void _moddeinit(void);
15 static int eb_hostmask(const char *data, struct Client *client_p, struct Channel *chptr, long mode_type);
16
17 DECLARE_MODULE_AV2(extb_hostmask, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc);
18
19 static int
20 _modinit(void)
21 {
22 extban_table['m'] = eb_hostmask;
23 return 0;
24 }
25
26 static void
27 _moddeinit(void)
28 {
29 extban_table['m'] = NULL;
30 }
31
32 static int
33 eb_hostmask(const char *banstr, struct Client *client_p, struct Channel *chptr, long mode_type)
34 {
35 return client_matches_mask(client_p, banstr) ? EXTBAN_MATCH : EXTBAN_NOMATCH;
36 }