Kea  2.1.7-git
isc::dhcp::NetworkStateImpl Class Reference

Implementation of the NetworkState class. More...

+ Inheritance diagram for isc::dhcp::NetworkStateImpl:

Public Member Functions

 NetworkStateImpl (const NetworkState::ServerType &server_type)
 Constructor. More...
 
 ~NetworkStateImpl ()
 Destructor. More...
 
void createTimer (const unsigned int seconds, const NetworkState::Origin &origin)
 Creates a timer counting the time when enableAll should be automatically called. More...
 
void destroyTimer (const NetworkState::Origin &origin)
 Destroys a timer if present. More...
 
void enableAll (const NetworkState::Origin &origin)
 Enables DHCP service globally and per scopes. More...
 
void reset (const NetworkState::Origin &origin)
 Reset internal counters for a specific origin. More...
 
void setDisableService (const bool disable, const NetworkState::Origin &origin)
 Sets appropriate disabled or enabled DHCP service state for the respective origin. More...
 

Public Attributes

uint32_t disabled_by_db_connection_
 Flag which indicates the state has been disabled by a DB connection loss. More...
 
bool disabled_by_ha_command_
 Flag which indicates the state has been disabled by the HA command. More...
 
bool disabled_by_user_command_
 Flag which indicates the state has been disabled by an user command. More...
 
NetworkState::Networks disabled_networks_
 A list of networks for which the DHCP service has been disabled. More...
 
NetworkState::Subnets disabled_subnets_
 A list of subnets for which the DHCP service has been disabled. More...
 
bool globally_disabled_
 A flag indicating if DHCP service is globally disabled. More...
 
NetworkState::ServerType server_type_
 Server type. More...
 
TimerMgrPtr timer_mgr_
 A pointer to the common timer manager. More...
 

Detailed Description

Implementation of the NetworkState class.

Definition at line 31 of file network_state.cc.

Constructor & Destructor Documentation

◆ NetworkStateImpl()

isc::dhcp::NetworkStateImpl::NetworkStateImpl ( const NetworkState::ServerType server_type)
inline

Constructor.

Definition at line 35 of file network_state.cc.

◆ ~NetworkStateImpl()

isc::dhcp::NetworkStateImpl::~NetworkStateImpl ( )
inline

Destructor.

Definition at line 43 of file network_state.cc.

Member Function Documentation

◆ createTimer()

void isc::dhcp::NetworkStateImpl::createTimer ( const unsigned int  seconds,
const NetworkState::Origin origin 
)
inline

Creates a timer counting the time when enableAll should be automatically called.

If the timer has been already scheduled, it is destroyed and replaced with a new timer.

Parameters
secondsNumber of seconds to elapse before the enableAll is called.
originThe origin of the state transition.

Definition at line 158 of file network_state.cc.

References isc_throw, and isc::asiolink::IntervalTimer::ONE_SHOT.

◆ destroyTimer()

void isc::dhcp::NetworkStateImpl::destroyTimer ( const NetworkState::Origin origin)
inline

Destroys a timer if present.

Parameters
originThe origin of the state transition.

Definition at line 188 of file network_state.cc.

References isc_throw.

◆ enableAll()

void isc::dhcp::NetworkStateImpl::enableAll ( const NetworkState::Origin origin)
inline

Enables DHCP service globally and per scopes.

If delayed enabling DHCP service has been scheduled, it cancels it.

Parameters
originThe origin of the state transition.
Todo:
Enable service for all subnets and networks here.

Definition at line 141 of file network_state.cc.

◆ reset()

void isc::dhcp::NetworkStateImpl::reset ( const NetworkState::Origin origin)
inline

Reset internal counters for a specific origin.

Note
The dhcp service will remain disabled until all flags are cleared.
Parameters
originThe origin of the state transition.

Definition at line 113 of file network_state.cc.

References isc_throw.

◆ setDisableService()

void isc::dhcp::NetworkStateImpl::setDisableService ( const bool  disable,
const NetworkState::Origin origin 
)
inline

Sets appropriate disabled or enabled DHCP service state for the respective origin.

Note
If any of the user commands, HA internal commands or connection recovery processes disable the dhcp service, the service will remain disabled until all flags are cleared. In the case of the connection recovery a reference count is used internally, so that all connections must be restored before enabling the network state.
Parameters
disableThe value of the flag used to perform the transition.
originThe origin of the state transition.

Definition at line 60 of file network_state.cc.

References isc_throw.

Member Data Documentation

◆ disabled_by_db_connection_

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 237 of file network_state.cc.

◆ disabled_by_ha_command_

bool isc::dhcp::NetworkStateImpl::disabled_by_ha_command_

Flag which indicates the state has been disabled by the HA command.

Definition at line 233 of file network_state.cc.

◆ disabled_by_user_command_

bool isc::dhcp::NetworkStateImpl::disabled_by_user_command_

Flag which indicates the state has been disabled by an user command.

Definition at line 229 of file network_state.cc.

◆ disabled_networks_

NetworkState::Networks isc::dhcp::NetworkStateImpl::disabled_networks_

A list of networks for which the DHCP service has been disabled.

Definition at line 219 of file network_state.cc.

◆ disabled_subnets_

NetworkState::Subnets isc::dhcp::NetworkStateImpl::disabled_subnets_

A list of subnets for which the DHCP service has been disabled.

Definition at line 216 of file network_state.cc.

◆ globally_disabled_

bool isc::dhcp::NetworkStateImpl::globally_disabled_

A flag indicating if DHCP service is globally disabled.

Definition at line 213 of file network_state.cc.

◆ server_type_

NetworkState::ServerType isc::dhcp::NetworkStateImpl::server_type_

Server type.

Definition at line 210 of file network_state.cc.

◆ timer_mgr_

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 225 of file network_state.cc.


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