mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibCore: Add declarations for getaddrinfo in SocketAddressWindows.h
This commit is contained in:
parent
170f056805
commit
a274a50bb3
|
|
@ -14,6 +14,7 @@ typedef unsigned long ULONG;
|
|||
typedef unsigned short USHORT;
|
||||
typedef char CHAR;
|
||||
typedef unsigned char UCHAR;
|
||||
typedef const CHAR* PCSTR;
|
||||
typedef USHORT ADDRESS_FAMILY;
|
||||
|
||||
#define WINAPI_FAMILY_PARTITION(x) 1
|
||||
|
|
@ -28,6 +29,13 @@ typedef USHORT ADDRESS_FAMILY;
|
|||
#define AF_INET 2
|
||||
#define AF_INET6 23
|
||||
|
||||
enum IPPROTO {
|
||||
IPPROTO_TCP = 6
|
||||
};
|
||||
|
||||
#define INET_ADDRSTRLEN 22
|
||||
#define INET6_ADDRSTRLEN 65
|
||||
|
||||
struct in6_addr {
|
||||
union {
|
||||
UCHAR Byte[16];
|
||||
|
|
@ -67,6 +75,7 @@ struct sockaddr {
|
|||
ADDRESS_FAMILY sa_family;
|
||||
CHAR sa_data[14];
|
||||
};
|
||||
using SOCKADDR = sockaddr;
|
||||
using LPSOCKADDR = sockaddr*;
|
||||
|
||||
struct addrinfo {
|
||||
|
|
@ -79,6 +88,8 @@ struct addrinfo {
|
|||
sockaddr* ai_addr;
|
||||
addrinfo* ai_next;
|
||||
};
|
||||
using ADDRINFOA = addrinfo;
|
||||
using PADDRINFOA = addrinfo*;
|
||||
|
||||
struct SOCKET_ADDRESS {
|
||||
sockaddr* lpSockaddr;
|
||||
|
|
@ -115,6 +126,9 @@ struct WSAMSG {
|
|||
};
|
||||
using LPWSAMSG = WSAMSG*;
|
||||
|
||||
extern "C" USHORT __stdcall htons(USHORT hostshort);
|
||||
extern "C" __stdcall INT getaddrinfo(PCSTR pNodeName, PCSTR pServiceName, const ADDRINFOA* pHints, PADDRINFOA* ppResult);
|
||||
extern "C" __stdcall void freeaddrinfo(PADDRINFOA pAddrInfo);
|
||||
extern "C" __stdcall PCSTR inet_ntop(int Family, void const* pAddr, char* pStringBuf, size_t StringBufSize);
|
||||
extern "C" __stdcall USHORT htons(USHORT hostshort);
|
||||
|
||||
#define _WS2DEF_ // don't include ws2def.h
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user