diff options
author | Grant Limberg <glimberg@gmail.com> | 2015-09-26 13:47:55 -0700 |
---|---|---|
committer | Grant Limberg <glimberg@gmail.com> | 2015-09-26 13:47:55 -0700 |
commit | e8cdff3eafd8096da22122eabddf57a09fe2bb90 (patch) | |
tree | d231aa6d9ccccc8ced6e1ead606ce16ff551cab9 /node/SelfAwareness.hpp | |
parent | 53d98343b7b444508259f6f1643e8d6724fb11e9 (diff) | |
parent | f69454ec9879a0b0a424f743ca144d1123ef7e99 (diff) | |
download | infinitytier-e8cdff3eafd8096da22122eabddf57a09fe2bb90.tar.gz infinitytier-e8cdff3eafd8096da22122eabddf57a09fe2bb90.zip |
Merge branch 'adamierymenko-dev' into android-jni-dev
also update for changed function calls that now accept a local address
# Conflicts:
# include/ZeroTierOne.h
# java/CMakeLists.txt
# java/jni/Android.mk
# java/jni/ZT1_jnicache.cpp
# java/jni/ZT1_jnilookup.h
# java/jni/ZT1_jniutils.cpp
# java/jni/com_zerotierone_sdk_Node.cpp
Diffstat (limited to 'node/SelfAwareness.hpp')
-rw-r--r-- | node/SelfAwareness.hpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/node/SelfAwareness.hpp b/node/SelfAwareness.hpp index d3b79d18..3133553e 100644 --- a/node/SelfAwareness.hpp +++ b/node/SelfAwareness.hpp @@ -28,10 +28,9 @@ #ifndef ZT_SELFAWARENESS_HPP #define ZT_SELFAWARENESS_HPP -#include <map> -#include <vector> - +#include "Constants.hpp" #include "InetAddress.hpp" +#include "Hashtable.hpp" #include "Address.hpp" #include "Mutex.hpp" @@ -66,17 +65,14 @@ public: */ void clean(uint64_t now); - /** - * @return True if our external (global scope) IPv4 ports appear to be randomized by a NAT device - */ - bool areGlobalIPv4PortsRandomized() const; - private: struct PhySurfaceKey { Address reporter; InetAddress::IpScope scope; + inline unsigned long hashCode() const throw() { return ((unsigned long)reporter.toInt() + (unsigned long)scope); } + PhySurfaceKey() : reporter(),scope(InetAddress::IP_SCOPE_NONE) {} PhySurfaceKey(const Address &r,InetAddress::IpScope s) : reporter(r),scope(s) {} inline bool operator<(const PhySurfaceKey &k) const throw() { return ((reporter < k.reporter) ? true : ((reporter == k.reporter) ? ((int)scope < (int)k.scope) : false)); } @@ -93,7 +89,7 @@ private: const RuntimeEnvironment *RR; - std::map< PhySurfaceKey,PhySurfaceEntry > _phy; + Hashtable< PhySurfaceKey,PhySurfaceEntry > _phy; Mutex _phy_m; }; |