From 48587aa855a5173b4b1e94290af885000dbd679e Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Sat, 11 Apr 2015 15:41:32 +0100 Subject: parser: add a time_spec rule Signed-off-by: Patrick McHardy --- src/parser_bison.y | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 identifier string comment_spec %destructor { xfree($$); } identifier string comment_spec +%type time_spec + %type type_identifier %type 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 ; -- cgit v1.2.3