<div dir="ltr">David -<div><br></div><div>I think these are fine.</div><div><br></div><div>donald</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Mar 27, 2021 at 2:48 PM David Lamparter <<a href="mailto:equinox@diac24.net">equinox@diac24.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi all,<br>
<br>
<br>
as I'm currently worming my way through the printfrr code, I'd like to<br>
add printfrr specifiers for afi_t/safi_t/iana_afi_t/iana_safi_t.<br>
However, unlike most other extension specifiers, there's no "obvious<br>
good" extension specifier for these, so here's a thread asking for<br>
suggestions.<br>
<br>
(extension specifier = "%pFX" & co.)<br>
<br>
For afi_t/safi_t/iana_afi_t/iana_safi_t the considerations are:<br>
- must start with "%d" or "%i" (if that eases a mnemonic, like with<br>
"%pFX", this might be a choice, but %i is probably better)<br>
- must then have one uppercase character, followed by one or more<br>
uppercase characters or digits, i.e.<br>
%i[A-Z][A-Z0-9][A-Z0-9]*<br>
- must not overlap with other extensions on a shorter length<br>
(i.e. no "%iAF" + "%iAFI")<br>
- this sequence must be different for all 4 AFI types for the typecheck<br>
to work correctly<br>
- should be short, the longest specifier currently existing is %pSG4 for<br>
"struct prefix_sg *", i.e. 3 characters after the %_<br>
- needs to be not misunderstood for AF_INET type constants, so %iAF/%dAF<br>
is probably a bad choice<br>
- needs to be as understandable/obvious as possible<br>
<br>
Not adding an extension specifier for (some of) these types is also an<br>
option. Ultimatively the question is what makes the code the "nicest."<br>
<br>
The best I can come up with is:<br>
- %iFA (afi_t) - "F)rr A)fi"<br>
- %iFS (safi_t) - "F)rr S)afi"<br>
- %iIA (iana_afi_t) - "I)ana A)fi" - slight overlap with %pIA<br>
- %iIS (iana_safi_t) - "I)ana S)afi"<br>
<br>
But maybe something longer is better?<br>
<br>
Input requested!<br>
<br>
<br>
-David<br>
<br>
_______________________________________________<br>
dev mailing list<br>
<a href="mailto:dev@lists.frrouting.org" target="_blank">dev@lists.frrouting.org</a><br>
<a href="https://lists.frrouting.org/listinfo/dev" rel="noreferrer" target="_blank">https://lists.frrouting.org/listinfo/dev</a><br>
</blockquote></div>