// Copyright (C) 2015 Jérôme Leclercq // This file is part of the "Nazara Engine - Network module" // For conditions of distribution and use, see copyright notice in Config.hpp #include #include #include namespace Nz { class IpAddressImpl { public: using SockAddrBuffer = std::array; IpAddressImpl() = delete; ~IpAddressImpl() = delete; static IpAddress FromAddrinfo(const addrinfo* info); #if NAZARA_CORE_WINDOWS_VISTA static IpAddress FromAddrinfo(const addrinfoW* info); #endif static IpAddress FromSockAddr(const sockaddr* address); static IpAddress FromSockAddr(const sockaddr_in* addressv4); static IpAddress FromSockAddr(const sockaddr_in6* addressv6); static bool ResolveAddress(const IpAddress& ipAddress, String* hostname, String* service, ResolveError* error); static std::vector ResolveHostname(NetProtocol procol, const String& hostname, const String& service, ResolveError* error); static socklen_t ToSockAddr(const IpAddress& ipAddress, void* buffer); static NetProtocol TranslatePFToNetProtocol(int family); static SocketType TranslateSockToNetProtocol(int socketType); static ResolveError TranslateWSAErrorToResolveError(int error); }; }