summaryrefslogtreecommitdiffstats
path: root/src/bin/dhcp4
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2022-10-16 00:54:30 +0200
committerFrancis Dupont <fdupont@isc.org>2022-10-18 22:59:06 +0200
commitdac2c8d64dcbeb7b028b8fdb3eb2f48712f3fd40 (patch)
tree66e5dd71425615b390ef82b7cd79ab7cc54012dc /src/bin/dhcp4
parent[#2585] Wrote createFromString tool (diff)
downloadkea-dac2c8d64dcbeb7b028b8fdb3eb2f48712f3fd40.tar.xz
kea-dac2c8d64dcbeb7b028b8fdb3eb2f48712f3fd40.zip
[#2595] Checkpoint: updated parsers
Diffstat (limited to 'src/bin/dhcp4')
-rw-r--r--src/bin/dhcp4/dhcp4_lexer.ll9
-rw-r--r--src/bin/dhcp4/dhcp4_parser.yy23
2 files changed, 31 insertions, 1 deletions
diff --git a/src/bin/dhcp4/dhcp4_lexer.ll b/src/bin/dhcp4/dhcp4_lexer.ll
index 1e8ab8b611..1114f673eb 100644
--- a/src/bin/dhcp4/dhcp4_lexer.ll
+++ b/src/bin/dhcp4/dhcp4_lexer.ll
@@ -222,6 +222,15 @@ ControlCharacterFill [^"\\]|\\["\\/bfnrtu]
}
}
+\"extended-info-checks\" {
+ switch(driver.ctx_) {
+ case isc::dhcp::Parser4Context::SANITY_CHECKS:
+ return isc::dhcp::Dhcp4Parser::make_EXTENDED_INFO_CHECKS(driver.loc_);
+ default:
+ return isc::dhcp::Dhcp4Parser::make_STRING("extended-info-checks", driver.loc_);
+ }
+}
+
\"dhcp-socket-type\" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::INTERFACES_CONFIG:
diff --git a/src/bin/dhcp4/dhcp4_parser.yy b/src/bin/dhcp4/dhcp4_parser.yy
index 07b4ece0de..0ad1f5ee1e 100644
--- a/src/bin/dhcp4/dhcp4_parser.yy
+++ b/src/bin/dhcp4/dhcp4_parser.yy
@@ -70,6 +70,7 @@ using namespace std;
SANITY_CHECKS "sanity-checks"
LEASE_CHECKS "lease-checks"
+ EXTENDED_INFO_CHECKS "extended-info-checks"
ECHO_CLIENT_ID "echo-client-id"
MATCH_CLIENT_ID "match-client-id"
@@ -906,7 +907,9 @@ sanity_checks_params: sanity_checks_param
}
;
-sanity_checks_param: lease_checks;
+sanity_checks_param: lease_checks
+ | extended_info_checks
+ ;
lease_checks: LEASE_CHECKS {
ctx.unique("lease-checks", ctx.loc2pos(@1));
@@ -927,6 +930,24 @@ lease_checks: LEASE_CHECKS {
}
}
+extended_info_checks: EXTENDED_INFO_CHECKS {
+ ctx.unique("extended-info-checks", ctx.loc2pos(@1));
+ ctx.enter(ctx.NO_KEYWORD);
+} COLON STRING {
+
+ if ( (string($4) == "none") ||
+ (string($4) == "fix") ||
+ (string($4) == "strict") ||
+ (string($4) == "pedantic")) {
+ ElementPtr user(new StringElement($4, ctx.loc2pos(@4)));
+ ctx.stack_.back()->set("extended-info-checks", user);
+ ctx.leave();
+ } else {
+ error(@4, "Unsupported 'extended-info-checks value: " + string($4) +
+ ", supported values are: none, fix, strict, pedantic");
+ }
+}
+
hosts_database: HOSTS_DATABASE {
ctx.unique("hosts-database", ctx.loc2pos(@1));
ElementPtr i(new MapElement(ctx.loc2pos(@1)));