Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
21eee97b
Commit
21eee97b
authored
Apr 25, 2014
by
Marcin Siodelski
Browse files
[3409] Pass whole context to the OptionDefListParser.
parent
6db44353
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/bin/dhcp4/config_parser.cc
View file @
21eee97b
...
...
@@ -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
,
...
...
src/bin/dhcp6/config_parser.cc
View file @
21eee97b
...
...
@@ -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_
);
...
...
src/lib/dhcpsrv/dhcp_parsers.cc
View file @
21eee97b
...
...
@@ -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:"
...
...
src/lib/dhcpsrv/dhcp_parsers.h
View file @
21eee97b
...
...
@@ -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.
...
...
src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc
View file @
21eee97b
...
...
@@ -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
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment