angiosperm/extensions/extb_hostmask.c
Ed Kellett a78869aa47
match: make matching API more versatile
in particular, we now know if masks are going to grant or deny access
2020-10-17 02:48:43 +01:00

36 lines
857 B
C

/*
* 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"
static const char extb_desc[] = "Hostmask ($m) extban type";
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);
DECLARE_MODULE_AV2(extb_hostmask, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc);
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)
{
return client_matches_mask(client_p, banstr, mode_type) ? EXTBAN_MATCH : EXTBAN_NOMATCH;
}