build: Fixing code to compile using the latest version of ndn-cpp-dev
The latest version of ndn-cpp-dev updated Name and Name::Components.
One issue is that name components now need to be explicitly constructed
either with name::Component or Name::Component constructor (implicit
construction is reserved for NDN names).
Another issue is that both Name and Name::Components are now internally
stored as "Blocks". Access to the value is possible through value(),
value_begin(), value_end(), value_size(), and blockFromValue() methods.
Change-Id: I25835da2c67567b2a20ecaa573ddd14edb6d6c0b
diff --git a/daemon/mgmt/fib-manager.cpp b/daemon/mgmt/fib-manager.cpp
index 3bcbb1a..f99bf1e 100644
--- a/daemon/mgmt/fib-manager.cpp
+++ b/daemon/mgmt/fib-manager.cpp
@@ -33,30 +33,30 @@
const FibManager::VerbAndProcessor FibManager::FIB_MANAGER_COMMAND_VERBS[] =
{
VerbAndProcessor(
- "insert",
+ Name::Component("insert"),
&FibManager::insertEntry
),
VerbAndProcessor(
- "delete",
+ Name::Component("delete"),
&FibManager::deleteEntry
),
VerbAndProcessor(
- "add-nexthop",
+ Name::Component("add-nexthop"),
&FibManager::addNextHop
),
VerbAndProcessor(
- "remove-nexthop",
+ Name::Component("remove-nexthop"),
&FibManager::removeNextHop
),
// Unsupported
// VerbAndProcessor(
- // "strategy",
+ // Name::Component("strategy"),
// &FibManager::strategy
// )
@@ -141,13 +141,9 @@
const size_t optionCompIndex =
FIB_MANAGER_COMMAND_PREFIX.size() + 1;
- const ndn::Buffer& optionBuffer =
- request.getName()[optionCompIndex].getValue();
- shared_ptr<const ndn::Buffer> tmpOptionBuffer(make_shared<ndn::Buffer>(optionBuffer));
-
try
{
- Block rawOptions(tmpOptionBuffer);
+ Block rawOptions = request.getName()[optionCompIndex].blockFromValue();
extractedOptions.wireDecode(rawOptions);
}
catch (const ndn::Tlv::Error& e)