Kea  1.5.0
command_creator.h
Go to the documentation of this file.
1 // Copyright (C) 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 HA_COMMAND_CREATOR_H
8 #define HA_COMMAND_CREATOR_H
9 
10 #include <ha_server_type.h>
11 #include <cc/data.h>
12 #include <dhcpsrv/lease.h>
13 #include <string>
14 
15 namespace isc {
16 namespace ha {
17 
21 public:
22 
27  createDHCPDisable(const unsigned int max_period,
28  const HAServerType& server_type);
29 
34  createDHCPEnable(const HAServerType& server_type);
35 
40  createHeartbeat(const HAServerType& server_type);
41 
53  createLease4Update(const dhcp::Lease4& lease4);
54 
62  createLease4Delete(const dhcp::Lease4& lease4);
63 
69 
81  const uint32_t limit);
82 
94  createLease6Update(const dhcp::Lease6& lease6);
95 
102  static data::ConstElementPtr
103  createLease6Delete(const dhcp::Lease6& lease6);
104 
108  static data::ConstElementPtr
110 
120  static data::ConstElementPtr
121  createLease6GetPage(const dhcp::Lease6Ptr& lease6,
122  const uint32_t limit);
123 
124 private:
125 
137  static void insertLeaseExpireTime(data::ElementPtr& lease);
138 
156  static void
157  insertService(data::ConstElementPtr& command,
158  const HAServerType& server_type);
159 };
160 
161 } // end of namespace ha
162 } // end of namespace isc
163 
164 #endif
isc::dhcp::Lease4Ptr
boost::shared_ptr< Lease4 > Lease4Ptr
Pointer to a Lease4 structure.
Definition: lease.h:245
isc::dhcp::Lease6Ptr
boost::shared_ptr< Lease6 > Lease6Ptr
Pointer to a Lease6 structure.
Definition: lease.h:460
isc::ha::CommandCreator
Holds a collection of functions which generate commands used for High Availability.
Definition: command_creator.h:20
ha_server_type.h
isc::ha::CommandCreator::createLease4GetAll
static data::ConstElementPtr createLease4GetAll()
Creates lease4-get-all command.
Definition: command_creator.cc:68
isc::ha::CommandCreator::createHeartbeat
static data::ConstElementPtr createHeartbeat(const HAServerType &server_type)
Creates ha-heartbeat command for DHCP server.
Definition: command_creator.cc:42
isc
Defines the logger used by the top-level component of kea-dhcp-ddns.
Definition: agent_parser.cc:144
isc::ha::CommandCreator::createLease4Update
static data::ConstElementPtr createLease4Update(const dhcp::Lease4 &lease4)
Creates lease4-update command.
Definition: command_creator.cc:49
isc::dhcp::Lease6
Structure that holds a lease for IPv6 address and/or prefix.
Definition: lease.h:471
isc::ha::CommandCreator::createDHCPDisable
static data::ConstElementPtr createDHCPDisable(const unsigned int max_period, const HAServerType &server_type)
Creates dhcp-disable command for DHCP server.
Definition: command_creator.cc:21
isc::ha::CommandCreator::createLease4Delete
static data::ConstElementPtr createLease4Delete(const dhcp::Lease4 &lease4)
Creates lease4-del command.
Definition: command_creator.cc:59
isc::ha::HAServerType
HAServerType
Lists possible server types for which HA service is created.
Definition: ha_server_type.h:14
isc::ha::CommandCreator::createLease6Delete
static data::ConstElementPtr createLease6Delete(const dhcp::Lease6 &lease6)
Creates lease6-del command.
Definition: command_creator.cc:110
data.h
isc::ha::CommandCreator::createLease6GetPage
static data::ConstElementPtr createLease6GetPage(const dhcp::Lease6Ptr &lease6, const uint32_t limit)
Creates lease6-get-page command.
Definition: command_creator.cc:126
isc::data::ElementPtr
boost::shared_ptr< Element > ElementPtr
Definition: data.h:20
isc::data::ConstElementPtr
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:23
lease.h
isc::ha::CommandCreator::createLease4GetPage
static data::ConstElementPtr createLease4GetPage(const dhcp::Lease4Ptr &lease4, const uint32_t limit)
Creates lease4-get-page command.
Definition: command_creator.cc:75
isc::ha::CommandCreator::createLease6Update
static data::ConstElementPtr createLease6Update(const dhcp::Lease6 &lease6)
Creates lease6-update command.
Definition: command_creator.cc:100
isc::ha::CommandCreator::createLease6GetAll
static data::ConstElementPtr createLease6GetAll()
Creates lease6-get-all command.
Definition: command_creator.cc:119
isc::ha::CommandCreator::createDHCPEnable
static data::ConstElementPtr createDHCPEnable(const HAServerType &server_type)
Creates dhcp-enable command for DHCP server.
Definition: command_creator.cc:35
isc::dhcp::Lease4
Structure that holds a lease for IPv4 address.
Definition: lease.h:256