summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYasuyuki KOZAKAI <yasuyuki@netfilter.org>2007-07-24 07:03:59 +0000
committerYasuyuki KOZAKAI <yasuyuki@netfilter.org>2007-07-24 07:03:59 +0000
commit2bcb16047e048afd1457642fa7bc2aefc8d06d9d (patch)
tree0f867e3ee7f6820cb322cbde3ed58fb600d94169
parent19f29509c8a97219c578aeaf8be15cf005d46eb3 (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 b21058c5..b21058c5 100755..100644
--- a/extensions/.quota-test
+++ b/extensions/.quota-testx
diff --git a/extensions/libipt_quota.c b/extensions/libxt_quota.c
index 89e5168c..a273b290 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(&quota);
+ xtables_register_match(&quota);
+ xtables_register_match(&quota6);
}