Bitcoin Core  29.1.0
P2P Digital Currency
Classes | Functions | Variables
net.h File Reference
#include <compat/compat.h>
#include <netmessagemaker.h>
#include <net.h>
#include <net_permissions.h>
#include <net_processing.h>
#include <netaddress.h>
#include <node/connection_types.h>
#include <node/eviction.h>
#include <span.h>
#include <sync.h>
#include <util/sock.h>
#include <algorithm>
#include <array>
#include <cassert>
#include <chrono>
#include <condition_variable>
#include <cstdint>
#include <cstring>
#include <memory>
#include <optional>
#include <string>
#include <unordered_map>
#include <vector>
Include dependency graph for net.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ConnmanTestMsg
 
class  ZeroSock
 A mocked Sock alternative that succeeds on all operations. More...
 
class  StaticContentsSock
 A mocked Sock alternative that returns a statically contained data upon read and succeeds and ignores all writes. More...
 
class  DynSock
 A mocked Sock alternative that allows providing the data to be returned by Recv() and inspecting the data that has been supplied to Send(). More...
 
class  DynSock::Pipe
 Unidirectional bytes or CNetMessage queue (FIFO). More...
 
struct  DynSock::Pipes
 
class  DynSock::Queue
 A basic thread-safe queue, used for queuing sockets to be returned by Accept(). More...
 

Functions

std::vector< NodeEvictionCandidateGetRandomNodeEvictionCandidates (int n_candidates, FastRandomContext &random_context)
 

Variables

constexpr ServiceFlags ALL_SERVICE_FLAGS []
 
constexpr NetPermissionFlags ALL_NET_PERMISSION_FLAGS []
 
constexpr ConnectionType ALL_CONNECTION_TYPES []
 
constexpr auto ALL_NETWORKS
 

Function Documentation

◆ GetRandomNodeEvictionCandidates()

std::vector<NodeEvictionCandidate> GetRandomNodeEvictionCandidates ( int  n_candidates,
FastRandomContext random_context 
)

Definition at line 119 of file net.cpp.

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

Variable Documentation

◆ ALL_CONNECTION_TYPES

constexpr ConnectionType ALL_CONNECTION_TYPES[]
Initial value:
{
}
AddrFetch connections are short lived connections used to solicit addresses from peers.
Inbound connections are those initiated by a peer.
Feeler connections are short-lived connections made to check that a node is alive.
These are the default connections that we use to connect with the network.
We open manual connections to addresses that users explicitly requested via the addnode RPC or the -a...
We use block-relay-only connections to help prevent against partition attacks.

Definition at line 118 of file net.h.

◆ ALL_NET_PERMISSION_FLAGS

constexpr NetPermissionFlags ALL_NET_PERMISSION_FLAGS[]

◆ ALL_NETWORKS

constexpr auto ALL_NETWORKS
Initial value:
= std::array{
}
A set of addresses that represent the hash of a string or FQDN.
Definition: netaddress.h:53
IPv4.
Definition: netaddress.h:37
I2P.
Definition: netaddress.h:46
IPv6.
Definition: netaddress.h:40
TOR (v2 or v3)
Definition: netaddress.h:43
CJDNS.
Definition: netaddress.h:49
Addresses from these networks are not publicly routable on the global Internet.
Definition: netaddress.h:34

Definition at line 127 of file net.h.

◆ ALL_SERVICE_FLAGS

constexpr ServiceFlags ALL_SERVICE_FLAGS[]