aboutgitcodebugslistschat
path: root/inany.h
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-02-28 22:25:02 +1100
committerStefano Brivio <sbrivio@redhat.com>2024-02-29 09:47:25 +0100
commit330b5db77d4c73b0fad0467e6268c08c4176312e (patch)
tree55d897e629d7cc5db374762b799ccb4fa5541976 /inany.h
parentd31277e292281aa7e61d3785f56af1c956520786 (diff)
downloadpasst-330b5db77d4c73b0fad0467e6268c08c4176312e.tar
passt-330b5db77d4c73b0fad0467e6268c08c4176312e.tar.gz
passt-330b5db77d4c73b0fad0467e6268c08c4176312e.tar.bz2
passt-330b5db77d4c73b0fad0467e6268c08c4176312e.tar.lz
passt-330b5db77d4c73b0fad0467e6268c08c4176312e.tar.xz
passt-330b5db77d4c73b0fad0467e6268c08c4176312e.tar.zst
passt-330b5db77d4c73b0fad0467e6268c08c4176312e.zip
inany: Add inany_ntop() helper
Add this helper to format an inany into either IPv4 or IPv6 text format as appropriate. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'inany.h')
-rw-r--r--inany.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/inany.h b/inany.h
index d110380..be8b8da 100644
--- a/inany.h
+++ b/inany.h
@@ -162,4 +162,8 @@ static inline void inany_siphash_feed(struct siphash_state *state,
siphash_feed(state, (uint64_t)aa->u32[2] << 32 | aa->u32[3]);
}
+#define INANY_ADDRSTRLEN MAX(INET_ADDRSTRLEN, INET6_ADDRSTRLEN)
+
+const char *inany_ntop(const union inany_addr *src, char *dst, socklen_t size);
+
#endif /* INANY_H */