![]() |
Kea
1.5.0
|
Holds communication state between DHCPv6 servers. More...
#include <communication_state.h>
Inheritance diagram for isc::ha::CommunicationState6:Public Member Functions | |
| CommunicationState6 (const asiolink::IOServicePtr &io_service, const HAConfigPtr &config) | |
| Constructor. More... | |
| virtual void | analyzeMessage (const boost::shared_ptr< dhcp::Pkt > &message) |
| Checks if the DHCPv6 message appears to be unanswered. More... | |
| virtual bool | failureDetected () const |
| Checks if the partner failure has been detected based on the DHCP traffic analysis. More... | |
Public Member Functions inherited from isc::ha::CommunicationState | |
| CommunicationState (const asiolink::IOServicePtr &io_service, const HAConfigPtr &config) | |
| Constructor. More... | |
| virtual | ~CommunicationState () |
| Destructor. More... | |
| bool | clockSkewShouldTerminate () const |
| Indicates whether the HA service should enter "terminated" state as a result of the clock skew exceeding maximum value. More... | |
| bool | clockSkewShouldWarn () |
| Indicates whether the HA service should issue a warning about high clock skew between the active servers. More... | |
| int64_t | getDurationInMillisecs () const |
| Returns duration between the poke time and current time. More... | |
| int | getPartnerState () const |
| Returns last known state of the partner. More... | |
| bool | isCommunicationInterrupted () const |
| Checks if communication with the partner is interrupted. More... | |
| bool | isHeartbeatRunning () const |
| Checks if recurring heartbeat is running. More... | |
| std::string | logFormatClockSkew () const |
| Returns current clock skew value in the logger friendly format. More... | |
| void | poke () |
| Pokes the communication state. More... | |
| void | setPartnerState (const std::string &state) |
| Sets partner state. More... | |
| void | setPartnerTime (const std::string &time_text) |
| Provide partner's notion of time so the new clock skew can be calculated. More... | |
| void | startHeartbeat (const long interval, const boost::function< void()> &heartbeat_impl) |
| Starts recurring heartbeat (public interface). More... | |
| void | stopHeartbeat () |
| Stops recurring heartbeat. More... | |
Protected Member Functions | |
| virtual void | clearUnackedClients () |
| Removes information about clients which the partner server failed to respond to. More... | |
Protected Member Functions inherited from isc::ha::CommunicationState | |
| bool | isClockSkewGreater (const long seconds) const |
| Checks if the clock skew is greater than the specified number of seconds. More... | |
| void | startHeartbeatInternal (const long interval=0, const boost::function< void()> &heartbeat_impl=0) |
| Starts recurring heartbeat. More... | |
Protected Attributes | |
| std::set< std::vector< uint8_t > > | unacked_clients_ |
| Holds information about the clients which the partner server failed to respond to. More... | |
Protected Attributes inherited from isc::ha::CommunicationState | |
| boost::posix_time::time_duration | clock_skew_ |
| Clock skew between the active servers. More... | |
| HAConfigPtr | config_ |
| High availability configuration. More... | |
| boost::function< void()> | heartbeat_impl_ |
| Pointer to the function providing heartbeat implementation. More... | |
| long | interval_ |
| Interval specified for the heartbeat. More... | |
| asiolink::IOServicePtr | io_service_ |
| Pointer to the common IO service instance. More... | |
| boost::posix_time::ptime | last_clock_skew_warn_ |
| Holds a time when last warning about too high clock skew was issued. More... | |
| int | partner_state_ |
| Last known state of the partner server. More... | |
| boost::posix_time::ptime | poke_time_ |
| Last poke time. More... | |
| asiolink::IntervalTimerPtr | timer_ |
| Interval timer triggering heartbeat commands. More... | |
Holds communication state between DHCPv6 servers.
This class implements DHCPv6 failure detection by monitoring the value of the "Elapsed Time" option in received DHCPv6 messages as described in CommunicationState::analyzeMessage.
Definition at line 389 of file communication_state.h.
| isc::ha::CommunicationState6::CommunicationState6 | ( | const asiolink::IOServicePtr & | io_service, |
| const HAConfigPtr & | config | ||
| ) |
Constructor.
| io_service | pointer to the common IO service instance. |
| config | pointer to the HA configuration. |
Definition at line 310 of file communication_state.cc.
|
virtual |
Checks if the DHCPv6 message appears to be unanswered.
See CommunicationState::analyzeMessage for details.
| message | DHCPv6 message to be analyzed. This must be the message which belongs to the partner, i.e. the caller must filter out messages belonging to the partner prior to calling this method. |
Implements isc::ha::CommunicationState.
Definition at line 316 of file communication_state.cc.
References isc::ha::CommunicationState::config_, D6O_CLIENTID, D6O_ELAPSED_TIME, isc::dhcp::Option::getOption(), isc_throw, and unacked_clients_.
Here is the call graph for this function:
|
protectedvirtual |
Removes information about clients which the partner server failed to respond to.
See CommunicationState::analyzeMessage for details.
Implements isc::ha::CommunicationState.
Definition at line 347 of file communication_state.cc.
References unacked_clients_.
|
virtual |
Checks if the partner failure has been detected based on the DHCP traffic analysis.
Implements isc::ha::CommunicationState.
Definition at line 341 of file communication_state.cc.
References isc::ha::CommunicationState::config_, and unacked_clients_.
|
protected |
Holds information about the clients which the partner server failed to respond to.
The value of the set holds DUIDs of the clients.
Definition at line 428 of file communication_state.h.
Referenced by analyzeMessage(), clearUnackedClients(), and failureDetected().