IN6_PKTINFO structure (ws2ipdef.h)

The in6_pktinfo structure is used to store received IPv6 packet address information, and is used by Windows to return information about received packets and also allows specifying the local IPv6 address to use for sending packets.

Syntax

typedef struct in6_pktinfo {
  IN6_ADDR ipi6_addr;
  ULONG    ipi6_ifindex;
} IN6_PKTINFO, *PIN6_PKTINFO;

Members

ipi6_addr

The destination IPv6 address from the IP header of the received packet when used with the LPFN_WSARECVMSG (WSARecvMsg) function. The local source IPv6 address to set in the IP header when used with the WSASendMsg function.

ipi6_ifindex

The interface on which the packet was received when used with the LPFN_WSARECVMSG (WSARecvMsg) function. The interface on which the packet should be sent when used with the WSASendMsg function.

Remarks

If the IPV6_PKTINFO socket option is set on a socket of type SOCK_DGRAM or SOCK_RAW, one of the control data objects returned by the LPFN_WSARECVMSG (WSARecvMsg) function will contain an in6_pktinfo structure used to store received packet address information.

On an IPv6 socket of type SOCK_DGRAM or SOCK_RAW, an application can specific the local IP source address to use for sending with the WSASendMsg function. One of the control data objects passed in the WSAMSG structure to the WSASendMsg function may contain an in6_pktinfo structure used to specify the local IPv6 address to use for sending.

On the Microsoft Windows Software Development Kit (SDK) released for Windows Vista and later, the organization of header files has changed and the in6_pktinfo structure is defined in the Ws2ipdef.h header file which is automatically included in the Ws2tcpip.h header file. The Ws2ipdef.h header files should never be used directly.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Header ws2ipdef.h (include Ws2tcpip.h)

See also

Dual-Stack Sockets for IPv6 Winsock Applications

IPPROTO_IPV6 Socket Options

IPV6_PKTINFO

IP_PKTINFO

WSAMSG

LPFN_WSARECVMSG (WSARecvMsg)

WSASendMsg

in_pktinfo