diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-11-27 23:34:57 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2017-01-03 14:21:53 +0100 |
commit | b139f738f558d6afb8c8f3e73526f578b059abd6 (patch) | |
tree | 2d1b575ee0058f988b43bb43970ab13162a87da0 /include/statement.h | |
parent | 0eaedf58acad4214dd827515c56b9da26ab9e9e3 (diff) |
src: add stateful object reference expression
This patch adds a new objref statement to refer to existing stateful
objects from rules, eg.
# nft add rule filter input counter name test counter
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/statement.h')
-rw-r--r-- | include/statement.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/statement.h b/include/statement.h index 9d0f601f..8f874c88 100644 --- a/include/statement.h +++ b/include/statement.h @@ -10,6 +10,13 @@ extern struct stmt *expr_stmt_alloc(const struct location *loc, extern struct stmt *verdict_stmt_alloc(const struct location *loc, struct expr *expr); +struct objref_stmt { + uint32_t type; + struct expr *expr; +}; + +struct stmt *objref_stmt_alloc(const struct location *loc); + struct counter_stmt { uint64_t packets; uint64_t bytes; @@ -212,6 +219,7 @@ extern struct stmt *xt_stmt_alloc(const struct location *loc); * @STMT_XT: XT statement * @STMT_QUOTA: quota statement * @STMT_NOTRACK: notrack statement + * @STMT_OBJREF: stateful object reference statement */ enum stmt_types { STMT_INVALID, @@ -235,6 +243,7 @@ enum stmt_types { STMT_XT, STMT_QUOTA, STMT_NOTRACK, + STMT_OBJREF, }; /** @@ -292,6 +301,7 @@ struct stmt { struct dup_stmt dup; struct fwd_stmt fwd; struct xt_stmt xt; + struct objref_stmt objref; }; }; |