mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 03:25:13 +00:00
LibCore: Add declarations for getaddrinfo in SocketAddressWindows.h
This commit is contained in:
parent
170f056805
commit
a274a50bb3
Notes:
github-actions[bot]
2025-02-05 23:09:00 +00:00
Author: https://github.com/stasoid Commit: https://github.com/LadybirdBrowser/ladybird/commit/a274a50bb30 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2673 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/gmta Reviewed-by: https://github.com/konradekk
1 changed files with 15 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue