[dev] printfrr bikeshed color for [iana_][s]afi_t
David Lamparter
equinox at diac24.net
Sat Mar 27 18:44:12 UTC 2021
Hi all,
as I'm currently worming my way through the printfrr code, I'd like to
add printfrr specifiers for afi_t/safi_t/iana_afi_t/iana_safi_t.
However, unlike most other extension specifiers, there's no "obvious
good" extension specifier for these, so here's a thread asking for
suggestions.
(extension specifier = "%pFX" & co.)
For afi_t/safi_t/iana_afi_t/iana_safi_t the considerations are:
- must start with "%d" or "%i" (if that eases a mnemonic, like with
"%pFX", this might be a choice, but %i is probably better)
- must then have one uppercase character, followed by one or more
uppercase characters or digits, i.e.
%i[A-Z][A-Z0-9][A-Z0-9]*
- must not overlap with other extensions on a shorter length
(i.e. no "%iAF" + "%iAFI")
- this sequence must be different for all 4 AFI types for the typecheck
to work correctly
- should be short, the longest specifier currently existing is %pSG4 for
"struct prefix_sg *", i.e. 3 characters after the %_
- needs to be not misunderstood for AF_INET type constants, so %iAF/%dAF
is probably a bad choice
- needs to be as understandable/obvious as possible
Not adding an extension specifier for (some of) these types is also an
option. Ultimatively the question is what makes the code the "nicest."
The best I can come up with is:
- %iFA (afi_t) - "F)rr A)fi"
- %iFS (safi_t) - "F)rr S)afi"
- %iIA (iana_afi_t) - "I)ana A)fi" - slight overlap with %pIA
- %iIS (iana_safi_t) - "I)ana S)afi"
But maybe something longer is better?
Input requested!
-David
More information about the dev
mailing list