Kea  2.3.1-git
isc::dhcp::Dhcpv6Srv Class Reference

DHCPv6 server service. More...

#include <dhcp6_srv.h>

+ Inheritance diagram for isc::dhcp::Dhcpv6Srv:

Public Types

enum  RequirementLevel { FORBIDDEN, MANDATORY, OPTIONAL }
 defines if certain option may, must or must not appear More...
 

Public Member Functions

 Dhcpv6Srv (uint16_t server_port=DHCP6_SERVER_PORT, uint16_t client_port=0)
 Default constructor. More...
 
virtual ~Dhcpv6Srv ()
 Destructor. Used during DHCPv6 service shutdown. More...
 
virtual void d2ClientErrorHandler (const dhcp_ddns::NameChangeSender::Result result, dhcp_ddns::NameChangeRequestPtr &ncr)
 Implements the error handler for DHCP_DDNS IO errors. More...
 
void discardPackets ()
 Discards parked packets Clears the packet parking lots of all packets. More...
 
bool earlyGHRLookup (const Pkt6Ptr &query, AllocEngine::ClientContext6 &ctx)
 Initialize client context and perform early global reservations lookup. More...
 
CBControlDHCPv6Ptr getCBControl () const
 Returns an object which controls access to the configuration backends. More...
 
asiolink::IOServicePtrgetIOService ()
 Returns pointer to the IO service used by the server. More...
 
NetworkStatePtrgetNetworkState ()
 Returns pointer to the network state used by the server. More...
 
OptionPtr getServerID ()
 Returns server-identifier option. More...
 
bool inTestMode () const
 Checks if the server is running in unit test mode. More...
 
std::list< std::list< std::string > > jsonPathsToRedact () const final override
 Return a list of all paths that contain passwords or secrets for kea-dhcp6. More...
 
void processDhcp6Query (Pkt6Ptr &query, Pkt6Ptr &rsp)
 Process a single incoming DHCPv6 query. More...
 
void processDhcp6QueryAndSendResponse (Pkt6Ptr &query, Pkt6Ptr &rsp)
 Process a single incoming DHCPv6 query. More...
 
void processPacket (Pkt6Ptr &query, Pkt6Ptr &rsp)
 Process a single incoming DHCPv6 packet. More...
 
void processPacketAndSendResponse (Pkt6Ptr &query)
 Process a single incoming DHCPv6 packet and sends the response. More...
 
void processPacketAndSendResponseNoThrow (Pkt6Ptr &query)
 Process a single incoming DHCPv6 packet and sends the response. More...
 
void processPacketBufferSend (hooks::CalloutHandlePtr &callout_handle, Pkt6Ptr &rsp)
 Executes buffer6_send callout and sends the response. More...
 
int run ()
 Main server processing loop. More...
 
void run_one ()
 Main server processing step. More...
 
void sendResponseNoThrow (hooks::CalloutHandlePtr &callout_handle, Pkt6Ptr &query, Pkt6Ptr &rsp)
 Process an unparked DHCPv6 packet and sends the response. More...
 
void shutdown () override
 Instructs the server to shut down. More...
 
void startD2 ()
 Starts DHCP_DDNS client IO if DDNS updates are enabled. More...
 
void stopD2 ()
 Stops DHCP_DDNS client IO if DDNS updates are enabled. More...
 
Public accessors returning values required to (re)open sockets.
uint16_t getServerPort () const
 Get UDP port on which server should listen. More...
 
- Public Member Functions inherited from isc::process::Daemon
 Daemon ()
 Default constructor. More...
 
virtual ~Daemon ()
 Destructor. More...
 
void checkConfigFile () const
 Checks the configuration file name. More...
 
virtual void cleanup ()
 Performs final deconfiguration. More...
 
void createPIDFile (int pid=0)
 Creates the PID file. More...
 
std::string getConfigFile () const
 Returns config file name. More...
 
int getExitValue ()
 Fetches the exit value. More...
 
std::string getPIDFileDir () const
 Returns the directory used when forming default PID file name. More...
 
std::string getPIDFileName () const
 Returns the current PID file name. More...
 
isc::data::ConstElementPtr redactConfig (isc::data::ConstElementPtr const &config)
 Redact a configuration. More...
 
void setConfigFile (const std::string &config_file)
 Sets the configuration file name. More...
 
void setExitValue (int value)
 Sets the exit value. More...
 
void setPIDFileDir (const std::string &pid_file_dir)
 Sets the PID file directory. More...
 
void setPIDFileName (const std::string &pid_file_name)
 Sets PID file name. More...
 
virtual size_t writeConfigFile (const std::string &config_file, isc::data::ConstElementPtr cfg=isc::data::ConstElementPtr()) const
 Writes current configuration to specified file. More...
 

Static Public Member Functions

static uint16_t checkRelaySourcePort (const Pkt6Ptr &query)
 Used for DHCPv4-over-DHCPv6 too. More...
 
static int getHookIndexBuffer6Send ()
 Returns the index of the buffer6_send hook. More...
 
static std::string getVersion (bool extended)
 returns Kea version on stdout and exit. More...
 
static void processStatsSent (const Pkt6Ptr &response)
 Updates statistics for transmitted packets. More...
 
static void setHostIdentifiers (AllocEngine::ClientContext6 &ctx)
 Set host identifiers within a context. More...
 
- Static Public Member Functions inherited from isc::process::Daemon
static void configureLogger (const isc::data::ConstElementPtr &log_config, const isc::process::ConfigPtr &storage)
 Configures logger. More...
 
static std::string getDefaultLoggerName ()
 Returns default logger name. More...
 
static std::string getProcName ()
 returns the process name This value is used as when forming the default PID file name More...
 
static bool getVerbose ()
 Returns if running in verbose mode. More...
 
static std::string getVersion (bool extended)
 returns Kea version on stdout and exits. More...
 
static void loggerInit (const char *log_name, bool verbose)
 Initializes logger. More...
 
static void setDefaultLoggerName (const std::string &logger)
 Sets the default logger name. More...
 
static void setProcName (const std::string &proc_name)
 Sets the process name. More...
 
static void setVerbose (const bool verbose)
 Sets or clears verbose mode. More...
 

Static Public Attributes

static const size_t MIN_MAC_LEN = 6
 Minimum length of a MAC address to be used in DUID generation. More...
 

Protected Member Functions

void appendDefaultOptions (const Pkt6Ptr &question, Pkt6Ptr &answer, const CfgOptionList &co_list)
 Appends default options to server's answer. More...
 
void appendRequestedOptions (const Pkt6Ptr &question, Pkt6Ptr &answer, const CfgOptionList &co_list)
 Appends requested options to server's answer. More...
 
void appendRequestedVendorOptions (const Pkt6Ptr &question, Pkt6Ptr &answer, AllocEngine::ClientContext6 &ctx, const CfgOptionList &co_list)
 Appends requested vendor options to server's answer. More...
 
OptionPtr assignIA_NA (const isc::dhcp::Pkt6Ptr &query, AllocEngine::ClientContext6 &ctx, Option6IAPtr ia)
 Processes IA_NA option (and assigns addresses if necessary). More...
 
OptionPtr assignIA_PD (const Pkt6Ptr &query, AllocEngine::ClientContext6 &ctx, boost::shared_ptr< Option6IA > ia)
 Processes IA_PD option (and assigns prefixes if necessary). More...
 
void assignLeases (const Pkt6Ptr &question, Pkt6Ptr &answer, AllocEngine::ClientContext6 &ctx)
 Assigns leases. More...
 
void buildCfgOptionList (const Pkt6Ptr &question, AllocEngine::ClientContext6 &ctx, CfgOptionList &co_list)
 Build the configured option list. More...
 
void checkDynamicSubnetChange (const Pkt6Ptr &question, Pkt6Ptr &answer, AllocEngine::ClientContext6 &ctx, const Subnet6Ptr orig_subnet)
 Iterates over new leases, update stale DNS entries. More...
 
void classifyPacket (const Pkt6Ptr &pkt)
 Assigns incoming packet to zero or more classes. More...
 
void conditionallySetReservedClientClasses (const Pkt6Ptr &pkt, const AllocEngine::ClientContext6 &ctx)
 Assigns classes retrieved from host reservation database if they haven't been yet set. More...
 
void copyClientOptions (const Pkt6Ptr &question, Pkt6Ptr &answer)
 Copies required options from client message to server answer. More...
 
void createNameChangeRequests (const Pkt6Ptr &answer, AllocEngine::ClientContext6 &ctx)
 Creates a number of isc::dhcp_ddns::NameChangeRequest objects based on the DHCPv6 Client FQDN Option. More...
 
OptionPtr declineIA (const Pkt6Ptr &decline, const DuidPtr &duid, int &general_status, boost::shared_ptr< Option6IA > ia, Lease6Collection &new_leases)
 Declines leases in a single IA_NA option. More...
 
bool declineLease (const Pkt6Ptr &decline, const Lease6Ptr lease, boost::shared_ptr< Option6IA > ia_rsp)
 Declines specific IPv6 lease. More...
 
bool declineLeases (const Pkt6Ptr &decline, Pkt6Ptr &reply, AllocEngine::ClientContext6 &ctx)
 Attempts to decline all leases in specified Decline message. More...
 
void evaluateClasses (const Pkt6Ptr &pkt, bool depend_on_known)
 Evaluate classes. More...
 
OptionPtr extendIA_NA (const Pkt6Ptr &query, AllocEngine::ClientContext6 &ctx, Option6IAPtr ia)
 Extends lifetime of the specific IA_NA option. More...
 
OptionPtr extendIA_PD (const Pkt6Ptr &query, AllocEngine::ClientContext6 &ctx, Option6IAPtr ia)
 Extends lifetime of the prefix. More...
 
void extendLeases (const Pkt6Ptr &query, Pkt6Ptr &reply, AllocEngine::ClientContext6 &ctx)
 Attempts to extend the lifetime of IAs. More...
 
void initContext (const Pkt6Ptr &pkt, AllocEngine::ClientContext6 &ctx, bool &drop)
 Initializes client context for specified packet. More...
 
void processClientFqdn (const Pkt6Ptr &question, const Pkt6Ptr &answer, AllocEngine::ClientContext6 &ctx)
 Processes Client FQDN Option. More...
 
Pkt6Ptr processConfirm (AllocEngine::ClientContext6 &ctx)
 Processes incoming Confirm message and returns Reply. More...
 
Pkt6Ptr processDecline (AllocEngine::ClientContext6 &ctx)
 Process incoming Decline message. More...
 
void processDhcp4Query (const Pkt6Ptr &dhcp4_query)
 Processes incoming DHCPv4-query message. More...
 
Pkt6Ptr processInfRequest (AllocEngine::ClientContext6 &ctx)
 Processes incoming Information-request message. More...
 
void processPacketPktSend (hooks::CalloutHandlePtr &callout_handle, Pkt6Ptr &query, Pkt6Ptr &rsp)
 Executes pkt6_send callout. More...
 
Pkt6Ptr processRebind (AllocEngine::ClientContext6 &ctx)
 Processes incoming Rebind message. More...
 
Pkt6Ptr processRelease (AllocEngine::ClientContext6 &ctx)
 Process incoming Release message. More...
 
Pkt6Ptr processRenew (AllocEngine::ClientContext6 &ctx)
 Processes incoming Renew message. More...
 
Pkt6Ptr processRequest (AllocEngine::ClientContext6 &ctx)
 Processes incoming Request and returns Reply response. More...
 
void processRSOO (const Pkt6Ptr &query, const Pkt6Ptr &rsp)
 Processes Relay-supplied options, if present. More...
 
Pkt6Ptr processSolicit (AllocEngine::ClientContext6 &ctx)
 Processes incoming Solicit and returns response. More...
 
virtual Pkt6Ptr receivePacket (int timeout)
 dummy wrapper around IfaceMgr::receive6 More...
 
OptionPtr releaseIA_NA (const DuidPtr &duid, const Pkt6Ptr &query, int &general_status, boost::shared_ptr< Option6IA > ia, Lease6Ptr &old_lease)
 Releases specific IA_NA option. More...
 
OptionPtr releaseIA_PD (const DuidPtr &duid, const Pkt6Ptr &query, int &general_status, boost::shared_ptr< Option6IA > ia, Lease6Ptr &old_lease)
 Releases specific IA_PD option. More...
 
void releaseLeases (const Pkt6Ptr &release, Pkt6Ptr &reply, AllocEngine::ClientContext6 &ctx)
 Attempts to release received addresses. More...
 
void requiredClassify (const Pkt6Ptr &pkt, AllocEngine::ClientContext6 &ctx)
 Assigns incoming packet to zero or more classes (required pass). More...
 
bool sanityCheck (const Pkt6Ptr &pkt)
 Verifies if specified packet meets RFC requirements. More...
 
void sanityCheck (const Pkt6Ptr &pkt, RequirementLevel clientid, RequirementLevel serverid)
 verifies if specified packet meets RFC requirements More...
 
void sanityCheckDUID (const OptionPtr &opt, const std::string &opt_name)
 verifies if received DUID option (client-id or server-id) is sane More...
 
isc::dhcp::Subnet6Ptr selectSubnet (const Pkt6Ptr &question, bool &drop)
 Selects a subnet for a given client's packet. More...
 
virtual void sendPacket (const Pkt6Ptr &pkt)
 dummy wrapper around IfaceMgr::send() More...
 
void setPacketStatisticsDefaults ()
 This function sets statistics related to DHCPv6 packets processing to their initial values. More...
 
void setReservedClientClasses (const Pkt6Ptr &pkt, const AllocEngine::ClientContext6 &ctx)
 Assigns classes retrieved from host reservation database. More...
 
void setStatusCode (boost::shared_ptr< Option6IA > &container, const OptionPtr &status)
 A simple utility method that sets the status code. More...
 
void setTeeTimes (uint32_t preferred_lft, const Subnet6Ptr &subnet, Option6IAPtr &resp)
 Sets the T1 and T2 timers in the outbound IA. More...
 
bool testServerID (const Pkt6Ptr &pkt)
 Compare received server id with our server id. More...
 
bool testUnicast (const Pkt6Ptr &pkt) const
 Check if the message can be sent to unicast. More...
 
- Protected Member Functions inherited from isc::process::Daemon
std::string makePIDFileName () const
 Manufacture the pid file name. More...
 

Static Protected Member Functions

static std::string duidToString (const OptionPtr &opt)
 converts DUID to text Converts content of DUID option to a text representation, e.g. More...
 
static HWAddrPtr getMAC (const Pkt6Ptr &pkt)
 Attempts to get a MAC/hardware address using configured sources. More...
 
static void removeDependentEvaluatedClasses (const Pkt6Ptr &pkt)
 Removed evaluated client classes. More...
 

Protected Attributes

boost::shared_ptr< AllocEnginealloc_engine_
 Allocation Engine. More...
 
CBControlDHCPv6Ptr cb_control_
 Controls access to the configuration backends. More...
 
uint16_t client_port_
 UDP port number to which server sends all responses. More...
 
std::queue< isc::dhcp_ddns::NameChangeRequestname_change_reqs_
 Holds a list of isc::dhcp_ddns::NameChangeRequest objects, which are waiting for sending to kea-dhcp-ddns module. More...
 
NetworkStatePtr network_state_
 Holds information about disabled DHCP service and/or disabled subnet/network scopes. More...
 
uint16_t server_port_
 UDP port number on which server listens. More...
 
OptionPtr serverid_
 Server DUID (to be sent in server-identifier option) More...
 
volatile bool shutdown_
 Indicates if shutdown is in progress. More...
 
- Protected Attributes inherited from isc::process::Daemon
isc::asiolink::IOSignalSetPtr signal_set_
 A pointer to the object installing custom signal handlers. More...
 
boost::posix_time::ptime start_
 Timestamp of the start of the daemon. More...
 

Static Protected Attributes

static const std::string VENDOR_CLASS_PREFIX
 this is a prefix added to the content of vendor-class option More...
 

Detailed Description

DHCPv6 server service.

This singleton class represents DHCPv6 server. It contains all top-level methods and routines necessary for server operation. In particular, it instantiates IfaceMgr, loads or generates DUID that is going to be used as server-identifier, receives incoming packets, processes them, manages leases assignment and generates appropriate responses.

This class does not support any controlling mechanisms directly. See the derived ControlledDhcpv6Srv class for support for command and configuration updates over msgq.

Definition at line 66 of file dhcp6_srv.h.

Member Enumeration Documentation

◆ RequirementLevel

defines if certain option may, must or must not appear

Enumerator
FORBIDDEN 
MANDATORY 
OPTIONAL 

Definition at line 74 of file dhcp6_srv.h.

Constructor & Destructor Documentation

◆ Dhcpv6Srv()

isc::dhcp::Dhcpv6Srv::Dhcpv6Srv ( uint16_t  server_port = DHCP6_SERVER_PORT,
uint16_t  client_port = 0 
)

Default constructor.

Instantiates necessary services, required to run DHCPv6 server. In particular, creates IfaceMgr that will be responsible for network interaction. Will instantiate lease manager, and load old or create new DUID. It is possible to specify alternate port on which DHCPv6 server will listen on and alternate port where DHCPv6 server sends all responses to. Those are mostly useful for testing purposes.

Parameters
server_portspecifies port number to listen on
client_portspecifies port number to send to
Todo:
call loadLibraries() when handling configuration changes

Definition at line 214 of file dhcp6_srv.cc.

References alloc_engine_, isc::dhcp::AllocEngine::ALLOC_ITERATIVE, isc::dhcp::Dhcp6to4Ipc::client_port, D6O_SERVERID, isc::dhcp::DBG_DHCP6_START, isc::dhcp::dhcp6_logger, isc::dhcp::DHCP6_NO_INTERFACES, isc::dhcp::DHCP6_OPEN_SOCKET, isc::dhcp::DHCP6_SRV_CONSTRUCT_ERROR, isc::util::DHCPv6, isc::dhcp::DUIDFactory::get(), isc::dhcp::Dhcp6to4Ipc::instance(), isc::dhcp::IfaceMgr::instance(), LOG_DEBUG, LOG_ERROR, serverid_, setPacketStatisticsDefaults(), shutdown_, and isc::dhcp::Option::V6.

+ Here is the call graph for this function:

◆ ~Dhcpv6Srv()

Member Function Documentation

◆ appendDefaultOptions()

void isc::dhcp::Dhcpv6Srv::appendDefaultOptions ( const Pkt6Ptr question,
Pkt6Ptr answer,
const CfgOptionList co_list 
)
protected

Appends default options to server's answer.

Adds required options to server's answer. In particular, server-id is added. Possibly other mandatory options will be added, depending on type (or content) of client message.

Parameters
questionclient's message
answerserver's message (options will be added here)
co_listconfigured option list (currently unused)

Definition at line 1388 of file dhcp6_srv.cc.

References getServerID().

Referenced by processConfirm(), processDecline(), processInfRequest(), processRebind(), processRelease(), processRenew(), processRequest(), and processSolicit().

+ Here is the call graph for this function:

◆ appendRequestedOptions()

void isc::dhcp::Dhcpv6Srv::appendRequestedOptions ( const Pkt6Ptr question,
Pkt6Ptr answer,
const CfgOptionList co_list 
)
protected

Appends requested options to server's answer.

Appends options requested by client to the server's answer.

Parameters
questionclient's message
answerserver's message (options will be added here)
co_listconfigured option list

Definition at line 1465 of file dhcp6_srv.cc.

References D6O_ORO, D6O_VENDOR_CLASS, D6O_VENDOR_OPTS, DHCP6_OPTION_SPACE, isc::dhcp::OptionVendor::getVendorId(), isc::dhcp::OptionVendorClass::getVendorId(), and isc::dhcp::OptionDescriptor::option_.

Referenced by processConfirm(), processInfRequest(), processRebind(), processRenew(), processRequest(), and processSolicit().

+ Here is the call graph for this function:

◆ appendRequestedVendorOptions()

void isc::dhcp::Dhcpv6Srv::appendRequestedVendorOptions ( const Pkt6Ptr question,
Pkt6Ptr answer,
AllocEngine::ClientContext6 ctx,
const CfgOptionList co_list 
)
protected

Appends requested vendor options to server's answer.

This is mostly useful for Cable Labs options for now, but the method is easily extensible to other vendors.

Parameters
questionclient's message
answerserver's message (vendor options will be added here)
ctxclient context (contains subnet, duid and other parameters)
co_listconfigured option list

Definition at line 1599 of file dhcp6_srv.cc.

References D6O_VENDOR_CLASS, D6O_VENDOR_OPTS, DOCSIS3_V6_ORO, isc::dhcp::OptionVendor::getVendorId(), isc::dhcp::OptionVendorClass::getVendorId(), isc::dhcp::OptionDescriptor::option_, isc::dhcp::AllocEngine::ClientContext6::subnet_, isc::dhcp::Option::V6, and VENDOR_ID_CABLE_LABS.

Referenced by processConfirm(), processInfRequest(), processRebind(), processRenew(), processRequest(), and processSolicit().

+ Here is the call graph for this function:

◆ assignIA_NA()

OptionPtr isc::dhcp::Dhcpv6Srv::assignIA_NA ( const isc::dhcp::Pkt6Ptr query,
AllocEngine::ClientContext6 ctx,
Option6IAPtr  ia 
)
protected

Processes IA_NA option (and assigns addresses if necessary).

Generates response to IA_NA. This typically includes selecting (and allocating a lease in case of REQUEST) an address lease and creating IAADDR option. In case of allocation failure, it may contain status code option with non-zero status, denoting cause of the allocation failure.

