]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[275-config-control-syntax-cleanup] Fixed config-control syntax
authorFrancis Dupont <fdupont@isc.org>
Tue, 20 Nov 2018 13:28:58 +0000 (14:28 +0100)
committerFrancis Dupont <fdupont@isc.org>
Tue, 27 Nov 2018 13:39:22 +0000 (08:39 -0500)
src/bin/dhcp4/dhcp4_lexer.ll
src/bin/dhcp4/dhcp4_parser.yy
src/bin/dhcp4/parser_context.h
src/bin/dhcp6/dhcp6_lexer.ll
src/bin/dhcp6/dhcp6_parser.yy
src/bin/dhcp6/parser_context.h

index 314ca284aece6f8837fa0a8b4a8204474d5bbd71..46b3d41a051aa9655e23673bff1e4ca4e6996ead 100644 (file)
@@ -135,6 +135,8 @@ ControlCharacterFill            [^"\\]|\\{JSONEscapeSequence}
             return isc::dhcp::Dhcp4Parser::make_SUB_HOOKS_LIBRARY(driver.loc_);
         case Parser4Context::PARSER_DHCP_DDNS:
             return isc::dhcp::Dhcp4Parser::make_SUB_DHCP_DDNS(driver.loc_);
+        case Parser4Context::PARSER_CONFIG_CONTROL:
+            return isc::dhcp::Dhcp4Parser::make_SUB_CONFIG_CONTROL(driver.loc_);
         case Parser4Context::PARSER_LOGGING:
             return isc::dhcp::Dhcp4Parser::make_SUB_LOGGING(driver.loc_);
         }
index fe1f905fb5fb5f84244a755dba3763632b0f2f41..084182e71daf7ce09343bb9b3e76d431fe88bfe1 100644 (file)
@@ -2070,15 +2070,6 @@ control_agent_json_object: CONTROL_AGENT {
     ctx.leave();
 };
 
-config_control: LCURLY_BRACKET {
-    ElementPtr m(new MapElement(ctx.loc2pos(@1)));
-    ctx.stack_.back()->add(m);
-    ctx.stack_.push_back(m);
-} config_control_params RCURLY_BRACKET {
-    ctx.stack_.pop_back();
-};
-
-
 config_control: CONFIG_CONTROL {
     ElementPtr i(new MapElement(ctx.loc2pos(@1)));
     ctx.stack_.back()->set("config-control", i);
@@ -2101,13 +2092,12 @@ sub_config_control: LCURLY_BRACKET {
 
 // This defines that subnet can have one or more parameters.
 config_control_params: config_control_param
-              | config_control_params COMMA config_control_param
-              ;
+                     | config_control_params COMMA config_control_param
+                     ;
 
 // This defines a list of allowed parameters for each subnet.
 config_control_param: config_databases
-            | unknown_map_entry
-            ;
+                    ;
 
 config_databases: CONFIG_DATABASES {
     ElementPtr l(new ListElement(ctx.loc2pos(@1)));
index a9a35ea2c2ca8d8a9ca9beb8a611d1c4302ddbfc..ae95f02c072fc2f376a678f06a8ed02414f0ccd8 100644 (file)
@@ -88,6 +88,9 @@ public:
         /// This will parse the input as dhcp-ddns.
         PARSER_DHCP_DDNS,
 
+        /// This will parse the input as config-control.
+        PARSER_CONFIG_CONTROL,
+
         /// This will parse the content of Logging.
         PARSER_LOGGING
     } ParserType;
index 0cb1a73fdba14f50c8167e1ee40200a9101d0ccb..4347991bde326d75f62a55cb786c55cf18c32a11 100644 (file)
@@ -137,6 +137,8 @@ ControlCharacterFill            [^"\\]|\\{JSONEscapeSequence}
             return isc::dhcp::Dhcp6Parser::make_SUB_HOOKS_LIBRARY(driver.loc_);
         case Parser6Context::PARSER_DHCP_DDNS:
             return isc::dhcp::Dhcp6Parser::make_SUB_DHCP_DDNS(driver.loc_);
+        case Parser6Context::PARSER_CONFIG_CONTROL:
+            return isc::dhcp::Dhcp6Parser::make_SUB_CONFIG_CONTROL(driver.loc_);
         case Parser6Context::PARSER_LOGGING:
             return isc::dhcp::Dhcp6Parser::make_SUB_LOGGING(driver.loc_);
         }
index d29a2975d4d74e8f4425746738d112e878f1ebee..71253663eceeeda409653ebbef3531d323fd235e 100644 (file)
@@ -2162,15 +2162,6 @@ control_agent_json_object: CONTROL_AGENT {
 
 // Config control information element
 
-config_control: LCURLY_BRACKET {
-    ElementPtr m(new MapElement(ctx.loc2pos(@1)));
-    ctx.stack_.back()->add(m);
-    ctx.stack_.push_back(m);
-} config_control_params RCURLY_BRACKET {
-    ctx.stack_.pop_back();
-};
-
-
 config_control: CONFIG_CONTROL {
     ElementPtr i(new MapElement(ctx.loc2pos(@1)));
     ctx.stack_.back()->set("config-control", i);
@@ -2193,13 +2184,12 @@ sub_config_control: LCURLY_BRACKET {
 
 // This defines that subnet can have one or more parameters.
 config_control_params: config_control_param
-              | config_control_params COMMA config_control_param
-              ;
+                     | config_control_params COMMA config_control_param
+                     ;
 
 // This defines a list of allowed parameters for each subnet.
 config_control_param: config_databases
-            | unknown_map_entry
-            ;
+                    ;
 
 config_databases: CONFIG_DATABASES {
     ElementPtr l(new ListElement(ctx.loc2pos(@1)));
index 9cec79b29ab0dd38f4c7ab2bf885b0046722c7f9..aea40cc28b7fc56e6aee3b616ad5c7d6099e58ba 100644 (file)
@@ -91,6 +91,9 @@ public:
         /// This will parse the input as dhcp-ddns. (D2 client config)
         PARSER_DHCP_DDNS,
 
+        /// This will parse the input as config-control.
+        PARSER_CONFIG_CONTROL,
+
         /// This will parse the content of Logging.
         PARSER_LOGGING