IPPROTO_IP
A version of this page is also available for
4/8/2010
The following table describes IPPROTO_IP socket options. See the getsockopt and setsockopt function reference pages for more information on getting and setting socket options. To enumerate protocols and discover supported properties for each installed protocol, use the WSAEnumProtocols function.
Note
These values are defined in Ws2tcpip.h. You must include this header for applications that call getsockopt or setsockopt on Windows Embedded CE-based devices.
Some socket options require more explanation than these tables can convey; such options contain links to additional pages.
Important
If you implement the IP_HDRINCL option to support the raw sockets protocol, you must first call the bind function on the socket before attempting the setsockopt call.
IPPROTO_IP
Option | get/set | Optval type | Description |
---|---|---|---|
IP_ADD_MEMBERSHIP |
set |
struct ip_mreq |
Joins the socket to multicast group on the specified interface. |
IP_DROP_MEMBERSHIP |
set |
struct ip_mreq |
Leaves the specified multicast group from the specified interface. Service providers must support this option when multicast is supported. Support is indicated in the WSAPROTOCOL_INFO structure returned by a WSAEnumProtocols function call with the following: XPI_SUPORTS_MULTIPOINT=1, XP1_MULTIPOINT_CONTROL_PLANE=0, XP1_MULTIPOINT_DATA_PLANE=0. |
IP_DSCP_TRAFFIC_TYPE |
set |
Struct ip_mreg |
For a call to WSPSetSockOpt with the level set to IPPROTYPE_IP specifies the requested traffic type with the following: DSCPTypeNotSet=0DSCPBestEffort=1,DSCPBackground=2 DSCPExcellentEffort=3DSCPVideo=4DSCPAudio=5DSCPControl=6 |
IP_MULTICAST_IF |
both |
DWORD |
Sets the outgoing (IPv4) interface for multicast traffic. Important for multihomed machines. The input value is the 4-byte network byte order IPv4 address. If optval is null, the default interface is used. |
IP_MULTICAST_TTL |
both |
DWORD |
Sets/gets the TTL value associated with IP multicast traffic on the socket. |
IP_MULTICAST_LOOP |
get |
DWORD |
Default value is TRUE. When TRUE, data that is sent from the local interface to the multicast group to which the socket is joined, including data sent from the same socket, will be echoed to its receive buffer. |