Kea  1.5.0
ctrl_dhcp4_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_DHCPV4_SRV_H
8 #define CTRL_DHCPV4_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 <dhcp4/dhcp4_srv.h>
17 
18 namespace isc {
19 namespace dhcp {
20 
26 public:
27 
31  ControlledDhcpv4Srv(uint16_t port = DHCP4_SERVER_PORT);
32 
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 
123 private:
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 
248 
259  commandVersionGetHandler(const std::string& command,
261 
271  commandBuildReportHandler(const std::string& command,
273 
288  commandLeasesReclaimHandler(const std::string& command,
290 
307  void reclaimExpiredLeases(const size_t max_leases, const uint16_t timeout,
308  const bool remove_lease,
309  const uint16_t max_unwarned_cycles);
310 
319  void deleteExpiredReclaimedLeases(const uint32_t secs);
320 
339  void dbReconnect(db::ReconnectCtlPtr db_reconnect_ctl);
340 
359  bool dbLostCallback(db::ReconnectCtlPtr db_reconnect_ctl);
360 
365  static ControlledDhcpv4Srv* server_;
366 
368  isc::asiolink::IOService io_service_;
369 
374  TimerMgrPtr timer_mgr_;
375 };
376 
377 }; // namespace isc::dhcp
378 }; // namespace isc
379 
380 #endif
DHCPv4 server service.
Definition: dhcp4_srv.h:194
void init(const std::string &config_file)
Initializes the server.
isc::data::ConstElementPtr loadConfigFile(const std::string &file_name)
Loads specific config file.
boost::shared_ptr< TimerMgr > TimerMgrPtr
Type definition of the shared pointer to TimerMgr.
Definition: timer_mgr.h:22
isc::data::ConstElementPtr checkConfig(isc::data::ConstElementPtr new_config)
Configuration checker.
static isc::data::ConstElementPtr processConfig(isc::data::ConstElementPtr new_config)
Configuration processor.
static isc::data::ConstElementPtr processCommand(const std::string &command, isc::data::ConstElementPtr args)
Command processor.
ControlledDhcpv4Srv(uint16_t port=DHCP4_SERVER_PORT)
Constructor.
void shutdown()
Initiates shutdown procedure for the whole DHCPv4 server.
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:23
void cleanup()
Performs cleanup, immediately before termination.
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 ...
static ControlledDhcpv4Srv * getInstance()
Returns pointer to the sole instance of Dhcpv4Srv.
Controlled version of the DHCPv4 server.
boost::shared_ptr< ReconnectCtl > ReconnectCtlPtr
Pointer to an instance of ReconnectCtl.