summaryrefslogtreecommitdiff
path: root/tests/lib/test_printfrr.c
AgeCommit message (Collapse)Author
2022-03-11lib: add `%pFXh` to print prefix w/o prefixlenDavid Lamparter
Mostly for pimd, for the time being. May be removed again if unused. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-14lib: add time formatting printfrr extsDavid Lamparter
Refer to docs in doc/developer for details. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-14lib: add `s` option to `pI4`/`pI6`/`pIA` printfrrDavid Lamparter
Adding an `s` after these printfrr specifiers replaces 0.0.0.0 / :: in the output with a star (`*`). This is primarily intended for use with multicast, e.g. to print `(*,G)`. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-12pimd: move `%pSG4` to `%pPSG4`David Lamparter
Since this is only used in very few places, moving it out of the way is reasonable. (`%pSG` will be pim_sgaddr) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-11tests: fix frr-format warnings in printfrr testDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-09-14lib,doc,tests: printfrr %pNHcg, %pNHciG. Paul Ziemba
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2021-03-30lib: add `%pSQ` and `%pSE` string escape formatsDavid Lamparter
These are for string quoting (`%pSQ`) and string escaping (`%pSE`); the sets / escape methods are currently rather "basic" and might be extended in the future. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-30lib: add `%*pHX` + `%*pHS` hexdump in printfrrDavid Lamparter
(I'll get to `zlog_hexdump()` in a separate pass.) Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-30lib: add `%pVA` recursive printfrrDavid Lamparter
Analogous to Linux kernel `%pV` (but our mechanism expects 2 specifier chars and `%pVA` is clearer anyway.) Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-30lib: add `FMT_NSTD()` for non-standard printf extsDavid Lamparter
... to suppress the warnings when using something that isn't quite ISO C compatible and would otherwise cause compiler warnings from `-Wformat`. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-27lib: record output positions in printfrrDavid Lamparter
This replaces `%n` with a safe, out-of-band option that simply records the start and end offset of the output produced for each `%...` specifier. The old `%n` code is removed. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-27lib: rework printfrr extensions to output directlyDavid Lamparter
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>
2019-06-12lib: make "%Ld" work for int64_tDavid Lamparter
... without compiler plugins. Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-03tests: exercise printfrr()David Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>