netfilter: nf_tables: add vlan support
Subsystems (2)
PATCH v2 1/1 netfilter: nf_tables: add vlan support
From: wenxu <[email protected]>
This patch implements the vlan expr type that can be used to configure vlan tci and vlan proto
Signed-off-by wenxu <[email protected]>
--- include/uapi/linux/netfilter/nf_tables.h | 24 +++++ net/netfilter/Kconfig | 6 ++ net/netfilter/Makefile | 1 + net/netfilter/nft_vlan.c | 161 +++++++++++++++++++++++++++++++ 4 files changed, 192 insertions(+) create mode 100644 net/netfilter/nft_vlan.c
include/uapi/linux/netfilter/nf_tables.h +24 -0
@@ -1794,4 +1794,28 @@ enum nft_tunnel_attributes { };#define NFTA_TUNNEL_MAX (__NFTA_TUNNEL_MAX - 1) +enum nft_vlan_action { +NFT_VLAN_ACTION_PUSH , +NFT_VLAN_ACTION_POP , +NFT_VLAN_ACTION_MODIFY , + __NFT_VLAN_ACTION_MAX +}; +#define NFT_VLAN_ACTION_MAX (__NFT_VLAN_ACTION_MAX - 1) + +/** +* enum nft_vlan_attributes - nf_tables vlan expression netlink attributes +* +* @NFTA_VLAN_ACTION: vlan data item to load (NLA_U32: nft_vlan_action) +* @NFTA_VLAN_SREG: source register (NLA_U16) +* @NFTA_VLAN_SREG2: source register (NLA_U16) +*/ +enum nft_vlan_attributes { +NFTA_VLAN_UNSPEC , +NFTA_VLAN_ACTION , +NFTA_VLAN_SREG , +NFTA_VLAN_SREG2 , + __NFTA_VLAN_MAX +}; +#define NFTA_VLAN_MAX (__NFTA_VLAN_MAX - 1) +#endif /* _LINUX_NF_TABLES_H */
net/netfilter/Kconfig +6 -0
@@ -556,6 +556,12 @@ config NFT_TUNNEL This option adds the "tunnel" expression that you can use to set tunneling policies. +config NFT_VLAN + tristate "Netfilter nf_tables vlan module" + help + This option adds the "vlan" expression that you can use to set + vlan policies. + config NFT_OBJREF tristate "Netfilter nf_tables stateful object reference module" help
net/netfilter/Makefile +1 -0
@@ -111,6 +111,7 @@ obj-$(CONFIG_NFT_OSF) += nft_osf.o obj-$(CONFIG_NFT_TPROXY) += nft_tproxy.o obj-$(CONFIG_NFT_XFRM) += nft_xfrm.o obj-$(CONFIG_NFT_SYNPROXY) += nft_synproxy.o +obj-$(CONFIG_NFT_VLAN) += nft_vlan.o obj-$(CONFIG_NFT_NAT) += nft_chain_nat.o
net/netfilter/nft_vlan.c new file +161 -0
161 lines not on this page · raw message
Signature · 1 line
1.8.3.1
Quoted 4 lines · [email protected] <[email protected]> wrote:
From: wenxu <[email protected]>
This patch implements the vlan expr type that can be used to configure vlan tci and vlan proto
Acked-by Florian Westphal <[email protected]>