diff options
author | David Lamparter <equinox@diac24.net> | 2021-03-26 14:16:01 +0100 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2021-03-30 22:34:56 +0200 |
commit | 94f78404952795538b72b752ef08d865122ecd09 (patch) | |
tree | c369c678b187287bb967e1e38249e279e15a61cb /lib/sockunion.h | |
parent | lib: add `%pSQ` and `%pSE` string escape formats (diff) | |
download | frr-94f78404952795538b72b752ef08d865122ecd09.tar.xz frr-94f78404952795538b72b752ef08d865122ecd09.zip |
lib: fix & improve `%pSU` format
This wasn't quite formatting IPv6+port in a useful way (no brackets),
and printing the scope ID (interface index) and unix addrs is useful
too.
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to '')
-rw-r--r-- | lib/sockunion.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/sockunion.h b/lib/sockunion.h index 5e80ba109..46ab7ff20 100644 --- a/lib/sockunion.h +++ b/lib/sockunion.h @@ -24,6 +24,7 @@ #include "privs.h" #include "if.h" +#include <sys/un.h> #ifdef __OpenBSD__ #include <netmpls/mpls.h> #endif @@ -36,6 +37,7 @@ union sockunion { struct sockaddr sa; struct sockaddr_in sin; struct sockaddr_in6 sin6; + struct sockaddr_un sun; #ifdef __OpenBSD__ struct sockaddr_mpls smpls; struct sockaddr_rtlabel rtlabel; @@ -106,6 +108,11 @@ extern int sockunion_is_null(const union sockunion *su); #ifdef _FRR_ATTRIBUTE_PRINTFRR #pragma FRR printfrr_ext "%pSU" (union sockunion *) +#pragma FRR printfrr_ext "%pSU" (struct sockaddr *) +#pragma FRR printfrr_ext "%pSU" (struct sockaddr_storage *) +#pragma FRR printfrr_ext "%pSU" (struct sockaddr_in *) +#pragma FRR printfrr_ext "%pSU" (struct sockaddr_in6 *) +#pragma FRR printfrr_ext "%pSU" (struct sockaddr_un *) #endif #ifdef __cplusplus |