19 static const auto testing_setup = MakeNoLogFileContext<>();
31 CreateSock = [&fuzzed_data_provider](int, int, int) {
32 return std::make_unique<FuzzedSock>(fuzzed_data_provider);
36 const CService addr{in6_addr(IN6ADDR_LOOPBACK_INIT), 7656};
37 const Proxy sam_proxy{addr,
false};
43 if (session.Listen(conn)) {
44 if (session.Accept(conn)) {
47 }
catch (
const std::runtime_error&) {
54 if (session.Connect(
CService{}, conn, proxy_error)) {
56 conn.
sock->SendComplete(
"verack\n", 10ms, interrupt);
57 }
catch (
const std::runtime_error&) {
61 fs::remove_all(private_key_path);
fs::path GetDataDirNet() const
Get data directory path with appended network identifier.
A combination of a network address (CNetAddr) and a (TCP) port.
A helper class for interruptible sleeps.
Path class wrapper to block calls to the fs::path(std::string) implicit constructor and the fs::path:...
static constexpr size_t MAX_MSG_SIZE
The maximum size of an incoming message from the I2P SAM proxy (in bytes).
std::function< std::unique_ptr< Sock >(int, int, int)> CreateSock
Socket factory.
An established connection with another peer.
std::unique_ptr< Sock > sock
Connected socket.
FUZZ_TARGET(i2p,.init=initialize_i2p)
int64_t ConsumeTime(FuzzedDataProvider &fuzzed_data_provider, const std::optional< int64_t > &min, const std::optional< int64_t > &max) noexcept
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.