face: Make default transport configurable
This commit also removes support for the ndnd-tlv-0.7
protocol's default socket location from UnixTransport.
Test HOME environment changing has also been centralized
into a single fixture (util/test-home-environment-fixture.hpp)
refs #2189
Change-Id: Iac1a6c88d7a2d9fcfb91a20356ac21b75daf7d17
diff --git a/src/transport/tcp-transport.hpp b/src/transport/tcp-transport.hpp
index 8afe007..13be254 100644
--- a/src/transport/tcp-transport.hpp
+++ b/src/transport/tcp-transport.hpp
@@ -24,6 +24,8 @@
#include "../common.hpp"
#include "transport.hpp"
+#include "util/config-file.hpp"
+
// forward declaration
namespace boost { namespace asio { namespace ip { class tcp; } } }
@@ -60,6 +62,14 @@
virtual void
send(const Block& header, const Block& payload);
+ static shared_ptr<TcpTransport>
+ create(const ConfigFile& config);
+
+NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+
+ static std::pair<std::string, std::string>
+ getDefaultSocketHostAndPort(const ConfigFile& config);
+
private:
std::string m_host;
std::string m_port;