The DHCPv6 server now supports the case when client classes are specified
in the host reservation and can be used to influence the pool selection
within a top level subnet.
If there are any classes in the host reservations, instead of clearing all
of the classes, remove the ones that are definede in the config. Then,
evaluate them again taking into account reserved ones.
The DHCPv4 server now takes into account client classes specified in
gobal reservations to select a subnet and/or pool for allocation within
a shared network.
This function was added to the ClientContext4 for the DHCPv4 server to be
able to quickly check if there are any global host reservations present
and if the reservations contain client classes which could be possibly
used for leases allocation.
src/lib/dhcpsrv/alloc_engine.cc
AllocEngine::allocateUnreservedLease4() - rather than first testing for a
host reservation and then looking for an existing lease, we reverse the
order, thus worrying about HRs only if there is no existing lease.
src/lib/dhcpsrv/tests/csv_lease_file4_unittest.cc
TEST_F(CSVLeaseFile4Test, embeddedEscapes) - new test
src/lib/dhcpsrv/tests/csv_lease_file6_unittest.cc
TEST_F(CSVLeaseFile6Test, embeddedEscapes) - new test
src/lib/util/csv_file.cc
CSVRow::escapeCharacters() - now automatically also escapes
first char of escape_tag to preserve input that happens to match
escape tag
src/lib/util/tests/csv_file_unittest.cc
TEST(CSVRowTest, escapeUnescape) - added embedded escape tests
plus misc clean up
Commas in hostname and user-context columns are now escaped as
"," when written out, and unescaped when read back in.
src/lib/util/csv_file.*
CSVRow::escapeCharacters()
CSVRow::unescapeCharacters()
CSVRow::readAtEscaped()
CSVRow::writeAtEscaped() - new functions
CSVRow::parse() - replaced boost::split() faster, simplified parsing
src/lib/util/tests/csv_file_unittest.cc
TEST(CSVRowTest, escapeUnescape) - new test
updated other tests
src/lib/dhcpsrv/csv_lease_file4.cc
CSVLeaseFile4 now uses CSVRow::writeAtEscaped() and CSVRow::readAtEscaped() for
hostname and user-context columns
src/lib/dhcpsrv/csv_lease_file6.cc
CSVLeaseFile6 now uses CSVRow::writeAtEscaped() and CSVRow::readAtEscaped() for
hostname and user-context columns
src/lib/dhcpsrv/tests/csv_lease_file4_unittest.cc
TEST_F(CSVLeaseFile4Test, embeddedCommas) - new test
src/lib/dhcpsrv/tests/csv_lease_file6_unittest.cc
TEST_F(CSVLeaseFile6Test, embeddedCommas) - new test
src/bin/agent/tests/ca_controller_unittests.cc
TEST_F(CtrlAgentControllerTest, shutdown) - new test
src/lib/process/daemon.h
Daemon::shutdown() restored to virtual
Other Minor cleanups
Added exit-value argument to shutdown command.
kea-dhcpX servers now exit with EXIT_FAILURE status on db loss
src/lib/process/daemon.*
Daemon::exit_value_, new member with getter/setter
src/lib/process/d_controller.*
DControllerBase::launch() - now returns getExitValue()
DControllerBase::shutdownHandler() - uses exit-value argument to set exit
value
src/lib/process/tests/daemon_unittest.cc
TEST_F(DaemonTest, exitValue) - new test
src/bin/agent/main.cc
Use launch() return value for exit value.
src/bin/agent/tests/ca_controller_unittests.cc
TEST_F(CtrlAgentControllerTest, shutdownExitValue) - new test
src/bin/d2/main.cc
Use launch() return value for exit value.
src/bin/d2/tests/d2_command_unittest.cc
TEST_F(CtrlChannelD2Test, shutdownExitValue) - new test
src/bin/dhcp4/ctrl_dhcp4_srv.*
ControlledDhcpv4Srv::
commandShutdownHandler() - handle exit-value argument
shutdown(int exit_value) - added exit_value parameter
dbReconnect() - call shutdown(EXIT_FAILURE)
dbLostCallback() - call shutdown(EXIT_FAILURE)
src/bin/dhcp4/dhcp4_srv.*
Dhcp4Srv::run() - returns int Daemon::exit_value instead of bool
src/bin/dhcp4/main.cc
Use run() return value for exit value.
src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc
TEST_F(CtrlChannelDhcpv4SrvTest, commands) - revamped test
src/bin/dhcp6/ctrl_dhcp6_srv.*
ControlledDhcpv6Srv::
commandShutdownHandler() - use exit-value argument to set exit value
shutdown(int exit_value) - added exit_value parameter
dbReconnect() - call shutdown(EXIT_FAILURE)
dbLostCallback() - call shutdown(EXIT_FAILURE)
src/bin/dhcp6/dhcp6_srv.*
Dhcp6Srv::run() - returns int Daemon::exit_value instead of bool
src/bin/dhcp6/main.cc
Use run() return value for exit value.
src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc
TEST_F(CtrlDhcpv6SrvTest, commands) - revamped test