Page MenuHomeFreeBSD

pf: Convenience function for optional (numeric) arguments
ClosedPublic

Authored by kp on May 27 2021, 2:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jun 25, 2:04 AM
Unknown Object (File)
Tue, Jun 23, 9:08 AM
Unknown Object (File)
Mon, Jun 22, 6:40 PM
Unknown Object (File)
Mon, Jun 22, 2:21 PM
Unknown Object (File)
Sat, Jun 20, 6:48 PM
Unknown Object (File)
Sat, Jun 20, 2:23 PM
Unknown Object (File)
Wed, Jun 17, 7:43 PM
Unknown Object (File)
Thu, Jun 4, 6:24 AM

Details

Summary

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.

MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable