MySqlBinding::createInteger<uint8_t>(), // calculate_tee_times
MySqlBinding::createInteger<float>(), // t1_percent
MySqlBinding::createInteger<float>(), // t2_percent
- MySqlBinding::createInteger<uint8_t>() // authoritative
+ MySqlBinding::createInteger<uint8_t>(), // authoritative
+ MySqlBinding::createString(SERVER_TAG_BUF_LENGTH) // server_tag
};
uint64_t last_pool_id = 0;
last_subnet->setAuthoritative(out_bindings[52]->getBool());
}
+ // server_tag
+ last_subnet->setServerTag(out_bindings[53]->getString());
+
// Subnet ready. Add it to the list.
subnets.push_back(last_subnet);
}
MySqlBinding::createInteger<uint8_t>(), // authoritative
MySqlBinding::createString(BOOT_FILE_NAME_BUF_LENGTH), // boot_file_name
MySqlBinding::createInteger<uint32_t>(), // next_server
- MySqlBinding::createString(SERVER_HOSTNAME_BUF_LENGTH) // server_hostname
+ MySqlBinding::createString(SERVER_HOSTNAME_BUF_LENGTH), // server_hostname
+ MySqlBinding::createString(SERVER_TAG_BUF_LENGTH) // server_tag
};
uint64_t last_network_id = 0;
last_network->setSname(out_bindings[31]->getString());
}
+ // server_tag
+ last_network->setServerTag(out_bindings[32]->getString());
+
shared_networks.push_back(last_network);
}
MySqlBinding::createInteger<uint64_t>(), // option: pd_pool_id
MySqlBinding::createInteger<uint8_t>(), // calculate_tee_times
MySqlBinding::createInteger<float>(), // t1_percent
- MySqlBinding::createInteger<float>() // t2_percent
+ MySqlBinding::createInteger<float>(), // t2_percent
+ MySqlBinding::createString(SERVER_TAG_BUF_LENGTH) // server_tag
};
uint64_t last_pool_id = 0;
last_subnet->setT2Percent(out_bindings[67]->getFloat());
}
+ // server_tag
+ last_subnet->setServerTag(out_bindings[68]->getString());
+
// Subnet ready. Add it to the list.
subnets.push_back(last_subnet);
}
MySqlBinding::createInteger<uint64_t>(), // option: pd_pool_id
MySqlBinding::createInteger<uint8_t>(), // calculate_tee_times
MySqlBinding::createInteger<float>(), // t1_percent
- MySqlBinding::createInteger<float>() // t2_percent
+ MySqlBinding::createInteger<float>(), // t2_percent
+ MySqlBinding::createString(SERVER_TAG_BUF_LENGTH) // server_tag
};
uint64_t last_network_id = 0;
last_network->setT2Percent(out_bindings[29]->getFloat());
}
+ // server_tag
+ last_network->setServerTag(out_bindings[30]->getString());
+
shared_networks.push_back(last_network);
}
MySqlBinding::createString(GLOBAL_PARAMETER_NAME_BUF_LENGTH), // name
MySqlBinding::createString(GLOBAL_PARAMETER_VALUE_BUF_LENGTH), // value
MySqlBinding::createInteger<uint8_t>(), // parameter_type
- MySqlBinding::createTimestamp() // modification_ts
+ MySqlBinding::createTimestamp(), // modification_ts
+ MySqlBinding::createString(SERVER_TAG_BUF_LENGTH) // server_tag
};
conn_.selectQuery(index, in_bindings, out_bindings,
(out_bindings[3]->getInteger<uint8_t>()));
stamped_value->setModificationTime(out_bindings[4]->getTimestamp());
+ stamped_value->setServerTag(out_bindings[5]->getString());
parameters.insert(stamped_value);
}
});
MySqlBinding::createInteger<uint8_t>(), // array
MySqlBinding::createString(OPTION_ENCAPSULATE_BUF_LENGTH), // encapsulate
MySqlBinding::createString(OPTION_RECORD_TYPES_BUF_LENGTH), // record_types
- MySqlBinding::createString(USER_CONTEXT_BUF_LENGTH) // user_context
+ MySqlBinding::createString(USER_CONTEXT_BUF_LENGTH), // user_context
+ MySqlBinding::createString(SERVER_TAG_BUF_LENGTH) // server_tag
};
uint64_t last_def_id = 0;
// Update modification time.
last_def->setModificationTime(out_bindings[5]->getTimestamp());
+ // server_tag
+ last_def->setServerTag(out_bindings[10]->getString());
+
// Store created option definition.
option_defs.push_back(last_def);
}
out_bindings.push_back(MySqlBinding::createInteger<uint64_t>());
// modification_ts
out_bindings.push_back(MySqlBinding::createTimestamp());
+ // server_tag
+ out_bindings.push_back(MySqlBinding::createString(SERVER_TAG_BUF_LENGTH));
// pd_pool_id
if (universe == Option::V6) {
out_bindings.push_back(MySqlBinding::createInteger<uint64_t>());
OptionDescriptorPtr desc = processOptionRow(universe, out_bindings.begin());
if (desc) {
+ // server_tag for the global option
+ desc->setServerTag(out_bindings[12]->getString());
options.push_back(*desc);
}
}
" g.name," \
" g.value," \
" g.parameter_type," \
- " g.modification_ts " \
+ " g.modification_ts," \
+ " s.tag " \
"FROM " #table_prefix "_global_parameter AS g " \
"INNER JOIN " #table_prefix "_global_parameter_server AS a " \
" ON g.id = a.parameter_id " \
" s.calculate_tee_times," \
" s.t1_percent," \
" s.t2_percent," \
- " s.authoritative " \
+ " s.authoritative," \
+ " srv.tag " \
"FROM dhcp4_subnet AS s " \
"INNER JOIN dhcp4_subnet_server AS a " \
" ON s.subnet_id = a.subnet_id " \
" o.pd_pool_id, " \
" s.calculate_tee_times," \
" s.t1_percent," \
- " s.t2_percent " \
+ " s.t2_percent," \
+ " srv.tag " \
"FROM dhcp6_subnet AS s " \
"INNER JOIN dhcp6_subnet_server AS a " \
" ON s.subnet_id = a.subnet_id " \
" n.authoritative," \
" n.boot_file_name," \
" n.next_server," \
- " n.server_hostname " \
+ " n.server_hostname," \
+ " s.tag " \
"FROM dhcp4_shared_network AS n " \
"INNER JOIN dhcp4_shared_network_server AS a " \
" ON n.id = a.shared_network_id " \
" o.pd_pool_id, " \
" n.calculate_tee_times," \
" n.t1_percent," \
- " n.t2_percent " \
+ " n.t2_percent," \
+ " s.tag " \
"FROM dhcp6_shared_network AS n " \
"INNER JOIN dhcp6_shared_network_server AS a " \
" ON n.id = a.shared_network_id " \
" d.array," \
" d.encapsulate," \
" d.record_types," \
- " d.user_context " \
+ " d.user_context," \
+ " s.tag " \
"FROM " #table_prefix "_option_def AS d " \
"INNER JOIN " #table_prefix "_option_def_server AS a" \
" ON d.id = a.option_def_id " \
" o.user_context," \
" o.shared_network_name," \
" o.pool_id," \
- " o.modification_ts " \
+ " o.modification_ts," \
+ " s.tag " \
pd_pool_id \
"FROM " #table_prefix "_options AS o " \
"INNER JOIN " #table_prefix "_options_server AS a" \
EXPECT_EQ("whale", returned_global_parameter->getValue());
EXPECT_TRUE(returned_global_parameter->getModificationTime() ==
global_parameter->getModificationTime());
+ EXPECT_EQ("all", returned_global_parameter->getServerTag());
// Because we have added the global parameter for all servers, it
// should be also returned for the explicitly specified server.
EXPECT_EQ("whale", returned_global_parameter->getValue());
EXPECT_TRUE(returned_global_parameter->getModificationTime() ==
global_parameter->getModificationTime());
+ EXPECT_EQ("all", returned_global_parameter->getServerTag());
// Check that the parameter is udpated when selector is specified correctly.
global_parameter = StampedValue::create("global", "fish");
EXPECT_EQ("fish", returned_global_parameter->getValue());
EXPECT_TRUE(returned_global_parameter->getModificationTime() ==
global_parameter->getModificationTime());
+ EXPECT_EQ("all", returned_global_parameter->getServerTag());
{
SCOPED_TRACE("UPDATE audit entry for the global parameter");
EXPECT_TRUE((*parameters_index.find("name4"))->getBoolValue());
EXPECT_EQ(1.65, (*parameters_index.find("name5"))->getDoubleValue());
+ for (auto param = parameters_index.begin(); param != parameters_index.end();
+ ++param) {
+ EXPECT_EQ("all", (*param)->getServerTag());
+ }
+
// Should be able to fetch these parameters when explicitly providing
// the server tag.
parameters = cbptr_->getAllGlobalParameters4(ServerSelector::ONE("server1"));
Subnet4Ptr returned_subnet = cbptr_->getSubnet4(ServerSelector::ALL(),
test_subnets_[0]->getID());
ASSERT_TRUE(returned_subnet);
+ EXPECT_EQ("all", returned_subnet->getServerTag());
// The easiest way to verify whether the returned subnet matches the inserted
// subnet is to convert both to text.
Subnet4Ptr returned_subnet = cbptr_->getSubnet4(ServerSelector::ALL(),
"192.0.2.0/24");
ASSERT_TRUE(returned_subnet);
+ EXPECT_EQ("all", returned_subnet->getServerTag());
// Verify subnet contents.
EXPECT_EQ(subnet->toElement()->str(), returned_subnet->toElement()->str());
// See if the subnets are returned ok.
for (auto i = 0; i < subnets.size(); ++i) {
+ EXPECT_EQ("all", subnets[i]->getServerTag());
EXPECT_EQ(test_subnets_[i + 1]->toElement()->str(),
subnets[i]->toElement()->str());
}
EXPECT_TRUE(isEquivalent(test_subnets_[1]->toElement(),
subnets[0]->toElement()));
+ // Check server tag
+ EXPECT_EQ("all", subnets[0]->getServerTag());
+
// Fetch all subnets belonging to shared network level2.
subnets = cbptr_->getSharedNetworkSubnets4(ServerSelector::ALL(), "level2");
ASSERT_EQ(2, subnets.size());
ASSERT_TRUE(returned_network);
EXPECT_GT(returned_network->getId(), 0);
+ EXPECT_EQ("all", returned_network->getServerTag());
// The easiest way to verify whether the returned shared network matches the
// inserted shared network is to convert both to text.
test_option_defs_[0]->getOptionSpaceName());
ASSERT_TRUE(returned_option_def);
EXPECT_GT(returned_option_def->getId(), 0);
+ EXPECT_EQ("all", returned_option_def->getServerTag());
EXPECT_TRUE(returned_option_def->equals(*option_def));
// See if option definitions are returned ok.
for (auto def = option_defs.begin(); def != option_defs.end(); ++def) {
+ EXPECT_EQ("all", (*def)->getServerTag());
bool success = false;
for (auto i = 1; i < test_option_defs_.size(); ++i) {
if ((*def)->equals(*test_option_defs_[i])) {
ASSERT_FALSE(option0 == index.end());
testOptionsEquivalent(*test_options_[0], *option0);
EXPECT_GT(option0->getId(), 0);
+ EXPECT_EQ("all", option0->getServerTag());
}
{
ASSERT_FALSE(option1 == index.end());
testOptionsEquivalent(*test_options_[1], *option1);
EXPECT_GT(option1->getId(), 0);
+ EXPECT_EQ("all", option1->getServerTag());
}
{
ASSERT_FALSE(option5 == index.end());
testOptionsEquivalent(*test_options_[5], *option5);
EXPECT_GT(option5->getId(), 0);
+ EXPECT_EQ("all", option5->getServerTag());
}
}
EXPECT_EQ("whale", returned_global_parameter->getValue());
EXPECT_TRUE(returned_global_parameter->getModificationTime() ==
global_parameter->getModificationTime());
+ EXPECT_EQ("all", returned_global_parameter->getServerTag());
// Because we have added the global parameter for all servers, it
// should be also returned for the explicitly specified server.
EXPECT_EQ("whale", returned_global_parameter->getValue());
EXPECT_TRUE(returned_global_parameter->getModificationTime() ==
global_parameter->getModificationTime());
+ EXPECT_EQ("all", returned_global_parameter->getServerTag());
// Check that the parameter is udpated when selector is specified correctly.
global_parameter = StampedValue::create("global", "fish");
const auto& parameters_index = parameters.get<StampedValueNameIndexTag>();
+ for (auto param = parameters_index.begin(); param != parameters_index.end();
+ ++param) {
+ EXPECT_EQ("all", (*param)->getServerTag());
+ }
+
// Verify their values.
EXPECT_EQ("value1", (*parameters_index.find("name1"))->getValue());
EXPECT_EQ(65, (*parameters_index.find("name2"))->getIntegerValue());
Subnet6Ptr returned_subnet = cbptr_->getSubnet6(ServerSelector::ALL(),
test_subnets_[0]->getID());
ASSERT_TRUE(returned_subnet);
+ EXPECT_EQ("all", returned_subnet->getServerTag());
// The easiest way to verify whether the returned subnet matches the inserted
// subnet is to convert both to text.
Subnet6Ptr returned_subnet = cbptr_->getSubnet6(ServerSelector::ALL(),
test_subnets_[0]->getID());
ASSERT_TRUE(returned_subnet);
+ EXPECT_EQ("all", returned_subnet->getServerTag());
// The easiest way to verify whether the returned subnet matches the inserted
// subnet is to convert both to text.
Subnet6Ptr returned_subnet = cbptr_->getSubnet6(ServerSelector::ALL(),
"2001:db8::/64");
ASSERT_TRUE(returned_subnet);
+ EXPECT_EQ("all", returned_subnet->getServerTag());
// Verify subnet contents.
EXPECT_EQ(subnet->toElement()->str(), returned_subnet->toElement()->str());
for (auto i = 0; i < subnets.size(); ++i) {
EXPECT_EQ(test_subnets_[i + 1]->toElement()->str(),
subnets[i]->toElement()->str());
+ EXPECT_EQ("all", subnets[i]->getServerTag());
}
// Attempt to remove the non existing subnet should return 0.
ASSERT_TRUE(returned_network);
EXPECT_GT(returned_network->getId(), 0);
+ EXPECT_EQ("all", returned_network->getServerTag());
// The easiest way to verify whether the returned shared network matches the
// inserted shared network is to convert both to text.
for (auto i = 0; i < networks.size(); ++i) {
EXPECT_EQ(test_networks_[i + 1]->toElement()->str(),
networks[i]->toElement()->str());
+ EXPECT_EQ("all", networks[i]->getServerTag());
}
// Add some subnets.
test_option_defs_[0]->getOptionSpaceName());
ASSERT_TRUE(returned_option_def);
EXPECT_GT(returned_option_def->getId(), 0);
+ EXPECT_EQ("all", returned_option_def->getServerTag());
EXPECT_TRUE(returned_option_def->equals(*option_def));
// See if option definitions are returned ok.
for (auto def = option_defs.begin(); def != option_defs.end(); ++def) {
+ EXPECT_EQ("all", (*def)->getServerTag());
bool success = false;
for (auto i = 1; i < test_option_defs_.size(); ++i) {
if ((*def)->equals(*test_option_defs_[i])) {
ASSERT_FALSE(option0 == index.end());
testOptionsEquivalent(*test_options_[0], *option0);
EXPECT_GT(option0->getId(), 0);
+ EXPECT_EQ("all", option0->getServerTag());
}
{
ASSERT_FALSE(option1 == index.end());
testOptionsEquivalent(*test_options_[1], *option1);
EXPECT_GT(option1->getId(), 0);
+ EXPECT_EQ("all", option1->getServerTag());
}
{
ASSERT_FALSE(option5 == index.end());
testOptionsEquivalent(*test_options_[5], *option5);
EXPECT_GT(option5->getId(), 0);
+ EXPECT_EQ("all", option5->getServerTag());
}
}
StampedElement::StampedElement()
/// @todo Change it to microsec_clock once we transition to subsecond
/// precision.
- : id_(0), timestamp_(boost::posix_time::second_clock::local_time()) {
+ : id_(0), timestamp_(boost::posix_time::second_clock::local_time()),
+ server_tag_() {
}
void
setModificationTime(boost::posix_time::second_clock::local_time());
}
+ElementPtr
+StampedElement::getMetadata() const {
+ ElementPtr metadata = Element::createMap();
+ metadata->set("server-tag", Element::create(getServerTag()));
+ return (metadata);
+}
+
} // end of namespace isc::data
} // end of namespace isc
#ifndef STAMPED_ELEMENT_H
#define STAMPED_ELEMENT_H
+#include <cc/data.h>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <cstdint>
+#include <string>
namespace isc {
namespace data {
return (timestamp_);
}
+ /// @brief Sets new server tag.
+ ///
+ /// @param server_tag
+ void setServerTag(const std::string& server_tag) {
+ server_tag_ = server_tag;
+ }
+
+ /// @brief Returns server tag.
+ std::string getServerTag() const {
+ return (server_tag_);
+ }
+
+ /// @brief Returns an object representing metadata to be returned
+ /// with objects from the configuration backend.
+ ///
+ /// @return Pointer to the metadata element.
+ isc::data::ElementPtr getMetadata() const;
+
private:
/// @brief Database identifier of the configuration element.
/// @brief Holds timestamp value.
boost::posix_time::ptime timestamp_;
+ /// @brief Holds server tag.
+ std::string server_tag_;
};
} // end of namespace isc::data
// Default identifier is 0.
EXPECT_EQ(0, element.getId());
+ // Default server tag is empty.
+ EXPECT_TRUE(element.getServerTag().empty());
+
// Checking that the delta between now and the timestamp is within
// 5s range should be sufficient.
boost::posix_time::time_duration delta =
EXPECT_LT(delta.seconds(), 5);
}
+// Tests that server tag can be overriden by a new value.
+TEST(StampedElementTest, setServerTag) {
+ StampedElement element;
+ element.setServerTag("foo");
+ EXPECT_EQ("foo", element.getServerTag());
+}
+
+// Test that metadata can be created from the StampedElement.
+TEST(StampedElementTest, getMetadata) {
+ StampedElement element;
+ element.setServerTag("world");
+ auto metadata = element.getMetadata();
+ ASSERT_TRUE(metadata);
+ ASSERT_EQ(Element::map, metadata->getType());
+
+ auto server_tag_element = metadata->get("server-tag");
+ ASSERT_TRUE(server_tag_element);
+ EXPECT_EQ(Element::string, server_tag_element->getType());
+ EXPECT_EQ("world", server_tag_element->stringValue());
+}
+
}
constexpr unsigned long AUDIT_ENTRY_LOG_MESSAGE_BUF_LENGTH = 65536;
+constexpr unsigned long SERVER_TAG_BUF_LENGTH = 256;
+
//*}
} // end of namespace isc::cb
ElementPtr
CfgOption::toElement() const {
+ return (toElementWithMetadata(false));
+}
+
+ElementPtr
+CfgOption::toElementWithMetadata(const bool include_metadata) const {
// option-data value is a list of maps
ElementPtr result = Element::createList();
// Iterate first on options using space names
}
// Set the persistency flag
map->set("always-send", Element::create(opt->persistent_));
+
+ // Include metadata if requested.
+ if (include_metadata) {
+ map->set("metadata", opt->getMetadata());
+ }
+
// Push on the list
result->add(map);
}
return (result);
}
+
} // namespace dhcp
} // namespace isc
/// @return a pointer to unparsed configuration
virtual isc::data::ElementPtr toElement() const;
+ /// @brief Unparse a configuration object with optionally including
+ /// the metadata.
+ ///
+ /// @param include_metadata boolean value indicating if the metadata
+ /// should be included (if true) or not (if false).
+ ///
+ /// @return A pointer to the unparsed configuration.
+ isc::data::ElementPtr
+ toElementWithMetadata(const bool include_metadata) const;
+
private:
/// @brief Appends encapsulated options to the options in an option space.
ElementPtr
CfgOptionDef::toElement() const {
+ return (toElementWithMetadata(false));
+}
+
+ElementPtr
+CfgOptionDef::toElementWithMetadata(const bool include_metadata) const {
// option-defs value is a list of maps
ElementPtr result = Element::createList();
// Iterate through the container by names and definitions
} else {
map->set("record-types", Element::create(std::string()));
}
+
+ // Include metadata if requested.
+ if (include_metadata) {
+ map->set("metadata", (*def)->getMetadata());
+ }
+
// Push on the list
result->add(map);
}
/// @return a pointer to unparsed configuration
virtual isc::data::ElementPtr toElement() const;
+ /// @brief Unparse a configuration object with optionally including
+ /// the metadata.
+ ///
+ /// @param include_metadata boolean value indicating if the metadata
+ /// should be included (if true) or not (if false).
+ ///
+ /// @return A pointer to the unparsed configuration.
+ isc::data::ElementPtr
+ toElementWithMetadata(const bool include_metadata) const;
+
/// @brief Merges specified option definitions from a configuration
/// into this configuration.
///
return (port_);
}
+ /// @brief Returns server tag to be associated with the stored configuration.
+ ///
+ /// @param server_selector Server selector.
+ std::string getServerTag(const db::ServerSelector& server_selector) const {
+ if (server_selector.getType() == db::ServerSelector::Type::ALL) {
+ return ("all");
+ }
+ // Return first tag found.
+ std::set<std::string> tags = server_selector.getTags();
+ if (!tags.empty()) {
+ return (*tags.begin());
+ }
+ return ("");
+ }
+
/// @brief Fake database connection
db::DatabaseConnection connection_;
}
void
-TestConfigBackendDHCPv4::createUpdateSubnet4(const db::ServerSelector& /* server_selector */,
+TestConfigBackendDHCPv4::createUpdateSubnet4(const db::ServerSelector& server_selector,
const Subnet4Ptr& subnet) {
+ subnet->setServerTag(getServerTag(server_selector));
+
auto& index = subnets_.get<SubnetSubnetIdIndexTag>();
auto subnet_it = index.find(subnet->getID());
}
void
-TestConfigBackendDHCPv4::createUpdateSharedNetwork4(const db::ServerSelector& /* server_selector */,
+TestConfigBackendDHCPv4::createUpdateSharedNetwork4(const db::ServerSelector& server_selector,
const SharedNetwork4Ptr& shared_network) {
+ shared_network->setServerTag(getServerTag(server_selector));
+
auto& index = shared_networks_.get<SharedNetworkNameIndexTag>();
auto network_it = index.find(shared_network->getName());
}
void
-TestConfigBackendDHCPv4::createUpdateOptionDef4(const db::ServerSelector& /* server_selector */,
+TestConfigBackendDHCPv4::createUpdateOptionDef4(const db::ServerSelector& server_selector,
const OptionDefinitionPtr& option_def) {
+ option_def->setServerTag(getServerTag(server_selector));
+
auto& index = option_defs_.get<1>();
auto option_def_it = index.find(option_def->getCode());
}
void
-TestConfigBackendDHCPv4::createUpdateOption4(const db::ServerSelector& /* server_selector */,
+TestConfigBackendDHCPv4::createUpdateOption4(const db::ServerSelector& server_selector,
const OptionDescriptorPtr& option) {
+ option->setServerTag(getServerTag(server_selector));
+
auto& index = options_.get<1>();
auto option_it = index.find(option->option_->getType());
}
void
-TestConfigBackendDHCPv4::createUpdateGlobalParameter4(const db::ServerSelector& /* server_selector */,
+TestConfigBackendDHCPv4::createUpdateGlobalParameter4(const db::ServerSelector& server_selector,
const data::StampedValuePtr& value) {
+ value->setServerTag(getServerTag(server_selector));
+
auto& index = globals_.get<StampedValueNameIndexTag>();
auto global_it = index.find(value->getName());
}
void
-TestConfigBackendDHCPv6::createUpdateSubnet6(const db::ServerSelector& /* server_selector */,
+TestConfigBackendDHCPv6::createUpdateSubnet6(const db::ServerSelector& server_selector,
const Subnet6Ptr& subnet) {
+ subnet->setServerTag(getServerTag(server_selector));
+
auto& index = subnets_.get<SubnetSubnetIdIndexTag>();
auto subnet_it = index.find(subnet->getID());
}
void
-TestConfigBackendDHCPv6::createUpdateSharedNetwork6(const db::ServerSelector& /* server_selector */,
+TestConfigBackendDHCPv6::createUpdateSharedNetwork6(const db::ServerSelector& server_selector,
const SharedNetwork6Ptr& shared_network) {
+
+ shared_network->setServerTag(getServerTag(server_selector));
auto& index = shared_networks_.get<SharedNetworkNameIndexTag>();
auto network_it = index.find(shared_network->getName());
}
void
-TestConfigBackendDHCPv6::createUpdateOptionDef6(const db::ServerSelector& /* server_selector */,
+TestConfigBackendDHCPv6::createUpdateOptionDef6(const db::ServerSelector& server_selector,
const OptionDefinitionPtr& option_def) {
+ option_def->setServerTag(getServerTag(server_selector));
+
auto& index = option_defs_.get<1>();
auto option_def_it = index.find(option_def->getCode());
}
void
-TestConfigBackendDHCPv6::createUpdateOption6(const db::ServerSelector& /* server_selector */,
+TestConfigBackendDHCPv6::createUpdateOption6(const db::ServerSelector& server_selector,
const OptionDescriptorPtr& option) {
+ option->setServerTag(getServerTag(server_selector));
+
auto& index = options_.get<1>();
auto option_it = index.find(option->option_->getType());
}
void
-TestConfigBackendDHCPv6::createUpdateGlobalParameter6(const db::ServerSelector& /* server_selector */,
+TestConfigBackendDHCPv6::createUpdateGlobalParameter6(const db::ServerSelector& server_selector,
const data::StampedValuePtr& value) {
+ value->setServerTag(getServerTag(server_selector));
+
auto& index = globals_.get<StampedValueNameIndexTag>();
auto global_it = index.find(value->getName());