mgmt: Fix issue with readvertisement commands always returning error code

NFD RIB commands in NLSR were previously always returning 406 errors due
to not having correct default return values for optional post-processing.
This does not appear to impede functionality but does cause incorrect
behavior on the NFD side and is blocking other changes.

Also fixes an issue where NLSR was not sending correctly formatted responses
back to commands from NFD which was raising errors.

Refs #5358

Change-Id: Iffe6a2416a6d7eafa44e17c821bf903c12ecb104
diff --git a/src/update/prefix-update-processor.cpp b/src/update/prefix-update-processor.cpp
index f07f0d0..2f403fb 100644
--- a/src/update/prefix-update-processor.cpp
+++ b/src/update/prefix-update-processor.cpp
@@ -114,7 +114,7 @@
   return false;
 }
 
-bool
+std::tuple<bool, std::string>
 PrefixUpdateProcessor::addOrDeletePrefix(const ndn::Name& prefix, bool addPrefix)
 {
   std::string value = " prefix " + prefix.toUri();
@@ -124,14 +124,14 @@
   std::fstream input(m_confFileNameDynamic, input.in);
   if (!input.good() || !input.is_open()) {
     NLSR_LOG_ERROR("Failed to open configuration file for parsing");
-    return false;
+    return {false, "Failed to open configuration file for parsing"};
   }
 
   if (addPrefix) {
     //check if prefix already exist in the nlsr configuration file
     if (checkForPrefixInFile(value)) {
       NLSR_LOG_ERROR("Prefix already exists in the configuration file");
-      return false;
+      return {false, "Prefix already exists in the configuration file"};
     }
     while (!input.eof()) {
       getline(input, line);
@@ -147,7 +147,7 @@
   else {
     if (!checkForPrefixInFile(value)) {
       NLSR_LOG_ERROR("Prefix doesn't exists in the configuration file");
-      return false;
+      return {false, "Prefix doesn't exists in the configuration file"};
     }
     boost::trim(value);
     while (!input.eof()) {
@@ -165,16 +165,16 @@
   std::ofstream output(m_confFileNameDynamic);
   output << fileString;
   output.close();
-  return true;
+  return {true, "OK"};
 }
 
-std::optional<bool>
+std::tuple<bool, std::string>
 PrefixUpdateProcessor::afterAdvertise(const ndn::Name& prefix)
 {
   return addOrDeletePrefix(prefix, true);
 }
 
-std::optional<bool>
+std::tuple<bool, std::string>
 PrefixUpdateProcessor::afterWithdraw(const ndn::Name& prefix)
 {
   return addOrDeletePrefix(prefix, false);