HomeFreeBSD

pf: Convenience function for optional (numeric) arguments

Description

pf: Convenience function for optional (numeric) arguments

Add _opt() variants for the uint* functions. These functions set the
provided default value if the nvlist doesn't contain the relevant value.
This is helpful for optional values (e.g. when the API is extended to
add new fields).

While here simplify the header by also using macros to create the
prototypes for the macro-generated function implementations.

Reviewed by: scottl
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D30510

(cherry picked from commit 7c4342890bf17b72f0d79ada1326d9cbf34e736c)

Details

Provenance
kpAuthored on May 15 2021, 11:45 AM
Reviewer
scottl
Differential Revision
D30510: pf: Convenience function for optional (numeric) arguments
Parents
rG4a3bd4277286: LinuxKPI: add pr_err_once
Branches
Unknown
Tags
Unknown