OSDN Git Service

5a22402cbe890a39eafb4f42bbe5b8aaddbced56
[linuxjm/LDP_man-pages.git] / original / man7 / udplite.7
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 2008-12-03 "Linux" "Linux Programmer's Manual"
28 .SH NAME
29 udplite \- Lightweight User Datagram Protocol
30 .SH SYNOPSIS
31 .B #include <sys/socket.h>
32 .br
33 .\" FIXME . see #defines under `BUGS',
34 .\"        when glibc supports this, add
35 .\"        #include <netinet/udplite.h>
36 .sp
37 .B sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDPLITE);
38 .SH DESCRIPTION
39 This is an implementation of the Lightweight User Datagram Protocol
40 (UDP-Lite), as described in RFC\ 3828.
41
42 UDP-Lite is an extension of UDP (RFC\ 768) to support variable-length
43 checksums.
44 This has advantages for some types of multimedia transport that
45 may be able to make use of slightly damaged datagrams,
46 rather than having them discarded by lower-layer protocols.
47
48 The variable-length checksum coverage is set via a
49 .BR setsockopt (2)
50 option.
51 If this option is not set, the only difference to UDP is
52 in using a different IP protocol identifier (IANA number 136).
53
54 The UDP-Lite implementation is a full extension of
55 .BR udp (7)\(emthat
56 is, it shares the same API and API behaviour, and in addition
57 offers two socket options to control the checksum coverage.
58 .SS Address format
59 UDP-Litev4 uses the
60 .I sockaddr_in
61 address format described in
62 .BR ip (7).
63 UDP-Litev6 uses the
64 .I sockaddr_in6
65 address format described in
66 .BR ipv6 (7).
67 .SS Socket options
68 To set or get a UDP-Lite socket option, call
69 .BR getsockopt (2)
70 to read or
71 .BR setsockopt (2)
72 to write the option with the option level argument set to
73 .BR IPPROTO_UDPLITE .
74 In addition, all
75 .B IPPROTO_UDP
76 socket options are valid on a UDP-Lite socket.
77 See
78 .BR udp (7)
79 for more information.
80
81 The following two options are specific to UDP-Lite.
82 .TP
83 .BR UDPLITE_SEND_CSCOV
84 This option sets the sender checksum coverage and takes an
85 .I int
86 as argument, with a checksum coverage value in the range 0..2^16-1.
87
88 A value of 0 means that the entire datagram is always covered.
89 Values from 1-7 are illegal (RFC\ 3828, 3.1) and are rounded up to
90 the minimum coverage of 8.
91
92 With regard to IPv6 jumbograms (RFC\ 2675), the UDP-Litev6 checksum
93 coverage is limited to the first 2^16-1 octets, as per RFC\ 3828, 3.5.
94 Higher values are therefore silently truncated to 2^16-1.
95 If in doubt, the current coverage value can always be queried using
96 .BR getsockopt (2).
97 .TP
98 .BR UDPLITE_RECV_CSCOV
99 This is the receiver-side analogue and uses the same argument format
100 and value range as
101 .BR UDPLITE_SEND_CSCOV .
102 This option is not required to enable traffic with partial checksum
103 coverage.
104 Its function is that of a traffic filter: when enabled, it
105 instructs the kernel to drop all packets which have a coverage
106 .I less
107 than the specified coverage value.
108
109 When the value of
110 .B UDPLITE_RECV_CSCOV
111 exceeds the actual packet coverage, incoming packets are silently dropped,
112 but may generate a warning message in the system log.
113 .\" SO_NO_CHECK exists and is supported by UDPv4, but is
114 .\" commented out in socket(7), hence also commented out here
115 .\".PP
116 .\"Since UDP-Lite mandates checksums, checksumming can not be disabled
117 .\"via the
118 .\".B SO_NO_CHECK
119 .\"option from
120 .\".BR socket (7).
121 .SH ERRORS
122 All errors documented for
123 .BR udp (7)
124 may be returned.
125 UDP-Lite does not add further errors.
126 .SH FILES
127 .I /proc/net/snmp
128 \- basic UDP-Litev4 statistics counters.
129 .br
130 .I /proc/net/snmp6
131 \- basic UDP-Litev6 statistics counters.
132 .SH VERSIONS
133 UDP-Litev4/v6 first appeared in Linux 2.6.20.
134 .SH BUGS
135 .\" FIXME . remove this section once glibc supports UDP-Lite
136 Where glibc support is missing, the following definitions are needed:
137 .in +4n
138 .nf
139
140 #define IPPROTO_UDPLITE     136
141 .\" The following two are defined in the kernel in linux/net/udplite.h
142 #define UDPLITE_SEND_CSCOV  10
143 #define UDPLITE_RECV_CSCOV  11
144 .fi
145 .in
146 .SH SEE ALSO
147 .BR ip (7),
148 .BR ipv6 (7),
149 .BR socket (7),
150 .BR udp (7)
151
152 RFC\ 3828 for the Lightweight User Datagram Protocol (UDP-Lite).
153
154 .I Documentation/networking/udplite.txt
155 in the Linux kernel source tree
156 .SH COLOPHON
157 This page is part of release 3.64 of the Linux
158 .I man-pages
159 project.
160 A description of the project,
161 and information about reporting bugs,
162 can be found at
163 \%http://www.kernel.org/doc/man\-pages/.