2015-12-10 08:25:22 +00:00
|
|
|
/*
|
|
|
|
* Hostmask extban type: bans all users matching a given hostmask, used for stacked extbans
|
|
|
|
* -- kaniini
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "stdinc.h"
|
|
|
|
#include "modules.h"
|
|
|
|
#include "client.h"
|
|
|
|
#include "ircd.h"
|
|
|
|
|
2016-03-09 07:29:41 +00:00
|
|
|
static const char extb_desc[] = "Hostmask ($m) extban type";
|
|
|
|
|
2015-12-10 08:25:22 +00:00
|
|
|
static int _modinit(void);
|
|
|
|
static void _moddeinit(void);
|
|
|
|
static int eb_hostmask(const char *data, struct Client *client_p, struct Channel *chptr, long mode_type);
|
|
|
|
|
2016-03-07 06:31:41 +00:00
|
|
|
DECLARE_MODULE_AV2(extb_hostmask, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc);
|
2015-12-10 08:25:22 +00:00
|
|
|
|
|
|
|
static int
|
|
|
|
_modinit(void)
|
|
|
|
{
|
|
|
|
extban_table['m'] = eb_hostmask;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_moddeinit(void)
|
|
|
|
{
|
|
|
|
extban_table['m'] = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
eb_hostmask(const char *banstr, struct Client *client_p, struct Channel *chptr, long mode_type)
|
|
|
|
{
|
2020-07-30 18:58:35 +00:00
|
|
|
if (banstr == NULL)
|
|
|
|
return EXTBAN_INVALID;
|
2020-04-12 01:07:17 +00:00
|
|
|
return client_matches_mask(client_p, banstr) ? EXTBAN_MATCH : EXTBAN_NOMATCH;
|
2015-12-10 08:25:22 +00:00
|
|
|
}
|