2 .\" Copyright 2000 Sam Varshavchik <mrsam@courier-mta.com>
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\" References: RFC 2553
7 .TH inet_ntop 3 (date) "Linux man-pages (unreleased)"
9 inet_ntop \- convert IPv4 and IPv6 addresses from binary to text form
12 .RI ( libc ", " \-lc )
15 .B #include <arpa/inet.h>
17 .BI "const char *inet_ntop(int " af ", const void *restrict " src ,
18 .BI " char " dst "[restrict ." size "], socklen_t " size );
21 This function converts the network address structure
25 address family into a character string.
26 The resulting string is copied to the buffer pointed to by
28 which must be a non-null pointer.
29 The caller specifies the number of bytes available in this buffer in
36 function to support multiple address families,
38 is now considered to be deprecated in favor of
40 The following address families are currently supported:
46 (in network byte order)
47 which is converted to an IPv4 network address in
48 the dotted-decimal format, "\fIddd.ddd.ddd.ddd\fP".
59 (in network byte order)
60 which is converted to a representation of this address in the
61 most appropriate IPv6 network address format for this address.
70 returns a non-null pointer to
72 NULL is returned if there was an error, with
74 set to indicate the error.
79 was not a valid address family.
82 The converted address string would exceed the size given by
85 For an explanation of the terms used in this section, see
93 Interface Attribute Value
96 T} Thread safety MT-Safe locale
106 Note that RFC\ 2553 defines a prototype where the last argument
110 Many systems follow RFC\ 2553.
111 glibc 2.0 and 2.1 have
113 but 2.2 and later have
115 .\" 2.1.3: size_t, 2.1.91: socklen_t
118 converts IPv4-mapped IPv6 addresses into an IPv6 format.