face: give ProtocolFactory access to NetworkMonitor
Subclasses of ProtocolFactory can access NetworkMonitor and
addFace callback anytime via member fields. They are supplied
to ProtocolFactory::create from FaceSystem.
This is in preparation for letting ProtocolFactory subclasses
react to fine-grained signals from NetworkMonitor.
refs #4021
Change-Id: I8da116bffc83d1bdeed7fd3b2e12c8872f19177b
diff --git a/daemon/face/ethernet-factory.cpp b/daemon/face/ethernet-factory.cpp
index 8fc9822..362527f 100644
--- a/daemon/face/ethernet-factory.cpp
+++ b/daemon/face/ethernet-factory.cpp
@@ -128,7 +128,7 @@
auto channel = this->createChannel(netif, time::seconds(idleTimeout));
if (wantListen && !channel->isListening()) {
try {
- channel->listen(context.addFace, nullptr);
+ channel->listen(this->addFace, nullptr);
}
catch (const EthernetChannel::Error& e) {
NFD_LOG_WARN("Cannot listen on " << netif->getName() << ": " << e.what());
@@ -293,7 +293,7 @@
if (face->getId() == face::INVALID_FACEID) {
// new face: register with forwarding
- context.addFace(face);
+ this->addFace(face);
}
else {
// existing face: don't destroy