git: e947b173ce - main - Status/2026Q3/netlink-deconding.adoc: Add report

From: Lorenzo Salvadore <salvadore_at_FreeBSD.org>
Date: Wed, 21 Oct 2026 14:43:04 UTC
The branch main has been updated by salvadore:

URL: https://cgit.FreeBSD.org/doc/commit/?id=e947b173cee45fce33735904626a978dd63fe41b

commit e947b173cee45fce33735904626a978dd63fe41b
Author:     Ishan Agrawal <iagrawal9990@gmail.com>
AuthorDate: 2026-09-30 14:40:06 +0000
Commit:     Lorenzo Salvadore <salvadore@FreeBSD.org>
CommitDate: 2026-10-21 13:59:27 +0000

    Status/2026Q3/netlink-deconding.adoc: Add report
    
    Pull Request:   https://github.com/freebsd/freebsd-doc/pull/714
---
 .../report-2026-07-2026-09/netlink-decoding.adoc   | 37 ++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/website/content/en/status/report-2026-07-2026-09/netlink-decoding.adoc b/website/content/en/status/report-2026-07-2026-09/netlink-decoding.adoc
new file mode 100644
index 0000000000..124520be06
--- /dev/null
+++ b/website/content/en/status/report-2026-07-2026-09/netlink-decoding.adoc
@@ -0,0 +1,37 @@
+=== Netlink Payload Decoding Infrastructure for FreeBSD Tracing Tools
+
+Links: +
+https://wiki.freebsd.org/SummerOfCode2026Projects/NetlinkPayloadDecodingInfrastructureForFreeBSDTracingTools[Project Page]
+
+Contact: Ishan Agrawal <ishan@freebsd.org>
+
+Mentor: Kristof Provost <kp@freebsd.org>
+
+PF uses Netlink to communicate between userland tools and the kernel, but before this work, man:truss[1] could not meaningfully decode the payloads of PF Netlink messages and would instead display much of the message as raw data.
+
+This project adds a reusable Netlink payload decoding infrastructure to `libsysdecode` and integrates it with man:truss[1], allowing structured decoding of Netlink messages rather than exposing only their raw contents.
+
+The core of the infrastructure is a generic attribute decoder based on decoder tables.
+The infrastructure supports decoding different attribute types, including integer values, strings, booleans, and nested attributes.
+Netlink commands can then provide their own decoder tables describing the attributes they contain, without requiring a separate decoding mechanism for each command.
+
+The infrastructure has been used to add decoding for several PF Netlink commands, including `PFNL_CMD_KILLSTATES`, `PFNL_CMD_GETRULES`, and `PFNL_CMD_GET_LIMIT`.
+
+For example, a PF Netlink message that previously appeared largely as an opaque buffer:
+
+----
+recvmsg(3,{0x90d83dda940,12,[{"@\^A\0\0\^P\0\^C\^C\^A\0\0\0\0\0"...,65536}],1,{},0,0},0) = 1060 (0x424)
+----
+
+With the new decoding infrastructure, man:truss[1] can decode the Netlink message and PF payload into meaningful fields, for example:
+
+----
+sendto(5,netlink{flags=NLM_F_REQUEST|NLM_F_ACK|NLM_F_ROOT|NLM_F_MATCH,seq=8,pid=0,len=92,type=18,pfctl={cmd=PFNL_CMD_GETSTATES{ifname=,proto=0,af=0,filter_addr=::,filter_mask=::,include_rule=FALSE}}},92,0,NULL,0) = 92 (0x5c)
+----
+
+man:truss[1] was also extended to track the protocol associated with `AF_NETLINK` sockets so that messages can be passed to the appropriate decoder.
+Netlink message flags are decoded as combinations of `NLM_F_*` flags, while unknown bits are preserved.
+
+The work in this quarter established the infrastructure needed to continue adding PF Netlink payload decoders without duplicating parsing logic for each command.
+
+Sponsor: Google LLC (GSoC 2026)