From: Yasuyuki KOZAKAI Date: Sat, 4 Aug 2007 08:28:23 +0000 (+0000) Subject: Add IPv6 support to statistic match X-Git-Tag: v1.4.0-rc1~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfd78a8066857c56284a263623a4ffabd1021ce6;p=thirdparty%2Fiptables.git Add IPv6 support to statistic match --- diff --git a/extensions/.statistic-test b/extensions/.statistic-testx similarity index 100% rename from extensions/.statistic-test rename to extensions/.statistic-testx diff --git a/extensions/libipt_statistic.c b/extensions/libxt_statistic.c similarity index 89% rename from extensions/libipt_statistic.c rename to extensions/libxt_statistic.c index 21122591..6f88c45f 100644 --- a/extensions/libipt_statistic.c +++ b/extensions/libxt_statistic.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include 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); }