Kea 3.2.0-git
isc::dhcp::ControlledDhcpv6Srv Class Reference

Controlled version of the DHCPv6 server. More...

#include <ctrl_dhcp6_srv.h>

Inheritance diagram for isc::dhcp::ControlledDhcpv6Srv:

Public Member Functions

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

Static Public Member Functions

static isc::data::ConstElementPtr checkConfig (isc::data::ConstElementPtr config)
 Configuration checker.
static isc::data::ConstElementPtr finishConfigHookLibraries (isc::data::ConstElementPtr config)
 Configuration checker for hook libraries.
static ControlledDhcpv6SrvgetInstance ()
 Returns pointer to the sole instance of Dhcpv6Srv.
static isc::data::ConstElementPtr processConfig (isc::data::ConstElementPtr config)
 Configuration processor.
Static Public Member Functions inherited from isc::dhcp::Dhcpv6Srv
static std::string getVersion (bool extended)
 returns Kea version on stdout and exit.
static void setHostIdentifiers (AllocEngine::ClientContext6 &ctx)
 Set host identifiers within a context.
static uint16_t checkRelaySourcePort (const Pkt6Ptr &query)
 Used for DHCPv4-over-DHCPv6 too.
static void processStatsSent (const Pkt6Ptr &response)
 Updates statistics for transmitted packets.
static int getHookIndexBuffer6Send ()
 Returns the index of the buffer6_send hook.
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.
static std::string getDefaultLoggerName ()
 Returns default logger name.
static std::string getProcName ()
 returns the process name This value is used as when forming the default PID file name
static bool getVerbose ()
 Returns if running in verbose mode.
static std::string getVersion (bool extended)
 returns Kea version on stdout and exits.
static void loggerInit (const char *log_name, bool verbose)
 Initializes logger.
static void setDefaultLoggerName (const std::string &logger)
 Sets the default logger name.
static void setProcName (const std::string &proc_name)
 Sets the process name.
static void setVerbose (const bool verbose)
 Sets or clears verbose mode.

Protected Member Functions

isc::data::ConstElementPtr commandBuildReportHandler (const std::string &command, isc::data::ConstElementPtr args)
 handler for processing 'build-report' command
isc::data::ConstElementPtr commandConfigBackendPullHandler (const std::string &command, isc::data::ConstElementPtr args)
 handler for config-backend-pull command
isc::data::ConstElementPtr commandConfigGetHandler (const std::string &command, isc::data::ConstElementPtr args)
 handler for processing 'config-get' command
isc::data::ConstElementPtr commandConfigHashGetHandler (const std::string &command, isc::data::ConstElementPtr args)
 handler for processing 'config-hash-get' command
isc::data::ConstElementPtr commandConfigReloadHandler (const std::string &command, isc::data::ConstElementPtr args)
 Handler for processing 'config-reload' command.
isc::data::ConstElementPtr commandConfigSetHandler (const std::string &command, isc::data::ConstElementPtr args)
 handler for processing 'config-set' command
isc::data::ConstElementPtr commandConfigTestHandler (const std::string &command, isc::data::ConstElementPtr args)
 handler for processing 'config-test' command
isc::data::ConstElementPtr commandConfigWriteHandler (const std::string &command, isc::data::ConstElementPtr args)
 handler for processing 'config-write' command
isc::data::ConstElementPtr commandDhcpDisableHandler (const std::string &command, isc::data::ConstElementPtr args)
 A handler for processing 'dhcp-disable' command.
isc::data::ConstElementPtr commandDhcpEnableHandler (const std::string &command, isc::data::ConstElementPtr args)
 A handler for processing 'dhcp-enable' command.
isc::data::ConstElementPtr commandInterfaceAddHandler (const std::string &command, isc::data::ConstElementPtr args)
 Handler for processing 'interface-add' command.
isc::data::ConstElementPtr commandInterfaceListHandler (const std::string &command, isc::data::ConstElementPtr args)
 Handler for processing 'interface-list' command.
isc::data::ConstElementPtr commandInterfaceRedetectHandler (const std::string &command, isc::data::ConstElementPtr args)
 Handler for processing 'interface-redetect' command.
isc::data::ConstElementPtr commandLeasesReclaimHandler (const std::string &command, isc::data::ConstElementPtr args)
 Handler for processing 'leases-reclaim' command.
isc::data::ConstElementPtr commandLfcStartHandler (const std::string &command, isc::data::ConstElementPtr args)
 handler for processing 'kea-lfc-start' command
isc::data::ConstElementPtr commandServerTagGetHandler (const std::string &command, isc::data::ConstElementPtr args)
 handler for server-tag-get command
isc::data::ConstElementPtr commandShutdownHandler (const std::string &command, isc::data::ConstElementPtr args)
 Handler for processing 'shutdown' command.
isc::data::ConstElementPtr commandStatisticSetMaxSampleAgeAllHandler (const std::string &command, isc::data::ConstElementPtr args)
 handler for processing 'statistic-sample-age-set-all' command
isc::data::ConstElementPtr commandStatisticSetMaxSampleCountAllHandler (const std::string &command, isc::data::ConstElementPtr args)
 handler for processing 'statistic-sample-count-set-all' command
isc::data::ConstElementPtr commandStatusGetHandler (const std::string &command, isc::data::ConstElementPtr args)
 handler for processing 'status-get' command
isc::data::ConstElementPtr commandSubnet6SelectTestHandler (const std::string &command, isc::data::ConstElementPtr args)
 Handler for processing 'subnet6-select-test' command.
isc::data::ConstElementPtr commandVersionGetHandler (const std::string &command, isc::data::ConstElementPtr args)
 @Brief handler for processing 'version-get' command
void setPacketStatisticsDefaults ()
 This function sets statistics related to DHCPv6 packets processing to their initial values.
bool testServerID (const Pkt6Ptr &pkt)
 Compare received server id with our server id.
bool testUnicast (const Pkt6Ptr &pkt) const
 Check if the message can be sent to unicast.
bool sanityCheck (const Pkt6Ptr &pkt)
 Verifies if specified packet meets RFC requirements.
void sanityCheck (const Pkt6Ptr &pkt, RequirementLevel clientid, RequirementLevel serverid)
 verifies if specified packet meets RFC requirements
