expr: add last match time support
Pablo Neira Ayuso
maintainerPATCH 1/2 expr: add last match time support
This new expression displays when last matching has happened.
Signed-off-by Pablo Neira Ayuso <[email protected]>
---
Already applied, I accidentally pushed it out, just for the record.
include/libnftnl/expr.h | 4 ++ src/Makefile.am | 1 + src/expr/last.c | 118 ++++++++++++++++++++++++++++++++++++++++ src/expr_ops.c | 2 + 4 files changed, 125 insertions(+) create mode 100644 src/expr/last.c
include/libnftnl/expr.h +4 -0
@@ -311,6 +311,10 @@ enum { NFTNL_EXPR_SYNPROXY_FLAGS, }; +enum { +NFTNL_EXPR_LAST_MSECS =NFTNL_EXPR_BASE , +}; + #ifdef __cplusplus }/* extern "C" */ #endif
src/Makefile.am +1 -0
@@ -34,6 +34,7 @@ libnftnl_la_SOURCES = utils.c \ expr/flow_offload.c \ expr/fib.c \ expr/fwd.c \ + expr/last.c \ expr/limit.c \ expr/log.c \ expr/lookup.c \
src/expr/last.c new file +118 -0
118 lines not on this page · raw message
src/expr_ops.c +2 -0
@@ -14,6 +14,7 @@ extern struct expr_ops expr_ops_dup;extern struct expr_ops expr_ops_exthdr;extern struct expr_ops expr_ops_fwd;extern struct expr_ops expr_ops_immediate; +extern struct expr_ops expr_ops_last;extern struct expr_ops expr_ops_limit;extern struct expr_ops expr_ops_log;extern struct expr_ops expr_ops_lookup;
@@ -57,6 +58,7 @@ static struct expr_ops *expr_ops[] = { &expr_ops_exthdr, &expr_ops_fwd, &expr_ops_immediate, + &expr_ops_last, &expr_ops_limit, &expr_ops_log, &expr_ops_lookup,
Signature · 1 line
2.30.2
Pablo Neira Ayuso
maintainerPATCH 2/2 expr: missing netlink attribute in last expression
NFTA_LAST_SET is missing, add it.
Fixes ed7c442c2d04 ("expr: add last match time support")
Signed-off-by Pablo Neira Ayuso <[email protected]>
---
Already applied, I accidentally pushed it out, just for the record.
include/linux/netfilter/nf_tables.h | 2 ++ 1 file changed, 2 insertions(+)
include/linux/netfilter/nf_tables.h +2 -0
@@ -1198,10 +1198,12 @@ enum nft_counter_attributes {/** * enum nft_last_attributes - nf_tables last expression netlink attributes * +* @NFTA_LAST_SET: last update has been set, zero means never updated (NLA_U32) * @NFTA_LAST_MSECS: milliseconds since last update (NLA_U64) */ enum nft_last_attributes {NFTA_LAST_UNSPEC , +NFTA_LAST_SET ,NFTA_LAST_MSECS ,NFTA_LAST_PAD , __NFTA_LAST_MAX
Signature · 1 line
2.30.2