diff options
| author | David Lamparter <equinox@diac24.net> | 2021-03-26 14:20:08 +0100 |
|---|---|---|
| committer | David Lamparter <equinox@diac24.net> | 2021-03-30 22:34:56 +0200 |
| commit | 7b183fd8ea23a03480fb40616ca0e8efaf0c1f76 (patch) | |
| tree | bed35490a531ad23b20e89a617438884793ef2aa /lib/sockunion.h | |
| parent | 94f78404952795538b72b752ef08d865122ecd09 (diff) | |
lib: add `%dPF` & `%dSO` formats
Just quick helpers to print `AF_*` and `SOCK_*` constants.
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'lib/sockunion.h')
| -rw-r--r-- | lib/sockunion.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/sockunion.h b/lib/sockunion.h index 46ab7ff20e..2cc80bb70f 100644 --- a/lib/sockunion.h +++ b/lib/sockunion.h @@ -113,6 +113,11 @@ extern int sockunion_is_null(const union sockunion *su); #pragma FRR printfrr_ext "%pSU" (struct sockaddr_in *) #pragma FRR printfrr_ext "%pSU" (struct sockaddr_in6 *) #pragma FRR printfrr_ext "%pSU" (struct sockaddr_un *) + +/* AF_INET/PF_INET & co., using "PF" to avoid confusion with AFI/SAFI */ +#pragma FRR printfrr_ext "%dPF" (int) +/* SOCK_STREAM & co. */ +#pragma FRR printfrr_ext "%dSO" (int) #endif #ifdef __cplusplus |
