[dev] New "printfrr()" functionality available in FRR master

Christian Franke chris at opensourcerouting.org
Fri Jun 7 07:06:06 EDT 2019


On 6/7/19 12:43 PM, David Lamparter wrote:
> The idea is that instead of doing:
> if (debug) {
>   char buf[];
>   zlog_debug("%s", inet_ntop(AF_INET, &addr, buf, sizeof(buf)));
> }
> you can do:
> if (debug)
>   zlog_debug("%pI4", &addr);
> For example, "%pI4" is used to print a "struct in_addr *" as A.B.C.D,
> with the inet_ntop() call happening inside of printfrr() instead of
> separately beforehand.

It's really cool to see this longstanding idea finally implemented. I
think it will make it a lot nicer to write code for FRR, while at the
same time allowing the code to be more concise and readable.

Great job everyone who made this possible!

All Best,

More information about the dev mailing list