summaryrefslogtreecommitdiffstats
path: root/src/expr.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2020-12-12 20:17:31 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2020-12-17 15:38:41 +0100
commit373445dc54eda77fc7b64fddf5e7d35536df51b0 (patch)
tree5a053465d53ccd53375f45b863d1eed01ec2bfed /src/expr.c
parent3469f09286ceeb041dd74e4b145d26620f314587 (diff)
src: add NFTNL_EXPR_DYNSET_EXPRESSIONS
NFTNL_EXPR_DYNSET_EXPR defines the stateful expression type that an element stores when added from the packet path. This patch adds support for the set expression list, which generalizes NFTNL_EXPR_DYNSET_EXPR. This patch also adds nftnl_expr_add_expr() to add new expressions to elements and nftnl_set_expr_expr_foreach() to iterate over the list of expressions. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/expr.c b/src/expr.c
index ed2f60e..8e0bce2 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -42,6 +42,9 @@ struct nftnl_expr *nftnl_expr_alloc(const char *name)
expr->flags |= (1 << NFTNL_EXPR_NAME);
expr->ops = ops;
+ if (ops->init)
+ ops->init(expr);
+
return expr;
}