#include "TestingSupport/Host/SocketTestUtilities.h"
#include "lldb/Host/Config.h"
#include "lldb/Utility/StreamString.h"
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include <arpa/inet.h>
#endif
usingnamespacelldb_private;
static void AcceptThread(Socket *listen_socket, bool child_processes_inherit,
Socket **accept_socket, Status *error) { … }
template <typename SocketType>
void lldb_private::CreateConnectedSockets(
llvm::StringRef listen_remote_address,
const std::function<std::string(const SocketType &)> &get_connect_addr,
std::unique_ptr<SocketType> *a_up, std::unique_ptr<SocketType> *b_up) { … }
bool lldb_private::CreateTCPConnectedSockets(
std::string listen_remote_ip, std::unique_ptr<TCPSocket> *socket_a_up,
std::unique_ptr<TCPSocket> *socket_b_up) { … }
#if LLDB_ENABLE_POSIX
void lldb_private::CreateDomainConnectedSockets(
llvm::StringRef path, std::unique_ptr<DomainSocket> *socket_a_up,
std::unique_ptr<DomainSocket> *socket_b_up) { … }
#endif
static bool CheckIPSupport(llvm::StringRef Proto, llvm::StringRef Addr) { … }
bool lldb_private::HostSupportsIPv4() { … }
bool lldb_private::HostSupportsIPv6() { … }
llvm::Expected<std::string> lldb_private::GetLocalhostIP() { … }