mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-01-18 10:46:33 +00:00
Add remoteTraceLevel to controller.
This commit is contained in:
parent
431716e249
commit
c57198decd
@ -662,6 +662,7 @@ unsigned int EmbeddedNetworkController::handleControlPlaneHttpPOST(
|
||||
member["remoteTraceTarget"] = json();
|
||||
}
|
||||
}
|
||||
if (b.count("remoteTraceLevel")) member["remoteTraceLevel"] = OSUtils::jsonInt(b["remoteTraceLevel"],0ULL);
|
||||
|
||||
if (b.count("authorized")) {
|
||||
const bool newAuth = OSUtils::jsonBool(b["authorized"],false);
|
||||
@ -784,6 +785,7 @@ unsigned int EmbeddedNetworkController::handleControlPlaneHttpPOST(
|
||||
network["remoteTraceTarget"] = json();
|
||||
}
|
||||
}
|
||||
if (b.count("remoteTraceLevel")) network["remoteTraceLevel"] = OSUtils::jsonInt(b["remoteTraceLevel"],0ULL);
|
||||
|
||||
if (b.count("v4AssignMode")) {
|
||||
json nv4m;
|
||||
@ -1322,6 +1324,7 @@ void EmbeddedNetworkController::_request(
|
||||
std::string rtt(OSUtils::jsonString(member["remoteTraceTarget"],""));
|
||||
if (rtt.length() == 10) {
|
||||
nc->remoteTraceTarget = Address(Utils::hexStrToU64(rtt.c_str()));
|
||||
nc->remoteTraceLevel = (Trace::Level)OSUtils::jsonInt(member["remoteTraceLevel"],0ULL);
|
||||
} else {
|
||||
rtt = OSUtils::jsonString(network["remoteTraceTarget"],"");
|
||||
if (rtt.length() == 10) {
|
||||
@ -1329,6 +1332,7 @@ void EmbeddedNetworkController::_request(
|
||||
} else {
|
||||
nc->remoteTraceTarget.zero();
|
||||
}
|
||||
nc->remoteTraceLevel = (Trace::Level)OSUtils::jsonInt(network["remoteTraceLevel"],0ULL);
|
||||
}
|
||||
|
||||
for(std::vector<Address>::const_iterator ab(ns.activeBridges.begin());ab!=ns.activeBridges.end();++ab)
|
||||
|
@ -125,6 +125,7 @@ private:
|
||||
if (!member.count("vRev")) member["vRev"] = -1;
|
||||
if (!member.count("vProto")) member["vProto"] = -1;
|
||||
if (!member.count("remoteTraceTarget")) member["remoteTraceTarget"] = nlohmann::json();
|
||||
if (!member.count("removeTraceLevel")) member["remoteTraceLevel"] = 0;
|
||||
member["objtype"] = "member";
|
||||
}
|
||||
inline void _initNetwork(nlohmann::json &network)
|
||||
@ -143,6 +144,7 @@ private:
|
||||
if (!network.count("ipAssignmentPools")) network["ipAssignmentPools"] = nlohmann::json::array();
|
||||
if (!network.count("mtu")) network["mtu"] = ZT_DEFAULT_MTU;
|
||||
if (!network.count("remoteTraceTarget")) network["remoteTraceTarget"] = nlohmann::json();
|
||||
if (!network.count("removeTraceLevel")) network["remoteTraceLevel"] = 0;
|
||||
if (!network.count("rules")) {
|
||||
// If unspecified, rules are set to allow anything and behave like a flat L2 segment
|
||||
network["rules"] = {{
|
||||
|
Loading…
Reference in New Issue
Block a user