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/core/network-interface.hpp b/daemon/core/network-interface.hpp
index d02171a..0265461 100644
--- a/daemon/core/network-interface.hpp
+++ b/daemon/core/network-interface.hpp
@@ -17,11 +17,13 @@
 class NetworkInterfaceInfo
 {
 public:
+
   int index;
   std::string name;
   ethernet::Address etherAddress;
   std::vector<boost::asio::ip::address_v4> ipv4Addresses;
   std::vector<boost::asio::ip::address_v6> ipv6Addresses;
+  boost::asio::ip::address_v4 broadcastAddress;
   unsigned int flags;
 
   bool
@@ -31,7 +33,11 @@
   isMulticastCapable() const;
 
   bool
+  isBroadcastCapable() const;
+
+  bool
   isUp() const;
+
 };
 
 inline bool
@@ -47,6 +53,12 @@
 }
 
 inline bool
+NetworkInterfaceInfo::isBroadcastCapable() const
+{
+  return (flags & IFF_BROADCAST) != 0;
+}
+
+inline bool
 NetworkInterfaceInfo::isUp() const
 {
   return (flags & IFF_UP) != 0;