face: Prevent infinite loop in TcpFactory and UdpFactory

Change-Id: Idd694bc08033c524f3c0e569ed74341aa33fce31
Refs: #2292
diff --git a/core/network-interface.hpp b/core/network-interface.hpp
index 8519db1..e9be083 100644
--- a/core/network-interface.hpp
+++ b/core/network-interface.hpp
@@ -88,9 +88,19 @@
   return (flags & IFF_UP) != 0;
 }
 
+/** \brief List configured network interfaces on the system and their info
+ */
 std::vector<NetworkInterfaceInfo>
 listNetworkInterfaces();
 
+#ifdef WITH_TESTS
+/** \brief Set a list of network interfaces to be returned by subsequent listNetworkInterfaces call
+ *  \note To reset to normal behavior, use `setDebugNetworkInterfaces(nullptr);`
+ */
+void
+setDebugNetworkInterfaces(shared_ptr<std::vector<NetworkInterfaceInfo>> interfaces);
+#endif
+
 } // namespace nfd
 
 #endif // NFD_CORE_NETWORK_INTERFACE_HPP