diff options
| author | Quentin Young <qlyoung@users.noreply.github.com> | 2020-07-29 14:29:34 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-29 14:29:34 -0400 |
| commit | 25ee44b52278c86fda27f76e932f6a12c375bf10 (patch) | |
| tree | bea9a0e54e73dafb08400f7e2e435d5be7fa1e93 /lib/prefix.c | |
| parent | 93d08879ad18f820ba00181aaf9a320471d3f7a8 (diff) | |
| parent | 6894924238aa70b7031df3bf77548f1857342217 (diff) | |
Merge pull request #6732 from opensourcerouting/printfrr-prep
*: preparations for printfrr coccinelle run
Diffstat (limited to 'lib/prefix.c')
| -rw-r--r-- | lib/prefix.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/prefix.c b/lib/prefix.c index 0900100be3..697e1a6239 100644 --- a/lib/prefix.c +++ b/lib/prefix.c @@ -22,6 +22,7 @@ #include <zebra.h> #include "prefix.h" +#include "ipaddr.h" #include "vty.h" #include "sockunion.h" #include "memory.h" @@ -1316,6 +1317,26 @@ char *esi_to_str(const esi_t *esi, char *buf, int size) return ptr; } +printfrr_ext_autoreg_p("EA", printfrr_ea) +static ssize_t printfrr_ea(char *buf, size_t bsz, const char *fmt, + int prec, const void *ptr) +{ + const struct ethaddr *mac = ptr; + + prefix_mac2str(mac, buf, bsz); + return 2; +} + +printfrr_ext_autoreg_p("IA", printfrr_ia) +static ssize_t printfrr_ia(char *buf, size_t bsz, const char *fmt, + int prec, const void *ptr) +{ + const struct ipaddr *ipa = ptr; + + ipaddr2str(ipa, buf, bsz); + return 2; +} + printfrr_ext_autoreg_p("I4", printfrr_i4) static ssize_t printfrr_i4(char *buf, size_t bsz, const char *fmt, int prec, const void *ptr) |
