fw: FaceTable::get returns Face* instead of shared_ptr
refs #3205
Change-Id: I1c61493382fe065389266ff3519ab2b265fe4f79
diff --git a/daemon/mgmt/fib-manager.cpp b/daemon/mgmt/fib-manager.cpp
index b7ac209..1c15ebf 100644
--- a/daemon/mgmt/fib-manager.cpp
+++ b/daemon/mgmt/fib-manager.cpp
@@ -24,6 +24,7 @@
*/
#include "fib-manager.hpp"
+#include "fw/face-table.hpp"
#include <ndn-cxx/management/nfd-fib-entry.hpp>
namespace nfd {
@@ -31,12 +32,12 @@
NFD_LOG_INIT("FibManager");
FibManager::FibManager(Fib& fib,
- function<shared_ptr<Face>(FaceId)> getFace,
+ const FaceTable& faceTable,
Dispatcher& dispatcher,
CommandValidator& validator)
: NfdManagerBase(dispatcher, validator, "fib")
, m_fib(fib)
- , m_getFace(getFace)
+ , m_faceTable(faceTable)
{
registerCommandHandler<ndn::nfd::FibAddNextHopCommand>("add-nexthop",
bind(&FibManager::addNextHop, this, _2, _3, _4, _5));
@@ -61,7 +62,7 @@
<< " faceid: " << faceId
<< " cost: " << cost);
- shared_ptr<Face> face = m_getFace(faceId);
+ Face* face = m_faceTable.get(faceId);
if (face != nullptr) {
fib::Entry* entry = m_fib.insert(prefix).first;
entry->addNextHop(*face, cost);
@@ -89,7 +90,7 @@
NFD_LOG_TRACE("remove-nexthop prefix: " << parameters.getName()
<< " faceid: " << parameters.getFaceId());
- shared_ptr<Face> face = m_getFace(parameters.getFaceId());
+ Face* face = m_faceTable.get(parameters.getFaceId());
if (face != nullptr) {
fib::Entry* entry = m_fib.findExactMatch(parameters.getName());
if (entry != nullptr) {