diff options
author | Patrick McHardy <kaber@trash.net> | 2015-04-11 15:41:32 +0100 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2015-04-12 19:59:27 +0100 |
commit | 48587aa855a5173b4b1e94290af885000dbd679e (patch) | |
tree | 246e4ae7553fba932c595f3b51285f23442ed7fe /src/parser_bison.y | |
parent | 0974fa84f162aecf16b4c252dcb438f7149856ab (diff) |
parser: add a time_spec rule
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'src/parser_bison.y')
-rw-r--r-- | src/parser_bison.y | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y index b86381d9..cd4e096a 100644 --- a/src/parser_bison.y +++ b/src/parser_bison.y @@ -396,6 +396,8 @@ static void location_update(struct location *loc, struct location *rhs, int n) %type <string> identifier string comment_spec %destructor { xfree($$); } identifier string comment_spec +%type <val> time_spec + %type <val> type_identifier %type <datatype> data_type @@ -1093,6 +1095,20 @@ string : STRING | QUOTED_STRING ; +time_spec : STRING + { + struct error_record *erec; + uint64_t res; + + erec = time_parse(&@1, $1, &res); + if (erec != NULL) { + erec_queue(erec, state->msgs); + YYERROR; + } + $$ = res; + } + ; + family_spec : /* empty */ { $$ = NFPROTO_IPV4; } | family_spec_explicit ; |