Bitcoin Core  24.99.0
P2P Digital Currency
Public Member Functions | Public Attributes | List of all members
ConnmanTestMsg Struct Reference

#include <net.h>

Inheritance diagram for ConnmanTestMsg:
[legend]
Collaboration diagram for ConnmanTestMsg:
[legend]

Public Member Functions

void SetPeerConnectTimeout (std::chrono::seconds timeout)
 
void AddTestNode (CNode &node)
 
void ClearTestNodes ()
 
void NodeReceiveMsgBytes (CNode &node, Span< const uint8_t > msg_bytes, bool &complete) const
 
bool ReceiveMsgFrom (CNode &node, CSerializedNetMsg &ser_msg) const
 
 CConnman (uint64_t seed0, uint64_t seed1, AddrMan &addrman, const NetGroupManager &netgroupman, bool network_active=true)
 
- Public Member Functions inherited from CConnman
void Init (const Options &connOptions) EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex
 
 CConnman (uint64_t seed0, uint64_t seed1, AddrMan &addrman, const NetGroupManager &netgroupman, bool network_active=true)
 
 ~CConnman ()
 
bool Start (CScheduler &scheduler, const Options &options) EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex
 
void StopThreads ()
 
void StopNodes ()
 
void Stop ()
 
void Interrupt () EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc)
 
bool GetNetworkActive () const
 
bool GetUseAddrmanOutgoing () const
 
void SetNetworkActive (bool active)
 
void OpenNetworkConnection (const CAddress &addrConnect, bool fCountFailure, CSemaphoreGrant *grantOutbound, const char *strDest, ConnectionType conn_type)
 
bool CheckIncomingNonce (uint64_t nonce)
 
bool ForNode (NodeId id, std::function< bool(CNode *pnode)> func)
 
void PushMessage (CNode *pnode, CSerializedNetMsg &&msg) EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex)
 
void ForEachNode (const NodeFn &func)
 
void ForEachNode (const NodeFn &func) const
 
std::vector< CAddressGetAddresses (size_t max_addresses, size_t max_pct, std::optional< Network > network) const
 Return all or many randomly selected addresses, optionally by network. More...
 
std::vector< CAddressGetAddresses (CNode &requestor, size_t max_addresses, size_t max_pct)
 Cache is used to minimize topology leaks, so it should be used for all non-trusted calls, for example, p2p. More...
 
void SetTryNewOutboundPeer (bool flag)
 
bool GetTryNewOutboundPeer () const
 
void StartExtraBlockRelayPeers ()
 
int GetExtraFullOutboundCount () const
 
int GetExtraBlockRelayCount () const
 
bool AddNode (const std::string &node) EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex)
 
bool RemoveAddedNode (const std::string &node) EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex)
 
std::vector< AddedNodeInfoGetAddedNodeInfo () const EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex)
 
bool AddConnection (const std::string &address, ConnectionType conn_type)
 Attempts to open a connection. More...
 
size_t GetNodeCount (ConnectionDirection) const
 
void GetNodeStats (std::vector< CNodeStats > &vstats) const
 
bool DisconnectNode (const std::string &node)
 
bool DisconnectNode (const CSubNet &subnet)
 
bool DisconnectNode (const CNetAddr &addr)
 
bool DisconnectNode (NodeId id)
 
ServiceFlags GetLocalServices () const
 Used to convey which local services we are offering peers during node connection. More...
 
uint64_t GetMaxOutboundTarget () const EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex)
 
std::chrono::seconds GetMaxOutboundTimeframe () const
 
bool OutboundTargetReached (bool historicalBlockServingLimit) const EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex)
 check if the outbound target is reached if param historicalBlockServingLimit is set true, the function will response true if the limit for serving historical blocks has been reached More...
 
uint64_t GetOutboundTargetBytesLeft () const EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex)
 response the bytes left in the current max outbound cycle in case of no limit, it will always response 0 More...
 
std::chrono::seconds GetMaxOutboundTimeLeftInCycle () const EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex)
 
uint64_t GetTotalBytesRecv () const
 
uint64_t GetTotalBytesSent () const EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex)
 
CSipHasher GetDeterministicRandomizer (uint64_t id) const
 Get a unique deterministic randomizer. More...
 
unsigned int GetReceiveFloodSize () const
 
void WakeMessageHandler () EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc)
 
bool ShouldRunInactivityChecks (const CNode &node, std::chrono::seconds now) const
 Return true if we should disconnect the peer for failing an inactivity check. More...
 

Public Attributes

void Handshake(CNode &node, bool successfully_connected, ServiceFlags remote_services, ServiceFlags local_services, int32_t version, bool relay_txs) EXCLUSIVE_LOCKS_REQUIRED(NetEventsInterface void ProcessMessagesOnce (CNode &node) EXCLUSIVE_LOCKS_REQUIRED(NetEventsInterface
 
- Public Attributes inherited from CConnman
void !m_total_bytes_sent_mutex
 
 nLocalServices = connOptions.nLocalServices
 
 nMaxConnections = connOptions.nMaxConnections
 
 m_max_outbound_full_relay = std::min(connOptions.m_max_outbound_full_relay, connOptions.nMaxConnections)
 
 m_max_outbound_block_relay = connOptions.m_max_outbound_block_relay
 
 m_use_addrman_outgoing = connOptions.m_use_addrman_outgoing
 
 nMaxAddnode = connOptions.nMaxAddnode
 
 nMaxFeeler = connOptions.nMaxFeeler
 
 m_max_outbound = m_max_outbound_full_relay + m_max_outbound_block_relay + nMaxFeeler
 
 m_client_interface = connOptions.uiInterface
 
 m_banman = connOptions.m_banman
 
 m_msgproc = connOptions.m_msgproc
 
 nSendBufferMaxSize = connOptions.nSendBufferMaxSize
 
 nReceiveFloodSize = connOptions.nReceiveFloodSize
 
 m_peer_connect_timeout = std::chrono::seconds{connOptions.m_peer_connect_timeout}
 
 nMaxOutboundLimit = connOptions.nMaxOutboundLimit
 
 vWhitelistedRange = connOptions.vWhitelistedRange
 
 m_added_nodes = connOptions.m_added_nodes
 
 m_onion_binds = connOptions.onion_binds
 
bool !m_added_nodes_mutex
 
bool !m_addr_fetches_mutex
 
bool !mutexMsgProc
 

Additional Inherited Members

- Public Types inherited from CConnman
using NodeFn = std::function< void(CNode *)>
 

Detailed Description

Definition at line 20 of file net.h.

Member Function Documentation

◆ AddTestNode()

void ConnmanTestMsg::AddTestNode ( CNode node)
inline

Definition at line 28 of file net.h.

Here is the caller graph for this function:

◆ CConnman()

CConnman::CConnman

Definition at line 729 of file net.cpp.

◆ ClearTestNodes()

void ConnmanTestMsg::ClearTestNodes ( )
inline

Definition at line 33 of file net.h.

◆ NodeReceiveMsgBytes()

void ConnmanTestMsg::NodeReceiveMsgBytes ( CNode node,
Span< const uint8_t >  msg_bytes,
bool &  complete 
) const

Definition at line 65 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReceiveMsgFrom()

bool ConnmanTestMsg::ReceiveMsgFrom ( CNode node,
CSerializedNetMsg ser_msg 
) const

Definition at line 85 of file net.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetPeerConnectTimeout()

void ConnmanTestMsg::SetPeerConnectTimeout ( std::chrono::seconds  timeout)
inline

Definition at line 23 of file net.h.

Here is the caller graph for this function:

Member Data Documentation

◆ ProcessMessagesOnce

void Handshake (CNode& node, bool successfully_connected, ServiceFlags remote_services, ServiceFlags local_services, int32_t version, bool relay_txs) EXCLUSIVE_LOCKS_REQUIRED(NetEventsInterface void ConnmanTestMsg::ProcessMessagesOnce(CNode &node) EXCLUSIVE_LOCKS_REQUIRED(NetEventsInterface
inline

Definition at line 50 of file net.h.


The documentation for this struct was generated from the following files: