Network: First commit
Former-commit-id: ec8697acc51569f5043e4f70e4cf42f1c5dc487c
This commit is contained in:
30
src/Nazara/Network/Win32/IpAddressImpl.hpp
Normal file
30
src/Nazara/Network/Win32/IpAddressImpl.hpp
Normal file
@@ -0,0 +1,30 @@
|
||||
// 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 <Nazara/Network/IpAddress.hpp>
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class IpAddressImpl
|
||||
{
|
||||
public:
|
||||
using SockAddrBuffer = std::array<UInt8, sizeof(sockaddr_in6)>;
|
||||
|
||||
IpAddressImpl() = delete;
|
||||
~IpAddressImpl() = delete;
|
||||
|
||||
static IpAddress FromAddrinfo(const addrinfo* info);
|
||||
static IpAddress FromAddrinfo(const addrinfoW* info);
|
||||
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);
|
||||
static std::vector<HostnameInfo> ResolveHostname(NetProtocol procol, const String& hostname, const String& service);
|
||||
|
||||
static socklen_t ToSockAddr(const IpAddress& ipAddress, void* buffer);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user