rib: use faces/update instead of faces/enable-local-control to enable local fields
refs #3734
Change-Id: Ic7a39a9b3297103bbe36bf5955e52523b9f8baa4
diff --git a/rib/rib-manager.cpp b/rib/rib-manager.cpp
index 4408b03..653ad28 100644
--- a/rib/rib-manager.cpp
+++ b/rib/rib-manager.cpp
@@ -89,13 +89,13 @@
}
void
-RibManager::enableLocalControlHeader()
+RibManager::enableLocalFields()
{
- m_nfdController.start<ndn::nfd::FaceEnableLocalControlCommand>(
+ m_nfdController.start<ndn::nfd::FaceUpdateCommand>(
ControlParameters()
- .setLocalControlFeature(ndn::nfd::LOCAL_CONTROL_FEATURE_INCOMING_FACE_ID),
- bind(&RibManager::onControlHeaderSuccess, this),
- bind(&RibManager::onControlHeaderError, this, _1));
+ .setFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED, true),
+ bind(&RibManager::onEnableLocalFieldsSuccess, this),
+ bind(&RibManager::onEnableLocalFieldsError, this, _1));
}
void
@@ -412,18 +412,17 @@
}
void
-RibManager::onControlHeaderSuccess()
+RibManager::onEnableLocalFieldsSuccess()
{
- NFD_LOG_DEBUG("Local control header enabled");
+ NFD_LOG_DEBUG("Local fields enabled");
}
void
-RibManager::onControlHeaderError(const ndn::nfd::ControlResponse& response)
+RibManager::onEnableLocalFieldsError(const ndn::nfd::ControlResponse& response)
{
- std::ostringstream os;
- os << "Couldn't enable local control header "
- << "(code: " << response.getCode() << ", info: " << response.getText() << ")";
- BOOST_THROW_EXCEPTION(Error(os.str()));
+ BOOST_THROW_EXCEPTION(Error("Couldn't enable local fields (code: " +
+ to_string(response.getCode()) + ", info: " + response.getText() +
+ ")"));
}
} // namespace rib
diff --git a/rib/rib-manager.hpp b/rib/rib-manager.hpp
index 99f5ccd..a8be263 100644
--- a/rib/rib-manager.hpp
+++ b/rib/rib-manager.hpp
@@ -71,7 +71,7 @@
registerWithNfd();
void
- enableLocalControlHeader();
+ enableLocalFields();
void
setConfigFile(ConfigFile& configFile);
@@ -149,10 +149,10 @@
onCommandPrefixAddNextHopError(const Name& name, const ndn::nfd::ControlResponse& response);
void
- onControlHeaderSuccess();
+ onEnableLocalFieldsSuccess();
void
- onControlHeaderError(const ndn::nfd::ControlResponse& response);
+ onEnableLocalFieldsError(const ndn::nfd::ControlResponse& response);
private:
ndn::Face& m_face;
diff --git a/rib/service.cpp b/rib/service.cpp
index 3b3798f..51ba11c 100644
--- a/rib/service.cpp
+++ b/rib/service.cpp
@@ -94,7 +94,7 @@
}
m_ribManager->registerWithNfd();
- m_ribManager->enableLocalControlHeader();
+ m_ribManager->enableLocalFields();
}
void