mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 04:04:16 +00:00
some cleanup
This commit is contained in:
parent
0a0f61b940
commit
d7a584f48f
44
Tunnel.cpp
44
Tunnel.cpp
@ -535,49 +535,5 @@ namespace tunnel
|
|||||||
&i2p::context.GetRouterInfo ()
|
&i2p::context.GetRouterInfo ()
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
OutboundTunnel * Tunnels::CreateOneHopOutboundTestTunnel (InboundTunnel * replyTunnel)
|
|
||||||
{
|
|
||||||
return CreateTunnel<OutboundTunnel> (replyTunnel->GetTunnelConfig ()->Invert ());
|
|
||||||
}
|
|
||||||
|
|
||||||
InboundTunnel * Tunnels::CreateOneHopInboundTestTunnel (OutboundTunnel * outboundTunnel)
|
|
||||||
{
|
|
||||||
i2p::ntcp::NTCPSession * peer = i2p::transports.GetNextNTCPSession ();
|
|
||||||
if (peer)
|
|
||||||
{
|
|
||||||
const i2p::data::RouterInfo& router = peer->GetRemoteRouterInfo ();
|
|
||||||
return CreateTunnel<InboundTunnel> (
|
|
||||||
new TunnelConfig (std::vector<const i2p::data::RouterInfo *>{&router}),
|
|
||||||
outboundTunnel);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
LogPrint ("No established peers");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
OutboundTunnel * Tunnels::CreateTwoHopsOutboundTestTunnel (InboundTunnel * replyTunnel)
|
|
||||||
{
|
|
||||||
return CreateTunnel<OutboundTunnel> (replyTunnel->GetTunnelConfig ()->Invert ());
|
|
||||||
}
|
|
||||||
|
|
||||||
InboundTunnel * Tunnels::CreateTwoHopsInboundTestTunnel (OutboundTunnel * outboundTunnel)
|
|
||||||
{
|
|
||||||
i2p::ntcp::NTCPSession * peer = i2p::transports.GetNextNTCPSession ();
|
|
||||||
if (peer)
|
|
||||||
{
|
|
||||||
const i2p::data::RouterInfo& router = peer->GetRemoteRouterInfo ();
|
|
||||||
return CreateTunnel<InboundTunnel> (
|
|
||||||
new TunnelConfig (std::vector<const i2p::data::RouterInfo *>
|
|
||||||
{
|
|
||||||
&router,
|
|
||||||
&i2p::context.GetRouterInfo ()
|
|
||||||
}),
|
|
||||||
outboundTunnel);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
LogPrint ("No established peers");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
5
Tunnel.h
5
Tunnel.h
@ -125,11 +125,6 @@ namespace tunnel
|
|||||||
TunnelPool * CreateTunnelPool (i2p::data::LocalDestination * localDestination);
|
TunnelPool * CreateTunnelPool (i2p::data::LocalDestination * localDestination);
|
||||||
void DeleteTunnelPool (TunnelPool * pool);
|
void DeleteTunnelPool (TunnelPool * pool);
|
||||||
|
|
||||||
OutboundTunnel * CreateOneHopOutboundTestTunnel (InboundTunnel * replyTunnel);
|
|
||||||
InboundTunnel * CreateOneHopInboundTestTunnel (OutboundTunnel * outboundTunnel = 0);
|
|
||||||
OutboundTunnel * CreateTwoHopsOutboundTestTunnel (InboundTunnel * replyTunnel);
|
|
||||||
InboundTunnel * CreateTwoHopsInboundTestTunnel (OutboundTunnel * outboundTunnel = 0);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void Run ();
|
void Run ();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user