1 .\" Copyright 2000 Sam Varshavchik <mrsam@courier-mta.com>
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" References: RFC 2553
24 .TH INET_NTOP 3 2008-11-11 "Linux" "Linux Programmer's Manual"
26 inet_ntop \- convert IPv4 and IPv6 addresses from binary to text form
29 .B #include <arpa/inet.h>
31 .BI "const char *inet_ntop(int " "af" ", const void *" "src" ,
32 .BI " char *" "dst" ", socklen_t " "size" );
35 This function converts the network address structure
39 address family into a character string.
40 The resulting string is copied to the buffer pointed to by
42 which must be a non-NULL pointer.
43 The caller specifies the number of bytes available in this buffer in
50 function to support multiple address families,
52 is now considered to be deprecated in favor of
54 The following address families are currently supported:
60 (in network byte order)
61 which is converted to an IPv4 network address in
62 the dotted-decimal format, "\fIddd.ddd.ddd.ddd\fP".
73 (in network byte order)
74 which is converted to a representation of this address in the
75 most appropriate IPv6 network address format for this address.
84 returns a non-NULL pointer to
86 NULL is returned if there was an error, with
88 set to indicate the error.
93 was not a valid address family.
96 The converted address string would exceed the size given by
100 Note that RFC\ 2553 defines a prototype where the last argument
104 Many systems follow RFC\ 2553.
105 Glibc 2.0 and 2.1 have
107 but 2.2 and later have
109 .\" 2.1.3: size_t, 2.1.91: socklen_t
112 converts IPv4-mapped IPv6 addresses into an IPv6 format.