]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Add IPv6 support to helper match
authorYasuyuki KOZAKAI <yasuyuki@netfilter.org>
Sat, 4 Aug 2007 08:26:59 +0000 (08:26 +0000)
committerYasuyuki KOZAKAI <yasuyuki@netfilter.org>
Sat, 4 Aug 2007 08:26:59 +0000 (08:26 +0000)
extensions/Makefile
extensions/libxt_helper.c [moved from extensions/libipt_helper.c with 70% similarity]
include/linux/netfilter/xt_helper.h [new file with mode: 0644]
include/linux/netfilter_ipv4/ipt_helper.h [deleted file]

index 5830faa80f29d3dfaa4aa32df2ab7f537040f7f1..63efc2af30acb22f998fd9787aab64b5c8eac143 100644 (file)
@@ -5,9 +5,9 @@
 # header files are present in the include/linux directory of this iptables
 # package (HW)
 #
-PF_EXT_SLIB:=ah addrtype conntrack ecn helper icmp iprange owner policy realm tos ttl unclean DNAT ECN LOG MASQUERADE MIRROR NETMAP REDIRECT REJECT SAME SNAT TOS TTL ULOG
+PF_EXT_SLIB:=ah addrtype conntrack ecn icmp iprange owner policy realm tos ttl unclean DNAT ECN LOG MASQUERADE MIRROR NETMAP REDIRECT REJECT SAME SNAT TOS TTL ULOG
 PF6_EXT_SLIB:=eui64 hl icmp6 owner policy HL LOG
-PFX_EXT_SLIB:=connmark connlimit comment dscp esp hashlimit length limit mac mark multiport physdev pkttype sctp state standard tcp tcpmss udp CLASSIFY CONNMARK DSCP MARK NFQUEUE NOTRACK TCPMSS TRACE
+PFX_EXT_SLIB:=connmark connlimit comment dscp esp hashlimit helper length limit mac mark multiport physdev pkttype sctp state standard tcp tcpmss udp CLASSIFY CONNMARK DSCP MARK NFQUEUE NOTRACK TCPMSS TRACE
 
 ifeq ($(DO_SELINUX), 1)
 PF_EXT_SE_SLIB:=
similarity index 70%
rename from extensions/libipt_helper.c
rename to extensions/libxt_helper.c
index c862541dbdbc70e64ad9c941b769b99989f6bbba..ca3cb21f7b6dad6fd8fc53173c7fd5726b72d8d5 100644 (file)
@@ -5,8 +5,8 @@
 #include <stdlib.h>
 #include <getopt.h>
 
-#include <iptables.h>
-#include <linux/netfilter_ipv4/ipt_helper.h>
+#include <xtables.h>
+#include <linux/netfilter/xt_helper.h>
 
 /* Function which prints out usage message. */
 static void
@@ -32,7 +32,7 @@ parse(int c, char **argv, int invert, unsigned int *flags,
       unsigned int *nfcache,
       struct xt_entry_match **match)
 {
-       struct ipt_helper_info *info = (struct ipt_helper_info *)(*match)->data;
+       struct xt_helper_info *info = (struct xt_helper_info *)(*match)->data;
 
        switch (c) {
        case '1':
@@ -68,7 +68,7 @@ print(const void *ip,
       const struct xt_entry_match *match,
       int numeric)
 {
-       struct ipt_helper_info *info = (struct ipt_helper_info *)match->data;
+       struct xt_helper_info *info = (struct xt_helper_info *)match->data;
 
        printf("helper match %s\"%s\" ", info->invert ? "! " : "", info->name);
 }
@@ -77,24 +77,39 @@ print(const void *ip,
 static void
 save(const void *ip, const struct xt_entry_match *match)
 {
-       struct ipt_helper_info *info = (struct ipt_helper_info *)match->data;
+       struct xt_helper_info *info = (struct xt_helper_info *)match->data;
 
        printf("%s--helper \"%s\" ",info->invert ? "! " : "", info->name);
 }
 
-static struct iptables_match helper = { 
+static struct xtables_match helper = { 
+       .family         = AF_INET,
        .name           = "helper",
        .version        = IPTABLES_VERSION,
-       .size           = IPT_ALIGN(sizeof(struct ipt_helper_info)),
+       .size           = XT_ALIGN(sizeof(struct xt_helper_info)),
        .help           = &help,
        .parse          = &parse,
        .final_check    = &final_check,
        .print          = &print,
        .save           = &save,
-       .extra_opts     = opts
+       .extra_opts     = opts,
+};
+
+static struct xtables_match helper6 = { 
+       .family         = AF_INET6,
+       .name           = "helper",
+       .version        = IPTABLES_VERSION,
+       .size           = XT_ALIGN(sizeof(struct xt_helper_info)),
+       .help           = &help,
+       .parse          = &parse,
+       .final_check    = &final_check,
+       .print          = &print,
+       .save           = &save,
+       .extra_opts     = opts,
 };
 
 void _init(void)
 {
-       register_match(&helper);
+       xtables_register_match(&helper);
+       xtables_register_match(&helper6);
 }
diff --git a/include/linux/netfilter/xt_helper.h b/include/linux/netfilter/xt_helper.h
new file mode 100644 (file)
index 0000000..6b42763
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef _XT_HELPER_H
+#define _XT_HELPER_H
+
+struct xt_helper_info {
+       int invert;
+       char name[30];
+};
+#endif /* _XT_HELPER_H */
diff --git a/include/linux/netfilter_ipv4/ipt_helper.h b/include/linux/netfilter_ipv4/ipt_helper.h
deleted file mode 100644 (file)
index 6f12ecb..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef _IPT_HELPER_H
-#define _IPT_HELPER_H
-
-struct ipt_helper_info {
-       int invert;
-       char name[30];
-};
-#endif /* _IPT_HELPER_H */