diff options
Diffstat (limited to 'src/parser_bison.y')
-rw-r--r-- | src/parser_bison.y | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y index 6fc834d0..ea3ff526 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -913,6 +913,7 @@ chain_block : /* empty */ { $$ = $<chain>-1; } | chain_block common_block | chain_block stmt_seperator | chain_block hook_spec stmt_seperator + | chain_block policy_spec stmt_seperator | chain_block rule stmt_seperator { list_add_tail(&$2->list, &$1->rules); @@ -1070,6 +1071,26 @@ hook_spec : TYPE STRING HOOK STRING PRIORITY NUM } ; +policy_spec : POLICY ACCEPT + { + if ($<chain>0->policy != -1) { + erec_queue(error(&@$, "you cannot set chain policy twice"), + state->msgs); + YYERROR; + } + $<chain>0->policy = NF_ACCEPT; + } + | POLICY DROP + { + if ($<chain>0->policy != -1) { + erec_queue(error(&@$, "you cannot set chain policy twice"), + state->msgs); + YYERROR; + } + $<chain>0->policy = NF_DROP; + } + ; + identifier : STRING ; |