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
Sebastian Schrader
Kea
Commits
dc69d955
Commit
dc69d955
authored
Apr 28, 2014
by
Marcin Siodelski
Browse files
[3409] Append line number to error caused by undefined global parameter.
parent
5c31704c
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/bin/dhcp4/config_parser.cc
View file @
dc69d955
...
...
@@ -414,7 +414,8 @@ namespace dhcp {
/// @return parser for specified global DHCPv4 parameter
/// @throw NotImplemented if trying to create a parser for unknown
/// config element
DhcpConfigParser
*
createGlobalDhcp4ConfigParser
(
const
std
::
string
&
config_id
)
{
DhcpConfigParser
*
createGlobalDhcp4ConfigParser
(
const
std
::
string
&
config_id
,
ConstElementPtr
element
)
{
DhcpConfigParser
*
parser
=
NULL
;
if
((
config_id
.
compare
(
"valid-lifetime"
)
==
0
)
||
(
config_id
.
compare
(
"renew-timer"
)
==
0
)
||
...
...
@@ -445,9 +446,9 @@ DhcpConfigParser* createGlobalDhcp4ConfigParser(const std::string& config_id) {
}
else
if
(
config_id
.
compare
(
"dhcp-ddns"
)
==
0
)
{
parser
=
new
D2ClientConfigParser
(
config_id
);
}
else
{
isc_throw
(
NotImplemented
,
"
Parser error: G
lobal configuration parameter
not supported
: "
<<
config_id
);
isc_throw
(
DhcpConfigError
,
"
unsupported g
lobal configuration parameter: "
<<
config_id
<<
" ("
<<
element
->
getPosition
()
<<
")"
);
}
return
(
parser
);
...
...
@@ -525,7 +526,8 @@ configureDhcp4Server(Dhcpv4Srv&, isc::data::ConstElementPtr config_set) {
const
std
::
map
<
std
::
string
,
ConstElementPtr
>&
values_map
=
config_set
->
mapValue
();
BOOST_FOREACH
(
config_pair
,
values_map
)
{
ParserPtr
parser
(
createGlobalDhcp4ConfigParser
(
config_pair
.
first
));
ParserPtr
parser
(
createGlobalDhcp4ConfigParser
(
config_pair
.
first
,
config_pair
.
second
));
LOG_DEBUG
(
dhcp4_logger
,
DBG_DHCP4_DETAIL
,
DHCP4_PARSER_CREATED
)
.
arg
(
config_pair
.
first
);
if
(
config_pair
.
first
==
"subnet4"
)
{
...
...
src/bin/dhcp6/config_parser.cc
View file @
dc69d955
...
...
@@ -640,7 +640,8 @@ namespace dhcp {
/// @return parser for specified global DHCPv6 parameter
/// @throw NotImplemented if trying to create a parser for unknown config
/// element
DhcpConfigParser
*
createGlobal6DhcpConfigParser
(
const
std
::
string
&
config_id
)
{
DhcpConfigParser
*
createGlobal6DhcpConfigParser
(
const
std
::
string
&
config_id
,
ConstElementPtr
element
)
{
DhcpConfigParser
*
parser
=
NULL
;
if
((
config_id
.
compare
(
"preferred-lifetime"
)
==
0
)
||
(
config_id
.
compare
(
"valid-lifetime"
)
==
0
)
||
...
...
@@ -669,9 +670,9 @@ DhcpConfigParser* createGlobal6DhcpConfigParser(const std::string& config_id) {
}
else
if
(
config_id
.
compare
(
"dhcp-ddns"
)
==
0
)
{
parser
=
new
D2ClientConfigParser
(
config_id
);
}
else
{
isc_throw
(
NotImplemented
,
"
Parser error: G
lobal configuration parameter
not supported
: "
<<
config_id
);
isc_throw
(
DhcpConfigError
,
"
unsupported g
lobal configuration parameter: "
<<
config_id
<<
" ("
<<
element
->
getPosition
()
<<
")"
);
}
return
(
parser
);
...
...
@@ -736,7 +737,8 @@ configureDhcp6Server(Dhcpv6Srv&, isc::data::ConstElementPtr config_set) {
const
std
::
map
<
std
::
string
,
ConstElementPtr
>&
values_map
=
config_set
->
mapValue
();
BOOST_FOREACH
(
config_pair
,
values_map
)
{
ParserPtr
parser
(
createGlobal6DhcpConfigParser
(
config_pair
.
first
));
ParserPtr
parser
(
createGlobal6DhcpConfigParser
(
config_pair
.
first
,
config_pair
.
second
));
LOG_DEBUG
(
dhcp6_logger
,
DBG_DHCP6_DETAIL
,
DHCP6_PARSER_CREATED
)
.
arg
(
config_pair
.
first
);
if
(
config_pair
.
first
==
"subnet6"
)
{
...
...
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