Freigeben über


in_pktinfo Structure

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

Syntax

typedef struct in_pktinfo {
  IN_ADDR ipi_addr;
  UINT    ipi_ifindex;
} in_pktinfo;

Mitglieder

  • ipi_addr
    The destination address from the IP header of the received packet when used with the WSARecvMsg function. The local source address to set in the IP header when used with the WSASendMsg function.

  • ipi_ifindex
    The interface on which the packet was received when used with the WSARecvMsg function. The interface on which the packet should be sent when used with the WSASendMsg function.

Hinweise

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

When this socket option is enabled on an IPv4 socket of type SOCK_DGRAM or SOCK_RAW, an application can also specific the local IP 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 in_pktinfo structure used to specify the local IPv4 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 in_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.

Anforderungen

Mindestens unterstützter Client

Windows XP

Mindestens unterstützter Server

Windows Server 2003

Header

Ws2ipdef.h (include Ws2tcpip.h); Ws2tcpip.h on Windows Server 2003 and Windows XP

Siehe auch

IP_PKTINFO

IPPROTO_IP Socket Options

WSAMSG

WSARecvMsg

WSASendMsg