build: Fixes for the latest reorganizations in ndn-cpp-dev library
Change-Id: I7cdb1e680342f72d90da6bc41028388dc57a22c0
diff --git a/daemon/mgmt/fib-manager.cpp b/daemon/mgmt/fib-manager.cpp
index f99bf1e..01e2cc8 100644
--- a/daemon/mgmt/fib-manager.cpp
+++ b/daemon/mgmt/fib-manager.cpp
@@ -11,10 +11,8 @@
#include "mgmt/internal-face.hpp"
#include "mgmt/app-face.hpp"
-#include <ndn-cpp-dev/management/fib-management-options.hpp>
#include <ndn-cpp-dev/encoding/tlv.hpp>
-
namespace nfd {
NFD_LOG_INIT("FibManager");
@@ -103,7 +101,7 @@
VerbDispatchTable::const_iterator verbProcessor = m_verbDispatch.find (verb);
if (verbProcessor != m_verbDispatch.end())
{
- ndn::FibManagementOptions options;
+ FibManagementOptions options;
if (!extractOptions(request, options))
{
sendResponse(command, 400, "Malformed command");
@@ -120,7 +118,7 @@
NFD_LOG_INFO("command result: processing verb: " << verb);
- ndn::ControlResponse response;
+ ControlResponse response;
(verbProcessor->second)(this, options, response);
sendResponse(command, response);
@@ -135,7 +133,7 @@
bool
FibManager::extractOptions(const Interest& request,
- ndn::FibManagementOptions& extractedOptions)
+ FibManagementOptions& extractedOptions)
{
const Name& command = request.getName();
const size_t optionCompIndex =
@@ -156,8 +154,8 @@
}
void
-FibManager::insertEntry(const ndn::FibManagementOptions& options,
- ndn::ControlResponse& response)
+FibManager::insertEntry(const FibManagementOptions& options,
+ ControlResponse& response)
{
NFD_LOG_DEBUG("insert prefix: " << options.getName());
NFD_LOG_INFO("insert result: OK"
@@ -167,8 +165,8 @@
}
void
-FibManager::deleteEntry(const ndn::FibManagementOptions& options,
- ndn::ControlResponse& response)
+FibManager::deleteEntry(const FibManagementOptions& options,
+ ControlResponse& response)
{
NFD_LOG_DEBUG("delete prefix: " << options.getName());
NFD_LOG_INFO("delete result: OK"
@@ -185,8 +183,8 @@
}
void
-FibManager::addNextHop(const ndn::FibManagementOptions& options,
- ndn::ControlResponse& response)
+FibManager::addNextHop(const FibManagementOptions& options,
+ ControlResponse& response)
{
NFD_LOG_DEBUG("add-nexthop prefix: " << options.getName()
<< " faceid: " << options.getFaceId()
@@ -220,8 +218,8 @@
}
void
-FibManager::removeNextHop(const ndn::FibManagementOptions& options,
- ndn::ControlResponse &response)
+FibManager::removeNextHop(const FibManagementOptions& options,
+ ControlResponse &response)
{
NFD_LOG_DEBUG("remove-nexthop prefix: " << options.getName()
<< " faceid: " << options.getFaceId());
@@ -254,7 +252,7 @@
}
void
-FibManager::strategy(const ndn::FibManagementOptions& options, ndn::ControlResponse& response)
+FibManager::strategy(const FibManagementOptions& options, ControlResponse& response)
{
}
diff --git a/daemon/mgmt/fib-manager.hpp b/daemon/mgmt/fib-manager.hpp
index 3b36aeb..79be094 100644
--- a/daemon/mgmt/fib-manager.hpp
+++ b/daemon/mgmt/fib-manager.hpp
@@ -13,11 +13,12 @@
#include "fw/strategy.hpp"
#include "mgmt/manager-base.hpp"
-#include <ndn-cpp-dev/management/fib-management-options.hpp>
-#include <ndn-cpp-dev/management/control-response.hpp>
+#include <ndn-cpp-dev/management/nfd-fib-management-options.hpp>
namespace nfd {
+using ndn::nfd::FibManagementOptions;
+
class Forwarder;
class Fib;
@@ -35,28 +36,28 @@
private:
void
- insertEntry(const ndn::FibManagementOptions& options,
- ndn::ControlResponse& response);
+ insertEntry(const FibManagementOptions& options,
+ ControlResponse& response);
void
- deleteEntry(const ndn::FibManagementOptions& options,
- ndn::ControlResponse& response);
+ deleteEntry(const FibManagementOptions& options,
+ ControlResponse& response);
void
- addNextHop(const ndn::FibManagementOptions& options,
- ndn::ControlResponse& response);
+ addNextHop(const FibManagementOptions& options,
+ ControlResponse& response);
void
- removeNextHop(const ndn::FibManagementOptions& options,
- ndn::ControlResponse& response);
+ removeNextHop(const FibManagementOptions& options,
+ ControlResponse& response);
void
- strategy(const ndn::FibManagementOptions& options,
- ndn::ControlResponse& response);
+ strategy(const FibManagementOptions& options,
+ ControlResponse& response);
bool
extractOptions(const Interest& request,
- ndn::FibManagementOptions& extractedOptions);
+ FibManagementOptions& extractedOptions);
// void
// onConfig(ConfigFile::Node section, bool isDryRun);
@@ -68,8 +69,8 @@
std::map<Name, shared_ptr<fw::Strategy> > m_namespaceToStrategyMap;
typedef function<void(FibManager*,
- const ndn::FibManagementOptions&,
- ndn::ControlResponse&)> VerbProcessor;
+ const FibManagementOptions&,
+ ControlResponse&)> VerbProcessor;
typedef std::map<Name::Component, VerbProcessor> VerbDispatchTable;
diff --git a/daemon/mgmt/manager-base.cpp b/daemon/mgmt/manager-base.cpp
index 8ab06e8..7add7b6 100644
--- a/daemon/mgmt/manager-base.cpp
+++ b/daemon/mgmt/manager-base.cpp
@@ -27,13 +27,13 @@
uint32_t code,
const std::string& text)
{
- ndn::ControlResponse response(code, text);
+ ControlResponse response(code, text);
sendResponse(name, response);
}
void
ManagerBase::sendResponse(const Name& name,
- const ndn::ControlResponse& response)
+ const ControlResponse& response)
{
NFD_LOG_DEBUG("responding"
<< " name: " << name
diff --git a/daemon/mgmt/manager-base.hpp b/daemon/mgmt/manager-base.hpp
index e8da7c9..e8d63cf 100644
--- a/daemon/mgmt/manager-base.hpp
+++ b/daemon/mgmt/manager-base.hpp
@@ -8,10 +8,12 @@
#define NFD_MGMT_MANAGER_BASE_HPP
#include "common.hpp"
-#include <ndn-cpp-dev/management/control-response.hpp>
+#include <ndn-cpp-dev/management/nfd-control-response.hpp>
namespace nfd {
+using ndn::nfd::ControlResponse;
+
class AppFace;
class ManagerBase
@@ -25,13 +27,13 @@
protected:
void
- setResponse(ndn::ControlResponse& response,
+ setResponse(ControlResponse& response,
uint32_t code,
const std::string& text);
void
sendResponse(const Name& name,
- const ndn::ControlResponse& response);
+ const ControlResponse& response);
void
sendResponse(const Name& name,
@@ -43,7 +45,7 @@
};
inline void
-ManagerBase::setResponse(ndn::ControlResponse& response,
+ManagerBase::setResponse(ControlResponse& response,
uint32_t code,
const std::string& text)
{
diff --git a/tests/mgmt/fib-manager.cpp b/tests/mgmt/fib-manager.cpp
index 25c38b3..1c1cf9f 100644
--- a/tests/mgmt/fib-manager.cpp
+++ b/tests/mgmt/fib-manager.cpp
@@ -13,9 +13,6 @@
#include <algorithm>
-#include <ndn-cpp-dev/management/fib-management-options.hpp>
-#include <ndn-cpp-dev/management/control-response.hpp>
-
#include <boost/test/unit_test.hpp>
namespace nfd {
@@ -58,7 +55,7 @@
m_callbackFired = true;
Block controlRaw = response.getContent().blockFromValue();
- ndn::ControlResponse control;
+ ControlResponse control;
control.wireDecode(controlRaw);
NFD_LOG_DEBUG("received control response"
@@ -161,7 +158,7 @@
bind(&FibManagerFixture::getFace, this, _1),
face);
- ndn::FibManagementOptions options;
+ FibManagementOptions options;
options.setName("/hello");
options.setFaceId(1);
options.setCost(1);
@@ -192,7 +189,7 @@
bind(&FibManagerFixture::getFace, this, _1),
face);
- ndn::FibManagementOptions options;
+ FibManagementOptions options;
options.setName("/hello");
options.setFaceId(1);
options.setCost(101);
@@ -226,7 +223,7 @@
bind(&FibManagerFixture::getFace, this, _1),
face);
- ndn::FibManagementOptions options;
+ FibManagementOptions options;
options.setName("/hello");
options.setFaceId(1);
options.setCost(101);
@@ -284,7 +281,7 @@
bind(&FibManagerFixture::getFace, this, _1),
face);
- ndn::FibManagementOptions options;
+ FibManagementOptions options;
options.setName("/hello");
options.setFaceId(1000);
options.setCost(101);
@@ -316,7 +313,7 @@
bind(&FibManagerFixture::getFace, this, _1),
face);
- ndn::FibManagementOptions options;
+ FibManagementOptions options;
options.setName("/hello");
options.setFaceId(1);
options.setCost(101);
@@ -355,7 +352,7 @@
for (int i = 1; i <= 2; i++)
{
- ndn::FibManagementOptions options;
+ FibManagementOptions options;
options.setName("/hello");
options.setFaceId(1);
options.setCost(100 + i);
@@ -408,7 +405,7 @@
fib.insert("/hello");
- ndn::FibManagementOptions options;
+ FibManagementOptions options;
options.setName("/hello");
options.setFaceId(1);
@@ -481,7 +478,7 @@
face);
{
- ndn::FibManagementOptions options;
+ FibManagementOptions options;
options.setName("/hello");
Block encodedOptions(options.wireEncode());
@@ -510,7 +507,7 @@
resetCallbackFired();
{
- ndn::FibManagementOptions options;
+ FibManagementOptions options;
options.setName("/hello");
Block encodedOptions(options.wireEncode());
@@ -545,7 +542,7 @@
shared_ptr<Face> face,
const Name& target)
{
- ndn::FibManagementOptions options;
+ FibManagementOptions options;
options.setName(target);
Block encodedOptions(options.wireEncode());
@@ -633,7 +630,7 @@
const Name& targetName,
FaceId targetFace)
{
- ndn::FibManagementOptions options;
+ FibManagementOptions options;
options.setName(targetName);
options.setFaceId(targetFace);
@@ -702,7 +699,7 @@
bind(&FibManagerFixture::getFace, this, _1),
face);
- ndn::FibManagementOptions options;
+ FibManagementOptions options;
options.setName("/hello");
options.setFaceId(1);
@@ -732,7 +729,7 @@
bind(&FibManagerFixture::getFace, this, _1),
face);
- ndn::FibManagementOptions options;
+ FibManagementOptions options;
options.setName("/hello");
options.setFaceId(1);
diff --git a/tests/mgmt/manager-base.cpp b/tests/mgmt/manager-base.cpp
index 6105699..feca0da 100644
--- a/tests/mgmt/manager-base.cpp
+++ b/tests/mgmt/manager-base.cpp
@@ -7,8 +7,6 @@
#include "mgmt/manager-base.hpp"
#include "mgmt/internal-face.hpp"
-#include <ndn-cpp-dev/management/control-response.hpp>
-
#include <boost/test/unit_test.hpp>
namespace nfd {
@@ -30,7 +28,7 @@
}
void
- testSetResponse(ndn::ControlResponse& response,
+ testSetResponse(ControlResponse& response,
uint32_t code,
const std::string& text)
{
@@ -47,7 +45,7 @@
void
testSendResponse(const Name& name,
- const ndn::ControlResponse& response)
+ const ControlResponse& response)
{
sendResponse(name, response);
}
@@ -67,7 +65,7 @@
m_callbackFired = true;
Block controlRaw = response.getContent().blockFromValue();
- ndn::ControlResponse control;
+ ControlResponse control;
control.wireDecode(controlRaw);
NFD_LOG_DEBUG("received control response"
@@ -94,7 +92,7 @@
BOOST_FIXTURE_TEST_CASE(SetResponse, ManagerBaseTest)
{
- ndn::ControlResponse response(200, "OK");
+ ControlResponse response(200, "OK");
BOOST_CHECK_EQUAL(response.getCode(), 200);
BOOST_CHECK_EQUAL(response.getText(), "OK");
@@ -123,7 +121,7 @@
bind(&ManagerBaseTest::validateControlResponse, this, _1,
"/response", 100, "test");
- ndn::ControlResponse response(100, "test");
+ ControlResponse response(100, "test");
testSendResponse("/response", 100, "test");
BOOST_REQUIRE(didCallbackFire());