|
|
@ -182,6 +182,15 @@ namespace tunnel |
|
|
|
return ret; |
|
|
|
return ret; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Tunnel::PrintHops (std::stringstream& s) const |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
for (auto& it: m_Hops) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
s << "-->"; |
|
|
|
|
|
|
|
s << i2p::data::GetIdentHashAbbreviation (it->ident->GetIdentHash ()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void InboundTunnel::HandleTunnelDataMsg (std::shared_ptr<const I2NPMessage> msg) |
|
|
|
void InboundTunnel::HandleTunnelDataMsg (std::shared_ptr<const I2NPMessage> msg) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (IsFailed ()) SetState (eTunnelStateEstablished); // incoming messages means a tunnel is alive
|
|
|
|
if (IsFailed ()) SetState (eTunnelStateEstablished); // incoming messages means a tunnel is alive
|
|
|
@ -193,9 +202,8 @@ namespace tunnel |
|
|
|
|
|
|
|
|
|
|
|
void InboundTunnel::Print (std::stringstream& s) const |
|
|
|
void InboundTunnel::Print (std::stringstream& s) const |
|
|
|
{ |
|
|
|
{ |
|
|
|
s << "-->" << i2p::data::GetIdentHashAbbreviation (GetNextIdentHash ()) << ":" << GetNextTunnelID (); |
|
|
|
PrintHops (s); |
|
|
|
s << "-->" << (GetNumHops () - 1) << " hops "; |
|
|
|
s << "-->" << GetTunnelID () << ":me"; |
|
|
|
s << GetTunnelID () << ":me"; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void OutboundTunnel::SendTunnelDataMsg (const uint8_t * gwHash, uint32_t gwTunnel, std::shared_ptr<i2p::I2NPMessage> msg) |
|
|
|
void OutboundTunnel::SendTunnelDataMsg (const uint8_t * gwHash, uint32_t gwTunnel, std::shared_ptr<i2p::I2NPMessage> msg) |
|
|
@ -235,8 +243,9 @@ namespace tunnel |
|
|
|
|
|
|
|
|
|
|
|
void OutboundTunnel::Print (std::stringstream& s) const |
|
|
|
void OutboundTunnel::Print (std::stringstream& s) const |
|
|
|
{ |
|
|
|
{ |
|
|
|
s << "me-->" << i2p::data::GetIdentHashAbbreviation (GetNextIdentHash ()) << ":" << GetNextTunnelID (); |
|
|
|
s << GetTunnelID () << ":me"; |
|
|
|
s << "-->" << (GetNumHops () - 1) << " hops-->"; |
|
|
|
PrintHops (s); |
|
|
|
|
|
|
|
s << "-->"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Tunnels tunnels; |
|
|
|
Tunnels tunnels; |
|
|
|