Skip to contentSkip to conversation

src/expr: add new nft_tee expression

RFC PATCH New Arturo Borrero Gonzalez 1 participant 1 message Feb 11, 2015 netfilter

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 src/expr: add new nft_tee expression

This patch gives support in libnftnl to the new nft_tee expression.

---
 include/libnftnl/expr.h             |    5 +
 include/linux/netfilter/nf_tables.h |   14 ++
 src/Makefile.am                     |    1 
 src/expr/tee.c                      |  280 +++++++++++++++++++++++++++++++++++
 4 files changed, 300 insertions(+)
 create mode 100644 src/expr/tee.c
include/libnftnl/expr.h +5 -0
index 9f25993..868a681 100644
@@ -167,6 +167,11 @@ enum {
 	NFT_EXPR_REDIR_FLAGS,
 };
 
+enum {
+	NFT_EXPR_TEE_GW			= NFT_RULE_EXPR_ATTR_BASE,
+	NFT_EXPR_TEE_OIF,
+};
+
 #ifdef __cplusplus
 } /* extern "C" */
 #endif
include/linux/netfilter/nf_tables.h +14 -0
index 832bc46..8dade0a 100644
@@ -856,6 +856,20 @@ enum nft_redir_attributes {
 #define NFTA_REDIR_MAX		(__NFTA_REDIR_MAX - 1)
 
 /**
+ * enum nft_tee_attributes - nf_tables tee expression netlink attributes
+ *
+ * @NFTA_TEE_GW: tee gateway (NLA_NESTED: nft_data_attributes)
+ * @NFTA_TEE_OIF: tee output interface name (NLA_STRING)
+ */
+enum nft_tee_attributes {
+	NFTA_TEE_UNSPEC,
+	NFTA_TEE_GW,
+	NFTA_TEE_OIF,
+	__NFTA_TEE_MAX
+};
+#define NFTA_TEE_MAX		(__NFTA_TEE_MAX - 1)
+
+/**
  * enum nft_gen_attributes - nf_tables ruleset generation attributes
  *
  * @NFTA_GEN_ID: Ruleset generation ID (NLA_U32)
src/Makefile.am +1 -0
index c77c3cc..c77bd49 100644
@@ -39,6 +39,7 @@ libnftnl_la_SOURCES = utils.c		\
 		      expr/target.c	\
 		      expr/masq.c	\
 		      expr/redir.c	\
+		      expr/tee.c	\
 		      expr/data_reg.h	\
 		      libnftnl.map	\
 		      expr_ops.h	\
src/expr/tee.c new file +280 -0

280 lines not on this page · raw message