 |
Kea
1.5.0
|
Go to the documentation of this file.
12 #include <boost/bind.hpp>
13 #include <boost/enable_shared_from_this.hpp>
19 const std::string NETWORK_STATE_TIMER_NAME =
"network-state-timer";
67 timer_mgr_->registerTimer(NETWORK_STATE_TIMER_NAME,
77 if (
timer_mgr_->isTimerRegistered(NETWORK_STATE_TIMER_NAME)) {
78 timer_mgr_->unregisterTimer(NETWORK_STATE_TIMER_NAME);
107 impl_->setDisableService(
true);
112 impl_->setDisableService(
false);
122 impl_->createTimer(seconds);
127 return (!impl_->globally_disabled_);
std::set< std::string > Networks
Type of the container holding collection of shared network names.
bool globally_disabled_
A flag indicating if DHCP service is globally disabled.
bool isServiceEnabled() const
Checks if the DHCP service is globally enabled.
NetworkState::Networks disabled_networks_
A list of networks for which the DHCP service has been disabled.
NetworkState::ServerType server_type_
Server type.
~NetworkStateImpl()
Destructor.
Defines the logger used by the top-level component of kea-dhcp-ddns.
Manages a pool of asynchronous interval timers.
std::set< SubnetID > Subnets
Type of the container holding collection of subnet identifiers.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
void selectiveDisable(const NetworkState::Subnets &subnets)
Disable DHCP service for selected subnets.
bool isDelayedEnableAll() const
Checks if delayed enabling of DHCP services is scheduled.
static const TimerMgrPtr & instance()
Returns pointer to the sole instance of the TimerMgr.
NetworkState::Subnets disabled_subnets_
A list of subnets for which the DHCP service has been disabled.
NetworkState(const ServerType &server_type)
Constructor.
NetworkStateImpl(const NetworkState::ServerType &server_type)
Constructor.
ServerType
DHCP server type.
boost::shared_ptr< TimerMgr > TimerMgrPtr
Type definition of the shared pointer to TimerMgr.
void createTimer(const unsigned int seconds)
Creates a timer counting the time when enableAll should be automatically called.
void enableAll()
Enables DHCP service globally and per scopes.
void selectiveEnable(const NetworkState::Subnets &subnets)
Enable DHCP service for selected subnets.
void destroyTimer()
Destroys a timer if present.
void enableService()
Globally enables DHCP service.
A generic exception that is thrown when a function is not implemented.
void delayedEnableAll(const unsigned int seconds)
Schedules enabling DHCP service in the future.
void enableAll()
Enables DHCP service globally and for scopes which have been disabled as a result of control command.
void setDisableService(const bool disable)
Globally disables or enables DHCP service.
TimerMgrPtr timer_mgr_
A pointer to the common timer manager.
Implementation of the NetworkState class.
void disableService()
Globally disables DHCP service.