tools: Make ndn-autoconfig register / instead of /ndn
Hosts in consumer region should use / instead of /ndn as default route.
refs #4201
Change-Id: I6dd15c6657cfe9110c7a4dc3e9046370cbaf2733
diff --git a/tests/tools/ndn-autoconfig/procedure.t.cpp b/tests/tools/ndn-autoconfig/procedure.t.cpp
index 27d9dcf..86dc484 100644
--- a/tests/tools/ndn-autoconfig/procedure.t.cpp
+++ b/tests/tools/ndn-autoconfig/procedure.t.cpp
@@ -196,7 +196,7 @@
BOOST_REQUIRE(req->hasOrigin());
BOOST_CHECK_EQUAL(req->getOrigin(), nfd::ROUTE_ORIGIN_AUTOCONF);
BOOST_REQUIRE(req->hasName());
- if (req->getName() == "/ndn") {
+ if (req->getName() == "/") {
++nRegisterNdn;
}
else if (req->getName() == "/localhop/nfd") {
@@ -230,7 +230,7 @@
{
this->initialize(Options{});
- int nRegisterNdn = 0, nRegisterLocalhopNfd = 0;
+ int nRegisterDefault = 0, nRegisterLocalhopNfd = 0;
this->processInterest = [&] (const Interest& interest) {
optional<ControlParameters> req = parseCommand(interest, "/localhost/nfd/faces/create");
if (req) {
@@ -247,8 +247,8 @@
req = parseCommand(interest, "/localhost/nfd/rib/register");
if (req) {
BOOST_REQUIRE(req->hasName());
- if (req->getName() == "/ndn") {
- ++nRegisterNdn;
+ if (req->getName() == "/") {
+ ++nRegisterDefault;
}
else if (req->getName() == "/localhop/nfd") {
++nRegisterLocalhopNfd;
@@ -273,7 +273,7 @@
BOOST_CHECK_EQUAL(this->runOnce(), true);
BOOST_CHECK_EQUAL(procedure->nCalls1, 1);
BOOST_CHECK_EQUAL(procedure->nCalls2, 1);
- BOOST_CHECK_EQUAL(nRegisterNdn, 1);
+ BOOST_CHECK_EQUAL(nRegisterDefault, 1);
BOOST_CHECK_EQUAL(nRegisterLocalhopNfd, 1);
}
diff --git a/tools/ndn-autoconfig/procedure.cpp b/tools/ndn-autoconfig/procedure.cpp
index 042ac17..fff88f7 100644
--- a/tools/ndn-autoconfig/procedure.cpp
+++ b/tools/ndn-autoconfig/procedure.cpp
@@ -37,7 +37,7 @@
using nfd::ControlResponse;
static const time::nanoseconds FACEURI_CANONIZE_TIMEOUT = time::seconds(4);
-static const std::vector<Name> HUB_PREFIXES{"/ndn", "/localhop/nfd"};
+static const std::vector<Name> HUB_PREFIXES{"/", "/localhop/nfd"};
static const nfd::RouteOrigin HUB_ROUTE_ORIGIN = nfd::ROUTE_ORIGIN_AUTOCONF;
static const uint64_t HUB_ROUTE_COST = 100;