summaryrefslogtreecommitdiff
path: root/node/Path.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-10-06 17:56:47 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-10-06 17:56:47 -0700
commit876aa0883d66340960381ec6388c55b23e5d2b5e (patch)
tree918e1246e2cb98fe74037ff083dcceb475bc6802 /node/Path.hpp
parent36db5865e7ab4ed92ede99f10835fba40e9b9fd8 (diff)
parent477feee8a3fbc84d00c2939b5fc8a9bbf19af2ca (diff)
downloadinfinitytier-876aa0883d66340960381ec6388c55b23e5d2b5e.tar.gz
infinitytier-876aa0883d66340960381ec6388c55b23e5d2b5e.zip
Merge branch 'adamierymenko-dev' into netcon
Diffstat (limited to 'node/Path.hpp')
-rw-r--r--node/Path.hpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/node/Path.hpp b/node/Path.hpp
index 1f947911..6a69e071 100644
--- a/node/Path.hpp
+++ b/node/Path.hpp
@@ -57,13 +57,13 @@ public:
* Nearly all paths will be normal trust. The other levels are for high
* performance local SDN use only.
*
- * These values MUST match ZT1_LocalInterfaceAddressTrust in ZeroTierOne.h
+ * These values MUST match ZT_LocalInterfaceAddressTrust in ZeroTierOne.h
*/
- enum Trust
+ enum Trust // NOTE: max 255
{
TRUST_NORMAL = 0,
- TRUST_PRIVACY = 1,
- TRUST_ULTIMATE = 2
+ TRUST_PRIVACY = 10,
+ TRUST_ULTIMATE = 20
};
Path() :
@@ -114,7 +114,7 @@ public:
*/
inline bool reliable() const throw()
{
- return ((_ipScope != InetAddress::IP_SCOPE_GLOBAL)&&(_ipScope != InetAddress::IP_SCOPE_PSEUDOPRIVATE));
+ return ( (_addr.ss_family == AF_INET6) || ((_ipScope != InetAddress::IP_SCOPE_GLOBAL)&&(_ipScope != InetAddress::IP_SCOPE_PSEUDOPRIVATE)) );
}
/**
@@ -122,14 +122,6 @@ public:
*/
inline operator bool() const throw() { return (_addr); }
- // Comparisons are by address only
- inline bool operator==(const Path &p) const throw() { return (_addr == p._addr); }
- inline bool operator!=(const Path &p) const throw() { return (_addr != p._addr); }
- inline bool operator<(const Path &p) const throw() { return (_addr < p._addr); }
- inline bool operator>(const Path &p) const throw() { return (_addr > p._addr); }
- inline bool operator<=(const Path &p) const throw() { return (_addr <= p._addr); }
- inline bool operator>=(const Path &p) const throw() { return (_addr >= p._addr); }
-
/**
* Check whether this address is valid for a ZeroTier path
*
@@ -163,7 +155,7 @@ public:
return false;
}
-private:
+protected:
InetAddress _addr;
InetAddress::IpScope _ipScope; // memoize this since it's a computed value checked often
Trust _trust;