I2P: End-to-End encrypted and anonymous Internet https://i2pd.website/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
836 B

10 years ago
#ifndef TUNNEL_POOL__
#define TUNNEL_POOL__
#include <set>
#include <vector>
#include "Identity.h"
10 years ago
#include "LeaseSet.h"
#include "I2NPProtocol.h"
#include "TunnelBase.h"
10 years ago
namespace i2p
{
namespace tunnel
{
class Tunnel;
class InboundTunnel;
class OutboundTunnel;
class TunnelPool // per local destination
{
public:
TunnelPool (i2p::data::LocalDestination * owner, int numTunnels = 5);
10 years ago
~TunnelPool ();
void CreateTunnels ();
void TunnelCreated (InboundTunnel * createdTunnel);
std::vector<InboundTunnel *> GetInboundTunnels (int num) const;
void ManageTunnels ();
private:
void CreateInboundTunnel ();
10 years ago
private:
i2p::data::LocalDestination * m_Owner;
int m_NumTunnels;
std::set<InboundTunnel *, TunnelCreationTimeCmp> m_InboundTunnels; // recent tunnel appears first
10 years ago
};
}
}
#endif