HomeFreeBSD

MAC/do: Ease input/output of ID types

Description

MAC/do: Ease input/output of ID types

Have a static constant array mapping numerical ID types to their
canonical representations ('id_type_to_str').

New parse_id_type() that parses a type thanks to 'id_type_to_str' and
with a special case to accept also 'any'.

Have parse_rule_element() use parse_id_type(). A later commit will add
a second call to the latter for the destination ID.

Reviewed by: bapt
Approved by: markj (mentor)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47615

Details

Provenance
olceAuthored on Jul 5 2024, 1:30 PM
Reviewer
bapt
Differential Revision
D47615: MAC/do: Ease input/output of ID types
Parents
rG0af43c029048: MAC/do: Better parsing for IDs (strtoui_strict())
Branches
Unknown
Tags
Unknown