38 return lhs.nVersion ==
rhs.nVersion &&
39 lhs.nCreateTime ==
rhs.nCreateTime &&
40 lhs.nBanUntil ==
rhs.nBanUntil;
58 banlist_file = fs::path{
"path"} /
"to" /
"inaccessible" /
"fuzzed_banlist";
76 if (addr.has_value() && addr->IsValid()) {
89 if (!subnet.IsValid()) {
fs::path GetDataDirNet() const
Get data directory path with appended network identifier.
void DumpBanlist() EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex)
void GetBanned(banmap_t &banmap) EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex)
std::string ConsumeRandomLengthString(size_t max_length)
T ConsumeIntegralInRange(T min, T max)
static std::string PathToString(const path &path)
Convert path object to a byte string.
#define LIMITED_WHILE(condition, limit)
Can be used to limit a theoretically unbounded loop.
std::map< CSubNet, CBanEntry > banmap_t
CSubNet LookupSubNet(const std::string &subnet_str)
Parse and resolve a specified subnet string into the appropriate internal representation.
std::vector< CNetAddr > LookupHost(const std::string &name, unsigned int nMaxSolutions, bool fAllowLookup, DNSLookupFn dns_lookup_function)
Resolve a host string to its corresponding network addresses.
bool WriteBinaryFile(const fs::path &filename, const std::string &data)
Write contents of std::string to a file.
static bool operator==(const CBanEntry &lhs, const CBanEntry &rhs)
CNetAddr ConsumeNetAddr(FuzzedDataProvider &fuzzed_data_provider, FastRandomContext *rand) noexcept
Create a CNetAddr.
CSubNet ConsumeSubNet(FuzzedDataProvider &fuzzed_data_provider) noexcept
NodeSeconds ConsumeTime(FuzzedDataProvider &fuzzed_data_provider, const std::optional< int64_t > &min, const std::optional< int64_t > &max) noexcept
size_t CallOneOf(FuzzedDataProvider &fuzzed_data_provider, Callables... callables)
void SeedRandomStateForTest(SeedRand seedtype)
Seed the global RNG state for testing and log the seed value.
@ ZEROS
Seed with a compile time constant of zeros.
void SetMockTime(int64_t nMockTimeIn)
DEPRECATED Use SetMockTime with chrono type.
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.
FuzzedDataProvider & fuzzed_data_provider