cmsg.3, unix.7: Refer to seccomp_unotify(2) for an example of SCM_RIGHTS usage
[man-pages.git] / man7 / udplite.7
blob8d45ec23185502ec3036d38c61dec0813a35e992
1 .\" Copyright (c) 2008 by Gerrit Renker <gerrit@erg.abdn.ac.uk>
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" $Id: udplite.7,v 1.12 2008/07/23 15:22:22 gerrit Exp gerrit $
26 .\"
27 .TH UDPLITE  7 2021-03-22 "Linux" "Linux Programmer's Manual"
28 .SH NAME
29 udplite \- Lightweight User Datagram Protocol
30 .SH SYNOPSIS
31 .nf
32 .B #include <sys/socket.h>
33 .\" FIXME . see #defines under `BUGS',
34 .\"        when glibc supports this, add
35 .\"        #include <netinet/udplite.h>
36 .PP
37 .B sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDPLITE);
38 .fi
39 .SH DESCRIPTION
40 This is an implementation of the Lightweight User Datagram Protocol
41 (UDP-Lite), as described in RFC\ 3828.
42 .PP
43 UDP-Lite is an extension of UDP (RFC\ 768) to support variable-length
44 checksums.
45 This has advantages for some types of multimedia transport that
46 may be able to make use of slightly damaged datagrams,
47 rather than having them discarded by lower-layer protocols.
48 .PP
49 The variable-length checksum coverage is set via a
50 .BR setsockopt (2)
51 option.
52 If this option is not set, the only difference from UDP is
53 in using a different IP protocol identifier (IANA number 136).
54 .PP
55 The UDP-Lite implementation is a full extension of
56 .BR udp (7)\(emthat
57 is, it shares the same API and API behavior, and in addition
58 offers two socket options to control the checksum coverage.
59 .SS Address format
60 UDP-Litev4 uses the
61 .I sockaddr_in
62 address format described in
63 .BR ip (7).
64 UDP-Litev6 uses the
65 .I sockaddr_in6
66 address format described in
67 .BR ipv6 (7).
68 .SS Socket options
69 To set or get a UDP-Lite socket option, call
70 .BR getsockopt (2)
71 to read or
72 .BR setsockopt (2)
73 to write the option with the option level argument set to
74 .BR IPPROTO_UDPLITE .
75 In addition, all
76 .B IPPROTO_UDP
77 socket options are valid on a UDP-Lite socket.
78 See
79 .BR udp (7)
80 for more information.
81 .PP
82 The following two options are specific to UDP-Lite.
83 .TP
84 .BR UDPLITE_SEND_CSCOV
85 This option sets the sender checksum coverage and takes an
86 .I int
87 as argument, with a checksum coverage value in the range 0..2^16-1.
88 .IP
89 A value of 0 means that the entire datagram is always covered.
90 Values from 1\-7 are illegal (RFC\ 3828, 3.1) and are rounded up to
91 the minimum coverage of 8.
92 .IP
93 With regard to IPv6 jumbograms (RFC\ 2675), the UDP-Litev6 checksum
94 coverage is limited to the first 2^16-1 octets, as per RFC\ 3828, 3.5.
95 Higher values are therefore silently truncated to 2^16-1.
96 If in doubt, the current coverage value can always be queried using
97 .BR getsockopt (2).
98 .TP
99 .BR UDPLITE_RECV_CSCOV
100 This is the receiver-side analogue and uses the same argument format
101 and value range as
102 .BR UDPLITE_SEND_CSCOV .
103 This option is not required to enable traffic with partial checksum
104 coverage.
105 Its function is that of a traffic filter: when enabled, it
106 instructs the kernel to drop all packets which have a coverage
107 .I less
108 than the specified coverage value.
110 When the value of
111 .B UDPLITE_RECV_CSCOV
112 exceeds the actual packet coverage, incoming packets are silently dropped,
113 but may generate a warning message in the system log.
114 .\" SO_NO_CHECK exists and is supported by UDPv4, but is
115 .\" commented out in socket(7), hence also commented out here
116 .\".PP
117 .\"Since UDP-Lite mandates checksums, checksumming can not be disabled
118 .\"via the
119 .\".B SO_NO_CHECK
120 .\"option from
121 .\".BR socket (7).
122 .SH ERRORS
123 All errors documented for
124 .BR udp (7)
125 may be returned.
126 UDP-Lite does not add further errors.
127 .SH FILES
129 .I /proc/net/snmp
130 Basic UDP-Litev4 statistics counters.
132 .I /proc/net/snmp6
133 Basic UDP-Litev6 statistics counters.
134 .SH VERSIONS
135 UDP-Litev4/v6 first appeared in Linux 2.6.20.
136 .SH BUGS
137 .\" FIXME . remove this section once glibc supports UDP-Lite
138 Where glibc support is missing, the following definitions are needed:
140 .in +4n
142 #define IPPROTO_UDPLITE     136
143 .\" The following two are defined in the kernel in linux/net/udplite.h
144 #define UDPLITE_SEND_CSCOV  10
145 #define UDPLITE_RECV_CSCOV  11
148 .SH SEE ALSO
149 .BR ip (7),
150 .BR ipv6 (7),
151 .BR socket (7),
152 .BR udp (7)
154 RFC\ 3828 for the Lightweight User Datagram Protocol (UDP-Lite).
156 .I Documentation/networking/udplite.txt
157 in the Linux kernel source tree