diff options
Diffstat (limited to 'lib/in46_addr.c')
-rw-r--r-- | lib/in46_addr.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/in46_addr.c b/lib/in46_addr.c index 8f5cc09..4e7cbcd 100644 --- a/lib/in46_addr.c +++ b/lib/in46_addr.c @@ -69,6 +69,16 @@ const char *in46a_ntop(const struct in46_addr *in, char *dst, socklen_t dst_size return inet_ntop(af, (const void *) &in->v4, dst, dst_size); } +/* like inet_ntoa() */ +const char *in46a_ntoa(const struct in46_addr *in46) +{ + static char addrstr_buf[256]; + if (in46a_ntop(in46, addrstr_buf, sizeof(addrstr_buf)) < 0) + return "INVALID"; + else + return addrstr_buf; +} + /*! Determine if two in46_addr are equal or not * \returns 1 in case they are equal; 0 otherwise */ int in46a_equal(const struct in46_addr *a, const struct in46_addr *b) |