rib: Accept KeyChain in RibManager constructor
refs: #2390
Change-Id: I45c9aae4bb111d75de63dcbcba4b3e6296eb2426
diff --git a/rib/nrd.cpp b/rib/nrd.cpp
index b4ff276..bdfab99 100644
--- a/rib/nrd.cpp
+++ b/rib/nrd.cpp
@@ -66,7 +66,7 @@
initializeLogging();
- m_ribManager.reset(new RibManager(*m_face));
+ m_ribManager.reset(new RibManager(*m_face, m_keyChain));
ConfigFile config([] (const std::string& filename, const std::string& sectionName,
const ConfigSection& section, bool isDryRun) {
diff --git a/rib/rib-manager.cpp b/rib/rib-manager.cpp
index 8215ade..4c03f3b 100644
--- a/rib/rib-manager.cpp
+++ b/rib/rib-manager.cpp
@@ -73,8 +73,9 @@
const time::seconds RibManager::ACTIVE_FACE_FETCH_INTERVAL = time::seconds(300);
-RibManager::RibManager(ndn::Face& face)
+RibManager::RibManager(ndn::Face& face, ndn::KeyChain& keyChain)
: m_face(face)
+ , m_keyChain(keyChain)
, m_nfdController(m_face, m_keyChain)
, m_localhostValidator(m_face)
, m_localhopValidator(m_face)
diff --git a/rib/rib-manager.hpp b/rib/rib-manager.hpp
index 8d90103..e38ee3c 100644
--- a/rib/rib-manager.hpp
+++ b/rib/rib-manager.hpp
@@ -61,8 +61,7 @@
}
};
- explicit
- RibManager(ndn::Face& face);
+ RibManager(ndn::Face& face, ndn::KeyChain& keyChain);
~RibManager();
@@ -202,8 +201,8 @@
private:
ndn::Face& m_face;
+ ndn::KeyChain& m_keyChain;
ndn::nfd::Controller m_nfdController;
- ndn::KeyChain m_keyChain;
ndn::ValidatorConfig m_localhostValidator;
ndn::ValidatorConfig m_localhopValidator;
ndn::nfd::FaceMonitor m_faceMonitor;
diff --git a/tests/rib/rib-manager.t.cpp b/tests/rib/rib-manager.t.cpp
index cfce38b..94a37af 100644
--- a/tests/rib/rib-manager.t.cpp
+++ b/tests/rib/rib-manager.t.cpp
@@ -47,7 +47,7 @@
{
face = ndn::util::makeDummyClientFace();
- manager = make_shared<RibManager>(ndn::ref(*face));
+ manager = make_shared<RibManager>(*face, keyChain);
manager->registerWithNfd();
face->processEvents(time::milliseconds(1));
@@ -107,6 +107,7 @@
public:
shared_ptr<RibManager> manager;
shared_ptr<ndn::util::DummyClientFace> face;
+ ndn::KeyChain keyChain;
const Name COMMAND_PREFIX;
const Name::Component ADD_NEXTHOP_VERB;