]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
pf: Convenience function for optional (numeric) arguments
authorKristof Provost <kp@FreeBSD.org>
Sat, 15 May 2021 11:45:55 +0000 (13:45 +0200)
committerKristof Provost <kp@FreeBSD.org>
Mon, 31 May 2021 12:19:17 +0000 (14:19 +0200)
commit7c4342890bf17b72f0d79ada1326d9cbf34e736c
tree188e0b35ce5627d0741aeb21df32a3e3ff8bcf28
parent27c77f42ae7402c313deec47aa67a8a8e0889410
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
sys/netpfil/pf/pf_nv.c
sys/netpfil/pf/pf_nv.h