]> jfr.im git - solanum.git/blame_incremental - extensions/extb_hostmask.c
explicitly show IP in SNO_BANNED snotes
[solanum.git] / extensions / extb_hostmask.c
... / ...
CommitLineData
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
11static const char extb_desc[] = "Hostmask ($m) extban type";
12
13static int _modinit(void);
14static void _moddeinit(void);
15static int eb_hostmask(const char *data, struct Client *client_p, struct Channel *chptr, long mode_type);
16
17DECLARE_MODULE_AV2(extb_hostmask, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc);
18
19static int
20_modinit(void)
21{
22 extban_table['m'] = eb_hostmask;
23 return 0;
24}
25
26static void
27_moddeinit(void)
28{
29 extban_table['m'] = NULL;
30}
31
32static int
33eb_hostmask(const char *banstr, struct Client *client_p, struct Channel *chptr, long mode_type)
34{
35 if (banstr == NULL)
36 return EXTBAN_INVALID;
37 return client_matches_mask(client_p, banstr) ? EXTBAN_MATCH : EXTBAN_NOMATCH;
38}