Commit 65be6022 authored by Francis Dupont's avatar Francis Dupont

[275-config-control-syntax-cleanup] Fixed config-control syntax

parent df5bfc6a
......@@ -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_);
}
......
......@@ -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)));
......
......@@ -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;
......
......@@ -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_);
}
......
......@@ -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)));
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment