move tunnel build request/reply code from I2NPProtocol.cpp to Tunnel.cpp

This commit is contained in:
orignal
2024-11-09 17:25:43 -05:00
parent 002d8c7773
commit c5e464a8b5
6 changed files with 114 additions and 133 deletions

View File

@@ -122,8 +122,11 @@ namespace tunnel
}
}
void HandleShortTransitTunnelBuildMsg (uint8_t * buf, size_t len)
void HandleShortTransitTunnelBuildMsg (std::shared_ptr<I2NPMessage> msg)
{
if (!msg) return;
uint8_t * buf = msg->GetPayload();
size_t len = msg->GetPayloadLength();
int num = buf[0];
LogPrint (eLogDebug, "TransitTunnel: ShortTunnelBuild ", num, " records");
if (num > i2p::tunnel::MAX_NUM_RECORDS)
@@ -359,8 +362,11 @@ namespace tunnel
return false;
}
void HandleVariableTransitTunnelBuildMsg (uint8_t * buf, size_t len)
void HandleVariableTransitTunnelBuildMsg (std::shared_ptr<I2NPMessage> msg)
{
if (!msg) return;
uint8_t * buf = msg->GetPayload();
size_t len = msg->GetPayloadLength();
int num = buf[0];
LogPrint (eLogDebug, "TransitTunnel: VariableTunnelBuild ", num, " records");
if (num > i2p::tunnel::MAX_NUM_RECORDS)