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

Details

Provenance
kpAuthored on May 15 2021, 11:45 AM
Reviewer
scottl
Differential Revision
D30510: pf: Convenience function for optional (numeric) arguments
Parents
rG27c77f42ae74: libpfctl: Improve error handling in pfctl_get_states()
Branches
Unknown
Tags
Unknown