1 .\" Copyright (c) 2015 Mark Johnston <markj@FreeBSD.org>
2 .\" Copyright (c) 2018 Michael Tuexen <tuexen@FreeBSD.org>
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
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.
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
33 .Nd a DTrace provider for tracing events related to the UDP-Lite protocol
35 .Fn udplite:::receive "pktinfo_t *" "csinfo_t *" "ipinfo_t *" "udplitesinfo_t *" \
37 .Fn udplite:::send "pktinfo_t *" "csinfo_t *" "ipinfo_t *" "udplitesinfo_t *" \
42 provider allows users to trace events in the
44 protocol implementation.
47 probe fires whenever the kernel prepares to transmit a UDP-Lite packet, and the
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.
59 argument is currently unimplemented and is included for compatibility with other
60 implementations of this provider.
62 .Bl -tag -width "uintptr_t pkt_addr" -offset indent
63 .It Vt uintptr_t pkt_addr
69 argument is currently unimplemented and is included for compatibility with other
70 implementations of this provider.
72 .Bl -tag -width "uintptr_t cs_addr" -offset indent
73 .It Vt uintptr_t cs_addr
75 .It Vt uint64_t cs_cid
86 argument contains IP fields common to both IPv4 and IPv6 packets.
88 .Bl -tag -width "uint32_t ip_plength" -offset indent
90 IP version of the packet, 4 for IPv4 packets and 6 for IPv6 packets.
91 .It Vt uint32_t ip_plength
93 This does not include the size of the IP header or IPv6 option headers.
94 .It Vt string ip_saddr
96 .It Vt string ip_daddr
97 IP destination address.
102 argument contains the state of the UDP-Lite connection associated with the packet.
104 .Bl -tag -width "uintptr_t udplites_addr" -offset indent
105 .It Vt uintptr_t udplites_addr
108 containing the IP state for the associated socket.
109 .It Vt uint16_t udplites_lport
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.
121 argument is the raw UDP-Lite header of the packet, with all fields in host order.
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.
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
143 The following script counts transmitted packets by destination port.
144 .Bd -literal -offset indent
147 @num[args[4]->udplite_dport] = count();
151 This script will print some details of each UDP-Lite packet as it is sent or received
153 .Bd -literal -offset indent
154 #pragma D option quiet
155 #pragma D option switchrate=10Hz
159 printf(" %10s %36s %-36s %6s\\n", "DELTA(us)", "SOURCE",
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);
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);
197 provider first appeared in
201 This manual page was written by
202 .An Mark Johnston Aq Mt markj@FreeBSD.org
204 .An Michael Tuexen Aq Mt tuexen@FreeBSD.org .