|
|
@ -27,19 +27,19 @@ namespace data |
|
|
|
RequestedDestination (const IdentHash& destination, bool isLeaseSet, |
|
|
|
RequestedDestination (const IdentHash& destination, bool isLeaseSet, |
|
|
|
bool isExploratory = false, i2p::tunnel::TunnelPool * pool = nullptr): |
|
|
|
bool isExploratory = false, i2p::tunnel::TunnelPool * pool = nullptr): |
|
|
|
m_Destination (destination), m_IsLeaseSet (isLeaseSet), m_IsExploratory (isExploratory), |
|
|
|
m_Destination (destination), m_IsLeaseSet (isLeaseSet), m_IsExploratory (isExploratory), |
|
|
|
m_Pool (pool), m_LastRouter (nullptr), m_CreationTime (0) {}; |
|
|
|
m_Pool (pool), m_CreationTime (0) {}; |
|
|
|
|
|
|
|
|
|
|
|
const IdentHash& GetDestination () const { return m_Destination; }; |
|
|
|
const IdentHash& GetDestination () const { return m_Destination; }; |
|
|
|
int GetNumExcludedPeers () const { return m_ExcludedPeers.size (); }; |
|
|
|
int GetNumExcludedPeers () const { return m_ExcludedPeers.size (); }; |
|
|
|
const std::set<IdentHash>& GetExcludedPeers () { return m_ExcludedPeers; }; |
|
|
|
const std::set<IdentHash>& GetExcludedPeers () { return m_ExcludedPeers; }; |
|
|
|
void ClearExcludedPeers (); |
|
|
|
void ClearExcludedPeers (); |
|
|
|
const RouterInfo * GetLastRouter () const { return m_LastRouter; }; |
|
|
|
std::shared_ptr<const RouterInfo> GetLastRouter () const { return m_LastRouter; }; |
|
|
|
i2p::tunnel::TunnelPool * GetTunnelPool () { return m_Pool; }; |
|
|
|
i2p::tunnel::TunnelPool * GetTunnelPool () { return m_Pool; }; |
|
|
|
bool IsExploratory () const { return m_IsExploratory; }; |
|
|
|
bool IsExploratory () const { return m_IsExploratory; }; |
|
|
|
bool IsLeaseSet () const { return m_IsLeaseSet; }; |
|
|
|
bool IsLeaseSet () const { return m_IsLeaseSet; }; |
|
|
|
bool IsExcluded (const IdentHash& ident) const { return m_ExcludedPeers.count (ident); }; |
|
|
|
bool IsExcluded (const IdentHash& ident) const { return m_ExcludedPeers.count (ident); }; |
|
|
|
uint64_t GetCreationTime () const { return m_CreationTime; }; |
|
|
|
uint64_t GetCreationTime () const { return m_CreationTime; }; |
|
|
|
I2NPMessage * CreateRequestMessage (const RouterInfo * router, const i2p::tunnel::InboundTunnel * replyTunnel); |
|
|
|
I2NPMessage * CreateRequestMessage (std::shared_ptr<const RouterInfo>, const i2p::tunnel::InboundTunnel * replyTunnel); |
|
|
|
I2NPMessage * CreateRequestMessage (const IdentHash& floodfill); |
|
|
|
I2NPMessage * CreateRequestMessage (const IdentHash& floodfill); |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
@ -48,7 +48,7 @@ namespace data |
|
|
|
bool m_IsLeaseSet, m_IsExploratory; |
|
|
|
bool m_IsLeaseSet, m_IsExploratory; |
|
|
|
i2p::tunnel::TunnelPool * m_Pool; |
|
|
|
i2p::tunnel::TunnelPool * m_Pool; |
|
|
|
std::set<IdentHash> m_ExcludedPeers; |
|
|
|
std::set<IdentHash> m_ExcludedPeers; |
|
|
|
const RouterInfo * m_LastRouter; |
|
|
|
std::shared_ptr<const RouterInfo> m_LastRouter; |
|
|
|
uint64_t m_CreationTime; |
|
|
|
uint64_t m_CreationTime; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -64,7 +64,7 @@ namespace data |
|
|
|
|
|
|
|
|
|
|
|
void AddRouterInfo (const IdentHash& ident, const uint8_t * buf, int len); |
|
|
|
void AddRouterInfo (const IdentHash& ident, const uint8_t * buf, int len); |
|
|
|
void AddLeaseSet (const IdentHash& ident, const uint8_t * buf, int len, i2p::tunnel::InboundTunnel * from); |
|
|
|
void AddLeaseSet (const IdentHash& ident, const uint8_t * buf, int len, i2p::tunnel::InboundTunnel * from); |
|
|
|
RouterInfo * FindRouter (const IdentHash& ident) const; |
|
|
|
std::shared_ptr<RouterInfo> FindRouter (const IdentHash& ident) const; |
|
|
|
LeaseSet * FindLeaseSet (const IdentHash& destination) const; |
|
|
|
LeaseSet * FindLeaseSet (const IdentHash& destination) const; |
|
|
|
|
|
|
|
|
|
|
|
void PublishLeaseSet (const LeaseSet * leaseSet, i2p::tunnel::TunnelPool * pool); |
|
|
|
void PublishLeaseSet (const LeaseSet * leaseSet, i2p::tunnel::TunnelPool * pool); |
|
|
@ -95,7 +95,7 @@ namespace data |
|
|
|
void Run (); // exploratory thread
|
|
|
|
void Run (); // exploratory thread
|
|
|
|
void Explore (int numDestinations); |
|
|
|
void Explore (int numDestinations); |
|
|
|
void Publish (); |
|
|
|
void Publish (); |
|
|
|
const RouterInfo * GetClosestFloodfill (const IdentHash& destination, const std::set<IdentHash>& excluded) const; |
|
|
|
std::shared_ptr<const RouterInfo> GetClosestFloodfill (const IdentHash& destination, const std::set<IdentHash>& excluded) const; |
|
|
|
void ManageLeaseSets (); |
|
|
|
void ManageLeaseSets (); |
|
|
|
|
|
|
|
|
|
|
|
RequestedDestination * CreateRequestedDestination (const IdentHash& dest, |
|
|
|
RequestedDestination * CreateRequestedDestination (const IdentHash& dest, |
|
|
|