expr: add new nft_tee expression
Pablo Neira Ayuso
maintainerPATCH 1/1 expr: add new nft_tee expression
From: Arturo Borrero <[email protected]>
This patch gives support in libnftnl to the new nft_tee expression.
Signed-off-by Arturo Borrero Gonzalez <[email protected]>
--- include/libnftnl/expr.h | 5 + include/linux/netfilter/nf_tables.h | 14 +++ src/Makefile.am | 1 + src/expr/tee.c | 234 +++++++++++++++++++++++++++++++++++ src/expr_ops.c | 2 + 5 files changed, 256 insertions(+) create mode 100644 src/expr/tee.c
include/libnftnl/expr.h +5 -0
@@ -174,6 +174,11 @@ enum { NFT_EXPR_REDIR_FLAGS, }; +enum { +NFT_EXPR_TEE_SREG_GW =NFT_RULE_EXPR_ATTR_BASE , +NFT_EXPR_TEE_OIFNAME , +}; + #ifdef __cplusplus }/* extern "C" */ #endif
include/linux/netfilter/nf_tables.h +14 -0
@@ -950,6 +950,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_SREG_GW: source register of gateway address (NLA_NESTED: nft_data_attributes) +* @NFTA_TEE_OIFNAME: output interface name (NLA_STRING) +*/ +enum nft_tee_attributes { +NFTA_TEE_UNSPEC , +NFTA_TEE_SREG_GW , +NFTA_TEE_OIFNAME , + __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
@@ -41,4 +41,5 @@ libnftnl_la_SOURCES = utils.c \ expr/target.c \ expr/masq.c \ expr/redir.c \ + expr/tee.c \ libnftnl.map
src/expr/tee.c new file +234 -0
234 lines not on this page · raw message
src/expr_ops.c +2 -0
@@ -23,6 +23,7 @@ extern struct expr_ops expr_ops_redir;extern struct expr_ops expr_ops_reject;extern struct expr_ops expr_ops_queue;extern struct expr_ops expr_ops_target; +extern struct expr_ops expr_ops_tee;extern struct expr_ops expr_ops_dynset;static struct expr_ops *expr_ops[] = {
@@ -45,6 +46,7 @@ static struct expr_ops *expr_ops[] = { &expr_ops_reject, &expr_ops_queue, &expr_ops_target, + &expr_ops_tee, &expr_ops_dynset, NULL, };
Signature · 1 line
1.7.10.4