mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-15 21:58:21 +00:00
Push remote surface as reported by peers along with known interface direct paths to assist with (some) NAT traversal. (trying this, may back out if not effective)
This commit is contained in:
@ -29,6 +29,7 @@
|
||||
#define ZT_SELFAWARENESS_HPP
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
#include "InetAddress.hpp"
|
||||
#include "Address.hpp"
|
||||
@ -65,6 +66,19 @@ public:
|
||||
*/
|
||||
void clean(uint64_t now);
|
||||
|
||||
/**
|
||||
* @return List of external surface addresses as reported by peers
|
||||
*/
|
||||
inline std::vector< std::pair<Address,InetAddress> > getReportedSurface() const
|
||||
{
|
||||
std::vector< std::pair<Address,InetAddress> > r;
|
||||
Mutex::Lock _l(_phy_m);
|
||||
r.reserve(_phy.size());
|
||||
for(std::map< PhySurfaceKey,PhySurfaceEntry >::const_iterator p(_phy.begin());p!=_phy.end();)
|
||||
r.push_back(std::pair<Address,InetAddress>(p->first.reporter,p->second.mySurface));
|
||||
return r;
|
||||
}
|
||||
|
||||
private:
|
||||
struct PhySurfaceKey
|
||||
{
|
||||
|
Reference in New Issue
Block a user