// Get the pd-pool list and check if it is empty.
const string& xpath =
"/ietf-dhcpv6-server:server/server-config/network-ranges"
- "/network-range[network-range-id='111']/pd-pools/pd-pool";
+ "/network-range[network-range-id='111']/pd-pools";
ConstElementPtr pools;
EXPECT_NO_THROW(pools = t_obj_->getPdPools(xpath));
ASSERT_TRUE(pools);
useModel(KEA_DHCP6_SERVER);
// Get the pd-pool list and check if it is empty.
- const string& xpath =
- "/kea-dhcp6-server:config/subnet6[id='111']/pd-pool";
+ const string& xpath = "/kea-dhcp6-server:config/subnet6[id='111']";
ConstElementPtr pools;
EXPECT_NO_THROW(pools = t_obj_->getPdPools(xpath));
ASSERT_TRUE(pools);
// Get the pd-pool list and check if the pd-pool is in it.
ConstElementPtr pools;
- EXPECT_NO_THROW(pools = t_obj_->getPdPools(subnet + "/pd-pools/pd-pool"));
+ EXPECT_NO_THROW(pools = t_obj_->getPdPools(subnet + "/pd-pools"));
ASSERT_TRUE(pools);
ASSERT_EQ(Element::list, pools->getType());
ASSERT_EQ(1, pools->size());
// Get the pd-pool list and check if the pd-pool is in it.
ConstElementPtr pools;
- EXPECT_NO_THROW(pools = t_obj_->getPdPools(xpath + "/pd-pool"));
+ EXPECT_NO_THROW(pools = t_obj_->getPdPools(xpath));
ASSERT_TRUE(pools);
ASSERT_EQ(Element::list, pools->getType());
ASSERT_EQ(1, pools->size());
// Get it back.
pools.reset();
- EXPECT_NO_THROW(pools = t_obj_->getPdPools(xpath + "/pd-pool"));
+ EXPECT_NO_THROW(pools = t_obj_->getPdPools(xpath));
ASSERT_TRUE(pools);
ASSERT_EQ(Element::list, pools->getType());
EXPECT_EQ(0, pools->size());
// Get it back.
pools.reset();
- EXPECT_NO_THROW(pools = t_obj_->getPdPools(xpath + "/pd-pool"));
+ EXPECT_NO_THROW(pools = t_obj_->getPdPools(xpath));
ASSERT_TRUE(pools);
ASSERT_EQ(Element::list, pools->getType());
EXPECT_EQ(0, pools->size());
// Get it back.
pools.reset();
- EXPECT_NO_THROW(pools = t_obj_->getPdPools(xpath + "/pd-pool"));
+ EXPECT_NO_THROW(pools = t_obj_->getPdPools(xpath));
ASSERT_TRUE(pools);
ASSERT_EQ(Element::list, pools->getType());
ASSERT_EQ(1, pools->size());
// Get it back.
pools.reset();
- EXPECT_NO_THROW(pools = t_obj_->getPdPools(xpath + "/pd-pool"));
+ EXPECT_NO_THROW(pools = t_obj_->getPdPools(xpath));
ASSERT_TRUE(pools);
ASSERT_EQ(Element::list, pools->getType());
ASSERT_EQ(1, pools->size());
// Get the pools list.
ConstElementPtr pools;
- EXPECT_NO_THROW(pools = t_obj_->getPdPools(xpath + "/pd-pool"));
+ EXPECT_NO_THROW(pools = t_obj_->getPdPools(xpath));
ASSERT_TRUE(pools);
// Check that both of them are returned properly.
// Get the pool list and check if it is empty.
const string& xpath = "/ietf-dhcpv6-server:server/server-config/"
- "network-ranges/network-range[network-range-id='111']/"
- "address-pools/address-pool";
+ "network-ranges/network-range[network-range-id='111']/address-pools";
ConstElementPtr pools;
EXPECT_NO_THROW(pools = t_obj_->getPools(xpath));
ASSERT_TRUE(pools);
useModel(KEA_DHCP6_SERVER);
// Get the pool list and check if it is empty.
- const string& xpath =
- "/kea-dhcp6-server:config/subnet6[id='111']/pool";
+ const string& xpath = "/kea-dhcp6-server:config/subnet6[id='111']";
ConstElementPtr pools;
EXPECT_NO_THROW(pools = t_obj_->getPools(xpath));
ASSERT_TRUE(pools);
// Get the pool list and check if the pool is in it.
ConstElementPtr pools;
- EXPECT_NO_THROW(pools = t_obj_->getPools(xpath + "/address-pool"));
+ EXPECT_NO_THROW(pools = t_obj_->getPools(xpath));
ASSERT_TRUE(pools);
ASSERT_EQ(Element::list, pools->getType());
ASSERT_EQ(1, pools->size());
// Get the pool list and check if the pool is in it.
ConstElementPtr pools;
- EXPECT_NO_THROW(pools = t_obj_->getPools(xpath + "/pool"));
+ EXPECT_NO_THROW(pools = t_obj_->getPools(xpath));
ASSERT_TRUE(pools);
ASSERT_EQ(Element::list, pools->getType());
ASSERT_EQ(1, pools->size());
// Get it back.
pools.reset();
- EXPECT_NO_THROW(pools = t_obj_->getPools(xpath + "/address-pool"));
+ EXPECT_NO_THROW(pools = t_obj_->getPools(xpath));
ASSERT_TRUE(pools);
ASSERT_EQ(Element::list, pools->getType());
EXPECT_EQ(0, pools->size());
// Get it back.
pools.reset();
- EXPECT_NO_THROW(pools = t_obj_->getPools(xpath + "/pool"));
+ EXPECT_NO_THROW(pools = t_obj_->getPools(xpath));
ASSERT_TRUE(pools);
ASSERT_EQ(Element::list, pools->getType());
EXPECT_EQ(0, pools->size());
// Get it back.
pools.reset();
- EXPECT_NO_THROW(pools = t_obj_->getPools(xpath + "/address-pool"));
+ EXPECT_NO_THROW(pools = t_obj_->getPools(xpath));
ASSERT_TRUE(pools);
ASSERT_EQ(Element::list, pools->getType());
ASSERT_EQ(1, pools->size());
// Get it back.
pools.reset();
- EXPECT_NO_THROW(pools = t_obj_->getPools(xpath + "/pool"));
+ EXPECT_NO_THROW(pools = t_obj_->getPools(xpath));
ASSERT_TRUE(pools);
ASSERT_EQ(Element::list, pools->getType());
ASSERT_EQ(1, pools->size());
// Get the subnet list and check if it is empty.
const string& xpath =
- "/ietf-dhcpv6-server:server/server-config/"
- "network-ranges/network-range";
+ "/ietf-dhcpv6-server:server/server-config/network-ranges";
ConstElementPtr subnets;
EXPECT_NO_THROW(subnets = t_obj_->getSubnets(xpath));
ASSERT_TRUE(subnets);
useModel(KEA_DHCP6_SERVER);
// Get the subnet list and check if it is empty.
- const string& xpath = "/kea-dhcp6-server:config/subnet6";
+ const string& xpath = "/kea-dhcp6-server:config";
ConstElementPtr subnets;
EXPECT_NO_THROW(subnets = t_obj_->getSubnets(xpath));
ASSERT_TRUE(subnets);
// Get the subnet list and check if the subnet is in it.
ConstElementPtr subnets;
- EXPECT_NO_THROW(subnets = t_obj_->getSubnets(xpath + "/network-range"));
+ EXPECT_NO_THROW(subnets = t_obj_->getSubnets(xpath));
ASSERT_TRUE(subnets);
ASSERT_EQ(Element::list, subnets->getType());
ASSERT_EQ(1, subnets->size());
// Get the subnet list and check if the subnet is in it.
ConstElementPtr subnets;
- EXPECT_NO_THROW(subnets = t_obj_->getSubnets(xpath + "/subnet6"));
+ EXPECT_NO_THROW(subnets = t_obj_->getSubnets(xpath));
ASSERT_TRUE(subnets);
ASSERT_EQ(Element::list, subnets->getType());
ASSERT_EQ(1, subnets->size());
// Get the subnet list and check if the subnet is in it.
ConstElementPtr subnets;
- EXPECT_NO_THROW(subnets = t_obj_->getSubnets(xpath + "/network-range"));
+ EXPECT_NO_THROW(subnets = t_obj_->getSubnets(xpath));
ASSERT_TRUE(subnets);
ASSERT_EQ(Element::list, subnets->getType());
ASSERT_EQ(1, subnets->size());
// Get the subnet list and check if the subnet is in it.
ConstElementPtr subnets;
- EXPECT_NO_THROW(subnets = t_obj_->getSubnets(xpath + "/subnet6"));
+ EXPECT_NO_THROW(subnets = t_obj_->getSubnets(xpath));
ASSERT_TRUE(subnets);
ASSERT_EQ(Element::list, subnets->getType());
ASSERT_EQ(1, subnets->size());
// Get it back.
subnets.reset();
- EXPECT_NO_THROW(subnets = t_obj_->getSubnets(xpath + "/network-range"));
+ EXPECT_NO_THROW(subnets = t_obj_->getSubnets(xpath));
ASSERT_TRUE(subnets);
ASSERT_EQ(Element::list, subnets->getType());
EXPECT_EQ(0, subnets->size());
useModel(KEA_DHCP4_SERVER);
// Set empty list.
- const string& xpath = "/kea-dhcp4-server:config/subnet4";
+ const string& xpath = "/kea-dhcp4-server:config";
ElementPtr subnets = Element::createList();
EXPECT_NO_THROW(t_obj_->setSubnets(xpath, subnets));
// Get it back.
subnets.reset();
- EXPECT_NO_THROW(subnets = t_obj_->getSubnets(xpath + "/network-range"));
+ EXPECT_NO_THROW(subnets = t_obj_->getSubnets(xpath));
ASSERT_TRUE(subnets);
ASSERT_EQ(Element::list, subnets->getType());
ASSERT_EQ(1, subnets->size());
useModel(KEA_DHCP4_SERVER);
// Set one subnet.
- const string& xpath = "/kea-dhcp4-server:config/subnet4";
+ const string& xpath = "/kea-dhcp4-server:config";
ElementPtr subnets = Element::createList();
ElementPtr subnet = Element::createMap();
subnet->set("subnet", Element::create(string("10.0.1.0/24")));
// Get it back.
subnets.reset();
- EXPECT_NO_THROW(subnets = t_obj_->getSubnets(xpath + "/network-range"));
+ EXPECT_NO_THROW(subnets = t_obj_->getSubnets(xpath));
ASSERT_TRUE(subnets);
ASSERT_EQ(Element::list, subnets->getType());
ASSERT_EQ(1, subnets->size());
useModel(KEA_DHCP4_SERVER);
// Set one subnet.
- const string& xpath = "/kea-dhcp4-server:config/subnet4";
+ const string& xpath = "/kea-dhcp4-server:config";
ElementPtr subnets = Element::createList();
ElementPtr subnet = Element::createMap();
subnet->set("subnet", Element::create(string("10.0.1.0/24")));
result->set("Dhcp6", dhcp6);
string xpath = "/" + model_ + ":server/server-config";
ConstElementPtr ranges =
- getSubnets(xpath + "/network-ranges/network-range");
+ getSubnets(xpath + "/network-ranges");
if (ranges && !ranges->empty()) {
dhcp6->set("subnet6", ranges);
}
string xpath = "/kea-dhcp4-server:config";
ElementPtr result = getServerKeaDhcpCommon(xpath);
// Handle subnets.
- ConstElementPtr subnets = getSubnets(xpath + "/subnet4");
+ ConstElementPtr subnets = getSubnets(xpath);
if (subnets && !subnets->empty()) {
result->set("subnet4", subnets);
}
// Handle DHCPv6 specific global parameters.
getParam(result, xpath, "preferred-lifetime");
// Handle subnets.
- ConstElementPtr subnets = getSubnets(xpath + "/subnet6");
+ ConstElementPtr subnets = getSubnets(xpath);
if (subnets && !subnets->empty()) {
result->set("subnet6", subnets);
}
setServerKeaDhcpCommon(xpath, elem);
ConstElementPtr subnets = elem->get("subnet4");
if (subnets) {
- setSubnets(xpath + "/subnet4", subnets);
+ setSubnets(xpath, subnets);
}
ConstElementPtr if_config = elem->get("interfaces-config");
if (if_config) {
}
ConstElementPtr subnets = elem->get("subnet6");
if (subnets) {
- setSubnets(xpath + "/subnet6", subnets);
+ setSubnets(xpath, subnets);
}
ConstElementPtr if_config = elem->get("interfaces-config");
if (if_config) {
/// @brief Get and translate database accesses from YANG to JSON.
///
- /// @param xpath The xpath of databases.
+ /// @param xpath The xpath of databases including the list name.
/// @return JSON representation of databases.
/// @throw SysrepoError when sysrepo raises an error.
isc::data::ConstElementPtr getDatabases(const std::string& xpath);
///
/// Null elem argument removes the database list.
///
- /// @param xpath The xpath of databases.
+ /// @param xpath The xpath of databases including the list name.
/// @param elem The JSON element.
void setDatabases(const std::string& xpath,
isc::data::ConstElementPtr elem);
protected:
/// @brief getDatabases JSON for kea-dhcp[46]-server models.
///
- /// @param xpath The xpath of databases.
+ /// @param xpath The xpath of databases including the list name.
/// @return JSON representation of databases.
/// @throw SysrepoError when sysrepo raises an error.
isc::data::ElementPtr getDatabasesKea(const std::string& xpath);
/// @brief setDatabases for kea-dhcp[46]-server models.
///
- /// @param xpath The xpath of databases.
+ /// @param xpath The xpath of databases including the list name.
/// @param elem The JSON element.
/// @throw BadValue on database without tyoe,
void setDatabasesKea(const std::string& xpath,
ElementPtr
TranslatorPdPools::getPdPools(const string& xpath) {
try {
- ElementPtr result = Element::createList();
- S_Iter_Value iter = getIter(xpath);
- if (!iter) {
- // Can't happen.
- isc_throw(Unexpected, "getPdPools: can't get iterator: " << xpath);
+ if ((model_ == IETF_DHCPV6_SERVER) ||
+ (model_ == KEA_DHCP6_SERVER)) {
+ return (getPdPoolsCommon(xpath));
}
- for (;;) {
- const string& pool = getNext(iter);
- if (pool.empty()) {
- break;
- }
- result->add(getPdPool(pool));
- }
- return (result);
} catch (const sysrepo_exception& ex) {
isc_throw(SysrepoError,
"sysrepo error getting pd-pools at '" << xpath
<< "': " << ex.what());
}
+ isc_throw(NotImplemented,
+ "getPdPools not implemented for the model: " << model_);
+}
+
+ElementPtr
+TranslatorPdPools::getPdPoolsCommon(const string& xpath) {
+ ElementPtr result = Element::createList();
+ S_Iter_Value iter = getIter(xpath + "/pd-pool");
+ if (!iter) {
+ // Can't happen.
+ isc_throw(Unexpected, "getPdPools: can't get iterator: " << xpath);
+ }
+ for (;;) {
+ const string& pool = getNext(iter);
+ if (pool.empty()) {
+ break;
+ }
+ result->add(getPdPool(pool));
+ }
+ return (result);
}
void
void setPdPoolIetf6(const std::string& xpath,
isc::data::ConstElementPtr elem);
- /// @brief getPdPool for kea-dhcp6.
+ /// @brief getPdPool for kea-dhcp6-server.
///
/// @param xpath The xpath of the pd-pool.
/// @return JSON representation of the pd-pool.
/// @throw SysrepoError when sysrepo raises an error.
isc::data::ElementPtr getPdPoolKea(const std::string& xpath);
- /// @brief setPdPool for kea-dhcp6.
+ /// @brief setPdPool for kea-dhcp6-server.
///
/// @param xpath The xpath of the pd-pool.
/// @param elem The JSON element.
void setPdPools(const std::string& xpath, isc::data::ConstElementPtr elem);
protected:
+ /// @brief getPdPools common part.
+ ///
+ /// @param xpath The xpath of the pd-pool list.
+ /// @throw SysrepoError when sysrepo raises an error.
+ isc::data::ElementPtr getPdPoolsCommon(const std::string& xpath);
+
/// @brief setPdPools using pool-id.
///
/// @param xpath The xpath of the pd-pool list.
ElementPtr
TranslatorPools::getPools(const string& xpath) {
try {
- ElementPtr result = Element::createList();
- S_Iter_Value iter = getIter(xpath);
- if (!iter) {
- // Can't happen.
- isc_throw(Unexpected, "getPools can't get iterator: " << xpath);
- }
- for (;;) {
- const string& pool = getNext(iter);
- if (pool.empty()) {
- break;
- }
- result->add(getPool(pool));
+ if (model_ == IETF_DHCPV6_SERVER) {
+ return (getPoolsIetf(xpath));
+ } else if ((model_ == KEA_DHCP4_SERVER) ||
+ (model_ == KEA_DHCP6_SERVER)) {
+ return (getPoolsKea(xpath));
}
- return (result);
} catch (const sysrepo_exception& ex) {
isc_throw(SysrepoError,
"sysrepo error getting pools at '" << xpath
<< "': " << ex.what());
}
+ isc_throw(NotImplemented,
+ "getPools not implemented for the model: " << model_);
+}
+
+ElementPtr
+TranslatorPools::getPoolsIetf(const string& xpath) {
+ ElementPtr result = Element::createList();
+ S_Iter_Value iter = getIter(xpath + "/address-pool");
+ if (!iter) {
+ // Can't happen.
+ isc_throw(Unexpected, "getPoolsIetf can't get iterator: " << xpath);
+ }
+ for (;;) {
+ const string& pool = getNext(iter);
+ if (pool.empty()) {
+ break;
+ }
+ result->add(getPool(pool));
+ }
+ return (result);
+}
+
+ElementPtr
+TranslatorPools::getPoolsKea(const string& xpath) {
+ ElementPtr result = Element::createList();
+ S_Iter_Value iter = getIter(xpath + "/pool");
+ if (!iter) {
+ // Can't happen.
+ isc_throw(Unexpected, "getPoolsKea can't get iterator: " << xpath);
+ }
+ for (;;) {
+ const string& pool = getNext(iter);
+ if (pool.empty()) {
+ break;
+ }
+ result->add(getPool(pool));
+ }
+ return (result);
}
void
void setPoolIetf6(const std::string& xpath,
isc::data::ConstElementPtr elem);
- /// @brief getPool for kea-dhcp[46].
+ /// @brief getPool for kea-dhcp[46]-server.
///
/// @param xpath The xpath of the pool.
/// @return JSON representation of the pool.
/// @throw BadValue on a pool without prefix and start or end address.
isc::data::ElementPtr getPoolKea(const std::string& xpath);
- /// @brief setPool for kea-dhcp[46].
+ /// @brief setPool for kea-dhcp[46]-server.
///
/// @param xpath The xpath of the pool.
/// @param elem The JSON element.
void setPools(const std::string& xpath, isc::data::ConstElementPtr elem);
protected:
+ /// @brief getPools for ietf-dhcpv6-server.
+ ///
+ /// @param xpath The xpath of the pool list.
+ isc::data::ElementPtr getPoolsIetf(const std::string& xpath);
+
+ /// @brief getPools for kea-dhcp[46]-server.
+ ///
+ /// @param xpath The xpath of the pool list.
+ isc::data::ElementPtr getPoolsKea(const std::string& xpath);
+
/// @brief setPools using pool-id.
///
/// @param xpath The xpath of the pool list.
isc_throw(Unexpected, "getSharedNetworkKea requires name: " << xpath);
}
result->set("name", name);
- ConstElementPtr subnets = getSubnets(xpath + "/" + subsel);
+ ConstElementPtr subnets = getSubnets(xpath);
if (subnets && (subnets->size() > 0)) {
result->set(subsel, subnets);
}
// Skip name which is the key.
ConstElementPtr subnets = elem->get(subsel);
if (subnets && (subnets->size() > 0)) {
- setSubnets(xpath + "/" + subsel, subnets);
+ setSubnets(xpath, subnets);
}
if (subsel == "subnet6") {
ConstElementPtr preferred = elem->get("preferred-lifetime");
ElementPtr result = Element::createMap();
/// @todo timers
/// @todo: option-data
- ConstElementPtr pools = getPools(xpath + "/address-pools/address-pool");
+ ConstElementPtr pools = getPools(xpath + "/address-pools");
if (pools) {
/// Set empty list too.
result->set("pools", pools);
}
- pools = getPdPools(xpath + "/pd-pools/pd-pool");
+ pools = getPdPools(xpath + "/pd-pools");
if (pools && (pools->size() > 0)) {
result->set("pd-pools", pools);
}
if (options && (options->size() > 0)) {
result->set("option-data", options);
}
- ConstElementPtr pools = getPools(xpath + "/pool");
+ ConstElementPtr pools = getPools(xpath);
if (pools && (pools->size() > 0)) {
result->set("pools", pools);
}
if (model_ == KEA_DHCP6_SERVER) {
- pools = getPdPools(xpath + "/pd-pool");
+ pools = getPdPools(xpath);
if (pools && (pools->size() > 0)) {
result->set("pd-pools", pools);
}
ElementPtr
TranslatorSubnets::getSubnets(const string& xpath) {
try {
- ElementPtr result = Element::createList();
- S_Iter_Value iter = getIter(xpath);
- if (!iter) {
- /// Can't happen.
- isc_throw(Unexpected, "getSubnets: can't get iterator: " << xpath);
- }
- for (;;) {
- const string& subnet = getNext(iter);
- if (subnet.empty()) {
- break;
- }
- result->add(getSubnet(subnet));
+ if (model_ == IETF_DHCPV6_SERVER) {
+ return (getSubnetsCommon(xpath, "network-range"));
+ } else if (model_ == KEA_DHCP4_SERVER) {
+ return (getSubnetsCommon(xpath, "subnet4"));
+ } else if (model_ == KEA_DHCP6_SERVER) {
+ return (getSubnetsCommon(xpath, "subnet6"));
}
- return (result);
} catch (const sysrepo_exception& ex) {
isc_throw(SysrepoError,
"sysrepo error getting subnets at '" << xpath
<< "': " << ex.what());
}
+ isc_throw(NotImplemented,
+ "getSubnets not implemented for the model: " << model_);
+}
+
+ElementPtr
+TranslatorSubnets::getSubnetsCommon(const string& xpath,
+ const std::string& subsel) {
+ ElementPtr result = Element::createList();
+ S_Iter_Value iter = getIter(xpath + "/" + subsel);
+ if (!iter) {
+ /// Can't happen.
+ isc_throw(Unexpected, "getSubnets: can't get iterator: " << xpath);
+ }
+ for (;;) {
+ const string& subnet = getNext(iter);
+ if (subnet.empty()) {
+ break;
+ }
+ result->add(getSubnet(subnet));
+ }
+ return (result);
}
void
try {
if (model_ == IETF_DHCPV6_SERVER) {
setSubnetsIetf6(xpath, elem);
- } else if ((model_ == KEA_DHCP4_SERVER) ||
- (model_ == KEA_DHCP6_SERVER)) {
- setSubnetsKea(xpath, elem);
+ } else if (model_ == KEA_DHCP4_SERVER) {
+ setSubnetsKea(xpath, elem, "subnet4");
+ } else if (model_ == KEA_DHCP6_SERVER) {
+ setSubnetsKea(xpath, elem, "subnet6");
} else {
isc_throw(NotImplemented,
"setSubnets not implemented for the model: " << model_);
}
void
-TranslatorSubnets::setSubnetsKea(const string& xpath, ConstElementPtr elem) {
+TranslatorSubnets::setSubnetsKea(const string& xpath, ConstElementPtr elem,
+ const std::string& subsel) {
for (size_t i = 0; i < elem->size(); ++i) {
ConstElementPtr subnet = elem->get(i);
if (!subnet->contains("id")) {
isc_throw(BadValue, "subnet without id: " << subnet->str());
}
ostringstream prefix;
- prefix << xpath << "[id='" << subnet->get("id")->intValue() << "']";
+ prefix << xpath << "/" << subsel << "[id='"
+ << subnet->get("id")->intValue() << "']";
setSubnet(prefix.str(), subnet);
}
}
/// +--rw host-reservations host-reservation* [cli-id]
/// @endcode
///
-/// YANG syntax for kea-dhcp[46] is with id as the key:
+/// YANG syntax for kea-dhcp[46]-server is with id as the key:
/// @code
/// +--rw valid-lifetime? uint32
/// +--rw renew-timer? uint32
void setSubnetIetf6(const std::string& xpath,
isc::data::ConstElementPtr elem);
- /// @brief getSubnet for kea-dhcp[46].
+ /// @brief getSubnet for kea-dhcp[46]-server.
///
/// @param xpath The xpath of the subnet.
/// @return JSON representation of the subnet.
isc::data::ElementPtr getSubnetKea(const std::string& xpath);
- /// @brief setSubnet for kea-dhcp[46].
+ /// @brief setSubnet for kea-dhcp[46]-server.
///
/// @param xpath The xpath of the subnet.
/// @param elem The JSON element.
void setSubnets(const std::string& xpath, isc::data::ConstElementPtr elem);
protected:
+ /// @brief getSubnets common part.
+ ///
+ /// @param xpath The xpath of the subnet list.
+ /// @param subsel The subnet list name.
+ isc::data::ElementPtr getSubnetsCommon(const std::string& xpath,
+ const std::string& subsel);
+
/// @brief setSubnets for ietf-dhcpv6-server.
///
/// @param xpath The xpath of the subnet list.
void setSubnetsIetf6(const std::string& xpath,
isc::data::ConstElementPtr elem);
- /// @brief setSubnets for kea-dhcp[46].
+ /// @brief setSubnets for kea-dhcp[46]-server.
///
/// @param xpath The xpath of the subnet list.
/// @param elem The JSON element.
+ /// @param subsel The subnet list name.
void setSubnetsKea(const std::string& xpath,
- isc::data::ConstElementPtr elem);
+ isc::data::ConstElementPtr elem,
+ const std::string& subsel);
};
}; // end of namespace isc::yang