Kea  1.9.9-git
ctrl_dhcp6_srv.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2021 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>
15 #include <dhcpsrv/timer_mgr.h>
16 #include <dhcp6/dhcp6_srv.h>
17 
18 namespace isc {
19 namespace dhcp {
20 
26 public:
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 
63  loadConfigFile(const std::string& file_name);
64 
69  void cleanup();
70 
73  virtual void shutdownServer(int exit_value);
74 
97  processCommand(const std::string& command, isc::data::ConstElementPtr args);
98 
113 
123 
128  return (server_);
129  }
130 
131 private:
132 
139  static void sessionReader(void);
140 
150  commandShutdownHandler(const std::string& command,
152 
163  commandLibReloadHandler(const std::string& command,
165 
176  commandConfigReloadHandler(const std::string& command,
178 
188  commandConfigGetHandler(const std::string& command,
190 
205  commandConfigWriteHandler(const std::string& command,
207 
218  commandConfigSetHandler(const std::string& command,
220 
231  commandConfigTestHandler(const std::string& command,
233 
242  commandDhcpDisableHandler(const std::string& command,
244 
252  commandDhcpEnableHandler(const std::string& command,
254 
265  commandVersionGetHandler(const std::string& command,
267 
277  commandBuildReportHandler(const std::string& command,
279 
294  commandLeasesReclaimHandler(const std::string& command,
296 
306  commandServerTagGetHandler(const std::string& command,
308 
319  commandConfigBackendPullHandler(const std::string& command,
321 
331  commandStatusGetHandler(const std::string& command,
333 
344  commandStatisticSetMaxSampleCountAllHandler(const std::string& command,
346 
357  commandStatisticSetMaxSampleAgeAllHandler(const std::string& command,
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 
406  bool dbLostCallback(db::ReconnectCtlPtr db_reconnect_ctl);
407 
416  bool dbRecoveredCallback(db::ReconnectCtlPtr db_reconnect_ctl);
417 
425  bool dbFailedCallback(db::ReconnectCtlPtr db_reconnect_ctl);
426 
438  void cbFetchUpdates(const SrvConfigPtr& srv_cfg,
439  boost::shared_ptr<unsigned> failure_count);
440 
445  static ControlledDhcpv6Srv* server_;
446 
451  TimerMgrPtr timer_mgr_;
452 };
453 
454 } // namespace dhcp
455 } // namespace isc
456 
457 #endif
boost::shared_ptr< TimerMgr > TimerMgrPtr
Type definition of the shared pointer to TimerMgr.
Definition: timer_mgr.h:24
virtual void shutdownServer(int exit_value)
Initiates shutdown procedure for the whole DHCPv6 server.
static ControlledDhcpv6Srv * getInstance()
Returns pointer to the sole instance of Dhcpv6Srv.
static isc::data::ConstElementPtr processCommand(const std::string &command, isc::data::ConstElementPtr args)
Command processor.
virtual ~ControlledDhcpv6Srv()
Destructor.
ControlledDhcpv6Srv(uint16_t server_port=DHCP6_SERVER_PORT, uint16_t client_port=0)
Constructor.
boost::shared_ptr< SrvConfig > SrvConfigPtr
Non-const pointer to the SrvConfig.
Definition: srv_config.h:1036
void init(const std::string &config_file)
Initializes the server.
static isc::data::ConstElementPtr processConfig(isc::data::ConstElementPtr new_config)
Configuration processor.
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:23
Defines the logger used by the top-level component of kea-dhcp-ddns.
This file contains several functions and constants that are used for handling commands and responses ...
void cleanup()
Performs cleanup, immediately before termination.
isc::data::ConstElementPtr checkConfig(isc::data::ConstElementPtr new_config)
Configuration checker.
Controlled version of the DHCPv6 server.
boost::shared_ptr< ReconnectCtl > ReconnectCtlPtr
Pointer to an instance of ReconnectCtl.
DHCPv6 server service.
Definition: dhcp6_srv.h:66
isc::data::ConstElementPtr loadConfigFile(const std::string &file_name)
Configure DHCPv6 server using the configuration file specified.