MySqlBinding::createInteger<float>(), // cache_threshold
MySqlBinding::createInteger<uint32_t>(), // cache_max_age
MySqlBinding::createInteger<uint32_t>(), // offer lifetime
+ MySqlBinding::createString(ALLOCATOR_TYPE_BUF_LENGTH), // allocator
MySqlBinding::createString(SERVER_TAG_BUF_LENGTH) // server_tag
};
last_subnet->setOfferLft(offer_lft);
}
- // server_tag at 71.
+ // allocator at 71.
+ if (!out_bindings[71]->amNull()) {
+ last_subnet->setAllocatorType(out_bindings[71]->getString());
+ }
+
+ // server_tag at 72.
// Subnet ready. Add it to the list.
auto ret = subnets.insert(last_subnet);
}
// Check for new server tags at 71.
- if (!out_bindings[71]->amNull() &&
- (last_tag != out_bindings[71]->getString())) {
- last_tag = out_bindings[71]->getString();
+ if (!out_bindings[72]->amNull() &&
+ (last_tag != out_bindings[72]->getString())) {
+ last_tag = out_bindings[72]->getString();
if (!last_tag.empty() && !last_subnet->hasServerTag(ServerTag(last_tag))) {
last_subnet->setServerTag(last_tag);
}
MySqlBinding::condCreateBool(subnet->getReservationsOutOfPool(Network::Inheritance::NONE)),
MySqlBinding::condCreateFloat(subnet->getCacheThreshold(Network::Inheritance::NONE)),
condCreateInteger<uint32_t>(subnet->getCacheMaxAge(Network::Inheritance::NONE)),
- condCreateInteger<uint32_t>(subnet->getOfferLft(Network::Inheritance::NONE))
+ condCreateInteger<uint32_t>(subnet->getOfferLft(Network::Inheritance::NONE)),
+ MySqlBinding::condCreateString(subnet->getAllocatorType(Network::Inheritance::NONE))
};
MySqlTransaction transaction(conn_);
MySqlBinding::createInteger<float>(), // cache_threshold
MySqlBinding::createInteger<uint32_t>(), // cache_max_age
MySqlBinding::createInteger<uint32_t>(), // offer lifetime
+ MySqlBinding::createString(ALLOCATOR_TYPE_BUF_LENGTH), // allocator
MySqlBinding::createString(SERVER_TAG_BUF_LENGTH) // server_tag
};
last_network->setOfferLft(offer_lft);
}
- // server_tag at 46.
+ // allocator at 46.
+ if (!out_bindings[46]->amNull()) {
+ last_network->setAllocatorType(out_bindings[46]->getString());
+ }
+
+ // server_tag at 47.
// Add the shared network.
auto ret = shared_networks.push_back(last_network);
}
// Check for new server tags.
- if (!out_bindings[46]->amNull() &&
- (last_tag != out_bindings[46]->getString())) {
- last_tag = out_bindings[46]->getString();
+ if (!out_bindings[47]->amNull() &&
+ (last_tag != out_bindings[47]->getString())) {
+ last_tag = out_bindings[47]->getString();
if (!last_tag.empty() && !last_network->hasServerTag(ServerTag(last_tag))) {
last_network->setServerTag(last_tag);
}
MySqlBinding::condCreateBool(shared_network->getReservationsOutOfPool(Network::Inheritance::NONE)),
MySqlBinding::condCreateFloat(shared_network->getCacheThreshold(Network::Inheritance::NONE)),
condCreateInteger<uint32_t>(shared_network->getCacheMaxAge(Network::Inheritance::NONE)),
- condCreateInteger<uint32_t>(shared_network->getOfferLft(Network::Inheritance::NONE))
+ condCreateInteger<uint32_t>(shared_network->getOfferLft(Network::Inheritance::NONE)),
+ MySqlBinding::condCreateString(shared_network->getAllocatorType(Network::Inheritance::NONE))
};
MySqlTransaction transaction(conn_);
" reservations_out_of_pool,"
" cache_threshold,"
" cache_max_age,"
- " offer_lifetime"
+ " offer_lifetime,"
+ " allocator"
") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
- " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" },
+ " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" },
// Insert association of the subnet with a server.
{ MySqlConfigBackendDHCPv4Impl::INSERT_SUBNET4_SERVER,
" reservations_out_of_pool,"
" cache_threshold,"
" cache_max_age,"
- " offer_lifetime"
+ " offer_lifetime,"
+ " allocator"
") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
- " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" },
+ " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" },
// Insert association of the shared network with a server.
{ MySqlConfigBackendDHCPv4Impl::INSERT_SHARED_NETWORK4_SERVER,
" reservations_out_of_pool = ?,"
" cache_threshold = ?,"
" cache_max_age = ?, "
- " offer_lifetime = ? "
+ " offer_lifetime = ?, "
+ " allocator = ? "
"WHERE subnet_id = ? OR subnet_prefix = ?" },
// Update existing shared network.
" reservations_out_of_pool = ?,"
" cache_threshold = ?,"
" cache_max_age = ?,"
- " offer_lifetime = ? "
+ " offer_lifetime = ?, "
+ " allocator = ? "
"WHERE name = ?" },
// Update existing option definition.
MySqlBinding::createInteger<uint8_t>(), // reservations_out_of_pool
MySqlBinding::createInteger<float>(), // cache_threshold
MySqlBinding::createInteger<uint32_t>(), // cache_max_age
+ MySqlBinding::createString(ALLOCATOR_TYPE_BUF_LENGTH), // allocator
+ MySqlBinding::createString(ALLOCATOR_TYPE_BUF_LENGTH), // pd_allocator
MySqlBinding::createString(SERVER_TAG_BUF_LENGTH) // server_tag
};
last_subnet->setCacheMaxAge(out_bindings[93]->getInteger<uint32_t>());
}
- // server_tag (94 / last)
+ // allocator (94)
+ if (!out_bindings[94]->amNull()) {
+ last_subnet->setAllocatorType(out_bindings[94]->getString());
+ }
+
+ // pd_allocator (95)
+ if (!out_bindings[95]->amNull()) {
+ last_subnet->setPdAllocatorType(out_bindings[95]->getString());
+ }
+
+ // server_tag (96 / last)
// Subnet ready. Add it to the list.
auto ret = subnets.insert(last_subnet);
}
// Check for new server tags.
- if (!out_bindings[94]->amNull() &&
- (last_tag != out_bindings[94]->getString())) {
- last_tag = out_bindings[94]->getString();
+ if (!out_bindings[96]->amNull() &&
+ (last_tag != out_bindings[96]->getString())) {
+ last_tag = out_bindings[96]->getString();
if (!last_tag.empty() && !last_subnet->hasServerTag(ServerTag(last_tag))) {
last_subnet->setServerTag(last_tag);
}
MySqlBinding::condCreateBool(subnet->getReservationsInSubnet(Network::Inheritance::NONE)),
MySqlBinding::condCreateBool(subnet->getReservationsOutOfPool(Network::Inheritance::NONE)),
MySqlBinding::condCreateFloat(subnet->getCacheThreshold(Network::Inheritance::NONE)),
- condCreateInteger<uint32_t>(subnet->getCacheMaxAge(Network::Inheritance::NONE))
+ condCreateInteger<uint32_t>(subnet->getCacheMaxAge(Network::Inheritance::NONE)),
+ MySqlBinding::condCreateString(subnet->getAllocatorType(Network::Inheritance::NONE)),
+ MySqlBinding::condCreateString(subnet->getPdAllocatorType(Network::Inheritance::NONE))
};
MySqlTransaction transaction(conn_);
MySqlBinding::createInteger<uint8_t>(), // reservations_out_of_pool
MySqlBinding::createInteger<float>(), // cache_threshold
MySqlBinding::createInteger<uint32_t>(), // cache_max_age
+ MySqlBinding::createString(ALLOCATOR_TYPE_BUF_LENGTH), // allocator
+ MySqlBinding::createString(ALLOCATOR_TYPE_BUF_LENGTH), // pd_allocator
MySqlBinding::createString(SERVER_TAG_BUF_LENGTH) // server_tag
};
last_network->setCacheMaxAge(out_bindings[45]->getInteger<uint32_t>());
}
- // server_tag at 46.
+ // allocator at 46.
+ if (!out_bindings[46]->amNull()) {
+ last_network->setAllocatorType(out_bindings[46]->getString());
+ }
+
+ // pd_allocator at 47.
+ if (!out_bindings[47]->amNull()) {
+ last_network->setPdAllocatorType(out_bindings[47]->getString());
+ }
+
+ // server_tag at 48.
// Add the shared network.
auto ret = shared_networks.push_back(last_network);
}
// Check for new server tags.
- if (!out_bindings[46]->amNull() &&
- (last_tag != out_bindings[46]->getString())) {
- last_tag = out_bindings[46]->getString();
+ if (!out_bindings[48]->amNull() &&
+ (last_tag != out_bindings[48]->getString())) {
+ last_tag = out_bindings[48]->getString();
if (!last_tag.empty() && !last_network->hasServerTag(ServerTag(last_tag))) {
last_network->setServerTag(last_tag);
}
MySqlBinding::condCreateBool(shared_network->getReservationsInSubnet(Network::Inheritance::NONE)),
MySqlBinding::condCreateBool(shared_network->getReservationsOutOfPool(Network::Inheritance::NONE)),
MySqlBinding::condCreateFloat(shared_network->getCacheThreshold(Network::Inheritance::NONE)),
- condCreateInteger<uint32_t>(shared_network->getCacheMaxAge(Network::Inheritance::NONE))
+ condCreateInteger<uint32_t>(shared_network->getCacheMaxAge(Network::Inheritance::NONE)),
+ MySqlBinding::condCreateString(shared_network->getAllocatorType(Network::Inheritance::NONE)),
+ MySqlBinding::condCreateString(shared_network->getPdAllocatorType(Network::Inheritance::NONE))
};
MySqlTransaction transaction(conn_);
" reservations_in_subnet,"
" reservations_out_of_pool,"
" cache_threshold,"
- " cache_max_age"
+ " cache_max_age,"
+ " allocator,"
+ " pd_allocator"
") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
- " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" },
+ " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" },
// Insert association of the subnet with a server.
{ MySqlConfigBackendDHCPv6Impl::INSERT_SUBNET6_SERVER,
" reservations_in_subnet,"
" reservations_out_of_pool,"
" cache_threshold,"
- " cache_max_age"
+ " cache_max_age,"
+ " allocator,"
+ " pd_allocator"
") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
- " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" },
+ " ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" },
// Insert association of the shared network with a server.
{ MySqlConfigBackendDHCPv6Impl::INSERT_SHARED_NETWORK6_SERVER,
" reservations_in_subnet = ?,"
" reservations_out_of_pool = ?,"
" cache_threshold = ?,"
- " cache_max_age = ? "
+ " cache_max_age = ?,"
+ " allocator = ?,"
+ " pd_allocator = ? "
"WHERE subnet_id = ? OR subnet_prefix = ?" },
// Update existing shared network.
" reservations_in_subnet = ?,"
" reservations_out_of_pool = ?,"
" cache_threshold = ?,"
- " cache_max_age = ? "
+ " cache_max_age = ?,"
+ " allocator = ?,"
+ " pd_allocator = ? "
"WHERE name = ?" },
// Update existing option definition.
" s.cache_threshold," \
" s.cache_max_age," \
" s.offer_lifetime, " \
+ " s.allocator, " \
" srv.tag " \
"FROM dhcp4_subnet AS s " \
server_join \
" s.reservations_out_of_pool," \
" s.cache_threshold," \
" s.cache_max_age," \
+ " s.allocator," \
+ " s.pd_allocator," \
" srv.tag " \
"FROM dhcp6_subnet AS s " \
server_join \
" n.cache_threshold," \
" n.cache_max_age," \
" n.offer_lifetime, " \
+ " n.allocator, " \
" s.tag " \
"FROM dhcp4_shared_network AS n " \
server_join \
" n.reservations_out_of_pool," \
" n.cache_threshold," \
" n.cache_max_age," \
+ " n.allocator," \
+ " n.pd_allocator," \
" s.tag " \
"FROM dhcp6_shared_network AS n " \
server_join \
-// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2023 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
constexpr unsigned long DNS_NAME_BUF_LENGTH = 255;
+constexpr unsigned long ALLOCATOR_TYPE_BUF_LENGTH = 64;
+
//*}
} // end of namespace isc::cb
subnet->setCacheThreshold(0.25);
subnet->setCacheMaxAge(20);
subnet->setOfferLft(77);
+ subnet->setAllocatorType("random");
Pool4Ptr pool1(new Pool4(IOAddress("192.0.2.10"),
IOAddress("192.0.2.20")));
shared_network->setCacheThreshold(0.26);
shared_network->setCacheMaxAge(21);
shared_network->setOfferLft(78);
+ shared_network->setAllocatorType("iterative");
// Add several options to the shared network.
shared_network->getCfgOption()->add(test_options_[2]->option_,
subnet->setT1Percent(0.345);
subnet->setT2Percent(0.444);
subnet->setDdnsSendUpdates(false);
+ subnet->setAllocatorType("random");
+ subnet->setPdAllocatorType("iterative");
Pool6Ptr pool1(new Pool6(Lease::TYPE_NA,
IOAddress("2001:db8::10"),
shared_network->setT1Percent(0.345);
shared_network->setT2Percent(0.444);
shared_network->setDdnsSendUpdates(false);
+ shared_network->setAllocatorType("iterative");
+ shared_network->setPdAllocatorType("random");
// Add several options to the shared network.
shared_network->getCfgOption()->add(test_options_[2]->option_,