diff options
author | /C=JP/ST=JP/CN=Yasuyuki Kozakai/emailAddress=yasuyuki@netfilter.org </C=JP/ST=JP/CN=Yasuyuki Kozakai/emailAddress=yasuyuki@netfilter.org> | 2007-07-24 07:03:59 +0000 |
---|---|---|
committer | /C=JP/ST=JP/CN=Yasuyuki Kozakai/emailAddress=yasuyuki@netfilter.org </C=JP/ST=JP/CN=Yasuyuki Kozakai/emailAddress=yasuyuki@netfilter.org> | 2007-07-24 07:03:59 +0000 |
commit | ad0bed59f2b059edcae4af8cd1b3a1ba46523175 (patch) | |
tree | 0f867e3ee7f6820cb322cbde3ed58fb600d94169 | |
parent | d23b1db6a50de02725a4091ab55c1223c7878db8 (diff) |
Add IPv6 support to quota match
-rw-r--r--[-rwxr-xr-x] | extensions/.quota-testx (renamed from extensions/.quota-test) | 0 | ||||
-rw-r--r-- | extensions/libxt_quota.c (renamed from extensions/libipt_quota.c) | 28 |
2 files changed, 22 insertions, 6 deletions
diff --git a/extensions/.quota-test b/extensions/.quota-testx index b21058c..b21058c 100755..100644 --- a/extensions/.quota-test +++ b/extensions/.quota-testx diff --git a/extensions/libipt_quota.c b/extensions/libxt_quota.c index 89e5168..a273b29 100644 --- a/extensions/libipt_quota.c +++ b/extensions/libxt_quota.c @@ -7,10 +7,9 @@ #include <stdio.h> #include <stdlib.h> #include <getopt.h> -#include <iptables.h> +#include <xtables.h> #include <linux/netfilter/xt_quota.h> -#include <linux/netfilter_ipv4/ip_tables.h> 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); } |