From d4f9a8fb9e9acc09b0726e19e7c8e5faaa959803 Mon Sep 17 00:00:00 2001 From: Laura Garcia Liebana Date: Sat, 22 Oct 2016 23:36:07 +0200 Subject: src: add offset attribute for numgen expression Add support to add an offset to the numgen generated value. Example: ct mark set numgen inc mod 2 offset 100 This will generate marks with serie like 100, 101, 100, ... Signed-off-by: Laura Garcia Liebana Signed-off-by: Pablo Neira Ayuso --- src/parser_bison.y | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/parser_bison.y') diff --git a/src/parser_bison.y b/src/parser_bison.y index f582221a..7377492b 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -2490,9 +2490,9 @@ numgen_type : INC { $$ = NFT_NG_INCREMENTAL; } | RANDOM { $$ = NFT_NG_RANDOM; } ; -numgen_expr : NUMGEN numgen_type MOD NUM +numgen_expr : NUMGEN numgen_type MOD NUM offset_opt { - $$ = numgen_expr_alloc(&@$, $2, $4); + $$ = numgen_expr_alloc(&@$, $2, $4, $5); } ; -- cgit v1.2.3