tools, tests: replace FaceFlags with individual fields

refs #1992

Change-Id: Ic635deb5c6c03f2eba4c440357ca435a46a91588
diff --git a/tests/daemon/mgmt/face-manager.cpp b/tests/daemon/mgmt/face-manager.cpp
index 608ea95..ad798af 100644
--- a/tests/daemon/mgmt/face-manager.cpp
+++ b/tests/daemon/mgmt/face-manager.cpp
@@ -1603,7 +1603,8 @@
                    .setFaceId(FACEID_RESERVED_MAX + 1)
                    .setRemoteUri(dummy->getRemoteUri().toString())
                    .setLocalUri(dummy->getLocalUri().toString())
-                   .setFlags(0);
+                   .setFaceScope(ndn::nfd::FACE_SCOPE_NON_LOCAL)
+                   .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT);
 
   Block encodedResultParameters(resultParameters.wireEncode());
 
@@ -1665,7 +1666,8 @@
                    .setFaceId(dummy->getId())
                    .setRemoteUri(dummy->getRemoteUri().toString())
                    .setLocalUri(dummy->getLocalUri().toString())
-                   .setFlags(0);
+                   .setFaceScope(ndn::nfd::FACE_SCOPE_NON_LOCAL)
+                   .setFacePersistency(ndn::nfd::FACE_PERSISTENCY_PERSISTENT);
 
   getFace()->onReceiveData +=
     bind(&FaceFixture::callbackDispatch, this, _1, command->getName(),
diff --git a/tools/nfd-autoreg.cpp b/tools/nfd-autoreg.cpp
index 5164f5d..0b6f7a5 100644
--- a/tools/nfd-autoreg.cpp
+++ b/tools/nfd-autoreg.cpp
@@ -137,7 +137,7 @@
   }
 
   void
-  registerPrefixesIfNeeded(uint64_t faceId, const FaceUri& uri, bool isOnDemand)
+  registerPrefixesIfNeeded(uint64_t faceId, const FaceUri& uri, FacePersistency facePersistency)
   {
     if (hasAllowedSchema(uri)) {
       boost::system::error_code ec;
@@ -148,7 +148,8 @@
         registerPrefixesForFace(faceId, m_allFacesPrefixes);
 
         // register autoreg prefixes if new face is on-demand and not blacklisted and whitelisted
-        if (isOnDemand && !isBlacklisted(address) && isWhitelisted(address)) {
+        if (facePersistency == FACE_PERSISTENCY_ON_DEMAND &&
+            !isBlacklisted(address) && isWhitelisted(address)) {
           registerPrefixesForFace(faceId, m_autoregPrefixes);
         }
       }
@@ -159,12 +160,12 @@
   onNotification(const FaceEventNotification& notification)
   {
     if (notification.getKind() == FACE_EVENT_CREATED &&
-        !notification.isLocal())
+        notification.getFaceScope() != FACE_SCOPE_LOCAL)
       {
         std::cerr << "PROCESSING: " << notification << std::endl;
 
         registerPrefixesIfNeeded(notification.getFaceId(), FaceUri(notification.getRemoteUri()),
-                                 notification.isOnDemand());
+                                 notification.getFacePersistency());
       }
     else
       {
@@ -295,7 +296,7 @@
 
         nfd::FaceStatus faceStatus(block);
         registerPrefixesIfNeeded(faceStatus.getFaceId(), FaceUri(faceStatus.getRemoteUri()),
-                                 faceStatus.isOnDemand());
+                                 faceStatus.getFacePersistency());
       }
   }