Bitcoin Core 32.1.0
P2P Digital Currency
Loading...
Searching...
No Matches
net.cpp File Reference
#include <rpc/register.h>
#include <rpc/server.h>
#include <addrman.h>
#include <addrman_impl.h>
#include <banman.h>
#include <chainparams.h>
#include <clientversion.h>
#include <core_io.h>
#include <crypto/hex_base.h>
#include <net.h>
#include <net_permissions.h>
#include <net_processing.h>
#include <net_types.h>
#include <netaddress.h>
#include <netbase.h>
#include <netgroup.h>
#include <node/connection_types.h>
#include <node/context.h>
#include <node/protocol_version.h>
#include <node/warnings.h>
#include <policy/feerate.h>
#include <protocol.h>
#include <rpc/request.h>
#include <rpc/server_util.h>
#include <rpc/util.h>
#include <semaphore_grant.h>
#include <sync.h>
#include <tinyformat.h>
#include <txmempool.h>
#include <uint256.h>
#include <univalue.h>
#include <util/chaintype.h>
#include <util/check.h>
#include <util/strencodings.h>
#include <util/string.h>
#include <util/time.h>
#include <validation.h>
#include <atomic>
#include <compare>
#include <cstdint>
#include <map>
#include <memory>
#include <optional>
#include <span>
#include <sstream>
#include <stdexcept>
#include <string>
#include <string_view>
#include <type_traits>
#include <utility>
#include <vector>

Go to the source code of this file.

Functions

static RPCMethod getconnectioncount ()
static RPCMethod ping ()
static UniValue GetServicesNames (ServiceFlags services)
 Returns, given services flags, a list of humanly readable (known) network services.
static RPCMethod getpeerinfo ()
static RPCMethod addnode ()
static RPCMethod addconnection ()
static RPCMethod disconnectnode ()
static RPCMethod getaddednodeinfo ()
static RPCMethod getnettotals ()
static UniValue GetNetworksInfo ()
static RPCMethod getnetworkinfo ()
static RPCMethod setban ()
static RPCMethod listbanned ()
static RPCMethod clearbanned ()
static RPCMethod setnetworkactive ()
static RPCMethod getnodeaddresses ()
static RPCMethod addpeeraddress ()
static RPCMethod sendmsgtopeer ()
static RPCMethod getaddrmaninfo ()
static RPCMethod exportasmap ()
UniValue AddrmanEntryToJSON (const AddrInfo &info, const CConnman &connman)
UniValue AddrmanTableToJSON (const std::vector< std::pair< AddrInfo, AddressPosition > > &tableInfos, const CConnman &connman)
static RPCMethod getrawaddrman ()
void RegisterNetRPCCommands (CRPCTable &t)
template<typename C, typename S, typename UnaryOp>
auto Join (const C &container, const S &separator, UnaryOp unary_op)
 Join all container items.
std::string_view TrimStringView (std::string_view str LIFETIMEBOUND, std::string_view pattern=" \f\n\r\t\v")

Variables

const std::vector< std::string > CONNECTION_TYPE_DOC
const std::vector< std::string > TRANSPORT_TYPE_DOC

Function Documentation

◆ addconnection()

RPCMethod addconnection ( )
static

Definition at line 416 of file net.cpp.

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

◆ addnode()

RPCMethod addnode ( )
static

Definition at line 341 of file net.cpp.

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

◆ addpeeraddress()

RPCMethod addpeeraddress ( )
static

Definition at line 1032 of file net.cpp.

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

◆ AddrmanEntryToJSON()

UniValue AddrmanEntryToJSON ( const AddrInfo & info,
const CConnman & connman )

Definition at line 1229 of file net.cpp.

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

◆ AddrmanTableToJSON()

UniValue AddrmanTableToJSON ( const std::vector< std::pair< AddrInfo, AddressPosition > > & tableInfos,
const CConnman & connman )

Definition at line 1250 of file net.cpp.

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

◆ clearbanned()

