Commit bc85fb4c authored by Alexandre Julliard's avatar Alexandre Julliard

ws2_32: Added implementation for inet_ntop.

parent 866240d4
......@@ -17792,6 +17792,7 @@ esac
for ac_func in \
_pclose \
_popen \
......@@ -17824,6 +17825,7 @@ for ac_func in \
gettid \
gettimeofday \
getuid \
inet_ntop \
inet_pton \
kqueue \
lstat \
......
......@@ -1387,6 +1387,7 @@ AC_CHECK_FUNCS(\
gettid \
gettimeofday \
getuid \
inet_ntop \
inet_pton \
kqueue \
lstat \
......
......@@ -4555,6 +4555,30 @@ int WINAPI WSARemoveServiceClass(LPGUID info)
}
/***********************************************************************
* inet_ntop (WS2_32.@)
*/
PCSTR WINAPI WS_inet_ntop( INT family, PVOID addr, PSTR buffer, size_t len )
{
#ifdef HAVE_INET_NTOP
union generic_unix_sockaddr unix_addr;
switch (family)
{
case WS_AF_INET:
ws_sockaddr_ws2u( addr, sizeof(struct WS_sockaddr_in), &unix_addr );
return inet_ntop( AF_INET, &unix_addr, buffer, len );
case WS_AF_INET6:
ws_sockaddr_ws2u( addr, sizeof(struct WS_sockaddr_in6), &unix_addr );
return inet_ntop( AF_INET6, &unix_addr, buffer, len );
}
#else
FIXME( "not supported on this platform\n" );
#endif
WSASetLastError( WSAEAFNOSUPPORT );
return NULL;
}
/***********************************************************************
* WSAStringToAddressA (WS2_32.80)
*/
INT WINAPI WSAStringToAddressA(LPSTR AddressString,
......
......@@ -117,3 +117,4 @@
@ stdcall freeaddrinfo(ptr) WS_freeaddrinfo
@ stdcall getaddrinfo(str str ptr ptr) WS_getaddrinfo
@ stdcall getnameinfo(ptr long ptr long ptr long long) WS_getnameinfo
@ stdcall inet_ntop(long ptr ptr long) WS_inet_ntop
......@@ -249,6 +249,9 @@
/* Define to 1 if you have the `inet_network' function. */
#undef HAVE_INET_NETWORK
/* Define to 1 if you have the `inet_ntop' function. */
#undef HAVE_INET_NTOP
/* Define to 1 if you have the `inet_pton' function. */
#undef HAVE_INET_PTON
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment