mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 21:37:17 +01:00
implemented delivery type tunnel for garlic
This commit is contained in:
parent
fcddf9843d
commit
b02b88627b
24
Garlic.cpp
24
Garlic.cpp
|
@ -312,15 +312,25 @@ namespace garlic
|
|||
LogPrint ("Unexpected I2NP garlic message ", (int)header->typeID);
|
||||
break;
|
||||
}
|
||||
case eGarlicDeliveryTypeRouter:
|
||||
LogPrint ("Garlic type router not implemented");
|
||||
// TODO: implement
|
||||
buf += 32;
|
||||
break;
|
||||
case eGarlicDeliveryTypeTunnel:
|
||||
LogPrint ("Garlic type tunnel not implemented");
|
||||
// TODO: implement
|
||||
{
|
||||
LogPrint ("Garlic type tunnel");
|
||||
uint32_t gwTunnel = be32toh (*(uint32_t *)buf);
|
||||
buf += 4;
|
||||
uint8_t * gwHash = buf;
|
||||
buf += 32;
|
||||
auto tunnel = i2p::tunnel::tunnels.GetNextOutboundTunnel ();
|
||||
if (tunnel) // we have send it through an outbound tunnel
|
||||
{
|
||||
I2NPMessage * msg = CreateI2NPMessage (buf, len - 36);
|
||||
tunnel->SendTunnelDataMsg (gwHash, gwTunnel, msg);
|
||||
}
|
||||
else
|
||||
LogPrint ("No outbound tunnels available for garlic clove");
|
||||
break;
|
||||
}
|
||||
case eGarlicDeliveryTypeRouter:
|
||||
LogPrint ("Garlic type router not supported");
|
||||
buf += 32;
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue