OSDN Git Service

(split) LDP_man-pages: release ioctl.2 [JM:00378]
[linuxjm/LDP_man-pages.git] / draft / man3 / inet_ntop.3
1 .\" Copyright 2000 Sam Varshavchik <mrsam@courier-mta.com>
2 .\"
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.
6 .\"
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.
11 .\"
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
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" References: RFC 2553
24 .\"
25 .\" Japanese Version Copyright (c) 2001 NAKANO Takeo all rights reserved.
26 .\" Translated 2001-01-14, NAKANO Takeo <nakano@apm.seikei.ac.jp>
27 .\" Updated 2005-02-26, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
28 .\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05
29 .\"
30 .TH INET_NTOP 3 2008-11-11 "Linux" "Linux Programmer's Manual"
31 .\"O .SH NAME
32 .SH Ì¾Á°
33 .\"O inet_ntop \- convert IPv4 and IPv6 addresses from binary to text form
34 inet_ntop \- IPv4/IPv6 ¥¢¥É¥ì¥¹¤ò¥Ð¥¤¥Ê¥ê·Á¼°¤«¤é¥Æ¥­¥¹¥È·Á¼°¤ËÊÑ´¹¤¹¤ë
35 .\"O .SH SYNOPSIS
36 .SH ½ñ¼°
37 .nf
38 .B #include <arpa/inet.h>
39 .sp
40 .BI "const char *inet_ntop(int " "af" ", const void *" "src" ,
41 .BI "                      char *" "dst" ", socklen_t " "size" );
42 .fi
43 .\"O .SH DESCRIPTION
44 .SH ÀâÌÀ
45 .\"O This function converts the network address structure
46 .\"O .I src
47 .\"O in the
48 .\"O .I af
49 .\"O address family into a character string.
50 .\"O The resulting string is copied to the buffer pointed to by
51 .\"O .IR dst ,
52 .\"O which must be a non-NULL pointer.
53 .\"O The caller specifies the number of bytes available in this buffer in
54 .\"O the argument
55 .\"O .IR size .
56 ¤³¤Î´Ø¿ô¤Ï¡¢
57 .I af
58 ¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¹½Â¤ÂÎ
59 .I src
60 ¤òʸ»úÎó¤ËÊÑ´¹¤¹¤ë¡£
61 ÊÑ´¹·ë²Ì¤Îʸ»úÎó¤Ï¡¢
62 .I dst
63 ¤¬»Ø¤¹¥Ð¥Ã¥Õ¥¡¤Ë¥³¥Ô¡¼¤µ¤ì¤ë¡£
64 .I dst
65 ¤Ï NULL ¤Ç¤Ê¤¤¥Ý¥¤¥ó¥¿¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
66 ¸Æ¤Ó½Ð¤·»þ¤Ë¡¢¤³¤Î¥Ð¥Ã¥Õ¥¡¤ÇÍøÍѤǤ­¤ë¥Ð¥¤¥È¿ô¤ò
67 °ú¤­¿ô
68 .I size
69 ¤Ë»ØÄꤹ¤ë¡£
70 .PP
71 .\"O .BR inet_ntop ()
72 .\"O extends the
73 .\"O .BR inet_ntoa (3)
74 .\"O function to support multiple address families,
75 .\"O .BR inet_ntoa (3)
76 .\"O is now considered to be deprecated in favor of
77 .\"O .BR inet_ntop ().
78 .\"O The following address families are currently supported:
79 .BR inet_ntop ()
80 ¤Ï
81 .BR inet_ntoa (3)
82 ´Ø¿ô¤ò³ÈÄ¥¤·¤ÆÊ£¿ô¤Î¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤ò°·¤¨¤ë¤è¤¦¤Ë¤·¤¿¤â¤Î¤Ç¤¢¤ë¡£
83 º£¸å¤Ï
84 .BR inet_ntoa (3)
85 ¤Ï»È¤ï¤º¡¢
86 .BR inet_ntop ()
87 ¤ò»È¤¦¤è¤¦¤Ë¤¹¤ë¤ÈÎɤ¤¤À¤í¤¦¡£
88 ¸½ºß¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Ï°Ê²¼¤ÎÄ̤ê:
89 .TP
90 .B AF_INET
91 .\"O .I src
92 .\"O points to a
93 .\"O .I struct in_addr
94 .\"O (in network byte order)
95 .\"O which is converted to an IPv4 network address in
96 .\"O the dotted-decimal format, "\fIddd.ddd.ddd.ddd\fP".
97 .\"O The buffer
98 .\"O .I dst
99 .\"O must be at least
100 .\"O .B INET_ADDRSTRLEN
101 .\"O bytes long.
102 ¤³¤Î¾ì¹ç
103 .I src
104 ¤Ï (¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Î)
105 .I "struct in_addr"
106 ¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¤ß¤Ê¤µ¤ì¡¢¤³¤Î¹½Â¤ÂΤÎÆâÍƤ¬
107 ¥É¥Ã¥È¶èÀÚ¤ê¤Î 10 ¿Ê¿ô·Á¼° "\fIddd.ddd.ddd.ddd\fP" ¤Î
108 IPv4 ¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤ËÊÑ´¹¤µ¤ì¤ë¡£
109 ¥Ð¥Ã¥Õ¥¡
110 .I dst
111 ¤Ï¾¯¤Ê¤¯¤È¤â
112 .B INET_ADDRSTRLEN
113 ¥Ð¥¤¥È¤ÎŤµ¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
114 .TP
115 .B AF_INET6
116 .\"O .I src
117 .\"O points to a
118 .\"O .I struct in6_addr
119 .\"O (in network byte order)
120 .\"O which is converted to a representation of this address in the
121 .\"O most appropriate IPv6 network address format for this address.
122 .\"O The buffer
123 .\"O .I dst
124 .\"O must be at least
125 .\"O .B INET6_ADDRSTRLEN
126 .\"O bytes long.
127 ¤³¤Î¾ì¹ç
128 .I src
129 ¤Ï (¥Í¥Ã¥È¥ï¡¼¥¯¥Ð¥¤¥È¥ª¡¼¥À¡¼¤Î)
130 .I "struct in6_addr"
131 ¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¤ß¤Ê¤µ¤ì¡¢¤³¤Î¹½Â¤ÂΤÎÆâÍƤ¬¡¢
132 (¤³¤Î¥¢¥É¥ì¥¹¤ËÂФ·¤Æ¤â¤Ã¤È¤âŬÀÚ¤Ê)
133 IPv6 ¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤Îɽ¼¨·Á¼°¤ËÊÑ´¹¤µ¤ì¤ë¡£
134 ¥Ð¥Ã¥Õ¥¡
135 .I dst
136 ¤Ï¾¯¤Ê¤¯¤È¤â
137 .B INET6_ADDRSTRLEN
138 ¥Ð¥¤¥È¤ÎŤµ¤ò»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
139 .\"O .SH "RETURN VALUE"
140 .SH ÊÖ¤êÃÍ
141 .\"O On success,
142 .\"O .BR inet_ntop ()
143 .\"O returns a non-NULL pointer to
144 .\"O .IR dst .
145 .\"O NULL is returned if there was an error, with
146 .\"O .I errno
147 .\"O set to indicate the error.
148 À®¸ù¤¹¤ë¤È¡¢
149 .BR inet_ntop ()
150 ¤Ï
151 .I dst
152 ¤Ø¤Î (NULL ¤Ç¤Ê¤¤) ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
153 ¥¨¥é¡¼¤¬¤¢¤Ã¤¿¾ì¹ç¤Ï NULL ¤òÊÖ¤·¡¢
154 .I errno
155 ¤ò¥¨¥é¡¼¤ò¼¨¤¹ÃͤËŬÀÚ¤ËÀßÄꤹ¤ë¡£
156 .\"O .SH ERRORS
157 .SH ¥¨¥é¡¼
158 .TP
159 .B EAFNOSUPPORT
160 .\"O .I af
161 .\"O was not a valid address family.
162 .I af
163 ¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Ç¤Ê¤«¤Ã¤¿¡£
164 .TP
165 .B ENOSPC
166 .\"O The converted address string would exceed the size given by
167 .\"O .IR size .
168 ÊÑ´¹¤µ¤ì¤¿¥¢¥É¥ì¥¹Ê¸»úÎó¤ÎŤµ¤¬
169 .I size
170 ¤Ç»ØÄꤵ¤ì¤¿¥µ¥¤¥º¤òĶ²á¤·¤Æ¤·¤Þ¤¦¡£
171 .\"O .SH "CONFORMING TO"
172 .SH ½àµò
173 POSIX.1-2001.
174 .\"O Note that RFC\ 2553 defines a prototype where the last argument
175 .\"O .I size
176 .\"O is of type
177 .\"O .IR size_t .
178 .\"O Many systems follow RFC\ 2553.
179 .\"O Glibc 2.0 and 2.1 have
180 .\"O .IR size_t ,
181 .\"O but 2.2 and later have
182 .\"O .IR socklen_t .
183 .\"O .\" 2.1.3: size_t, 2.1.91: socklen_t
184 RFC\ 2553 ¤Ç¤ÏºÇ¸å¤Î°ú¤­¿ô
185 .I size
186 ¤Î¥×¥í¥È¥¿¥¤¥×¤ò
187 .I size_t
188 ·¿¤ÈÄêµÁ¤·¤Æ¤¤¤ë¡£Â¿¤¯¤Î¥·¥¹¥Æ¥à¤Ç¤Ï RFC\ 2553 ¤Ë¤·¤¿¤¬¤Ã¤Æ¤¤¤ë¡£
189 glibc 2.0 ¤È 2.1 ¤Ç¤Ï
190 .I size_t
191 ¤À¤¬¡¢
192 glibc 2.2 °Ê¹ß¤Ç¤Ï
193 .I socklen_t
194 ¤È¤Ê¤Ã¤Æ¤¤¤ë¡£
195 .\" 2.1.3: size_t, 2.1.91: socklen_t
196 .\"O .SH BUGS
197 .SH ¥Ð¥°
198 .\"O .B AF_INET6
199 .\"O converts IPv6-mapped IPv4 addresses into an IPv6 format.
200 .B AF_INET6
201 ¤Ï IPv4 ¤¬¥Þ¥Ã¥×¤µ¤ì¤¿ IPv6 ¥¢¥É¥ì¥¹¤ò
202 IPv6 ·Á¼°¤ËÊÑ´¹¤·¤Æ¤·¤Þ¤¦¡£
203 .\"O .SH EXAMPLE
204 .SH Îã
205 .\"O See
206 .\"O .BR inet_pton (3).
207 .BR inet_pton (3)
208 ¤ò»²¾È¡£
209 .\"O .SH "SEE ALSO"
210 .SH ´ØÏ¢¹àÌÜ
211 .BR getnameinfo (3),
212 .BR inet (3),
213 .BR inet_pton (3)