Commit 63e8df70 authored by Francis Dupont's avatar Francis Dupont
Browse files

[master] Finished merge of trac5126 (flat style)

parents 0d05123d 8c17bbef
......@@ -204,6 +204,7 @@ protected:
}
}
public:
/// @brief Returns a value converted to uint32_t
///
/// Instantiation of getIntType() to uint32_t
......@@ -212,7 +213,8 @@ protected:
/// @param name name of the parameter
/// @return an uint32_t value
/// @throw isc::dhcp::DhcpConfigError when it is not an uint32_t
uint32_t getUint32(isc::data::ConstElementPtr scope, const std::string& name) {
uint32_t getUint32(isc::data::ConstElementPtr scope,
const std::string& name) {
return (getIntType<uint32_t>(scope, name));
}
......@@ -224,7 +226,8 @@ protected:
/// @param name name of the parameter
/// @return an uint16_t value
/// @throw isc::dhcp::DhcpConfigError when it is not an uint16_t
uint16_t getUint16(isc::data::ConstElementPtr scope, const std::string& name) {
uint16_t getUint16(isc::data::ConstElementPtr scope,
const std::string& name) {
return (getIntType<uint16_t>(scope, name));
}
......
......@@ -58,10 +58,6 @@ public:
class SimpleParserClassTest : public SimpleParser {
public:
/// Make getUint8 public
using SimpleParser::getUint8;
/// @brief Instantiation of getAndConvert
///
/// @param scope specified parameter will be extracted from this scope
......
......@@ -103,15 +103,13 @@ ClientClassDefParser::parse(ClientClassDictionaryPtr& class_dictionary,
if (next_server.getFamily() != AF_INET) {
isc_throw(DhcpConfigError, "Invalid next-server value: '"
<< next_server_txt
<< "', must be IPv4 address ("
<< next_server_txt << "', must be IPv4 address ("
<< getPosition("next-server", class_def_cfg) << ")");
}
if (next_server.isV4Bcast()) {
isc_throw(DhcpConfigError, "Invalid next-server value: '"
<< next_server_txt
<< "', must not be a broadcast ("
<< next_server_txt << "', must not be a broadcast ("
<< getPosition("next-server", class_def_cfg) << ")");
}
}
......@@ -148,7 +146,7 @@ ClientClassDefParser::parse(ClientClassDictionaryPtr& class_dictionary,
class_dictionary->addClass(name, match_expr, test, options,
next_server, sname, filename);
} catch (const std::exception& ex) {
isc_throw(DhcpConfigError, ex.what()
isc_throw(DhcpConfigError, "Can't add class: " << ex.what()
<< " (" << class_def_cfg->getPosition() << ")");
}
}
......
......@@ -26,6 +26,9 @@ namespace dhcp {
void
DUIDConfigParser::parse(const CfgDUIDPtr& cfg,
isc::data::ConstElementPtr duid_configuration) {
if (!cfg) {
isc_throw(DhcpConfigError, "Must provide valid pointer to cfg when parsing duid");
}
std::string param;
try {
......
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