diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-10-27 22:11:40 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-10-27 22:12:49 +0200 |
commit | 986aa0a5aea34ebb17a3abc03f01cc232a90ebd1 (patch) | |
tree | 8f6b854b3eda2e7d687f4a30af19a2622fa3b5bc /src/parser_bison.y | |
parent | 8d5c5a0de3fa62588985fbb7241821d583f01e2c (diff) |
parser: add offset keyword and parser rule
This is required by the numgen and jhash expressions.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/parser_bison.y')
-rw-r--r-- | src/parser_bison.y | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y index 7377492b..35504de1 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -410,6 +410,7 @@ static void location_update(struct location *loc, struct location *rhs, int n) %token NUMGEN "numgen" %token INC "inc" %token MOD "mod" +%token OFFSET "offset" %token JHASH "jhash" %token SEED "seed" @@ -482,7 +483,7 @@ static void location_update(struct location *loc, struct location *rhs, int n) %destructor { stmt_free($$); } reject_stmt reject_stmt_alloc %type <stmt> nat_stmt nat_stmt_alloc masq_stmt masq_stmt_alloc redir_stmt redir_stmt_alloc %destructor { stmt_free($$); } nat_stmt nat_stmt_alloc masq_stmt masq_stmt_alloc redir_stmt redir_stmt_alloc -%type <val> nf_nat_flags nf_nat_flag +%type <val> nf_nat_flags nf_nat_flag offset_opt %type <stmt> queue_stmt queue_stmt_alloc %destructor { stmt_free($$); } queue_stmt queue_stmt_alloc %type <val> queue_stmt_flags queue_stmt_flag @@ -2486,6 +2487,10 @@ meta_stmt : META meta_key SET expr } ; +offset_opt : /* empty */ { $$ = 0; } + | OFFSET NUM { $$ = $2; } + ; + numgen_type : INC { $$ = NFT_NG_INCREMENTAL; } | RANDOM { $$ = NFT_NG_RANDOM; } ; |