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/face-system.hpp b/daemon/face/face-system.hpp
index d1f38b9..6557c72 100644
--- a/daemon/face/face-system.hpp
+++ b/daemon/face/face-system.hpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2017,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
@@ -30,6 +30,9 @@
 #include "core/config-file.hpp"
 #include "core/network-interface.hpp"
 #include "core/network-interface-predicate.hpp"
+#include <ndn-cxx/net/network-address.hpp>
+#include <ndn-cxx/net/network-interface.hpp>
+#include <ndn-cxx/net/network-monitor.hpp>
 
 namespace nfd {
 
@@ -47,8 +50,11 @@
 class FaceSystem : noncopyable
 {
 public:
+  FaceSystem(FaceTable& faceTable, const shared_ptr<ndn::net::NetworkMonitor>& netmon);
+
+  DEPRECATED(
   explicit
-  FaceSystem(FaceTable& faceTable);
+  FaceSystem(FaceTable& faceTable));
 
   ~FaceSystem();
 
@@ -83,17 +89,15 @@
   class ConfigContext : noncopyable
   {
   public:
+    /// \deprecated use NetworkMonitor provided as ProtocolFactory::netmon
     const std::vector<NetworkInterfaceInfo>&
     listNetifs() const
     {
-      ///\todo get netifs from NetworkMonitor
       return m_netifs;
     }
 
   public:
     bool isDryRun;
-    FaceCreatedCallback addFace;
-    ///\todo add NetworkMonitor
 
   private:
     std::vector<NetworkInterfaceInfo> m_netifs;