blob: ef266543dd66724c6456942b2ceab65c102849ce [file] [log] [blame]
Joszef Kadlecsik690a3952003-05-21 10:31:08 +00001/* 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
Yasuyuki KOZAKAI857ff8b2007-07-24 06:41:01 +00007#include <xtables.h>
8#include <linux/netfilter/x_tables.h>
Joszef Kadlecsik690a3952003-05-21 10:31:08 +00009
Jan Engelhardt932e6482007-10-04 16:27:30 +000010static void NOTRACK_help(void)
Joszef Kadlecsik690a3952003-05-21 10:31:08 +000011{
Jan Engelhardt8b7c64d2008-04-15 11:48:25 +020012 printf("NOTRACK target takes no options\n");
Joszef Kadlecsik690a3952003-05-21 10:31:08 +000013}
14
Joszef Kadlecsik690a3952003-05-21 10:31:08 +000015static int
Jan Engelhardt932e6482007-10-04 16:27:30 +000016NOTRACK_parse(int c, char **argv, int invert, unsigned int *flags,
17 const void *entry, struct xt_entry_target **target)
Joszef Kadlecsik690a3952003-05-21 10:31:08 +000018{
19 return 0;
20}
21
Jan Engelhardt932e6482007-10-04 16:27:30 +000022static struct xtables_target notrack_target = {
Jan Engelhardt03d99482008-11-18 12:27:54 +010023 .family = NFPROTO_IPV4,
Yasuyuki KOZAKAI857ff8b2007-07-24 06:41:01 +000024 .name = "NOTRACK",
Jan Engelhardt8b7c64d2008-04-15 11:48:25 +020025 .version = XTABLES_VERSION,
Yasuyuki KOZAKAI857ff8b2007-07-24 06:41:01 +000026 .size = XT_ALIGN(0),
27 .userspacesize = XT_ALIGN(0),
Jan Engelhardt932e6482007-10-04 16:27:30 +000028 .help = NOTRACK_help,
29 .parse = NOTRACK_parse,
Joszef Kadlecsik690a3952003-05-21 10:31:08 +000030};
31
Jan Engelhardt932e6482007-10-04 16:27:30 +000032static struct xtables_target notrack_target6 = {
Jan Engelhardt03d99482008-11-18 12:27:54 +010033 .family = NFPROTO_IPV6,
Yasuyuki KOZAKAI51861642007-07-24 06:43:55 +000034 .name = "NOTRACK",
Jan Engelhardt8b7c64d2008-04-15 11:48:25 +020035 .version = XTABLES_VERSION,
Yasuyuki KOZAKAI51861642007-07-24 06:43:55 +000036 .size = XT_ALIGN(0),
37 .userspacesize = XT_ALIGN(0),
Jan Engelhardt932e6482007-10-04 16:27:30 +000038 .help = NOTRACK_help,
39 .parse = NOTRACK_parse,
Yasuyuki KOZAKAI51861642007-07-24 06:43:55 +000040};
41
Joszef Kadlecsik690a3952003-05-21 10:31:08 +000042void _init(void)
43{
Jan Engelhardt932e6482007-10-04 16:27:30 +000044 xtables_register_target(&notrack_target);
45 xtables_register_target(&notrack_target6);
Joszef Kadlecsik690a3952003-05-21 10:31:08 +000046}