core: use FaceUri from ndn-cxx

refs #2143

Change-Id: Ida06daf406f941a699c9f1013450951db3cd28e9
diff --git a/tools/ndn-autoconfig.cpp b/tools/ndn-autoconfig.cpp
index 77470c5..fdd8ba9 100644
--- a/tools/ndn-autoconfig.cpp
+++ b/tools/ndn-autoconfig.cpp
@@ -25,16 +25,16 @@
 
 #include "version.hpp"
 
-#include "core/face-uri.hpp"
-
 #include <ndn-cxx/face.hpp>
 #include <ndn-cxx/security/key-chain.hpp>
 #include <ndn-cxx/management/nfd-controller.hpp>
 #include <ndn-cxx/management/nfd-face-status.hpp>
 #include <ndn-cxx/security/key-chain.hpp>
 #include <ndn-cxx/encoding/buffer-stream.hpp>
+#include <ndn-cxx/util/face-uri.hpp>
 
 #include <boost/lexical_cast.hpp>
+#include <boost/noncopyable.hpp>
 
 #include <sys/types.h>
 #include <netinet/in.h>
@@ -59,7 +59,7 @@
             << std::endl;
 }
 
-class NdnAutoconfig
+class NdnAutoconfig : boost::noncopyable
 {
 public:
   union QueryAnswer
@@ -149,7 +149,7 @@
 
         nfd::FaceStatus faceStatus(block);
 
-        ::nfd::FaceUri uri(faceStatus.getRemoteUri());
+        ndn::util::FaceUri uri(faceStatus.getRemoteUri());
         if (uri.getScheme() == "udp4") {
           namespace ip = boost::asio::ip;
           boost::system::error_code ec;
diff --git a/tools/nfd-autoreg.cpp b/tools/nfd-autoreg.cpp
index 43862a6..0ad6841 100644
--- a/tools/nfd-autoreg.cpp
+++ b/tools/nfd-autoreg.cpp
@@ -27,6 +27,7 @@
 #include <ndn-cxx/name.hpp>
 
 #include <ndn-cxx/security/key-chain.hpp>
+#include <ndn-cxx/util/face-uri.hpp>
 #include <ndn-cxx/management/nfd-controller.hpp>
 #include <ndn-cxx/management/nfd-face-monitor.hpp>
 #include <ndn-cxx/management/nfd-face-status.hpp>
@@ -37,17 +38,19 @@
 #include <boost/program_options/parsers.hpp>
 
 #include "version.hpp"
-#include "core/face-uri.hpp"
 #include "core/network.hpp"
 
-namespace po = boost::program_options;
-
-namespace nfd {
-
 using namespace ndn::nfd;
 using ndn::Face;
 using ndn::KeyChain;
 using ndn::nfd::FaceEventNotification;
+using ndn::util::FaceUri;
+using ::nfd::Network;
+
+namespace ndn {
+namespace nfd_autoreg {
+
+namespace po = boost::program_options;
 
 class AutoregServer : boost::noncopyable
 {
@@ -250,17 +253,14 @@
     uint64_t currentSegment = data.getName().get(-1).toSegment();
 
     const name::Component& finalBlockId = data.getMetaInfo().getFinalBlockId();
-    if (finalBlockId.empty() ||
-        finalBlockId.toSegment() > currentSegment)
-      {
-        m_face.expressInterest(data.getName().getPrefix(-1).appendSegment(currentSegment+1),
-                               bind(&AutoregServer::fetchFaceStatusSegments, this, _2, buffer),
-                               ndn::OnTimeout());
-      }
-    else
-      {
-        return processFaceStatusDataset(buffer);
-      }
+    if (finalBlockId.empty() || finalBlockId.toSegment() > currentSegment) {
+      m_face.expressInterest(data.getName().getPrefix(-1).appendSegment(currentSegment + 1),
+                             bind(&AutoregServer::fetchFaceStatusSegments, this, _2, buffer),
+                             ndn::OnTimeout());
+    }
+    else {
+      return processFaceStatusDataset(buffer);
+    }
   }
 
   void
@@ -389,11 +389,12 @@
   std::vector<Network> m_blackList;
 };
 
-} // namespace nfd
+} // namespace nfd_autoreg
+} // namespace ndn
 
 int
 main(int argc, char* argv[])
 {
-  nfd::AutoregServer server;
+  ndn::nfd_autoreg::AutoregServer server;
   return server.main(argc, argv);
 }