Parameters
queryclient's message (typically SOLICIT or REQUEST) to the client (if the client sent this option to the server).
ctxclient context (contains subnet, duid and other parameters)
iapointer to client's IA_NA option (client's request)
Returns
IA_NA option (server's response)
Todo:
: Handle more than one lease

Definition at line 2262 of file dhcp6_srv.cc.

References isc::dhcp::AllocEngine::ClientContext6::IAContext::addHint(), alloc_engine_, isc::dhcp::AllocEngine::ClientContext6::createIAContext(), isc::dhcp::AllocEngine::ClientContext6::currentIA(), D6O_IA_NA, D6O_IAADDR, isc::dhcp::DBG_DHCP6_DETAIL, isc::dhcp::DBG_DHCP6_DETAIL_DATA, isc::dhcp::DHCP6_LEASE_ADVERT, isc::dhcp::DHCP6_LEASE_ADVERT_FAIL, isc::dhcp::DHCP6_LEASE_ALLOC, isc::dhcp::DHCP6_LEASE_ALLOC_FAIL, isc::dhcp::DHCP6_LEASE_DATA, isc::dhcp::DHCP6_LEASE_REUSE, isc::dhcp::DHCP6_PROCESS_IA_NA_REQUEST, isc::dhcp::AllocEngine::ClientContext6::fake_allocation_, isc::dhcp::AllocEngine::ClientContext6::IAContext::iaid_, isc::asiolink::IOAddress::IPV6_ZERO_ADDRESS(), isc::dhcp::lease6_logger, isc::dhcp::Lease::lifetimeToText(), LOG_DEBUG, LOG_INFO, setTeeTimes(), STATUS_NoAddrsAvail, isc::dhcp::AllocEngine::ClientContext6::subnet_, isc::dhcp::AllocEngine::ClientContext6::IAContext::type_, and isc::dhcp::Lease::TYPE_NA.

Referenced by assignLeases().

+ Here is the call graph for this function:

◆ assignIA_PD()

OptionPtr isc::dhcp::Dhcpv6Srv::assignIA_PD ( const Pkt6Ptr query,
AllocEngine::ClientContext6 ctx,
boost::shared_ptr< Option6IA ia 
)
protected

Processes IA_PD option (and assigns prefixes if necessary).

Generates response to IA_PD. This typically includes selecting (and allocating in the case of REQUEST) a prefix lease and creating an IAPREFIX option. In case of an allocation failure, it may contain a status code option with non-zero status denoting the cause of the allocation failure.

Parameters
queryclient's message (typically SOLICIT or REQUEST)
ctxclient context (contains subnet, duid and other parameters)
iapointer to client's IA_PD option (client's request)
Returns
IA_PD option (server's response)

Definition at line 2389 of file dhcp6_srv.cc.

References isc::dhcp::AllocEngine::ClientContext6::IAContext::addHint(), alloc_engine_, isc::dhcp::AllocEngine::ClientContext6::createIAContext(), isc::dhcp::AllocEngine::ClientContext6::currentIA(), D6O_IA_PD, D6O_IAPREFIX, D6O_PD_EXCLUDE, isc::dhcp::DBG_DHCP6_DETAIL, isc::dhcp::DHCP6_PD_LEASE_ADVERT, isc::dhcp::DHCP6_PD_LEASE_ADVERT_FAIL, isc::dhcp::DHCP6_PD_LEASE_ALLOC, isc::dhcp::DHCP6_PD_LEASE_ALLOC_FAIL, isc::dhcp::DHCP6_PD_LEASE_REUSE, isc::dhcp::DHCP6_PROCESS_IA_PD_REQUEST, isc::dhcp::AllocEngine::ClientContext6::fake_allocation_, isc::dhcp::Pool6::getPrefixExcludeOption(), isc::dhcp::AllocEngine::ClientContext6::IAContext::iaid_, isc::asiolink::IOAddress::IPV6_ZERO_ADDRESS(), isc::dhcp::lease6_logger, isc::dhcp::Lease::lifetimeToText(), LOG_DEBUG, LOG_INFO, setTeeTimes(), STATUS_NoPrefixAvail, isc::dhcp::AllocEngine::ClientContext6::subnet_, isc::dhcp::AllocEngine::ClientContext6::IAContext::type_, and isc::dhcp::Lease::TYPE_PD.

Referenced by assignLeases().

+ Here is the call graph for this function:

◆ assignLeases()

void isc::dhcp::Dhcpv6Srv::assignLeases ( const Pkt6Ptr question,
Pkt6Ptr answer,
AllocEngine::ClientContext6 ctx 
)
protected

Assigns leases.

It supports non-temporary addresses (IA_NA) and prefixes (IA_PD). It does NOT support temporary addresses (IA_TA).

Parameters
questionclient's message (with requested IA options)
answerserver's message (IA options will be added here). This message should contain Client FQDN option being sent by the server to the client (if the client sent this option to the server).
ctxclient context (contains subnet, duid and other parameters)

Definition at line 1938 of file dhcp6_srv.cc.

References assignIA_NA(), assignIA_PD(), checkDynamicSubnetChange(), D6O_IA_NA, D6O_IA_PD, and isc::dhcp::AllocEngine::ClientContext6::subnet_.

Referenced by processRequest(), and processSolicit().

+ Here is the call graph for this function:

◆ buildCfgOptionList()

void isc::dhcp::Dhcpv6Srv::buildCfgOptionList ( const Pkt6Ptr question,
AllocEngine::ClientContext6 ctx,
CfgOptionList co_list 
)
protected

◆ checkDynamicSubnetChange()

void isc::dhcp::Dhcpv6Srv::checkDynamicSubnetChange ( const Pkt6Ptr question,
Pkt6Ptr answer,
AllocEngine::ClientContext6 ctx,
const Subnet6Ptr  orig_subnet 
)
protected

Iterates over new leases, update stale DNS entries.

Checks the context's current subnet (most recently selected) against an original selected subnet. If they are the same the function simply returns.

If they differ, we treat this as a dynamic subnet change made by the allocation engine. It is possible that DDNS subnet parameters for the new subnet are different and this needs to handled. We first save the current DNS-related values from the context and then re-run processClientFqdn(). This will rebuild the FQDN option to send back to the client based on the new subnet as well as update the context. If the new values are different from the previous values, we iterate over the leases and update the DNS values.

Parameters
questionClient's message.
answerServer's response to a client. If server generated
ctxclient context (contains subnet, duid and other parameters)
orig_subnetthe originally selected subnet
Note
Subnet may be modified by the allocation engine, if the initial subnet belongs to a shared network. Note that this will only handle cases where all IA_xx's in a client request result in a subnet change. It is possible, currently, for the last IA_xx in request to end up using the same subnet as originally selected, and we will miss a change incurred by preceding IA_xx's. In general users should be strongly encouraged to avoid situations where all of the following are true:
  1. clients send more than one IA_xx in a query
  2. subnets in the shared-network are equally eligible (i.e don't have class guards etc)
  3. subnets have differing options or DDNS parameters

Definition at line 4558 of file dhcp6_srv.cc.

References D6O_CLIENT_FQDN, isc::dhcp::DBG_DHCP6_BASIC_DATA, isc::dhcp::DHCP6_SUBNET_DYNAMICALLY_CHANGED, isc::dhcp::AllocEngine::ClientContext6::fake_allocation_, isc::dhcp::AllocEngine::ClientContext6::fwd_dns_update_, isc::dhcp::AllocEngine::ClientContext6::hostname_, isc::dhcp::LeaseMgrFactory::instance(), LOG_DEBUG, isc::dhcp::AllocEngine::ClientContext6::new_leases_, isc::dhcp::packet6_logger, processClientFqdn(), isc::dhcp::AllocEngine::ClientContext6::rev_dns_update_, isc::dhcp::AllocEngine::ClientContext6::subnet_, and isc::dhcp::LeaseMgr::updateLease6().

Referenced by assignLeases(), and extendLeases().

+ Here is the call graph for this function:

◆ checkRelaySourcePort()

uint16_t isc::dhcp::Dhcpv6Srv::checkRelaySourcePort ( const Pkt6Ptr query)
static

Used for DHCPv4-over-DHCPv6 too.

Check if the last relay added a relay-source-port option.

Parameters
queryDHCPv6 message to be checked.
Returns
the port to use to join the relay or 0 for the default.

Definition at line 4403 of file dhcp6_srv.cc.

References D6O_RELAY_SOURCE_PORT, DHCPV6_ADVERTISE, DHCPV6_CONFIRM, DHCPV6_DECLINE, DHCPV6_DHCPV4_QUERY, DHCPV6_DHCPV4_RESPONSE, DHCPV6_INFORMATION_REQUEST, DHCPV6_REBIND, DHCPV6_RECONFIGURE, DHCPV6_RELEASE, DHCPV6_RENEW, DHCPV6_REPLY, DHCPV6_REQUEST, and DHCPV6_SOLICIT.

Referenced by isc::dhcp::Dhcp6to4Ipc::handler().

◆ classifyPacket()

void isc::dhcp::Dhcpv6Srv::classifyPacket ( const Pkt6Ptr pkt)
protected

Assigns incoming packet to zero or more classes.

Note
This is done in two phases: first the content of the vendor-class-identifier options are used as classes, by calling classifyByVendor(). Second, the classification match expressions are evaluated. The resulting classes will be stored in the packet (see isc::dhcp::Pkt6::classes_ and isc::dhcp::Pkt6::inClass).
Parameters
pktpacket to be classified

Definition at line 3990 of file dhcp6_srv.cc.

References evaluateClasses().

Referenced by processPacket().

+ Here is the call graph for this function:

◆ conditionallySetReservedClientClasses()

void isc::dhcp::Dhcpv6Srv::conditionallySetReservedClientClasses ( const Pkt6Ptr pkt,
const AllocEngine::ClientContext6 ctx 
)
protected

Assigns classes retrieved from host reservation database if they haven't been yet set.

This function sets reserved client classes in case they haven't been set after fetching host reservations from the database. This is the case when the client has non-global host reservation and the selected subnet belongs to a shared network.

Parameters
pktPointer to the packet to which classes will be assigned.
ctxReference to the client context.

Definition at line 4084 of file dhcp6_srv.cc.

References isc::dhcp::AllocEngine::ClientContext6::currentHost(), setReservedClientClasses(), and isc::dhcp::AllocEngine::ClientContext6::subnet_.

Referenced by processConfirm(), processDecline(), processInfRequest(), processRebind(), processRelease(), processRenew(), processRequest(), and processSolicit().

+ Here is the call graph for this function:

◆ copyClientOptions()

void isc::dhcp::Dhcpv6Srv::copyClientOptions ( const Pkt6Ptr question,
Pkt6Ptr answer 
)
protected

Copies required options from client message to server answer.

Copies options that must appear in any server response (ADVERTISE, REPLY) to client's messages (SOLICIT, REQUEST, RENEW, REBIND, DECLINE, RELEASE). One notable example is client-id. Other options may be copied as required. Relay information details are also copied here.

Parameters
questionclient's message (options will be copied from here)
answerserver's message (options will be copied here)
Todo:
: Should throw if there is no client-id (except anonymous INF-REQUEST)

Definition at line 1372 of file dhcp6_srv.cc.

References D6O_CLIENTID.

Referenced by processConfirm(), processDecline(), processInfRequest(), processRebind(), processRelease(), processRenew(), processRequest(), and processSolicit().

◆ createNameChangeRequests()

void isc::dhcp::Dhcpv6Srv::createNameChangeRequests ( const Pkt6Ptr answer,
AllocEngine::ClientContext6 ctx 
)
protected

Creates a number of isc::dhcp_ddns::NameChangeRequest objects based on the DHCPv6 Client FQDN Option.

The isc::dhcp_ddns::NameChangeRequest class encapsulates the request from the DHCPv6 server to the DHCP-DDNS module to perform DNS Update. The FQDN option carries response to the client about DNS updates that server intends to perform for the DNS client. Based on this, the function will create zero or more isc::dhcp_ddns::NameChangeRequest objects and store them in the internal queue. To catch lease renewals that alter the FQDN, the function first looks at the context's changed list of leases (if any) to determine if DNS entries need to be removed. It then looks at the valid leases to determine if any DNS entries need to be added. If DNS updates are disabled, this method returns immediately.

Todo:
Add support for multiple IAADDR options in the IA_NA.
Parameters
answerA message begins sent to the Client. If it holds the
ctxclient context (contains subnet, duid and other parameters) Client FQDN option, this option is used to create NameChangeRequests.
Todo:
IA_NA may contain multiple addresses. We should process each address individually. Currently we get only one.
Todo:
Currently we create NCR with the first IPv6 address that is carried in one of the IA_NAs. In the future, the NCR API should be extended to map multiple IPv6 addresses to a single FQDN. In such case, this return statement will be removed.

Definition at line 2120 of file dhcp6_srv.cc.

References isc::dhcp::calculateDdnsTtl(), isc::dhcp::AllocEngine::ClientContext6::IAContext::changed_leases_, isc::dhcp_ddns::CHG_ADD, isc::dhcp_ddns::CHG_REMOVE, isc::dhcp::AllocEngine::ClientContext6::currentIA(), D6O_CLIENT_FQDN, D6O_CLIENTID, D6O_IA_NA, D6O_IAADDR, isc::dhcp::DBG_DHCP6_DETAIL, isc::dhcp::ddns6_logger, isc::dhcp::DHCP6_DDNS_CREATE_ADD_NAME_CHANGE_REQUEST, isc::dhcp::CfgMgr::getD2ClientMgr(), isc::util::OutputBuffer::getData(), isc::dhcp::AllocEngine::ClientContext6::getDdnsParams(), isc::util::OutputBuffer::getLength(), isc::dhcp::D2ClientMgr::getUpdateDirections(), isc::dhcp::CfgMgr::instance(), isc_throw, LOG_DEBUG, isc::dhcp::queueNCR(), and isc::dhcp::D2ClientMgr::sendRequest().

Referenced by processRebind(), processRenew(), processRequest(), and processSolicit().

+ Here is the call graph for this function:

◆ d2ClientErrorHandler()

void isc::dhcp::Dhcpv6Srv::d2ClientErrorHandler ( const dhcp_ddns::NameChangeSender::Result  result,
dhcp_ddns::NameChangeRequestPtr ncr 
)
virtual

Implements the error handler for DHCP_DDNS IO errors.

Invoked when a NameChangeRequest send to kea-dhcp-ddns completes with a failed status. These are communications errors, not data related failures.

This method logs the failure and then suspends all further updates. Updating can only be restored by reconfiguration or restarting the server. There is currently no retry logic so the first IO error that occurs will suspend updates.

Todo:
We may wish to make this more robust or sophisticated.
Parameters
resultResult code of the send operation.
ncrNameChangeRequest which failed to send.
Todo:
We may wish to revisit this, but for now we will simply turn them off.

Definition at line 4330 of file dhcp6_srv.cc.

References isc::dhcp::ddns6_logger, isc::dhcp::DHCP6_DDNS_REQUEST_SEND_FAILED, isc::dhcp::CfgMgr::getD2ClientMgr(), isc::dhcp::CfgMgr::instance(), LOG_ERROR, and isc::dhcp::D2ClientMgr::suspendUpdates().

Referenced by startD2().

+ Here is the call graph for this function:

◆ declineIA()

OptionPtr isc::dhcp::Dhcpv6Srv::declineIA ( const Pkt6Ptr decline,
const DuidPtr duid,
int &  general_status,
boost::shared_ptr< Option6IA ia,
Lease6Collection new_leases 
)
protected

Declines leases in a single IA_NA option.

This method iterates over all addresses in this IA_NA, verifies whether they belong to the client and calls declineLease. If there's an error, general_status (a status put in the top level scope), will be updated.

Parameters
declineclient's Decline message
duidclient's duid (used to verify if the client owns the lease)
general_status[out] status in top-level message (may be updated)
iaspecific IA_NA option to process.
new_leasesa collection of leases being declined.
Returns
IA_NA option with response (to be included in Reply message)

Definition at line 3684 of file dhcp6_srv.cc.

References D6O_IA_NA, D6O_IAADDR, isc::dhcp::DBG_DHCP6_DETAIL, declineLease(), isc::dhcp::DHCP6_DECLINE_FAIL_DUID_MISMATCH, isc::dhcp::DHCP6_DECLINE_FAIL_IAID_MISMATCH, isc::dhcp::DHCP6_DECLINE_FAIL_LEASE_WITHOUT_DUID, isc::dhcp::DHCP6_DECLINE_FAIL_NO_LEASE, isc::dhcp::DHCP6_DECLINE_PROCESS_IA, isc::dhcp::LeaseMgr::getLease6(), isc::dhcp::LeaseMgrFactory::instance(), isc::dhcp::lease6_logger, LOG_DEBUG, LOG_ERROR, LOG_INFO, setStatusCode(), STATUS_NoBinding, STATUS_UnspecFail, and isc::dhcp::Lease::TYPE_NA.

Referenced by declineLeases().

+ Here is the call graph for this function:

◆ declineLease()

bool isc::dhcp::Dhcpv6Srv::declineLease ( const Pkt6Ptr decline,
const Lease6Ptr  lease,
boost::shared_ptr< Option6IA ia_rsp 
)
protected

Declines specific IPv6 lease.

This method performs the actual decline and all necessary operations:

  • cleans up DNS, if necessary
  • updates subnet[X].declined-addresses (per subnet stat)
  • updates declined-addresses (global stat)
  • disassociates client information from the lease
  • moves the lease to DECLINED state
  • sets lease expiration time to decline-probation-period
  • adds status-code success
Parameters
declineused for generating removal Name Change Request.
leaselease to be declined
ia_rspresponse IA_NA.
Returns
true when expected to continue, false when hooks told us to drop the packet

Definition at line 3818 of file dhcp6_srv.cc.

References isc::dhcp_ddns::CHG_REMOVE, isc::dhcp::DBG_DHCP6_DETAIL, isc::log::DBGLVL_PKT_HANDLING, isc::dhcp::DHCP6_DECLINE_FAIL, isc::dhcp::DHCP6_DECLINE_LEASE, isc::dhcp::DHCP6_HOOK_DECLINE_DROP, isc::dhcp::DHCP6_HOOK_DECLINE_SKIP, isc::dhcp::getCalloutHandle(), isc::hooks::hooks_logger, isc::dhcp::CfgMgr::instance(), isc::dhcp::LeaseMgrFactory::instance(), isc::dhcp::lease6_logger, LOG_DEBUG, LOG_ERROR, LOG_INFO, isc::dhcp::queueNCR(), STATUS_Success, isc::dhcp::LeaseMgr::updateLease6(), and isc::Exception::what().

Referenced by declineIA().

+ Here is the call graph for this function:

◆ declineLeases()

bool isc::dhcp::Dhcpv6Srv::declineLeases ( const Pkt6Ptr decline,
Pkt6Ptr reply,
AllocEngine::ClientContext6 ctx 
)
protected

Attempts to decline all leases in specified Decline message.

This method iterates over all IA_NA options and calls declineIA on each of them.

Parameters
declineDecline message sent by a client
replyServer's response (IA_NA with status will be added here)
ctxcontext
Returns
true when expected to continue, false when hooks told us to drop the packet

Definition at line 3642 of file dhcp6_srv.cc.

References D6O_IA_NA, declineIA(), isc::dhcp::AllocEngine::ClientContext6::duid_, isc::dhcp::AllocEngine::ClientContext6::new_leases_, and STATUS_Success.

Referenced by processDecline().

+ Here is the call graph for this function:

◆ discardPackets()

void isc::dhcp::Dhcpv6Srv::discardPackets ( )

Discards parked packets Clears the packet parking lots of all packets.

Called during reconfigure and shutdown.

Definition at line 4515 of file dhcp6_srv.cc.

Referenced by isc::dhcp::configureDhcp6Server(), and ~Dhcpv6Srv().

◆ duidToString()

std::string isc::dhcp::Dhcpv6Srv::duidToString ( const OptionPtr opt)
staticprotected

converts DUID to text Converts content of DUID option to a text representation, e.g.

01:ff:02:03:06:80:90:ab:cd:ef

Parameters
optoption that contains DUID
Returns
string representation

Definition at line 1352 of file dhcp6_srv.cc.

Referenced by testServerID().

◆ earlyGHRLookup()

◆ evaluateClasses()

void isc::dhcp::Dhcpv6Srv::evaluateClasses ( const Pkt6Ptr pkt,
bool  depend_on_known 
)
protected

Evaluate classes.

Note
Second part of the classification.

Evaluate expressions of client classes: if it returns true the class is added to the incoming packet.

Parameters
pktpacket to be classified.
depend_on_knownif false classes depending on the KNOWN or UNKNOWN classes are skipped, if true only these classes are evaluated.

Definition at line 4001 of file dhcp6_srv.cc.

References isc::dhcp::DBG_DHCP6_DETAIL, isc::dhcp::dhcp6_logger, isc::dhcp::EVAL_RESULT, isc::dhcp::evaluateBool(), isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::CfgMgr::instance(), LOG_DEBUG, LOG_ERROR, LOG_INFO, and isc::Exception::what().

Referenced by classifyPacket(), earlyGHRLookup(), and initContext().

+ Here is the call graph for this function:

◆ extendIA_NA()

OptionPtr isc::dhcp::Dhcpv6Srv::extendIA_NA ( const Pkt6Ptr query,
AllocEngine::ClientContext6 ctx,
Option6IAPtr  ia 
)
protected

Extends lifetime of the specific IA_NA option.

Generates response to IA_NA in Renew or Rebind. This typically includes finding a lease that corresponds to the received address. If no such lease is found, an IA_NA response is generated with an appropriate status code.

Parameters
queryclient's message (Renew or Rebind) to the client (if the client sent this option to the server).
ctxclient context (contains subnet, duid and other parameters)
iaIA_NA option which carries address for which lease lifetime will be extended.
Returns
IA_NA option (server's response)
Todo:
For simplicity and due to limitations of LeaseMgr we don't get the binding for the client for which we don't get subnet id. Subnet id is a required value when searching for the bindings. The fact that we can't identify the subnet for the returning client doesn't really mean that the client has no binding. It is possible that due to server's reconfiguration the subnet has been removed or modified since the client has got his lease. We may need to rethink whether it is appropriate to send no binding if the subnet hasn't been found for the client.

Definition at line 2531 of file dhcp6_srv.cc.

References isc::dhcp::AllocEngine::ClientContext6::IAContext::addHint(), alloc_engine_, isc::dhcp_ddns::CHG_REMOVE, isc::dhcp::AllocEngine::ClientContext6::createIAContext(), isc::dhcp::AllocEngine::ClientContext6::currentIA(), D6O_IA_NA, D6O_IAADDR, isc::dhcp::DBG_DHCP6_DETAIL, isc::dhcp::ddns6_logger, isc::dhcp::DHCP6_DDNS_REMOVE_OLD_LEASE_FQDN, isc::dhcp::DHCP6_LEASE_RENEW, isc::dhcp::DHCP6_LEASE_REUSE, isc::dhcp::DHCP6_PROCESS_IA_NA_EXTEND, isc::util::equalValues(), isc::dhcp::AllocEngine::ClientContext6::fwd_dns_update_, isc::dhcp::AllocEngine::ClientContext6::IAContext::hints_, isc::dhcp::AllocEngine::ClientContext6::hostname_, isc::dhcp::AllocEngine::ClientContext6::IAContext::ia_rsp_, isc::dhcp::AllocEngine::ClientContext6::IAContext::iaid_, isc::dhcp::lease6_logger, isc::dhcp::Lease::lifetimeToText(), LOG_DEBUG, LOG_INFO, isc::dhcp::AllocEngine::ClientContext6::IAContext::old_leases_, isc::dhcp::queueNCR(), isc::dhcp::AllocEngine::ClientContext6::rev_dns_update_, setTeeTimes(), STATUS_NoAddrsAvail, STATUS_NoBinding, isc::dhcp::AllocEngine::ClientContext6::subnet_, isc::dhcp::AllocEngine::ClientContext6::IAContext::type_, and isc::dhcp::Lease::TYPE_NA.

Referenced by extendLeases().

+ Here is the call graph for this function:

◆ extendIA_PD()

OptionPtr isc::dhcp::Dhcpv6Srv::extendIA_PD ( const Pkt6Ptr query,
AllocEngine::ClientContext6 ctx,
Option6IAPtr  ia 
)
protected

Extends lifetime of the prefix.

This function is called by the logic which processes Renew and Rebind messages to extend the lifetime of the existing prefix.

The behavior of this function is different than extendIA_NA in that when there is no subnet found for the rebinding case, the Rebind message is discarded by the server. That behavior is based on the following statement from the RFC 8415, section 18.3.5:

"If the server chooses to not include any IAs containing IA Address or IA Prefix options with lifetimes of 0 and the server does not include any other IAs with leases and/or status codes, the server does not send a Reply message. In this situation, the server discards the Rebind message".

Todo:
We should consider unification of the server behavior for address assignment and prefix delegation with respect to Rebind message processing. The RFC 8415, section 18.3.5 doesn't really differentiate between IA_NA and IA_PD in how they should be processed by the server. The intention of the spec is as follows:
  • If the server finds a lease but addresses and/or prefixes are not appropriate anymore, it sends them with zero lifetimes.
  • If the server doesn't find a lease the server checks if the addresses and/or prefixes the client sends are appropriate and sends them back with zero lifetimes if they aren't.
  • The server may choose to not respond at all, if it cannot determine whether the addresses and/or prefixes are appropriate and it doesn't allocate any other addresses and/or prefixes.
  • If the server cannot find the leases included in the Rebind, the server may either allocate the leases or simply return NoBinding.

The extendIA_PD function drops the Rebind message if it cannot find the client entry (as a result of not finding a subnet for the client), the extendIA_NA function sends NoBinding status code in that case. Perhaps we should introduce an "Authoritative" configuration flag which, if enabled, would cause the server to always respond, either indicating that the address/prefix is inappropriate (with zero lifetimes) or that there is no binding (NoBinding status code) for both addresses and prefixes. When the "Authoritative" flag is disabled the server would drop the Rebind for which there is neither subnet selected nor client entry found (as it could be handled by another DHCP server). If nothing else we could consider unifying the behavior of extendIA_NA and extendIA_PD with respect to Rebind processing.

Parameters
queryclient's message
ctxclient context (contains subnet, duid and other parameters)
iaIA_PD option that is being renewed
Returns
IA_PD option (server's response)
Exceptions
DHCPv6DiscardMessageErrorwhen the message being processed should be discarded by the server, i.e. there is no binding for the client doing Rebind.
Todo:
: We may consider in which cases we could determine whether the delegated prefixes are appropriate for the link to which the client's interface is attached. Just not being able to select the subnet may not be enough, because there might be other DHCP servers around that are configured to handle that subnet. Therefore we don't fully follow all the paths in section 18.3.5 of RFC 8415 to respond with zero lifetimes for the prefixes being rebound.

For the leases that we just retired, send the prefixes with 0 lifetimes.

Definition at line 2692 of file dhcp6_srv.cc.

References isc::dhcp::AllocEngine::ClientContext6::IAContext::addHint(), alloc_engine_, isc::dhcp::AllocEngine::ClientContext6::createIAContext(), isc::dhcp::AllocEngine::ClientContext6::currentIA(), D6O_IA_PD, D6O_IAPREFIX, D6O_PD_EXCLUDE, isc::dhcp::DBG_DHCP6_DETAIL, isc::dhcp::DHCP6_PD_LEASE_RENEW, isc::dhcp::DHCP6_PD_LEASE_REUSE, isc::dhcp::DHCP6_PROCESS_IA_PD_EXTEND, DHCPV6_RENEW, isc::dhcp::AllocEngine::ClientContext6::duid_, isc::util::equalValues(), isc::dhcp::Pool6::getPrefixExcludeOption(), isc::dhcp::AllocEngine::ClientContext6::IAContext::hints_, isc::dhcp::AllocEngine::ClientContext6::IAContext::ia_rsp_, isc::dhcp::AllocEngine::ClientContext6::IAContext::iaid_, isc_throw, isc::dhcp::lease6_logger, isc::dhcp::Lease::lifetimeToText(), LOG_DEBUG, LOG_INFO, isc::dhcp::AllocEngine::ClientContext6::IAContext::old_leases_, setTeeTimes(), STATUS_NoBinding, STATUS_NoPrefixAvail, isc::dhcp::AllocEngine::ClientContext6::subnet_, isc::dhcp::AllocEngine::ClientContext6::IAContext::type_, and isc::dhcp::Lease::TYPE_PD.

Referenced by extendLeases().

+ Here is the call graph for this function:

◆ extendLeases()

void isc::dhcp::Dhcpv6Srv::extendLeases ( const Pkt6Ptr query,
Pkt6Ptr reply,
AllocEngine::ClientContext6 ctx 
)
protected

Attempts to extend the lifetime of IAs.

This function is called when a client sends Renew or Rebind message. It iterates through received IA options and attempts to extend corresponding lease lifetimes. Internally, it calls Dhcpv6Srv::extendIA_NA and Dhcpv6Srv::extendIA_PD to extend the lifetime of IA_NA and IA_PD leases accordingly.

Parameters
queryclient's Renew or Rebind message
replyserver's response
ctxclient context (contains subnet, duid and other parameters)
Todo:
add support for IA_TA

Definition at line 2891 of file dhcp6_srv.cc.

References checkDynamicSubnetChange(), D6O_IA_NA, D6O_IA_PD, extendIA_NA(), extendIA_PD(), and isc::dhcp::AllocEngine::ClientContext6::subnet_.

Referenced by processRebind(), and processRenew().

+ Here is the call graph for this function:

◆ getCBControl()

CBControlDHCPv6Ptr isc::dhcp::Dhcpv6Srv::getCBControl ( ) const
inline

Returns an object which controls access to the configuration backends.

Returns
Pointer to the instance of the object which controls access to the configuration backends.

Definition at line 124 of file dhcp6_srv.h.

Referenced by isc::dhcp::configureDhcp6Server(), and isc::dhcp::ControlledDhcpv6Srv::~ControlledDhcpv6Srv().

◆ getHookIndexBuffer6Send()

int isc::dhcp::Dhcpv6Srv::getHookIndexBuffer6Send ( )
static

Returns the index of the buffer6_send hook.

Returns
the index of the buffer6_send hook

Definition at line 4498 of file dhcp6_srv.cc.

References D6O_ORO, and isc::dhcp::OptionIntArray< T >::getValues().

+ Here is the call graph for this function:

◆ getIOService()

asiolink::IOServicePtr& isc::dhcp::Dhcpv6Srv::getIOService ( )
inline

◆ getMAC()

HWAddrPtr isc::dhcp::Dhcpv6Srv::getMAC ( const Pkt6Ptr pkt)
staticprotected

Attempts to get a MAC/hardware address using configured sources.

Tries to extract MAC/hardware address information from the packet using MAC sources configured in 'mac-sources' configuration parameter.

Parameters
pktwill try to exact MAC address from this packet
Returns
HWaddr pointer (or NULL if configured methods fail)

Definition at line 2247 of file dhcp6_srv.cc.

References isc::dhcp::CfgMgr::getCurrentCfg(), and isc::dhcp::CfgMgr::instance().

Referenced by earlyGHRLookup().

+ Here is the call graph for this function:

◆ getNetworkState()

NetworkStatePtr& isc::dhcp::Dhcpv6Srv::getNetworkState ( )
inline

Returns pointer to the network state used by the server.

Definition at line 115 of file dhcp6_srv.h.

Referenced by isc::dhcp::ControlledDhcpv6Srv::processConfig().

◆ getServerID()

OptionPtr isc::dhcp::Dhcpv6Srv::getServerID ( )
inline

Returns server-identifier option.

Returns
server-id option

Definition at line 135 of file dhcp6_srv.h.

Referenced by appendDefaultOptions(), and testServerID().

◆ getServerPort()

uint16_t isc::dhcp::Dhcpv6Srv::getServerPort ( ) const
inline

Get UDP port on which server should listen.

Typically, server listens on UDP port number 547. Other ports are used for testing purposes only.

Returns
UDP port on which server should listen.

Definition at line 216 of file dhcp6_srv.h.

Referenced by isc::dhcp::ControlledDhcpv6Srv::processConfig().

◆ getVersion()

std::string isc::dhcp::Dhcpv6Srv::getVersion ( bool  extended)
static

returns Kea version on stdout and exit.

redeclaration/redefinition. isc::process::Daemon::getVersion()

Definition at line 4345 of file dhcp6_srv.cc.

References isc::dhcp::PgSqlLeaseMgr::getDBVersion(), isc::dhcp::MySqlLeaseMgr::getDBVersion(), isc::dhcp::LeaseMgr::getDBVersion(), and isc::dhcp::Memfile_LeaseMgr::V6.

+ Here is the call graph for this function:

◆ initContext()

void isc::dhcp::Dhcpv6Srv::initContext ( const Pkt6Ptr pkt,
AllocEngine::ClientContext6 ctx,
bool &  drop 
)
protected

Initializes client context for specified packet.

This method:

  • Performs the subnet selection and stores the result in context
  • Extracts the duid from the packet and saves it to the context
  • Extracts the hardware address from the packet and saves it to the context
  • Performs host reservation lookup and stores the result in the context

Even though the incoming packet type is known to this method, it doesn't set the fake_allocation flag, because of a possibility that the Rapid Commit option is in use. The fake_allocation flag is set appropriately after it has been determined whether the Rapid Commit option was included and that the server respects it.

Parameters
pktpointer to a packet for which context will be created.
[out]ctxreference to context object to be initialized.
[out]dropif it is true the packet will be dropped.

Definition at line 494 of file dhcp6_srv.cc.

References alloc_engine_, isc::dhcp::AllocEngine::ClientContext6::callout_handle_, isc::dhcp::AllocEngine::ClientContext6::currentHost(), isc::dhcp::DBG_DHCP6_BASIC, isc::log::DBGLVL_PKT_HANDLING, isc::dhcp::DHCP6_CLASS_ASSIGNED, isc::dhcp::dhcp6_logger, isc::dhcp::DHCP6_PACKET_DROP_DROP_CLASS2, isc::dhcp::AllocEngine::ClientContext6::early_global_reservations_lookup_, evaluateClasses(), isc::dhcp::AllocEngine::ClientContext6::fwd_dns_update_, isc::dhcp::getCalloutHandle(), isc::dhcp::AllocEngine::ClientContext6::globalHost(), isc::dhcp::AllocEngine::ClientContext6::hostname_, isc::dhcp::AllocEngine::ClientContext6::hosts_, LOG_DEBUG, isc::dhcp::packet6_logger, removeDependentEvaluatedClasses(), isc::dhcp::AllocEngine::ClientContext6::rev_dns_update_, selectSubnet(), setHostIdentifiers(), setReservedClientClasses(), and isc::dhcp::AllocEngine::ClientContext6::subnet_.

Referenced by processDhcp6Query().

+ Here is the call graph for this function:

◆ inTestMode()

bool isc::dhcp::Dhcpv6Srv::inTestMode ( ) const
inline

Checks if the server is running in unit test mode.

Returns
true if the server is running in unit test mode, false otherwise.

Definition at line 105 of file dhcp6_srv.h.

◆ jsonPathsToRedact()

std::list< std::list< std::string > > isc::dhcp::Dhcpv6Srv::jsonPathsToRedact ( ) const
finaloverridevirtual

Return a list of all paths that contain passwords or secrets for kea-dhcp6.

Returns
the list of lists of sequential JSON map keys needed to reach the passwords and secrets.

Reimplemented from isc::process::Daemon.

Definition at line 4609 of file dhcp6_srv.cc.

◆ processClientFqdn()

void isc::dhcp::Dhcpv6Srv::processClientFqdn ( const Pkt6Ptr question,
const Pkt6Ptr answer,
AllocEngine::ClientContext6 ctx 
)
protected

Processes Client FQDN Option.

This function retrieves DHCPv6 Client FQDN Option (if any) from the packet sent by a client and takes necessary actions upon this option. Received option comprises flags field which controls what DNS updates server should do. Server may override client's preference based on the current configuration. Server indicates that it has overridden the preference by storing DHCPv6 Client FQDN option with the appropriate flags in the response to a client. This option is also used to communicate the client's domain-name which should be sent to the DNS in the update. Again, server may act upon the received domain-name, i.e. if the provided domain-name is partial it should generate the fully qualified domain-name.

This function takes into account the host reservation if one is matched to this client when forming the FQDN to be used with DNS as well as the lease name to be stored with the lease. In the following the term "reserved hostname" means a host reservation which includes a non-blank hostname.

  • If there is no Client FQDN and no reserved hostname then there will no be DNS updates and the lease hostname will be empty.
  • If there is no Client FQDN but there is reserved hostname then there will be no DNS updates and the lease hostname will be equal to reserved hostname.
  • If there is a Client FQDN and a reserved hostname, then both the FQDN and lease hostname will be equal to reserved hostname with the qualifying suffix appended.
  • If there is a Client FQDN but no reserved hostname then both the FQDN and lease hostname will be equal to the name provided in the client FQDN adjusted according the DhcpDdns configuration parameters (e.g.replace-client-name, qualifying suffix...).

All the logic required to form appropriate answer to the client is held in this function.

Parameters
questionClient's message.
answerServer's response to a client. If server generated Client FQDN option for the client, this option is stored in this object.
ctxclient context (includes subnet, client-id, hw-addr etc.)

Definition at line 1987 of file dhcp6_srv.cc.

References isc::dhcp::D2ClientMgr::adjustDomainName(), isc::dhcp::D2ClientMgr::adjustFqdnFlags(), isc::dhcp::AllocEngine::ClientContext6::currentHost(), D6O_CLIENT_FQDN, isc::dhcp::DBG_DHCP6_DETAIL, isc::log::DBGLVL_PKT_HANDLING, isc::dhcp::ddns6_logger, isc::dhcp::DHCP6_DDNS_GENERATE_FQDN, isc::dhcp::DHCP6_DDNS_RECEIVE_FQDN, isc::dhcp::DHCP6_DDNS_RESPONSE_FQDN_DATA, isc::dhcp::DHCP6_HOOK_DDNS_UPDATE, isc::dhcp::Option6ClientFqdn::FLAG_N, isc::dhcp::Option6ClientFqdn::FLAG_S, isc::dhcp::Option6ClientFqdn::FULL, isc::dhcp::AllocEngine::ClientContext6::fwd_dns_update_, isc::dhcp::getCalloutHandle(), isc::dhcp::CfgMgr::getD2ClientMgr(), isc::dhcp::AllocEngine::ClientContext6::getDdnsParams(), isc::dhcp::Option6ClientFqdn::getDomainName(), isc::dhcp::D2ClientMgr::getUpdateDirections(), isc::hooks::hooks_logger, isc::dhcp::AllocEngine::ClientContext6::hostname_, isc::dhcp::CfgMgr::instance(), LOG_DEBUG, isc::dhcp::Option6ClientFqdn::PARTIAL, isc::dhcp::D2ClientMgr::qualifyName(), isc::dhcp::D2ClientConfig::RCM_ALWAYS, isc::dhcp::D2ClientConfig::RCM_WHEN_NOT_PRESENT, isc::dhcp::AllocEngine::ClientContext6::rev_dns_update_, isc::dhcp::Option6ClientFqdn::setDomainName(), isc::dhcp::Option6ClientFqdn::setFlag(), isc::dhcp::AllocEngine::ClientContext6::subnet_, and isc::dhcp::Option6ClientFqdn::toText().

Referenced by checkDynamicSubnetChange(), processRebind(), processRenew(), processRequest(), and processSolicit().

+ Here is the call graph for this function:

◆ processConfirm()

Pkt6Ptr isc::dhcp::Dhcpv6Srv::processConfirm ( AllocEngine::ClientContext6 ctx)
protected

Processes incoming Confirm message and returns Reply.

This function processes Confirm message from the client according to section 18.3.3. of RFC 8415. It discards the Confirm message if the message sent by the client contains no addresses, i.e. it has no IA_NA options or all IA_NA options contain no IAAddr options.

If the Confirm message contains addresses this function will perform the following checks:

  • check if there is appropriate subnet configured for the client (e.g. subnet from which addresses are assigned for requests received on the particular interface).
  • check if all addresses sent in the Confirm message belong to the selected subnet.

If any of the checks above fails, the Reply message with the status code NotOnLink is returned. Otherwise, the Reply message with the status code Success is returned.

Parameters
ctxReference to client context
Returns
Reply message from the server or NULL pointer if Confirm message should be discarded by the server.

Definition at line 3496 of file dhcp6_srv.cc.

References appendDefaultOptions(), appendRequestedOptions(), appendRequestedVendorOptions(), buildCfgOptionList(), conditionallySetReservedClientClasses(), copyClientOptions(), D6O_IA_NA, D6O_IAADDR, DHCPV6_REPLY, isc::dhcp::Option6IAAddr::getAddress(), isc::dhcp::Option::getOptions(), isc_throw, isc::dhcp::AllocEngine::ClientContext6::query_, requiredClassify(), STATUS_NotOnLink, STATUS_Success, and isc::dhcp::AllocEngine::ClientContext6::subnet_.

Referenced by processDhcp6Query().

+ Here is the call graph for this function:

◆ processDecline()

Pkt6Ptr isc::dhcp::Dhcpv6Srv::processDecline ( AllocEngine::ClientContext6 ctx)
protected

Process incoming Decline message.

This method processes Decline message. It conducts standard sanity checks, creates empty reply and copies the necessary options from the client's message. Finally, it calls declineLeases, where the actual address processing takes place.

Parameters
ctxReference to client context
Returns
Reply message to be sent to the client.

Definition at line 3612 of file dhcp6_srv.cc.

References appendDefaultOptions(), buildCfgOptionList(), conditionallySetReservedClientClasses(), copyClientOptions(), declineLeases(), DHCPV6_REPLY, isc::dhcp::AllocEngine::ClientContext6::query_, and requiredClassify().

Referenced by processDhcp6Query().

+ Here is the call graph for this function:

◆ processDhcp4Query()

void isc::dhcp::Dhcpv6Srv::processDhcp4Query ( const Pkt6Ptr dhcp4_query)
protected

Processes incoming DHCPv4-query message.

It always returns NULL, as there is nothing to be sent back to the client at this time. The message was sent to DHCPv4 server using isc::dhcp::Dhcp6to4Ipc::handler()). We will send back a response to the client once we get back DHCP4-REPLY from the DHCPv4 server.

Parameters
dhcp4_querymessage received from client Does not throw

Definition at line 3948 of file dhcp6_srv.cc.

References D6O_DHCPV4_MSG, D6O_VENDOR_CLASS, isc::dhcp::DOCSIS3_CLASS_EROUTER, isc::dhcp::DOCSIS3_CLASS_MODEM, isc::dhcp::Dhcp6to4Ipc::instance(), isc::dhcp::Dhcp4o6IpcBase::send(), and VENDOR_CLASS_PREFIX.

Referenced by processDhcp6Query().

+ Here is the call graph for this function:

◆ processDhcp6Query()

void isc::dhcp::Dhcpv6Srv::processDhcp6Query ( Pkt6Ptr query,
Pkt6Ptr rsp 
)

◆ processDhcp6QueryAndSendResponse()

void isc::dhcp::Dhcpv6Srv::processDhcp6QueryAndSendResponse ( Pkt6Ptr query,
Pkt6Ptr rsp 
)

Process a single incoming DHCPv6 query.

It calls per-type processXXX methods, generates appropriate answer, sends the answer to the client.

Parameters
queryA pointer to the packet to be processed.
rspA pointer to the response.

Definition at line 897 of file dhcp6_srv.cc.

References isc::dhcp::DHCP6_PACKET_PROCESS_EXCEPTION, isc::dhcp::DHCP6_PACKET_PROCESS_STD_EXCEPTION, isc::dhcp::getCalloutHandle(), LOG_ERROR, isc::dhcp::packet6_logger, processDhcp6Query(), and processPacketBufferSend().

Referenced by processDhcp6Query().

+ Here is the call graph for this function:

◆ processInfRequest()

Pkt6Ptr isc::dhcp::Dhcpv6Srv::processInfRequest ( AllocEngine::ClientContext6 ctx)
protected

Processes incoming Information-request message.

Parameters
ctxReference to client context
Returns
Reply message to be sent to the client.

Definition at line 3917 of file dhcp6_srv.cc.

References appendDefaultOptions(), appendRequestedOptions(), appendRequestedVendorOptions(), buildCfgOptionList(), conditionallySetReservedClientClasses(), copyClientOptions(), DHCPV6_REPLY, isc::dhcp::AllocEngine::ClientContext6::query_, and requiredClassify().

Referenced by processDhcp6Query().

+ Here is the call graph for this function:

◆ processPacket()

◆ processPacketAndSendResponse()

void isc::dhcp::Dhcpv6Srv::processPacketAndSendResponse ( Pkt6Ptr query)

Process a single incoming DHCPv6 packet and sends the response.

It verifies correctness of the passed packet, calls per-type processXXX methods, generates appropriate answer, sends the answer to the client.

Parameters
queryA pointer to the packet to be processed.

Definition at line 709 of file dhcp6_srv.cc.

References isc::dhcp::getCalloutHandle(), processPacket(), and processPacketBufferSend().

Referenced by processPacketAndSendResponseNoThrow(), and run_one().

+ Here is the call graph for this function:

◆ processPacketAndSendResponseNoThrow()

void isc::dhcp::Dhcpv6Srv::processPacketAndSendResponseNoThrow ( Pkt6Ptr query)

Process a single incoming DHCPv6 packet and sends the response.

It verifies correctness of the passed packet, calls per-type processXXX methods, generates appropriate answer, sends the answer to the client.

Parameters
queryA pointer to the packet to be processed.

Definition at line 697 of file dhcp6_srv.cc.

References isc::dhcp::DHCP6_PACKET_PROCESS_EXCEPTION, isc::dhcp::DHCP6_PACKET_PROCESS_STD_EXCEPTION, LOG_ERROR, isc::dhcp::packet6_logger, and processPacketAndSendResponse().

Referenced by run_one().

+ Here is the call graph for this function:

◆ processPacketBufferSend()

void isc::dhcp::Dhcpv6Srv::processPacketBufferSend ( hooks::CalloutHandlePtr callout_handle,
Pkt6Ptr rsp 
)

Executes buffer6_send callout and sends the response.

Parameters
callout_handlepointer to the callout handle.
rsppointer to a response.

Definition at line 1285 of file dhcp6_srv.cc.

References isc::dhcp::DBG_DHCP6_BASIC, isc::dhcp::DBG_DHCP6_DETAIL_DATA, isc::dhcp::DBG_DHCP6_HOOKS, isc::dhcp::DHCP6_HOOK_BUFFER_SEND_SKIP, isc::dhcp::DHCP6_PACKET_SEND, isc::dhcp::DHCP6_PACKET_SEND_FAIL, isc::dhcp::DHCP6_RESPONSE_DATA, isc::hooks::hooks_logger, LOG_DEBUG, LOG_ERROR, isc::dhcp::packet6_logger, processStatsSent(), and sendPacket().

Referenced by processDhcp6QueryAndSendResponse(), processPacketAndSendResponse(), and sendResponseNoThrow().

+ Here is the call graph for this function:

◆ processPacketPktSend()

void isc::dhcp::Dhcpv6Srv::processPacketPktSend ( hooks::CalloutHandlePtr callout_handle,
Pkt6Ptr query,
Pkt6Ptr rsp 
)
protected

Executes pkt6_send callout.

Parameters
callout_handlepointer to the callout handle.
queryPointer to a query.
rspPointer to a response.

Callouts decided to drop the packet.

Definition at line 1220 of file dhcp6_srv.cc.

References isc::dhcp::DBG_DHCP6_HOOKS, isc::log::DBGLVL_PKT_HANDLING, isc::dhcp::DHCP6_HOOK_PACKET_SEND_DROP, isc::dhcp::DHCP6_HOOK_PACKET_SEND_SKIP, isc::dhcp::DHCP6_PACK_FAIL, isc::hooks::hooks_logger, LOG_DEBUG, LOG_ERROR, and isc::dhcp::options6_logger.

Referenced by sendResponseNoThrow().

◆ processRebind()

Pkt6Ptr isc::dhcp::Dhcpv6Srv::processRebind ( AllocEngine::ClientContext6 ctx)
protected

Processes incoming Rebind message.

Todo:
There are cases when the Rebind message should be discarded by the DHCP server. One of those is when the server doesn't have a record of the client and it is unable to determine whether the client is on the appropriate link or not. We don't seem to do it now.
Parameters
ctxReference to client context
Returns
Reply message to be sent to the client.

Definition at line 3462 of file dhcp6_srv.cc.

References alloc_engine_, appendDefaultOptions(), appendRequestedOptions(), appendRequestedVendorOptions(), buildCfgOptionList(), conditionallySetReservedClientClasses(), copyClientOptions(), createNameChangeRequests(), DHCPV6_REPLY, extendLeases(), processClientFqdn(), isc::dhcp::AllocEngine::ClientContext6::query_, and requiredClassify().

Referenced by processDhcp6Query().

+ Here is the call graph for this function:

◆ processRelease()

Pkt6Ptr isc::dhcp::Dhcpv6Srv::processRelease ( AllocEngine::ClientContext6 ctx)
protected

Process incoming Release message.

Parameters
ctxReference to client context
Returns
Reply message to be sent to the client.
Todo:
If client sent a release and we should remove outstanding DNS records.

Definition at line 3586 of file dhcp6_srv.cc.

References appendDefaultOptions(), conditionallySetReservedClientClasses(), copyClientOptions(), DHCPV6_REPLY, isc::dhcp::AllocEngine::ClientContext6::query_, releaseLeases(), and requiredClassify().

Referenced by processDhcp6Query().

+ Here is the call graph for this function:

◆ processRenew()

Pkt6Ptr isc::dhcp::Dhcpv6Srv::processRenew ( AllocEngine::ClientContext6 ctx)
protected

Processes incoming Renew message.

Parameters
ctxReference to client context
Returns
Reply message to be sent to the client.

Definition at line 3428 of file dhcp6_srv.cc.

References alloc_engine_, appendDefaultOptions(), appendRequestedOptions(), appendRequestedVendorOptions(), buildCfgOptionList(), conditionallySetReservedClientClasses(), copyClientOptions(), createNameChangeRequests(), DHCPV6_REPLY, extendLeases(), processClientFqdn(), isc::dhcp::AllocEngine::ClientContext6::query_, and requiredClassify().

Referenced by processDhcp6Query().

+ Here is the call graph for this function:

◆ processRequest()

Pkt6Ptr isc::dhcp::Dhcpv6Srv::processRequest ( AllocEngine::ClientContext6 ctx)
protected

Processes incoming Request and returns Reply response.

Processes incoming Request message and verifies that its sender should be served. In particular IA, TA and PD options are populated with assigned addresses, temporary addresses and delegated prefixes, respectively. Uses LeaseMgr to allocate or update existing leases.

Parameters
ctxReference to client context
Returns
REPLY message or NULL

Definition at line 3394 of file dhcp6_srv.cc.

References alloc_engine_, appendDefaultOptions(), appendRequestedOptions(), appendRequestedVendorOptions(), assignLeases(), buildCfgOptionList(), conditionallySetReservedClientClasses(), copyClientOptions(), createNameChangeRequests(), DHCPV6_REPLY, processClientFqdn(), isc::dhcp::AllocEngine::ClientContext6::query_, and requiredClassify().

Referenced by processDhcp6Query().

+ Here is the call graph for this function:

◆ processRSOO()

void isc::dhcp::Dhcpv6Srv::processRSOO ( const Pkt6Ptr query,
const Pkt6Ptr rsp 
)
protected

Processes Relay-supplied options, if present.

This method implements RFC6422. It checks if there are any RSOO options inserted by the relay agents in the query message. If there are, they are copied over to the response if they meet the following criteria:

  • the option is marked as RSOO-enabled (see relay-supplied-options configuration parameter)
  • there is no such option provided by the server)

Definition at line 4369 of file dhcp6_srv.cc.

References D6O_RSOO, isc::dhcp::CfgMgr::getCurrentCfg(), and isc::dhcp::CfgMgr::instance().

Referenced by processDhcp6Query().

+ Here is the call graph for this function:

◆ processSolicit()

Pkt6Ptr isc::dhcp::Dhcpv6Srv::processSolicit ( AllocEngine::ClientContext6 ctx)
protected

Processes incoming Solicit and returns response.

Processes received Solicit message and verifies that its sender should be served. In particular IA, TA and PD options are populated with to-be assigned addresses, temporary addresses and delegated prefixes, respectively. In the usual 4 message exchange, server is expected to respond with Advertise message. However, if client requests rapid-commit and server supports it, Reply will be sent instead of Advertise and requested leases will be assigned immediately.

Parameters
ctxReference to client context
Returns
Advertise, Reply message or NULL.

Definition at line 3328 of file dhcp6_srv.cc.

References alloc_engine_, appendDefaultOptions(), appendRequestedOptions(), appendRequestedVendorOptions(), assignLeases(), buildCfgOptionList(), conditionallySetReservedClientClasses(), copyClientOptions(), createNameChangeRequests(), D6O_RAPID_COMMIT, isc::dhcp::DBG_DHCP6_DETAIL, isc::dhcp::DHCP6_RAPID_COMMIT, DHCPV6_ADVERTISE, DHCPV6_REPLY, isc::dhcp::AllocEngine::ClientContext6::fake_allocation_, LOG_DEBUG, isc::dhcp::options6_logger, processClientFqdn(), isc::dhcp::AllocEngine::ClientContext6::query_, requiredClassify(), and isc::dhcp::AllocEngine::ClientContext6::subnet_.

Referenced by processDhcp6Query().

+ Here is the call graph for this function:

◆ processStatsSent()

void isc::dhcp::Dhcpv6Srv::processStatsSent ( const Pkt6Ptr response)
static

Updates statistics for transmitted packets.

Note
used by DHCPv4-over-DHCPv6 so must be public and static
Parameters
responsepacket transmitted

Definition at line 4474 of file dhcp6_srv.cc.

References DHCPV6_ADVERTISE, DHCPV6_DHCPV4_RESPONSE, and DHCPV6_REPLY.

Referenced by processPacketBufferSend().

◆ receivePacket()

Pkt6Ptr isc::dhcp::Dhcpv6Srv::receivePacket ( int  timeout)
protectedvirtual

dummy wrapper around IfaceMgr::receive6

This method is useful for testing purposes, where its replacement simulates reception of a packet. For that purpose it is protected.

Definition at line 310 of file dhcp6_srv.cc.

References isc::dhcp::IfaceMgr::instance().

Referenced by run_one().

+ Here is the call graph for this function:

◆ releaseIA_NA()

OptionPtr isc::dhcp::Dhcpv6Srv::releaseIA_NA ( const DuidPtr duid,
const Pkt6Ptr query,
int &  general_status,
boost::shared_ptr< Option6IA ia,
Lease6Ptr old_lease 
)
protected

Releases specific IA_NA option.

Generates response to IA_NA in Release message. This covers finding and removal of a lease that corresponds to the received address. If no such lease is found, an IA_NA response is generated with an appropriate status code.

The server sends top-level Status Code option. This method may update the passed value of that option, i.e. general_status. It is set to SUCCESS when message processing begins, but may be updated to some error code if the release process fails.

Parameters
duidclient's duid
queryclient's message
general_statusa global status (it may be updated in case of errors)
iaIA_NA option that is being released
old_leasea pointer to the lease being released
Returns
IA_NA option (server's response)

Definition at line 2996 of file dhcp6_srv.cc.

References isc::dhcp::Option::addOption(), isc::dhcp_ddns::CHG_REMOVE, D6O_IA_NA, D6O_IAADDR, isc::dhcp::DBG_DHCP6_DETAIL, isc::dhcp::DBG_DHCP6_HOOKS, isc::dhcp::LeaseMgr::deleteLease(), isc::dhcp::DHCP6_HOOK_LEASE6_RELEASE_NA_SKIP, isc::dhcp::DHCP6_LEASE_NA_WITHOUT_DUID, isc::dhcp::DHCP6_PROCESS_IA_NA_RELEASE, isc::dhcp::DHCP6_RELEASE_NA, isc::dhcp::DHCP6_RELEASE_NA_FAIL, isc::dhcp::DHCP6_RELEASE_NA_FAIL_WRONG_DUID, isc::dhcp::DHCP6_RELEASE_NA_FAIL_WRONG_IAID, isc::dhcp::getCalloutHandle(), isc::dhcp::LeaseMgr::getLease6(), isc::hooks::hooks_logger, isc::dhcp::LeaseMgrFactory::instance(), isc::dhcp::lease6_logger, LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_WARN, isc::dhcp::queueNCR(), STATUS_NoBinding, STATUS_Success, STATUS_UnspecFail, and isc::dhcp::Lease::TYPE_NA.

Referenced by releaseLeases().

+ Here is the call graph for this function:

◆ releaseIA_PD()

OptionPtr isc::dhcp::Dhcpv6Srv::releaseIA_PD ( const DuidPtr duid,
const Pkt6Ptr query,
int &  general_status,
boost::shared_ptr< Option6IA ia,
Lease6Ptr old_lease 
)
protected

Releases specific IA_PD option.

Generates response to IA_PD in Release message. This covers finding and removal of a lease that corresponds to the received prefix(es). If no such lease is found, an IA_PD response is generated with an appropriate status code.

Parameters
duidclient's duid
queryclient's message
general_statusa global status (it may be updated in case of errors)
iaIA_PD option that is being released
old_leasea pointer to the lease being released
Returns
IA_PD option (server's response)

Definition at line 3168 of file dhcp6_srv.cc.

References isc::dhcp::Option::addOption(), D6O_IA_PD, D6O_IAPREFIX, isc::dhcp::DBG_DHCP6_HOOKS, isc::dhcp::LeaseMgr::deleteLease(), isc::dhcp::DHCP6_HOOK_LEASE6_RELEASE_PD_SKIP, isc::dhcp::DHCP6_LEASE_PD_WITHOUT_DUID, isc::dhcp::DHCP6_RELEASE_PD, isc::dhcp::DHCP6_RELEASE_PD_FAIL, isc::dhcp::DHCP6_RELEASE_PD_FAIL_WRONG_DUID, isc::dhcp::DHCP6_RELEASE_PD_FAIL_WRONG_IAID, isc::dhcp::getCalloutHandle(), isc::dhcp::LeaseMgr::getLease6(), isc::hooks::hooks_logger, isc::dhcp::LeaseMgrFactory::instance(), isc::dhcp::lease6_logger, LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_WARN, STATUS_NoBinding, STATUS_Success, STATUS_UnspecFail, and isc::dhcp::Lease::TYPE_PD.

Referenced by releaseLeases().

+ Here is the call graph for this function:

◆ releaseLeases()

void isc::dhcp::Dhcpv6Srv::releaseLeases ( const Pkt6Ptr release,
Pkt6Ptr reply,
AllocEngine::ClientContext6 ctx 
)
protected

Attempts to release received addresses.

It iterates through received IA_NA options and attempts to release received addresses. If no such leases are found, or the lease fails proper checks (e.g. belongs to someone else), a proper status code is added to reply message. Released addresses are not added to REPLY packet, just its IA_NA containers.

Parameters
releaseclient's message asking to release
replyserver's response
ctxclient context (includes subnet, client-id, hw-addr etc.)
Todo:
Add support for IA_TA
Todo:
Consider supporting more than one address in a single IA. It is allowed by RFC 8415, but it is not widely implemented. The only software that supports that is Dibbler, but its author seriously doubts if anyone is really using it. Clients that want more than one address or prefix just include more instances of IA options.

Definition at line 2938 of file dhcp6_srv.cc.

References isc::dhcp::AllocEngine::ClientContext6::currentIA(), D6O_IA_NA, D6O_IA_PD, isc::dhcp::AllocEngine::ClientContext6::duid_, isc::dhcp::AllocEngine::ClientContext6::IAContext::old_leases_, releaseIA_NA(), releaseIA_PD(), and STATUS_Success.

Referenced by processRelease().

+ Here is the call graph for this function:

◆ removeDependentEvaluatedClasses()

void isc::dhcp::Dhcpv6Srv::removeDependentEvaluatedClasses ( const Pkt6Ptr pkt)
staticprotected

Removed evaluated client classes.

Todo:
: keep the list of dependent evaluated classes so remove only them.
Parameters
pktthe packet.

Definition at line 4050 of file dhcp6_srv.cc.

References isc::dhcp::CfgMgr::getCurrentCfg(), and isc::dhcp::CfgMgr::instance().

Referenced by earlyGHRLookup(), and initContext().

+ Here is the call graph for this function:

◆ requiredClassify()

void isc::dhcp::Dhcpv6Srv::requiredClassify ( const Pkt6Ptr pkt,
AllocEngine::ClientContext6 ctx 
)
protected

Assigns incoming packet to zero or more classes (required pass).

Note
This required classification evaluates all classes which were marked for required evaluation. Classes are collected so evaluated in the reversed order than output option processing.
The only-if-required flag is related because it avoids double evaluation (which is not forbidden).
Parameters
pktpacket to be classified
ctxallocation context where to get information

Definition at line 4099 of file dhcp6_srv.cc.

References isc::dhcp::AllocEngine::ClientContext6::allocated_resources_, isc::dhcp::ClientClasses::cbegin(), isc::dhcp::ClientClasses::cend(), isc::dhcp::AllocEngine::ClientContext6::currentHost(), D6O_CLIENT_FQDN, D6O_IA_NA, D6O_IAADDR, isc::dhcp::DBG_DHCP6_BASIC, isc::dhcp::DBG_DHCP6_DETAIL, isc::dhcp::DBG_DHCP6_DETAIL_DATA, isc::dhcp::ddns6_logger, isc::dhcp::DHCP6_CLASS_UNDEFINED, isc::dhcp::DHCP6_CLASS_UNTESTABLE, isc::dhcp::DHCP6_DDNS_FQDN_GENERATED, isc::dhcp::DHCP6_DDNS_GENERATED_FQDN_UPDATE_FAIL, isc::dhcp::dhcp6_logger, DHCPV6_ADVERTISE, isc::dhcp::EVAL_RESULT, isc::dhcp::evaluateBool(), isc::dhcp::Option6ClientFqdn::FULL, isc::dhcp::D2ClientMgr::generateFqdn(), isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::CfgMgr::getD2ClientMgr(), isc::dhcp::AllocEngine::ClientContext6::getDdnsParams(), isc::dhcp::Option6ClientFqdn::getDomainName(), isc::dhcp::Option::getOption(), isc::dhcp::AllocEngine::ClientContext6::hostname_, isc::dhcp::ClientClasses::insert(), isc::dhcp::CfgMgr::instance(), isc::dhcp::LeaseMgrFactory::instance(), isc_throw, LOG_DEBUG, LOG_ERROR, LOG_INFO, isc::dhcp::AllocEngine::ClientContext6::new_leases_, isc::dhcp::AllocEngine::ClientContext6::subnet_, isc::asiolink::IOAddress::toText(), isc::dhcp::Lease::TYPE_NA, isc::dhcp::Lease::TYPE_PD, isc::dhcp::LeaseMgr::updateLease6(), and isc::Exception::what().

Referenced by processConfirm(), processDecline(), processInfRequest(), processRebind(), processRelease(), processRenew(), processRequest(), and processSolicit().

+ Here is the call graph for this function:

◆ run()

int isc::dhcp::Dhcpv6Srv::run ( )

Main server processing loop.

Main server processing loop. Call the processing step routine until shut down.

Returns
The value returned by Daemon::getExitValue().

Definition at line 582 of file dhcp6_srv.cc.

References isc::dhcp::DHCP6_PACKET_PROCESS_EXCEPTION, isc::dhcp::DHCP6_PACKET_PROCESS_STD_EXCEPTION, isc::process::Daemon::getExitValue(), getIOService(), LOG_ERROR, isc::dhcp::packet6_logger, run_one(), server_port_, and shutdown_.

+ Here is the call graph for this function:

◆ run_one()

void isc::dhcp::Dhcpv6Srv::run_one ( )

◆ sanityCheck() [1/2]

bool isc::dhcp::Dhcpv6Srv::sanityCheck ( const Pkt6Ptr pkt)
protected

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.

Parameters
pktpacket to be checked
Returns
false if the message should be dropped as a result of the sanity check.

Definition at line 1747 of file dhcp6_srv.cc.

References isc::dhcp::bad_packet6_logger, isc::dhcp::DBG_DHCP6_BASIC, isc::dhcp::DHCP6_REQUIRED_OPTIONS_CHECK_FAIL, isc::dhcp::DHCP6_UNKNOWN_MSG_RECEIVED, DHCPV6_CONFIRM, DHCPV6_DECLINE, DHCPV6_DHCPV4_QUERY, DHCPV6_INFORMATION_REQUEST, DHCPV6_REBIND, DHCPV6_RELEASE, DHCPV6_RENEW, DHCPV6_REQUEST, DHCPV6_SOLICIT, FORBIDDEN, LOG_DEBUG, MANDATORY, OPTIONAL, and isc::Exception::what().

Referenced by processPacket().

+ Here is the call graph for this function:

◆ sanityCheck() [2/2]

void isc::dhcp::Dhcpv6Srv::sanityCheck ( const Pkt6Ptr pkt,
RequirementLevel  clientid,
RequirementLevel  serverid 
)
protected

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.

Parameters
pktpacket to be checked
clientidexpectation regarding client-id option
serveridexpectation regarding server-id option
Exceptions
RFCViolationif any issues are detected

Definition at line 1789 of file dhcp6_srv.cc.

References D6O_CLIENTID, D6O_SERVERID, FORBIDDEN, isc_throw, MANDATORY, OPTIONAL, and sanityCheckDUID().

+ Here is the call graph for this function:

◆ sanityCheckDUID()

void isc::dhcp::Dhcpv6Srv::sanityCheckDUID ( const OptionPtr opt,
const std::string &  opt_name 
)
protected

verifies if received DUID option (client-id or server-id) is sane

Parameters
optoption to be checked
opt_nametext name to be printed
Exceptions
RFCViolationif any issues are detected

Definition at line 1846 of file dhcp6_srv.cc.

References isc_throw, and isc::dhcp::DUID::MAX_DUID_LEN.

Referenced by sanityCheck().

◆ selectSubnet()

Subnet6Ptr isc::dhcp::Dhcpv6Srv::selectSubnet ( const Pkt6Ptr question,
bool &  drop 
)
protected

◆ sendPacket()

void isc::dhcp::Dhcpv6Srv::sendPacket ( const Pkt6Ptr pkt)
protectedvirtual

dummy wrapper around IfaceMgr::send()

This method is useful for testing purposes, where its replacement simulates transmission of a packet. For that purpose it is protected.

Definition at line 314 of file dhcp6_srv.cc.

References isc::dhcp::IfaceMgr::instance(), and isc::dhcp::IfaceMgr::send().

Referenced by processPacketBufferSend().

+ Here is the call graph for this function:

◆ sendResponseNoThrow()

void isc::dhcp::Dhcpv6Srv::sendResponseNoThrow ( hooks::CalloutHandlePtr callout_handle,
Pkt6Ptr query,
Pkt6Ptr rsp 
)

Process an unparked DHCPv6 packet and sends the response.

Parameters
callout_handlepointer to the callout handle.
queryA pointer to the packet to be processed.
rspA pointer to the response.

Definition at line 1206 of file dhcp6_srv.cc.

References isc::dhcp::DHCP6_PACKET_PROCESS_EXCEPTION, isc::dhcp::DHCP6_PACKET_PROCESS_STD_EXCEPTION, LOG_ERROR, isc::dhcp::packet6_logger, processPacketBufferSend(), and processPacketPktSend().

+ Here is the call graph for this function:

◆ setHostIdentifiers()

void isc::dhcp::Dhcpv6Srv::setHostIdentifiers ( AllocEngine::ClientContext6 ctx)
static

Set host identifiers within a context.

This method sets an ordered list of host identifier types and values which the server should use to find host reservations. The order of the set is determined by the configuration parameter, host-reservation-identifiers

Parameters
ctxreference to the context.

Definition at line 362 of file dhcp6_srv.cc.

References isc::dhcp::AllocEngine::ClientContext6::addHostIdentifier(), isc::log::DBGLVL_TRACE_BASIC, isc::dhcp::DHCP6_FLEX_ID, isc::dhcp::AllocEngine::ClientContext6::duid_, isc::dhcp::getCalloutHandle(), isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::Host::getIdentifierAsText(), isc::dhcp::AllocEngine::ClientContext6::hwaddr_, isc::dhcp::Host::IDENT_DUID, isc::dhcp::Host::IDENT_FLEX, isc::dhcp::Host::IDENT_HWADDR, isc::dhcp::CfgMgr::instance(), LOG_DEBUG, isc::dhcp::packet6_logger, and isc::dhcp::AllocEngine::ClientContext6::query_.

Referenced by earlyGHRLookup(), and initContext().

+ Here is the call graph for this function:

◆ setPacketStatisticsDefaults()

void isc::dhcp::Dhcpv6Srv::setPacketStatisticsDefaults ( )
protected

This function sets statistics related to DHCPv6 packets processing to their initial values.

All of the statistics observed by the DHCPv6 server and with the names like "pkt6-" are reset to 0. This function must be invoked in the class constructor.

Definition at line 258 of file dhcp6_srv.cc.

References isc::stats::StatsMgr::instance(), and isc::stats::StatsMgr::setValue().

Referenced by Dhcpv6Srv().

+ Here is the call graph for this function:

◆ setReservedClientClasses()

void isc::dhcp::Dhcpv6Srv::setReservedClientClasses ( const Pkt6Ptr pkt,
const AllocEngine::ClientContext6 ctx 
)
protected

Assigns classes retrieved from host reservation database.

Parameters
pktPointer to the packet to which classes will be assigned.
ctxReference to the client context.

Definition at line 4065 of file dhcp6_srv.cc.

References isc::dhcp::ClientClasses::cbegin(), isc::dhcp::ClientClasses::cend(), isc::dhcp::AllocEngine::ClientContext6::currentHost(), isc::dhcp::DBG_DHCP6_BASIC, isc::dhcp::DHCP6_CLASS_ASSIGNED, isc::dhcp::dhcp6_logger, isc::dhcp::ClientClasses::empty(), LOG_DEBUG, and isc::dhcp::ClientClasses::toText().

Referenced by conditionallySetReservedClientClasses(), and initContext().

+ Here is the call graph for this function:

◆ setStatusCode()

void isc::dhcp::Dhcpv6Srv::setStatusCode ( boost::shared_ptr< Option6IA > &  container,
const OptionPtr status 
)
protected

A simple utility method that sets the status code.

Removes old status code and sets a new one.

Parameters
containerstatus code will be added here
statusstatus code option

Definition at line 3809 of file dhcp6_srv.cc.

References D6O_STATUS_CODE.

Referenced by declineIA().

◆ setTeeTimes()

void isc::dhcp::Dhcpv6Srv::setTeeTimes ( uint32_t  preferred_lft,
const Subnet6Ptr subnet,
Option6IAPtr resp 
)
protected

Sets the T1 and T2 timers in the outbound IA.

This method determines the values for both the T1 and T2 timers for the given IA. It is influenced by the lease's subnet's values for renew-timer, rebind-timer, calculate-tee-times, t1-percent, and t2-percent as follows:

T2:

The value for T2 defaults to zero. If the rebind-timer value is specified then use it. If not and calculate-tee-times is true, then use the value given by: preferred lease time * t2-percent.

T1:

The candidate value for T1 defaults to zero. If the renew-timer value is specified then use it. If not and calculate-tee-times is true, then use the value given by: preferred lease time * t1-percent.

The T1 candidate will be used provided it less than to T2, otherwise it will be set T1 to zero.

Parameters
preferred_lftpreferred lease time of the lease being assigned to the client
subnetthe subnet to which the lease belongs
respoutbound IA option in which the timers are set.
Todo:
This logic to be modified if we decide to support infinite lease times.

Definition at line 4522 of file dhcp6_srv.cc.

Referenced by assignIA_NA(), assignIA_PD(), extendIA_NA(), and extendIA_PD().

◆ shutdown()

void isc::dhcp::Dhcpv6Srv::shutdown ( )
overridevirtual

Instructs the server to shut down.

Reimplemented from isc::process::Daemon.

Definition at line 305 of file dhcp6_srv.cc.

References isc::dhcp::DBG_DHCP6_BASIC, isc::dhcp::dhcp6_logger, isc::dhcp::DHCP6_SHUTDOWN_REQUEST, LOG_DEBUG, and shutdown_.

Referenced by isc::dhcp::ControlledDhcpv6Srv::shutdownServer().

◆ startD2()

void isc::dhcp::Dhcpv6Srv::startD2 ( )

Starts DHCP_DDNS client IO if DDNS updates are enabled.

If updates are enabled, it instructs the D2ClientMgr singleton to enter send mode. If D2ClientMgr encounters errors it may throw D2ClientError. This method does not catch exceptions.

Definition at line 4309 of file dhcp6_srv.cc.

References d2ClientErrorHandler(), isc::dhcp::D2ClientMgr::ddnsEnabled(), isc::dhcp::CfgMgr::getD2ClientMgr(), isc::dhcp::CfgMgr::instance(), and isc::dhcp::D2ClientMgr::startSender().

Referenced by isc::dhcp::ControlledDhcpv6Srv::processConfig().

+ Here is the call graph for this function:

◆ stopD2()

void isc::dhcp::Dhcpv6Srv::stopD2 ( )

Stops DHCP_DDNS client IO if DDNS updates are enabled.

If updates are enabled, it instructs the D2ClientMgr singleton to leave send mode. If D2ClientMgr encounters errors it may throw D2ClientError. This method does not catch exceptions.

Definition at line 4321 of file dhcp6_srv.cc.

References isc::dhcp::D2ClientMgr::ddnsEnabled(), isc::dhcp::CfgMgr::getD2ClientMgr(), isc::dhcp::CfgMgr::instance(), and isc::dhcp::D2ClientMgr::stopSender().

Referenced by ~Dhcpv6Srv().

+ Here is the call graph for this function:

◆ testServerID()

bool isc::dhcp::Dhcpv6Srv::testServerID ( const Pkt6Ptr pkt)
protected

Compare received server id with our server id.

Checks if the server id carried in a query from a client matches server identifier being used by the server.

Parameters
pktDHCPv6 packet carrying server identifier to be checked.
Returns
true if server id carried in the query matches server id used by the server; false otherwise.
Todo:
Currently we always check server identifier regardless if it is allowed in the received message or not (per RFC 8415). If the server identifier is not allowed in the message, the sanityCheck function should deal with it.

Definition at line 319 of file dhcp6_srv.cc.

References isc::dhcp::bad_packet6_logger, D6O_SERVERID, isc::log::DBGLVL_PKT_HANDLING, isc::dhcp::DHCP6_PACKET_DROP_SERVERID_MISMATCH, duidToString(), getServerID(), and LOG_DEBUG.

Referenced by processPacket().

+ Here is the call graph for this function:

◆ testUnicast()

bool isc::dhcp::Dhcpv6Srv::testUnicast ( const Pkt6Ptr pkt) const
protected

Check if the message can be sent to unicast.

This function checks if the received message conforms to the section 16 of RFC 8415 which says that: "A server MUST discard any Solicit, Confirm, Rebind or Information-request messages it receives with a Layer 3 unicast destination address.

Parameters
pktDHCPv6 message to be checked.
Returns
false if the message has been sent to unicast address but it is not allowed according to RFC3315, section 15; true otherwise.

Definition at line 341 of file dhcp6_srv.cc.

References isc::dhcp::bad_packet6_logger, isc::log::DBGLVL_PKT_HANDLING, isc::dhcp::DHCP6_PACKET_DROP_UNICAST, DHCPV6_CONFIRM, DHCPV6_INFORMATION_REQUEST, DHCPV6_REBIND, DHCPV6_SOLICIT, and LOG_DEBUG.

Referenced by processPacket().

Member Data Documentation

◆ alloc_engine_

boost::shared_ptr<AllocEngine> isc::dhcp::Dhcpv6Srv::alloc_engine_
protected

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)

Definition at line 1182 of file dhcp6_srv.h.

Referenced by assignIA_NA(), assignIA_PD(), Dhcpv6Srv(), earlyGHRLookup(), extendIA_NA(), extendIA_PD(), initContext(), processRebind(), processRenew(), processRequest(), processSolicit(), and isc::dhcp::ControlledDhcpv6Srv::~ControlledDhcpv6Srv().

◆ cb_control_

CBControlDHCPv6Ptr isc::dhcp::Dhcpv6Srv::cb_control_
protected

Controls access to the configuration backends.

Definition at line 1193 of file dhcp6_srv.h.

◆ client_port_

uint16_t isc::dhcp::Dhcpv6Srv::client_port_
protected

UDP port number to which server sends all responses.

Definition at line 1133 of file dhcp6_srv.h.

Referenced by processDhcp6Query().

◆ MIN_MAC_LEN

const size_t isc::dhcp::Dhcpv6Srv::MIN_MAC_LEN = 6
static

Minimum length of a MAC address to be used in DUID generation.

Definition at line 81 of file dhcp6_srv.h.

◆ name_change_reqs_

std::queue<isc::dhcp_ddns::NameChangeRequest> isc::dhcp::Dhcpv6Srv::name_change_reqs_
protected

Holds a list of isc::dhcp_ddns::NameChangeRequest objects, which are waiting for sending to kea-dhcp-ddns module.

Definition at line 1186 of file dhcp6_srv.h.

◆ network_state_

NetworkStatePtr isc::dhcp::Dhcpv6Srv::network_state_
protected

Holds information about disabled DHCP service and/or disabled subnet/network scopes.

Definition at line 1190 of file dhcp6_srv.h.

Referenced by run_one(), and isc::dhcp::ControlledDhcpv6Srv::~ControlledDhcpv6Srv().

◆ server_port_

uint16_t isc::dhcp::Dhcpv6Srv::server_port_
protected

UDP port number on which server listens.

Definition at line 1130 of file dhcp6_srv.h.

Referenced by run().

◆ serverid_

OptionPtr isc::dhcp::Dhcpv6Srv::serverid_
protected

Server DUID (to be sent in server-identifier option)

Definition at line 1164 of file dhcp6_srv.h.

Referenced by Dhcpv6Srv().

◆ shutdown_

volatile bool isc::dhcp::Dhcpv6Srv::shutdown_
protected

Indicates if shutdown is in progress.

Setting it to true will initiate server shutdown procedure.

Definition at line 1168 of file dhcp6_srv.h.

Referenced by Dhcpv6Srv(), run(), and shutdown().

◆ VENDOR_CLASS_PREFIX

const std::string isc::dhcp::Dhcpv6Srv::VENDOR_CLASS_PREFIX
staticprotected

this is a prefix added to the content of vendor-class option

If incoming packet has a vendor class option, its content is prepended with this prefix and then interpreted as a class. For example, a packet that sends vendor class with value of "FOO" will cause the packet to be assigned to class VENDOR_CLASS_FOO.

Definition at line 935 of file dhcp6_srv.h.

Referenced by processDhcp4Query().


The documentation for this class was generated from the following files: