![]() |
Kea
1.5.0
|
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 port=DHCP6_SERVER_PORT) | |
| Default constructor. More... | |
| virtual | ~Dhcpv6Srv () |
| Destructor. Used during DHCPv6 service shutdown. More... | |
| void | classifyByVendor (const Pkt6Ptr &pkt, std::string &classes) |
| Assign class using vendor-class-identifier option. 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 cached and parked packets Clears the call_handle store and packet parking lots of all packets. More... | |
| asiolink::IOServicePtr & | getIOService () |
| Returns pointer to the IO service used by the server. More... | |
| NetworkStatePtr & | getNetworkState () |
| Returns pointer to the network state used by the server. More... | |
| uint16_t | getPort () const |
| Get UDP port on which server should listen. More... | |
| OptionPtr | getServerID () |
| Returns server-identifier option. More... | |
| void | processPacket (Pkt6Ptr &query, Pkt6Ptr &rsp) |
| Process a single incoming DHCPv6 packet. More... | |
| void | processPacketBufferSend (hooks::CalloutHandlePtr &callout_handle, Pkt6Ptr &rsp) |
| Executes buffer6_send callout and sends the response. More... | |
| bool | run () |
| Main server processing loop. More... | |
| void | run_one () |
| Main server processing step. More... | |
| void | shutdown () |
| 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 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... | |
| 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... | |
| std::string | getProcName () const |
| returns the process name This value is used as when forming the default PID file name More... | |
| void | setConfigFile (const std::string &config_file) |
| Sets the configuration file name. 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... | |
| void | setProcName (const std::string &proc_name) |
| Sets the process 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 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 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 | 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, const isc::dhcp::Pkt6Ptr &answer, AllocEngine::ClientContext6 &ctx, Option6IAPtr ia) |
| Processes IA_NA option (and assigns addresses if necessary). More... | |
| OptionPtr | assignIA_PD (const Pkt6Ptr &query, const isc::dhcp::Pkt6Ptr &answer, 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 | classifyPacket (const Pkt6Ptr &pkt) |
| Assigns incoming packet to zero or more classes. 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, const Pkt6Ptr &answer, 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 | 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... | |
| 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 | |
| virtual void | handleSignal () |
| Invokes handler for the next received signal. More... | |
| 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... | |
Protected Attributes | |
| boost::shared_ptr< AllocEngine > | alloc_engine_ |
| Allocation Engine. More... | |
| std::queue< isc::dhcp_ddns::NameChangeRequest > | name_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... | |
| 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::util::SignalHandler | signal_handler_ |
| Pointer to the common signal handler invoked by the handleSignal function. More... | |
| isc::util::SignalSetPtr | signal_set_ |
| A pointer to the object installing custom signal handlers. More... | |
Static Protected Attributes | |
| static const std::string | VENDOR_CLASS_PREFIX |
| this is a prefix added to the content of vendor-class option More... | |
DHCPv6 server service.
This 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.
Definition at line 59 of file dhcp6_srv.h.
defines if certain option may, must or must not appear
| Enumerator | |
|---|---|
| FORBIDDEN | |
| MANDATORY | |
| OPTIONAL | |
Definition at line 67 of file dhcp6_srv.h.
| isc::dhcp::Dhcpv6Srv::Dhcpv6Srv | ( | uint16_t | port = DHCP6_SERVER_PORT | ) |
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.
| port | port on will all sockets will listen |
Definition at line 182 of file dhcp6_srv.cc.
References alloc_engine_, isc::dhcp::AllocEngine::ALLOC_ITERATIVE, D6O_SERVERID, isc::dhcp::DBG_DHCP6_START, isc::dhcp::dhcp6_logger, isc::dhcp::DUIDFactory::get(), isc::dhcp::IfaceMgr::instance(), LOG_DEBUG, LOG_ERROR, serverid_, shutdown_, and isc::dhcp::Option::V6.
Here is the call graph for this function:
|
virtual |
Destructor. Used during DHCPv6 service shutdown.
Definition at line 221 of file dhcp6_srv.cc.
References isc::dhcp::Dhcp4o6IpcBase::close(), isc::dhcp::IfaceMgr::closeSockets(), isc::dhcp::LeaseMgrFactory::destroy(), isc::dhcp::dhcp6_logger, discardPackets(), isc::dhcp::Dhcp6to4Ipc::instance(), isc::dhcp::IfaceMgr::instance(), LOG_ERROR, and stopD2().
Here is the call graph for this function:
|
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.
| question | client's message |
| answer | server's message (options will be added here) |
| co_list | configured option list (currently unused) |
Definition at line 1044 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:
|
protected |
Appends requested options to server's answer.
Appends options requested by client to the server's answer.
| question | client's message |
| answer | server's message (options will be added here) |
| co_list | configured option list |
Definition at line 1120 of file dhcp6_srv.cc.
References D6O_ORO, DHCP6_OPTION_SPACE, and isc::dhcp::OptionDescriptor::option_.
Referenced by processConfirm(), processInfRequest(), processRebind(), processRenew(), processRequest(), and processSolicit().
|
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.
| question | client's message |
| answer | server's message (vendor options will be added here) |
| ctx | client context (contains subnet, duid and other parameters) |
| co_list | configured option list |
Definition at line 1172 of file dhcp6_srv.cc.
References D6O_VENDOR_OPTS, DOCSIS3_V6_ORO, isc::dhcp::OptionDescriptor::option_, isc::dhcp::AllocEngine::ClientContext6::subnet_, and isc::dhcp::Option::V6.
Referenced by processConfirm(), processInfRequest(), processRebind(), processRenew(), processRequest(), and processSolicit().
|
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.
| query | client's message (typically SOLICIT or REQUEST) |
| answer | server's response to the client's message. This message should contain Client FQDN option being sent by the server to the client (if the client sent this option to the server). |
| ctx | client context (contains subnet, duid and other parameters) |
| ia | pointer to client's IA_NA option (client's request) |
Definition at line 1707 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_CLIENT_FQDN, D6O_IA_NA, D6O_IAADDR, isc::dhcp::DBG_DHCP6_DETAIL, isc::dhcp::DBG_DHCP6_DETAIL_DATA, isc::dhcp::AllocEngine::ClientContext6::fake_allocation_, isc::dhcp::AllocEngine::ClientContext6::fwd_dns_update_, isc::dhcp::CfgMgr::getD2ClientMgr(), isc::dhcp::D2ClientMgr::getUpdateDirections(), isc::dhcp::AllocEngine::ClientContext6::IAContext::iaid_, isc::dhcp::CfgMgr::instance(), isc::asiolink::IOAddress::IPV6_ZERO_ADDRESS(), isc::dhcp::lease6_logger, LOG_DEBUG, LOG_INFO, isc::dhcp::AllocEngine::ClientContext6::rev_dns_update_, STATUS_NoAddrsAvail, isc::dhcp::AllocEngine::ClientContext6::subnet_, isc::asiolink::IOAddress::toText(), isc::dhcp::AllocEngine::ClientContext6::IAContext::type_, and isc::dhcp::Lease::TYPE_NA.
Referenced by assignLeases().
Here is the call graph for this function:
|
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.
| query | client's message (typically SOLICIT or REQUEST) |
| answer | server's response to the client's message (unused). |
| ctx | client context (contains subnet, duid and other parameters) |
| ia | pointer to client's IA_PD option (client's request) |
Definition at line 1828 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::AllocEngine::ClientContext6::fake_allocation_, isc::dhcp::Pool6::getPrefixExcludeOption(), isc::dhcp::AllocEngine::ClientContext6::IAContext::iaid_, isc::asiolink::IOAddress::IPV6_ZERO_ADDRESS(), isc::dhcp::lease6_logger, LOG_DEBUG, LOG_INFO, STATUS_NoPrefixAvail, isc::dhcp::AllocEngine::ClientContext6::subnet_, isc::asiolink::IOAddress::toText(), isc::dhcp::AllocEngine::ClientContext6::IAContext::type_, and isc::dhcp::Lease::TYPE_PD.
Referenced by assignLeases().
Here is the call graph for this function:
|
protected |
Assigns leases.
It supports non-temporary addresses (IA_NA) and prefixes (IA_PD). It does NOT support temporary addresses (IA_TA).
| question | client's message (with requested IA options) |
| answer | server'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). |
| ctx | client context (contains subnet, duid and other parameters) |
Definition at line 1439 of file dhcp6_srv.cc.
References assignIA_NA(), assignIA_PD(), D6O_IA_NA, D6O_IA_PD, isc::dhcp::DBG_DHCP6_BASIC_DATA, LOG_DEBUG, isc::dhcp::packet6_logger, and isc::dhcp::AllocEngine::ClientContext6::subnet_.
Referenced by processRequest(), and processSolicit().
Here is the call graph for this function:
|
protected |
Build the configured option list.
CfgOption objects used to append options to the response.| question | client's message |
| ctx | client context (for the subnet) |
| co_list | configured option list to build |
Definition at line 1051 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(), isc::dhcp::DBG_DHCP6_BASIC, isc::dhcp::dhcp6_logger, isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::CfgMgr::instance(), isc::dhcp::isClientClassBuiltIn(), LOG_DEBUG, isc::dhcp::AllocEngine::ClientContext6::subnet_, isc::dhcp::Lease::TYPE_NA, and isc::dhcp::Lease::TYPE_PD.
Referenced by processConfirm(), processDecline(), processInfRequest(), processRebind(), processRenew(), processRequest(), and processSolicit().
Here is the call graph for this function:
|
static |
Used for DHCPv4-over-DHCPv6 too.
Check if the last relay added a relay-source-port option.
| query | DHCPv6 message to be checked. |
Definition at line 3715 of file dhcp6_srv.cc.
References D6O_RELAY_SOURCE_PORT.
Referenced by isc::dhcp::Dhcp6to4Ipc::handler().
| void isc::dhcp::Dhcpv6Srv::classifyByVendor | ( | const Pkt6Ptr & | pkt, |
| std::string & | classes | ||
| ) |
Assign class using vendor-class-identifier option.
| pkt | packet to be classified |
| classes | a reference to added class names for logging |
Definition at line 3312 of file dhcp6_srv.cc.
References D6O_VENDOR_CLASS, isc::dhcp::DOCSIS3_CLASS_EROUTER, isc::dhcp::DOCSIS3_CLASS_MODEM, and VENDOR_CLASS_PREFIX.
Referenced by classifyPacket().
|
protected |
Assigns incoming packet to zero or more classes.
| pkt | packet to be classified |
Definition at line 3334 of file dhcp6_srv.cc.
References classifyByVendor(), and evaluateClasses().
Referenced by processPacket().
Here is the call graph for this function:
|
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.
| question | client's message (options will be copied from here) |
| answer | server's message (options will be copied here) |
Definition at line 1028 of file dhcp6_srv.cc.
References D6O_CLIENTID.
Referenced by processConfirm(), processDecline(), processInfRequest(), processRebind(), processRelease(), processRenew(), processRequest(), and processSolicit().
|
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. Requests created by this function are only for adding or updating DNS records. If DNS updates are disabled, this method returns immediately.
| answer | A message begins sent to the Client. If it holds the |
| ctx | client context (contains subnet, duid and other parameters) Client FQDN option, this option is used to create NameChangeRequests. |
Definition at line 1572 of file dhcp6_srv.cc.
References isc::dhcp::AllocEngine::ClientContext6::IAContext::changed_leases_, isc::dhcp_ddns::CHG_ADD, 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::CfgMgr::getD2ClientMgr(), isc::util::OutputBuffer::getData(), isc::util::OutputBuffer::getLength(), isc::dhcp::D2ClientMgr::getUpdateDirections(), isc::dhcp::CfgMgr::instance(), isc_throw, LOG_DEBUG, and isc::dhcp::D2ClientMgr::sendRequest().
Referenced by processRebind(), processRenew(), processRequest(), and processSolicit().
Here is the call graph for this function:
|
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.
| result | Result code of the send operation. |
| ncr | NameChangeRequest which failed to send. |
Definition at line 3639 of file dhcp6_srv.cc.
References isc::dhcp::ddns6_logger, 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:
|
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.
| decline | client's Decline message |
| duid | client's duid (used to verify if the client owns the lease) |
| general_status | [out] status in top-level message (may be updated) |
| ia | specific IA_NA option to process. |
| new_leases | a collection of leases being declined. |
Definition at line 3042 of file dhcp6_srv.cc.
References D6O_IA_NA, D6O_IAADDR, isc::dhcp::DBG_DHCP6_DETAIL, declineLease(), 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:
|
protected |
Declines specific IPv6 lease.
This method performs the actual decline and all necessary operations:
| decline | used for generating removal Name Change Request. |
| lease | lease to be declined |
| ia_rsp | response IA_NA. |
Definition at line 3176 of file dhcp6_srv.cc.
References isc::dhcp_ddns::CHG_REMOVE, isc::dhcp::DBG_DHCP6_DETAIL, isc::dhcp::getCalloutHandle(), Hooks, isc::hooks::hooks_logger, isc::dhcp::CfgMgr::instance(), isc::dhcp::LeaseMgrFactory::instance(), isc::dhcp::lease6_logger, LOG_DEBUG, LOG_INFO, isc::dhcp::queueNCR(), STATUS_Success, and isc::dhcp::LeaseMgr::updateLease6().
Referenced by declineIA().
Here is the call graph for this function:
|
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.
| decline | Decline message sent by a client |
| reply | Server's response (IA_NA with status will be added here) |
| ctx | context |
Definition at line 2999 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:| void isc::dhcp::Dhcpv6Srv::discardPackets | ( | ) |
Discards cached and parked packets Clears the call_handle store and packet parking lots of all packets.
Called during reconfigure and shutdown.
Definition at line 3827 of file dhcp6_srv.cc.
References isc::dhcp::getCalloutHandle().
Referenced by isc::dhcp::configureDhcp6Server(), and ~Dhcpv6Srv().
Here is the call graph for this function:
|
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
| opt | option that contains DUID |
Definition at line 1008 of file dhcp6_srv.cc.
Referenced by testServerID().
|
protected |
Evaluate classes.
Evaluate expressions of client classes: if it returns true the class is added to the incoming packet.
| pkt | packet to be classified. |
| depend_on_known | if false classes depending on the KNOWN or UNKNOWN classes are skipped, if true only these classes are evaluated. |
Definition at line 3346 of file dhcp6_srv.cc.
References isc::dhcp::DBG_DHCP6_DETAIL, isc::dhcp::dhcp6_logger, isc::dhcp::evaluateBool(), isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::CfgMgr::instance(), LOG_DEBUG, LOG_ERROR, LOG_INFO, and isc::Exception::what().
Referenced by classifyPacket(), and initContext().
Here is the call graph for this function:
|
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.
| query | client's message (Renew or Rebind) |
| answer | server's response to the client's message. This message should contain Client FQDN option being sent by the server to the client (if the client sent this option to the server). |
| ctx | client context (contains subnet, duid and other parameters) |
| ia | IA_NA option which carries address for which lease lifetime will be extended. |
Definition at line 1942 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_CLIENT_FQDN, D6O_IA_NA, D6O_IAADDR, isc::dhcp::DBG_DHCP6_DETAIL, isc::dhcp::ddns6_logger, isc::util::equalValues(), isc::dhcp::AllocEngine::ClientContext6::fwd_dns_update_, isc::dhcp::CfgMgr::getD2ClientMgr(), isc::dhcp::D2ClientMgr::getUpdateDirections(), 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::CfgMgr::instance(), isc::dhcp::lease6_logger, LOG_DEBUG, LOG_INFO, isc::dhcp::AllocEngine::ClientContext6::IAContext::old_leases_, isc::dhcp::queueNCR(), isc::dhcp::AllocEngine::ClientContext6::rev_dns_update_, 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:
|
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".
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.
| query | client's message |
| ctx | client context (contains subnet, duid and other parameters) |
| ia | IA_PD option that is being renewed |
| DHCPv6DiscardMessageError | when the message being processed should be discarded by the server, i.e. there is no binding for the client doing Rebind. |
For the leases that we just retired, send the prefixes with 0 lifetimes.
Definition at line 2100 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, 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, LOG_DEBUG, LOG_INFO, isc::dhcp::AllocEngine::ClientContext6::IAContext::old_leases_, 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:
|
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.
| query | client's Renew or Rebind message |
| reply | server's response |
| ctx | client context (contains subnet, duid and other parameters) |
Definition at line 2283 of file dhcp6_srv.cc.
References D6O_IA_NA, D6O_IA_PD, extendIA_NA(), and extendIA_PD().
Referenced by processRebind(), and processRenew().
Here is the call graph for this function:
|
static |
Returns the index of the buffer6_send hook.
Definition at line 3810 of file dhcp6_srv.cc.
References Hooks.
|
inline |
Returns pointer to the IO service used by the server.
Definition at line 90 of file dhcp6_srv.h.
Referenced by isc::dhcp::ControlledDhcpv6Srv::ControlledDhcpv6Srv(), isc::dhcp::ControlledDhcpv6Srv::processConfig(), and run().
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.
| pkt | will try to exact MAC address from this packet |
Definition at line 1692 of file dhcp6_srv.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), and isc::dhcp::CfgMgr::instance().
Referenced by initContext().
Here is the call graph for this function:
|
inline |
Returns pointer to the network state used by the server.
Definition at line 95 of file dhcp6_srv.h.
References network_state_.
Referenced by isc::dhcp::ControlledDhcpv6Srv::processConfig().
|
inline |
Get UDP port on which server should listen.
Typically, server listens on UDP port 547. Other ports are only used for testing purposes.
Definition at line 141 of file dhcp6_srv.h.
Referenced by isc::dhcp::ControlledDhcpv6Srv::processConfig().
|
inline |
Returns server-identifier option.
Definition at line 106 of file dhcp6_srv.h.
References serverid_.
Referenced by appendDefaultOptions(), and testServerID().
|
static |
returns Kea version on stdout and exit.
redeclaration/redefinition. isc::process::Daemon::getVersion()
Definition at line 3654 of file dhcp6_srv.cc.
References isc::dhcp::PgSqlLeaseMgr::getDBVersion(), isc::dhcp::MySqlLeaseMgr::getDBVersion(), isc::dhcp::CqlLeaseMgr::getDBVersion(), and isc::dhcp::Memfile_LeaseMgr::getDBVersion().
Here is the call graph for this function:
|
protected |
Initializes client context for specified packet.
This method:
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.
| pkt | pointer to a packet for which context will be created. | |
| [out] | ctx | reference to context object to be initialized. |
| [out] | drop | if it is true the packet will be dropped. |
Definition at line 303 of file dhcp6_srv.cc.
References isc::dhcp::AllocEngine::ClientContext6::addHostIdentifier(), alloc_engine_, isc::dhcp::AllocEngine::ClientContext6::callout_handle_, isc::dhcp::DBG_DHCP6_BASIC, isc::log::DBGLVL_TRACE_BASIC, isc::dhcp::dhcp6_logger, isc::dhcp::AllocEngine::ClientContext6::duid_, evaluateClasses(), isc::dhcp::AllocEngine::ClientContext6::fwd_dns_update_, isc::dhcp::getCalloutHandle(), isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::Host::getIdentifierAsText(), getMAC(), Hooks, isc::dhcp::AllocEngine::ClientContext6::hostname_, isc::dhcp::AllocEngine::ClientContext6::hosts_, 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, isc::dhcp::AllocEngine::ClientContext6::query_, isc::dhcp::AllocEngine::ClientContext6::rev_dns_update_, selectSubnet(), and isc::dhcp::AllocEngine::ClientContext6::subnet_.
Referenced by processPacket().
Here is the call graph for this function:
|
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.
All the logic required to form appropriate answer to the client is held in this function.
| question | Client's message. |
| answer | Server's response to a client. If server generated Client FQDN option for the client, this option is stored in this object. |
| ctx | client context (includes subnet, client-id, hw-addr etc.) |
Definition at line 1499 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::dhcp::ddns6_logger, isc::dhcp::D2ClientMgr::ddnsEnabled(), isc::dhcp::Option6ClientFqdn::FLAG_S, isc::dhcp::Option6ClientFqdn::FULL, isc::dhcp::D2ClientMgr::getD2ClientConfig(), isc::dhcp::CfgMgr::getD2ClientMgr(), 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, and isc::dhcp::Option6ClientFqdn::setDomainName().
Referenced by processRebind(), processRenew(), processRequest(), and processSolicit().
Here is the call graph for this function:
|
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:
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.
| ctx | Reference to client context |
Definition at line 2853 of file dhcp6_srv.cc.
References appendDefaultOptions(), appendRequestedOptions(), appendRequestedVendorOptions(), buildCfgOptionList(), copyClientOptions(), D6O_IA_NA, D6O_IAADDR, DHCPV6_REPLY, isc::dhcp::Option6IAAddr::getAddress(), isc::dhcp::Option::getOptions(), isc_throw, isc::dhcp::AllocEngine::ClientContext6::query_, requiredClassify(), setReservedClientClasses(), STATUS_NotOnLink, STATUS_Success, and isc::dhcp::AllocEngine::ClientContext6::subnet_.
Referenced by processPacket().
Here is the call graph for this function:
|
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.
| ctx | Reference to client context |
Definition at line 2969 of file dhcp6_srv.cc.
References appendDefaultOptions(), buildCfgOptionList(), copyClientOptions(), declineLeases(), DHCPV6_REPLY, isc::dhcp::AllocEngine::ClientContext6::query_, requiredClassify(), and setReservedClientClasses().
Referenced by processPacket().
Here is the call graph for this function:
|
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.
| dhcp4_query | message received from client Does not throw |
Definition at line 3290 of file dhcp6_srv.cc.
References D6O_DHCPV4_MSG, isc::dhcp::Dhcp6to4Ipc::instance(), and isc::dhcp::Dhcp4o6IpcBase::send().
Referenced by processPacket().
Here is the call graph for this function:
|
protected |
Processes incoming Information-request message.
| ctx | Reference to client context |
Definition at line 3259 of file dhcp6_srv.cc.
References appendDefaultOptions(), appendRequestedOptions(), appendRequestedVendorOptions(), buildCfgOptionList(), copyClientOptions(), DHCPV6_REPLY, isc::dhcp::AllocEngine::ClientContext6::query_, requiredClassify(), and setReservedClientClasses().
Referenced by processPacket().
Here is the call graph for this function:Process a single incoming DHCPv6 packet.
It verifies correctness of the passed packet, call per-type processXXX methods, generates appropriate answer.
| query | A pointer to the packet to be processed. |
| rsp | A pointer to the response |
Definition at line 519 of file dhcp6_srv.cc.
References isc::dhcp::bad_packet6_logger, classifyPacket(), isc::dhcp::DBG_DHCP6_BASIC, isc::dhcp::DBG_DHCP6_BASIC_DATA, isc::dhcp::DBG_DHCP6_DETAIL, isc::dhcp::DBG_DHCP6_DETAIL_DATA, isc::dhcp::DBG_DHCP6_HOOKS, DHCPV6_CONFIRM, DHCPV6_DECLINE, DHCPV6_DHCPV4_QUERY, DHCPV6_INFORMATION_REQUEST, DHCPV6_REBIND, DHCPV6_RELEASE, DHCPV6_RENEW, DHCPV6_REQUEST, DHCPV6_SOLICIT, isc::dhcp::getCalloutHandle(), Hooks, isc::hooks::hooks_logger, initContext(), LOG_DEBUG, isc::dhcp::options6_logger, isc::dhcp::packet6_logger, processConfirm(), processDecline(), processDhcp4Query(), processInfRequest(), processRebind(), processRelease(), processRenew(), processRequest(), processRSOO(), processSolicit(), sanityCheck(), testServerID(), testUnicast(), and isc::Exception::what().
Referenced by run_one().
Here is the call graph for this function:| void isc::dhcp::Dhcpv6Srv::processPacketBufferSend | ( | hooks::CalloutHandlePtr & | callout_handle, |
| Pkt6Ptr & | rsp | ||
| ) |
Executes buffer6_send callout and sends the response.
| callout_handle | pointer to the callout handle. |
| rsp | pointer to a response. |
Definition at line 951 of file dhcp6_srv.cc.
References isc::dhcp::DBG_DHCP6_DETAIL_DATA, isc::dhcp::DBG_DHCP6_HOOKS, Hooks, isc::hooks::hooks_logger, LOG_DEBUG, LOG_ERROR, isc::dhcp::packet6_logger, processStatsSent(), and sendPacket().
Referenced by run_one().
Here is the call graph for this function:
|
protected |
Executes pkt6_send callout.
| callout_handle | pointer to the callout handle. |
| query | Pointer to a query. |
| rsp | Pointer to a response. |
Callouts decided to drop the packet.
Definition at line 886 of file dhcp6_srv.cc.
References isc::dhcp::DBG_DHCP6_HOOKS, Hooks, isc::hooks::hooks_logger, LOG_DEBUG, LOG_ERROR, and isc::dhcp::options6_logger.
|
protected |
Processes incoming Rebind message.
| ctx | Reference to client context |
Definition at line 2827 of file dhcp6_srv.cc.
References appendDefaultOptions(), appendRequestedOptions(), appendRequestedVendorOptions(), buildCfgOptionList(), copyClientOptions(), createNameChangeRequests(), DHCPV6_REPLY, extendLeases(), processClientFqdn(), isc::dhcp::AllocEngine::ClientContext6::query_, requiredClassify(), and setReservedClientClasses().
Referenced by processPacket().
Here is the call graph for this function:
|
protected |
Process incoming Release message.
| ctx | Reference to client context |
Definition at line 2943 of file dhcp6_srv.cc.
References appendDefaultOptions(), copyClientOptions(), DHCPV6_REPLY, isc::dhcp::AllocEngine::ClientContext6::query_, releaseLeases(), requiredClassify(), and setReservedClientClasses().
Referenced by processPacket().
Here is the call graph for this function:
|
protected |
Processes incoming Renew message.
| ctx | Reference to client context |
Definition at line 2801 of file dhcp6_srv.cc.
References appendDefaultOptions(), appendRequestedOptions(), appendRequestedVendorOptions(), buildCfgOptionList(), copyClientOptions(), createNameChangeRequests(), DHCPV6_REPLY, extendLeases(), processClientFqdn(), isc::dhcp::AllocEngine::ClientContext6::query_, requiredClassify(), and setReservedClientClasses().
Referenced by processPacket().
Here is the call graph for this function:
|
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.
| ctx | Reference to client context |
Definition at line 2775 of file dhcp6_srv.cc.
References appendDefaultOptions(), appendRequestedOptions(), appendRequestedVendorOptions(), assignLeases(), buildCfgOptionList(), copyClientOptions(), createNameChangeRequests(), DHCPV6_REPLY, processClientFqdn(), isc::dhcp::AllocEngine::ClientContext6::query_, requiredClassify(), and setReservedClientClasses().
Referenced by processPacket().
Here is the call graph for this function: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:
Definition at line 3681 of file dhcp6_srv.cc.
References D6O_RSOO, isc::dhcp::CfgMgr::getCurrentCfg(), and isc::dhcp::CfgMgr::instance().
Referenced by processPacket().
Here is the call graph for this function:
|
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.
| ctx | Reference to client context |
Definition at line 2717 of file dhcp6_srv.cc.
References appendDefaultOptions(), appendRequestedOptions(), appendRequestedVendorOptions(), assignLeases(), buildCfgOptionList(), copyClientOptions(), createNameChangeRequests(), D6O_RAPID_COMMIT, isc::dhcp::DBG_DHCP6_DETAIL, DHCPV6_ADVERTISE, DHCPV6_REPLY, isc::dhcp::AllocEngine::ClientContext6::fake_allocation_, LOG_DEBUG, isc::dhcp::options6_logger, processClientFqdn(), isc::dhcp::AllocEngine::ClientContext6::query_, requiredClassify(), setReservedClientClasses(), and isc::dhcp::AllocEngine::ClientContext6::subnet_.
Referenced by processPacket().
Here is the call graph for this function:
|
static |
Updates statistics for transmitted packets.
| response | packet transmitted |
Definition at line 3786 of file dhcp6_srv.cc.
References DHCPV6_ADVERTISE, DHCPV6_DHCPV4_RESPONSE, and DHCPV6_REPLY.
Referenced by processPacketBufferSend().
|
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 250 of file dhcp6_srv.cc.
References isc::dhcp::IfaceMgr::instance().
Referenced by run_one().
Here is the call graph for this function:
|
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.
| duid | client's duid |
| query | client's message |
| general_status | a global status (it may be updated in case of errors) |
| ia | IA_NA option that is being released |
| old_lease | a pointer to the lease being released |
Definition at line 2383 of file dhcp6_srv.cc.
References 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::getCalloutHandle(), isc::dhcp::LeaseMgr::getLease6(), Hooks, 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:
|
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.
| duid | client's duid |
| query | client's message |
| general_status | a global status (it may be updated in case of errors) |
| ia | IA_PD option that is being released |
| old_lease | a pointer to the lease being released |
Definition at line 2556 of file dhcp6_srv.cc.
References D6O_IA_PD, D6O_IAPREFIX, isc::dhcp::DBG_DHCP6_HOOKS, isc::dhcp::LeaseMgr::deleteLease(), isc::dhcp::getCalloutHandle(), isc::dhcp::LeaseMgr::getLease6(), Hooks, 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:
|
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.
| release | client's message asking to release |
| reply | server's response |
| ctx | client context (includes subnet, client-id, hw-addr etc.) |
Definition at line 2324 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:
|
protected |
Assigns incoming packet to zero or more classes (required pass).
| pkt | packet to be classified |
| ctx | allocation context where to get informations |
Definition at line 3414 of file dhcp6_srv.cc.
References isc::dhcp::AllocEngine::ClientContext6::allocated_resources_, isc::dhcp::ClientClasses::cbegin(), isc::dhcp::ClientClasses::cend(), isc::dhcp::DBG_DHCP6_BASIC, isc::dhcp::DBG_DHCP6_DETAIL, isc::dhcp::dhcp6_logger, isc::dhcp::evaluateBool(), isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::ClientClasses::insert(), isc::dhcp::CfgMgr::instance(), LOG_DEBUG, LOG_ERROR, LOG_INFO, isc::dhcp::AllocEngine::ClientContext6::subnet_, isc::dhcp::Lease::TYPE_NA, isc::dhcp::Lease::TYPE_PD, and isc::Exception::what().
Referenced by processConfirm(), processDecline(), processInfRequest(), processRebind(), processRelease(), processRenew(), processRequest(), and processSolicit().
Here is the call graph for this function:| bool isc::dhcp::Dhcpv6Srv::run | ( | ) |
Main server processing loop.
Main server processing loop. Call the processing step routine until shut down.
Definition at line 404 of file dhcp6_srv.cc.
References getIOService(), LOG_ERROR, isc::dhcp::packet6_logger, run_one(), and shutdown_.
Here is the call graph for this function:| void isc::dhcp::Dhcpv6Srv::run_one | ( | ) |
Main server processing step.
Main server processing step. Receives one incoming packet, calls the processing packet routing and (if necessary) transmits a response.
Definition at line 424 of file dhcp6_srv.cc.
References isc::dhcp::bad_packet6_logger, isc::dhcp::DBG_DHCP6_BASIC, isc::dhcp::DBG_DHCP6_DETAIL, isc::dhcp::DBG_DHCP6_DETAIL_DATA, isc::dhcp::dhcp6_logger, isc::dhcp::getCalloutHandle(), isc::process::Daemon::handleSignal(), LOG_DEBUG, LOG_ERROR, network_state_, isc::dhcp::packet6_logger, processPacket(), processPacketBufferSend(), receivePacket(), and isc::process::Daemon::signal_set_.
Referenced by run().
Here is the call graph for this function:
|
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.
| pkt | packet to be checked |
Definition at line 1249 of file dhcp6_srv.cc.
References isc::dhcp::bad_packet6_logger, isc::dhcp::DBG_DHCP6_BASIC, 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:
|
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.
| pkt | packet to be checked |
| clientid | expectation regarding client-id option |
| serverid | expectation regarding server-id option |
| RFCViolation | if any issues are detected |
Definition at line 1291 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:
|
protected |
verifies if received DUID option (client-id or server-id) is sane
| opt | option to be checked |
| opt_name | text name to be printed |
| RFCViolation | if any issues are detected |
Definition at line 1348 of file dhcp6_srv.cc.
References isc_throw.
Referenced by sanityCheck().
|
protected |
Selects a subnet for a given client's packet.
| question | client's message |
| drop | if it is true the packet will be dropped |
Definition at line 1363 of file dhcp6_srv.cc.
References isc::dhcp::DBG_DHCP6_BASIC_DATA, isc::dhcp::DBG_DHCP6_DETAIL, isc::dhcp::DBG_DHCP6_DETAIL_DATA, isc::dhcp::DBG_DHCP6_HOOKS, isc::dhcp::getCalloutHandle(), isc::dhcp::CfgMgr::getCurrentCfg(), Hooks, isc::hooks::hooks_logger, isc::dhcp::CfgSubnets6::initSelector(), isc::dhcp::CfgMgr::instance(), LOG_DEBUG, and isc::dhcp::packet6_logger.
Referenced by initContext().
Here is the call graph for this function:
|
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 254 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:
|
protected |
Assigns classes retrieved from host reservation database.
| pkt | Pointer to the packet to which classes will be assigned. |
| ctx | Reference to the client context. |
Definition at line 3395 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_logger, isc::dhcp::ClientClasses::empty(), LOG_DEBUG, and isc::dhcp::ClientClasses::toText().
Referenced by processConfirm(), processDecline(), processInfRequest(), processRebind(), processRelease(), processRenew(), processRequest(), and processSolicit().
Here is the call graph for this function:
|
protected |
A simple utility method that sets the status code.
Removes old status code and sets a new one.
| container | status code will be added here |
| status | status code option |
Definition at line 3167 of file dhcp6_srv.cc.
References D6O_STATUS_CODE.
Referenced by declineIA().
|
virtual |
Instructs the server to shut down.
Reimplemented from isc::process::Daemon.
Definition at line 245 of file dhcp6_srv.cc.
References isc::dhcp::DBG_DHCP6_BASIC, isc::dhcp::dhcp6_logger, LOG_DEBUG, and shutdown_.
Referenced by isc::dhcp::ControlledDhcpv6Srv::shutdown().
| 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 3618 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:| 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 3630 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:
|
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.
| pkt | DHCPv6 packet carrying server identifier to be checked. |
Definition at line 259 of file dhcp6_srv.cc.
References isc::dhcp::bad_packet6_logger, D6O_SERVERID, isc::dhcp::DBG_DHCP6_DETAIL_DATA, duidToString(), getServerID(), and LOG_DEBUG.
Referenced by processPacket().
Here is the call graph for this function:
|
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.
| pkt | DHCPv6 message to be checked. |
Definition at line 282 of file dhcp6_srv.cc.
References isc::dhcp::bad_packet6_logger, isc::dhcp::DBG_DHCP6_DETAIL, DHCPV6_CONFIRM, DHCPV6_INFORMATION_REQUEST, DHCPV6_REBIND, DHCPV6_SOLICIT, and LOG_DEBUG.
Referenced by processPacket().
|
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 985 of file dhcp6_srv.h.
Referenced by assignIA_NA(), assignIA_PD(), Dhcpv6Srv(), extendIA_NA(), extendIA_PD(), and initContext().
|
static |
Minimum length of a MAC address to be used in DUID generation.
Definition at line 74 of file dhcp6_srv.h.
|
protected |
Holds a list of isc::dhcp_ddns::NameChangeRequest objects, which are waiting for sending to kea-dhcp-ddns module.
Definition at line 989 of file dhcp6_srv.h.
|
protected |
Holds information about disabled DHCP service and/or disabled subnet/network scopes.
Definition at line 993 of file dhcp6_srv.h.
Referenced by getNetworkState(), and run_one().
|
protected |
Server DUID (to be sent in server-identifier option)
Definition at line 967 of file dhcp6_srv.h.
Referenced by Dhcpv6Srv(), and getServerID().
|
protected |
Indicates if shutdown is in progress.
Setting it to true will initiate server shutdown procedure.
Definition at line 971 of file dhcp6_srv.h.
Referenced by Dhcpv6Srv(), run(), and shutdown().
|
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 788 of file dhcp6_srv.h.
Referenced by classifyByVendor().