INTERNET_ADDRESS  
 

This structure represents a numeric IPv4 or IPv6 address in network byte order.

typedef struct _INTERNET_ADDRESS
{
    INT    ipFamily;
    BYTE   ipNumber[16];
} INTERNET_ADDRESS, *LPINTERNET_ADDRESS;

Members

ipFamily
An integer which identifies the type of IP address. It will be one of the following values:
Value Description
INET_ADDRESS_UNKNOWN The address has not been specified or the bytes in the ipNumber array does not represent a valid address. Functions which populate this structure will use this value to indicate that the address cannot be determined.
INET_ADDRESS_IPV4 Specifies that the address is in IPv4 format. The first four bytes of the ipNumber array are significant and contains the IP address. The remaining bytes are not significant and an application should not depend on them having any particular value, including zero.
INET_ADDRESS_IPV6 Specifies that the address is in IPv6 format. All bytes in the ipNumber array are significant. Note that it is possible for an IPv6 address to actually represent an IPv4 address. This is indicated by the first 10 bytes of the address being zero.
ipNumber
A byte array which contains the numeric form of the IP address. This array is large enough to store both IPv4 (32 bit) and IPv6 (128 bit) addresses. The values are stored in network byte order.

Remarks

The INTERNET_ADDRESS structure is used by some functions to represent an Internet address in a binary format that is compatible with both IPv4 and IPv6 addresses. Applications that use this structure should consider it to be opaque, and should not modify the contents of the structure directly.

For compatibility with legacy applications that expect an IP address to be 32 bits and stored in an unsigned integer, you can copy the first four bytes of the ipNumber array using the CopyMemory function or equivalent. Note that if this is done, your application should always check the ipFamily member first to make sure that it is actually an IPv4 address.

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cswsock11.h