void sanityCheckDUID (const OptionPtr &opt, const std::string &opt_name)
 verifies if received DUID option (client-id or server-id) is sane
Pkt6Ptr processSolicit (AllocEngine::ClientContext6 &ctx)
 Processes incoming Solicit and returns response.
Pkt6Ptr processRequest (AllocEngine::ClientContext6 &ctx)
 Processes incoming Request and returns Reply response.
Pkt6Ptr processRenew (AllocEngine::ClientContext6 &ctx)
 Processes incoming Renew message.
Pkt6Ptr processRebind (AllocEngine::ClientContext6 &ctx)
 Processes incoming Rebind message.
Pkt6Ptr processConfirm (AllocEngine::ClientContext6 &ctx)
 Processes incoming Confirm message and returns Reply.
Pkt6Ptr processRelease (AllocEngine::ClientContext6 &ctx)
 Process incoming Release message.
Pkt6Ptr processDecline (AllocEngine::ClientContext6 &ctx)
 Process incoming Decline message.
Pkt6Ptr processInfRequest (AllocEngine::ClientContext6 &ctx)
 Processes incoming Information-request message.
void processDhcp4Query (const Pkt6Ptr &dhcp4_query)
 Processes incoming DHCPv4-query message.
Pkt6Ptr processAddrRegInform (AllocEngine::ClientContext6 &ctx)
 Processes incoming Addr-reg-inform message.
isc::dhcp::ConstSubnet6Ptr selectSubnet (const Pkt6Ptr &question, bool &drop)
 Selects a subnet for a given client's packet.
OptionPtr assignIA_NA (const isc::dhcp::Pkt6Ptr &query, AllocEngine::ClientContext6 &ctx, Option6IAPtr ia)
 Processes IA_NA option (and assigns addresses if necessary).
OptionPtr assignIA_PD (const Pkt6Ptr &query, AllocEngine::ClientContext6 &ctx, boost::shared_ptr< Option6IA > ia)
 Processes IA_PD option (and assigns prefixes if necessary).
OptionPtr extendIA_NA (const Pkt6Ptr &query, AllocEngine::ClientContext6 &ctx, Option6IAPtr ia)
 Extends lifetime of the specific IA_NA option.
OptionPtr extendIA_PD (const Pkt6Ptr &query, AllocEngine::ClientContext6 &ctx, Option6IAPtr ia)
 Extends lifetime of the prefix.
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.
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.
void reject (const Pkt6Ptr &query, Pkt6Ptr &answer)
 Reject query.
OptionPtr rejectIA_NA (const isc::dhcp::Pkt6Ptr &query, Option6IAPtr ia)
 Reject IA_NA.
OptionPtr rejectIA_PD (const isc::dhcp::Pkt6Ptr &query, Option6IAPtr ia)
 Reject IA_PD.
void copyClientOptions (const Pkt6Ptr &question, Pkt6Ptr &answer)
 Copies required options from client message to server answer.
void buildCfgOptionList (const Pkt6Ptr &question, AllocEngine::ClientContext6 &ctx, CfgOptionList &co_list)
 Build the configured option list.
void appendDefaultOptions (const Pkt6Ptr &question, Pkt6Ptr &answer, const CfgOptionList &co_list)
 Appends default options to server's answer.
void appendRequestedOptions (const Pkt6Ptr &question, Pkt6Ptr &answer, const CfgOptionList &co_list)
 Appends requested options to server's answer.
void appendRequestedVendorOptions (const Pkt6Ptr &question, Pkt6Ptr &answer, AllocEngine::ClientContext6 &ctx, const CfgOptionList &co_list)
 Appends requested vendor options to server's answer.
void assignLeases (const Pkt6Ptr &question, Pkt6Ptr &answer, AllocEngine::ClientContext6 &ctx)
 Assigns leases.
void processClientFqdn (const Pkt6Ptr &question, const Pkt6Ptr &answer, AllocEngine::ClientContext6 &ctx)
 Processes Client FQDN Option.
void createNameChangeRequests (const Pkt6Ptr &answer, AllocEngine::ClientContext6 &ctx)
 Creates a number of isc::dhcp_ddns::NameChangeRequest objects based on the DHCPv6 Client FQDN Option.
void extendLeases (const Pkt6Ptr &query, Pkt6Ptr &reply, AllocEngine::ClientContext6 &ctx)
 Attempts to extend the lifetime of IAs.
void setTeeTimes (uint32_t preferred_lft, const ConstSubnet6Ptr &subnet, Option6IAPtr &resp)
 Sets the T1 and T2 timers in the outbound IA.
void releaseLeases (const Pkt6Ptr &release, Pkt6Ptr &reply, AllocEngine::ClientContext6 &ctx)
 Attempts to release received addresses.
virtual Pkt6Ptr receivePacket (int timeout)
 dummy wrapper around IfaceMgr::receive6
virtual void sendPacket (const Pkt6Ptr &pkt)
 dummy wrapper around IfaceMgr::send()
void classifyPacket (const Pkt6Ptr &pkt)
 Assigns incoming packet to zero or more classes.
void evaluateClasses (const Pkt6Ptr &pkt, bool depend_on_known)
 Evaluate classes.
void setReservedClientClasses (const Pkt6Ptr &pkt, const AllocEngine::ClientContext6 &ctx)
 Assigns classes retrieved from host reservation database.
void conditionallySetReservedClientClasses (const Pkt6Ptr &pkt, const AllocEngine::ClientContext6 &ctx)
 Assigns classes retrieved from host reservation database if they haven't been yet set.
void evaluateAdditionalClasses (const Pkt6Ptr &pkt, AllocEngine::ClientContext6 &ctx)
 Evaluates classes in the additional classes lists.
void processRSOO (const Pkt6Ptr &query, const Pkt6Ptr &rsp)
 Processes Relay-supplied options, if present.
void initContext (AllocEngine::ClientContext6 &ctx, bool &drop)
 Initializes client context for specified packet.
bool declineLeases (const Pkt6Ptr &decline, Pkt6Ptr &reply, AllocEngine::ClientContext6 &ctx)
 Attempts to decline all leases in specified Decline message.
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.
bool declineLease (const Pkt6Ptr &decline, const Lease6Ptr lease, boost::shared_ptr< Option6IA > ia_rsp)
 Declines specific IPv6 lease.
void setStatusCode (boost::shared_ptr< Option6IA > &container, const OptionPtr &status)
 A simple utility method that sets the status code.
void checkPostAssignmentChanges (const Pkt6Ptr &question, Pkt6Ptr &answer, AllocEngine::ClientContext6 &ctx, const ConstSubnet6Ptr orig_subnet)
 Iterates over new leases, update stale DNS entries.
OptionPtr getPDExclude (const AllocEngine::ClientContext6 &ctx, const Lease6Ptr &lease)
 Return the PD exclude option to include.
void processPacketPktSend (hooks::CalloutHandlePtr &callout_handle, Pkt6Ptr &query, Pkt6Ptr &rsp, ConstSubnet6Ptr &subnet)
 Executes pkt6_send callout.
Protected Member Functions inherited from isc::process::Daemon
std::string makePIDFileName () const
 Manufacture the pid file name.

Static Protected Member Functions

static void sessionReader (void)
 Callback that will be called from iface_mgr when data is received over control socket.
static std::string duidToString (const OptionPtr &opt)
 converts DUID to text Converts content of DUID option to a text representation, e.g.
static void removeDependentEvaluatedClasses (const Pkt6Ptr &pkt)
 Removed evaluated client classes.
static HWAddrPtr getMAC (const Pkt6Ptr &pkt)
 Attempts to get a MAC/hardware address using configured sources.

Additional Inherited Members

Public Types inherited from isc::dhcp::Dhcpv6Srv
enum  RequirementLevel { FORBIDDEN , MANDATORY , OPTIONAL }
 defines if certain option may, must or must not appear More...
Static Public Attributes inherited from isc::dhcp::Dhcpv6Srv
static const size_t MIN_MAC_LEN = 6
 Minimum length of a MAC address to be used in DUID generation.
uint16_t server_port_
 UDP port number on which server listens.
uint16_t client_port_
 UDP port number to which server sends all responses.
OptionPtr serverid_
 Server DUID (to be sent in server-identifier option).
volatile bool shutdown_
 Indicates if shutdown is in progress.
boost::shared_ptr< AllocEnginealloc_engine_
 Allocation Engine.
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.
NetworkStatePtr network_state_
 Holds information about disabled DHCP service and/or disabled subnet/network scopes.
CBControlDHCPv6Ptr cb_control_
 Controls access to the configuration backends.
Protected Attributes inherited from isc::process::Daemon
isc::asiolink::IOSignalSetPtr signal_set_
 A pointer to the object installing custom signal handlers.
boost::posix_time::ptime start_
 Timestamp of the start of the daemon.
static const std::string VENDOR_CLASS_PREFIX
 this is a prefix added to the content of vendor-class option

Detailed Description

Controlled version of the DHCPv6 server.

This is a class that is responsible for DHCPv6 server being controllable, by reading configuration file from disk.

Definition at line 26 of file ctrl_dhcp6_srv.h.

Constructor & Destructor Documentation

◆ ControlledDhcpv6Srv()

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

Constructor.

Parameters
server_portUDP port to be opened for DHCP traffic
client_portUDP port where all responses are sent to.

Definition at line 1414 of file ctrl_dhcp6_srv.cc.

References isc::dhcp::Dhcpv6Srv::Dhcpv6Srv(), commandBuildReportHandler(), commandConfigBackendPullHandler(), commandConfigGetHandler(), commandConfigHashGetHandler(), commandConfigReloadHandler(), commandConfigSetHandler(), commandConfigTestHandler(), commandConfigWriteHandler(), commandDhcpDisableHandler(), commandDhcpEnableHandler(), commandInterfaceAddHandler(), commandInterfaceListHandler(), commandInterfaceRedetectHandler(), commandLeasesReclaimHandler(), commandLfcStartHandler(), commandServerTagGetHandler(), commandShutdownHandler(), commandStatisticSetMaxSampleAgeAllHandler(), commandStatisticSetMaxSampleCountAllHandler(), commandStatusGetHandler(), commandSubnet6SelectTestHandler(), commandVersionGetHandler(), isc::config::HttpCommandConfig::DEFAULT_AUTHENTICATION_REALM, isc::config::HttpCommandConfig::DEFAULT_SOCKET_ADDRESS, getInstance(), isc::dhcp::Dhcpv6Srv::getIOService(), isc::config::CommandMgr::instance(), isc::config::HttpCommandMgr::instance(), isc::config::UnixCommandMgr::instance(), isc::dhcp::TimerMgr::instance(), isc_throw, isc::config::BaseCommandMgr::registerCommand(), isc::asiolink::ProcessSpawn::setIOService(), isc::config::HttpCommandMgr::setIOService(), isc::config::UnixCommandMgr::setIOService(), isc::db::DatabaseConnection::setIOService(), isc::stats::StatsMgr::statisticGetAllHandler(), isc::stats::StatsMgr::statisticGetHandler(), isc::stats::StatsMgr::statisticGlobalGetAllHandler(), isc::stats::StatsMgr::statisticRemoveAllHandler(), isc::stats::StatsMgr::statisticRemoveHandler(), isc::stats::StatsMgr::statisticResetAllHandler(), isc::stats::StatsMgr::statisticResetHandler(), isc::stats::StatsMgr::statisticSetMaxSampleAgeHandler(), isc::stats::StatsMgr::statisticSetMaxSampleCountHandler(), and isc::config::HttpCommandConfig::SUPPORTED_SERVICE.

Referenced by checkConfig(), finishConfigHookLibraries(), getInstance(), processConfig(), and sessionReader().

Here is the call graph for this function:

◆ ~ControlledDhcpv6Srv()

Member Function Documentation

◆ checkConfig()

isc::data::ConstElementPtr isc::dhcp::ControlledDhcpv6Srv::checkConfig ( isc::data::ConstElementPtr config)
static

Configuration checker.

This is a method for checking incoming configuration.

Parameters
configJSON representation of the new configuration
Returns
status of the config check

Definition at line 1399 of file ctrl_dhcp6_srv.cc.

References ControlledDhcpv6Srv(), isc::dhcp::configureDhcp6Server(), isc::config::CONTROL_RESULT_ERROR, isc::config::createAnswer(), isc::dhcp::DBG_DHCP6_COMMAND, isc::dhcp::DHCP6_CONFIG_RECEIVED, isc::dhcp::dhcp6_logger, getInstance(), LOG_DEBUG, and isc::process::Daemon::redactConfig().

Referenced by commandConfigTestHandler().

Here is the call graph for this function:

◆ cleanup()

void isc::dhcp::ControlledDhcpv6Srv::cleanup ( )
virtual

Performs cleanup, immediately before termination.

This method performs final clean up, just before the Dhcpv6Srv object is destroyed. Currently it is a no-op.

Reimplemented from isc::process::Daemon.

Definition at line 127 of file ctrl_dhcp6_srv.cc.

References isc::dhcp::Dhcpv6Srv::getIOService(), and isc::process::Daemon::signal_set_.

Referenced by ~ControlledDhcpv6Srv().

Here is the call graph for this function:

◆ commandBuildReportHandler()

ConstElementPtr isc::dhcp::ControlledDhcpv6Srv::commandBuildReportHandler ( const std::string & command,
isc::data::ConstElementPtr args )
protected

handler for processing 'build-report' command

This handler processes build-report command, which returns over the control channel the -W command line argument.

Parameters
command(parameter ignored)
args(parameter ignored)
Returns
status of the command with the config report

Definition at line 855 of file ctrl_dhcp6_srv.cc.

References isc::config::CONTROL_RESULT_SUCCESS, isc::config::createAnswer(), and isc::detail::getConfigReport().

Referenced by ControlledDhcpv6Srv().

Here is the call graph for this function:

◆ commandConfigBackendPullHandler()

ConstElementPtr isc::dhcp::ControlledDhcpv6Srv::commandConfigBackendPullHandler ( const std::string & command,
isc::data::ConstElementPtr args )
protected

handler for config-backend-pull command

This method handles the config-backend-pull command, which updates the server configuration from the Config Backends immediately.

Parameters
command(parameter ignored)
args(ignored)
Returns
status of the command.

Definition at line 1017 of file ctrl_dhcp6_srv.cc.

References isc::config::CONTROL_RESULT_EMPTY, isc::config::CONTROL_RESULT_ERROR, isc::config::CONTROL_RESULT_SUCCESS, isc::config::createAnswer(), isc::config::createAnswer(), isc::dhcp::DHCP6_CB_ON_DEMAND_FETCH_UPDATES_FAIL, isc::dhcp::dhcp6_logger, isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::CfgMgr::instance(), isc::dhcp::IfaceMgr::instance(), isc::dhcp::TimerMgr::instance(), and LOG_ERROR.

Referenced by ControlledDhcpv6Srv().

Here is the call graph for this function:

◆ commandConfigGetHandler()

ConstElementPtr isc::dhcp::ControlledDhcpv6Srv::commandConfigGetHandler ( const std::string & command,
isc::data::ConstElementPtr args )
protected

handler for processing 'config-get' command

This handler processes config-get command, which retrieves the current configuration and returns it in response.

Parameters
command(ignored)
args(ignored)
Returns
current configuration wrapped in a response

Definition at line 264 of file ctrl_dhcp6_srv.cc.

References isc::config::CONTROL_RESULT_SUCCESS, isc::data::Element::create(), isc::config::createAnswer(), isc::dhcp::CfgMgr::getCurrentCfg(), isc::config::BaseCommandMgr::getHash(), and isc::dhcp::CfgMgr::instance().

Referenced by ControlledDhcpv6Srv().

Here is the call graph for this function:

◆ commandConfigHashGetHandler()

ConstElementPtr isc::dhcp::ControlledDhcpv6Srv::commandConfigHashGetHandler ( const std::string & command,
isc::data::ConstElementPtr args )
protected

handler for processing 'config-hash-get' command

This handler processes config-hash-get command, which retrieves the hash of the current configuration and returns it in response.

Parameters
command(ignored)
args(ignored)
Returns
hash of current configuration wrapped in a response

Definition at line 274 of file ctrl_dhcp6_srv.cc.

References isc::config::CONTROL_RESULT_SUCCESS, isc::data::Element::create(), isc::config::createAnswer(), isc::data::Element::createMap(), isc::dhcp::CfgMgr::getCurrentCfg(), isc::config::BaseCommandMgr::getHash(), and isc::dhcp::CfgMgr::instance().

Referenced by ControlledDhcpv6Srv().

Here is the call graph for this function:

◆ commandConfigReloadHandler()

ConstElementPtr isc::dhcp::ControlledDhcpv6Srv::commandConfigReloadHandler ( const std::string & command,
isc::data::ConstElementPtr args )
protected

Handler for processing 'config-reload' command.

This handler processes config-reload command, which processes configuration specified in args parameter.

Parameters
command(parameter ignored)
argsconfiguration to be processed
Returns
status of the command

Definition at line 239 of file ctrl_dhcp6_srv.cc.

References isc::config::CONTROL_RESULT_ERROR, isc::config::createAnswer(), isc::config::createAnswer(), isc::dhcp::DHCP6_DYNAMIC_RECONFIGURATION, isc::dhcp::DHCP6_DYNAMIC_RECONFIGURATION_FAIL, isc::dhcp::DHCP6_DYNAMIC_RECONFIGURATION_SUCCESS, isc::dhcp::dhcp6_logger, isc::process::Daemon::getConfigFile(), getInstance(), isc::dhcp::IfaceMgr::instance(), loadConfigFile(), LOG_FATAL, and LOG_INFO.

Referenced by ControlledDhcpv6Srv().

Here is the call graph for this function:

◆ commandConfigSetHandler()

ConstElementPtr isc::dhcp::ControlledDhcpv6Srv::commandConfigSetHandler ( const std::string & command,
isc::data::ConstElementPtr args )
protected

handler for processing 'config-set' command

This handler processes config-set command, which processes configuration specified in args parameter.

Parameters
command(parameter ignored)
argsconfiguration to be processed. Expected format: map containing Dhcp6 map that contains DHCPv6 server configuration.
Returns
status of the command

Let postponed hook initializations run.

Definition at line 347 of file ctrl_dhcp6_srv.cc.

References isc::dhcp::CfgMgr::clearStagingConfiguration(), isc::dhcp::CfgMgr::commit(), isc::config::CONTROL_RESULT_ERROR, isc::config::CONTROL_RESULT_FATAL_ERROR, isc::config::CONTROL_RESULT_SUCCESS, isc::config::createAnswer(), isc::config::createAnswer(), isc::dhcp::DHCP6_CONFIG_UNRECOVERABLE_ERROR, isc::dhcp::DHCP6_CONFIG_UNSUPPORTED_OBJECT, isc::dhcp::dhcp6_logger, isc::dhcp::CfgMgr::getCurrentCfg(), getShutdown(), isc::dhcp::CfgMgr::getStagingCfg(), isc::dhcp::LeaseMgrFactory::haveInstance(), isc::asiolink::IOServiceMgr::instance(), isc::dhcp::CfgMgr::instance(), isc::dhcp::IfaceMgr::instance(), isc::dhcp::LeaseMgrFactory::instance(), isc::dhcp::Memfile_LeaseMgr::isLFCProcessRunning(), LOG_ERROR, LOG_FATAL, isc::data::Element::map, isc::config::parseAnswer(), isc::asiolink::IOServiceMgr::pollIOServices(), processConfig(), and isc::dhcp::Memfile_LeaseMgr::V6.

Referenced by ControlledDhcpv6Srv().

Here is the call graph for this function:

◆ commandConfigTestHandler()

ConstElementPtr isc::dhcp::ControlledDhcpv6Srv::commandConfigTestHandler ( const std::string & command,
isc::data::ConstElementPtr args )
protected

handler for processing 'config-test' command

This handler processes config-test command, which checks configuration specified in args parameter.

Parameters
command(parameter ignored)
argsconfiguration to be checked. Expected format: map containing Dhcp6 map that contains DHCPv6 server configuration.
Returns
status of the command

Definition at line 478 of file ctrl_dhcp6_srv.cc.

References checkConfig(), isc::dhcp::CfgMgr::clearStagingConfiguration(), isc::config::CONTROL_RESULT_ERROR, isc::config::createAnswer(), isc::config::createAnswer(), isc::dhcp::DHCP6_CONFIG_UNSUPPORTED_OBJECT, isc::dhcp::dhcp6_logger, isc::dhcp::CfgMgr::instance(), isc::dhcp::IfaceMgr::instance(), LOG_ERROR, and isc::data::Element::map.

Referenced by ControlledDhcpv6Srv().

Here is the call graph for this function:

◆ commandConfigWriteHandler()

ConstElementPtr isc::dhcp::ControlledDhcpv6Srv::commandConfigWriteHandler ( const std::string & command,
isc::data::ConstElementPtr args )
protected

handler for processing 'config-write' command

This handle processes config-write command, which writes the current configuration to disk. This command takes one optional parameter called filename. If specified, the current configuration will be written to that file. If not specified, the file used during Kea start-up will be used. To avoid any exploits, the target directory must be the same as a security measure against exploiting file writes remotely.

Parameters
command(ignored)
argsmay contain optional string argument filename
Returns
status of the configuration file write

Definition at line 286 of file ctrl_dhcp6_srv.cc.

References isc::process::Daemon::checkWriteConfigFile(), isc::config::CONTROL_RESULT_ERROR, isc::config::CONTROL_RESULT_SUCCESS, isc::data::Element::create(), isc::config::createAnswer(), isc::data::Element::createMap(), isc::process::Daemon::getConfigFile(), isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::CfgMgr::instance(), isc::data::Element::map, isc::data::Element::string, isc::Exception::what(), and isc::process::Daemon::writeConfigFile().

Referenced by ControlledDhcpv6Srv().

Here is the call graph for this function:

◆ commandDhcpDisableHandler()

ConstElementPtr isc::dhcp::ControlledDhcpv6Srv::commandDhcpDisableHandler ( const std::string & command,
isc::data::ConstElementPtr args )
protected

A handler for processing 'dhcp-disable' command.

Parameters
commandcommand name (ignored).
argsarguments for the command. It must be a map and it may include optional 'max-period' parameter.
Returns
result of the command.

Definition at line 540 of file ctrl_dhcp6_srv.cc.

References isc::config::CONTROL_RESULT_ERROR, isc::config::CONTROL_RESULT_SUCCESS, isc::config::createAnswer(), isc::dhcp::NetworkState::HA_REMOTE_COMMAND, isc::data::Element::integer, isc::data::Element::map, isc::dhcp::Dhcpv6Srv::network_state_, isc::data::Element::string, and isc::dhcp::NetworkState::USER_COMMAND.

Referenced by ControlledDhcpv6Srv().

Here is the call graph for this function:

◆ commandDhcpEnableHandler()

ConstElementPtr isc::dhcp::ControlledDhcpv6Srv::commandDhcpEnableHandler ( const std::string & command,
isc::data::ConstElementPtr args )
protected

A handler for processing 'dhcp-enable' command.

Parameters
commandcommand name (ignored)
argsarguments for the command (ignored).
Returns
result of the command.

Definition at line 636 of file ctrl_dhcp6_srv.cc.

References isc::config::CONTROL_RESULT_ERROR, isc::config::CONTROL_RESULT_SUCCESS, isc::config::createAnswer(), isc::dhcp::NetworkState::HA_REMOTE_COMMAND, isc::data::Element::integer, isc::data::Element::map, isc::dhcp::Dhcpv6Srv::network_state_, isc::data::Element::string, and isc::dhcp::NetworkState::USER_COMMAND.

Referenced by ControlledDhcpv6Srv().

Here is the call graph for this function:

◆ commandInterfaceAddHandler()

ConstElementPtr isc::dhcp::ControlledDhcpv6Srv::commandInterfaceAddHandler ( const std::string & command,
isc::data::ConstElementPtr args )
protected

Handler for processing 'interface-add' command.

This handler processes interface-add command.

Parameters
command(parameter ignored)
argsarguments for the command.
Returns
status of the command with the result

Definition at line 764 of file ctrl_dhcp6_srv.cc.

References isc::config::CONTROL_RESULT_ERROR, isc::config::CONTROL_RESULT_FATAL_ERROR, isc::config::CONTROL_RESULT_SUCCESS, isc::config::createAnswer(), isc::data::Element::createList(), isc::db::error, isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::Dhcpv6Srv::getServerPort(), getShutdown(), isc::dhcp::CfgMgr::instance(), isc::dhcp::IfaceMgr::instance(), isc::data::Element::list, isc::data::Element::map, and isc::dhcp::IfacesConfigParser::parseInterfacesList().

Referenced by ControlledDhcpv6Srv().

Here is the call graph for this function:

◆ commandInterfaceListHandler()

ConstElementPtr isc::dhcp::ControlledDhcpv6Srv::commandInterfaceListHandler ( const std::string & command,
isc::data::ConstElementPtr args )
protected

Handler for processing 'interface-list' command.

This handler processes interface-list command.

Parameters
command(parameter ignored)
argsarguments for the command (ignored).
Returns
status of the command with the result

Definition at line 706 of file ctrl_dhcp6_srv.cc.

References isc::config::CONTROL_RESULT_ERROR, isc::config::CONTROL_RESULT_SUCCESS, isc::config::createAnswer(), isc::data::Element::createMap(), isc::db::error, isc::dhcp::IfaceMgr::getIfaces(), isc::dhcp::IfaceMgr::instance(), and isc::dhcp::IfaceCollection::size().

Referenced by ControlledDhcpv6Srv(), and commandInterfaceRedetectHandler().

Here is the call graph for this function:

◆ commandInterfaceRedetectHandler()

ConstElementPtr isc::dhcp::ControlledDhcpv6Srv::commandInterfaceRedetectHandler ( const std::string & command,
isc::data::ConstElementPtr args )
protected

Handler for processing 'interface-redetect' command.

This handler processes interface-redetect command.

Parameters
command(parameter ignored)
argsarguments for the command (ignored).
Returns
status of the command with the result

Definition at line 733 of file ctrl_dhcp6_srv.cc.

References commandInterfaceListHandler(), isc::config::CONTROL_RESULT_ERROR, isc::config::createAnswer(), isc::dhcp::IfaceMgr::detectIfaces(), isc::db::error, and isc::dhcp::IfaceMgr::instance().

Referenced by ControlledDhcpv6Srv().

Here is the call graph for this function:

◆ commandLeasesReclaimHandler()

ConstElementPtr isc::dhcp::ControlledDhcpv6Srv::commandLeasesReclaimHandler ( const std::string & command,
isc::data::ConstElementPtr args )
protected

Handler for processing 'leases-reclaim' command.

This handler processes leases-reclaim command, which triggers the leases reclamation immediately. No limit for processing time or number of processed leases applies.

Parameters
command(parameter ignored)
argsarguments map { "remove": <bool> } if true a lease is removed when it is reclaimed, if false its state is changed to "expired-reclaimed".
Returns
status of the command (should be success unless args was not a Bool Element).

Definition at line 863 of file ctrl_dhcp6_srv.cc.

References isc::data::Element::boolean, isc::config::CONTROL_RESULT_ERROR, and isc::config::createAnswer().

Referenced by ControlledDhcpv6Srv().

Here is the call graph for this function:

◆ commandLfcStartHandler()

ConstElementPtr isc::dhcp::ControlledDhcpv6Srv::commandLfcStartHandler ( const std::string & command,
isc::data::ConstElementPtr args )
protected

handler for processing 'kea-lfc-start' command

This handler processes kea-lfc-start command, which cleans up the lease file (the backup file of the memfile lease backend). isc::dhcp::LeaseMgr::lfcStartHandler

Parameters
command(ignored)
args(ignored)
Returns
process information wrapped in a response

Definition at line 1160 of file ctrl_dhcp6_srv.cc.

References isc::config::CONTROL_RESULT_COMMAND_UNSUPPORTED, isc::config::createAnswer(), isc::dhcp::LeaseMgrFactory::haveInstance(), and isc::dhcp::LeaseMgrFactory::instance().

Referenced by ControlledDhcpv6Srv().

Here is the call graph for this function:

◆ commandServerTagGetHandler()

ConstElementPtr isc::dhcp::ControlledDhcpv6Srv::commandServerTagGetHandler ( const std::string & command,
isc::data::ConstElementPtr args )
protected

handler for server-tag-get command

This method handles the server-tag-get command, which retrieves the current server tag and returns it in response.

Parameters
command(ignored)
args(ignored)
Returns
current configuration wrapped in a response

Definition at line 1006 of file ctrl_dhcp6_srv.cc.

References isc::config::CONTROL_RESULT_SUCCESS, isc::data::Element::create(), isc::config::createAnswer(), isc::data::Element::createMap(), isc::dhcp::CfgMgr::getCurrentCfg(), and isc::dhcp::CfgMgr::instance().

Referenced by ControlledDhcpv6Srv().

Here is the call graph for this function:

◆ commandShutdownHandler()

ConstElementPtr isc::dhcp::ControlledDhcpv6Srv::commandShutdownHandler ( const std::string & command,
isc::data::ConstElementPtr args )
protected

Handler for processing 'shutdown' command.

This handler processes shutdown command, which initializes shutdown procedure.

Parameters
command(parameter ignored)
args(parameter ignored)
Returns
status of the command

Definition at line 210 of file ctrl_dhcp6_srv.cc.

References isc::config::CONTROL_RESULT_ERROR, isc::config::CONTROL_RESULT_SUCCESS, isc::config::createAnswer(), isc::dhcp::dhcp6_logger, isc::dhcp::DHCP6_NOT_RUNNING, getInstance(), isc::data::Element::integer, LOG_WARN, isc::data::Element::map, and shutdownServer().

Referenced by ControlledDhcpv6Srv().

Here is the call graph for this function:

◆ commandStatisticSetMaxSampleAgeAllHandler()

ConstElementPtr isc::dhcp::ControlledDhcpv6Srv::commandStatisticSetMaxSampleAgeAllHandler ( const std::string & command,
isc::data::ConstElementPtr args )
protected

handler for processing 'statistic-sample-age-set-all' command

This handler processes statistic-sample-age-set-all command, which sets max_sample_age_ limit of all statistics and the default. isc::stats::StatsMgr::statisticSetMaxSampleAgeAllHandler

Parameters
command(ignored)
argsstructure containing a map that contains "duration"
Returns
process information wrapped in a response

Definition at line 1147 of file ctrl_dhcp6_srv.cc.

References isc::data::Element::create(), isc::dhcp::CfgMgr::getCurrentCfg(), isc::stats::StatsMgr::getMaxSampleAgeDefault(), isc::dhcp::CfgMgr::instance(), isc::stats::StatsMgr::instance(), isc::stats::StatsMgr::statisticSetMaxSampleAgeAllHandler(), and isc::stats::toSeconds().

Referenced by ControlledDhcpv6Srv().

Here is the call graph for this function:

◆ commandStatisticSetMaxSampleCountAllHandler()

ConstElementPtr isc::dhcp::ControlledDhcpv6Srv::commandStatisticSetMaxSampleCountAllHandler ( const std::string & command,
isc::data::ConstElementPtr args )
protected

handler for processing 'statistic-sample-count-set-all' command

This handler processes statistic-sample-count-set-all command, which sets max_sample_count_ limit of all statistics and the default. isc::stats::StatsMgr::statisticSetMaxSampleCountAllHandler

Parameters
command(ignored)
argsstructure containing a map that contains "max-samples"
Returns
process information wrapped in a response

Definition at line 1135 of file ctrl_dhcp6_srv.cc.

References isc::data::Element::create(), isc::dhcp::CfgMgr::getCurrentCfg(), isc::stats::StatsMgr::getMaxSampleCountDefault(), isc::dhcp::CfgMgr::instance(), isc::stats::StatsMgr::instance(), and isc::stats::StatsMgr::statisticSetMaxSampleCountAllHandler().

Referenced by ControlledDhcpv6Srv().

Here is the call graph for this function:

◆ commandStatusGetHandler()

ConstElementPtr isc::dhcp::ControlledDhcpv6Srv::commandStatusGetHandler ( const std::string & command,
isc::data::ConstElementPtr args )
protected

handler for processing 'status-get' command

This handler processes status-get command, which retrieves the server process information i.e. the pid and returns it in response.

Parameters
command(ignored)
args(ignored)
Returns
process information wrapped in a response

Definition at line 1056 of file ctrl_dhcp6_srv.cc.

References isc::config::CONTROL_RESULT_SUCCESS, isc::data::Element::create(), isc::config::createAnswer(), isc::data::Element::createList(), isc::data::Element::createMap(), isc::db::error, isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::LeaseMgr::getStatus(), isc::dhcp::LeaseMgrFactory::haveInstance(), isc::dhcp::CfgMgr::instance(), isc::dhcp::IfaceMgr::instance(), isc::dhcp::LeaseMgrFactory::instance(), isc::util::MultiThreadingMgr::instance(), isc::data::Element::map, isc::dhcp::Dhcpv6Srv::network_state_, and isc::process::Daemon::start_.

Referenced by ControlledDhcpv6Srv().

Here is the call graph for this function:

◆ commandSubnet6SelectTestHandler()

ConstElementPtr isc::dhcp::ControlledDhcpv6Srv::commandSubnet6SelectTestHandler ( const std::string & command,
isc::data::ConstElementPtr args )
protected

Handler for processing 'subnet6-select-test' command.

This handler processes subnet6-select-test command, which returns the result of DHCPv6 subnet selected.

Parameters
command(parameter ignored)
argsarguments map { <selector>:

}

Returns
status of the command with the selection result

Definition at line 889 of file ctrl_dhcp6_srv.cc.

References isc::dhcp::SubnetSelector::client_classes_, isc::config::CONTROL_RESULT_EMPTY, isc::config::CONTROL_RESULT_ERROR, isc::config::CONTROL_RESULT_SUCCESS, isc::config::createAnswer(), D6O_INTERFACE_ID, isc::util::str::decodeFormattedHexString(), isc::dhcp::SubnetSelector::first_relay_linkaddr_, isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::SubnetSelector::iface_name_, isc::dhcp::ClientClasses::insert(), isc::dhcp::CfgMgr::instance(), isc::dhcp::SubnetSelector::interface_id_, isc::asiolink::IOAddress::IPV6_ZERO_ADDRESS(), isc::asiolink::IOAddress::isV6(), isc::data::Element::list, isc::data::Element::map, isc::util::str::quotedStringToBinary(), isc::dhcp::SubnetSelector::remote_address_, isc::data::Element::string, and isc::dhcp::Option::V6.

Referenced by ControlledDhcpv6Srv().

Here is the call graph for this function:

◆ commandVersionGetHandler()

ConstElementPtr isc::dhcp::ControlledDhcpv6Srv::commandVersionGetHandler ( const std::string & command,
isc::data::ConstElementPtr args )
protected

@Brief handler for processing 'version-get' command

This handler processes version-get command, which returns over the control channel the -v and -V command line arguments.

Parameters
command(parameter ignored)
args(parameter ignored)
Returns
status of the command with the version in text and the extended version in arguments.

Definition at line 844 of file ctrl_dhcp6_srv.cc.

References isc::config::CONTROL_RESULT_SUCCESS, isc::data::Element::create(), isc::config::createAnswer(), isc::data::Element::createMap(), and isc::dhcp::Dhcpv6Srv::getVersion().

Referenced by ControlledDhcpv6Srv().

Here is the call graph for this function:

◆ finishConfigHookLibraries()

isc::data::ConstElementPtr isc::dhcp::ControlledDhcpv6Srv::finishConfigHookLibraries ( isc::data::ConstElementPtr config)
static

Configuration checker for hook libraries.

This is a method for checking incoming configuration in the hooks libraries. It calls dhcp4_srv_configured hook point for all hooks.

Parameters
configJSON representation of the new configuration
Returns
status of the config check

Definition at line 1365 of file ctrl_dhcp6_srv.cc.

References ControlledDhcpv6Srv(), isc::hooks::HooksManager::callCallouts(), isc::hooks::HooksManager::calloutsPresent(), isc::config::CONTROL_RESULT_ERROR, isc::config::createAnswer(), isc::hooks::HooksManager::createCalloutHandle(), isc::db::error, getInstance(), isc::dhcp::Dhcpv6Srv::getIOService(), isc::dhcp::Dhcpv6Srv::getNetworkState(), Hooks, isc::dhcp::CfgMgr::instance(), and isc::hooks::CalloutHandle::NEXT_STEP_DROP.

Referenced by isc::dhcp::configureDhcp6Server(), and processConfig().

Here is the call graph for this function:

◆ getInstance()

ControlledDhcpv6Srv * isc::dhcp::ControlledDhcpv6Srv::getInstance ( )
inlinestatic

Returns pointer to the sole instance of Dhcpv6Srv.

Returns
server instance (may return NULL, if called before server is spawned)

Definition at line 118 of file ctrl_dhcp6_srv.h.

References ControlledDhcpv6Srv().

Referenced by ControlledDhcpv6Srv(), checkConfig(), commandConfigReloadHandler(), commandShutdownHandler(), finishConfigHookLibraries(), and processConfig().

Here is the call graph for this function:

◆ getShutdown()

bool isc::dhcp::ControlledDhcpv6Srv::getShutdown ( ) const

Return the server shutdown flag value.

Definition at line 205 of file ctrl_dhcp6_srv.cc.

References isc::dhcp::Dhcpv6Srv::shutdown_.

Referenced by commandConfigSetHandler(), and commandInterfaceAddHandler().

◆ init()

void isc::dhcp::ControlledDhcpv6Srv::init ( const std::string & config_file)

Initializes the server.

It reads the JSON file from disk or may perform any other setup operation. In particular, it also install signal handlers.

This method may throw if initialization fails.

Definition at line 102 of file ctrl_dhcp6_srv.cc.

References isc::config::CONTROL_RESULT_SUCCESS, isc::dhcp::Dhcpv6Srv::getIOService(), isc_throw, loadConfigFile(), isc::config::parseAnswer(), isc::process::Daemon::signal_set_, and isc::process::Daemon::start_.

Referenced by main().

Here is the call graph for this function:

◆ loadConfigFile()

ConstElementPtr isc::dhcp::ControlledDhcpv6Srv::loadConfigFile ( const std::string & file_name)

Configure DHCPv6 server using the configuration file specified.

This function is used to both configure the DHCP server on its startup and dynamically reconfigure the server when SIGHUP signal is received.

It fetches DHCPv6 server's configuration from the 'Dhcp6' section of the JSON configuration file.

This utility method is called whenever we know a filename of the config and need to load it. It calls config-set command once the content of the file has been loaded and verified to be a sane JSON configuration. config-set handler will process the config file (apply it as current configuration).

Parameters
file_namename of the file to be loaded
Returns
status of the file loading and outcome of config-set

Definition at line 133 of file ctrl_dhcp6_srv.cc.

References isc::dhcp::CfgMgr::clearStagingConfiguration(), isc::config::CONTROL_RESULT_SUCCESS, isc::config::createCommand(), isc::dhcp::DHCP6_CONFIG_LOAD_FAIL, isc::dhcp::dhcp6_logger, isc::dhcp::DHCP6_MULTI_THREADING_INFO, isc::config::CommandMgr::instance(), isc::dhcp::CfgMgr::instance(), isc::util::MultiThreadingMgr::instance(), isc_throw, LOG_ERROR, LOG_INFO, isc::data::Element::map, isc::config::parseAnswer(), isc::dhcp::Parser6Context::parseFile(), isc::dhcp::Parser6Context::PARSER_DHCP6, and isc::config::BaseCommandMgr::processCommand().

Referenced by commandConfigReloadHandler(), and init().

Here is the call graph for this function:

◆ processConfig()

isc::data::ConstElementPtr isc::dhcp::ControlledDhcpv6Srv::processConfig ( isc::data::ConstElementPtr config)
static

Configuration processor.

This is a method for handling incoming configuration updates. This method should be called by all configuration backends when the server is starting up or when configuration has changed.

As pointer to this method is used a callback in ASIO used in ModuleCCSession, it has to be static.

Parameters
configtextual representation of the new configuration
Returns
status of the config update

Definition at line 1169 of file ctrl_dhcp6_srv.cc.

References ControlledDhcpv6Srv(), isc::dhcp::CfgMultiThreading::apply(), isc::dhcp::LibDHCP::commitRuntimeOptionDefs(), isc::dhcp::configureDhcp6Server(), isc::config::CONTROL_RESULT_ERROR, isc::config::CONTROL_RESULT_SUCCESS, isc::config::createAnswer(), D6O_SERVERID, isc::db::DatabaseConnection::db_failed_callback_, isc::db::DatabaseConnection::db_lost_callback_, isc::db::DatabaseConnection::db_recovered_callback_, isc::dhcp::DBG_DHCP6_COMMAND, isc::dhcp::DHCP6_CONFIG_PACKET_QUEUE, isc::dhcp::DHCP6_CONFIG_RECEIVED, isc::dhcp::dhcp6_logger, isc::dhcp::DHCP6_USING_SERVERID, finishConfigHookLibraries(), getInstance(), isc::dhcp::Dhcpv6Srv::getNetworkState(), isc::dhcp::Dhcpv6Srv::getServerPort(), isc::dhcp::CfgMgr::getStagingCfg(), isc::dhcp::LeaseMgrFactory::init_allocators_, isc::dhcp::CfgMgr::instance(), isc::dhcp::Dhcp6to4Ipc::instance(), isc::dhcp::IfaceMgr::instance(), isc::dhcp::TimerMgr::instance(), LOG_DEBUG, LOG_INFO, isc::asiolink::IntervalTimer::ONE_SHOT, isc::dhcp::Dhcp6to4Ipc::open(), isc::dhcp::CfgIface::open_sockets_failed_callback_, isc::config::parseAnswer(), isc::process::Daemon::redactConfig(), isc::dhcp::Dhcpv6Srv::startD2(), and isc::dhcp::Option::V6.

Referenced by commandConfigSetHandler().

Here is the call graph for this function:

◆ sessionReader()

void isc::dhcp::ControlledDhcpv6Srv::sessionReader ( void )
staticprotected

Callback that will be called from iface_mgr when data is received over control socket.

This static callback method is called from IfaceMgr::receive6() method, when there is a new command or configuration sent over control socket (that was sent from some yet unspecified sender).

References ControlledDhcpv6Srv().

Here is the call graph for this function:

◆ shutdownServer()

void isc::dhcp::ControlledDhcpv6Srv::shutdownServer ( int exit_value)
virtual

Initiates shutdown procedure for the whole DHCPv6 server.

Parameters
exit_valueinteger value to the process should exit with.

Definition at line 1542 of file ctrl_dhcp6_srv.cc.

References isc::dhcp::Dhcpv6Srv::getIOService(), isc::process::Daemon::setExitValue(), and isc::dhcp::Dhcpv6Srv::shutdown().

Referenced by commandShutdownHandler().

Here is the call graph for this function:

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