Kea 2.5.8
|
Implementation of the NetworkState
class.
More...
Public Member Functions | |
NetworkStateImpl (const NetworkState::ServerType &server_type) | |
Constructor. | |
~NetworkStateImpl () | |
Destructor. | |
void | createTimer (const unsigned int seconds, unsigned int origin) |
Creates a timer counting the time when delayedEnable should be automatically called. | |
void | delayedEnable (unsigned int origin) |
Enables DHCP service for an origin. | |
void | destroyTimer (unsigned int origin) |
Destroys a timer if present. | |
std::string | getTimerName (unsigned int origin) const |
Creates a unique timer name from the origin. | |
void | resetForDbConnection () |
Reset internal counters for a database connection origin. | |
void | setDisableService (const bool disable, unsigned int origin) |
Sets appropriate disabled or enabled DHCP service state for the respective origin. | |
Public Attributes | |
uint32_t | disabled_by_db_connection_ |
Flag which indicates the state has been disabled by a DB connection loss. | |
std::unordered_set< unsigned int > | disabled_by_origin_ |
A set of requests to disable the service by origin. | |
NetworkState::Networks | disabled_networks_ |
A list of networks for which the DHCP service has been disabled. | |
NetworkState::Subnets | disabled_subnets_ |
A list of subnets for which the DHCP service has been disabled. | |
bool | globally_disabled_ |
A flag indicating if DHCP service is globally disabled. | |
NetworkState::ServerType | server_type_ |
Server type. | |
TimerMgrPtr | timer_mgr_ |
A pointer to the common timer manager. | |
Implementation of the NetworkState
class.
Definition at line 25 of file network_state.cc.
|
inline |
Constructor.
Definition at line 29 of file network_state.cc.
|
inline |
Destructor.
Definition at line 37 of file network_state.cc.
References destroyTimer(), and disabled_by_origin_.
|
inline |
Creates a timer counting the time when delayedEnable
should be automatically called.
If the timer has been already scheduled, it is destroyed and replaced with a new timer.
seconds | Number of seconds to elapse before the delayedEnable is called. |
origin | The origin of the state transition. |
Definition at line 110 of file network_state.cc.
References isc::dhcp::NetworkState::DB_CONNECTION, delayedEnable(), destroyTimer(), getTimerName(), isc_throw, isc::asiolink::IntervalTimer::ONE_SHOT, and timer_mgr_.
|
inline |
Enables DHCP service for an origin.
If delayed enabling DHCP service has been scheduled, it cancels it.
origin | The origin of the state transition. |
Definition at line 96 of file network_state.cc.
References destroyTimer(), and setDisableService().
Referenced by createTimer().
|
inline |
Destroys a timer if present.
origin | The origin of the state transition. |
Definition at line 127 of file network_state.cc.
References isc::dhcp::NetworkState::DB_CONNECTION, getTimerName(), and timer_mgr_.
Referenced by ~NetworkStateImpl(), createTimer(), and delayedEnable().
|
inline |
Creates a unique timer name from the origin.
origin | The origin of the state transition. |
Definition at line 141 of file network_state.cc.
Referenced by createTimer(), and destroyTimer().
|
inline |
Reset internal counters for a database connection origin.
Definition at line 84 of file network_state.cc.
References disabled_by_db_connection_, disabled_by_origin_, and globally_disabled_.
|
inline |
Sets appropriate disabled or enabled DHCP service state for the respective origin.
disable | The value of the flag used to perform the transition. |
origin | The origin of the state transition. |
Definition at line 55 of file network_state.cc.
References isc::dhcp::NetworkState::DB_CONNECTION, disabled_by_db_connection_, disabled_by_origin_, and globally_disabled_.
Referenced by delayedEnable().
uint32_t isc::dhcp::NetworkStateImpl::disabled_by_db_connection_ |
Flag which indicates the state has been disabled by a DB connection loss.
Definition at line 170 of file network_state.cc.
Referenced by resetForDbConnection(), and setDisableService().
std::unordered_set<unsigned int> isc::dhcp::NetworkStateImpl::disabled_by_origin_ |
A set of requests to disable the service by origin.
Definition at line 166 of file network_state.cc.
Referenced by ~NetworkStateImpl(), resetForDbConnection(), and setDisableService().
NetworkState::Networks isc::dhcp::NetworkStateImpl::disabled_networks_ |
A list of networks for which the DHCP service has been disabled.
Definition at line 157 of file network_state.cc.
NetworkState::Subnets isc::dhcp::NetworkStateImpl::disabled_subnets_ |
A list of subnets for which the DHCP service has been disabled.
Definition at line 154 of file network_state.cc.
bool isc::dhcp::NetworkStateImpl::globally_disabled_ |
A flag indicating if DHCP service is globally disabled.
Definition at line 151 of file network_state.cc.
Referenced by resetForDbConnection(), and setDisableService().
NetworkState::ServerType isc::dhcp::NetworkStateImpl::server_type_ |
Server type.
Definition at line 148 of file network_state.cc.
TimerMgrPtr isc::dhcp::NetworkStateImpl::timer_mgr_ |
A pointer to the common timer manager.
This pointer is held here to make sure that the timer manager is not destroyed before an instance of this class is destroyed.
Definition at line 163 of file network_state.cc.
Referenced by createTimer(), and destroyTimer().