mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-01-31 08:25:38 +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();
|
member["remoteTraceTarget"] = json();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (b.count("remoteTraceLevel")) member["remoteTraceLevel"] = OSUtils::jsonInt(b["remoteTraceLevel"],0ULL);
|
||||||
|
|
||||||
if (b.count("authorized")) {
|
if (b.count("authorized")) {
|
||||||
const bool newAuth = OSUtils::jsonBool(b["authorized"],false);
|
const bool newAuth = OSUtils::jsonBool(b["authorized"],false);
|
||||||
@ -784,6 +785,7 @@ unsigned int EmbeddedNetworkController::handleControlPlaneHttpPOST(
|
|||||||
network["remoteTraceTarget"] = json();
|
network["remoteTraceTarget"] = json();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (b.count("remoteTraceLevel")) network["remoteTraceLevel"] = OSUtils::jsonInt(b["remoteTraceLevel"],0ULL);
|
||||||
|
|
||||||
if (b.count("v4AssignMode")) {
|
if (b.count("v4AssignMode")) {
|
||||||
json nv4m;
|
json nv4m;
|
||||||
@ -1322,6 +1324,7 @@ void EmbeddedNetworkController::_request(
|
|||||||
std::string rtt(OSUtils::jsonString(member["remoteTraceTarget"],""));
|
std::string rtt(OSUtils::jsonString(member["remoteTraceTarget"],""));
|
||||||
if (rtt.length() == 10) {
|
if (rtt.length() == 10) {
|
||||||
nc->remoteTraceTarget = Address(Utils::hexStrToU64(rtt.c_str()));
|
nc->remoteTraceTarget = Address(Utils::hexStrToU64(rtt.c_str()));
|
||||||
|
nc->remoteTraceLevel = (Trace::Level)OSUtils::jsonInt(member["remoteTraceLevel"],0ULL);
|
||||||
} else {
|
} else {
|
||||||
rtt = OSUtils::jsonString(network["remoteTraceTarget"],"");
|
rtt = OSUtils::jsonString(network["remoteTraceTarget"],"");
|
||||||
if (rtt.length() == 10) {
|
if (rtt.length() == 10) {
|
||||||
@ -1329,6 +1332,7 @@ void EmbeddedNetworkController::_request(
|
|||||||
} else {
|
} else {
|
||||||
nc->remoteTraceTarget.zero();
|
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)
|
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("vRev")) member["vRev"] = -1;
|
||||||
if (!member.count("vProto")) member["vProto"] = -1;
|
if (!member.count("vProto")) member["vProto"] = -1;
|
||||||
if (!member.count("remoteTraceTarget")) member["remoteTraceTarget"] = nlohmann::json();
|
if (!member.count("remoteTraceTarget")) member["remoteTraceTarget"] = nlohmann::json();
|
||||||
|
if (!member.count("removeTraceLevel")) member["remoteTraceLevel"] = 0;
|
||||||
member["objtype"] = "member";
|
member["objtype"] = "member";
|
||||||
}
|
}
|
||||||
inline void _initNetwork(nlohmann::json &network)
|
inline void _initNetwork(nlohmann::json &network)
|
||||||
@ -143,6 +144,7 @@ private:
|
|||||||
if (!network.count("ipAssignmentPools")) network["ipAssignmentPools"] = nlohmann::json::array();
|
if (!network.count("ipAssignmentPools")) network["ipAssignmentPools"] = nlohmann::json::array();
|
||||||
if (!network.count("mtu")) network["mtu"] = ZT_DEFAULT_MTU;
|
if (!network.count("mtu")) network["mtu"] = ZT_DEFAULT_MTU;
|
||||||
if (!network.count("remoteTraceTarget")) network["remoteTraceTarget"] = nlohmann::json();
|
if (!network.count("remoteTraceTarget")) network["remoteTraceTarget"] = nlohmann::json();
|
||||||
|
if (!network.count("removeTraceLevel")) network["remoteTraceLevel"] = 0;
|
||||||
if (!network.count("rules")) {
|
if (!network.count("rules")) {
|
||||||
// If unspecified, rules are set to allow anything and behave like a flat L2 segment
|
// If unspecified, rules are set to allow anything and behave like a flat L2 segment
|
||||||
network["rules"] = {{
|
network["rules"] = {{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user