src: Changing prefix registration's flag and FaceMonitor

Refs: #1841 #1843

Change-Id: I7ab74d529cf6f9f54ec1db1415f54f36f2229723
diff --git a/src/nlsr.hpp b/src/nlsr.hpp
index bcfe95b..dd3c99b 100644
--- a/src/nlsr.hpp
+++ b/src/nlsr.hpp
@@ -31,6 +31,7 @@
 #include <ndn-cxx/security/certificate-cache-ttl.hpp>
 #include <ndn-cxx/util/scheduler.hpp>
 #include <ndn-cxx/management/nfd-face-event-notification.hpp>
+#include <ndn-cxx/management/nfd-face-monitor.hpp>
 
 #include "conf-parameter.hpp"
 #include "adjacency-list.hpp"
@@ -42,7 +43,6 @@
 #include "route/fib.hpp"
 #include "communication/sync-logic-handler.hpp"
 #include "hello-protocol.hpp"
-#include "face-monitor.hpp"
 
 #include "validator.hpp"
 
@@ -86,9 +86,11 @@
     , m_certificateCache(new ndn::CertificateCacheTtl(m_nlsrFace.getIoService()))
     , m_validator(m_nlsrFace, DEFAULT_BROADCAST_PREFIX, m_certificateCache)
 
-    , m_faceMonitor(m_nlsrFace.getIoService(),
-                    ndn::bind(&Nlsr::onFaceEventNotification, this, _1))
-  {}
+    , m_faceMonitor(m_nlsrFace)
+  {
+    m_faceMonitor.onNotification += ndn::bind(&Nlsr::onFaceEventNotification, this, _1);
+    m_faceMonitor.start();
+  }
 
   void
   registrationFailed(const ndn::Name& name);
@@ -380,7 +382,7 @@
   ndn::Name m_defaultIdentity;
   ndn::Name m_defaultCertName;
 
-  FaceMonitor m_faceMonitor;
+  ndn::nfd::FaceMonitor m_faceMonitor;
 };
 
 } //namespace nlsr