IPPROTO_UDP Socket Options

The following table describes IPPROTO_UDP socket options that apply to sockets created for the IPv4 and IPv6 address families (AF_INET and AF_INET6) with the protocol parameter to the socket function specified as UDP (IPPROTO_UDP). 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, WSCEnumProtocols, or WSCEnumProtocols32 function.

IPPROTO_UDP Socket Options
OptionGetSetOptval typeDescription
UDP_CHECKSUM_COVERAGEyesyesDWORD (boolean)When TRUE, UDP datagrams are sent with a checksum.
UDP_NOCHECKSUMyesyesDWORD (boolean)When TRUE, UDP datagrams are sent with the checksum of zero. Required for service providers. If a service provider does not have a mechanism to disable UDP checksum calculation, it may simply store this option without taking any action. This option is not supported for IPv6.


Windows Support for IPPROTO_UDP options
OptionWindows 7Windows Server 2008Windows VistaWindows Server 2003Windows XPWindows 2000Windows NT4Windows 9x/Me



On the Microsoft Windows Software Development Kit (SDK) released for Windows Vista and later, the organization of header files has changed and IPPROTO_UDP level is defined in the Ws2def.h header file which is automatically included in the Winsock2.h header file. The IPPROTO_UDP socket options are defined in the Ws2tcpip.h header file. The Ws2def.h header file should never be used directly.



Ws2def.h (include Winsock2.h);
Winsock2.h on Windows Server 2003, Windows XP and Windows 2000