From: Yasuyuki KOZAKAI Date: Tue, 24 Jul 2007 07:03:59 +0000 (+0000) Subject: Add IPv6 support to quota match X-Git-Tag: v1.4.0-rc1~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2bcb16047e048afd1457642fa7bc2aefc8d06d9d;p=thirdparty%2Fiptables.git Add IPv6 support to quota match --- diff --git a/extensions/.quota-test b/extensions/.quota-testx old mode 100755 new mode 100644 similarity index 100% rename from extensions/.quota-test rename to extensions/.quota-testx diff --git a/extensions/libipt_quota.c b/extensions/libxt_quota.c similarity index 80% rename from extensions/libipt_quota.c rename to extensions/libxt_quota.c index 89e5168c..a273b290 100644 --- a/extensions/libipt_quota.c +++ b/extensions/libxt_quota.c @@ -7,10 +7,9 @@ #include #include #include -#include +#include #include -#include static struct option opts[] = { {"quota", 1, 0, '1'}, @@ -47,7 +46,7 @@ parse_quota(const char *s, u_int64_t * quota) { *quota = strtoull(s, (char **) NULL, 10); -#ifdef DEBUG_IPT_QUOTA +#ifdef DEBUG_XT_QUOTA printf("Quota: %llu\n", *quota); #endif @@ -86,11 +85,27 @@ final_check(unsigned int flags) { } -struct iptables_match quota = { +struct xtables_match quota = { .next = NULL, + .family = AF_INET, .name = "quota", .version = IPTABLES_VERSION, - .size = IPT_ALIGN(sizeof (struct xt_quota_info)), + .size = XT_ALIGN(sizeof (struct xt_quota_info)), + .userspacesize = offsetof(struct xt_quota_info, quota), + .help = &help, + .parse = &parse, + .final_check = &final_check, + .print = &print, + .save = &save, + .extra_opts = opts +}; + +struct xtables_match quota6 = { + .next = NULL, + .family = AF_INET6, + .name = "quota", + .version = IPTABLES_VERSION, + .size = XT_ALIGN(sizeof (struct xt_quota_info)), .userspacesize = offsetof(struct xt_quota_info, quota), .help = &help, .parse = &parse, @@ -103,5 +118,6 @@ struct iptables_match quota = { void _init(void) { - register_match("a); + xtables_register_match("a); + xtables_register_match("a6); }