2013-11-10 23:19:49 +00:00
|
|
|
#ifndef TUNNEL_ENDPOINT_H__
|
|
|
|
#define TUNNEL_ENDPOINT_H__
|
|
|
|
|
|
|
|
#include <inttypes.h>
|
|
|
|
#include <map>
|
|
|
|
#include <string>
|
|
|
|
#include "I2NPProtocol.h"
|
|
|
|
#include "TunnelBase.h"
|
|
|
|
|
|
|
|
namespace i2p
|
|
|
|
{
|
|
|
|
namespace tunnel
|
|
|
|
{
|
|
|
|
class TunnelEndpoint
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2013-12-10 13:10:49 +00:00
|
|
|
TunnelEndpoint (): m_NumReceivedBytes (0) {};
|
|
|
|
size_t GetNumReceivedBytes () const { return m_NumReceivedBytes; };
|
|
|
|
|
2013-11-10 23:19:49 +00:00
|
|
|
void HandleDecryptedTunnelDataMsg (I2NPMessage * msg);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
void HandleNextMessage (const TunnelMessageBlock& msg);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2014-06-11 14:56:20 +00:00
|
|
|
struct TunnelMessageBlockEx: public TunnelMessageBlock
|
|
|
|
{
|
|
|
|
uint8_t nextFragmentNum;
|
|
|
|
};
|
|
|
|
|
|
|
|
std::map<uint32_t, TunnelMessageBlockEx> m_IncompleteMessages;
|
2013-12-10 13:10:49 +00:00
|
|
|
size_t m_NumReceivedBytes;
|
2013-11-10 23:19:49 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|