DTRACE_UDPLITE(4)
π DTRACE_UDPLITE(4) β dtrace_udplite π
Okay bestie, this is the Kernel Interfaces Manual page for dtrace_udplite, and it's giving βDTrace but make it UDP-Lite.β Buckle up β we're getting into probes, packet headers, and all the little fields. π
β¨ NAME β¨
dtrace_udplite β a DTrace provider for tracing events related to the UDP-Lite protocol π
πΈ SYNOPSIS πΈ
udplite:::receive(pktinfo_t *, csinfo_t *, ipinfo_t *, udplitesinfo_t *,
udpliteinfo_t *);
udplite:::send(pktinfo_t *, csinfo_t *, ipinfo_t *, udplitesinfo_t *,
udpliteinfo_t *);
π¦ DESCRIPTION π¦
So the DTrace udplite provider lets you trace events inside the udplite(4) protocol implementation. No cap.
The udplite:::send() probe fires whenever the kernel is getting ready to transmit a UDP-Lite packet. The udplite:::receive() probe fires whenever the kernel receives a UDP-Lite packet β unless the UDP-Lite header is incomplete, the destination port is 0, the length field is invalid, or the checksum is wrong. π«Ά
The arguments to these probes are how you get the detailed info about the IP and UDP-Lite headers of the corresponding packet. It's giving βpacket receipts, but make it observability.β π
π ARGUMENTS π
π The pktinfo_t argument
The pktinfo_t argument is currently unimplemented and is included for compatibility with other implementations of this provider. Its fields are:
uintptr_t pkt_addrβ Always set to0. Literally always. π«
π§Έ The csinfo_t argument
The csinfo_t argument is currently unimplemented and is included for compatibility with other implementations of this provider. Its fields are:
uintptr_t cs_addrβ Always set to0.uint64_t cs_cidβ A pointer to thestruct inpcbfor this packet, orNULL.pid_t cs_pidβ Always set to0.
πΈ The ipinfo_t argument
The ipinfo_t argument contains IP fields common to both IPv4 and IPv6 packets. Its fields are:
uint8_t ip_verβ IP version of the packet,4for IPv4 packets and6for IPv6 packets.uint32_t ip_plengthβ IP payload size. This does not include the size of the IP header or IPv6 option headers.string ip_saddrβ IP source address.string ip_daddrβ IP destination address.
π¦ The udplitesinfo_t argument
The udplitesinfo_t argument contains the state of the UDP-Lite connection associated with the packet. Its fields are:
uintptr_t udplites_addrβ Pointer to thestruct inpcbcontaining the IP state for the associated socket.uint16_t udplites_lportβ Local UDP-Lite port.uint16_t udplites_rportβ Remote UDP-Lite port.string udplites_laddrβ Local IPv4 or IPv6 address.string udplites_raddrβ Remote IPv4 or IPv6 address.
π The udpliteinfo_t argument
The udpliteinfo_t argument is the raw UDP-Lite header of the packet, with all fields in host order. Its fields are:
uint16_t udplite_sportβ Source UDP-Lite port.uint16_t udplite_dportβ Destination UDP-Lite port.uint16_t udplite_coverageβ Checksum coverage of the UDP-Lite header, in bytes, or0for full coverage.uint16_t udplite_checksumβ A checksum of the UDP-Lite header and payload, or0if no checksum was calculated.struct udplitehdr *udplite_hdrβ A pointer to the raw UDP-Lite header.
π FILES π
/usr/lib/dtrace/udplite.dβ DTrace type and translator definitions for theudpliteprovider.
π₯ EXAMPLES π₯
The following script counts transmitted packets by destination port.
udplite:::send
{
@num[args[4]->udplite_dport] = count();
}
This script will print some details of each UDP-Lite packet as it is sent or received by the kernel:
#pragma D option quiet
#pragma D option switchrate=10Hz
dtrace:::BEGIN
{
printf(" %10s %36s %-36s %6s\n", "DELTA(us)", "SOURCE",
"DEST", "COV");
last = timestamp;
}
udplite:::send
{
this->elapsed = (timestamp - last) / 1000;
self->dest = strjoin(strjoin(args[2]->ip_daddr, ":"),
lltostr(args[4]->udplite_dport));
printf(" %10d %30s:%-5d -> %-36s %6d\n", this->elapsed,
args[2]->ip_saddr, args[4]->udplite_sport,
self->dest, args[4]->udplite_coverage);
last = timestamp;
}
udplite:::receive
{
this->elapsed = (timestamp - last) / 1000;
self->dest = strjoin(strjoin(args[2]->ip_saddr, ":"),
lltostr(args[4]->udplite_sport));
printf(" %10d %30s:%-5d <- %-36s %6d\n", this->elapsed,
args[2]->ip_daddr, args[4]->udplite_dport,
self->dest, args[4]->udplite_coverage);
last = timestamp;
}
π SEE ALSO π
dtrace(1), dtrace_ip(4), dtrace_sctp(4), dtrace_tcp(4), dtrace_udp(4), udplite(4), SDT(9)
Go read those too, bestie β it's a whole lore universe. πβ¨
β HISTORY β
The udplite provider first appeared in FreeBSD 12.0. Periodt. π«
π AUTHORS π
This manual page was written by Mark Johnston <markj@FreeBSD.org> and Michael Tuexen <tuexen@FreeBSD.org>.
That's the whole vibe β this page comes from Debian, dated August 1, 2018, and the manual footer reads DTRACE_UDPLITE(4). Stay packet-positive, bestie! π«Άπ
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 2015 Mark Johnston <markj@FreeBSD.org>
- Copyright (c) 2018 Michael Tuexen <tuexen@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms