HomeFreeBSD

libpfctl: introduce pfctl_handle

Description

libpfctl: introduce pfctl_handle

Consumers of libpfctl can (and in future, should) open a handle. This
handle is an opaque object which contains the /dev/pf file descriptor
and a netlink handle. This means that libpfctl users can open the handle
as root, then drop privileges and still access pf.

Already add the handle to pfctl_startstop() and pfctl_get_creatorids()
as these are new in main, and not present on stable branches. Other
calls will have handle-enabled alternatives implemented in subsequent
commits.

Sponsored by: Rubicon Communications, LLC ("Netgate")

Details

Provenance
kpAuthored on Jan 4 2024, 9:50 AM
Parents
rG32df0124f467: pf tests: ensure that pflog shows malformed packets as blocked, not passed
Branches
Unknown
Tags
Unknown