Commit Graph
168 Commits
Author SHA1 Message Date
Kristof Provost 01482de958 libsysdecode: decode PFNL_CMD_GET_RULESETS and PFNL_CMD_GET_RULESET
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2026-08-26 17:03:59 +02:00
Kristof Provost 9b9b3b157a libsysdecode: also verify command decoders
We already verified that the attribute parser tables were correctly
sorted. Now also verify that the command decoders are too.

While here move the assertions into a constructor so we only run them once.
2026-08-10 16:33:32 +02:00
Ishan Agrawal 0f2e98c151 libsysdecode: verify decoder tables are sorted
Add assertions to validate decoder table ordering required by
binary search.

Signed-off-by:	Ishan Agrawal <[email protected]>
Sponsored-by:	Google LLC (GSoC 2026)
Reviewed by:	kp
2026-08-10 16:33:32 +02:00
Ishan Agrawal 2ef4baaffc libsysdecode: avoid extra commas for undecoded netlink attributes
Signed-off-by:	Ishan Agrawal <[email protected]>
Sponsored-by:	Google LLC (GSoC 2026)
Reviewed by:	kp
2026-08-10 16:33:32 +02:00
Ishan Agrawal 15c0c9df3a libsysdecode: use decoder table for PF netlink commands
Introduce a PF netlink command decoder table mapping PFNL commands to
their attribute decoder sets. This replaces the existing switch-based
dispatch and makes it easier to add support for additional PF netlink
commands.

Signed-off-by:	Ishan Agrawal <[email protected]>
Sponsored-by:	Google LLC (GSoC 2026)
Reviewed by:	kp
2026-08-10 16:33:32 +02:00
Ishan Agrawal 11bc53984b libsysdecode: add attribute parsing for PFNL_CMD_GETRULES
Signed-off-by:	Ishan Agrawal <[email protected]>
Sponsored-by:	Google LLC (GSoC 2026)
Reviewed by:	kp
2026-08-10 16:33:32 +02:00
Ishan Agrawal 91aa9bf0ae libsysdecode : add attribute parsing for PFNL_CMD_GET_LIMIT
Signed-off-by:	Ishan Agrawal <[email protected]>
Sponsored-by:	Google LLC (GSoC 2026)
Reviewed by:	kp
2026-08-10 16:33:31 +02:00
Ishan Agrawal 1d926be882 libsysdecode : add attribute parsing for PFNL_CMD_KILLSTATES
Signed-off-by:	Ishan Agrawal <[email protected]>
Sponsored-by:	Google LLC (GSoC 2026)
Reviewed by:	kp
2026-08-10 16:33:31 +02:00
Mitchell Horne d6dcd8d2c3 libsysdecode: fix nlm_flag regex in mktables
Some NLM_F_ definitions contain multiple underscores in their name; this
should pick them up.

Reviewed by:	kp, Ishan Agrawal <[email protected]>
Fixes:  4c932a4d45 ("netlink: decode netlink message flags symbolically")
Sponsored by:	The FreeBSD Foundation
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2340
2026-07-28 11:30:52 -03:00
Dag-Erling Smørgrav 2bacbbecb1 kqueue: Add NOTE_REAP
Add a NOTE_REAP event for EVFILTER_PROC which provides a notification
when the process is reaped.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Reviewed by:	kib, markj
Differential Revision:	https://reviews.freebsd.org/D58313
2026-07-27 12:15:26 +02:00
Ishan Agrawal 407b7bcc93 libsysdecode: decode combined Netlink message flags
Change sysdecode_nlm_flag() to decode Netlink message flags as a
bitmask instead of looking up a single flag value. This correctly
prints combinations of NLM_F_* flags while preserving any unknown
bits in hexadecimal.

Reported by:	androvonx95 <[email protected]>
Reviewed by:	kp
Signed-off-by:	Ishan Agrawal <[email protected]>
Sponsored-by:	Google LLC (GSoC 2026)
2026-07-27 11:27:54 +02:00
Ishan Agrawal 5c1461a2b0 libsysdecode: use local sysdecode.h
Replace <sysdecode.h> with "sysdecode.h" so local builds use the in-tree header
in lib/libsysdecode instead of a stale installed copy in /usr/include, avoiding
build failures after updating sysdecode.h.

Signed-off-by:	Ishan Agrawal <[email protected]>
Sponsored-by:	Google LLC (GSoC 2026)
Reviewed by:	kp
Pull-Request:	https://github.com/freebsd/freebsd-src/pull/2338
2026-07-27 09:24:49 +02:00
Ishan Agrawal 26bb78b772 libsysdecode: add Netlink attribute decoding infrastructure
Introduce a generic Netlink attribute decoding framework based on
attribute decoder tables. The framework supports decoding primitive
attribute types as well as nested attributes and can be reused by
different Generic Netlink families.

Signed-off-by:	Ishan Agrawal <[email protected]>
Sponsored-by:	Google LLC (GSoC 2026)
Reviewed-by:	kp
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2337
2026-07-24 17:02:37 +02:00
Dag-Erling Smørgrav a931431a1d libsysdecode: Recognize NOTE_PDSIGCHLD
MFC after:	1 week
Fixes:		2a5e58c596 ("procdesc: add NOTE_PDSIGCHLD")
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D58388
2026-07-21 23:57:32 +02:00
Dag-Erling Smørgrav af202a5052 Retire dialog
This is the last remaining piece of GPL software in the base system.
The installer transitioned to bsddialog four years ago, and the last
remaining dialog consumer, dpv, was turned off more than two years ago.
Retire dpv, libdpv, libfigpar (used only by dpv), and dialog itself.

Reviewed by:	dteske
Differential Revision:	https://reviews.freebsd.org/D55424
2026-07-07 08:47:36 +02:00
Gleb Smirnoff f01c509568 pf: revert netlink commands back to enum
Revert pf_nl.h part of 017690e509 and use new libsysdecode build glue
that parses enums.

Reviewed by:	kp, glebius
Differential Revision:	https://reviews.freebsd.org/D57866
2026-07-06 21:41:25 +02:00
Dag-Erling Smørgrav 8b197806dc libsysdecode: Teach mktables to handle enums
While here, clean up and simplify the existing code.

MFC after:	1 week
Reviewed by:	glebius, jhb
Differential Revision:	https://reviews.freebsd.org/D57993
2026-07-06 21:41:15 +02:00
Ishan Agrawal fa50691ecf libsysdecode: decode PF Generic Netlink commands
Decode the Generic Netlink command header for messages
belonging to the PF Generic Netlink family. Display the
command name using the PF Generic Netlink command decoder.

Signed-off-by:	Ishan Agrawal <[email protected]>
Reviewed by:	kp
Sponsored-by:	Google LLC (GSoC 2026)
2026-07-05 16:04:06 +02:00
Ishan Agrawal c268c80fc3 libsysdecode: cache Generic Netlink family IDs
Record Generic Netlink family IDs learned from
CTRL_CMD_GETFAMILY responses and use them to decode subsequent
Generic Netlink messages using symbolic family names instead of
numeric IDs.

Signed-off-by:	Ishan Agrawal <[email protected]>
Reviewed by:	kp
Sponsored-by:	Google LLC (GSoC 2026)
2026-07-05 16:03:52 +02:00
Ishan Agrawal 80586e8536 libsysdecode: decode Generic Netlink controller messages
Decode Generic Netlink controller (GENL_ID_CTRL) messages in
Netlink payloads. Display the Generic Netlink header along with
the CTRL_CMD_GETFAMILY attributes, including the family ID and
family name.

Signed-off-by:	Ishan Agrawal <[email protected]>
Reviewed by:	kp
Sponsored-by:	Google LLC (GSoC 2026)
2026-07-05 16:03:34 +02:00
Ishan Agrawal 8a1576dc26 truss: track Netlink socket protocols
Record the Netlink protocol associated with AF_NETLINK sockets when
they are created and pass it to libsysdecode during message decoding.

Use the protocol to distinguish between Generic Netlink and Route
Netlink sockets, ensuring that Generic Netlink decoding is only
performed for NETLINK_GENERIC sockets.

Signed-off-by:	Ishan Agrawal <[email protected]>
Reviewed by:	kp
Sponsored-by :	Google LLC (GSoC 2026)
2026-07-05 16:03:20 +02:00
Dag-Erling Smørgrav 402a657488 libsysdecode: Fix shutdownhow table
MFC after:	1 week
Fixes:		c3276e02be ("sockets: make shutdown(2) how argument a enum")
Reviewed by:	glebius
Differential Revision:	https://reviews.freebsd.org/D57915
2026-07-01 12:06:52 +02:00
Dag-Erling Smørgrav 2b9f382361 Revert "Retire dialog"
This reverts commit 5b2bdadeb6.
2026-06-29 17:53:51 +02:00
Dag-Erling Smørgrav 5b2bdadeb6 Retire dialog
This is the last remaining piece of GPL software in the base system.
The installer transitioned to bsddialog four years ago, and the last
remaining dialog consumer, dpv, was turned off more than two years ago.
Retire dpv, libdpv, libfigpar (used only by dpv), and dialog itself.

