| Kea 3.0.2-git

ha_config.h
Go to the documentation of this file.
1// Copyright (C) 2018-2024 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_CONFIG_H
8#define HA_CONFIG_H
9
10#include <ha_relationship_mapper.h>
11#include <asiolink/crypto_tls.h>
12#include <dhcpsrv/subnet.h>
13#include <exceptions/exceptions.h>
14#include <http/basic_auth.h>
15#include <http/post_request_json.h>
16#include <http/url.h>
17#include <util/optional.h>
18#include <util/state_model.h>
19#include <boost/shared_ptr.hpp>
20#include <cstdint>
21#include <map>
22#include <string>
23
24 namespace isc {
25 namespace ha {
26
28 class HAConfigValidationError : public Exception {
29 public:
30 HAConfigValidationError(const char* file, size_t line, const char* what) :
31 isc::Exception(file, line, what) { }
32};
33
34 class HAConfig;
35
37 typedef boost::shared_ptr<HAConfig> HAConfigPtr;
38
40 typedef HARelationshipMapper<HAConfig> HAConfigMapper;
41
43 typedef boost::shared_ptr<HAConfigMapper> HAConfigMapperPtr;
44
46 class HAConfig {
47 public:
48
55 enum HAMode {
56 LOAD_BALANCING,
57 HOT_STANDBY,
58 PASSIVE_BACKUP
59 };
60
66 class PeerConfig {
67 public:
68
83 enum Role {
84 PRIMARY,
85 SECONDARY,
86 STANDBY,
87 BACKUP
88 };
89
91 PeerConfig();
92
94 std::string getName() const {
95 return (name_);
96 }
97
102 void setName(const std::string& name);
103
105 http::Url getUrl() const {
106 return (url_);
107 }
108
112 void setUrl(const http::Url& url) {
113 url_ = url;
114 }
115
117 util::Optional<std::string> getTrustAnchor() const {
118 return (trust_anchor_);
119 }
120
124 void setTrustAnchor(const util::Optional<std::string>& ca) {
125 trust_anchor_ = ca;
126 }
127
129 util::Optional<std::string> getCertFile() const {
130 return (cert_file_);
131 }
132
136 void setCertFile(const util::Optional<std::string>& cert) {
137 cert_file_ = cert;
138 }
139
141 util::Optional<std::string> getKeyFile() const {
142 return (key_file_);
143 }
144
148 void setKeyFile(const util::Optional<std::string>& key) {
149 key_file_ = key;
150 }
151
153 asiolink::TlsContextPtr getTlsContext() const {
154 return (tls_context_);
155 }
156
162 std::string getLogLabel() const;
163
165 Role getRole() const {
166 return (role_);
167 }
168
178 void setRole(const std::string& role);
179
185 static Role stringToRole(const std::string& role);
186
191 static std::string roleToString(const HAConfig::PeerConfig::Role& role);
192
197 bool isAutoFailover() const {
198 return (auto_failover_);
199 }
200
205 void setAutoFailover(const bool auto_failover) {
206 auto_failover_ = auto_failover;
207 }
208
210 http::BasicHttpAuthPtr& getBasicAuth() {
211 return (basic_auth_);
212 }
213
215 const http::BasicHttpAuthPtr& getBasicAuth() const {
216 return (basic_auth_);
217 }
218
221 void addBasicAuthHttpHeader(http::PostHttpRequestJsonPtr request) const;
222
227 asiolink::TlsContextPtr tls_context_;
228
229 private:
230
231 std::string name_;
232 http::Url url_;
233 util::Optional<std::string> trust_anchor_;
234 util::Optional<std::string> cert_file_;
235 util::Optional<std::string> key_file_;
236 Role role_;
237 bool auto_failover_;
238 http::BasicHttpAuthPtr basic_auth_;
239 };
240
242 typedef boost::shared_ptr<PeerConfig> PeerConfigPtr;
243
245 typedef std::map<std::string, PeerConfigPtr> PeerConfigMap;
246
248 class StateConfig {
249 public:
250
254 explicit StateConfig(const int state);
255
257 int getState() const {
258 return (state_);
259 }
260
262 util::StatePausing getPausing() const {
263 return (pausing_);
264 }
265
270 void setPausing(const std::string& pausing);
271
276 static util::StatePausing stringToPausing(const std::string& pausing);
277
281 static std::string pausingToString(const util::StatePausing& pausing);
282
283 private:
284
286 int state_;
287
289 util::StatePausing pausing_;
290 };
291
293 typedef boost::shared_ptr<StateConfig> StateConfigPtr;
294
300 class StateMachineConfig {
301 public:
302
304 StateMachineConfig()
305 : states_() {
306 }
307
316 StateConfigPtr getStateConfig(const int state);
317
318 private:
319
321 std::map<int, StateConfigPtr> states_;
322 };
323
325 typedef boost::shared_ptr<StateMachineConfig> StateMachineConfigPtr;
326
328 HAConfig();
329
331 static HAConfigPtr create();
332
343 PeerConfigPtr selectNextPeerConfig(const std::string& name);
344
346 std::string getThisServerName() const {
347 return (this_server_name_);
348 }
349
354 void setThisServerName(const std::string& this_server_name);
355
357 HAMode getHAMode() const {
358 return (ha_mode_);
359 }
360
369 void setHAMode(const std::string& ha_mode);
370
376 static HAMode stringToHAMode(const std::string& ha_mode);
377
382 static std::string HAModeToString(const HAMode& ha_mode);
383
386 bool amSendingLeaseUpdates() const {
387 return (send_lease_updates_);
388 }
389
399 void setSendLeaseUpdates(const bool send_lease_updates) {
400 send_lease_updates_ = send_lease_updates;
401 }
402
405 bool amSyncingLeases() const {
406 return (sync_leases_);
407 }
408
418 void setSyncLeases(const bool sync_leases) {
419 sync_leases_ = sync_leases;
420 }
421
425 uint32_t getSyncTimeout() const {
426 return (sync_timeout_);
427 }
428
432 void setSyncTimeout(const uint32_t sync_timeout) {
433 sync_timeout_ = sync_timeout;
434 }
435
440 uint32_t getSyncPageLimit() const {
441 return (sync_page_limit_);
442 }
443
448 void setSyncPageLimit(const uint32_t sync_page_limit) {
449 sync_page_limit_ = sync_page_limit;
450 }
451
464 uint32_t getDelayedUpdatesLimit() const {
465 return (delayed_updates_limit_);
466 }
467
480 void setDelayedUpdatesLimit(const uint32_t delayed_updates_limit) {
481 delayed_updates_limit_ = delayed_updates_limit;
482 }
483
491 bool amAllowingCommRecovery() const {
492 return (delayed_updates_limit_ > 0);
493 }
494
502 uint32_t getHeartbeatDelay() const {
503 return (heartbeat_delay_);
504 }
505
513 void setHeartbeatDelay(const uint32_t heartbeat_delay) {
514 heartbeat_delay_ = heartbeat_delay;
515 }
516
522 uint32_t getMaxResponseDelay() const {
523 return (max_response_delay_);
524 }
525
533 void setMaxResponseDelay(const uint32_t max_response_delay) {
534 max_response_delay_ = max_response_delay;
535 }
536
541 uint32_t getMaxAckDelay() const {
542 return (max_ack_delay_);
543 }
544
549 void setMaxAckDelay(const uint32_t max_ack_delay) {
550 max_ack_delay_ = max_ack_delay;
551 }
552
557 uint32_t getMaxUnackedClients() const {
558 return (max_unacked_clients_);
559 }
560
565 void setMaxUnackedClients(const uint32_t max_unacked_clients) {
566 max_unacked_clients_ = max_unacked_clients;
567 }
568
584 uint32_t getMaxRejectedLeaseUpdates() const {
585 return (max_rejected_lease_updates_);
586 }
587
598 void setMaxRejectedLeaseUpdates(const uint32_t max_rejected_lease_updates) {
599 max_rejected_lease_updates_ = max_rejected_lease_updates;
600 }
601
608 void setWaitBackupAck(const bool wait_backup_ack) {
609 wait_backup_ack_ = wait_backup_ack;
610 }
611
617 bool amWaitingBackupAck() const {
618 return (wait_backup_ack_);
619 }
620
624 bool getEnableMultiThreading() {
625 return (enable_multi_threading_);
626 }
627
632 void setEnableMultiThreading(bool enable_multi_threading) {
633 enable_multi_threading_ = enable_multi_threading;
634 }
635
643 bool getHttpDedicatedListener() {
644 return (http_dedicated_listener_);
645 }
646
652 void setHttpDedicatedListener(bool http_dedicated_listener) {
653 http_dedicated_listener_ = http_dedicated_listener;
654 }
655
659 uint32_t getHttpListenerThreads() {
660 return (http_listener_threads_);
661 }
662
666 void setHttpListenerThreads(uint32_t http_listener_threads) {
667 http_listener_threads_ = http_listener_threads;
668 }
669
673 uint32_t getHttpClientThreads() {
674 return (http_client_threads_);
675 }
676
680 void setHttpClientThreads(uint32_t http_client_threads) {
681 http_client_threads_ = http_client_threads;
682 }
683
685 util::Optional<std::string> getTrustAnchor() const {
686 return (trust_anchor_);
687 }
688
692 void setTrustAnchor(const util::Optional<std::string>& ca) {
693 trust_anchor_ = ca;
694 }
695
697 util::Optional<std::string> getCertFile() const {
698 return (cert_file_);
699 }
700
704 void setCertFile(const util::Optional<std::string>& cert) {
705 cert_file_ = cert;
706 }
707
709 util::Optional<std::string> getKeyFile() const {
710 return (key_file_);
711 }
712
716 void setKeyFile(const util::Optional<std::string>& key) {
717 key_file_ = key;
718 }
719
721 bool getRequireClientCerts() const {
722 return (require_client_certs_);
723 }
724
728 void setRequireClientCerts(bool flag) {
729 require_client_certs_ = flag;
730 }
731
733 bool getRestrictCommands() const {
734 return (restrict_commands_);
735 }
736
740 void setRestrictCommands(bool flag) {
741 restrict_commands_ = flag;
742 }
743
750 PeerConfigPtr getPeerConfig(const std::string& name) const;
751
762 PeerConfigPtr getFailoverPeerConfig() const;
763
767 PeerConfigPtr getThisServerConfig() const;
768
775 PeerConfigMap getOtherServersConfig() const;
776
780 PeerConfigMap getAllServersConfig() const {
781 return (peers_);
782 }
783
787 StateMachineConfigPtr getStateMachineConfig() const {
788 return (state_machine_);
789 }
790
805 void validate();
806
817 static std::string getSubnetServerName(const dhcp::ConstSubnetPtr& subnet);
818
819 std::string this_server_name_;
820 HAMode ha_mode_;
821 bool send_lease_updates_;
822 bool sync_leases_;
823 uint32_t sync_timeout_;
824 uint32_t sync_page_limit_;
826 uint32_t delayed_updates_limit_;
828 uint32_t heartbeat_delay_;
829 uint32_t max_response_delay_;
830 uint32_t max_ack_delay_;
831 uint32_t max_unacked_clients_;
832 uint32_t max_rejected_lease_updates_;
833 bool wait_backup_ack_;
834 bool enable_multi_threading_;
835 bool http_dedicated_listener_;
836 uint32_t http_listener_threads_;
837 uint32_t http_client_threads_;
838 util::Optional<std::string> trust_anchor_;
839 util::Optional<std::string> cert_file_;
840 util::Optional<std::string> key_file_;
841 bool require_client_certs_;
842 bool restrict_commands_;
843 PeerConfigMap peers_;
844 StateMachineConfigPtr state_machine_;
845};
846
847} // end of namespace isc::ha
848} // end of namespace isc
849
850#endif
basic_auth.h
isc::Exception::Exception
Exception(const char *file, size_t line, const char *what)
Constructor for a given type for exceptions with file name and file line number.
Definition exceptions/exceptions.cc:17
isc::Exception::what
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
Definition exceptions/exceptions.cc:32
isc::ha::HAConfigValidationError::HAConfigValidationError
HAConfigValidationError(const char *file, size_t line, const char *what)
Definition ha_config.h:30
isc::ha::HAConfig::PeerConfig::getLogLabel
std::string getLogLabel() const
Returns a string identifying a server used in logging.
Definition ha_config.cc:55
isc::ha::HAConfig::PeerConfig::getRole
Role getRole() const
Returns server's role.
Definition ha_config.h:165
isc::ha::HAConfig::PeerConfig::PeerConfig
PeerConfig()
Constructor.
Definition ha_config.cc:33
isc::ha::HAConfig::PeerConfig::getTrustAnchor
util::Optional< std::string > getTrustAnchor() const
Returns server's trust-anchor.
Definition ha_config.h:117
isc::ha::HAConfig::PeerConfig::setKeyFile
void setKeyFile(const util::Optional< std::string > &key)
Sets server's key-file.
Definition ha_config.h:148
isc::ha::HAConfig::PeerConfig::setAutoFailover
void setAutoFailover(const bool auto_failover)
Enables/disables auto-failover function for the server.
Definition ha_config.h:205
isc::ha::HAConfig::PeerConfig::setUrl
void setUrl(const http::Url &url)
Sets server's URL.
Definition ha_config.h:112
isc::ha::HAConfig::PeerConfig::addBasicAuthHttpHeader
void addBasicAuthHttpHeader(http::PostHttpRequestJsonPtr request) const
Adds a basic HTTP authentication header to a request when credentials are specified.
Definition ha_config.cc:99
isc::ha::HAConfig::PeerConfig::isAutoFailover
bool isAutoFailover() const
Checks if the auto-failover function is enabled for the server.
Definition ha_config.h:197
isc::ha::HAConfig::PeerConfig::getKeyFile
util::Optional< std::string > getKeyFile() const
Returns server's key-file.
Definition ha_config.h:141
isc::ha::HAConfig::PeerConfig::tls_context_
asiolink::TlsContextPtr tls_context_
Server TLS context.
Definition ha_config.h:227
isc::ha::HAConfig::PeerConfig::Role
Role
Server's role in the High Availability setup.
Definition ha_config.h:83
isc::ha::HAConfig::PeerConfig::STANDBY
@ STANDBY
Definition ha_config.h:86
isc::ha::HAConfig::PeerConfig::PRIMARY
@ PRIMARY
Definition ha_config.h:84
isc::ha::HAConfig::PeerConfig::SECONDARY
@ SECONDARY
Definition ha_config.h:85
isc::ha::HAConfig::PeerConfig::BACKUP
@ BACKUP
Definition ha_config.h:87
isc::ha::HAConfig::PeerConfig::setRole
void setRole(const std::string &role)
Sets servers role.
Definition ha_config.cc:50
isc::ha::HAConfig::PeerConfig::getBasicAuth
const http::BasicHttpAuthPtr & getBasicAuth() const
Returns const basic HTTP authentication.
Definition ha_config.h:215
isc::ha::HAConfig::PeerConfig::getName
std::string getName() const
Returns server name.
Definition ha_config.h:94
isc::ha::HAConfig::PeerConfig::getTlsContext
asiolink::TlsContextPtr getTlsContext() const
Returns a pointer to the server's TLS context.
Definition ha_config.h:153
isc::ha::HAConfig::PeerConfig::roleToString
static std::string roleToString(const HAConfig::PeerConfig::Role &role)
Returns role name.
Definition ha_config.cc:82
isc::ha::HAConfig::PeerConfig::stringToRole
static Role stringToRole(const std::string &role)
Decodes role provided as a string.
Definition ha_config.cc:62
isc::ha::HAConfig::PeerConfig::setName
void setName(const std::string &name)
Sets server name.
Definition ha_config.cc:39
isc::ha::HAConfig::PeerConfig::getCertFile
util::Optional< std::string > getCertFile() const
Returns server's cert-file.
Definition ha_config.h:129
isc::ha::HAConfig::PeerConfig::getBasicAuth
http::BasicHttpAuthPtr & getBasicAuth()
Returns non-const basic HTTP authentication.
Definition ha_config.h:210
isc::ha::HAConfig::PeerConfig::getUrl
http::Url getUrl() const
Returns URL of the server's control channel.
Definition ha_config.h:105
isc::ha::HAConfig::PeerConfig::setTrustAnchor
void setTrustAnchor(const util::Optional< std::string > &ca)
Sets server's trust-anchor.
Definition ha_config.h:124
isc::ha::HAConfig::PeerConfig::setCertFile
void setCertFile(const util::Optional< std::string > &cert)
Sets server's cert-file.
Definition ha_config.h:136
isc::ha::HAConfig::StateConfig::getPausing
util::StatePausing getPausing() const
Returns pausing mode for the given state.
Definition ha_config.h:262
isc::ha::HAConfig::StateConfig::getState
int getState() const
Returns identifier of the state.
Definition ha_config.h:257
isc::ha::HAConfig::StateConfig::stringToPausing
static util::StatePausing stringToPausing(const std::string &pausing)
Converts pausing mode from the textual form.
Definition ha_config.cc:117
isc::ha::HAConfig::StateConfig::setPausing
void setPausing(const std::string &pausing)
Sets pausing mode for the given state.
Definition ha_config.cc:112
isc::ha::HAConfig::StateConfig::StateConfig
StateConfig(const int state)
Constructor.
Definition ha_config.cc:107
isc::ha::HAConfig::StateConfig::pausingToString
static std::string pausingToString(const util::StatePausing &pausing)
Returns pausing mode in the textual form.
Definition ha_config.cc:132
isc::ha::HAConfig::StateMachineConfig::getStateConfig
StateConfigPtr getStateConfig(const int state)
Returns pointer to the state specific configuration.
Definition ha_config.cc:151
isc::ha::HAConfig::StateMachineConfig::StateMachineConfig
StateMachineConfig()
Constructor.
Definition ha_config.h:304
isc::ha::HAConfig::max_response_delay_
uint32_t max_response_delay_
Max delay in response to heartbeats.
Definition ha_config.h:829
isc::ha::HAConfig::http_listener_threads_
uint32_t http_listener_threads_
Number of HTTP listener threads.
Definition ha_config.h:836
isc::ha::HAConfig::create
static HAConfigPtr create()
Instantiates a HAConfig.
Definition ha_config.cc:178
isc::ha::HAConfig::sync_page_limit_
uint32_t sync_page_limit_
Page size limit while synchronizing leases.
Definition ha_config.h:824
isc::ha::HAConfig::getHAMode
HAMode getHAMode() const
Returns mode of operation.
Definition ha_config.h:357
isc::ha::HAConfig::getKeyFile
util::Optional< std::string > getKeyFile() const
Returns global key-file.
Definition ha_config.h:709
isc::ha::HAConfig::getThisServerName
std::string getThisServerName() const
Returns name of this server.
Definition ha_config.h:346
isc::ha::HAConfig::setWaitBackupAck
void setWaitBackupAck(const bool wait_backup_ack)
Configures the server to wait/not wait for the lease update acknowledgments from the backup servers.
Definition ha_config.h:608
isc::ha::HAConfig::require_client_certs_
bool require_client_certs_
Require client certs flag.
Definition ha_config.h:841
isc::ha::HAConfig::getDelayedUpdatesLimit
uint32_t getDelayedUpdatesLimit() const
Returns the maximum number of lease updates which can be held unsent in the communication-recovery st...
Definition ha_config.h:464
isc::ha::HAConfig::http_dedicated_listener_
bool http_dedicated_listener_
Enable use of own HTTP listener.
Definition ha_config.h:835
isc::ha::HAConfig::setHttpListenerThreads
void setHttpListenerThreads(uint32_t http_listener_threads)
Sets the number of threads the HTTP listener should use.
Definition ha_config.h:666
isc::ha::HAConfig::setKeyFile
void setKeyFile(const util::Optional< std::string > &key)
Sets global key-file.
Definition ha_config.h:716
isc::ha::HAConfig::getAllServersConfig
PeerConfigMap getAllServersConfig() const
Returns configurations of all servers.
Definition ha_config.h:780
isc::ha::HAConfig::HAMode
HAMode
Mode of operation.
Definition ha_config.h:55
isc::ha::HAConfig::HOT_STANDBY
@ HOT_STANDBY
Definition ha_config.h:57
isc::ha::HAConfig::PASSIVE_BACKUP
@ PASSIVE_BACKUP
Definition ha_config.h:58
isc::ha::HAConfig::LOAD_BALANCING
@ LOAD_BALANCING
Definition ha_config.h:56
isc::ha::HAConfig::validate
void validate()
Validates configuration.
Definition ha_config.cc:283
isc::ha::HAConfig::setHttpDedicatedListener
void setHttpDedicatedListener(bool http_dedicated_listener)
Sets whether or not the server is configured to use its own HTTP listener.
Definition ha_config.h:652
isc::ha::HAConfig::delayed_updates_limit_
uint32_t delayed_updates_limit_
Maximum number of lease updates held for later send in communication-recovery.
Definition ha_config.h:826
isc::ha::HAConfig::getHeartbeatDelay
uint32_t getHeartbeatDelay() const
Returns heartbeat delay in milliseconds.
Definition ha_config.h:502
isc::ha::HAConfig::getThisServerConfig
PeerConfigPtr getThisServerConfig() const
Returns configuration of this server.
Definition ha_config.cc:271
isc::ha::HAConfig::getRequireClientCerts
bool getRequireClientCerts() const
Returns require-client-certs.
Definition ha_config.h:721
isc::ha::HAConfig::setSyncPageLimit
void setSyncPageLimit(const uint32_t sync_page_limit)
Sets new page limit size for leases fetched from the partner during database synchronization.
Definition ha_config.h:448
isc::ha::HAConfig::max_rejected_lease_updates_
uint32_t max_rejected_lease_updates_
Limit of rejected lease updates before termination.
Definition ha_config.h:832
isc::ha::HAConfig::PeerConfigMap
std::map< std::string, PeerConfigPtr > PeerConfigMap
Map of the servers' configurations.
Definition ha_config.h:245
isc::ha::HAConfig::setMaxRejectedLeaseUpdates
void setMaxRejectedLeaseUpdates(const uint32_t max_rejected_lease_updates)
Sets the maximum number of clients for whom the lease updates can fail due to other than general erro...
Definition ha_config.h:598
isc::ha::HAConfig::setMaxUnackedClients
void setMaxUnackedClients(const uint32_t max_unacked_clients)
Set maximum number of clients which may fail to communicate with the DHCP server before entering part...
Definition ha_config.h:565
isc::ha::HAConfig::setTrustAnchor
void setTrustAnchor(const util::Optional< std::string > &ca)
Sets global trust-anchor.
Definition ha_config.h:692
isc::ha::HAConfig::StateMachineConfigPtr
boost::shared_ptr< StateMachineConfig > StateMachineConfigPtr
Pointer to a state machine configuration.
Definition ha_config.h:325
isc::ha::HAConfig::setHAMode
void setHAMode(const std::string &ha_mode)
Sets new mode of operation.
Definition ha_config.cc:213
isc::ha::HAConfig::ha_mode_
HAMode ha_mode_
Mode of operation.
Definition ha_config.h:820
isc::ha::HAConfig::send_lease_updates_
bool send_lease_updates_
Send lease updates to partner?
Definition ha_config.h:821
isc::ha::HAConfig::getMaxUnackedClients
uint32_t getMaxUnackedClients() const
Returns maximum number of clients which may fail to communicate with the DHCP server before entering ...
Definition ha_config.h:557
isc::ha::HAConfig::getHttpListenerThreads
uint32_t getHttpListenerThreads()
Fetches the number of threads the HTTP listener should use.
Definition ha_config.h:659
isc::ha::HAConfig::amSendingLeaseUpdates
bool amSendingLeaseUpdates() const
Returns boolean flag indicating whether lease updates should be sent to the partner.
Definition ha_config.h:386
isc::ha::HAConfig::setRequireClientCerts
void setRequireClientCerts(bool flag)
Sets require-client-certs.
Definition ha_config.h:728
isc::ha::HAConfig::setMaxResponseDelay
void setMaxResponseDelay(const uint32_t max_response_delay)
Sets new max response delay.
Definition ha_config.h:533
isc::ha::HAConfig::getRestrictCommands
bool getRestrictCommands() const
Returns restrict-commands.
Definition ha_config.h:733
isc::ha::HAConfig::setHttpClientThreads
void setHttpClientThreads(uint32_t http_client_threads)
Sets the number of threads the HTTP client should use.
Definition ha_config.h:680
isc::ha::HAConfig::setSyncLeases
void setSyncLeases(const bool sync_leases)
Sets boolean flag indicating whether the active servers should synchronize their lease databases upon...
Definition ha_config.h:418
isc::ha::HAConfig::max_unacked_clients_
uint32_t max_unacked_clients_
Maximum number of unacked clients.
Definition ha_config.h:831
isc::ha::HAConfig::setMaxAckDelay
void setMaxAckDelay(const uint32_t max_ack_delay)
Sets maximum time for a client trying to communicate with DHCP server to completed the transaction.
Definition ha_config.h:549
isc::ha::HAConfig::peers_
PeerConfigMap peers_
Map of peers' configurations.
Definition ha_config.h:843
isc::ha::HAConfig::amAllowingCommRecovery
bool amAllowingCommRecovery() const
Convenience function checking if communication recovery is allowed.
Definition ha_config.h:491
isc::ha::HAConfig::max_ack_delay_
uint32_t max_ack_delay_
Maximum DHCP message ack delay.
Definition ha_config.h:830
isc::ha::HAConfig::cert_file_
util::Optional< std::string > cert_file_
Certificate file.
Definition ha_config.h:839
isc::ha::HAConfig::getSyncTimeout
uint32_t getSyncTimeout() const
Returns timeout for lease database synchronization.
Definition ha_config.h:425
isc::ha::HAConfig::amSyncingLeases
bool amSyncingLeases() const
Returns boolean flag indicating whether the active servers should synchronize their lease databases u...
Definition ha_config.h:405
isc::ha::HAConfig::amWaitingBackupAck
bool amWaitingBackupAck() const
Checks if the server is configured to wait for the acknowledgments to the lease updates from the back...
Definition ha_config.h:617
isc::ha::HAConfig::setHeartbeatDelay
void setHeartbeatDelay(const uint32_t heartbeat_delay)
Sets new heartbeat delay in milliseconds.
Definition ha_config.h:513
isc::ha::HAConfig::getMaxResponseDelay
uint32_t getMaxResponseDelay() const
Returns max response delay.
Definition ha_config.h:522
isc::ha::HAConfig::restrict_commands_
bool restrict_commands_
Restrict commands to HA flag.
Definition ha_config.h:842
isc::ha::HAConfig::setThisServerName
void setThisServerName(const std::string &this_server_name)
Sets name of this server.
Definition ha_config.cc:201
isc::ha::HAConfig::getOtherServersConfig
PeerConfigMap getOtherServersConfig() const
Returns configuration of other servers.
Definition ha_config.cc:276
isc::ha::HAConfig::setSendLeaseUpdates
void setSendLeaseUpdates(const bool send_lease_updates)
Sets boolean flag indicating whether lease updates should be sent to the partner.
Definition ha_config.h:399
isc::ha::HAConfig::setSyncTimeout
void setSyncTimeout(const uint32_t sync_timeout)
Sets new lease database syncing timeout in milliseconds.
Definition ha_config.h:432
isc::ha::HAConfig::getFailoverPeerConfig
PeerConfigPtr getFailoverPeerConfig() const
Returns configuration of the partner which takes part in failover.
Definition ha_config.cc:258
isc::ha::HAConfig::getPeerConfig
PeerConfigPtr getPeerConfig(const std::string &name) const
Returns configuration of the specified server.
Definition ha_config.cc:248
isc::ha::HAConfig::key_file_
util::Optional< std::string > key_file_
Private key file.
Definition ha_config.h:840
isc::ha::HAConfig::getCertFile
util::Optional< std::string > getCertFile() const
Returns global cert-file.
Definition ha_config.h:697
isc::ha::HAConfig::selectNextPeerConfig
PeerConfigPtr selectNextPeerConfig(const std::string &name)
Creates and returns pointer to the new peer's configuration.
Definition ha_config.cc:183
isc::ha::HAConfig::setRestrictCommands
void setRestrictCommands(bool flag)
Sets restrict-commands.
Definition ha_config.h:740
isc::ha::HAConfig::getMaxRejectedLeaseUpdates
uint32_t getMaxRejectedLeaseUpdates() const
Returns a maximum number of clients for whom lease updates failed due to other than general error.
Definition ha_config.h:584
isc::ha::HAConfig::sync_leases_
bool sync_leases_
Synchronize databases on startup?
Definition ha_config.h:822
isc::ha::HAConfig::wait_backup_ack_
bool wait_backup_ack_
Wait for lease update ack from backup?
Definition ha_config.h:833
isc::ha::HAConfig::getMaxAckDelay
uint32_t getMaxAckDelay() const
Returns maximum time for a client trying to communicate with DHCP server to complete the transaction.
Definition ha_config.h:541
isc::ha::HAConfig::state_machine_
StateMachineConfigPtr state_machine_
State machine configuration.
Definition ha_config.h:844
isc::ha::HAConfig::HAConfig
HAConfig()
Constructor.
Definition ha_config.cc:165
isc::ha::HAConfig::trust_anchor_
util::Optional< std::string > trust_anchor_
Trust anchor.
Definition ha_config.h:838
isc::ha::HAConfig::stringToHAMode
static HAMode stringToHAMode(const std::string &ha_mode)
Decodes HA mode provided as string.
Definition ha_config.cc:218
isc::ha::HAConfig::setCertFile
void setCertFile(const util::Optional< std::string > &cert)
Sets global cert-file.
Definition ha_config.h:704
isc::ha::HAConfig::setDelayedUpdatesLimit
void setDelayedUpdatesLimit(const uint32_t delayed_updates_limit)
Sets new limit for the number of lease updates to be held unsent in the communication-recovery state.
Definition ha_config.h:480
isc::ha::HAConfig::getStateMachineConfig
StateMachineConfigPtr getStateMachineConfig() const
Returns state machine configuration.
Definition ha_config.h:787
isc::ha::HAConfig::getHttpClientThreads
uint32_t getHttpClientThreads()
Fetches the number of threads the HTTP client should use.
Definition ha_config.h:673
isc::ha::HAConfig::http_client_threads_
uint32_t http_client_threads_
Number of HTTP client threads.
Definition ha_config.h:837
isc::ha::HAConfig::getTrustAnchor
util::Optional< std::string > getTrustAnchor() const
Returns global trust-anchor.
Definition ha_config.h:685
isc::ha::HAConfig::sync_timeout_
uint32_t sync_timeout_
Timeout for syncing lease database (ms).
Definition ha_config.h:823
isc::ha::HAConfig::StateConfigPtr
boost::shared_ptr< StateConfig > StateConfigPtr
Pointer to the state configuration.
Definition ha_config.h:293
isc::ha::HAConfig::enable_multi_threading_
bool enable_multi_threading_
Enable multi-threading.
Definition ha_config.h:834
isc::ha::HAConfig::heartbeat_delay_
uint32_t heartbeat_delay_
Heartbeat delay in milliseconds.
Definition ha_config.h:828
isc::ha::HAConfig::getSyncPageLimit
uint32_t getSyncPageLimit() const
Returns maximum number of leases per page to be fetched during database synchronization.
Definition ha_config.h:440
isc::ha::HAConfig::getSubnetServerName
static std::string getSubnetServerName(const dhcp::ConstSubnetPtr &subnet)
Convenience function extracting a value of the ha-server-name parameter from a subnet context.
Definition ha_config.cc:524
isc::ha::HAConfig::HAModeToString
static std::string HAModeToString(const HAMode &ha_mode)
Returns HA mode name.
Definition ha_config.cc:233
isc::ha::HAConfig::getEnableMultiThreading
bool getEnableMultiThreading()
Checks if the server is configured for multi-threaded operation.
Definition ha_config.h:624
isc::ha::HAConfig::this_server_name_
std::string this_server_name_
This server name.
Definition ha_config.h:819
isc::ha::HAConfig::setEnableMultiThreading
void setEnableMultiThreading(bool enable_multi_threading)
Sets whether or not server is configured for multi-threaded operation.
Definition ha_config.h:632
isc::ha::HAConfig::getHttpDedicatedListener
bool getHttpDedicatedListener()
Checks if the server is configured to use its own HTTP listener.
Definition ha_config.h:643
isc::ha::HAConfig::PeerConfigPtr
boost::shared_ptr< PeerConfig > PeerConfigPtr
Pointer to the server's configuration.
Definition ha_config.h:242
isc::ha::HARelationshipMapper
Holds associations between objects and HA relationships.
Definition ha_relationship_mapper.h:33
isc::http::Url
Represents an URL.
Definition url.h:20
isc::util::Optional
A template representing an optional value.
Definition optional.h:36
crypto_tls.h
TLS API.
exceptions.h
ha_relationship_mapper.h
isc::asiolink::TlsContextPtr
boost::shared_ptr< TlsContext > TlsContextPtr
The type of shared pointers to TlsContext objects.
Definition common_tls.h:37
isc::dhcp::ConstSubnetPtr
boost::shared_ptr< const Subnet > ConstSubnetPtr
A generic pointer to either const Subnet4 or const Subnet6 object.
Definition subnet.h:452
isc::ha
Definition command_creator.cc:20
isc::ha::HAConfigMapperPtr
boost::shared_ptr< HAConfigMapper > HAConfigMapperPtr
Pointer to an object mapping HAConfig to relationships.
Definition ha_config.h:43
isc::ha::HAConfigMapper
HARelationshipMapper< HAConfig > HAConfigMapper
Type of an object mapping HAConfig to relationships.
Definition ha_config.h:40
isc::ha::HAConfigPtr
boost::shared_ptr< HAConfig > HAConfigPtr
Pointer to the High Availability configuration structure.
Definition ha_config.h:37
isc::http::BasicHttpAuthPtr
boost::shared_ptr< BasicHttpAuth > BasicHttpAuthPtr
Type of pointers to basic HTTP authentication objects.
Definition basic_auth.h:70
isc::http::PostHttpRequestJsonPtr
boost::shared_ptr< PostHttpRequestJson > PostHttpRequestJsonPtr
Pointer to PostHttpRequestJson.
Definition post_request_json.h:29
isc::util::StatePausing
StatePausing
State machine pausing modes.
Definition state_model.h:45
isc
Defines the logger used by the top-level component of kea-lfc.
Definition agent_parser.cc:148
optional.h
post_request_json.h
state_model.h
This file defines the class StateModel.
subnet.h
url.h