Bitcoin Core  26.99.0
P2P Digital Currency
Classes | Functions
net.h File Reference
#include <net.h>
#include <net_permissions.h>
#include <netaddress.h>
#include <node/connection_types.h>
#include <node/eviction.h>
#include <protocol.h>
#include <test/fuzz/FuzzedDataProvider.h>
#include <test/fuzz/util.h>
#include <test/util/net.h>
#include <threadsafety.h>
#include <util/sock.h>
#include <chrono>
#include <cstdint>
#include <limits>
#include <memory>
#include <optional>
#include <string>
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

class  FuzzedSock
 

Functions

CNetAddr ConsumeNetAddr (FuzzedDataProvider &fuzzed_data_provider, FastRandomContext *rand=nullptr) noexcept
 Create a CNetAddr. More...
 
FuzzedSock ConsumeSock (FuzzedDataProvider &fuzzed_data_provider)
 
CSubNet ConsumeSubNet (FuzzedDataProvider &fuzzed_data_provider) noexcept
 
CService ConsumeService (FuzzedDataProvider &fuzzed_data_provider) noexcept
 
CAddress ConsumeAddress (FuzzedDataProvider &fuzzed_data_provider) noexcept
 
template<bool ReturnUniquePtr = false>
auto ConsumeNode (FuzzedDataProvider &fuzzed_data_provider, const std::optional< NodeId > &node_id_in=std::nullopt) noexcept
 
std::unique_ptr< CNodeConsumeNodeAsUniquePtr (FuzzedDataProvider &fdp, const std::optional< NodeId > &node_id_in=std::nullopt)
 

Function Documentation

◆ ConsumeAddress()

CAddress ConsumeAddress ( FuzzedDataProvider fuzzed_data_provider)
noexcept

Definition at line 87 of file net.cpp.

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

◆ ConsumeNetAddr()

CNetAddr ConsumeNetAddr ( FuzzedDataProvider fuzzed_data_provider,
FastRandomContext rand = nullptr 
)
noexcept

Create a CNetAddr.

It may have addr.IsValid() == false.

Parameters
[in,out]fuzzed_data_providerTake data for the address from this, if rand is nullptr.
[in,out]randIf not nullptr, take data from it instead of from fuzzed_data_provider. Prefer generating addresses using fuzzed_data_provider because it is not uniform. Only use rand if fuzzed_data_provider is exhausted or its data is needed for other things.
Returns
a "random" network address.

Definition at line 28 of file net.cpp.

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

◆ ConsumeNode()

template<bool ReturnUniquePtr = false>
auto ConsumeNode ( FuzzedDataProvider fuzzed_data_provider,
const std::optional< NodeId > &  node_id_in = std::nullopt 
)
noexcept

Definition at line 109 of file net.h.

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

◆ ConsumeNodeAsUniquePtr()

std::unique_ptr<CNode> ConsumeNodeAsUniquePtr ( FuzzedDataProvider fdp,
const std::optional< NodeId > &  node_id_in = std::nullopt 
)
inline

Definition at line 145 of file net.h.

Here is the caller graph for this function:

◆ ConsumeService()

CService ConsumeService ( FuzzedDataProvider fuzzed_data_provider)
inlinenoexcept

Definition at line 101 of file net.h.

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

◆ ConsumeSock()

FuzzedSock ConsumeSock ( FuzzedDataProvider fuzzed_data_provider)
inline

Definition at line 91 of file net.h.

Here is the caller graph for this function:

◆ ConsumeSubNet()

CSubNet ConsumeSubNet ( FuzzedDataProvider fuzzed_data_provider)
inlinenoexcept

Definition at line 96 of file net.h.

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