Kea 2.7.5
|
Holds a collection of functions which generate commands used for High Availability. More...
#include <command_creator.h>
Static Public Member Functions | |
static data::ConstElementPtr | createDHCPDisable (const unsigned int origin_id, const unsigned int max_period, const HAServerType &server_type) |
Creates dhcp-disable command for DHCP server. | |
static data::ConstElementPtr | createDHCPEnable (const unsigned int origin_id, const HAServerType &server_type) |
Creates dhcp-enable command for DHCP server. | |
static data::ConstElementPtr | createHAReset (const std::string &server_name, const HAServerType &server_type) |
Creates ha-reset command. | |
static data::ConstElementPtr | createHeartbeat (const std::string &server_name, const HAServerType &server_type) |
Creates ha-heartbeat command for DHCP server. | |
static data::ConstElementPtr | createLease4Delete (const dhcp::Lease4 &lease4) |
Creates lease4-del command. | |
static data::ConstElementPtr | createLease4GetAll () |
Creates lease4-get-all command. | |
static data::ConstElementPtr | createLease4GetPage (const dhcp::Lease4Ptr &lease4, const uint32_t limit) |
Creates lease4-get-page command. | |
static data::ConstElementPtr | createLease4Update (const dhcp::Lease4 &lease4) |
Creates lease4-update command. | |
static data::ConstElementPtr | createLease6BulkApply (const dhcp::Lease6CollectionPtr &leases, const dhcp::Lease6CollectionPtr &deleted_leases) |
Creates lease6-bulk-apply command. | |
static data::ConstElementPtr | createLease6BulkApply (LeaseUpdateBacklog &leases) |
Creates lease6-bulk-apply command. | |
static data::ConstElementPtr | createLease6Delete (const dhcp::Lease6 &lease6) |
Creates lease6-del command. | |
static data::ConstElementPtr | createLease6GetAll () |
Creates lease6-get-all command. | |
static data::ConstElementPtr | createLease6GetPage (const dhcp::Lease6Ptr &lease6, const uint32_t limit) |
Creates lease6-get-page command. | |
static data::ConstElementPtr | createLease6Update (const dhcp::Lease6 &lease6) |
Creates lease6-update command. | |
static data::ConstElementPtr | createMaintenanceNotify (const std::string &server_name, const bool cancel, const HAServerType &server_type) |
Creates ha-maintenance-notify command. | |
static data::ConstElementPtr | createSyncCompleteNotify (const unsigned int origin_id, const std::string &server_name, const HAServerType &server_type) |
Creates ha-sync-complete-notify command. | |
Static Public Attributes | |
static std::unordered_set< std::string > | ha_commands4_ |
List of commands used by the High Availability in v4. | |
static std::unordered_set< std::string > | ha_commands6_ |
List of commands used by the High Availability in v6. | |
Holds a collection of functions which generate commands used for High Availability.
Definition at line 22 of file command_creator.h.
|
static |
Creates dhcp-disable command for DHCP server.
origin_id | A numeric value of the origin created from the HAService identifier. |
max_period | The max-period time the service can stay disabled before automatically transitioning to enabled state. |
server_type | type of the DHCP server, i.e. v4 or v6. |
Definition at line 41 of file command_creator.cc.
References isc::data::Element::create(), isc::config::createCommand(), and isc::data::Element::createMap().
|
static |
Creates dhcp-enable command for DHCP server.
origin_id | A numeric value of the origin created from the HAService identifier. |
server_type | type of the DHCP server, i.e. v4 or v6. |
Definition at line 59 of file command_creator.cc.
References isc::data::Element::create(), isc::config::createCommand(), and isc::data::Element::createMap().
|
static |
Creates ha-reset command.
server_name | name of the server sending the command allowing for associating the command with the relationship. |
server_type | type of the DHCP server, i.e. v4 or v6. |
Definition at line 72 of file command_creator.cc.
References isc::data::Element::create(), isc::config::createCommand(), and isc::data::Element::createMap().
|
static |
Creates ha-heartbeat command for DHCP server.
server_name | name of the server sending the command allowing for associating the command with the relationship. |
server_type | type of the DHCP server, i.e. v4 or v6. |
Definition at line 82 of file command_creator.cc.
References isc::data::Element::create(), isc::config::createCommand(), and isc::data::Element::createMap().
|
static |
Creates lease4-del command.
lease4 | Reference to a lease for which the command should be created. |
Definition at line 103 of file command_creator.cc.
References isc::data::Element::create(), isc::config::createCommand(), and isc::ha::DHCPv4.
Referenced by isc::ha::HAService::asyncSendLeaseUpdates().
|
static |
Creates lease4-get-all command.
Definition at line 113 of file command_creator.cc.
References isc::config::createCommand(), and isc::ha::DHCPv4.
|
static |
Creates lease4-get-page command.
lease4 | Pointer to the last lease returned on the previous page of leases. This lease is used to set the value of the "from" parameter in the lease4-get-page command. If this command is sent to fetch the first page, the lease4 parameter should be set to null. |
limit | Limit of leases on the page. |
Definition at line 120 of file command_creator.cc.
References isc::data::Element::create(), isc::config::createCommand(), isc::data::Element::createMap(), isc::ha::DHCPv4, and isc_throw.
|
static |
Creates lease4-update command.
It adds "force-create" parameter to the lease information to force the remote server to create the lease if it doesn't exist in its lease database.
lease4 | Reference to a lease for which the command should be created. |
Definition at line 92 of file command_creator.cc.
References isc::data::Element::create(), isc::config::createCommand(), and isc::ha::DHCPv4.
Referenced by isc::ha::HAService::asyncSendLeaseUpdates().
|
static |
Creates lease6-bulk-apply command.
leases | Pointer to the collection of leases to be created or/and updated. |
deleted_leases | Pointer to the collection of leases to be deleted. |
Definition at line 145 of file command_creator.cc.
References isc::data::Element::create(), isc::config::createCommand(), isc::data::Element::createList(), isc::data::Element::createMap(), and isc::ha::DHCPv6.
Referenced by isc::ha::HAService::asyncSendLeaseUpdates().
|
static |
Creates lease6-bulk-apply command.
This command pops the leases from the backlog. As a result, the backlog is empty after calling this function.
leases | Reference to the collection of DHCPv6 leases backlog. |
Definition at line 180 of file command_creator.cc.
References isc::data::Element::create(), isc::config::createCommand(), isc::data::Element::createList(), isc::data::Element::createMap(), isc::ha::LeaseUpdateBacklog::DELETE, and isc::ha::DHCPv6.
|
static |
Creates lease6-del command.
lease6 | Reference to a lease for which the command should be created. |
Definition at line 218 of file command_creator.cc.
References isc::data::Element::create(), isc::config::createCommand(), and isc::ha::DHCPv6.
|
static |
Creates lease6-get-all command.
Definition at line 228 of file command_creator.cc.
References isc::config::createCommand(), and isc::ha::DHCPv6.
|
static |
Creates lease6-get-page command.
lease6 | Pointer to the last lease returned on the previous page of leases. This lease is used to set the value of the "from" parameter in the lease6-get-page command. If this command is sent to fetch the first page, the lease6 parameter should be set to null. |
limit | Limit of leases on the page. |
Definition at line 235 of file command_creator.cc.
References isc::data::Element::create(), isc::config::createCommand(), isc::data::Element::createMap(), isc::ha::DHCPv6, and isc_throw.
|
static |
Creates lease6-update command.
It adds "force-create" parameter to the lease information to force the remote server to create the lease if it doesn't exist in its lease database.
lease6 | Reference to a lease for which the command should be created. |
Definition at line 207 of file command_creator.cc.
References isc::data::Element::create(), isc::config::createCommand(), and isc::ha::DHCPv6.
|
static |
Creates ha-maintenance-notify command.
server_name | name of the server sending the command allowing for associating the command with the relationship. |
cancel | boolean value indicating if the maintenance is being cancelled (true) or requested (false). |
server_type | type of the DHCP server, i.e. v4 or v6. |
Definition at line 260 of file command_creator.cc.
References isc::data::Element::create(), isc::config::createCommand(), and isc::data::Element::createMap().
|
static |
Creates ha-sync-complete-notify command.
origin_id | a numeric value of the origin created from the HAService identifier to enable the DHCP service. |
server_name | name of the server sending the command allowing for associating the command with the relationship. |
server_type | type of the DHCP server, i.e. v4 or v6. |
Definition at line 272 of file command_creator.cc.
References isc::data::Element::create(), isc::config::createCommand(), and isc::data::Element::createMap().
|
static |
List of commands used by the High Availability in v4.
Definition at line 200 of file command_creator.h.
Referenced by isc::ha::HAService::HAService().
|
static |
List of commands used by the High Availability in v6.
Definition at line 203 of file command_creator.h.
Referenced by isc::ha::HAService::HAService().