Kea  1.5.0
network_state.h
Go to the documentation of this file.
1 // Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
2 //
3 // This Source Code Form is subject to the terms of the Mozilla Public
4 // License, v. 2.0. If a copy of the MPL was not distributed with this
5 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 
7 #ifndef NETWORK_STATE_H
8 #define NETWORK_STATE_H
9 
10 #include <cc/data.h>
11 #include <dhcpsrv/subnet_id.h>
12 #include <boost/shared_ptr.hpp>
13 #include <set>
14 #include <string>
15 
16 namespace isc {
17 namespace dhcp {
18 
19 class NetworkStateImpl;
20 
57 class NetworkState {
58 public:
59 
61  enum ServerType {
64  };
65 
67  typedef std::set<SubnetID> Subnets;
68 
70  typedef std::set<std::string> Networks;
71 
73  NetworkState(const ServerType& server_type);
74 
79  void disableService();
80 
86  void enableService();
87 
90  void enableAll();
91 
96  void delayedEnableAll(const unsigned int seconds);
97 
101  bool isServiceEnabled() const;
102 
110  bool isDelayedEnableAll() const;
111 
113 
114 
121  void selectiveDisable(const NetworkState::Subnets& subnets);
122 
129  void selectiveDisable(const NetworkState::Networks& networks);
130 
137  void selectiveEnable(const NetworkState::Subnets& subnets);
138 
145  void selectiveEnable(const NetworkState::Networks& networks);
146 
148 
149 private:
150 
152  boost::shared_ptr<NetworkStateImpl> impl_;
153 };
154 
156 typedef boost::shared_ptr<NetworkState> NetworkStatePtr;
157 
158 } // end of namespace isc::dhcp
159 } // end of namespace isc
160 
161 #endif // NETWORK_STATE_H
void disableService()
Globally disables DHCP service.
std::set< std::string > Networks
Type of the container holding collection of shared network names.
Definition: network_state.h:70
NetworkState(const ServerType &server_type)
Constructor.
ServerType
DHCP server type.
Definition: network_state.h:61
Holds information about DHCP service enabling status.
Definition: network_state.h:57
std::set< SubnetID > Subnets
Type of the container holding collection of subnet identifiers.
Definition: network_state.h:67
void selectiveEnable(const NetworkState::Subnets &subnets)
Enable DHCP service for selected subnets.
void delayedEnableAll(const unsigned int seconds)
Schedules enabling DHCP service in the future.
void enableService()
Globally enables DHCP service.
void enableAll()
Enables DHCP service globally and for scopes which have been disabled as a result of control command.
void selectiveDisable(const NetworkState::Subnets &subnets)
Disable DHCP service for selected subnets.
Defines the logger used by the top-level component of kea-dhcp-ddns.
bool isServiceEnabled() const
Checks if the DHCP service is globally enabled.
boost::shared_ptr< NetworkState > NetworkStatePtr
Pointer to the NetworkState object.
bool isDelayedEnableAll() const
Checks if delayed enabling of DHCP services is scheduled.