mgmt: refactor StrategyChoiceManager to use StrategyChoiceOptions (from FibManagementOptions)
refs: #1311
Change-Id: I104acede81d2ff00607b37ebccf741836aee3efb
diff --git a/daemon/mgmt/strategy-choice-manager.cpp b/daemon/mgmt/strategy-choice-manager.cpp
index 665f4a8..cd4dc5b 100644
--- a/daemon/mgmt/strategy-choice-manager.cpp
+++ b/daemon/mgmt/strategy-choice-manager.cpp
@@ -72,7 +72,7 @@
const Name& command = request->getName();
- ndn::nfd::FibManagementOptions options;
+ ndn::nfd::StrategyChoiceOptions options;
if (!extractOptions(*request, options))
{
sendResponse(command, 400, "Malformed command");
@@ -99,7 +99,7 @@
bool
StrategyChoiceManager::extractOptions(const Interest& request,
- ndn::nfd::FibManagementOptions& extractedOptions)
+ ndn::nfd::StrategyChoiceOptions& extractedOptions)
{
const Name& command = request.getName();
const size_t optionCompIndex =
@@ -121,7 +121,7 @@
}
void
-StrategyChoiceManager::setStrategy(const ndn::nfd::FibManagementOptions& options,
+StrategyChoiceManager::setStrategy(const ndn::nfd::StrategyChoiceOptions& options,
ControlResponse& response)
{
const Name& prefix = options.getName();
@@ -146,7 +146,7 @@
}
void
-StrategyChoiceManager::unsetStrategy(const ndn::nfd::FibManagementOptions& options,
+StrategyChoiceManager::unsetStrategy(const ndn::nfd::StrategyChoiceOptions& options,
ControlResponse& response)
{
static const Name ROOT_PREFIX;
diff --git a/daemon/mgmt/strategy-choice-manager.hpp b/daemon/mgmt/strategy-choice-manager.hpp
index 6313fbb..2232588 100644
--- a/daemon/mgmt/strategy-choice-manager.hpp
+++ b/daemon/mgmt/strategy-choice-manager.hpp
@@ -9,7 +9,7 @@
#include "mgmt/manager-base.hpp"
-#include <ndn-cpp-dev/management/nfd-fib-management-options.hpp>
+#include <ndn-cpp-dev/management/nfd-strategy-choice-options.hpp>
namespace nfd {
@@ -35,16 +35,16 @@
bool
extractOptions(const Interest& request,
- ndn::nfd::FibManagementOptions& extractedOptions);
+ ndn::nfd::StrategyChoiceOptions& extractedOptions);
void
- setStrategy(const ndn::nfd::FibManagementOptions& options,
+ setStrategy(const ndn::nfd::StrategyChoiceOptions& options,
ControlResponse& response);
void
- unsetStrategy(const ndn::nfd::FibManagementOptions& options,
+ unsetStrategy(const ndn::nfd::StrategyChoiceOptions& options,
ControlResponse& response);
private:
diff --git a/tests/mgmt/strategy-choice-manager.cpp b/tests/mgmt/strategy-choice-manager.cpp
index 6577f6d..4703fb7 100644
--- a/tests/mgmt/strategy-choice-manager.cpp
+++ b/tests/mgmt/strategy-choice-manager.cpp
@@ -208,7 +208,7 @@
BOOST_FIXTURE_TEST_CASE(UnsignedCommand, AllStrategiesFixture)
{
- ndn::nfd::FibManagementOptions options;
+ ndn::nfd::StrategyChoiceOptions options;
options.setName("/test");
options.setStrategy("/localhost/nfd/strategy/best-route");
@@ -232,7 +232,7 @@
BOOST_FIXTURE_TEST_CASE(UnauthorizedCommand,
UnauthorizedCommandFixture<StrategyChoiceManagerFixture>)
{
- ndn::nfd::FibManagementOptions options;
+ ndn::nfd::StrategyChoiceOptions options;
options.setName("/test");
options.setStrategy("/localhost/nfd/strategy/best-route");
@@ -256,7 +256,7 @@
BOOST_AUTO_TEST_CASE(UnsupportedVerb)
{
- ndn::nfd::FibManagementOptions options;
+ ndn::nfd::StrategyChoiceOptions options;
options.setStrategy("/localhost/nfd/strategy/test-strategy-b");
Block encodedOptions(options.wireEncode());
@@ -297,7 +297,7 @@
BOOST_AUTO_TEST_CASE(SetStrategies)
{
- ndn::nfd::FibManagementOptions options;
+ ndn::nfd::StrategyChoiceOptions options;
options.setName("/test");
options.setStrategy("/localhost/nfd/strategy/test-strategy-b");
@@ -325,7 +325,7 @@
BOOST_AUTO_TEST_CASE(SetUnsupportedStrategy)
{
- ndn::nfd::FibManagementOptions options;
+ ndn::nfd::StrategyChoiceOptions options;
options.setName("/test");
options.setStrategy("/localhost/nfd/strategy/unit-test-doesnotexist");
@@ -370,7 +370,7 @@
// BOOST_FIXTURE_TEST_CASE(SetNotInstalled, DefaultStrategyOnlyFixture)
// {
// BOOST_REQUIRE(!getStrategyChoice().hasStrategy("/localhost/nfd/strategy/test-strategy-b"));
-// ndn::nfd::FibManagementOptions options;
+// ndn::nfd::StrategyChoiceOptions options;
// options.setName("/test");
// options.setStrategy("/localhost/nfd/strategy/test-strategy-b");
@@ -396,7 +396,7 @@
BOOST_AUTO_TEST_CASE(Unset)
{
- ndn::nfd::FibManagementOptions options;
+ ndn::nfd::StrategyChoiceOptions options;
options.setName("/test");
BOOST_REQUIRE(m_strategyChoice.insert("/test", "/localhost/nfd/strategy/test-strategy-b"));
@@ -426,7 +426,7 @@
BOOST_AUTO_TEST_CASE(UnsetRoot)
{
- ndn::nfd::FibManagementOptions options;
+ ndn::nfd::StrategyChoiceOptions options;
options.setName("/");
Block encodedOptions(options.wireEncode());