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
15namespace isc {
16namespace ha {
17
21public:
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
103 createLease6Delete(const dhcp::Lease6& lease6);
104
110
122 const uint32_t limit);
123
124private:
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
Holds a collection of functions which generate commands used for High Availability.
static data::ConstElementPtr createLease4Delete(const dhcp::Lease4 &lease4)
Creates lease4-del command.
static data::ConstElementPtr createHeartbeat(const HAServerType &server_type)
Creates ha-heartbeat command for DHCP server.
static data::ConstElementPtr createLease4Update(const dhcp::Lease4 &lease4)
Creates lease4-update command.
static data::ConstElementPtr createDHCPDisable(const unsigned int max_period, const HAServerType &server_type)
Creates dhcp-disable command for DHCP server.
static data::ConstElementPtr createLease6Update(const dhcp::Lease6 &lease6)
Creates lease6-update command.
static data::ConstElementPtr createLease6Delete(const dhcp::Lease6 &lease6)
Creates lease6-del command.
static data::ConstElementPtr createLease4GetAll()
Creates lease4-get-all command.
static data::ConstElementPtr createLease6GetPage(const dhcp::Lease6Ptr &lease6, const uint32_t limit)
Creates lease6-get-page command.
static data::ConstElementPtr createDHCPEnable(const HAServerType &server_type)
Creates dhcp-enable command for DHCP server.
static data::ConstElementPtr createLease6GetAll()
Creates lease6-get-all command.
static data::ConstElementPtr createLease4GetPage(const dhcp::Lease4Ptr &lease4, const uint32_t limit)
Creates lease4-get-page command.
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:23
boost::shared_ptr< Element > ElementPtr
Definition: data.h:22
boost::shared_ptr< Lease6 > Lease6Ptr
Pointer to a Lease6 structure.
Definition: lease.h:463
boost::shared_ptr< Lease4 > Lease4Ptr
Pointer to a Lease4 structure.
Definition: lease.h:248
HAServerType
Lists possible server types for which HA service is created.
Defines the logger used by the top-level component of kea-dhcp-ddns.
Structure that holds a lease for IPv4 address.
Definition: lease.h:256
Structure that holds a lease for IPv6 address and/or prefix.
Definition: lease.h:471