ws2_32: Added implementation for inet_ntop.
This commit is contained in:
parent
866240d4fd
commit
bc85fb4cd3
|
@ -17790,6 +17790,7 @@ esac
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
for ac_func in \
|
||||
|
@ -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 \
|
||||
|
|
|
@ -4554,6 +4554,30 @@ int WINAPI WSARemoveServiceClass(LPGUID info)
|
|||
return SOCKET_ERROR;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* 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)
|
||||
*/
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue