rib: recognize /localhop/nfd HUB prefix in RemoteRegistrator
Change-Id: If4d29b17e381f121d025ee8a9a52466a68e46a83
refs: #2412
diff --git a/rib/remote-registrator.cpp b/rib/remote-registrator.cpp
index a587653..47fa146 100644
--- a/rib/remote-registrator.cpp
+++ b/rib/remote-registrator.cpp
@@ -36,7 +36,7 @@
using ndn::nfd::CommandOptions;
const Name RemoteRegistrator::LOCAL_REGISTRATION_PREFIX = "/localhost";
-const Name RemoteRegistrator::REMOTE_HUB_PREFIX = "/localhop/nfd/rib";
+const Name RemoteRegistrator::REMOTE_HUB_PREFIX = "/localhop/nfd";
const name::Component RemoteRegistrator::IGNORE_COMMPONENT("rib");
RemoteRegistrator::RemoteRegistrator(ndn::nfd::Controller& controller,
@@ -99,14 +99,8 @@
.setOrigin(ndn::nfd::ROUTE_ORIGIN_CLIENT)// set origin to client.
.setFaceId(0);// the remote hub will take the input face as the faceId.
- Name commandPrefix = REMOTE_HUB_PREFIX;
- if (IGNORE_COMMPONENT == commandPrefix.at(-1))
- {
- commandPrefix = commandPrefix.getPrefix(-1);
- }
-
m_commandOptions
- .setPrefix(commandPrefix)
+ .setPrefix(REMOTE_HUB_PREFIX)
.setTimeout(time::milliseconds(timeout));
m_nRetries = retry;
diff --git a/rib/remote-registrator.hpp b/rib/remote-registrator.hpp
index bdd6ca9..2eea754 100644
--- a/rib/remote-registrator.hpp
+++ b/rib/remote-registrator.hpp
@@ -240,7 +240,7 @@
int m_nRetries;
static const Name LOCAL_REGISTRATION_PREFIX; // /localhost
- static const Name REMOTE_HUB_PREFIX; // /localhop/nfd/rib
+ static const Name REMOTE_HUB_PREFIX; // /localhop/nfd
static const name::Component IGNORE_COMMPONENT; // rib
};
diff --git a/tests/rib/remote-registrator.cpp b/tests/rib/remote-registrator.cpp
index 8e30218..9caf345 100644
--- a/tests/rib/remote-registrator.cpp
+++ b/tests/rib/remote-registrator.cpp
@@ -164,7 +164,7 @@
void
connectToHub()
{
- rib.insert(COMMAND_PREFIX, Route());
+ rib.insert(Name("/localhop/nfd"), Route());
advanceClocks(time::milliseconds(1));
}
@@ -172,7 +172,7 @@
void
disconnectToHub()
{
- rib.erase(COMMAND_PREFIX, Route());
+ rib.erase(Name("/localhop/nfd"), Route());
advanceClocks(time::milliseconds(1));
}