Kea: ctrl_dhcp6_srv.h Source File

| Kea 2.2.0

ctrl_dhcp6_srv.h
Go to the documentation of this file.
1// Copyright (C) 2012-2022 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 CTRL_DHCPV6_SRV_H
8#define CTRL_DHCPV6_SRV_H
9
10#include <asiolink/asio_wrapper.h>
11#include <asiolink/asiolink.h>
12#include <cc/data.h>
13#include <cc/command_interpreter.h>
14#include <util/reconnect_ctl.h>
15#include <dhcpsrv/timer_mgr.h>
16#include <dhcp6/dhcp6_srv.h>
17
18namespace isc {
19namespace dhcp {
20
25 class ControlledDhcpv6Srv : public isc::dhcp::Dhcpv6Srv {
26public:
27
32 ControlledDhcpv6Srv(uint16_t server_port = DHCP6_SERVER_PORT,
33 uint16_t client_port = 0);
34
36 virtual ~ControlledDhcpv6Srv();
37
44 void init(const std::string& config_file);
45
62 isc::data::ConstElementPtr
63 loadConfigFile(const std::string& file_name);
64
69 void cleanup();
70
73 virtual void shutdownServer(int exit_value);
74
96 static isc::data::ConstElementPtr
97 processCommand(const std::string& command, isc::data::ConstElementPtr args);
98
111 static isc::data::ConstElementPtr
112 processConfig(isc::data::ConstElementPtr new_config);
113
121 isc::data::ConstElementPtr
122 checkConfig(isc::data::ConstElementPtr new_config);
123
127 static ControlledDhcpv6Srv* getInstance() {
128 return (server_);
129 }
130
131private:
132
139 static void sessionReader(void);
140
149 isc::data::ConstElementPtr
150 commandShutdownHandler(const std::string& command,
151 isc::data::ConstElementPtr args);
152
162 isc::data::ConstElementPtr
163 commandLibReloadHandler(const std::string& command,
164 isc::data::ConstElementPtr args);
165
175 isc::data::ConstElementPtr
176 commandConfigReloadHandler(const std::string& command,
177 isc::data::ConstElementPtr args);
178
187 isc::data::ConstElementPtr
188 commandConfigGetHandler(const std::string& command,
189 isc::data::ConstElementPtr args);
190
204 isc::data::ConstElementPtr
205 commandConfigWriteHandler(const std::string& command,
206 isc::data::ConstElementPtr args);
207
217 isc::data::ConstElementPtr
218 commandConfigSetHandler(const std::string& command,
219 isc::data::ConstElementPtr args);
220
230 isc::data::ConstElementPtr
231 commandConfigTestHandler(const std::string& command,
232 isc::data::ConstElementPtr args);
233
241 isc::data::ConstElementPtr
242 commandDhcpDisableHandler(const std::string& command,
243 isc::data::ConstElementPtr args);
244
251 isc::data::ConstElementPtr
252 commandDhcpEnableHandler(const std::string& command,
253 isc::data::ConstElementPtr args);
254
264 isc::data::ConstElementPtr
265 commandVersionGetHandler(const std::string& command,
266 isc::data::ConstElementPtr args);
267
276 isc::data::ConstElementPtr
277 commandBuildReportHandler(const std::string& command,
278 isc::data::ConstElementPtr args);
279
293 isc::data::ConstElementPtr
294 commandLeasesReclaimHandler(const std::string& command,
295 isc::data::ConstElementPtr args);
296
305 isc::data::ConstElementPtr
306 commandServerTagGetHandler(const std::string& command,
307 isc::data::ConstElementPtr args);
308
318 isc::data::ConstElementPtr
319 commandConfigBackendPullHandler(const std::string& command,
320 isc::data::ConstElementPtr args);
321
330 isc::data::ConstElementPtr
331 commandStatusGetHandler(const std::string& command,
332 isc::data::ConstElementPtr args);
333
343 isc::data::ConstElementPtr
344 commandStatisticSetMaxSampleCountAllHandler(const std::string& command,
345 isc::data::ConstElementPtr args);
346
356 isc::data::ConstElementPtr
357 commandStatisticSetMaxSampleAgeAllHandler(const std::string& command,
358 isc::data::ConstElementPtr args);
359
376 void reclaimExpiredLeases(const size_t max_leases, const uint16_t timeout,
377 const bool remove_lease,
378 const uint16_t max_unwarned_cycles);
379
388 void deleteExpiredReclaimedLeases(const uint32_t secs);
389
407 bool dbLostCallback(util::ReconnectCtlPtr db_reconnect_ctl);
408
420 bool dbRecoveredCallback(util::ReconnectCtlPtr db_reconnect_ctl);
421
432 bool dbFailedCallback(util::ReconnectCtlPtr db_reconnect_ctl);
433
441 void openSocketsFailedCallback(util::ReconnectCtlPtr reconnect_ctl);
442
454 void cbFetchUpdates(const SrvConfigPtr& srv_cfg,
455 boost::shared_ptr<unsigned> failure_count);
456
461 static ControlledDhcpv6Srv* server_;
462
467 TimerMgrPtr timer_mgr_;
468};
469
470} // namespace dhcp
471} // namespace isc
472
473#endif
asio_wrapper.h
asiolink.h
isc::dhcp::ControlledDhcpv6Srv
Controlled version of the DHCPv6 server.
Definition: ctrl_dhcp6_srv.h:25
isc::dhcp::ControlledDhcpv6Srv::init
void init(const std::string &config_file)
Initializes the server.
Definition: ctrl_dhcp6_srv.cc:167
isc::dhcp::ControlledDhcpv6Srv::cleanup
void cleanup()
Performs cleanup, immediately before termination.
Definition: ctrl_dhcp6_srv.cc:196
isc::dhcp::ControlledDhcpv6Srv::checkConfig
isc::data::ConstElementPtr checkConfig(isc::data::ConstElementPtr new_config)
Configuration checker.
Definition: ctrl_dhcp6_srv.cc:1088
isc::dhcp::ControlledDhcpv6Srv::processConfig
static isc::data::ConstElementPtr processConfig(isc::data::ConstElementPtr new_config)
Configuration processor.
Definition: ctrl_dhcp6_srv.cc:881
isc::dhcp::ControlledDhcpv6Srv::~ControlledDhcpv6Srv
virtual ~ControlledDhcpv6Srv()
Destructor.
Definition: ctrl_dhcp6_srv.cc:1210
isc::dhcp::ControlledDhcpv6Srv::processCommand
static isc::data::ConstElementPtr processCommand(const std::string &command, isc::data::ConstElementPtr args)
Command processor.
Definition: ctrl_dhcp6_srv.cc:807
isc::dhcp::ControlledDhcpv6Srv::shutdownServer
virtual void shutdownServer(int exit_value)
Initiates shutdown procedure for the whole DHCPv6 server.
Definition: ctrl_dhcp6_srv.cc:1204
isc::dhcp::ControlledDhcpv6Srv::getInstance
static ControlledDhcpv6Srv * getInstance()
Returns pointer to the sole instance of Dhcpv6Srv.
Definition: ctrl_dhcp6_srv.h:127
isc::dhcp::ControlledDhcpv6Srv::loadConfigFile
isc::data::ConstElementPtr loadConfigFile(const std::string &file_name)
Configure DHCPv6 server using the configuration file specified.
Definition: ctrl_dhcp6_srv.cc:95
isc::dhcp::ControlledDhcpv6Srv::ControlledDhcpv6Srv
ControlledDhcpv6Srv(uint16_t server_port=DHCP6_SERVER_PORT, uint16_t client_port=0)
Constructor.
Definition: ctrl_dhcp6_srv.cc:1104
isc::dhcp::Dhcpv6Srv
DHCPv6 server service.
Definition: dhcp6_srv.h:66
command_interpreter.h
This file contains several functions and constants that are used for handling commands and responses ...
data.h
dhcp6_srv.h
isc::data::ConstElementPtr
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:27
isc::dhcp::TimerMgrPtr
boost::shared_ptr< TimerMgr > TimerMgrPtr
Type definition of the shared pointer to TimerMgr.
Definition: timer_mgr.h:24
isc::dhcp::SrvConfigPtr
boost::shared_ptr< SrvConfig > SrvConfigPtr
Non-const pointer to the SrvConfig.
Definition: srv_config.h:1165
isc::util::ReconnectCtlPtr
boost::shared_ptr< ReconnectCtl > ReconnectCtlPtr
Pointer to an instance of ReconnectCtl.
Definition: reconnect_ctl.h:138
isc
Defines the logger used by the top-level component of kea-lfc.
Definition: agent_parser.cc:143
reconnect_ctl.h
timer_mgr.h