inet_ntop(3) Library Functions Manual inet_ntop(3) inet_ntop - IPv4 IPv6 C (libc, -lc) #include const char *inet_ntop(socklen_t size; int af, const void *restrict src, char dst[restrict size], socklen_t size); src af dst, NULL. size . inet_ntoa(3) inet_ntop() , inet_ntoa(3). : AF_INET src points to a struct in_addr (in network byte order) which is converted to an IPv4 network address in the dotted-decimal format, "ddd.ddd.ddd.ddd". The buffer dst must be at least INET_ADDRSTRLEN bytes long. AF_INET6 src struct in6_addr ( ), IPv6 . dst , , INET6_ADDRSTRLEN . inet_ntop() -NULL dst. NULL, errno . EAFNOSUPPORT af . ENOSPC , size. attributes(7). +----------------------------+----------------------------------------------------------+--------------------------+ | | | | +----------------------------+----------------------------------------------------------+--------------------------+ |inet_ntop() | | MT-Safe locale | +----------------------------+----------------------------------------------------------+--------------------------+ POSIX.1-2008. POSIX.1-2001. Note that RFC 2553 defines a prototype where the last argument size is of type size_t. Many systems follow RFC 2553. glibc 2.0 and 2.1 have size_t, but 2.2 and later have socklen_t. AF_INET6 IPv4- IPv6 IPv6. inet_pton(3). getnameinfo(3), inet(3), inet_pton(3) () Azamat Hackimov , Dmitriy S. Seregin , Yuri Kozlov ; GNU (GNU General Public License - GPL, 3 ) , - . - , , () () () . Linux man-pages 6.18 28 2025 . inet_ntop(3)