tools: autoconfig prefix registration changes

After establishing HUB connectivity,
the prefix registration for TESTBED_PREFIX (/ndn) sets:
* Origin=autoconf
* Cost=100
* ExpirationPeriod=(practically) infinity

refs #1726

Change-Id: I7d2cf0982626c02efa6fbded677e47cdb14336ef
diff --git a/tools/ndn-autoconfig.cpp b/tools/ndn-autoconfig.cpp
index f73ef94..71bca2f 100644
--- a/tools/ndn-autoconfig.cpp
+++ b/tools/ndn-autoconfig.cpp
@@ -173,7 +173,8 @@
       nfd::ControlParameters parameters;
       parameters
         .setName(LOCALHOP_HUB_DISCOVERY_PREFIX)
-        .setCost(1);
+        .setCost(1)
+        .setExpirationPeriod(time::seconds(30));
 
       nRegistrations->first = multicastFaces.size();
 
@@ -380,13 +381,14 @@
     std::cerr << "Successfully created face: " << resp << std::endl;
 
     // Register a prefix in RIB
-    nfd::ControlParameters ribParameters;
-    ribParameters
-      .setName("/ndn")
-      .setFaceId(resp.getFaceId());
-
+    static const Name TESTBED_PREFIX("/ndn");
     m_controller.start<nfd::RibRegisterCommand>(
-      ribParameters,
+      nfd::ControlParameters()
+        .setName(TESTBED_PREFIX)
+        .setFaceId(resp.getFaceId())
+        .setOrigin(nfd::ROUTE_ORIGIN_AUTOCONF)
+        .setCost(100)
+        .setExpirationPeriod(time::milliseconds::max()),
       bind(&NdnAutoconfig::onPrefixRegistrationSuccess, this, _1),
       bind(&NdnAutoconfig::onPrefixRegistrationError, this, _1, _2));
   }