rib+tools: delete NRD
refs #3570
Change-Id: I9a6e8eb6c74ea5e09a2e724805f07ca4e58af51c
diff --git a/rib/rib-manager.cpp b/rib/rib-manager.cpp
index fedfd8a..e581095 100644
--- a/rib/rib-manager.cpp
+++ b/rib/rib-manager.cpp
@@ -164,8 +164,8 @@
ControlParameters()
.setName(Name(topPrefix).append(MGMT_MODULE_NAME))
.setFaceId(0),
- bind(&RibManager::onNrdCommandPrefixAddNextHopSuccess, this, cref(topPrefix), _1),
- bind(&RibManager::onNrdCommandPrefixAddNextHopError, this, cref(topPrefix), _2));
+ bind(&RibManager::onCommandPrefixAddNextHopSuccess, this, cref(topPrefix), _1),
+ bind(&RibManager::onCommandPrefixAddNextHopError, this, cref(topPrefix), _2));
// add top prefix to the dispatcher
m_addTopPrefix(topPrefix);
@@ -216,8 +216,8 @@
.setRoute(route);
m_rib.beginApplyUpdate(update,
- bind(&RibManager::onRibUpdateSuccess, this, update),
- bind(&RibManager::onRibUpdateFailure, this, update, _1, _2));
+ bind(&RibManager::onRibUpdateSuccess, this, update),
+ bind(&RibManager::onRibUpdateFailure, this, update, _1, _2));
m_registeredFaces.insert(route.faceId);
}
@@ -245,8 +245,8 @@
.setRoute(route);
m_rib.beginApplyUpdate(update,
- bind(&RibManager::onRibUpdateSuccess, this, update),
- bind(&RibManager::onRibUpdateFailure, this, update, _1, _2));
+ bind(&RibManager::onRibUpdateSuccess, this, update),
+ bind(&RibManager::onRibUpdateFailure, this, update, _1, _2));
}
void
@@ -425,8 +425,8 @@
}
void
-RibManager::onNrdCommandPrefixAddNextHopSuccess(const Name& prefix,
- const ndn::nfd::ControlParameters& result)
+RibManager::onCommandPrefixAddNextHopSuccess(const Name& prefix,
+ const ndn::nfd::ControlParameters& result)
{
NFD_LOG_DEBUG("Successfully registered " + prefix.toUri() + " with NFD");
@@ -443,7 +443,7 @@
}
void
-RibManager::onNrdCommandPrefixAddNextHopError(const Name& name, const std::string& msg)
+RibManager::onCommandPrefixAddNextHopError(const Name& name, const std::string& msg)
{
BOOST_THROW_EXCEPTION(Error("Error in setting interest filter (" + name.toUri() + "): " + msg));
}
diff --git a/rib/rib-manager.hpp b/rib/rib-manager.hpp
index 7c7ff00..55ee394 100644
--- a/rib/rib-manager.hpp
+++ b/rib/rib-manager.hpp
@@ -165,11 +165,11 @@
private:
void
- onNrdCommandPrefixAddNextHopSuccess(const Name& prefix,
- const ndn::nfd::ControlParameters& result);
+ onCommandPrefixAddNextHopSuccess(const Name& prefix,
+ const ndn::nfd::ControlParameters& result);
void
- onNrdCommandPrefixAddNextHopError(const Name& name, const std::string& msg);
+ onCommandPrefixAddNextHopError(const Name& name, const std::string& msg);
void
onControlHeaderSuccess();
diff --git a/rib/nrd.cpp b/rib/service.cpp
similarity index 93%
rename from rib/nrd.cpp
rename to rib/service.cpp
index d723a3f..3b3798f 100644
--- a/rib/nrd.cpp
+++ b/rib/service.cpp
@@ -23,7 +23,7 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "nrd.hpp"
+#include "service.hpp"
#include "rib-manager.hpp"
#include "core/config-file.hpp"
@@ -40,19 +40,19 @@
static const std::string INTERNAL_CONFIG = "internal://nfd.conf";
-Nrd::Nrd(const std::string& configFile, ndn::KeyChain& keyChain)
+Service::Service(const std::string& configFile, ndn::KeyChain& keyChain)
: m_configFile(configFile)
, m_keyChain(keyChain)
{
}
-Nrd::Nrd(const ConfigSection& config, ndn::KeyChain& keyChain)
+Service::Service(const ConfigSection& config, ndn::KeyChain& keyChain)
: m_configSection(config)
, m_keyChain(keyChain)
{
}
-Nrd::~Nrd()
+Service::~Service()
{
// It is necessary to explicitly define the destructor, because some member variables
// (e.g., unique_ptr<RibManager>) are forward-declared, but implicitly declared destructor
@@ -60,7 +60,7 @@
}
void
-Nrd::initialize()
+Service::initialize()
{
m_face.reset(new ndn::Face(getLocalNfdTransport(), getGlobalIoService(), m_keyChain));
m_dispatcher.reset(new ndn::mgmt::Dispatcher(*m_face, m_keyChain));
@@ -77,7 +77,7 @@
// do nothing
}
else {
- // missing NRD section
+ // missing "rib" section handler
ConfigFile::throwErrorOnUnknownSection(filename, sectionName, section, isDryRun);
}
});
@@ -98,7 +98,7 @@
}
void
-Nrd::initializeLogging()
+Service::initializeLogging()
{
ConfigFile config(&ConfigFile::ignoreUnknownSection);
LoggerFactory::getInstance().setConfigFile(config);
@@ -114,7 +114,7 @@
}
shared_ptr<ndn::Transport>
-Nrd::getLocalNfdTransport()
+Service::getLocalNfdTransport()
{
ConfigSection config;
diff --git a/rib/nrd.hpp b/rib/service.hpp
similarity index 69%
rename from rib/nrd.hpp
rename to rib/service.hpp
index 0d8743d..5cb60d9 100644
--- a/rib/nrd.hpp
+++ b/rib/service.hpp
@@ -23,8 +23,8 @@
* NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef NFD_RIB_NRD_HPP
-#define NFD_RIB_NRD_HPP
+#ifndef NFD_RIB_SERVICE_HPP
+#define NFD_RIB_SERVICE_HPP
#include "common.hpp"
#include "core/config-file.hpp"
@@ -40,10 +40,9 @@
class RibManager;
/**
- * \brief Class representing NRD (NFD RIB Manager) instance
- * This class can be used to initialize all components of NRD
+ * \brief initializes and executes NFD-RIB service thread
*/
-class Nrd : noncopyable
+class Service : noncopyable
{
public:
class Error : public std::runtime_error
@@ -57,27 +56,31 @@
};
/**
- * \brief Create NRD instance using absolute or relative path to \p configFile
+ * \brief create NFD-RIB service
+ * \param configFile absolute or relative path of configuration file
+ * \param keyChain the KeyChain
*/
- Nrd(const std::string& configFile, ndn::KeyChain& keyChain);
+ Service(const std::string& configFile, ndn::KeyChain& keyChain);
/**
- * \brief Create NRD instance using a parsed ConfigSection \p config
- * This version of the constructor is more appropriate for integrated environments,
- * such as NS-3 or android.
- * \note When using this version of the constructor, error messages will include
- * "internal://nfd.conf" when referring to configuration errors.
+ * \brief create NFD-RIB service
+ * \param config parsed configuration section
+ * \param keyChain the KeyChain
+ * \note This constructor overload is more appropriate for integrated environments,
+ * such as NS-3 or android. Error messages related to configuration file
+ * will use "internal://nfd.conf" as configuration filename.
*/
- Nrd(const ConfigSection& config, ndn::KeyChain& keyChain);
+ Service(const ConfigSection& config, ndn::KeyChain& keyChain);
/**
* \brief Destructor
*/
- ~Nrd();
+ ~Service();
/**
- * \brief Perform initialization of NFD instance
- * After initialization, NFD instance can be started by invoking run on globalIoService
+ * \brief Perform initialization of NFD-RIB instance
+ *
+ * After initialization, NFD-RIB instance can be started by running the global io_service
*/
void
initialize();
@@ -88,7 +91,7 @@
/**
* \brief Look into the config file and construct appropriate transport to communicate with NFD
- * If NRD instance was initialized with config file, INFO format is assumed
+ * If NFD-RIB instance was initialized with config file, INFO format is assumed
*/
shared_ptr<ndn::Transport>
getLocalNfdTransport();
@@ -106,4 +109,4 @@
} // namespace rib
} // namespace nfd
-#endif // NFD_RIB_NRD_HPP
+#endif // NFD_RIB_SERVICE_HPP