mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-14 02:27:38 -07:00
Bunch more cleanup, improvements to NAT traversal logic, finished updating Switch.
This commit is contained in:
parent
ee0f56355b
commit
6eb9289367
11 changed files with 161 additions and 141 deletions
|
@ -137,7 +137,7 @@ public:
|
|||
* @param now Current time
|
||||
* @return Best path or NULL if there are no active (or fixed) direct paths
|
||||
*/
|
||||
Path *getBestPath(uint64_t now)
|
||||
inline Path *getBestPath(uint64_t now)
|
||||
{
|
||||
Path *bestPath = (Path *)0;
|
||||
uint64_t lrMax = 0;
|
||||
|
@ -150,6 +150,25 @@ public:
|
|||
return bestPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send via best path
|
||||
*
|
||||
* @param RR Runtime environment
|
||||
* @param data Packet data
|
||||
* @param len Packet length
|
||||
* @param now Current time
|
||||
* @return Path used on success or NULL on failure
|
||||
*/
|
||||
inline Path *send(const RuntimeEnvironment *RR,const void *data,unsigned int len,uint64_t now)
|
||||
{
|
||||
Path *bestPath = getBestPath(now);
|
||||
if (bestPath) {
|
||||
if (bestPath->send(RR,data,len,now))
|
||||
return bestPath;
|
||||
}
|
||||
return (Path *)0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return All known direct paths to this peer
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue