]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man4/dtrace_udplite.4
Fix the driver name in ads111x.4, and hook the manpage up to the build.
[FreeBSD/FreeBSD.git] / share / man / man4 / dtrace_udplite.4
1 .\" Copyright (c) 2015 Mark Johnston <markj@FreeBSD.org>
2 .\" Copyright (c) 2018 Michael Tuexen <tuexen@FreeBSD.org>
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\"
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 .\" SUCH DAMAGE.
25 .\"
26 .\" $FreeBSD$
27 .\"
28 .Dd August 1, 2018
29 .Dt DTRACE_UDPLITE 4
30 .Os
31 .Sh NAME
32 .Nm dtrace_udplite
33 .Nd a DTrace provider for tracing events related to the UDP-Lite protocol
34 .Sh SYNOPSIS
35 .Fn udplite:::receive "pktinfo_t *" "csinfo_t *" "ipinfo_t *" "udplitesinfo_t *" \
36     "udpliteinfo_t *"
37 .Fn udplite:::send "pktinfo_t *" "csinfo_t *" "ipinfo_t *" "udplitesinfo_t *" \
38     "udpliteinfo_t *"
39 .Sh DESCRIPTION
40 The DTrace
41 .Nm udplite
42 provider allows users to trace events in the
43 .Xr udplite 4
44 protocol implementation.
45 The
46 .Fn udplite:::send
47 probe fires whenever the kernel prepares to transmit a UDP-Lite packet, and the
48 .Fn udplite:::receive
49 probe fires whenever the kernel receives a UDP-Lite packet, unless
50 the UDP-Lite header is incomplete,
51 the destination port is 0,
52 the length field is invalid,
53 or the checksum is wrong.
54 The arguments to these probes can be used to obtain detailed information about
55 the IP and UDP-Lite headers of the corresponding packet.
56 .Sh ARGUMENTS
57 The
58 .Vt pktinfo_t
59 argument is currently unimplemented and is included for compatibility with other
60 implementations of this provider.
61 Its fields are:
62 .Bl -tag -width "uintptr_t pkt_addr" -offset indent
63 .It Vt uintptr_t pkt_addr
64 Always set to 0.
65 .El
66 .Pp
67 The
68 .Vt csinfo_t
69 argument is currently unimplemented and is included for compatibility with other
70 implementations of this provider.
71 Its fields are:
72 .Bl -tag -width "uintptr_t cs_addr" -offset indent
73 .It Vt uintptr_t cs_addr
74 Always set to 0.
75 .It Vt uint64_t cs_cid
76 A pointer to the
77 .Vt struct inpcb
78 for this packet, or
79 .Dv NULL .
80 .It Vt pid_t cs_pid
81 Always set to 0.
82 .El
83 .Pp
84 The
85 .Vt ipinfo_t
86 argument contains IP fields common to both IPv4 and IPv6 packets.
87 Its fields are:
88 .Bl -tag -width "uint32_t ip_plength" -offset indent
89 .It Vt uint8_t ip_ver
90 IP version of the packet, 4 for IPv4 packets and 6 for IPv6 packets.
91 .It Vt uint32_t ip_plength
92 IP payload size.
93 This does not include the size of the IP header or IPv6 option headers.
94 .It Vt string ip_saddr
95 IP source address.
96 .It Vt string ip_daddr
97 IP destination address.
98 .El
99 .Pp
100 The
101 .Vt udplitesinfo_t
102 argument contains the state of the UDP-Lite connection associated with the packet.
103 Its fields are:
104 .Bl -tag -width "uintptr_t udplites_addr" -offset indent
105 .It Vt uintptr_t udplites_addr
106 Pointer to the
107 .Vt struct inpcb
108 containing the IP state for the associated socket.
109 .It Vt uint16_t udplites_lport
110 Local UDP-Lite port.
111 .It Vt uint16_t udplites_rport
112 Remote UDP-Lite port.
113 .It Vt string udplites_laddr
114 Local IPv4 or IPv6 address.
115 .It Vt string udplites_raddr
116 Remote IPv4 or IPv6 address.
117 .El
118 .Pp
119 The
120 .Vt udpliteinfo_t
121 argument is the raw UDP-Lite header of the packet, with all fields in host order.
122 Its fields are:
123 .Bl -tag -width "struct udplitehdr *udplite_hdr" -offset indent
124 .It Vt uint16_t udplite_sport
125 Source UDP-Lite port.
126 .It Vt uint16_t udplite_dport
127 Destination UDP-Lite port.
128 .It Vt uint16_t udplite_coverage
129 Checksum coverage of the UDP-Lite header, in bytes, or 0 for full coverage.
130 .It Vt uint16_t udplite_checksum
131 A checksum of the UDP-Lite header and payload, or 0 if no checksum was calculated.
132 .It Vt struct udplitehdr *udplite_hdr
133 A pointer to the raw UDP-Lite header.
134 .El
135 .Sh FILES
136 .Bl -tag -width "/usr/lib/dtrace/udplite.d" -compact
137 .It Pa /usr/lib/dtrace/udplite.d
138 DTrace type and translator definitions for the
139 .Nm udplite
140 provider.
141 .El
142 .Sh EXAMPLES
143 The following script counts transmitted packets by destination port.
144 .Bd -literal -offset indent
145 udplite:::send
146 {
147         @num[args[4]->udplite_dport] = count();
148 }
149 .Ed
150 .Pp
151 This script will print some details of each UDP-Lite packet as it is sent or received
152 by the kernel:
153 .Bd -literal -offset indent
154 #pragma D option quiet
155 #pragma D option switchrate=10Hz
156
157 dtrace:::BEGIN
158 {
159         printf(" %10s %36s    %-36s %6s\\n", "DELTA(us)", "SOURCE",
160             "DEST", "COV");
161         last = timestamp;
162 }
163
164 udplite:::send
165 {
166         this->elapsed = (timestamp - last) / 1000;
167         self->dest = strjoin(strjoin(args[2]->ip_daddr, ":"),
168              lltostr(args[4]->udplite_dport));
169         printf(" %10d %30s:%-5d -> %-36s %6d\\n", this->elapsed,
170             args[2]->ip_saddr, args[4]->udplite_sport,
171             self->dest, args[4]->udplite_coverage);
172         last = timestamp;
173 }
174
175 udplite:::receive
176 {
177         this->elapsed = (timestamp - last) / 1000;
178         self->dest = strjoin(strjoin(args[2]->ip_saddr, ":"),
179              lltostr(args[4]->udplite_sport));
180         printf(" %10d %30s:%-5d <- %-36s %6d\\n", this->elapsed,
181             args[2]->ip_daddr, args[4]->udplite_dport,
182             self->dest, args[4]->udplite_coverage);
183         last = timestamp;
184 }
185 .Ed
186 .Sh SEE ALSO
187 .Xr dtrace 1 ,
188 .Xr dtrace_ip 4 ,
189 .Xr dtrace_sctp 4 ,
190 .Xr dtrace_tcp 4 ,
191 .Xr dtrace_udp 4 ,
192 .Xr udplite 4 ,
193 .Xr SDT 9
194 .Sh HISTORY
195 The
196 .Nm udplite
197 provider first appeared in
198 .Fx
199 12.0.
200 .Sh AUTHORS
201 This manual page was written by
202 .An Mark Johnston Aq Mt markj@FreeBSD.org
203 and
204 .An Michael Tuexen Aq Mt tuexen@FreeBSD.org .