Implemented empirical determination of external addressing, paritioned per scope.

This commit is contained in:
Adam Ierymenko 2015-04-07 11:56:10 -07:00
parent 817824b88b
commit 52c3b7c34e
10 changed files with 102 additions and 95 deletions

View file

@ -230,10 +230,9 @@ public:
inline uint64_t lastAnnouncedTo() const throw() { return _lastAnnouncedTo; }
/**
* @param now Current time
* @return True if peer has received something within ZT_PEER_ACTIVITY_TIMEOUT ms
* @return True if peer has received an actual data frame within ZT_PEER_ACTIVITY_TIMEOUT milliseconds
*/
inline bool alive(uint64_t now) const throw() { return ((now - _lastReceive) < ZT_PEER_ACTIVITY_TIMEOUT); }
inline uint64_t alive(uint64_t now) const throw() { return ((now - lastFrame()) < ZT_PEER_ACTIVITY_TIMEOUT); }
/**
* @return Current latency or 0 if unknown (max: 65535)
@ -292,6 +291,20 @@ public:
*/
void clearPaths(bool fixedToo);
/**
* Reset paths within a given scope
*
* For fixed paths in this scope, a packet is sent. Non-fixed paths in this
* scope are forgotten. If there are no paths remaining, a message is sent
* indirectly to reestablish connectivity if we're actively exchanging
* data with this peer (alive).
*
* @param RR Runtime environment
* @param scope IP scope of paths to reset
* @param now Current time
*/
void resetWithinScope(const RuntimeEnvironment *RR,InetAddress::IpScope scope,uint64_t now);
/**
* @return 256-bit secret symmetric encryption key
*/