mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-06 20:55:13 +02:00

Xtables-addons's extensions will always be built as modules, so it is safe to use __attribute__((constructor)).
39 lines
866 B
C
39 lines
866 B
C
/*
|
|
* "TARPIT" target extension to iptables
|
|
* this file is in the Public Domain
|
|
*/
|
|
#include <stdio.h>
|
|
#include <getopt.h>
|
|
#include <xtables.h>
|
|
|
|
static void tarpit_tg_help(void)
|
|
{
|
|
printf("TARPIT takes no options\n\n");
|
|
}
|
|
|
|
static int tarpit_tg_parse(int c, char **argv, int invert, unsigned int *flags,
|
|
const void *entry, struct xt_entry_target **target)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static void tarpit_tg_check(unsigned int flags)
|
|
{
|
|
}
|
|
|
|
static struct xtables_target tarpit_tg_reg = {
|
|
.version = XTABLES_VERSION,
|
|
.name = "TARPIT",
|
|
.family = AF_INET,
|
|
.size = XT_ALIGN(0),
|
|
.userspacesize = XT_ALIGN(0),
|
|
.help = tarpit_tg_help,
|
|
.parse = tarpit_tg_parse,
|
|
.final_check = tarpit_tg_check,
|
|
};
|
|
|
|
static __attribute__((constructor)) void tarpit_tg_ldr(void)
|
|
{
|
|
xtables_register_target(&tarpit_tg_reg);
|
|
}
|