HomeFreeBSD

IfAPI: Add iterator to complement if_foreach()

Description

IfAPI: Add iterator to complement if_foreach()

Summary:
Sometimes an if_foreach() callback can be trivial, or need a lot of
outer context. In this case a regular for loop makes more sense. To
keep things hidden in the new API, use an opaque if_iter structure
that can still be instantiated on the stack. The current implementation
uses just a single pointer out of the 4 alotted to the opaque context,
and the cleanup does nothing, but may be used in the future.

Reviewed by: melifaro
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D39138

Details

Provenance
jhibbitsAuthored on Mar 16 2023, 8:24 PM
Reviewer
melifaro
Differential Revision
D39138: IfAPI: Add iterator to complement if_foreach()
Parents
rG2af158ae8313: makefs: add missing break for 'g' case in tarfs test
Branches
Unknown
Tags
Unknown