CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
26 #include <unordered_set>
29 namespace catapult {
namespace ionet {
31 #define NODE_SOURCE_LIST \
33 ENUM_VALUE(Dynamic_Incoming) \
44 #define ENUM_VALUE(LABEL) LABEL,
85 using ServiceIdentifiers = std::unordered_set<ServiceIdentifier, utils::BaseValueHasher<ServiceIdentifier>>;
NodeSource m_source
Definition: NodeInfo.h:131
std::unordered_set< ServiceIdentifier, utils::BaseValueHasher< ServiceIdentifier > > ServiceIdentifiers
A container of service identifiers.
Definition: NodeInfo.h:85
Connection state unique to a node and connection identifier.
Definition: NodeInfo.h:59
utils::BaseValue< uint32_t, ServiceIdentifier_tag > ServiceIdentifier
Definition: NodeInfo.h:56
void incrementFailures(Timestamp timestamp)
Increments the number of failed interactions at timestamp.
Definition: NodeInfo.cpp:86
uint32_t NumConsecutiveFailures
Number of consecutive failed connections.
Definition: NodeInfo.h:74
Node interactions container.
Definition: NodeInteractionsContainer.h:50
NodeInteractions interactions(Timestamp timestamp) const
Gets the node interactions at timestamp.
Definition: NodeInfo.cpp:51
uint32_t BanAge
Definition: NodeInfo.h:78
Information about a node and its interactions.
Definition: NodeInfo.h:82
std::vector< std::pair< ServiceIdentifier, ConnectionState > > m_connectionStates
Definition: NodeInfo.h:133
void incrementSuccesses(Timestamp timestamp)
Increments the number of successful interactions at timestamp.
Definition: NodeInfo.cpp:81
ConnectionState & provisionConnectionState(ServiceIdentifier serviceId)
Gets connection state for the service identified by serviceId and creates zeroed state if no state ex...
Definition: NodeInfo.cpp:91
NodeSource source() const
Gets the node source.
Definition: NodeInfo.cpp:47
size_t numConnectionStates() const
Gets the number of connection states.
Definition: NodeInfo.cpp:55
const ConnectionState * getConnectionState(ServiceIdentifier serviceId) const
Gets connection state for the service identified by serviceId or nullptr if no state exists.
Definition: NodeInfo.cpp:73
void pruneBuckets(Timestamp timestamp)
Prunes buckets at timestamp.
Definition: NodeInteractionsContainer.cpp:64
bool hasActiveConnection() const
Returns true if at least one connection is active.
Definition: NodeInfo.cpp:67
void incrementSuccesses(Timestamp timestamp)
Increments successful interactions at timestamp.
Definition: NodeInteractionsContainer.cpp:56
std::ostream & operator<<(std::ostream &out, ConnectionSecurityMode value)
Insertion operator for outputting value to out.
NodeInfo(NodeSource source)
Creates a node info with source.
Definition: NodeInfo.cpp:44
NodeSource
Definition: NodeInfo.h:47
Node interactions.
Definition: NodeInteractionsContainer.h:29
void clearAge(ServiceIdentifier serviceId)
Clears the age of the connection for the service identified by serviceId.
Definition: NodeInfo.cpp:100
ConnectionState()
Creates zeroed state.
Definition: NodeInfo.h:62
Definition: AddressExtractionExtension.cpp:28
ServiceIdentifiers services() const
Gets the associated service ids.
Definition: NodeInfo.cpp:59
void incrementFailures(Timestamp timestamp)
Increments failed interactions at timestamp.
Definition: NodeInteractionsContainer.cpp:60
uint32_t Age
Definition: NodeInfo.h:71
void updateBan(ServiceIdentifier serviceId, uint32_t maxConnectionBanAge, uint32_t numConsecutiveFailuresBeforeBanning)
Definition: NodeInfo.cpp:108
Definition: NodeInfo.h:55
NodeInteractionsContainer m_interactions
Definition: NodeInfo.h:132
NodeInteractions interactions(Timestamp timestamp) const
Gets the node interactions at timestamp..
Definition: NodeInteractionsContainer.cpp:44