version 4, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
inet_ntop |
|
|
2 |
!!!inet_ntop |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
RETURN VALUE |
|
|
7 |
SEE ALSO |
|
|
8 |
BUGS |
|
|
9 |
---- |
|
|
10 |
!!NAME |
|
|
11 |
|
|
|
12 |
|
|
|
13 |
inet_ntop - Parse network address structures |
|
|
14 |
!!SYNOPSIS |
|
|
15 |
|
|
|
16 |
|
|
|
17 |
__#include |
|
|
18 |
__ ''af''__, const void *__''src''__, |
|
|
19 |
char *__''dst''__, size_t__ ''cnt''__); |
|
|
20 |
__ |
|
|
21 |
!!DESCRIPTION |
|
|
22 |
|
|
|
23 |
|
|
|
24 |
This function converts the network address structure |
|
|
25 |
''src'' in the ''af'' address family into a character |
|
|
26 |
string, which is copied to a character buffer ''dst'', |
|
|
27 |
which is ''cnt'' bytes long. |
|
|
28 |
|
|
|
29 |
|
4 |
perry |
30 |
inet_ntop(3) extends the __inet_ntoa__(3) function |
|
|
31 |
to support multiple address families, inet_ntoa(3) is |
1 |
perry |
32 |
now considered to be deprecated in favor of |
4 |
perry |
33 |
inet_ntop(3). The following address families are |
1 |
perry |
34 |
currently supported: |
|
|
35 |
|
|
|
36 |
|
|
|
37 |
__AF_INET__ |
|
|
38 |
|
|
|
39 |
|
|
|
40 |
''src'' points to a ''struct in_addr'' (network byte |
|
|
41 |
order format) which is converted to an IPv4 network address |
|
|
42 |
in the dotted-quad format, |
|
|
43 |
''ddd.ddd.ddd.ddd''''dst'' |
|
|
44 |
must be at least __INET_ADDRSTRLEN__ bytes |
|
|
45 |
long. |
|
|
46 |
|
|
|
47 |
|
|
|
48 |
__AF_INET6__ |
|
|
49 |
|
|
|
50 |
|
|
|
51 |
''src'' points to a ''struct in6_addr'' (network byte |
|
|
52 |
order format) which is converted to a representation of this |
|
|
53 |
address in the most appropriate IPv6 network address format |
|
|
54 |
for this address. The buffer ''dst'' must be at least |
|
|
55 |
__INET6_ADDRSTRLEN__ bytes long. |
|
|
56 |
!!RETURN VALUE |
|
|
57 |
|
|
|
58 |
|
|
|
59 |
__inet_ntop__ returns a non-null pointer to ''dst''. |
|
|
60 |
NULL is returned if there was an error, with ''errno'' |
|
|
61 |
set to __EAFNOSUPPORT__ if ''af'' was not set to a |
|
|
62 |
valid address family, or to __ENOSPC__ if the converted |
|
|
63 |
address string would exceed the size of ''dst'' given by |
|
|
64 |
the ''cnt'' argument. |
|
|
65 |
!!SEE ALSO |
|
|
66 |
|
|
|
67 |
|
4 |
perry |
68 |
inet_pton(3) |
1 |
perry |
69 |
!!BUGS |
|
|
70 |
|
|
|
71 |
|
|
|
72 |
__AF_INET6__ converts IPv6-mapped IPv4 addresses into an |
|
|
73 |
IPv6 format. |
|
|
74 |
---- |