Commit 6d3fb27d authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰

[2320] Allocation Engine hooked up to DHCPv4 server

 - DORA support added
 - REQUEST/Renewing support added
 - RELEASE support added
 - AllocationEngine now supports lease4 renewals
 - many other smaller code additions
 - many tests written
parent 32e13fbf
......@@ -26,12 +26,6 @@ to establish a session with the BIND 10 control channel.
A debug message listing the command (and possible arguments) received
from the BIND 10 control system by the IPv4 DHCP server.
% DHCP4_CONFIG_COMPLETE DHCPv4 server has completed configuration: %1
This is an informational message announcing the successful processing of a
new configuration. it is output during server startup, and when an updated
configuration is committed by the administrator. Additional information
may be provided.
% DHCP4_CONFIG_LOAD_FAIL failed to load configuration: %1
This critical error message indicates that the initial DHCPv4
configuration has failed. The server will start, but nothing will be
......@@ -41,19 +35,51 @@ served until the configuration has been corrected.
This is an informational message reporting that the configuration has
been extended to include the specified IPv4 subnet.
% DHCP4_CONFIG_OPTION_DUPLICATE multiple options with the code: %1 added to the subnet: %2
This warning message is issued on an attempt to configure multiple options with the
same option code for the particular subnet. Adding multiple options is uncommon
for DHCPv4, but it is not prohibited.
% DHCP4_CONFIG_UPDATE updated configuration received: %1
A debug message indicating that the IPv4 DHCP server has received an
updated configuration from the BIND 10 configuration system.
% DHCP4_CONFIG_START DHCPv4 server is processing the following configuration: %1
This is a debug message that is issued every time the server receives a
configuration. That happens at start up and also when a server configuration
change is committed by the administrator.
% DHCP4_CONFIG_UPDATE updated configuration received: %1
A debug message indicating that the IPv4 DHCP server has received an
updated configuration from the BIND 10 configuration system.
% DHCP4_CONFIG_COMPLETE DHCPv4 server has completed configuration: %1
This is an informational message announcing the successful processing of a
new configuration. it is output during server startup, and when an updated
configuration is committed by the administrator. Additional information
may be provided.
% DHCP4_CONFIG_OPTION_DUPLICATE multiple options with the code: %1 added to the subnet: %2
This warning message is issued on an attempt to configure multiple options with the
same option code for the particular subnet. Adding multiple options is uncommon
for DHCPv4, but it is not prohibited.
% DHCP4_DB_BACKEND_STARTED lease database started (type: %1, name: %2)
This informational message is printed every time DHCPv4 server is started.
It indicates what database backend type is being to store lease and
other information.
% DHCP4_LEASE_ADVERT lease %1 advertised (client client-id=%2, iaid=%3)
This debug message indicates that the server successfully advertised
a lease. It is up to the client to choose one server out of othe advertised
and continue allocation with that server. This is a normal behavior and
indicates successful operation.
% DHCP4_LEASE_ADVERT_FAIL failed to advertise a lease for client client-id=%1, iaid=%2
This message indicates that the server failed to offer (in response to
received DISCOVER) a lease for a given client. There may be many reasons for
such failure. Each specific failure is logged in a separate log entry.
% DHCP4_LEASE_ALLOC lease %1 has been allocated (client duid=%2, iaid=%3)
This debug message indicates that the server successfully granted (in
response to client's REQUEST message) a lease. This is a normal behavior
and incicates successful operation.
% DHCP4_LEASE_ALLOC_FAIL failed to grant a lease for client duid=%1, iaid=%2
This message indicates that the server failed to grant (in response to
received REQUEST) a lease for a given client. There may be many reasons for
such failure. Each specific failure is logged in a separate log entry.
% DHCP4_NOT_RUNNING IPv4 DHCP server is not running
A warning message is issued when an attempt is made to shut down the
......@@ -91,6 +117,36 @@ to be a programming error: please raise a bug report.
% DHCP4_QUERY_DATA received packet type %1, data is <%2>
A debug message listing the data received from the client.
% DHCP4_RELEASE address %1 belonging to client-id=%2, hwaddr=%3 was released properly.
This debug message indicates that an address was released properly. It
is a normal operation during client shutdown.
% DHCP4_RELEASE_FAIL failed to remove lease for address %1 for duid=%2, hwaddr=%3
This error message indicates that the software failed to remove a
lease from the lease database. It is probably due to an error during a
database operation: resolution will most likely require administrator
intervention (e.g. check if DHCP process has sufficient privileges to
update the database). It may also be triggered if a lease was manually
removed from the database during RELEASE message processing.
% DHCP4_RELEASE_FAIL_NO_LEASE client (client-id=%2) tried to release address %1, but there is no lease for such address.
This warning message is printed when client attempts to release a lease,
but no such lease is known by the server.
% DHCP4_RELEASE_FAIL_WRONG_CLIENT_ID client (client-id=%2) tried to release address %1, but it belongs to client (client-id=%3)
This warning message indicates that client tried to release an address
that belongs to a different client. This should not happen in normal
circumstances and may indicate a misconfiguration of the client. However,
since the client releasing the address will stop using it anyway, there
is a good chance that the situation will correct itself.
% DHCP4_RELEASE_FAIL_WRONG_HWADDR client (client-id=%2) tried to release address %1, but sent from a wrong hardware address (%3)
This warning message indicates that client tried to release an address
that does belong to it, but the lease information was associated with a different
hardware address. One possible reason for using different hardware address is
that a cloned virtual machine was not updated and both clones use the same
client-id.
% DHCP4_RESPONSE_DATA responding with packet type %1, data is <%2>
A debug message listing the data returned to the client.
......@@ -131,3 +187,13 @@ processed any command-line switches and is starting.
This is a debug message issued during the IPv4 DHCP server startup.
It lists some information about the parameters with which the server
is running.
% DHCP4_SUBNET_SELECTED the %1 subnet was selected for client assignment
This is a debug message informing that a given subnet was selected. It will
be used for address and option assignment. This is one of the early steps
in the processing of incoming client message.
% DHCP4_SUBNET_SELECTION_FAILED failed to select a subnet for incoming packet, src=%1 type=%2
This warning message is output when a packet was received from a subnet for
which the DHCPv4 server has not been configured. The cause is most likely due
to a misconfiguration of the server.
......@@ -16,9 +16,19 @@
#include <dhcp/dhcp4.h>
#include <dhcp/iface_mgr.h>
#include <dhcp/option4_addrlst.h>
#include <dhcp/option_int.h>
#include <dhcp/pkt4.h>
#include <dhcp/duid.h>
#include <dhcp/hwaddr.h>
#include <dhcp4/dhcp4_log.h>
#include <dhcp4/dhcp4_srv.h>
#include <dhcpsrv/utils.h>
#include <dhcpsrv/cfgmgr.h>
#include <dhcpsrv/lease_mgr.h>
#include <dhcpsrv/lease_mgr_factory.h>
#include <dhcpsrv/subnet.h>
#include <dhcpsrv/utils.h>
#include <dhcpsrv/addr_utilities.h>
using namespace isc;
using namespace isc::asiolink;
......@@ -28,26 +38,35 @@ using namespace std;
// These are hardcoded parameters. Currently this is a skeleton server that only
// grants those options and a single, fixed, hardcoded lease.
const std::string HARDCODED_LEASE = "192.0.2.222"; // assigned lease
const std::string HARDCODED_NETMASK = "255.255.255.0";
const uint32_t HARDCODED_LEASE_TIME = 60; // in seconds
const std::string HARDCODED_GATEWAY = "192.0.2.1";
const std::string HARDCODED_DNS_SERVER = "192.0.2.2";
const std::string HARDCODED_DOMAIN_NAME = "isc.example.com";
const std::string HARDCODED_SERVER_ID = "192.0.2.1";
Dhcpv4Srv::Dhcpv4Srv(uint16_t port) {
Dhcpv4Srv::Dhcpv4Srv(uint16_t port, const char* dbconfig) {
LOG_DEBUG(dhcp4_logger, DBG_DHCP4_START, DHCP4_OPEN_SOCKET).arg(port);
try {
// First call to instance() will create IfaceMgr (it's a singleton)
// it may throw something if things go wrong
IfaceMgr::instance();
/// @todo: instantiate LeaseMgr here once it is imlpemented.
IfaceMgr::instance().openSockets4(port);
if (port) {
// open sockets only if port is non-zero. Port 0 is used
// for non-socket related testing.
IfaceMgr::instance().openSockets4(port);
}
setServerID();
// Instantiate LeaseMgr
LeaseMgrFactory::create(dbconfig);
LOG_INFO(dhcp4_logger, DHCP4_DB_BACKEND_STARTED)
.arg(LeaseMgrFactory::instance().getType())
.arg(LeaseMgrFactory::instance().getName());
// Instantiate allocation engine
alloc_engine_.reset(new AllocEngine(AllocEngine::ALLOC_ITERATIVE, 100));
} catch (const std::exception &e) {
LOG_ERROR(dhcp4_logger, DHCP4_SRV_CONSTRUCT_ERROR).arg(e.what());
shutdown_ = true;
......@@ -167,18 +186,11 @@ Dhcpv4Srv::run() {
void
Dhcpv4Srv::setServerID() {
/// TODO implement this for real once interface detection (ticket 1237)
/// is done. Use hardcoded server-id for now.
#if 0
// uncomment this once ticket 1350 is merged.
IOAddress srvId("127.0.0.1");
serverid_ = OptionPtr(
new Option4AddrLst(Option::V4, DHO_DHCP_SERVER_IDENTIFIER, srvId));
#endif
/// @todo: implement this for real (see ticket #2588)
serverid_ = OptionPtr(new Option4AddrLst(DHO_DHCP_SERVER_IDENTIFIER,
IOAddress(HARDCODED_SERVER_ID)));
}
void Dhcpv4Srv::copyDefaultFields(const Pkt4Ptr& question, Pkt4Ptr& answer) {
answer->setIface(question->getIface());
answer->setIndex(question->getIndex());
......@@ -201,6 +213,10 @@ void Dhcpv4Srv::copyDefaultFields(const Pkt4Ptr& question, Pkt4Ptr& answer) {
answer->setRemoteAddr(question->getRemoteAddr());
}
OptionPtr client_id = question->getOption(DHO_DHCP_CLIENT_IDENTIFIER);
if (client_id) {
answer->addOption(client_id);
}
}
void Dhcpv4Srv::appendDefaultOptions(Pkt4Ptr& msg, uint8_t msg_type) {
......@@ -213,9 +229,7 @@ void Dhcpv4Srv::appendDefaultOptions(Pkt4Ptr& msg, uint8_t msg_type) {
msg->addOption(opt);
// DHCP Server Identifier (type 54)
opt = OptionPtr
(new Option4AddrLst(DHO_DHCP_SERVER_IDENTIFIER, IOAddress(HARDCODED_SERVER_ID)));
msg->addOption(opt);
msg->addOption(getServerID());
// more options will be added here later
}
......@@ -235,25 +249,125 @@ void Dhcpv4Srv::appendRequestedOptions(Pkt4Ptr& msg) {
msg->addOption(opt);
}
void Dhcpv4Srv::tryAssignLease(Pkt4Ptr& msg) {
OptionPtr opt;
void Dhcpv4Srv::assignLease(const Pkt4Ptr& question, Pkt4Ptr& answer) {
// We need to select a subnet the client is connected in.
Subnet4Ptr subnet = selectSubnet(question);
if (!subnet) {
// This particular client is out of luck today. We do not have
// information about the subnet he is connected to. This likely means
// misconfiguration of the server (or some relays). We will continue to
// process this message, but our response will be almost useless: no
// addresses or prefixes, no subnet specific configuration etc. The only
// thing this client can get is some global information (like DNS
// servers).
// perhaps this should be logged on some higher level? This is most likely
// configuration bug.
LOG_ERROR(dhcp4_logger, DHCP4_SUBNET_SELECTION_FAILED)
.arg(question->getRemoteAddr().toText())
.arg(serverReceivedPacketName(question->getType()));
setMsgType(answer, DHCPNAK);
answer->setYiaddr(IOAddress("0.0.0.0"));
return;
} else {
LOG_DEBUG(dhcp4_logger, DBG_DHCP4_DETAIL_DATA, DHCP4_SUBNET_SELECTED)
.arg(subnet->toText());
}
// TODO: Implement actual lease assignment here
msg->setYiaddr(IOAddress(HARDCODED_LEASE));
// Get client-id option
ClientIdPtr client_id;
OptionPtr opt = question->getOption(DHO_DHCP_CLIENT_IDENTIFIER);
if (opt) {
client_id = ClientIdPtr(new ClientId(opt->getData()));
}
// client-id is not mandatory in DHCPv4
// IP Address Lease time (type 51)
opt = OptionPtr(new Option(Option::V4, DHO_DHCP_LEASE_TIME));
opt->setUint32(HARDCODED_LEASE_TIME);
msg->addOption(opt);
// TODO: create Option_IntArray that holds list of integers, similar to Option4_AddrLst
IOAddress hint = question->getYiaddr();
// Subnet mask (type 1)
opt = OptionPtr(new Option4AddrLst(DHO_SUBNET_MASK, IOAddress(HARDCODED_NETMASK)));
msg->addOption(opt);
HWAddrPtr hwaddr = question->getHWAddr();
// Router (type 3)
opt = OptionPtr(new Option4AddrLst(DHO_ROUTERS, IOAddress(HARDCODED_GATEWAY)));
msg->addOption(opt);
// "Fake" allocation is processing of DISCOVER message. We pretend to do an
// allocation, but we do not put the lease in the database. That is ok,
// because we do not guarantee that the user will get that exact lease. If
// the user selects this server to do actual allocation (i.e. sends REQUEST)
// it should include this hint. That will help us during the actual lease
// allocation.
bool fake_allocation = false;
if (question->getType() == DHCPDISCOVER) {
fake_allocation = true;
}
// Use allocation engine to pick a lease for this client. Allocation engine
// will try to honour the hint, but it is just a hint - some other address
// may be used instead. If fake_allocation is set to false, the lease will
// be inserted into the LeaseMgr as well.
Lease4Ptr lease = alloc_engine_->allocateAddress4(subnet, client_id, hwaddr,
hint, fake_allocation);
if (lease) {
// We have a lease! Let's wrap its content into IA_NA option
// with IAADDR suboption.
LOG_DEBUG(dhcp4_logger, DBG_DHCP4_DETAIL, fake_allocation?
DHCP4_LEASE_ADVERT:DHCP4_LEASE_ALLOC)
.arg(client_id?client_id->toText():"(no client-id)")
.arg(hwaddr?hwaddr->toText():"(no hwaddr info)")
.arg(hint.toText());
answer->setYiaddr(lease->addr_);
// IP Address Lease time (type 51)
opt = OptionPtr(new Option(Option::V4, DHO_DHCP_LEASE_TIME));
opt->setUint32(lease->valid_lft_);
answer->addOption(opt);
// @todo: include real router information here
// Router (type 3)
opt = OptionPtr(new Option4AddrLst(DHO_ROUTERS, IOAddress(HARDCODED_GATEWAY)));
answer->addOption(opt);
// Subnet mask (type 1)
answer->addOption(getNetmaskOption(subnet));
// @todo: send renew timer option (T1, option 58)
// @todo: send rebind timer option (T2, option 59)
} else {
// Allocation engine did not allocate a lease. The engine logged
// cause of that failure. The only thing left is to insert
// status code to pass the sad news to the client.
LOG_DEBUG(dhcp4_logger, DBG_DHCP4_DETAIL, fake_allocation?
DHCP4_LEASE_ADVERT_FAIL:DHCP4_LEASE_ALLOC_FAIL)
.arg(client_id?client_id->toText():"(no client-id)")
.arg(hwaddr?hwaddr->toText():"(no hwaddr info)")
.arg(hint.toText());
setMsgType(answer, DHCPNAK);
answer->setYiaddr(IOAddress("0.0.0.0"));
}
}
OptionPtr Dhcpv4Srv::getNetmaskOption(const Subnet4Ptr& subnet) {
uint32_t netmask = getNetmask4(subnet->get().second);
OptionPtr opt(new OptionInt<uint32_t>(Option::V4,
DHO_SUBNET_MASK, netmask));
return (opt);
}
void Dhcpv4Srv::setMsgType(Pkt4Ptr& pkt, uint8_t dhcp_type) {
OptionPtr opt = pkt->getOption(DHO_DHCP_MESSAGE_TYPE);
if (opt) {
// There is message type option already, update it
opt->setUint8(dhcp_type);
} else {
// There is no message type option yet, add it
std::vector<uint8_t> tmp(1, dhcp_type);
opt = OptionPtr(new Option(Option::V4, DHO_DHCP_MESSAGE_TYPE, tmp));
pkt->addOption(opt);
}
}
Pkt4Ptr Dhcpv4Srv::processDiscover(Pkt4Ptr& discover) {
......@@ -264,7 +378,7 @@ Pkt4Ptr Dhcpv4Srv::processDiscover(Pkt4Ptr& discover) {
appendDefaultOptions(offer, DHCPOFFER);
appendRequestedOptions(offer);
tryAssignLease(offer);
assignLease(discover, offer);
return (offer);
}
......@@ -277,13 +391,56 @@ Pkt4Ptr Dhcpv4Srv::processRequest(Pkt4Ptr& request) {
appendDefaultOptions(ack, DHCPACK);
appendRequestedOptions(ack);
tryAssignLease(ack);
assignLease(request, ack);
return (ack);
}
void Dhcpv4Srv::processRelease(Pkt4Ptr& release) {
/// TODO: Implement this.
ClientIdPtr client_id;
OptionPtr opt = release->getOption(DHO_DHCP_CLIENT_IDENTIFIER);
if (opt) {
client_id = ClientIdPtr(new ClientId(opt->getData()));
}
Lease4Ptr lease = LeaseMgrFactory::instance().getLease4(release->getYiaddr());
if (!lease) {
LOG_DEBUG(dhcp4_logger, DBG_DHCP4_DETAIL, DHCP4_RELEASE_FAIL_NO_LEASE)
.arg(release->getYiaddr().toText())
.arg(release->getHWAddr()->toText())
.arg(client_id ? client_id->toText() : "(no client-id)");
return;
}
if (lease->hwaddr_ != release->getHWAddr()->hwaddr_) {
// @todo: Print hwaddr from lease as part of ticket #2589
LOG_DEBUG(dhcp4_logger, DBG_DHCP4_DETAIL, DHCP4_RELEASE_FAIL_WRONG_HWADDR)
.arg(release->getYiaddr().toText())
.arg(client_id ? client_id->toText() : "(no client-id)")
.arg(release->getHWAddr()->toText());
return;
}
if (lease->client_id_ && client_id && *lease->client_id_ != *client_id) {
LOG_DEBUG(dhcp4_logger, DBG_DHCP4_DETAIL, DHCP4_RELEASE_FAIL_WRONG_CLIENT_ID)
.arg(release->getYiaddr().toText())
.arg(client_id->toText())
.arg(lease->client_id_->toText());
return;
}
if (LeaseMgrFactory::instance().deleteLease(lease->addr_)) {
LOG_DEBUG(dhcp4_logger, DBG_DHCP4_DETAIL, DHCP4_RELEASE)
.arg(lease->addr_.toText())
.arg(client_id ? client_id->toText() : "(no client-id)")
.arg(release->getHWAddr()->toText());
} else {
LOG_ERROR(dhcp4_logger, DHCP4_RELEASE_FAIL)
.arg(lease->addr_.toText())
.arg(client_id ? client_id->toText() : "(no client-id)")
.arg(release->getHWAddr()->toText());
}
}
void Dhcpv4Srv::processDecline(Pkt4Ptr& decline) {
......@@ -325,3 +482,33 @@ Dhcpv4Srv::serverReceivedPacketName(uint8_t type) {
}
return (UNKNOWN);
}
Subnet4Ptr Dhcpv4Srv::selectSubnet(const Pkt4Ptr& question) {
Subnet4Ptr subnet = CfgMgr::instance().getSubnet4(question->getRemoteAddr());
return (subnet);
}
void Dhcpv4Srv::sanityCheck(const Pkt4Ptr& pkt, RequirementLevel serverid) {
OptionPtr server_id = pkt->getOption(DHO_DHCP_SERVER_IDENTIFIER);
switch (serverid) {
case FORBIDDEN:
if (server_id) {
isc_throw(RFCViolation, "Server-id option was not expected, but "
<< "received in " << serverReceivedPacketName(pkt->getType()));
}
break;
case MANDATORY:
if (!server_id) {
isc_throw(RFCViolation, "Server-id option was expected, but not "
" received in message "
<< serverReceivedPacketName(pkt->getType()));
}
break;
case OPTIONAL:
// do nothing here
;
}
}
......@@ -18,14 +18,16 @@
#include <dhcp/dhcp4.h>
#include <dhcp/pkt4.h>
#include <dhcp/option.h>
#include <dhcpsrv/subnet.h>
#include <dhcpsrv/alloc_engine.h>
#include <boost/noncopyable.hpp>
#include <iostream>
namespace isc {
namespace dhcp {
/// @brief DHCPv4 server service.
///
/// This singleton class represents DHCPv4 server. It contains all
......@@ -44,6 +46,14 @@ namespace dhcp {
class Dhcpv4Srv : public boost::noncopyable {
public:
/// @brief defines if certain option may, must or must not appear
typedef enum {
FORBIDDEN,
MANDATORY,
OPTIONAL
} RequirementLevel;
/// @brief Default constructor.
///
/// Instantiates necessary services, required to run DHCPv4 server.
......@@ -54,7 +64,10 @@ class Dhcpv4Srv : public boost::noncopyable {
/// for testing purposes.
///
/// @param port specifies port number to listen on
Dhcpv4Srv(uint16_t port = DHCP4_SERVER_PORT);
/// @param dbconfig Lease manager configuration string. The default
/// of the "memfile" manager is used for testing.
Dhcpv4Srv(uint16_t port = DHCP4_SERVER_PORT,
const char* dbconfig = "type=memfile");
/// @brief Destructor. Used during DHCPv4 service shutdown.
~Dhcpv4Srv();
......@@ -82,6 +95,8 @@ class Dhcpv4Srv : public boost::noncopyable {
/// As the operation of the method does not depend on any server state, it
/// is declared static.
///
/// @todo: This should be named static Pkt4::getName()
///
/// @param type DHCPv4 packet type
///
/// @return Pointer to "const" string containing the packet name.
......@@ -90,6 +105,17 @@ class Dhcpv4Srv : public boost::noncopyable {
static const char* serverReceivedPacketName(uint8_t type);
protected:
/// @brief verifies if specified packet meets RFC requirements
///
/// Checks if mandatory option is really there, that forbidden option
/// is not there, and that client-id or server-id appears only once.
///
/// @param pkt packet to be checked
/// @param serverid expectation regarding server-id option
/// @throw RFCViolation if any issues are detected
void sanityCheck(const Pkt4Ptr& pkt, RequirementLevel serverid);
/// @brief Processes incoming DISCOVER and returns response.
///
/// Processes received DISCOVER message and verifies that its sender
......@@ -156,11 +182,19 @@ protected:
/// client and assigning it. Options corresponding to the lease
/// are added to specific message.
///
/// Note: Lease manager is not implemented yet, so this method
/// used fixed, hardcoded lease.
/// @param question DISCOVER or REQUEST message from client
/// @param answer OFFER or ACK/NAK message (lease options will be added here)
void assignLease(const Pkt4Ptr& question, Pkt4Ptr& answer);
/// @brief Attempts to renew received addresses
///
/// Attempts to renew existing lease. This typically includes finding a lease that
/// corresponds to the received address. If no such lease is found, a status code
/// response is generated.
///
/// @param msg OFFER or ACK message (lease options will be added here)
void tryAssignLease(Pkt4Ptr& msg);
/// @param renew client's message asking for renew
/// @param reply server's response (ACK or NAK)
void renewLease(const Pkt4Ptr& renew, Pkt4Ptr& reply);
/// @brief Appends default options to a message
///
......@@ -173,6 +207,14 @@ protected:
/// @return server-id option
OptionPtr getServerID() { return serverid_; }
/// @brief Sets DHCPv4 message type
///
/// It tries to find existing DHCP TYPE (53) option and update
/// it to specified value. If there is no such option, it is
/// added.
static void setMsgType(Pkt4Ptr& pkt, uint8_t dhcp_type);
/// @brief Sets server-identifier.
///
/// This method attempts to set server-identifier DUID. It tries to
......@@ -184,12 +226,32 @@ protected:
// previously stored configuration and no network interfaces available)
void setServerID();
/// @brief Selects a subnet for a given client's packet.
///
/// @param question client's message
/// @return selected subnet (or NULL if no suitable subnet was found)
isc::dhcp::Subnet4Ptr selectSubnet(const Pkt4Ptr& question);
/// server DUID (to be sent in server-identifier option)
OptionPtr serverid_;
/// indicates if shutdown is in progress. Setting it to true will
/// initiate server shutdown procedure.
volatile bool shutdown_;
private:
/// @brief Constructs netmask option based on subnet4
///
/// @return Option that contains netmask information
static OptionPtr getNetmaskOption(const Subnet4Ptr& subnet);
/// @brief Allocation Engine.
/// Pointer to the allocation engine that we are currently using
/// It must be a pointer, because we will support changing engines
/// during normal operation (e.g. to use different allocators)
boost::shared_ptr<AllocEngine> alloc_engine_;
};
}; // namespace isc::dhcp
......
This diff is collapsed.
......@@ -61,7 +61,7 @@ A debug message indicating that the IPv6 DHCP server has received an
updated configuration from the BIND 10 configuration system.
% DHCP6_DB_BACKEND_STARTED lease database started (type: %1, name: %2)
This informational message is printed every time DHCPv6 is started.
This informational message is printed every time DHCPv6 server is started.
It indicates what database backend type is being to store lease and
other information.
......
......@@ -32,6 +32,7 @@
#include <dhcpsrv/lease_mgr.h>
#include <dhcpsrv/lease_mgr_factory.h>
#include <dhcpsrv/subnet.h>
#include <dhcpsrv/utils.h>
#include <exceptions/exceptions.h>
#include <util/io_utilities.h>
#include <util/range_utilities.h>
......@@ -405,7 +406,7 @@ void Dhcpv6Srv::sanityCheck(const Pkt6Ptr& pkt, RequirementLevel clientid,
switch (serverid) {