From: Patrick McHardy Date: Sat, 11 Apr 2015 14:41:32 +0000 (+0100) Subject: parser: add a time_spec rule X-Git-Tag: v0.5~50^2~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48587aa855a5173b4b1e94290af885000dbd679e;p=thirdparty%2Fnftables.git parser: add a time_spec rule Signed-off-by: Patrick McHardy --- 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 ;