path: root/iptables/xshared.h
diff options
authorPhil Sutter <>2020-11-16 17:20:57 +0100
committerPhil Sutter <>2021-05-17 15:07:02 +0200
commit9dc50b5b8e4416219c700331c6e301d840f6e55d (patch)
tree44d2ae242c7a2659200cfd5330e0f492e0517d0f /iptables/xshared.h
parent3664249f520308e8d9ce6238374f08ac96aedbb6 (diff)
xshared: Merge invflags handling code
Join invflags handling between iptables, ip6tables, xtables and arptables. Ebtables still has its own code which differs quite a bit. In order to use a shared set_option() routine, iptables and ip6tables need to provide a local 'invflags' variable which is 16bits wide. Signed-off-by: Phil Sutter <>
Diffstat (limited to 'iptables/xshared.h')
1 files changed, 11 insertions, 0 deletions
diff --git a/iptables/xshared.h b/iptables/xshared.h
index af2a5adb..dace221b 100644
--- a/iptables/xshared.h
+++ b/iptables/xshared.h
@@ -68,6 +68,17 @@ struct xtables_globals;
struct xtables_rule_match;
struct xtables_target;
+/* define invflags which won't collide with IPT ones */
+#define IPT_INV_SRCDEVADDR 0x0080
+#define IPT_INV_TGTDEVADDR 0x0100
+#define IPT_INV_ARPHLN 0x0200
+#define IPT_INV_ARPOP 0x0400
+#define IPT_INV_ARPHRD 0x0800
+set_option(unsigned int *options, unsigned int option, u_int16_t *invflg,
+ bool invert);
* xtables_afinfo - protocol family dependent information
* @kmod: kernel module basename (e.g. "ip_tables")