Kea  1.5.0
ctrl_dhcp6_srv.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2018 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 
31  ControlledDhcpv6Srv(uint16_t port = DHCP6_SERVER_PORT);
32 
34  virtual ~ControlledDhcpv6Srv();
35 
42  void init(const std::string& config_file);
43 
55  loadConfigFile(const std::string& file_name);
56 
61  void cleanup();
62 
64  void shutdown();
65 
88  processCommand(const std::string& command, isc::data::ConstElementPtr args);
89 
104 
114 
119  return (server_);
120  }
121 
122 private:
123 
130  static void sessionReader(void);
131 
141  commandShutdownHandler(const std::string& command,
143 
154  commandLibReloadHandler(const std::string& command,
156 
167  commandConfigReloadHandler(const std::string& command,
169 
179  commandConfigGetHandler(const std::string& command,
181 
196  commandConfigWriteHandler(const std::string& command,
198 
210  commandConfigSetHandler(const std::string& command,
212 
224  commandConfigTestHandler(const std::string& command,
226 
235  commandDhcpDisableHandler(const std::string& command,
237 
245  commandDhcpEnableHandler(const std::string& command,
247 
258  commandVersionGetHandler(const std::string& command,
260 
270  commandBuildReportHandler(const std::string& command,
272 
287  commandLeasesReclaimHandler(const std::string& command,
289 
306  void reclaimExpiredLeases(const size_t max_leases, const uint16_t timeout,
307  const bool remove_lease,
308  const uint16_t max_unwarned_cycles);
309 
310 
319  void deleteExpiredReclaimedLeases(const uint32_t secs);
320 
338  void dbReconnect(db::ReconnectCtlPtr db_reconnect_ctl);
339 
356  bool dbLostCallback(db::ReconnectCtlPtr db_reconnect_ctl);
357 
362  static ControlledDhcpv6Srv* server_;
363 
365  isc::asiolink::IOService io_service_;
366 
371  TimerMgrPtr timer_mgr_;
372 };
373 
374 }; // namespace isc::dhcp
375 }; // namespace isc
376 
377 #endif
boost::shared_ptr< TimerMgr > TimerMgrPtr
Type definition of the shared pointer to TimerMgr.
Definition: timer_mgr.h:22
static ControlledDhcpv6Srv * getInstance()
returns pointer to the sole instance of Dhcpv6Srv
virtual ~ControlledDhcpv6Srv()
Destructor.
void init(const std::string &config_file)
Initializes the server.
static isc::data::ConstElementPtr processCommand(const std::string &command, isc::data::ConstElementPtr args)
command processor
void shutdown()
Initiates shutdown procedure for the whole DHCPv6 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.
ControlledDhcpv6Srv(uint16_t port=DHCP6_SERVER_PORT)
Constructor.
Controlled version of the DHCPv6 server.
boost::shared_ptr< ReconnectCtl > ReconnectCtlPtr
Pointer to an instance of ReconnectCtl.
DHCPv6 server service.
Definition: dhcp6_srv.h:59
isc::data::ConstElementPtr loadConfigFile(const std::string &file_name)
Loads specific configuration file.