From 9bee0c86f1794c6c5418f256420758dc15d91f77 Mon Sep 17 00:00:00 2001 From: Laura Garcia Liebana Date: Fri, 4 Nov 2016 14:01:12 +0100 Subject: src: add offset attribute for hash expression Add support to add an offset to the hash generator, eg. ct mark set hash ip saddr mod 10 offset 100 This will generate marks with series between 100-109. Signed-off-by: Laura Garcia Liebana Signed-off-by: Pablo Neira Ayuso --- src/parser_bison.y | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/parser_bison.y') diff --git a/src/parser_bison.y b/src/parser_bison.y index 82fec99c..74f24a52 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -2580,14 +2580,14 @@ numgen_expr : NUMGEN numgen_type MOD NUM offset_opt } ; -hash_expr : JHASH expr MOD NUM SEED NUM +hash_expr : JHASH expr MOD NUM SEED NUM offset_opt { - $$ = hash_expr_alloc(&@$, $4, $6); + $$ = hash_expr_alloc(&@$, $4, $6, $7); $$->hash.expr = $2; } - | JHASH expr MOD NUM + | JHASH expr MOD NUM offset_opt { - $$ = hash_expr_alloc(&@$, $4, 0); + $$ = hash_expr_alloc(&@$, $4, 0, $5); $$->hash.expr = $2; } ; -- cgit v1.2.3