From: Rayne on
Hi all,

I'm trying to implement the inet_ntop function in Windows, and I found
the code from http://www.mail-archive.com/us...(a)ipv6.org/msg02107.html

I'm using Visual Studio .NET 2003, and according to the msdn article
for getnameinfo(), I need to include the Ws2tcpip.h file and also
include the Wspiapi.h file. So in my header file, I have

#include <Ws2tcpip.h>
#include <Wspiapi.h>
#include <string.h>

and the function definition is in a .c file. Ws232.lib is also
specified in my Project properties -> Configuration Properties ->
Linker -> Input -> Additional Dependencies.

However, I have the following errors (several instances of each error
shown below, and several other similar ones) and they all point to the
Ws2tcpip.h file.

error C2039: 'Byte' : is not a member of 'in6_addr::__unnamed'
error C2039: 'sin6_flowinfo' : is not a member of 'sockaddr_in6'
error C2039: 'sin6_port' : is not a member of 'sockaddr_in6'
error C2039: 'sin6_scope_id' : is not a member of 'sockaddr_in6'
error C2039: 'Word' : is not a member of 'in6_addr::__unnamed'
error C2065: 'AF_INET6' : undeclared identifier
error C2079: 'ip_mreq::imr_interface' uses undefined struct 'in_addr'
error C2079: 'ip_msfilter::imr_interface' uses undefined struct
'in_addr'
error C2079: 'sockaddr_gen::Address' uses undefined struct 'sockaddr'
error C2079: 'sockaddr_gen::AddressIn' uses undefined struct
'sockaddr_in'
error C2371: 'FAR' : redefinition; different basic types
error C2501: 'in6_addr::__unnamed::Byte' : missing storage-class or
type specifiers
error C3861: 'AF_INET6': identifier not found, even with argument-
dependent lookup
error C3861: 'memcmp': identifier not found, even with argument-
dependent lookup
error C3861: 'memset': identifier not found, even with argument-
dependent lookup

I've tried including <Windows.h> and switching the order of
<Ws2tcpip.h> and <Wspiapi.h>, but I still get the errors. Why is this
so?

Thank you.

Regards,
Rayne
From: Christian ASTOR on
On 8 déc, 04:57, Rayne <lancer6...(a)yahoo.com> wrote:

> I'm trying to implement the inet_ntop function in Windows,

There is :
RtlIpv4AddressToStringEx()
RtlIpv6AddressToStringEx()
(MSDN says Vista for minimum OS, but it's wrong, it's on XP also...)

(or WSAAddressToString)
From: Rayne on
On Dec 8, 4:10 pm, Christian ASTOR <casto...(a)club-internet.fr> wrote:
> On 8 déc, 04:57, Rayne <lancer6...(a)yahoo.com> wrote:
>
> > I'm trying to implement the inet_ntop function in Windows,
>
> There is :
> RtlIpv4AddressToStringEx()
> RtlIpv6AddressToStringEx()
> (MSDN says Vista for minimum OS, but it's wrong, it's on XP also...)
>
> (or WSAAddressToString)

Can I use WSAAddressToString on Windows 2000?
From: marc on
Rayne a écrit :

> Can I use WSAAddressToString on Windows 2000?

See MSDN :
Minimum supported client Windows 2000 Professional