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
11#include <asiolink/asiolink.h>
12#include <cc/data.h>
15#include <dhcpsrv/timer_mgr.h>
16#include <dhcp4/dhcp4_srv.h>
17
18namespace isc {
19namespace dhcp {
20
26public:
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
123private:
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
Controlled version of the DHCPv4 server.
static isc::data::ConstElementPtr processConfig(isc::data::ConstElementPtr new_config)
Configuration processor.
void shutdown()
Initiates shutdown procedure for the whole DHCPv4 server.
isc::data::ConstElementPtr loadConfigFile(const std::string &file_name)
Loads specific config file.
void cleanup()
Performs cleanup, immediately before termination.
static isc::data::ConstElementPtr processCommand(const std::string &command, isc::data::ConstElementPtr args)
Command processor.
void init(const std::string &config_file)
Initializes the server.
static ControlledDhcpv4Srv * getInstance()
Returns pointer to the sole instance of Dhcpv4Srv.
isc::data::ConstElementPtr checkConfig(isc::data::ConstElementPtr new_config)
Configuration checker.
DHCPv4 server service.
Definition: dhcp4_srv.h:194
This file contains several functions and constants that are used for handling commands and responses ...
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:23
boost::shared_ptr< ReconnectCtl > ReconnectCtlPtr
Pointer to an instance of ReconnectCtl.
boost::shared_ptr< TimerMgr > TimerMgrPtr
Type definition of the shared pointer to TimerMgr.
Definition: timer_mgr.h:25
Defines the logger used by the top-level component of kea-dhcp-ddns.