Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
net_permissions.cpp
Go to the documentation of this file.
1// Copyright (c) 2020-present The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#include <net_permissions.h>
6#include <netbase.h>
8#include <test/fuzz/fuzz.h>
9#include <test/fuzz/util.h>
10#include <test/fuzz/util/net.h>
11#include <util/translation.h>
12
13#include <cassert>
14#include <cstdint>
15#include <string>
16#include <vector>
17
19{
20 FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
21 const std::string s = fuzzed_data_provider.ConsumeRandomLengthString(1000);
23
32 }
33
43 }
44}
std::string ConsumeRandomLengthString(size_t max_length)
static void AddFlag(NetPermissionFlags &flags, NetPermissionFlags f)
static void ClearFlag(NetPermissionFlags &flags, NetPermissionFlags f)
ClearFlag is only called with f == NetPermissionFlags::Implicit.
static std::vector< std::string > ToStrings(NetPermissionFlags flags)
static bool HasFlag(NetPermissionFlags flags, NetPermissionFlags f)
static bool TryParse(const std::string &str, NetWhitebindPermissions &output, bilingual_str &error)
static bool TryParse(const std::string &str, NetWhitelistPermissions &output, ConnectionDirection &output_connection_direction, bilingual_str &error)
#define FUZZ_TARGET(...)
Definition fuzz.h:35
NetPermissionFlags
ConnectionDirection
Definition netbase.h:33
Bilingual messages:
Definition translation.h:24
WeakEnumType ConsumeWeakEnum(FuzzedDataProvider &fuzzed_data_provider, const WeakEnumType(&all_types)[size]) noexcept
Definition util.h:128
constexpr NetPermissionFlags ALL_NET_PERMISSION_FLAGS[]
Definition net.h:130
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.
Definition time.h:73
assert(!tx.IsCoinBase())
FuzzedDataProvider & fuzzed_data_provider
Definition fees.cpp:38