DTRACE_UDPLITE(4)
π NAME π
dtrace_udplite β a DTrace provider for tracing events related to the UDP-Lite protocol π
okay bestie so this is a section 4 page from the Kernel Interfaces Manual, and it's literally all about the DTrace provider that lets you peek at UDP-Lite stuff happening in the kernel β¨
π 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 π¦
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 is0, the length field is invalid, or the checksum is wrong. π (sorry bestie, those ones just don't make it to the probe)
The arguments to these probes are your besties for getting super detailed info about the IP and UDP-Lite headers of the packet in question. it's giving forensic scientist π
β¨ ARGUMENTS β¨
πΈ pktinfo_t
The pktinfo_t argument is currently unimplemented and only exists for compatibility with other implementations of this provider. Its fields are:
uintptr_t pkt_addrβ always set to0.
πΈ csinfo_t
The csinfo_t argument is also currently unimplemented and likewise just there 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.
πΈ ipinfo_t
The ipinfo_t argument carries the IP fields that are 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. Heads up: 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.
πΈ udplitesinfo_t
The udplitesinfo_t argument holds 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.
πΈ udpliteinfo_t
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 the udplite provider. the blueprint, fr fr π§
π EXAMPLES π
This lil script right here counts transmitted packets by destination port. iconic behaviour:
udplite:::send
{
@num[args[4]->udplite_dport] = count();
}
And this one prints some details of every UDP-Lite packet as it's 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)
like, go read those too, they're all in the same friend group π
π HISTORY π
The udplite provider first appeared in FreeBSD 12.0. a whole era β¨
π«Ά AUTHORS π«Ά
This manual page was written by Mark Johnston <markj@FreeBSD.org> and Michael Tuexen <tuexen@FreeBSD.org>. absolute legends, no notes π
and that's the whole page, bestie!! π¦ this one shipped from Debian, dated August 1, 2018, and it lives in the manual as DTRACE_UDPLITE(4). mwah, slay, periodt πππΈ
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2015 Mark Johnston <markj@FreeBSD.org>
- Copyright (c) 2018 Michael Tuexen <tuexen@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms