mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 11:17:49 +02:00
implement restricted routes (initial)
This commit is contained in:
parent
b9cbdb2dc4
commit
74a7e67002
9 changed files with 87 additions and 10 deletions
11
Transports.h
11
Transports.h
|
@ -98,6 +98,13 @@ namespace transport
|
|||
size_t GetNumPeers () const { return m_Peers.size (); };
|
||||
std::shared_ptr<const i2p::data::RouterInfo> GetRandomPeer () const;
|
||||
|
||||
/** get a trusted first hop for restricted routes */
|
||||
std::shared_ptr<const i2p::data::RouterInfo> GetRestrictedPeer() const;
|
||||
/** do we want to use restricted routes? */
|
||||
bool RoutesRestricted() const;
|
||||
/** restrict routes to use only these router families for first hops */
|
||||
void RestrictRoutes(std::vector<std::string> families);
|
||||
|
||||
void PeerTest ();
|
||||
|
||||
private:
|
||||
|
@ -140,6 +147,10 @@ namespace transport
|
|||
uint64_t m_LastInBandwidthUpdateBytes, m_LastOutBandwidthUpdateBytes;
|
||||
uint64_t m_LastBandwidthUpdateTime;
|
||||
|
||||
/** which router families to trust for first hops */
|
||||
std::vector<std::string> m_TrustedFamilies;
|
||||
mutable std::mutex m_FamilyMutex;
|
||||
|
||||
public:
|
||||
|
||||
// for HTTP only
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue