Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
net.h File Reference
#include <addrman.h>
#include <addrman_impl.h>
#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/asmap.h>
#include <util/sock.h>
#include <chrono>
#include <cstddef>
#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  AddrManDeterministic
class  FuzzedNetEvents
class  FuzzedSock

Functions

CNetAddr ConsumeNetAddr (FuzzedDataProvider &fuzzed_data_provider, FastRandomContext *rand=nullptr) noexcept
 Create a CNetAddr.
FuzzedNetEvents ConsumeNetEvents (FuzzedDataProvider &fdp) noexcept
FuzzedSock ConsumeSock (FuzzedDataProvider &fuzzed_data_provider)
NetGroupManager ConsumeNetGroupManager (FuzzedDataProvider &fuzzed_data_provider) noexcept
CSubNet ConsumeSubNet (FuzzedDataProvider &fuzzed_data_provider) noexcept
CService ConsumeService (FuzzedDataProvider &fuzzed_data_provider) noexcept
std::vector< CServiceConsumeServiceVector (FuzzedDataProvider &fuzzed_data_provider, size_t max_vector_size=5) 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 88 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 29 of file net.cpp.

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

◆ ConsumeNetEvents()

FuzzedNetEvents ConsumeNetEvents ( FuzzedDataProvider & fdp)
inlinenodiscardnoexcept

Definition at line 226 of file net.h.

Here is the caller graph for this function:

◆ ConsumeNetGroupManager()

NetGroupManager ConsumeNetGroupManager ( FuzzedDataProvider & fuzzed_data_provider)
inlinenodiscardnoexcept

Definition at line 236 of file net.h.

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 270 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 310 of file net.h.

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

◆ ConsumeService()

CService ConsumeService ( FuzzedDataProvider & fuzzed_data_provider)
inlinenoexcept

Definition at line 250 of file net.h.

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

◆ ConsumeServiceVector()

std::vector< CService > ConsumeServiceVector ( FuzzedDataProvider & fuzzed_data_provider,
size_t max_vector_size = 5 )
inlinenoexcept

Definition at line 255 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)
inlinenodiscard

Definition at line 231 of file net.h.

Here is the caller graph for this function:

◆ ConsumeSubNet()

CSubNet ConsumeSubNet ( FuzzedDataProvider & fuzzed_data_provider)
inlinenoexcept

Definition at line 245 of file net.h.

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