aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJP Abgrall <jpa@google.com>2011-06-21 11:14:49 -0700
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2021-10-13 03:37:34 +0200
commit5cf594eea3eb18d8113284ebdd44f33e1ba9fde6 (patch)
tree4abcd2c84d4e53fc4d46bf31af41f286d52ecf0f /include
parentd74d01466a468d5f814be24ad989eff2ead2f3b9 (diff)
downloadkernel_replicant_linux-5cf594eea3eb18d8113284ebdd44f33e1ba9fde6.tar.gz
kernel_replicant_linux-5cf594eea3eb18d8113284ebdd44f33e1ba9fde6.tar.bz2
kernel_replicant_linux-5cf594eea3eb18d8113284ebdd44f33e1ba9fde6.zip
ANDROID: netfilter: xt_quota2: add quota2 from xtables-addons
xt_quota in the kernel is plain broken: - counts quota at a per CPU level (was written back when ubiquitous SMP was just a dream) - provides no way to count across IPV4/IPV6. Therefore this patch adds xt_quota2, derived from "extensions/xt_quota2.c" from xtables-addons (https://sourceforge.net/projects/xtables-addons) at commit e84391ce665cef046967f796dd91026851d6bbf3. Bug: 120445421 Change-Id: I19d49858840effee9ecf6cff03c23b45a97efdeb Signed-off-by: JP Abgrall <jpa@google.com> [adelva: Folded 4d33aa305871 ("netfilter: xt_quota2: fixup the quota2, and enable.") into this patch] Signed-off-by: Alistair Delva <adelva@google.com> [maennich: Folded eab894210465 ("ANDROID: fix kernelci build-break") into this patch] Signed-off-by: Matthias Maennich <maennich@google.com> [ebiggers: Folded in the following commits: 8a35207f24f0 ("ANDROID: fix up xt_quota2 for proc_ops changes") 91e5e077d8df ("ANDROID: move up spin_unlock_bh() ahead of remove_proc_entry()"). b20eacd8ddbd ("ANDROID: fix a bug in quota2") Also updated the commit message.] Signed-off-by: Eric Biggers <ebiggers@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/netfilter/xt_quota2.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/netfilter/xt_quota2.h b/include/linux/netfilter/xt_quota2.h
new file mode 100644
index 000000000000..a3918718cbf8
--- /dev/null
+++ b/include/linux/netfilter/xt_quota2.h
@@ -0,0 +1,26 @@
+#ifndef _XT_QUOTA_H
+#define _XT_QUOTA_H
+#include <linux/types.h>
+
+enum xt_quota_flags {
+ XT_QUOTA_INVERT = 1 << 0,
+ XT_QUOTA_GROW = 1 << 1,
+ XT_QUOTA_PACKET = 1 << 2,
+ XT_QUOTA_NO_CHANGE = 1 << 3,
+ XT_QUOTA_MASK = 0x0F,
+};
+
+struct xt_quota_counter;
+
+struct xt_quota_mtinfo2 {
+ char name[15];
+ u_int8_t flags;
+
+ /* Comparison-invariant */
+ aligned_u64 quota;
+
+ /* Used internally by the kernel */
+ struct xt_quota_counter *master __attribute__((aligned(8)));
+};
+
+#endif /* _XT_QUOTA_H */