face, mgmt: improve face creation failure and bad URI handling

Prevent creation of faces to endpoints owned by NFD instance

Prevent creation of UDP broadcast faces (255.255.255.255 and
those belonging to machine's interfaces) in response to
face creation command

Sanity check configuration file port numbers in face manager

refs: #1414, #1427

Change-Id: Ia3f0a9337f3d97c34388773eab05bc39ad6dd804
diff --git a/daemon/face/tcp-factory.hpp b/daemon/face/tcp-factory.hpp
index 6ba2e37..d4b6618 100644
--- a/daemon/face/tcp-factory.hpp
+++ b/daemon/face/tcp-factory.hpp
@@ -67,6 +67,16 @@
              const FaceConnectFailedCallback& onConnectFailed);
 
 private:
+
+  void
+  prohibitEndpoint(const tcp::Endpoint& endpoint);
+
+  void
+  prohibitAllIpv4Endpoints(const uint16_t port);
+
+  void
+  prohibitAllIpv6Endpoints(const uint16_t port);
+
   /**
    * \brief Look up TcpChannel using specified local endpoint
    *
@@ -88,6 +98,8 @@
   ChannelMap m_channels;
 
   std::string m_defaultPort;
+
+  std::set<tcp::Endpoint> m_prohibitedEndpoints;
 };
 
 } // namespace nfd