Commit 61cd69fd authored by Francis Dupont's avatar Francis Dupont
Browse files

[master] Fixed merge errors

parent 644526fc
......@@ -198,7 +198,8 @@ ClientClassDefParser::parse(ClientClassDictionaryPtr& class_dictionary,
// Add the client class definition
try {
class_dictionary->addClass(name, match_expr, test, required, options,
defs, next_server, sname, filename);
defs, user_context, next_server, sname,
filename);
} catch (const std::exception& ex) {
isc_throw(DhcpConfigError, "Can't add class: " << ex.what()
<< " (" << class_def_cfg->getPosition() << ")");
......
......@@ -73,6 +73,7 @@ SharedNetwork4Parser::parse(const data::ConstElementPtr& shared_network_data) {
ConstElementPtr user_context = shared_network_data->get("user-context");
if (user_context) {
shared_network->setContext(user_context);
}
if (shared_network_data->contains("require-client-classes")) {
const std::vector<data::ElementPtr>& class_list =
......@@ -132,6 +133,7 @@ SharedNetwork6Parser::parse(const data::ConstElementPtr& shared_network_data) {
ConstElementPtr user_context = shared_network_data->get("user-context");
if (user_context) {
shared_network->setContext(user_context);
}
if (shared_network_data->contains("require-client-classes")) {
const std::vector<data::ElementPtr>& class_list =
......
......@@ -208,7 +208,7 @@ public:
/// such subnet by inspecting "last allocation" timestamps. The one with most
/// recent timestamp is selected.
///
/// The preferred subnet must also fulfil the condition of equal client classes
/// The preferred subnet must also fulfil the condition of equal client class
/// with the @c selected_subnet.
///
/// @param subnets Container holding subnets belonging to this shared
......@@ -226,7 +226,7 @@ public:
auto preferred_subnet = selected_subnet;
for (auto s = subnets.begin(); s != subnets.end(); ++s) {
if (((*s)->getClientClasses() == selected_subnet->getClientClasses()) &&
if (((*s)->getClientClass() == selected_subnet->getClientClass()) &&
((*s)->getLastAllocatedTime(lease_type) >
selected_subnet->getLastAllocatedTime(lease_type))) {
preferred_subnet = (*s);
......
......@@ -56,7 +56,7 @@ HostDataSourceUtils::generateIdentifier(const bool new_identifier) {
HostPtr
HostDataSourceUtils::initializeHost4(const std::string& address,
const Host::IdentifierType& id) {
const Host::IdentifierType& id) {
std::vector<uint8_t> ident;
if (id == Host::IDENT_HWADDR) {
ident = generateHWAddr();
......@@ -80,9 +80,9 @@ HostDataSourceUtils::initializeHost4(const std::string& address,
HostPtr
HostDataSourceUtils::initializeHost6(std::string address,
Host::IdentifierType identifier,
bool prefix,
bool new_identifier) {
Host::IdentifierType identifier,
bool prefix,
bool new_identifier) {
std::vector<uint8_t> ident;
switch (identifier) {
case Host::IDENT_HWADDR:
......@@ -121,7 +121,7 @@ HostDataSourceUtils::initializeHost6(std::string address,
bool
HostDataSourceUtils::reservationExists(const IPv6Resrv& resrv,
const IPv6ResrvRange& range) {
const IPv6ResrvRange& range) {
for (IPv6ResrvIterator it = range.first; it != range.second; ++it) {
if (resrv == it->second) {
return true;
......@@ -132,8 +132,8 @@ HostDataSourceUtils::reservationExists(const IPv6Resrv& resrv,
void
HostDataSourceUtils::compareHwaddrs(const ConstHostPtr& host1,
const ConstHostPtr& host2,
bool expect_match) {
const ConstHostPtr& host2,
bool expect_match) {
ASSERT_TRUE(host1);
ASSERT_TRUE(host2);
......@@ -168,8 +168,8 @@ HostDataSourceUtils::compareHwaddrs(const ConstHostPtr& host1,
void
HostDataSourceUtils::compareDuids(const ConstHostPtr& host1,
const ConstHostPtr& host2,
bool expect_match) {
const ConstHostPtr& host2,
bool expect_match) {
ASSERT_TRUE(host1);
ASSERT_TRUE(host2);
......@@ -203,7 +203,7 @@ HostDataSourceUtils::compareDuids(const ConstHostPtr& host1,
void
HostDataSourceUtils::compareHosts(const ConstHostPtr& host1,
const ConstHostPtr& host2) {
const ConstHostPtr& host2) {
// Let's compare HW addresses and expect match.
compareHwaddrs(host1, host2, true);
......@@ -251,7 +251,7 @@ HostDataSourceUtils::compareHosts(const ConstHostPtr& host1,
void
HostDataSourceUtils::compareReservations6(IPv6ResrvRange resrv1,
IPv6ResrvRange resrv2) {
IPv6ResrvRange resrv2) {
// Compare number of reservations for both hosts
if (std::distance(resrv1.first, resrv1.second) !=
std::distance(resrv2.first, resrv2.second)) {
......@@ -303,13 +303,13 @@ HostDataSourceUtils::compareReservations6(IPv6ResrvRange resrv1,
void
HostDataSourceUtils::compareClientClasses(const ClientClasses& classes1,
const ClientClasses& classes2) {
EXPECT_TRUE(std::equal(classes1.begin(), classes1.end(), classes2.begin()));
const ClientClasses& classes2) {
EXPECT_TRUE(std::equal(classes1.cbegin(), classes1.cend(), classes2.cbegin()));
}
void
HostDataSourceUtils::compareOptions(const ConstCfgOptionPtr& cfg1,
const ConstCfgOptionPtr& cfg2) {
const ConstCfgOptionPtr& cfg2) {
ASSERT_TRUE(cfg1);
ASSERT_TRUE(cfg2);
......
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