summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorArturo Borrero Gonzalez <arturo@netfilter.org>2021-01-20 14:04:14 +0100
committerArturo Borrero Gonzalez <arturo@netfilter.org>2021-02-01 11:29:25 +0100
commit089aa91d6a4a382775d6077c842492ed3d54be60 (patch)
tree6f17597503e73830eab768e08547a39ed4697f47 /src
parent3132697b9a0f6ce9574f52e56b0f2a13624e5aa7 (diff)
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 <arturo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r--src/read_config_lex.l8
1 files changed, 6 insertions, 2 deletions
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; }