mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
transit tunnel
This commit is contained in:
parent
18ec2e9ce8
commit
84301daeb8
7 changed files with 561 additions and 0 deletions
41
TunnelGateway.h
Normal file
41
TunnelGateway.h
Normal file
|
@ -0,0 +1,41 @@
|
|||
#ifndef TUNNEL_GATEWAY_H__
|
||||
#define TUNNEL_GATEWAY_H__
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <vector>
|
||||
#include "I2NPProtocol.h"
|
||||
#include "TunnelBase.h"
|
||||
|
||||
namespace i2p
|
||||
{
|
||||
namespace tunnel
|
||||
{
|
||||
class TunnelGatewayBuffer
|
||||
{
|
||||
struct TunnelMessageBlockExt: public TunnelMessageBlock
|
||||
{
|
||||
size_t deliveryInstructionsLen, totalLen;
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
void PutI2NPMsg (const uint8_t * gwHash, uint32_t gwTunnel, I2NPMessage * msg);
|
||||
std::vector<I2NPMessage *> GetTunnelDataMsgs (uint32_t tunnelID);
|
||||
|
||||
private:
|
||||
|
||||
size_t CreateFirstFragment (TunnelMessageBlockExt * block, uint8_t * buf, size_t len);
|
||||
size_t CreateFollowOnFragment (TunnelMessageBlockExt * block, uint8_t * buf, size_t len);
|
||||
I2NPMessage * CreateNextTunnelMessage (uint32_t tunnelID, int from, int to, size_t size);
|
||||
|
||||
private:
|
||||
|
||||
std::vector<TunnelMessageBlockExt *> m_I2NPMsgs;
|
||||
// for fragmented messages
|
||||
size_t m_NextOffset, m_NextSeqn;
|
||||
uint32_t m_NextMsgID;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue