Browse Source

some cleanup

pull/50/head
orignal 11 years ago
parent
commit
d7a584f48f
  1. 44
      Tunnel.cpp
  2. 5
      Tunnel.h

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

@ -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…
Cancel
Save