udplite(7) | Miscellaneous Information Manual | udplite(7) |
udplite - Lightweight User Datagram Protocol
#include <sys/socket.h>
sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDPLITE);
This is an implementation of the Lightweight User Datagram Protocol (UDP-Lite), as described in RFC 3828.
UDP-Lite is an extension of UDP (RFC 768) to support variable-length checksums. This has advantages for some types of multimedia transport that may be able to make use of slightly damaged datagrams, rather than having them discarded by lower-layer protocols.
The variable-length checksum coverage is set via a setsockopt(2) option. If this option is not set, the only difference from UDP is in using a different IP protocol identifier (IANA number 136).
The UDP-Lite implementation is a full extension of udp(7)—that is, it shares the same API and API behavior, and in addition offers two socket options to control the checksum coverage.
UDP-Litev4 uses the sockaddr_in address format described in ip(7). UDP-Litev6 uses the sockaddr_in6 address format described in ipv6(7).
To set or get a UDP-Lite socket option, call getsockopt(2) to read or setsockopt(2) to write the option with the option level argument set to IPPROTO_UDPLITE. In addition, all IPPROTO_UDP socket options are valid on a UDP-Lite socket. See udp(7) for more information.
The following two options are specific to UDP-Lite.
All errors documented for udp(7) may be returned. UDP-Lite does not add further errors.
UDP-Litev4/v6 first appeared in Linux 2.6.20.
Where glibc support is missing, the following definitions are needed:
#define IPPROTO_UDPLITE 136 #define UDPLITE_SEND_CSCOV 10 #define UDPLITE_RECV_CSCOV 11
ip(7), ipv6(7), socket(7), udp(7)
RFC 3828 for the Lightweight User Datagram Protocol (UDP-Lite).
Documentation/networking/udplite.txt in the Linux kernel source tree
2023-10-31 | Linux man-pages 6.7 |