diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-07-27 17:02:43 -0700 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-07-27 17:02:43 -0700 |
| commit | f0003ea92277039f70dd6f16920dd2db9fb2fb1e (patch) | |
| tree | c5f67fe41f7cfc78dbb00ceb151e419d81aff2a8 /node/SelfAwareness.hpp | |
| parent | e30ba3e1382b50aa8f393132204f8f27ccfb03f9 (diff) | |
| download | infinitytier-f0003ea92277039f70dd6f16920dd2db9fb2fb1e.tar.gz infinitytier-f0003ea92277039f70dd6f16920dd2db9fb2fb1e.zip | |
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)
Diffstat (limited to 'node/SelfAwareness.hpp')
| -rw-r--r-- | node/SelfAwareness.hpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/node/SelfAwareness.hpp b/node/SelfAwareness.hpp index 4780fa5b..9fcefa62 100644 --- a/node/SelfAwareness.hpp +++ b/node/SelfAwareness.hpp @@ -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 { |
