David - I think these are fine. donald On Sat, Mar 27, 2021 at 2:48 PM David Lamparter <equinox@diac24.net> wrote:
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
_______________________________________________ dev mailing list dev@lists.frrouting.org https://lists.frrouting.org/listinfo/dev