From 089aa91d6a4a382775d6077c842492ed3d54be60 Mon Sep 17 00:00:00 2001 From: Arturo Borrero Gonzalez Date: Wed, 20 Jan 2021 14:04:14 +0100 Subject: conntrackd: introduce yes & no config values They are equivalent of 'on' and 'off' and makes the config easier to understand. Signed-off-by: Arturo Borrero Gonzalez --- src/read_config_lex.l | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/read_config_lex.l b/src/read_config_lex.l index b0d9e61..f1f4fe3 100644 --- a/src/read_config_lex.l +++ b/src/read_config_lex.l @@ -35,6 +35,10 @@ nl [\n\r] is_on [o|O][n|N] is_off [o|O][f|F][f|F] +is_yes [y|Y][e|E][s|S] +is_no [n|N][o|O] +is_true {is_on}|{is_yes} +is_false {is_off}|{is_no} integer [0-9]+ signed_integer [\-\+][0-9]+ path \/[^\"\n ]* @@ -138,8 +142,8 @@ notrack [N|n][O|o][T|t][R|r][A|a][C|c][K|k] "Systemd" { return T_SYSTEMD; } "StartupResync" { return T_STARTUP_RESYNC; } -{is_on} { return T_ON; } -{is_off} { return T_OFF; } +{is_true} { return T_ON; } +{is_false} { return T_OFF; } {integer} { yylval.val = atoi(yytext); return T_NUMBER; } {signed_integer} { yylval.val = atoi(yytext); return T_SIGNED_NUMBER; } {ip4} { yylval.string = strdup(yytext); return T_IP; } -- cgit v1.2.3