Commit f87000bd authored by Marcin Siodelski's avatar Marcin Siodelski
Browse files

[3968] Merge branch 'master' into trac3968

parents acb688a9 3710b0d9
1030. [bug] marcin
Fixed failing 'reclaimExpiredLeasesTimeout' unit tests on
some virtual machines.
(trac #4075, git c3a2487f53ecf69edc0a38f574fce17c4332162c)
1029. [func] tomek
A new hook point lease6_decline has been added. It is called when
the DHCPv6 server is about to decline a lease as a result of
processing incoming DECLINE message.
(Trac #3986, git b6e3f1bbe3595aeba769d627d571e2eeee38a397)
1028. [func] marcin
Expired leases are processed periodically according to the
server configuration.
(Trac #3975, git 3bd8891c0b9cb7dc504fa69251610996775cefbf)
1027. [func] tomek
Expired declined IPv6 leases can now be reclaimed (returned to the
available pool) after probation period elapses.
(Trac #3985, git 9aadfa902d898ce1f52b773152a5b34519a9a9fe)
1026. [doc] stephen
Added documentation for the kea-dhcp4.commands and
kea-dhcp6.commands loggers.
(Trac #3952, git 3eb5d3185683e05494c1d84ed7195627fce4b6c1)
1025. [func] tomek
A new hook point lease4_decline has been added. It is called when
the DHCPv4 server is about to decline a lease as a result of
processing incoming DHCPDECLINE message.
(Trac #3986, git 39bde93fe25e4aff52623d4df7fd55c64e0a9c21)
1024. [func]* tomek
Boolean Skip flag in Hooks API has been replaced by enum status.
This is backward incompatible change if you developed hook
library that takes advantage of the skip flag. See Hooks
Developer Guide for easy steps necessary for migration.
(Trac #3499, git 99ca398d4d042a098b5c491368733220db8cdd08)
1023. [func] tmark
kea-admin now supports upgrading from MySQL schema version 3.0
to 4.0. In addition, the lease6 data dump now contains the
text label for lease_hwaddr_source column rather than its
numeric value.
(Trac #3967, git 2e13ac3b0b278faabe338b00ffee8259c13f5342)
1022. [func] fdupont
Added support for the V4 link selection sub-option (RFC 3527). If
present in an incoming packet, the server will allocate an address
in the subnet identified in the option. If this is impossible, no
address will be allocated and the request refused.
(Trac #4057, git 8c02cec5ec8e311a9d23fd582d8e9e8647667abb)
1021. [bug] stephen
Added missing address parameter to ALLOC_ENGINE_V4_REQUEST_OUT_OF_POOL
message.
(Trac #3996, git 680233550747209a1707e8f920179479b980aa2a)
1020. [func] kalmus
A general purpose base class for MySQL connection has been
implemented.
(Trac #3681, git tbd)
(Trac #3681, git 884d8bb4a55d3d7b1b8f3f01efb312bd8dec399b)
1019. [func] marcin
Added new configuration parameters controlling processing of the
......
......@@ -1412,6 +1412,7 @@ AC_CONFIG_FILES([compatcheck/Makefile
src/bin/admin/scripts/mysql/Makefile
src/bin/admin/scripts/mysql/upgrade_1.0_to_2.0.sh
src/bin/admin/scripts/mysql/upgrade_2.0_to_3.0.sh
src/bin/admin/scripts/mysql/upgrade_3.0_to_4.0.sh
src/bin/admin/scripts/pgsql/Makefile
src/hooks/Makefile
src/hooks/dhcp/Makefile
......
......@@ -2680,8 +2680,30 @@ should include options from the isc option space:
</listitem>
</itemizedlist>
</para>
</section>
<section id="dhcp6-decline">
<title>Duplicate Addresses (DECLINE support)</title>
<note>
<para>@todo: Full text will be added as part of #3990.</para>
</note>
<para>
The server does not decrease assigned-addresses statistics
when Decline message is received and processed successfully. While
technically a declined address is no longer assigned, the primary usage
of the assigned-addresses statistic is to monitor pool utilization. Most
people would forget to include declined-addresses in the calculation,
and simply do assigned-addresses/total-addresses. This would have a bias
towards under-representing pool utilization. As this has a
potential for major issues, we decided not to decrease assigned
addresses immediately after receiving Decline, but to do
it later when we recover the address back to the available pool.
</para>
</section>
<section id="dhcp6-stats">
<title>Statistics in DHCPv6 server</title>
<note>
......
......@@ -199,6 +199,12 @@
for the particular hook point.
</simpara>
</listitem>
<listitem>
<simpara><command>kea-dhcp4.commands</command> - this logger is used
to log messages relating to the handling of commands received by the
the DHCPv4 server over the command channel.
</simpara>
</listitem>
<listitem>
<simpara><command>kea-dhcp4.ddns</command> - this logger is used by
the DHCPv4 server to log messages related to the Client FQDN and
......@@ -258,6 +264,13 @@
the settings from this logger if there is no specialized logger
provided.</simpara>
</listitem>
<listitem>
<simpara><command>kea-dhcp6.alloc-engine</command> - this is the
logger used by the lease allocation engine, which is responsible
for managing leases in the lease database, i.e. create, modify
and remove DHCPv6 leases as a result of processing messages from
the clients.</simpara>
</listitem>
<listitem>
<simpara><command>kea-dhcp6.bad-packets</command> - this is the
logger used by the DHCPv6 server deamon for logging inbound client
......@@ -269,6 +282,12 @@
for the particular hook point.
</simpara>
</listitem>
<listitem>
<simpara><command>kea-dhcp6.commands</command> - this logger is used
to log messages relating to the handling of commands received by the
the DHCPv6 server over the command channel.
</simpara>
</listitem>
<listitem>
<simpara><command>kea-dhcp6.ddns</command> - this logger is used by
the DHCPv6 server to log messages related to the Client FQDN option
......@@ -279,13 +298,6 @@
<simpara><command>kea-dhcp6.dhcp6</command> - this is the logger
used DHCPv6 server deamon to log basic operations.</simpara>
</listitem>
<listitem>
<simpara><command>kea-dhcp6.alloc-engine</command> - this is the
logger used by the lease allocation engine, which is responsible
for managing leases in the lease database, i.e. create, modify
and remove DHCPv6 leases as a result of processing messages from
the clients.</simpara>
</listitem>
<listitem>
<simpara><command>kea-dhcp6.dhcpsrv</command> - this is a base
logger for the libdhcpsrv library.</simpara>
......
/upgrade_1.0_to_2.0.sh
/upgrade_2.0_to_3.0.sh
/upgrade_3.0_to_4.0.sh
SUBDIRS = .
sqlscriptsdir = ${datarootdir}/${PACKAGE_NAME}/scripts/mysql
sqlscripts_DATA = dhcpdb_create.mysql upgrade_1.0_to_2.0.sh upgrade_2.0_to_3.0.sh
sqlscripts_DATA = dhcpdb_create.mysql
sqlscripts_DATA += upgrade_1.0_to_2.0.sh
sqlscripts_DATA += upgrade_2.0_to_3.0.sh
sqlscripts_DATA += upgrade_3.0_to_4.0.sh
EXTRA_DIST = dhcpdb_create.mysql upgrade_1.0_to_2.0.sh upgrade_2.0_to_3.0.sh
EXTRA_DIST = ${sqlscripts_DATA}
......@@ -369,11 +369,12 @@ SELECT
l.hostname,
IFNULL(HEX(l.hwaddr), ''),
IFNULL(l.hwtype, ''),
IFNULL(l.hwaddr_source, ''),
IFNULL(h.name, ''),
IFNULL(s.name, '')
FROM lease6 l
left outer join lease6_types t on (l.lease_type = t.lease_type)
left outer join lease_state s on (l.state = s.state);
left outer join lease_state s on (l.state = s.state)
left outer join lease_hwaddr_source h on (l.hwaddr_source = h.hwaddr_source);
END $$
DELIMITER ;
......
#!/bin/sh
# Include utilities. Use installed version if available and
# use build version if it isn't.
if [ -e @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh ]; then
. @datarootdir@/@PACKAGE_NAME@/scripts/admin-utils.sh
else
. @abs_top_builddir@/src/bin/admin/admin-utils.sh
fi
VERSION=`mysql_version "$@"`
if [ "$VERSION" != "3.0" ]; then
printf "This script upgrades 3.0 to 4.0. Reported version is $VERSION. Skipping upgrade.\n"
exit 0
fi
mysql "$@" <<EOF
# Add state column to the lease4 table.
ALTER TABLE lease4
ADD COLUMN state INT UNSIGNED DEFAULT 0;
# Add state column to the lease6 table.
ALTER TABLE lease6
ADD COLUMN state INT UNSIGNED DEFAULT 0;
# Create indexes for querying leases in a given state and segregated
# by the expiration time. One of the applications is to retrieve all
# expired leases. However, these indexes can be also used to retrieve
# leases in a given state regardless of the expiration time.
CREATE INDEX lease4_by_state_expire ON lease4 (state, expire);
CREATE INDEX lease6_by_state_expire ON lease6 (state, expire);
# Create table holding mapping of the lease states to their names.
# This is not used in queries from the DHCP server but rather in
# direct queries from the lease database management tools.
CREATE TABLE IF NOT EXISTS lease_state (
state INT UNSIGNED PRIMARY KEY NOT NULL,
name VARCHAR(64) NOT NULL);
# Insert currently defined state names.
INSERT INTO lease_state VALUES (0, "default");
INSERT INTO lease_state VALUES (1, "declined");
INSERT INTO lease_state VALUES (2, "expired-reclaimed");
# FUNCTION that returns a result set containing the column names for lease4 dumps
DROP PROCEDURE IF EXISTS lease4DumpHeader;
DELIMITER $$
CREATE PROCEDURE lease4DumpHeader()
BEGIN
SELECT 'address,hwaddr,client_id,valid_lifetime,expire,subnet_id,fqdn_fwd,fqdn_rev,hostname,state';
END $$
DELIMITER ;
# FUNCTION that returns a result set containing the data for lease4 dumps
DROP PROCEDURE IF EXISTS lease4DumpData;
DELIMITER $$
CREATE PROCEDURE lease4DumpData()
BEGIN
SELECT
INET_NTOA(l.address),
IFNULL(HEX(l.hwaddr), ''),
IFNULL(HEX(l.client_id), ''),
l.valid_lifetime,
l.expire,
l.subnet_id,
l.fqdn_fwd,
l.fqdn_rev,
l.hostname,
s.name
from
lease4 l
LEFT OUTER JOIN lease_state s on (l.state = s.state);
END $$
DELIMITER ;
# FUNCTION that returns a result set containing the column names for lease6 dumps
DROP PROCEDURE IF EXISTS lease6DumpHeader;
DELIMITER $$
CREATE PROCEDURE lease6DumpHeader()
BEGIN
SELECT 'address,duid,valid_lifetime,expire,subnet_id,pref_lifetime,lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr,hwtype,hwaddr_source,state';
END $$
DELIMITER ;
# FUNCTION that returns a result set containing the data for lease6 dumps
DROP PROCEDURE IF EXISTS lease6DumpData;
DELIMITER $$
CREATE PROCEDURE lease6DumpData()
BEGIN
SELECT
l.address,
IFNULL(HEX(l.duid), ''),
l.valid_lifetime,
l.expire,
l.subnet_id,
l.pref_lifetime,
IFNULL(t.name, ''),
l.iaid,
l.prefix_len,
l.fqdn_fwd,
l.fqdn_rev,
l.hostname,
IFNULL(HEX(l.hwaddr), ''),
IFNULL(l.hwtype, ''),
IFNULL(h.name, ''),
IFNULL(s.name, '')
FROM lease6 l
left outer join lease6_types t on (l.lease_type = t.lease_type)
left outer join lease_state s on (l.state = s.state)
left outer join lease_hwaddr_source h on (l.hwaddr_source = h.hwaddr_source);
END $$
DELIMITER ;
# Update the schema version number
UPDATE schema_version
SET version = '4', minor = '0';
# This line concludes database upgrade to version 4.0.
EOF
RESULT=$?
exit $?
address,duid,valid_lifetime,expire,subnet_id,pref_lifetime,lease_type,iaid,prefix_len,fqdn_fwd,fqdn_rev,hostname,hwaddr,hwtype,hwaddr_source,state
10,3230,30,2015-04-04 01:15:30,40,50,IA_TA,60,70,1,1,one.example.com,3830,90,100,default
11,,30,2015-05-05 02:30:45,40,50,IA_TA,60,70,1,1,,3830,90,100,declined
12,3231,30,2015-06-06 11:01:07,40,50,IA_TA,60,70,1,1,three.example.com,3830,90,100,expired-reclaimed
10,3230,30,2015-04-04 01:15:30,40,50,IA_TA,60,70,1,1,one.example.com,3830,90,,default
11,,30,2015-05-05 02:30:45,40,50,IA_TA,60,70,1,1,,3830,90,HWADDR_SOURCE_RAW,declined
12,3231,30,2015-06-06 11:01:07,40,50,IA_TA,60,70,1,1,three.example.com,3830,90,HWADDR_SOURCE_DUID,expired-reclaimed
......@@ -212,7 +212,7 @@ mysql_upgrade_test() {
assert_str_eq "1.0" ${version} "Expected kea-admin to return %s, returned value was %s"
# Ok, we have a 1.0 database. Let's upgrade it to 3.0
# Ok, we have a 1.0 database. Let's upgrade it to 4.0
${keaadmin} lease-upgrade mysql -u $db_user -p $db_password -n $db_name -d @abs_top_srcdir@/src/bin/admin/scripts
ERRCODE=$?
......@@ -263,9 +263,38 @@ EOF
assert_eq 0 $ERRCODE "dhcp6_options table is missing or broken. (returned status code %d, expected %d)"
# Verify that it reports version 3.0.
#table: lease_state table added (upgrade 3.0 -> 4.0)
mysql -u$db_user -p$db_password $db_name >/dev/null 2>&1 <<EOF
SELECT state,name from lease_state;
EOF
ERRCODE=$?
assert_eq 0 $ERRCODE "dhcp6_options table is missing or broken. (returned status code %d, expected %d)"
#table: state column added to lease4 (upgrade 3.0 -> 4.0)
mysql -u$db_user -p$db_password $db_name >/dev/null 2>&1 <<EOF
SELECT state from lease4;
EOF
ERRCODE=$?
assert_eq 0 $ERRCODE "lease4 is missing state column. (returned status code %d, expected %d)"
#table: state column added to lease6 (upgrade 3.0 -> 4.0)
mysql -u$db_user -p$db_password $db_name >/dev/null 2>&1 <<EOF
SELECT state from lease6;
EOF
ERRCODE=$?
assert_eq 0 $ERRCODE "lease6 is missing state column. (returned status code %d, expected %d)"
#table: stored procedures for lease dumps added (upgrade 3.0 -> 4.0)
mysql -u$db_user -p$db_password $db_name >/dev/null 2>&1 <<EOF
call lease4DumpHeader(); call lease4DumpData(); call lease6DumpHeader(); call lease6DumpHeader();
EOF
ERRCODE=$?
assert_eq 0 $ERRCODE "lease dump stored procedures are missing or broken. (returned status code %d, expected %d)"
# Verify that it reports version 4.0.
version=$(${keaadmin} lease-version mysql -u $db_user -p $db_password -n $db_name)
assert_str_eq "3.0" ${version} "Expected kea-admin to return %s, returned value was %s"
assert_str_eq "4.0" ${version} "Expected kea-admin to return %s, returned value was %s"
# Let's wipe the whole database
mysql_wipe
......@@ -366,9 +395,9 @@ mysql_lease6_dump_test() {
# Insert the reference record
insert_sql="\
insert into lease6 values(10,20,30,\"2015-04-04 01:15:30\",40,50,1,60,70,1,1,\"one.example.com\",80,90,100, 0);\
insert into lease6 values(11,NULL,30,\"2015-05-05 02:30:45\",40,50,1,60,70,1,1,\"\",80,90,100, 1);\
insert into lease6 values(12,21,30,\"2015-06-06 11:01:07\",40,50,1,60,70,1,1,\"three.example.com\",80,90,100, 2);"
insert into lease6 values(10,20,30,\"2015-04-04 01:15:30\",40,50,1,60,70,1,1,\"one.example.com\",80,90,0,0);\
insert into lease6 values(11,NULL,30,\"2015-05-05 02:30:45\",40,50,1,60,70,1,1,\"\",80,90,1,1);\
insert into lease6 values(12,21,30,\"2015-06-06 11:01:07\",40,50,1,60,70,1,1,\"three.example.com\",80,90,4,2);"
mysql_execute "$insert_sql"
ERRCODE=$?
......
......@@ -135,20 +135,6 @@ ControlledDhcpv4Srv::processConfig(isc::data::ConstElementPtr config) {
ConstElementPtr answer = configureDhcp4Server(*srv, config);
// Start worker thread if there are any timers installed. Note that
// we also start worker thread when the reconfiguration failed, because
// in that case we continue using an old configuration and the server
// should still run installed timers.
if (TimerMgr::instance()->timersCount() > 0) {
try {
TimerMgr::instance()->startThread();
} catch (const std::exception& ex) {
err << "Unable to start worker thread running timers: "
<< ex.what() << ".";
return (isc::config::createAnswer(1, err.str()));
}
}
// Check that configuration was successful. If not, do not reopen sockets
// and don't bother with DDNS stuff.
try {
......@@ -181,6 +167,32 @@ ControlledDhcpv4Srv::processConfig(isc::data::ConstElementPtr config) {
CfgMgr::instance().getStagingCfg()->getCfgIface()->
openSockets(AF_INET, srv->getPort(), getInstance()->useBroadcast());
// Install the timers for handling leases reclamation.
try {
CfgMgr::instance().getStagingCfg()->getCfgExpiration()->
setupTimers(&ControlledDhcpv4Srv::reclaimExpiredLeases,
&ControlledDhcpv4Srv::deleteExpiredReclaimedLeases,
server_);
} catch (const std::exception& ex) {
err << "unable to setup timers for periodically running the"
" reclamation of the expired leases: "
<< ex.what() << ".";
return (isc::config::createAnswer(1, err.str()));
}
// Start worker thread if there are any timers installed.
if (TimerMgr::instance()->timersCount() > 0) {
try {
TimerMgr::instance()->startThread();
} catch (const std::exception& ex) {
err << "Unable to start worker thread running timers: "
<< ex.what() << ".";
return (isc::config::createAnswer(1, err.str()));
}
}
return (answer);
}
......@@ -229,8 +241,10 @@ ControlledDhcpv4Srv::~ControlledDhcpv4Srv() {
try {
cleanup();
// Stop worker thread running timers, if it is running.
// Stop worker thread running timers, if it is running. Then
// unregister any timers.
timer_mgr_->stopThread();
timer_mgr_->unregisterTimers();
// Close the command socket (if it exists).
CommandMgr::instance().closeCommandSocket();
......@@ -262,5 +276,24 @@ void ControlledDhcpv4Srv::sessionReader(void) {
}
}
void
ControlledDhcpv4Srv::reclaimExpiredLeases(const size_t max_leases,
const uint16_t timeout,
const bool remove_lease,
const uint16_t max_unwarned_cycles) {
server_->alloc_engine_->reclaimExpiredLeases4(max_leases, timeout,
remove_lease,
max_unwarned_cycles);
// We're using the ONE_SHOT timer so there is a need to re-schedule it.
TimerMgr::instance()->setup(CfgExpiration::RECLAIM_EXPIRED_TIMER_NAME);
}
void
ControlledDhcpv4Srv::deleteExpiredReclaimedLeases(const uint32_t secs) {
server_->alloc_engine_->deleteExpiredReclaimedLeases4(secs);
// We're using the ONE_SHOT timer so there is a need to re-schedule it.
TimerMgr::instance()->setup(CfgExpiration::FLUSH_RECLAIMED_TIMER_NAME);
}
}; // end of isc::dhcp namespace
}; // end of isc namespace
......@@ -150,6 +150,37 @@ private:
commandConfigReloadHandler(const std::string& command,
isc::data::ConstElementPtr args);
/// @brief Reclaims expired IPv4 leases and reschedules timer.
///
/// This is a wrapper method for @c AllocEngine::reclaimExpiredLeases4.
/// It reschedules the timer for leases reclamation upon completion of
/// this method.
///
/// @param max_leases Maximum number of leases to be reclaimed.
/// @param timeout Maximum amount of time that the reclaimation routine
/// may be processing expired leases, expressed in milliseconds.
/// @param remove_lease A boolean value indicating if the lease should
/// be removed when it is reclaimed (if true) or it should be left in the
/// database in the "expired-reclaimed" state (if false).
/// @param max_unwarned_cycles A number of consecutive processing cycles
/// of expired leases, after which the system issues a warning if there
/// are still expired leases in the database. If this value is 0, the
/// warning is never issued.
void reclaimExpiredLeases(const size_t max_leases, const uint16_t timeout,
const bool remove_lease,
const uint16_t max_unwarned_cycles);
/// @brief Deletes reclaimed leases and reschedules the timer.
///
/// This is a wrapper method for @c AllocEngine::deleteExpiredReclaimed4.
/// It reschedules the timer for leases reclamation upon completion of
/// this method.
///
/// @param secs Minimum number of seconds after which a lease can be
/// deleted.
void deleteExpiredReclaimedLeases(const uint32_t secs);
/// @brief Static pointer to the sole instance of the DHCP server.
///
/// This is required for config and command handlers to gain access to
......
......@@ -40,8 +40,10 @@
- Description of the hook. This explains where in the processing the hook
is located, the possible actions a callout attached to this hook could take,
and a description of the data passed to the callouts.
- Skip flag action: the action taken by the server if a callout chooses to set
the "skip" flag.
- Next step status: the action taken by the server when a callout chooses to set
status to specified value. Actions not listed explicitly are not supported.
If a callout sets status to unsupported value, this specific value will be
ignored and treated as if the status was CONTINUE.
@section dhcpv4HooksHookPoints Hooks in the DHCPv4 Server
......@@ -64,7 +66,7 @@ packet processing. Hook points that are not specific to packet processing
are set yet. Callouts installed on this hook point can modify the data
in the received buffer. The server will parse the buffer afterwards.
- <b>Skip flag action</b>: If any callout sets the skip flag, the server will
- <b>Next step status</b>: If any callout sets the status to SKIP, the server will
skip the buffer parsing. In this case there is an expectation that
the callout will parse the options carried in the buffer, create
@c isc::dhcp::Option objects (or derived) and add them to the "query4"
......@@ -90,7 +92,7 @@ packet processing. Hook points that are not specific to packet processing
field has been already parsed and stored in other fields. Therefore,
the modification in the data_ field has no effect.
- <b>Skip flag action</b>: If any callout sets the skip flag, the server will
- <b>Next step status</b>: If any callout sets the status to SKIP, the server will
drop the packet and start processing the next one. The reason for the drop
will be logged if logging is set to the appropriate debug level.
......@@ -109,9 +111,9 @@ packet processing. Hook points that are not specific to packet processing
configured are provided as "subnet4collection". The list itself must
not be modified.
- <b>Skip flag action</b>: If any callout, installed on "subnet4_select",
sets the skip flag, the server will not select any subnet. Packet processing
will continue, but will be severely limited.
- <b>Next step status</b>: If any callout installed on the "subnet4_select" hook
sets the next step status to SKIP, the server will not select any subnet.
Packet processing will continue, but will be severely limited.
@subsection dhcpv4HooksLeaseSelect lease4_select
......@@ -134,11 +136,11 @@ packet processing. Hook points that are not specific to packet processing
lease won't be inserted into the database (DHCPDISCOVER case), a value of
false indicates that it will (DHCPREQUEST case).
- <b>Skip flag action</b>: If any callout installed on "lease4_select"
sets the skip flag, the server will not assign any lease and the callouts
become responsible for the lease assignment. If the callouts fail to provide
a lease, the packet processing will continue, but client will not get
an address.
- <b>Next step status</b>: If any callout installed on the "lease4_select" hook
sets the next step action to SKIP, the server will not assign any lease and
the callouts become responsible for the lease assignment. If the callouts
fail to provide a lease, the packet processing will continue, but client
will not get an address.
@subsection dhcpv4HooksLeaseRenew lease4_renew
......@@ -155,8 +157,8 @@ packet processing. Hook points that are not specific to packet processing
be taken as the server will attempt to update the lease in the database
without any additional checks.
- <b>Skip flag action</b>: If any callout installed on "lease4_renew"
sets the skip flag, the server will not update the lease in the
- <b>Next step status</b>: If any callout installed on the "lease4_renew" hook
sets the next step action to SKIP, the server will not update the lease in the
database and will continue using the old values instead.
@subsection dhcpv4HooksLeaseRelease lease4_release
......@@ -170,11 +172,34 @@ packet processing. Hook points that are not specific to packet processing
The "lease4" argument points to @c Lease4 object that contains the lease to
be released. It doesn't make sense to modify it at this time.
- <b>Skip flag action</b>: If any callout installed on "lease4_release"
sets the skip flag, the server will not delete the lease. It will be
kept in the database and will go through the regular expiration/reuse
- <b>Next step status</b>: If any callout installed on the "lease4_release" hook
sets the next step action to SKIP, the server will not delete the lease.
It will be kept in the database and will go through the regular expiration/reuse
process.
@subsection dhcpv4HooksLeaseDecline lease4_decline
- @b Arguments:
- name: @b query4, type: isc::dhcp::Pkt4Ptr, direction: <b>in</b>
- name: @b lease4, type: isc::dhcp::Lease4Ptr, direction: <b>in</b>
- @b Description: this callout is executed when the server engine
is about to decline a lease, as a result of receiving DHCPDECLINE packet.
The server already sanity checked it (the packet is sane, attempts to decline
a lease that is valid and belongs to the client that requests its decline).
The "lease4" argument points to @c Lease4 object that contains the lease to
be released. Note this lease still contains client identifying information.
That data is provided for informational purposes and it doesn't make sense to
modify it at this time. All the information will be removed from the lease
before it is updated in the database.
- <b>Next step status</b>: If any callout installed on the "lease4_release" hook
sets the next step action to DROP, the server will not decline the lease.
Care should be taken when setting this status. The lease will be kept in
the database as it is and the client will incorrectly assume that the server
marked this lease as unavailable. If the client restarts its configuration,
it will get the same (not declined) lease as a result.
@subsection dhcpv4HooksPkt4Send pkt4_send
- @b Arguments:
......@@ -190,10 +215,11 @@ packet processing. Hook points that are not specific to packet processing
pkt4_send callouts are complete, so any changes to that field will
be overwritten.)