// 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() << ")");
/// 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
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);
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();
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:
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;
void
HostDataSourceUtils::compareHwaddrs(const ConstHostPtr& host1,
- const ConstHostPtr& host2,
- bool expect_match) {
+ const ConstHostPtr& host2,
+ bool expect_match) {
ASSERT_TRUE(host1);
ASSERT_TRUE(host2);
void
HostDataSourceUtils::compareDuids(const ConstHostPtr& host1,
- const ConstHostPtr& host2,
- bool expect_match) {
+ const ConstHostPtr& host2,
+ bool expect_match) {
ASSERT_TRUE(host1);
ASSERT_TRUE(host2);
void
HostDataSourceUtils::compareHosts(const ConstHostPtr& host1,
- const ConstHostPtr& host2) {
+ const ConstHostPtr& host2) {
// Let's compare HW addresses and expect match.
compareHwaddrs(host1, host2, true);
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)) {
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);