Kea: ctrl_dhcp6_srv.h Source File

| Kea 3.0.3-git

ctrl_dhcp6_srv.h
Go to the documentation of this file.
1// Copyright (C) 2012-2025 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
87 static isc::data::ConstElementPtr
88 processConfig(isc::data::ConstElementPtr config);
89
97 static isc::data::ConstElementPtr
98 checkConfig(isc::data::ConstElementPtr config);
99
108 static isc::data::ConstElementPtr
109 finishConfigHookLibraries(isc::data::ConstElementPtr config);
110
114 static ControlledDhcpv6Srv* getInstance() {
115 return (server_);
116 }
117
118private:
125 static void sessionReader(void);
126
135 isc::data::ConstElementPtr
136 commandShutdownHandler(const std::string& command,
137 isc::data::ConstElementPtr args);
138
148 isc::data::ConstElementPtr
149 commandConfigReloadHandler(const std::string& command,
150 isc::data::ConstElementPtr args);
151
160 isc::data::ConstElementPtr
161 commandConfigGetHandler(const std::string& command,
162 isc::data::ConstElementPtr args);
163
172 isc::data::ConstElementPtr
173 commandConfigHashGetHandler(const std::string& command,
174 isc::data::ConstElementPtr args);
175
189 isc::data::ConstElementPtr
190 commandConfigWriteHandler(const std::string& command,
191 isc::data::ConstElementPtr args);
192
202 isc::data::ConstElementPtr
203 commandConfigSetHandler(const std::string& command,
204 isc::data::ConstElementPtr args);
205
215 isc::data::ConstElementPtr
216 commandConfigTestHandler(const std::string& command,
217 isc::data::ConstElementPtr args);
218
226 isc::data::ConstElementPtr
227 commandDhcpDisableHandler(const std::string& command,
228 isc::data::ConstElementPtr args);
229
236 isc::data::ConstElementPtr
237 commandDhcpEnableHandler(const std::string& command,
238 isc::data::ConstElementPtr args);
239
249 isc::data::ConstElementPtr
250 commandVersionGetHandler(const std::string& command,
251 isc::data::ConstElementPtr args);
252
261 isc::data::ConstElementPtr
262 commandBuildReportHandler(const std::string& command,
263 isc::data::ConstElementPtr args);
264
278 isc::data::ConstElementPtr
279 commandLeasesReclaimHandler(const std::string& command,
280 isc::data::ConstElementPtr args);
281
291 isc::data::ConstElementPtr
292 commandSubnet6SelectTestHandler(const std::string& command,
293 isc::data::ConstElementPtr args);
294
303 isc::data::ConstElementPtr
304 commandServerTagGetHandler(const std::string& command,
305 isc::data::ConstElementPtr args);
306
316 isc::data::ConstElementPtr
317 commandConfigBackendPullHandler(const std::string& command,
318 isc::data::ConstElementPtr args);
319
328 isc::data::ConstElementPtr
329 commandStatusGetHandler(const std::string& command,
330 isc::data::ConstElementPtr args);
331
341 isc::data::ConstElementPtr
342 commandStatisticSetMaxSampleCountAllHandler(const std::string& command,
343 isc::data::ConstElementPtr args);
344
354 isc::data::ConstElementPtr
355 commandStatisticSetMaxSampleAgeAllHandler(const std::string& command,
356 isc::data::ConstElementPtr args);
357
374 void reclaimExpiredLeases(const size_t max_leases, const uint16_t timeout,
375 const bool remove_lease,
376 const uint16_t max_unwarned_cycles);
377
386 void deleteExpiredReclaimedLeases(const uint32_t secs);
387
405 bool dbLostCallback(util::ReconnectCtlPtr db_reconnect_ctl);
406
418 bool dbRecoveredCallback(util::ReconnectCtlPtr db_reconnect_ctl);
419
430 bool dbFailedCallback(util::ReconnectCtlPtr db_reconnect_ctl);
431
439 void openSocketsFailedCallback(util::ReconnectCtlPtr reconnect_ctl);
440
452 void cbFetchUpdates(const SrvConfigPtr& srv_cfg,
453 boost::shared_ptr<unsigned> failure_count);
454
459 static ControlledDhcpv6Srv* server_;
460
465 TimerMgrPtr timer_mgr_;
466};
467
468} // namespace dhcp
469} // namespace isc
470
471#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:99
isc::dhcp::ControlledDhcpv6Srv::cleanup
void cleanup()
Performs cleanup, immediately before termination.
Definition ctrl_dhcp6_srv.cc:124
isc::dhcp::ControlledDhcpv6Srv::finishConfigHookLibraries
static isc::data::ConstElementPtr finishConfigHookLibraries(isc::data::ConstElementPtr config)
Configuration checker for hook libraries.
Definition ctrl_dhcp6_srv.cc:1177
isc::dhcp::ControlledDhcpv6Srv::~ControlledDhcpv6Srv
virtual ~ControlledDhcpv6Srv()
Destructor.
Definition ctrl_dhcp6_srv.cc:1342
isc::dhcp::ControlledDhcpv6Srv::processConfig
static isc::data::ConstElementPtr processConfig(isc::data::ConstElementPtr config)
Configuration processor.
Definition ctrl_dhcp6_srv.cc:966
isc::dhcp::ControlledDhcpv6Srv::shutdownServer
virtual void shutdownServer(int exit_value)
Initiates shutdown procedure for the whole DHCPv6 server.
Definition ctrl_dhcp6_srv.cc:1336
isc::dhcp::ControlledDhcpv6Srv::getInstance
static ControlledDhcpv6Srv * getInstance()
Returns pointer to the sole instance of Dhcpv6Srv.
Definition ctrl_dhcp6_srv.h:114
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:130
isc::dhcp::ControlledDhcpv6Srv::checkConfig
static isc::data::ConstElementPtr checkConfig(isc::data::ConstElementPtr config)
Configuration checker.
Definition ctrl_dhcp6_srv.cc:1211
isc::dhcp::ControlledDhcpv6Srv::ControlledDhcpv6Srv
ControlledDhcpv6Srv(uint16_t server_port=DHCP6_SERVER_PORT, uint16_t client_port=0)
Constructor.
Definition ctrl_dhcp6_srv.cc:1226
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::config
Definition command_interpreter.cc:23
isc::data::ConstElementPtr
boost::shared_ptr< const Element > ConstElementPtr
Definition data.h:30
isc::dhcp
Definition dhcp4/client_handler.cc:20
isc::dhcp::TimerMgrPtr
boost::shared_ptr< TimerMgr > TimerMgrPtr
Type definition of the shared pointer to TimerMgr.
Definition timer_mgr.h:27
isc::dhcp::SrvConfigPtr
boost::shared_ptr< SrvConfig > SrvConfigPtr
Non-const pointer to the SrvConfig.
Definition srv_config.h:1136
isc::util::ReconnectCtlPtr
boost::shared_ptr< ReconnectCtl > ReconnectCtlPtr
Pointer to an instance of ReconnectCtl.
Definition reconnect_ctl.h:148
isc
Defines the logger used by the top-level component of kea-lfc.
Definition agent_parser.cc:148
reconnect_ctl.h
timer_mgr.h