RPCMethod clearbanned ( )
static

Definition at line 927 of file net.cpp.

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

◆ disconnectnode()

RPCMethod disconnectnode ( )
static

Definition at line 479 of file net.cpp.

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

◆ exportasmap()

RPCMethod exportasmap ( )
static

Definition at line 1179 of file net.cpp.

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

◆ getaddednodeinfo()

RPCMethod getaddednodeinfo ( )
static

Definition at line 525 of file net.cpp.

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

◆ getaddrmaninfo()

RPCMethod getaddrmaninfo ( )
static

Definition at line 1140 of file net.cpp.

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

◆ getconnectioncount()

RPCMethod getconnectioncount ( )
static

Definition at line 87 of file net.cpp.

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

◆ getnettotals()

RPCMethod getnettotals ( )
static

Definition at line 599 of file net.cpp.

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

◆ getnetworkinfo()

RPCMethod getnetworkinfo ( )
static

Definition at line 671 of file net.cpp.

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

◆ GetNetworksInfo()

UniValue GetNetworksInfo ( )
static

Definition at line 649 of file net.cpp.

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

◆ getnodeaddresses()

RPCMethod getnodeaddresses ( )
static

Definition at line 971 of file net.cpp.

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

◆ getpeerinfo()

RPCMethod getpeerinfo ( )
static

Definition at line 147 of file net.cpp.

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

◆ getrawaddrman()

RPCMethod getrawaddrman ( )
static

Definition at line 1266 of file net.cpp.

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

◆ GetServicesNames()

UniValue GetServicesNames ( ServiceFlags services)
static

Returns, given services flags, a list of humanly readable (known) network services.

Definition at line 136 of file net.cpp.

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

◆ Join()

template<typename C, typename S, typename UnaryOp>
auto util::Join ( const C & container,
const S & separator,
UnaryOp unary_op )

Join all container items.

Typically used to concatenate strings but accepts containers with elements of any type.

Parameters
containerThe items to join
separatorThe separator
unary_opApply this operator to each item

Definition at line 209 of file string.h.

◆ listbanned()

RPCMethod listbanned ( )
static

Definition at line 879 of file net.cpp.

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

◆ ping()

RPCMethod ping ( )
static

Definition at line 110 of file net.cpp.

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

◆ RegisterNetRPCCommands()

void RegisterNetRPCCommands ( CRPCTable & t)

Definition at line 1306 of file net.cpp.

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

◆ sendmsgtopeer()

RPCMethod sendmsgtopeer ( )
static

Definition at line 1092 of file net.cpp.

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

◆ setban()

RPCMethod setban ( )
static

Definition at line 799 of file net.cpp.

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

◆ setnetworkactive()

RPCMethod setnetworkactive ( )
static

Definition at line 949 of file net.cpp.

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

◆ TrimStringView()

std::string_view util::TrimStringView ( std::string_view str LIFETIMEBOUND,
std::string_view pattern = " \f\n\r\t\v" )
inlinenodiscard

Definition at line 163 of file string.h.

Variable Documentation

◆ CONNECTION_TYPE_DOC

const std::vector<std::string> CONNECTION_TYPE_DOC
Initial value:
{
"outbound-full-relay (default automatic connections)",
"block-relay-only (does not relay transactions or addresses)",
"inbound (initiated by the peer)",
"manual (added via addnode RPC or -addnode/-connect configuration options)",
"addr-fetch (short-lived automatic connection for soliciting addresses)",
"feeler (short-lived automatic connection for testing addresses)",
"private-broadcast (short-lived automatic connection for broadcasting privacy-sensitive transactions)"
}

Definition at line 71 of file net.cpp.

◆ TRANSPORT_TYPE_DOC

const std::vector<std::string> TRANSPORT_TYPE_DOC
Initial value:
{
"detecting (peer could be v1 or v2)",
"v1 (plaintext transport protocol)",
"v2 (BIP324 encrypted transport protocol)"
}

Definition at line 81 of file net.cpp.