]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Add IPv6 support to statistic match
authorYasuyuki KOZAKAI <yasuyuki@netfilter.org>
Sat, 4 Aug 2007 08:28:23 +0000 (08:28 +0000)
committerYasuyuki KOZAKAI <yasuyuki@netfilter.org>
Sat, 4 Aug 2007 08:28:23 +0000 (08:28 +0000)
extensions/.statistic-testx [moved from extensions/.statistic-test with 100% similarity]
extensions/libxt_statistic.c [moved from extensions/libipt_statistic.c with 89% similarity]

similarity index 89%
rename from extensions/libipt_statistic.c
rename to extensions/libxt_statistic.c
index 21122591b77ec2cb1fd9b692eb75f2ada8ecba05..6f88c45f6029a27a53f95770d2a4a14626225924 100644 (file)
@@ -5,7 +5,7 @@
 #include <stddef.h>
 #include <getopt.h>
 
-#include <iptables.h>
+#include <xtables.h>
 #include <linux/netfilter/xt_statistic.h>
 
 static void
@@ -165,10 +165,25 @@ save(const void *ip, const struct xt_entry_match *match)
        print_match(info, "--");
 }
 
-static struct iptables_match statistic = { 
+static struct xtables_match statistic = { 
+       .family         = AF_INET,
        .name           = "statistic",
        .version        = IPTABLES_VERSION,
-       .size           = IPT_ALIGN(sizeof(struct xt_statistic_info)),
+       .size           = XT_ALIGN(sizeof(struct xt_statistic_info)),
+       .userspacesize  = offsetof(struct xt_statistic_info, u.nth.count),
+       .help           = help,
+       .parse          = parse,
+       .final_check    = final_check,
+       .print          = print,
+       .save           = save,
+       .extra_opts     = opts
+};
+
+static struct xtables_match statistic6 = { 
+       .family         = AF_INET6,
+       .name           = "statistic",
+       .version        = IPTABLES_VERSION,
+       .size           = XT_ALIGN(sizeof(struct xt_statistic_info)),
        .userspacesize  = offsetof(struct xt_statistic_info, u.nth.count),
        .help           = help,
        .parse          = parse,
@@ -180,5 +195,6 @@ static struct iptables_match statistic = {
 
 void _init(void)
 {
-       register_match(&statistic);
+       xtables_register_match(&statistic);
+       xtables_register_match(&statistic6);
 }