rib: register /localhost|localhop/nfd/rib in FIB

refs #2857

Change-Id: If3a471c1c5dbe514929ce5d02a4741960dedc02b
diff --git a/rib/rib-manager.cpp b/rib/rib-manager.cpp
index edd6c5d..fedfd8a 100644
--- a/rib/rib-manager.cpp
+++ b/rib/rib-manager.cpp
@@ -37,13 +37,14 @@
 
 const Name RibManager::LOCAL_HOST_TOP_PREFIX = "/localhost/nfd";
 const Name RibManager::LOCAL_HOP_TOP_PREFIX = "/localhop/nfd";
+const std::string RibManager::MGMT_MODULE_NAME = "rib";
 const Name RibManager::FACES_LIST_DATASET_PREFIX = "/localhost/nfd/faces/list";
 const time::seconds RibManager::ACTIVE_FACE_FETCH_INTERVAL = time::seconds(300);
 
 RibManager::RibManager(Dispatcher& dispatcher,
                        ndn::Face& face,
                        ndn::KeyChain& keyChain)
-  : ManagerBase(dispatcher, "rib")
+  : ManagerBase(dispatcher, MGMT_MODULE_NAME)
   , m_face(face)
   , m_keyChain(keyChain)
   , m_nfdController(m_face, m_keyChain)
@@ -161,7 +162,7 @@
   // register entry to the FIB
   m_nfdController.start<ndn::nfd::FibAddNextHopCommand>(
      ControlParameters()
-       .setName(topPrefix)
+       .setName(Name(topPrefix).append(MGMT_MODULE_NAME))
        .setFaceId(0),
      bind(&RibManager::onNrdCommandPrefixAddNextHopSuccess, this, cref(topPrefix), _1),
      bind(&RibManager::onNrdCommandPrefixAddNextHopError, this, cref(topPrefix), _2));
diff --git a/rib/rib-manager.hpp b/rib/rib-manager.hpp
index 0e5d68d..7c7ff00 100644
--- a/rib/rib-manager.hpp
+++ b/rib/rib-manager.hpp
@@ -194,6 +194,7 @@
 private:
   static const Name LOCAL_HOST_TOP_PREFIX;
   static const Name LOCAL_HOP_TOP_PREFIX;
+  static const std::string MGMT_MODULE_NAME;
   static const Name FACES_LIST_DATASET_PREFIX;
   static const time::seconds ACTIVE_FACE_FETCH_INTERVAL;
   scheduler::EventId m_activeFaceFetchEvent;
diff --git a/tests/rib/rib-manager.t.cpp b/tests/rib/rib-manager.t.cpp
index 0f1e3f7..610c61d 100644
--- a/tests/rib/rib-manager.t.cpp
+++ b/tests/rib/rib-manager.t.cpp
@@ -102,6 +102,7 @@
 
     auto replyFibAddCommand = [this] (const Interest& interest) {
       nfd::ControlParameters params(interest.getName().get(-5).blockFromValue());
+      BOOST_CHECK(params.getName() == "/localhost/nfd/rib" || params.getName() == "/localhop/nfd/rib");
       params.setFaceId(1).setCost(0);
       nfd::ControlResponse resp;