src: decouple classes from Nlsr object
refs: #1952, #2803, #3960, #4288
Change-Id: Ibe3ac3820f11e8107ee4b13e510d53c27467a6cb
diff --git a/src/update/manager-base.cpp b/src/update/manager-base.cpp
index f8ab6d1..ccd00e1 100644
--- a/src/update/manager-base.cpp
+++ b/src/update/manager-base.cpp
@@ -64,7 +64,7 @@
NLSR_LOG_INFO("Advertising name: " << castParams.getName() << "\n");
m_lsdb.buildAndInstallOwnNameLsa();
if (castParams.hasFlags() && castParams.getFlags() == PREFIX_FLAG) {
- NLSR_LOG_INFO("Saving name to the configuration file");
+ NLSR_LOG_INFO("Saving name to the configuration file ");
if (afterAdvertise(castParams.getName()) == true) {
return done(ndn::nfd::ControlResponse(205, "OK").setBody(parameters.wireEncode()));
}
diff --git a/src/update/prefix-update-processor.cpp b/src/update/prefix-update-processor.cpp
index 3573ef0..6222198 100644
--- a/src/update/prefix-update-processor.cpp
+++ b/src/update/prefix-update-processor.cpp
@@ -51,11 +51,11 @@
}
PrefixUpdateProcessor::PrefixUpdateProcessor(ndn::mgmt::Dispatcher& dispatcher,
- ndn::Face& face,
+ ndn::security::ValidatorConfig& validator,
NamePrefixList& namePrefixList,
Lsdb& lsdb, const std::string& configFileName)
: CommandManagerBase(dispatcher, namePrefixList, lsdb, "prefix-update")
- , m_validator(std::make_unique<ndn::security::v2::CertificateFetcherDirectFetch>(face))
+ , m_validator(validator)
, m_configFileName(configFileName)
{
NLSR_LOG_DEBUG("Setting dispatcher to capture Interests for: "
@@ -178,14 +178,14 @@
}
ndn::optional<bool>
-PrefixUpdateProcessor::afterAdvertise(const ndn::Name& prefix) {
-
+PrefixUpdateProcessor::afterAdvertise(const ndn::Name& prefix)
+{
return addOrDeletePrefix(prefix, true);
}
ndn::optional<bool>
-PrefixUpdateProcessor::afterWithdraw(const ndn::Name& prefix) {
-
+PrefixUpdateProcessor::afterWithdraw(const ndn::Name& prefix)
+{
return addOrDeletePrefix(prefix, false);
}
diff --git a/src/update/prefix-update-processor.hpp b/src/update/prefix-update-processor.hpp
index 4491448..f397df1 100644
--- a/src/update/prefix-update-processor.hpp
+++ b/src/update/prefix-update-processor.hpp
@@ -44,7 +44,7 @@
{
public:
PrefixUpdateProcessor(ndn::mgmt::Dispatcher& dispatcher,
- ndn::Face& face,
+ ndn::security::ValidatorConfig& validator,
NamePrefixList& namePrefixList,
Lsdb& lsdb, const std::string& configFileName);
@@ -95,7 +95,7 @@
makeAuthorization();
private:
- ndn::security::ValidatorConfig m_validator;
+ ndn::security::ValidatorConfig& m_validator;
const std::string& m_configFileName;
};