4 * Simple version of inet_ntop()
12 const char *inet_ntop(int af
, const void *src
,
13 char *dst
, socklen_t cnt
)
19 p
= inet_ntoa(*((struct in_addr
*)src
));
21 if (cnt
<= strlen(p
)) {
35 struct in6_addr
*a
= src
;
39 /* we do not compress :0: to :: */
40 for (i
= 0; i
< 8; i
++)
41 p
+= sprintf(p
, "%x:", ntohs(a
->s6_addr16
[i
]));