]> git.proxmox.com Git - mirror_frr.git/commit
lib: rework printfrr extensions to output directly
authorDavid Lamparter <equinox@diac24.net>
Thu, 18 Feb 2021 21:52:23 +0000 (22:52 +0100)
committerDavid Lamparter <equinox@diac24.net>
Sat, 27 Mar 2021 15:56:55 +0000 (16:56 +0100)
commit212e04e5a7f682594dab26cd8354bc4fa040b61f
tree59a09a812b868332f073985494ee0a61910da9fd
parentbcf9d7d8aa77c66ac2e99f75ae11e276accecb1d
lib: rework printfrr extensions to output directly

Allowing printfrr extensions to directly write to the output buffer has
a few advantages:
- there is no arbitrary length limit imposed (previously 64)
- the output doesn't need to be copied another time
- the extension can directly use bprintfrr() to put together pieces

The downside is that the theoretical length (regardless of available
buffer space) must be computed correctly.

Extended unit tests to test these paths a bit more thoroughly.

Signed-off-by: David Lamparter <equinox@diac24.net>
bgpd/bgp_table.c
lib/nexthop.c
lib/prefix.c
lib/printf/glue.c
lib/printf/printflocal.h
lib/printf/vfprintf.c
lib/printfrr.h
lib/sockunion.c
lib/srcdest_table.c
tests/lib/test_printfrr.c