(cherry picked from commit 73bb4a92985d747462d866248c1e7623f7ff1a7f)
2026-06-29 13:49:22 +00:00
Ishan Agrawal 4c932a4d45 netlink: decode netlink message flags symbolically
Generate an nlm_flag table definition for mktable from
netlink/netlink.h, add a sysdecode_nlm_flag() helper to
libsysdecode, and use it when decoding netlink message headers.

This enables mktable to generate netlink message flag lookup tables and
replaces raw hexadecimal output for recognized NLM_F_* flag values
with their symbolic names.

Reviewed by:	kp
Signed-off-by:	Ishan Agrawal <[email protected]>
Sponsored by:	Google LLC (GSoC 2026)
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2294
2026-06-24 14:15:20 +02:00
Ishan Agrawal 017690e509 netpfil: add PF netlink command decoding support
Convert PFNL_CMD values in pf_nl.h from an enum to #define constants,
add a pfnl_cmd table definition for mktable, and implement the
corresponding command decoding helpers in libsysdecode.

This allows mktable to generate PF netlink command lookup tables and
enables symbolic decoding of PF netlink commands.

Reviewed by:	kp
Signed-off-by:	Ishan Agrawal <[email protected]>
Sponsored by:	Google LLC (GSoC 2026)
2026-06-03 10:52:06 +02:00
Ishan Agrawal 8ef0093f29 truss: add support for decoding Netlink messages
Netlink usage is growing in FreeBSD. This patch adds support to
`truss(1)` to decode Netlink headers in sendmsg/recvmsg calls, making
debugging network configuration tools significantly easier.

Changes:

libsysdecode: Add `sysdecode_netlink()` to parse struct `nlmsghdr`.
truss: Detect `AF_NETLINK` sockets and decode the message payload.

Reviewed by:	kp
Signed-off-by:	Ishan Agrawal <[email protected]>
Github PR:	https://github.com/freebsd/freebsd-src/pull/1950
2026-04-03 08:52:29 +02:00
Enji Cooper b78806b156 Remove additional libtpool and libuutil-related files
This change removes additional library files and tests orphaned in the
commit referenced below.

MFC with:	8b78d412a
Fixes: 8b78d412a ("zfs: world changes after 89f729dcc merge")
2026-02-03 23:33:04 -08:00
Alex Richardson 86f325711c rtld: silence clang's unterminated-string-initialization warning
Since the initializer is used in other places where we can't just
replace it with a char-by-char initializer, this adds a macro for the
nonstring attribute (match the linuxkpi definition).

Reviewed by:	emaste, jhb
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D52535
2025-12-16 12:21:45 -08:00
Dag-Erling Smørgrav c51876a107 libsysdecode: Use consistent include path
mkioctls should look at the same set of headers as mktables does.

MFC after:	1 week
Fixes:          139d114acc ("libsysdecode use MKTABLES_INCLUDEDIR")
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Reviewed by:	sjg
Differential Revision:	https://reviews.freebsd.org/D54106
2025-12-07 14:06:41 +01:00
Jose Luis Duran 7238317403 blocklist: Rename blacklist to blocklist
Follow up upstream rename from blacklist to blocklist.

- Old names and rc scripts are still valid, but emitting an ugly warning
- Old firewall rules and anchor names should work, but emitting an ugly
  warning
- Old MK_BLACKLIST* knobs are wired to the new ones

Although care has been taken not to break current configurations, this
is a large patch containing mostly duplicated code.  If issues arise, it
will be swiftly reverted.

Reviewed by:	ivy (pkgbase)
Approved by:	emaste (mentor)
MFC after:	2 days
Relnotes:	yes
2025-10-12 17:14:27 +00:00
Felix Johnson 4ba91e076e sysdecode_syscallnames.3: s/names/name/
The sysdecode_syscallname function was accidentally documented as being
plural. Move it to reflect it's actual name, and adjust all references.

