mgmt refactoring: Refactor InternalFace
InternalFace is now exclusively for internal use by NFD's forwarding
pipelines. A separate InternalClientFace has been introduced, intended
to be used by the NFD internal applications, including FIB, Face, RIB
manager, and others.
Change-Id: I4a06b9d05b1613a456c6267582091924557d73be
Refs: #2107
diff --git a/daemon/nfd.cpp b/daemon/nfd.cpp
index 1041643..66ab514 100644
--- a/daemon/nfd.cpp
+++ b/daemon/nfd.cpp
@@ -31,7 +31,8 @@
#include "core/config-file.hpp"
#include "fw/forwarder.hpp"
#include "face/null-face.hpp"
-#include "mgmt/internal-face.hpp"
+#include "face/internal-face.hpp"
+#include "face/internal-client-face.hpp"
// #include "mgmt/fib-manager.hpp"
// #include "mgmt/face-manager.hpp"
// #include "mgmt/strategy-choice-manager.hpp"
@@ -47,14 +48,14 @@
Nfd::Nfd(const std::string& configFile, ndn::KeyChain& keyChain)
: m_configFile(configFile)
- // , m_keyChain(keyChain)
+ , m_keyChain(keyChain)
, m_networkMonitor(getGlobalIoService())
{
}
Nfd::Nfd(const ConfigSection& config, ndn::KeyChain& keyChain)
: m_configSection(config)
- // , m_keyChain(keyChain)
+ , m_keyChain(keyChain)
, m_networkMonitor(getGlobalIoService())
{
}
@@ -128,6 +129,8 @@
Nfd::initializeManagement()
{
m_internalFace = make_shared<InternalFace>();
+ m_forwarder->getFaceTable().addReserved(m_internalFace, FACEID_INTERNAL_FACE);
+ m_internalClientFace = makeInternalClientFace(m_internalFace, m_keyChain);
// m_fibManager.reset(new FibManager(m_forwarder->getFib(),
// bind(&Forwarder::getFace, m_forwarder.get(), _1),
@@ -150,7 +153,7 @@
m_forwarder->getMeasurements());
tablesConfig.setConfigFile(config);
- m_internalFace->getValidator().setConfigFile(config);
+ // m_internalFace->getValidator().setConfigFile(config);
m_forwarder->getFaceTable().addReserved(m_internalFace, FACEID_INTERNAL_FACE);
@@ -193,7 +196,7 @@
tablesConfig.setConfigFile(config);
- m_internalFace->getValidator().setConfigFile(config);
+ // m_internalFace->getValidator().setConfigFile(config);
// m_faceManager->setConfigFile(config);
if (!m_configFile.empty()) {