mgmt: Inserting created multicast faces into the forwarder (FaceTable)
Change-Id: I124c9a96c5c82b29deca5492d34fdf90d7ff0353
Refs: #1394
diff --git a/daemon/mgmt/face-manager.cpp b/daemon/mgmt/face-manager.cpp
index 7ebe384..96d1ce7 100644
--- a/daemon/mgmt/face-manager.cpp
+++ b/daemon/mgmt/face-manager.cpp
@@ -395,7 +395,7 @@
factory->createMulticastFace(nic->ipv4Addresses[0].to_string(),
mcastGroup, mcastPort);
- NFD_LOG_INFO("Created multicast Face ID " << newFace->getId());
+ addCreatedFaceToForwarder(newFace);
if (useEndpoint)
{
@@ -490,7 +490,8 @@
{
shared_ptr<EthernetFace> newFace =
factory->createMulticastFace(nic, mcastGroup);
- NFD_LOG_INFO("Created multicast Face ID " << newFace->getId());
+
+ addCreatedFaceToForwarder(newFace);
}
catch (const EthernetFactory::Error& factoryError)
{
@@ -593,14 +594,21 @@
}
void
+FaceManager::addCreatedFaceToForwarder(const shared_ptr<Face>& newFace)
+{
+ m_faceTable.add(newFace);
+
+ NFD_LOG_INFO("Created face " << newFace->getUri() << " ID " << newFace->getId());
+}
+
+void
FaceManager::onCreated(const Name& requestName,
ndn::nfd::FaceManagementOptions& options,
const shared_ptr<Face>& newFace)
{
- m_faceTable.add(newFace);
- options.setFaceId(newFace->getId());
+ addCreatedFaceToForwarder(newFace);
- NFD_LOG_INFO("Created Face ID " << newFace->getId());
+ options.setFaceId(newFace->getId());
ndn::nfd::ControlResponse response;
setResponse(response, 200, "Success", options.wireEncode());
diff --git a/daemon/mgmt/face-manager.hpp b/daemon/mgmt/face-manager.hpp
index 6787084..d489dff 100644
--- a/daemon/mgmt/face-manager.hpp
+++ b/daemon/mgmt/face-manager.hpp
@@ -78,6 +78,9 @@
ndn::nfd::FaceManagementOptions& extractedOptions);
void
+ addCreatedFaceToForwarder(const shared_ptr<Face>& newFace);
+
+ void
onCreated(const Name& requestName,
ndn::nfd::FaceManagementOptions& options,
const shared_ptr<Face>& newFace);