PR:			278383
Reviewed by:		ziaee
Differential Revision:	https://reviews.freebsd.org/D51002
2025-08-25 20:49:05 -04:00
Ricardo Branco ea4042246d libsysdecode: Add O_CLOFORK flags to sysdecode
Reviewed by:	kib
MFC after:	1 month
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1698
2025-07-06 23:09:18 +00:00
Mark Johnston b79bd43f9a libsysdecode: Add support for decoding inotify syscall flags
MFC after:	3 months
Sponsored by:	Klara, Inc.
2025-07-04 14:42:33 +00:00
Konstantin Belousov c27f7d6b9c libsysdecode: correct regexp for thr_new flags
Two flags include underscore after the "THR_" prefix.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2025-06-04 14:24:20 +03:00
Graham Percival 6e1fc01180 manuals: Fix "unusual .Xr" warnings with a script
These were reported by `mandoc -T lint ...` as warnings:
- unusual Xr order
- unusual Xr punctuation

Fixes made by script in https://github.com/Tarsnap/freebsd-doc-scripts

Signed-off-by:	Graham Percival <[email protected]>
Reviewed by:	mhorne, Alexander Ziaee <[email protected]>
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1464
2024-10-15 17:18:14 -03:00
Mark Johnston a86678a3d6 Remove a ktrace.out which snuck into an earlier commit
Fixes:	b76961e3a2 ("kdump: Print splice structures")
2024-09-10 17:52:43 +00:00
Mark Johnston b76961e3a2 kdump: Print splice structures
MFC after:	3 months
Sponsored by:	Klara, Inc.
Sponsored by:	Stormshield
2024-09-10 16:52:01 +00:00
Warner Losh e9ac41698b Remove residual blank line at start of Makefile
This is a residual of the $FreeBSD$ removal.

MFC After: 3 days (though I'll just run the command on the branches)
Sponsored by: Netflix
2024-07-15 16:43:39 -06:00
Brooks Davis d511e97c54 libsysdecode: support rfork(RFSPAWN)
Match the "U" in RFSPAWN's value (1U<<31) (and "u" for completeness).
Reject kernel-only RFPPWAIT to avoid a duplicate entry.

Reviewed by:	imp, markj
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D45597
2024-06-19 21:38:31 +01:00
Simon J. Gerraty 139d114acc libsysdecode use MKTABLES_INCLUDEDIR
We do not conflate SYSROOT with STAGE_ROOT/DESTDIR during
DIRDEPS_BUILD

Make sure mktables looks in the right place.

Reviewed by:	stevek
Sponsored by:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D44415
2024-03-21 11:55:56 -07:00
Kyle Evans 6b3db5d779 libsysdecode: fix build after 3d0a736796
TCP_USE_DDP is a kernel-only macro, so we must exclude it in
libsysdecode to avoid breaking the build.

Fixes:	3d0a736796 ("tcp: Add a new kernel-only TCP_USE_DDP [...]")
2024-03-20 22:14:49 -05:00
Kyle Evans bd23e71f91 libsysdecode: add a decoder for pollfd events
We'll use this in another change to read pollfd arrays coming from a
successful poll(2) operation.

Reviewed by:	bapt, jhb
Differential Revision:	https://reviews.freebsd.org/D44159
2024-03-04 23:44:09 -06:00
Warner Losh a2f733abcf lib: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by:		Netflix
2023-11-26 22:23:59 -07:00
Warner Losh fa9896e082 Remove $FreeBSD$: two-line nroff pattern
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
2023-08-16 11:55:10 -06:00
Warner Losh d0b2dbfa0e Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:03 -06:00
Warner Losh 1d386b48a5 Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:42 -06:00
Warner Losh b3e7694832 Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-08-16 11:54:16 -06:00
Dmitry Chagin f3e11927dc vm: Allow MAP_32BIT for all architectures
Reviewed by:		alc, kib, markj
Differential revision:	https://reviews.freebsd.org/D41435
2023-08-14 20:20:20 +03:00
Jessica Clarke 45be5010ce libsysdecode: Migrate from COMPAT_32BIT to generic COMPAT_LIBCOMPAT
The use isn't any more generic, just the variable itself, which will
allow COMPAT_32BIT to be removed. The fact we even have to check
COMPAT_LIBCOMPAT here in order to pass the right flags to CPP points at
our libcompat infrastructure not suitably modifying the CPP variable
(which we barely use for world; this and bsd.symver.mk are the two
uses, and the latter could benefit from the right flags too), but this
change doesn't attempt to fix that.

See commit 8fad2cda93 ("bsd.compat.mk: Provide new CPP and sub-make
variables") for the context behind this change.

Reviewed by:	emaste, imp, brooks, jhb
Differential Revision:	https://reviews.freebsd.org/D40930
2023-07-09 18:49:43 +01:00