|
|
|
@ -18,6 +18,7 @@
@@ -18,6 +18,7 @@
|
|
|
|
|
#include <thread> |
|
|
|
|
#include <mutex> |
|
|
|
|
#include <memory> |
|
|
|
|
#include "util.h" |
|
|
|
|
#include "Queue.h" |
|
|
|
|
#include "Crypto.h" |
|
|
|
|
#include "TunnelConfig.h" |
|
|
|
@ -40,6 +41,8 @@ namespace tunnel
@@ -40,6 +41,8 @@ namespace tunnel
|
|
|
|
|
const int MAX_NUM_RECORDS = 8; |
|
|
|
|
const int HIGH_LATENCY_PER_HOP = 250; // in milliseconds
|
|
|
|
|
|
|
|
|
|
const size_t I2NP_TUNNEL_ENPOINT_MESSAGE_SIZE = 2*TUNNEL_DATA_MSG_SIZE + I2NP_HEADER_SIZE + TUNNEL_GATEWAY_HEADER_SIZE + 28; // reserved for alignment and NTCP 16 + 6 + 6
|
|
|
|
|
|
|
|
|
|
enum TunnelState |
|
|
|
|
{ |
|
|
|
|
eTunnelStatePending, |
|
|
|
@ -219,6 +222,8 @@ namespace tunnel
@@ -219,6 +222,8 @@ namespace tunnel
|
|
|
|
|
void DeleteTunnelPool (std::shared_ptr<TunnelPool> pool); |
|
|
|
|
void StopTunnelPool (std::shared_ptr<TunnelPool> pool); |
|
|
|
|
|
|
|
|
|
std::shared_ptr<I2NPMessage> NewI2NPTunnelMessage (); |
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
|
|
|
|
|
template<class TTunnel> |
|
|
|
@ -257,6 +262,7 @@ namespace tunnel
@@ -257,6 +262,7 @@ namespace tunnel
|
|
|
|
|
std::list<std::shared_ptr<TunnelPool>> m_Pools; |
|
|
|
|
std::shared_ptr<TunnelPool> m_ExploratoryPool; |
|
|
|
|
i2p::util::Queue<std::shared_ptr<I2NPMessage> > m_Queue; |
|
|
|
|
i2p::util::MemoryPoolMt<I2NPMessageBuffer<I2NP_TUNNEL_ENPOINT_MESSAGE_SIZE> > m_I2NPTunnelMessagesMemoryPool; |
|
|
|
|
|
|
|
|
|
// some stats
|
|
|
|
|
int m_NumSuccesiveTunnelCreations, m_NumFailedTunnelCreations; |
|
|
|
|