Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
ConnmanTestMsg Struct Reference

#include <net.h>

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

Public Member Functions

void SetMsgProc (NetEventsInterface *msgproc)
void SetAddrman (AddrMan &in)
void SetPeerConnectTimeout (std::chrono::seconds timeout)
void ResetAddrCache ()
void ResetMaxOutboundCycle ()
void Reset ()
 Reset the internal state.
std::vector< CNode * > TestNodes ()
void AddTestNode (CNode &node)
void ClearTestNodes ()
void CreateNodeFromAcceptedSocketPublic (std::unique_ptr< Sock > sock, NetPermissionFlags permissions, const CAddress &addr_bind, const CAddress &addr_peer)
bool InitBindsPublic (const CConnman::Options &options)
void SocketHandlerPublic ()
void NodeReceiveMsgBytes (CNode &node, std::span< const uint8_t > msg_bytes, bool &complete) const
bool ReceiveMsgFrom (CNode &node, CSerializedNetMsg &&ser_msg) const
void FlushSendBuffer (CNode &node) const
bool AlreadyConnectedToAddressPublic (const CNetAddr &addr)
CNodeConnectNodePublic (PeerManager &peerman, const char *pszDest, ConnectionType conn_type) EXCLUSIVE_LOCKS_REQUIRED(!m_unused_i2p_sessions_mutex)
 CConnman (uint64_t seed0, uint64_t seed1, AddrMan &addrman, const NetGroupManager &netgroupman, const CChainParams &params, bool network_active=true, std::shared_ptr< CThreadInterrupt > interrupt_net=std::make_shared< CThreadInterrupt >())
Public Member Functions inherited from CConnman
void Init (const Options &connOptions) EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex
const bool use_v2transport (GetLocalServices() &NODE_P2P_V2)
 for (const std::string &added_node :connOptions.m_added_nodes)
void SetCaptureMessages (bool cap)
 CConnman (uint64_t seed0, uint64_t seed1, AddrMan &addrman, const NetGroupManager &netgroupman, const CChainParams &params, bool network_active=true, std::shared_ptr< CThreadInterrupt > interrupt_net=std::make_shared< CThreadInterrupt >())
 ~CConnman ()
bool Start (CScheduler &scheduler, const Options &options) EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex
void StopThreads ()
void StopNodes () EXCLUSIVE_LOCKS_REQUIRED(!m_reconnections_mutex)
void Stop () EXCLUSIVE_LOCKS_REQUIRED(!m_reconnections_mutex)
void Interrupt () EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc)
bool GetNetworkActive () const
bool GetUseAddrmanOutgoing () const
void SetNetworkActive (bool active)
bool OpenNetworkConnection (const CAddress &addrConnect, bool fCountFailure, CountingSemaphoreGrant<> &&grant_outbound, const char *pszDest, ConnectionType conn_type, bool use_v2transport, const std::optional< Proxy > &proxy_override=std::nullopt) EXCLUSIVE_LOCKS_REQUIRED(!m_unused_i2p_sessions_mutex)
 Open a new P2P connection and initialize it with the PeerManager at m_msgproc.
bool CheckIncomingNonce (uint64_t nonce)
void ASMapHealthCheck ()
RecursiveMutexGetNodesMutex () const LOCK_RETURNED(m_nodes_mutex)
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< CAddressGetAddressesUnsafe (size_t max_addresses, size_t max_pct, std::optional< Network > network, bool filtered=true) const
 Return randomly selected addresses.
std::vector< CAddressGetAddresses (CNode &requestor, size_t max_addresses, size_t max_pct)
 Return addresses from the per-requestor cache.
void SetTryNewOutboundPeer (bool flag)
bool GetTryNewOutboundPeer () const
void StartExtraBlockRelayPeers ()
int GetFullOutboundConnCount () const
int GetExtraFullOutboundCount () const
int GetExtraBlockRelayCount () const
bool AddNode (const AddedNodeParams &add) EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex)
bool RemoveAddedNode (std::string_view node) EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex)
bool AddedNodesContain (const CAddress &addr) const EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex)
std::vector< AddedNodeInfoGetAddedNodeInfo (bool include_connected) const EXCLUSIVE_LOCKS_REQUIRED(!m_added_nodes_mutex)
bool AddConnection (const std::string &address, ConnectionType conn_type, bool use_v2transport) EXCLUSIVE_LOCKS_REQUIRED(!m_unused_i2p_sessions_mutex)
 Attempts to open a connection.
size_t GetNodeCount (ConnectionDirection) const
std::map< CNetAddr, LocalServiceInfogetNetLocalAddresses () const
uint32_t GetMappedAS (const CNetAddr &addr) const
void GetNodeStats (std::vector< CNodeStats > &vstats) const
bool DisconnectNode (std::string_view node)
bool DisconnectNode (const CSubNet &subnet)
bool DisconnectNode (const CNetAddr &addr)
bool DisconnectNode (NodeId id)
ServiceFlags GetLocalServices () const
void AddLocalServices (ServiceFlags services)
void RemoveLocalServices (ServiceFlags services)
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)
uint64_t GetOutboundTargetBytesLeft () const EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex)
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.
void WakeMessageHandler () EXCLUSIVE_LOCKS_REQUIRED(!mutexMsgProc)
bool ShouldRunInactivityChecks (const CNode &node, std::chrono::microseconds now) const
 Return true if we should disconnect the peer for failing an inactivity check.
bool MultipleManualOrFullOutboundConns (Network net) const EXCLUSIVE_LOCKS_REQUIRED(m_nodes_mutex)

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 boo ProcessMessagesOnce )(CNode &node) EXCLUSIVE_LOCKS_REQUIRED(NetEventsInterface
Public Attributes inherited from CConnman
void !m_total_bytes_sent_mutex
 m_local_services = connOptions.m_local_services
 m_max_automatic_connections = connOptions.m_max_automatic_connections
 m_max_outbound_full_relay = std::min(MAX_OUTBOUND_FULL_RELAY_CONNECTIONS, m_max_automatic_connections)
 m_max_outbound_block_relay = std::min(MAX_BLOCK_RELAY_ONLY_CONNECTIONS, m_max_automatic_connections - m_max_outbound_full_relay)
 m_max_automatic_outbound = m_max_outbound_full_relay + m_max_outbound_block_relay + m_max_feeler
 m_max_inbound = std::max(0, m_max_automatic_connections - m_max_automatic_outbound)
 m_use_addrman_outgoing = connOptions.m_use_addrman_outgoing
 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
 vWhitelistedRangeIncoming = connOptions.vWhitelistedRangeIncoming
 vWhitelistedRangeOutgoing = connOptions.vWhitelistedRangeOutgoing
 m_onion_binds = connOptions.onion_binds
 whitelist_forcerelay = connOptions.whitelist_forcerelay
 whitelist_relay = connOptions.whitelist_relay
 m_capture_messages = connOptions.m_capture_messages
bool !m_added_nodes_mutex
bool !m_addr_fetches_mutex
bool !mutexMsgProc
class CConnman::PrivateBroadcast m_private_broadcast

Additional Inherited Members

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

Detailed Description

Definition at line 35 of file net.h.

Member Function Documentation

◆ AddTestNode()

void ConnmanTestMsg::AddTestNode ( CNode & node)
inline

Definition at line 61 of file net.h.

Here is the caller graph for this function:

◆ AlreadyConnectedToAddressPublic()

bool ConnmanTestMsg::AlreadyConnectedToAddressPublic ( const CNetAddr & addr)
inline

Definition at line 114 of file net.h.

Here is the call graph for this function:

◆ CConnman()

CConnman::CConnman ( uint64_t seed0,
uint64_t seed1,
AddrMan & addrman,
const NetGroupManager & netgroupman,
const CChainParams & params,
bool network_active = true,
std::shared_ptr< CThreadInterrupt > interrupt_net = std::make_shared<CThreadInterrupt>() )

Definition at line 1145 of file net.cpp.

Here is the call graph for this function:

◆ ClearTestNodes()

void ConnmanTestMsg::ClearTestNodes ( )
inline

Definition at line 69 of file net.h.

Here is the caller graph for this function:

◆ ConnectNodePublic()

CNode * ConnmanTestMsg::ConnectNodePublic ( PeerManager & peerman,
const char * pszDest,
ConnectionType conn_type )

Definition at line 125 of file net.cpp.

Here is the call graph for this function:

◆ CreateNodeFromAcceptedSocketPublic()

void ConnmanTestMsg::CreateNodeFromAcceptedSocketPublic ( std::unique_ptr< Sock > sock,
NetPermissionFlags permissions,
const CAddress & addr_bind,
const CAddress & addr_peer )
inline

Definition at line 78 of file net.h.

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

◆ FlushSendBuffer()

void ConnmanTestMsg::FlushSendBuffer ( CNode & node) const

Definition at line 99 of file net.cpp.

Here is the caller graph for this function:

◆ InitBindsPublic()

bool ConnmanTestMsg::InitBindsPublic ( const CConnman::Options & options)
inline

Definition at line 86 of file net.h.

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

◆ NodeReceiveMsgBytes()

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

Definition at line 91 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 111 of file net.cpp.

Here is the call graph for this function:

◆ Reset()

void ConnmanTestMsg::Reset ( )

Reset the internal state.

Definition at line 83 of file net.cpp.

Here is the call graph for this function:

◆ ResetAddrCache()

void ConnmanTestMsg::ResetAddrCache ( )

Definition at line 74 of file net.cpp.

Here is the caller graph for this function:

◆ ResetMaxOutboundCycle()

void ConnmanTestMsg::ResetMaxOutboundCycle ( )

Definition at line 76 of file net.cpp.

Here is the caller graph for this function:

◆ SetAddrman()

void ConnmanTestMsg::SetAddrman ( AddrMan & in)
inline

Definition at line 43 of file net.h.

◆ SetMsgProc()

void ConnmanTestMsg::SetMsgProc ( NetEventsInterface * msgproc)
inline

Definition at line 38 of file net.h.

◆ SetPeerConnectTimeout()

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

Definition at line 45 of file net.h.

Here is the caller graph for this function:

◆ SocketHandlerPublic()

void ConnmanTestMsg::SocketHandlerPublic ( )
inline

Definition at line 91 of file net.h.

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

◆ TestNodes()

std::vector< CNode * > ConnmanTestMsg::TestNodes ( )
inline

Definition at line 55 of file net.h.

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 boo ConnmanTestMsg::ProcessMessagesOnce) (CNode &node) EXCLUSIVE_LOCKS_REQUIRED(NetEventsInterface
inline

Definition at line 104 of file net.h.


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