summaryrefslogtreecommitdiffstats
path: root/src/parser_bison.y
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2020-03-17 14:50:38 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2020-03-20 13:13:40 +0100
commit6d80e0f154920b5d26aa764459ec0450a8a12b58 (patch)
tree97627d1a1935f051b83b8cb11751c92769261456 /src/parser_bison.y
parent6c84577b0d23d1f3fdafb4d74fd5868e891cc6af (diff)
src: support for counter in set definition
This patch allows you to turn on counter for each element in the set. table ip x { set y { typeof ip saddr counter elements = { 192.168.10.35, 192.168.10.101, 192.168.10.135 } } chain z { type filter hook output priority filter; policy accept; ip daddr @y } } This example shows how to turn on counters globally in the set 'y'. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/parser_bison.y')
-rw-r--r--src/parser_bison.y5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y
index 3d65d208..e14118ca 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -1733,6 +1733,11 @@ set_block : /* empty */ { $$ = $<set>-1; }
$1->gc_int = $3;
$$ = $1;
}
+ | set_block COUNTER stmt_separator
+ {
+ $1->stmt = counter_stmt_alloc(&@$);
+ $$ = $1;
+ }
| set_block ELEMENTS '=' set_block_expr
{
$1->init = $4;