Commit 21eee97b authored by Marcin Siodelski's avatar Marcin Siodelski
Browse files

[3409] Pass whole context to the OptionDefListParser.

parent 6db44353
......@@ -413,8 +413,7 @@ DhcpConfigParser* createGlobalDhcp4ConfigParser(const std::string& config_id) {
globalContext(),
Dhcp4OptionDataParser::factory);
} else if (config_id.compare("option-def") == 0) {
parser = new OptionDefListParser(config_id,
globalContext()->option_defs_);
parser = new OptionDefListParser(config_id, globalContext());
} else if ((config_id.compare("version") == 0) ||
(config_id.compare("next-server") == 0)) {
parser = new StringParser(config_id,
......
......@@ -639,8 +639,7 @@ DhcpConfigParser* createGlobal6DhcpConfigParser(const std::string& config_id) {
globalContext(),
Dhcp6OptionDataParser::factory);
} else if (config_id.compare("option-def") == 0) {
parser = new OptionDefListParser(config_id,
globalContext()->option_defs_);
parser = new OptionDefListParser(config_id, globalContext());
} else if (config_id.compare("version") == 0) {
parser = new StringParser(config_id,
globalContext()->string_values_);
......
......@@ -817,10 +817,9 @@ OptionDefParser::createOptionDef(ConstElementPtr option_def_element) {
}
// ******************************** OptionDefListParser ************************
OptionDefListParser::
OptionDefListParser(const std::string&, OptionDefStoragePtr storage,
ParserContextPtr global_context)
: storage_(storage),
OptionDefListParser::OptionDefListParser(const std::string&,
ParserContextPtr global_context)
: storage_(global_context->option_defs_),
global_context_(global_context) {
if (!storage_) {
isc_throw(isc::dhcp::DhcpConfigError, "parser logic error:"
......
......@@ -752,12 +752,10 @@ public:
///
/// @param dummy first argument is ignored, all Parser constructors
/// accept string as first argument.
/// @param storage is the definition storage in which to store the parsed
/// definitions in this list
/// @param global_context is a pointer to the global context which
/// stores global scope parameters, options, option defintions.
/// @throw isc::dhcp::DhcpConfigError if storage is null.
OptionDefListParser(const std::string& dummy, OptionDefStoragePtr storage,
OptionDefListParser(const std::string& dummy,
ParserContextPtr global_context);
/// @brief Parse configuration entries.
......
......@@ -384,7 +384,6 @@ public:
} else if (config_id.compare("option-def") == 0) {
parser.reset(new OptionDefListParser(config_id,
parser_context_->option_defs_,
parser_context_));
} else if (config_id.compare("hooks-libraries") == 0) {
......
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