mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-01-30 08:04:04 +00:00
Merge remote-tracking branch 'origin/expose-surface-addresses' into dev
This commit is contained in:
commit
3b11915eab
@ -35,6 +35,7 @@
|
|||||||
#include "NetworkController.hpp"
|
#include "NetworkController.hpp"
|
||||||
#include "Hashtable.hpp"
|
#include "Hashtable.hpp"
|
||||||
#include "Bond.hpp"
|
#include "Bond.hpp"
|
||||||
|
#include "SelfAwareness.hpp"
|
||||||
|
|
||||||
// Bit mask for "expecting reply" hash
|
// Bit mask for "expecting reply" hash
|
||||||
#define ZT_EXPECTING_REPLIES_BUCKET_MASK1 255
|
#define ZT_EXPECTING_REPLIES_BUCKET_MASK1 255
|
||||||
@ -187,6 +188,8 @@ public:
|
|||||||
|
|
||||||
inline const Identity &identity() const { return _RR.identity; }
|
inline const Identity &identity() const { return _RR.identity; }
|
||||||
|
|
||||||
|
inline const std::vector<InetAddress> SurfaceAddresses() const { return _RR.sa->whoami(); }
|
||||||
|
|
||||||
inline Bond *bondController() const { return _RR.bc; }
|
inline Bond *bondController() const { return _RR.bc; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1536,6 +1536,15 @@ public:
|
|||||||
}
|
}
|
||||||
settings["listeningOn"] = boundAddrArray;
|
settings["listeningOn"] = boundAddrArray;
|
||||||
|
|
||||||
|
std::vector<InetAddress> surfaceAddrs = _node-> SurfaceAddresses();
|
||||||
|
auto surfaceAddrArray = json::array();
|
||||||
|
for (int i = 0; i < surfaceAddrs.size(); i++) {
|
||||||
|
char ipBuf[64] = { 0 };
|
||||||
|
surfaceAddrs[i].toString(ipBuf);
|
||||||
|
surfaceAddrArray.push_back(ipBuf);
|
||||||
|
}
|
||||||
|
settings["surfaceAddresses"] = surfaceAddrArray;
|
||||||
|
|
||||||
#ifdef ZT_USE_MINIUPNPC
|
#ifdef ZT_USE_MINIUPNPC
|
||||||
settings["portMappingEnabled"] = OSUtils::jsonBool(settings["portMappingEnabled"],true);
|
settings["portMappingEnabled"] = OSUtils::jsonBool(settings["portMappingEnabled"],true);
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user