blob: ef266543dd66724c6456942b2ceab65c102849ce [file] [log] [blame]
yuezonghe824eb0c2024-06-27 02:32:26 -07001/* Shared library add-on to iptables to add NOTRACK target support. */
2#include <stdio.h>
3#include <string.h>
4#include <stdlib.h>
5#include <getopt.h>
6
7#include <xtables.h>
8#include <linux/netfilter/x_tables.h>
9
10static void NOTRACK_help(void)
11{
12 printf("NOTRACK target takes no options\n");
13}
14
15static int
16NOTRACK_parse(int c, char **argv, int invert, unsigned int *flags,
17 const void *entry, struct xt_entry_target **target)
18{
19 return 0;
20}
21
22static struct xtables_target notrack_target = {
23 .family = NFPROTO_IPV4,
24 .name = "NOTRACK",
25 .version = XTABLES_VERSION,
26 .size = XT_ALIGN(0),
27 .userspacesize = XT_ALIGN(0),
28 .help = NOTRACK_help,
29 .parse = NOTRACK_parse,
30};
31
32static struct xtables_target notrack_target6 = {
33 .family = NFPROTO_IPV6,
34 .name = "NOTRACK",
35 .version = XTABLES_VERSION,
36 .size = XT_ALIGN(0),
37 .userspacesize = XT_ALIGN(0),
38 .help = NOTRACK_help,
39 .parse = NOTRACK_parse,
40};
41
42void _init(void)
43{
44 xtables_register_target(&notrack_target);
45 xtables_register_target(&notrack_target6);
46}