16 #include <boost/foreach.hpp>
17 #include <boost/lexical_cast.hpp>
37 std::string duid_type = getString(duid_configuration,
"type");
40 if (duid_type ==
"LLT") {
41 numeric_type = DUID::DUID_LLT;
42 }
else if (duid_type ==
"EN") {
43 numeric_type = DUID::DUID_EN;
44 }
else if (duid_type ==
"LL") {
45 numeric_type = DUID::DUID_LL;
48 << duid_type <<
"'. Expected: LLT, EN or LL");
51 cfg->setType(static_cast<DUID::DUIDType>(numeric_type));
54 if (duid_configuration->contains(param)) {
55 cfg->setIdentifier(getString(duid_configuration, param));
59 if (duid_configuration->contains(param)) {
60 cfg->setHType(getUint16(duid_configuration, param));
64 if (duid_configuration->contains(param)) {
65 cfg->setTime(getUint32(duid_configuration, param));
68 param =
"enterprise-id";
69 if (duid_configuration->contains(param)) {
70 cfg->setEnterpriseId(getUint32(duid_configuration, param));
74 if (duid_configuration->contains(param)) {
75 cfg->setPersist(getBoolean(duid_configuration, param));
78 param =
"user-context";
81 cfg->setContext(user_context);
85 }
catch (
const std::exception& ex) {
88 << getPosition(param, duid_configuration) <<
")");
#define LOG_WARN(LOGGER, MESSAGE)
Macro to conveniently test warn output and log it.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
DUIDType
specifies DUID type
To be removed. Please use ConfigError instead.
boost::shared_ptr< const Element > ConstElementPtr
const isc::log::MessageID DHCPSRV_CFGMGR_CONFIGURE_SERVERID
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
Defines the logger used by the top-level component of kea-dhcp-ddns.
isc::log::Logger dhcpsrv_logger("dhcpsrv")
DHCP server library Logger.
boost::shared_ptr< CfgDUID > CfgDUIDPtr
Pointer to the Non-const object.