]>
Commit | Line | Data |
---|---|---|
e2a9fa9c AC |
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" | |
e2a9fa9c | 10 | |
eeabf33a EM |
11 | static const char extb_desc[] = "Hostmask ($m) extban type"; |
12 | ||
e2a9fa9c AC |
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 | ||
c81afd15 | 17 | DECLARE_MODULE_AV2(extb_hostmask, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc); |
e2a9fa9c AC |
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 | { | |
a7d4a0ab | 35 | return client_matches_mask(client_p, banstr) ? EXTBAN_MATCH : EXTBAN_NOMATCH; |
e2a9fa9c | 36 | } |