mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 03:53:44 +02:00
Remove a few old comments
This commit is contained in:
parent
e7891bfcb0
commit
b1ddba0438
2 changed files with 15 additions and 8 deletions
|
@ -87,7 +87,9 @@ public:
|
||||||
std::string policyAlias() { return _policyAlias; }
|
std::string policyAlias() { return _policyAlias; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inform the bond about the path that its peer (owning object) just learned about
|
* Inform the bond about the path that its peer (owning object) just learned about.
|
||||||
|
* If the path is allowed to be used, it will be inducted into the bond on a trial
|
||||||
|
* period where link statistics will be collected to judge its quality.
|
||||||
*
|
*
|
||||||
* @param path Newly-learned Path which should now be handled by the Bond
|
* @param path Newly-learned Path which should now be handled by the Bond
|
||||||
* @param now Current time
|
* @param now Current time
|
||||||
|
|
|
@ -1630,7 +1630,6 @@ public:
|
||||||
// Custom Policies
|
// Custom Policies
|
||||||
json &customBondingPolicies = settings["policies"];
|
json &customBondingPolicies = settings["policies"];
|
||||||
for (json::iterator policyItr = customBondingPolicies.begin(); policyItr != customBondingPolicies.end();++policyItr) {
|
for (json::iterator policyItr = customBondingPolicies.begin(); policyItr != customBondingPolicies.end();++policyItr) {
|
||||||
//fprintf(stderr, "\n\n--- (%s)\n", policyItr.key().c_str());
|
|
||||||
// Custom Policy
|
// Custom Policy
|
||||||
std::string customPolicyStr(policyItr.key());
|
std::string customPolicyStr(policyItr.key());
|
||||||
json &customPolicy = policyItr.value();
|
json &customPolicy = policyItr.value();
|
||||||
|
@ -1684,7 +1683,6 @@ public:
|
||||||
// Policy-Specific link set
|
// Policy-Specific link set
|
||||||
json &links = customPolicy["links"];
|
json &links = customPolicy["links"];
|
||||||
for (json::iterator linkItr = links.begin(); linkItr != links.end();++linkItr) {
|
for (json::iterator linkItr = links.begin(); linkItr != links.end();++linkItr) {
|
||||||
//fprintf(stderr, "\t--- link (%s)\n", linkItr.key().c_str());
|
|
||||||
std::string linkNameStr(linkItr.key());
|
std::string linkNameStr(linkItr.key());
|
||||||
json &link = linkItr.value();
|
json &link = linkItr.value();
|
||||||
|
|
||||||
|
@ -1719,12 +1717,19 @@ public:
|
||||||
}
|
}
|
||||||
_node->bondController()->addCustomLink(customPolicyStr, new Link(linkNameStr,ipvPref,speed,linkMonitorInterval,upDelay,downDelay,enabled,linkMode,failoverToStr,alloc));
|
_node->bondController()->addCustomLink(customPolicyStr, new Link(linkNameStr,ipvPref,speed,linkMonitorInterval,upDelay,downDelay,enabled,linkMode,failoverToStr,alloc));
|
||||||
}
|
}
|
||||||
// TODO: This is dumb
|
|
||||||
std::string linkSelectMethodStr(OSUtils::jsonString(customPolicy["activeReselect"],"optimize"));
|
std::string linkSelectMethodStr(OSUtils::jsonString(customPolicy["activeReselect"],"optimize"));
|
||||||
if (linkSelectMethodStr == "always") { newTemplateBond->setLinkSelectMethod(ZT_MULTIPATH_RESELECTION_POLICY_ALWAYS); }
|
if (linkSelectMethodStr == "always") {
|
||||||
if (linkSelectMethodStr == "better") { newTemplateBond->setLinkSelectMethod(ZT_MULTIPATH_RESELECTION_POLICY_BETTER); }
|
newTemplateBond->setLinkSelectMethod(ZT_MULTIPATH_RESELECTION_POLICY_ALWAYS);
|
||||||
if (linkSelectMethodStr == "failure") { newTemplateBond->setLinkSelectMethod(ZT_MULTIPATH_RESELECTION_POLICY_FAILURE); }
|
}
|
||||||
if (linkSelectMethodStr == "optimize") { newTemplateBond->setLinkSelectMethod(ZT_MULTIPATH_RESELECTION_POLICY_OPTIMIZE); }
|
if (linkSelectMethodStr == "better") {
|
||||||
|
newTemplateBond->setLinkSelectMethod(ZT_MULTIPATH_RESELECTION_POLICY_BETTER);
|
||||||
|
}
|
||||||
|
if (linkSelectMethodStr == "failure") {
|
||||||
|
newTemplateBond->setLinkSelectMethod(ZT_MULTIPATH_RESELECTION_POLICY_FAILURE);
|
||||||
|
}
|
||||||
|
if (linkSelectMethodStr == "optimize") {
|
||||||
|
newTemplateBond->setLinkSelectMethod(ZT_MULTIPATH_RESELECTION_POLICY_OPTIMIZE);
|
||||||
|
}
|
||||||
if (newTemplateBond->getLinkSelectMethod() < 0 || newTemplateBond->getLinkSelectMethod() > 3) {
|
if (newTemplateBond->getLinkSelectMethod() < 0 || newTemplateBond->getLinkSelectMethod() > 3) {
|
||||||
fprintf(stderr, "warning: invalid value (%s) for linkSelectMethod, assuming mode: always\n", linkSelectMethodStr.c_str());
|
fprintf(stderr, "warning: invalid value (%s) for linkSelectMethod, assuming mode: always\n", linkSelectMethodStr.c_str());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue