[ndnSIM] mgmt: Conditional compilation of TCP/UDP factories

Change-Id: Ic0519d7eb85518be0faa880fc216c15a0cf266cc
diff --git a/daemon/mgmt/face-manager.cpp b/daemon/mgmt/face-manager.cpp
index 0c94fea..2263a7d 100644
--- a/daemon/mgmt/face-manager.cpp
+++ b/daemon/mgmt/face-manager.cpp
@@ -27,8 +27,17 @@
 
 #include "core/network-interface.hpp"
 #include "face/generic-link-service.hpp"
+
+#include "face/protocol-factory.hpp"
+
+#ifdef HAVE_TCP
 #include "face/tcp-factory.hpp"
+#endif // HAVE_TCP
+
+#ifdef HAVE_UDP
 #include "face/udp-factory.hpp"
+#endif // HAVE_UDP
+
 #include "fw/face-table.hpp"
 
 #include <ndn-cxx/management/nfd-channel-status.hpp>
@@ -515,6 +524,7 @@
   //   port 6363 ; TCP listener port number
   // }
 
+#if defined(HAVE_TCP)
   uint16_t port = 6363;
   bool needToListen = true;
   bool enableV4 = true;
@@ -574,6 +584,9 @@
       m_factories.insert(std::make_pair("tcp6", factory));
     }
   }
+#else
+  BOOST_THROW_EXCEPTION(ConfigFile::Error("NFD was compiled without TCP support, cannot process \"tcp\" section"));
+#endif // HAVE_TCP
 }
 
 void
@@ -593,6 +606,7 @@
   //   mcast_group 224.0.23.170 ; UDP multicast group (IPv4 only)
   // }
 
+#if defined(HAVE_UDP)
   uint16_t port = 6363;
   bool enableV4 = true;
   bool enableV6 = true;
@@ -729,6 +743,9 @@
       face->close();
     }
   }
+#else
+  BOOST_THROW_EXCEPTION(ConfigFile::Error("NFD was compiled without UDP support, cannot process \"udp\" section"));
+#endif // HAVE_UDP
 }
 
 void