summaryrefslogtreecommitdiffstats
path: root/src/bin/dhcp6/dhcp6_parser.yy
diff options
context:
space:
mode:
authorAndrei Pavel <andrei@isc.org>2021-05-14 13:39:30 +0200
committerAndrei Pavel <andrei@isc.org>2021-05-19 14:59:02 +0200
commit2872ae70f9b581c895f4b94d7927b112add1175a (patch)
tree4612c50d77c69f7181aa9b550f58fb6b50532b7e /src/bin/dhcp6/dhcp6_parser.yy
parent[#1818] added more checks in unittests (diff)
downloadkea-2872ae70f9b581c895f4b94d7927b112add1175a.tar.xz
kea-2872ae70f9b581c895f4b94d7927b112add1175a.zip
[#1860] add "compatibility" parameter to parsers
and "lenient-option-parsing"
Diffstat (limited to 'src/bin/dhcp6/dhcp6_parser.yy')
-rw-r--r--src/bin/dhcp6/dhcp6_parser.yy29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/bin/dhcp6/dhcp6_parser.yy b/src/bin/dhcp6/dhcp6_parser.yy
index 18cfc9b343..555eed87e7 100644
--- a/src/bin/dhcp6/dhcp6_parser.yy
+++ b/src/bin/dhcp6/dhcp6_parser.yy
@@ -253,6 +253,9 @@ using namespace std;
MAXVER "maxver"
PATTERN "pattern"
+ COMPATIBILITY "compatibility"
+ LENIENT_OPTION_PARSING "lenient-option-parsing"
+
// Not real tokens, just a way to signal what the parser is expected to
// parse.
TOPLEVEL_JSON
@@ -524,6 +527,7 @@ global_param: data_directory
| statistic_default_sample_age
| dhcp_multi_threading
| ip_reservations_unique
+ | compatibility
| unknown_map_entry
;
@@ -2818,6 +2822,31 @@ pattern: PATTERN {
ctx.leave();
};
+compatibility: COMPATIBILITY {
+ ctx.unique("compatibility", ctx.loc2pos(@1));
+ ElementPtr i(new MapElement(ctx.loc2pos(@1)));
+ ctx.stack_.back()->set("compatibility", i);
+ ctx.stack_.push_back(i);
+ ctx.enter(ctx.COMPATIBILITY);
+} COLON LCURLY_BRACKET compatibility_params RCURLY_BRACKET {
+ ctx.stack_.pop_back();
+ ctx.leave();
+};
+
+compatibility_params: compatibility_param
+ | compatibility_params COMMA compatibility_param
+ ;
+
+compatibility_param: lenient_option_parsing
+ | unknown_map_entry
+ ;
+
+lenient_option_parsing: LENIENT_OPTION_PARSING COLON BOOLEAN {
+ ctx.unique("lenient-option-parsing", ctx.loc2pos(@1));
+ ElementPtr b(new BoolElement($3, ctx.loc2pos(@3)));
+ ctx.stack_.back()->set("lenient-option-parsing", b);
+};
+
%%
void