mgmt: support LpReliability flag in faces/create and faces/update

refs #4003

Change-Id: Iddf94ea55c630b038187c2503783591b118230ec
diff --git a/daemon/mgmt/face-manager.cpp b/daemon/mgmt/face-manager.cpp
index 8966d9d..c3cd1bd 100644
--- a/daemon/mgmt/face-manager.cpp
+++ b/daemon/mgmt/face-manager.cpp
@@ -118,7 +118,9 @@
   try {
     factory->createFace({remoteUri, localUri, parameters.getFacePersistency(),
         parameters.hasFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED) &&
-        parameters.getFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED)},
+        parameters.getFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED),
+        parameters.hasFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED) &&
+        parameters.getFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED)},
       bind(&FaceManager::afterCreateFaceSuccess, this, parameters, _1, done),
       bind(&FaceManager::afterCreateFaceFailure, this, _1, _2, done));
   }
@@ -227,7 +229,7 @@
   if (parameters.hasFacePersistency()) {
     face->setPersistency(parameters.getFacePersistency());
   }
-  setLinkServiceOptions(*face, parameters, response);
+  setLinkServiceOptions(*face, parameters);
 
   // Set ControlResponse fields
   response = collectFaceProperties(*face, false);
@@ -250,8 +252,7 @@
 
 void
 FaceManager::setLinkServiceOptions(Face& face,
-                                   const ControlParameters& parameters,
-                                   ControlParameters& response)
+                                   const ControlParameters& parameters)
 {
   auto linkService = dynamic_cast<face::GenericLinkService*>(face.getLinkService());
   BOOST_ASSERT(linkService != nullptr);
@@ -261,10 +262,10 @@
       face.getScope() == ndn::nfd::FACE_SCOPE_LOCAL) {
     options.allowLocalFields = parameters.getFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED);
   }
+  if (parameters.hasFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED)) {
+    options.reliabilityOptions.isEnabled = parameters.getFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED);
+  }
   linkService->setOptions(options);
-
-  // Set Flags for ControlResponse
-  response.setFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED, options.allowLocalFields, false);
 }
 
 ControlParameters
@@ -277,7 +278,8 @@
   ControlParameters params;
   params.setFaceId(face.getId())
         .setFacePersistency(face.getPersistency())
-        .setFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED, options.allowLocalFields, false);
+        .setFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED, options.allowLocalFields, false)
+        .setFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED, options.reliabilityOptions.isEnabled, false);
   if (wantUris) {
     params.setUri(face.getRemoteUri().toString())
           .setLocalUri(face.getLocalUri().toString());