2013-11-11 03:19:49 +04:00
|
|
|
#ifndef TUNNEL_BASE_H__
|
|
|
|
#define TUNNEL_BASE_H__
|
|
|
|
|
|
|
|
#include <inttypes.h>
|
2013-11-13 16:56:16 +04:00
|
|
|
#include "I2NPProtocol.h"
|
2013-11-11 03:19:49 +04:00
|
|
|
|
|
|
|
namespace i2p
|
|
|
|
{
|
|
|
|
namespace tunnel
|
|
|
|
{
|
2013-11-23 05:41:28 +04:00
|
|
|
const size_t TUNNEL_DATA_MSG_SIZE = 1028;
|
|
|
|
const size_t TUNNEL_DATA_MAX_PAYLOAD_SIZE = 1003;
|
|
|
|
|
2013-11-11 03:19:49 +04:00
|
|
|
enum TunnelDeliveryType
|
|
|
|
{
|
|
|
|
eDeliveryTypeLocal = 0,
|
|
|
|
eDeliveryTypeTunnel = 1,
|
|
|
|
eDeliveryTypeRouter = 2
|
|
|
|
};
|
|
|
|
struct TunnelMessageBlock
|
|
|
|
{
|
|
|
|
TunnelDeliveryType deliveryType;
|
|
|
|
uint32_t tunnelID;
|
|
|
|
uint8_t hash[32];
|
|
|
|
I2NPMessage * data;
|
|
|
|
};
|
2013-11-13 16:56:16 +04:00
|
|
|
|
|
|
|
class TunnelBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual void EncryptTunnelMsg (I2NPMessage * tunnelMsg) = 0;
|
|
|
|
virtual uint32_t GetNextTunnelID () const = 0;
|
|
|
|
virtual const uint8_t * GetNextIdentHash () const = 0;
|
|
|
|
};
|
2013-11-11 03:19:49 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|