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
25 .\" Japanese Version Copyright (c) 2001 NAKANO Takeo all rights reserved.
26 .\" Translated Sun Jan 14 2001 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
27 .\" Updated Tue Nov 26 2002 by Kentaro Shirakata <argrath@ub32.org>
29 .\"WORD: null pointer ¥Ì¥ë¡¦¥Ý¥¤¥ó¥¿¡¼
31 .TH GETIPNODEBYNAME 3 2010-09-04 "Linux" "Linux Programmer's Manual"
33 getipnodebyname, getipnodebyaddr, freehostent \- ¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤Î̾Á°¤È¥¢¥É¥ì¥¹¤Î¼èÆÀ
36 .B #include <sys/types.h>
37 .B #include <sys/socket.h>
40 .BI "struct hostent *getipnodebyname(const char *" name ", int " af ,
41 .BI " int " flags ", int *" error_num );
43 .BI "struct hostent *getipnodebyaddr(const void *" addr ", size_t " len ,
44 .BI " int " af ", int *" "error_num" );
46 .BI "void freehostent(struct hostent *" "ip" );
49 ¤³¤ì¤é¤Î´Ø¿ô¤ÏÈó¿ä¾©¤Ç¤¢¤ë (glibc ¤Ç¤ÏÍøÍѤǤ¤Ê¤¤)¡£
56 .BR getipnodebyname ()
58 .BR getipnodebyaddr ()
59 ¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤Î̾Á°¤È¥¢¥É¥ì¥¹¤òÊÖ¤¹¡£
60 ¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢°Ê²¼¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤¹¡£
74 ¤³¤ì¤é¤Î´Ø¿ô¤Ï¡¢ IPv4 ¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¤Ë¤·¤«¥¢¥¯¥»¥¹¤Ç¤¤Ê¤¤
78 ¤òÃÖ¤´¹¤¨¤ë¤â¤Î¤Ç¤¢¤ë¡£
79 .BR getipnodebyname ()
81 .BR getipnodebyaddr ()
82 ´Ø¿ô¤ÏÊ£¿ô¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¥Õ¥¡¥ß¥ê¡¼¤Ë¥¢¥¯¥»¥¹²Äǽ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£
86 ¤Î´Ø¿ô·²¤È°Û¤Ê¤ê¡¢Æ°Åª¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
89 ¹½Â¤ÂΤòɬÍפȤ·¤Ê¤¯¤Ê¤Ã¤¿¸å¤Ï¡¢
91 ´Ø¿ô¤òÍѤ¤¤ì¤ÐưŪ¤Ê³ä¤êÅö¤Æ¥á¥â¥ê¤ò²òÊü¤Ç¤¤ë¡£
92 .SS getipnodebyname() ¤Î°ú¤¿ô
93 .BR getipnodebyname ()
96 °ú¤¿ô¤Ç»ØÄꤵ¤ì¤¿¥Û¥¹¥È¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤ò°ú¤¯¡£
98 °ú¤¿ô¤Ë¤Ï°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«¤ò»ØÄꤹ¤ë¡£
102 °ú¤¿ô¤Ï¡¢¥É¥Ã¥È¤Ç 4 ¤Ä¤Ë¶èÀÚ¤é¤ì¤¿ IPv4 ¥¢¥É¥ì¥¹¤«¡¢
103 IPv4 ¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤Î̾Á°¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
107 °ú¤¿ô¤Ï¡¢16 ¿Ê¤Î IPv6 ¥¢¥É¥ì¥¹¤«¡¢
108 IPv6 ¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤Î̾Á°¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ç¤¢¤ë¡£
111 ¥Ñ¥é¥á¡¼¥¿¤Ë¤ÏÄɲäΥª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¡£
112 Ê£¿ô¤Î¥Õ¥é¥°¤ò»ØÄꤹ¤ë¤Ë¤Ï¡¢¤½¤ì¤é¤Î¥Ó¥Ã¥Èñ°Ì¤Î OR ¤ò¤È¤Ã¤Æ»ØÄꤹ¤ì¤Ð¤è¤¤¡£
113 ¥ª¥×¥·¥ç¥ó¤ò¤Ò¤È¤Ä¤â»ØÄꤷ¤¿¤¯¤Ê¤¤¤È¤¤Ë¤Ï¡¢
115 ¤Ë 0 ¤òÀßÄꤹ¤ëɬÍפ¬¤¢¤ë¡£
120 ¤È¶¦¤ËÍѤ¤¤é¤ì¡¢IPv6 ¥¢¥É¥ì¥¹¤ÎÂå¤ï¤ê¤Ë IPv4 ¥¢¥É¥ì¥¹¤òÌ䤤¹ç¤ï¤»¤ë¡£
121 Ì䤤¹ç¤ï¤»¤ë IPv4 ¥¢¥É¥ì¥¹¤Ï IPv6 ¥¢¥É¥ì¥¹¤Ë¥Þ¥Ã¥×¤µ¤ì¤ë¡£
126 ¤È¶¦¤ËÍѤ¤¤é¤ì¡¢IPv4 ¥¢¥É¥ì¥¹¤È IPv6 ¥¢¥É¥ì¥¹¤ÎξÊý¤òÌ䤤¹ç¤ï¤»¤ë¡£
127 ¸«¤Ä¤«¤Ã¤¿ IPv4 ¥¢¥É¥ì¥¹¤Ï¡¢¤¹¤Ù¤Æ IPv6 ¥¢¥É¥ì¥¹¤Ë¥Þ¥Ã¥×¤µ¤ì¤ë¡£
133 IPv6 ¤¬³ä¤êÅö¤Æ¤é¤ì¤¿¥Í¥Ã¥È¥ï¡¼¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬
134 ¥·¥¹¥Æ¥à¤Ë¤Ò¤È¤Ä¤â¤Ê¤±¤ì¤Ð IPv6 ¥¢¥É¥ì¥¹¤ÎÌ䤤¹ç¤ï¤»¤ò¹Ô¤ï¤º¡¢
135 IPv4 ¤¬³ä¤êÅö¤Æ¤é¤ì¤¿¥Í¥Ã¥È¥ï¡¼¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬
136 ¥·¥¹¥Æ¥à¤Ë¤Ò¤È¤Ä¤â¤Ê¤±¤ì¤Ð IPv4 ¥¢¥É¥ì¥¹¤ÎÌ䤤¹ç¤ï¤»¤ò¹Ô¤ï¤Ê¤¤¤è¤¦¤ËÍ׵᤹¤ë¡£
137 ¤³¤Î¥Õ¥é¥°¤ÏñÆȤǤ⡢¤¢¤ë¤¤¤Ï
139 ¥Õ¥é¥°¤È¶¦¤Ë¤Ç¤âÍѤ¤¤ë¤³¤È¤¬¤Ç¤¤ë¡£
143 .BR (AI_ADDRCONFIG | AI_V4MAPPED)
145 .SS "getipnodebyaddr() ¤Î°ú¤¿ô"
146 .BR getipnodebyaddr ()
147 ´Ø¿ô¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤¬
149 °ú¤¿ô¤Ç»ØÄꤵ¤ì¤¿¥Û¥¹¥È¤Î̾Á°¤ò°ú¤¯¡£
151 °ú¤¿ô¤Ë¤Ï°Ê²¼¤ÎÃͤΤ¤¤º¤ì¤«¤ò»ØÄꤹ¤ë¡£
157 ¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ê¡¢
160 .I sizeof(struct in_addr)
161 ¤ËÀßÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
167 ¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤Ç¤¢¤ê¡¢
170 .I sizeof(struct in6_addr)
171 ¤ËÀßÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
173 ¥¨¥é¡¼¤¬µ¯¤³¤ë¤È¥Ì¥ë¡¦¥Ý¥¤¥ó¥¿¡¼¤¬ÊÖ¤µ¤ì¡¢
175 ¤Ë°Ê²¼¤Ë¥ê¥¹¥È¤µ¤ì¤¿¥¨¥é¡¼¥³¡¼¥É¤Î¤¤¤º¤ì¤«¤¬ÀßÄꤵ¤ì¤ë¡£
178 ¥Û¥¹¥È̾¤Þ¤¿¤Ï¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¡£
181 ¥É¥á¥¤¥ó¥Í¡¼¥à¥µ¡¼¥Ð¡¼¤Ï
182 ¤½¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤Þ¤¿¤Ï¥Í¥Ã¥È¥ï¡¼¥¯Ì¾¤òǧ¼±¤·¤¿¤¬¡¢
183 ÊÖ»ö¤¬Ê֤äƤ³¤Ê¤«¤Ã¤¿¡£¸¶°ø¤È¤·¤Æ¤Ï¡¢
184 Î㤨¤Ð IPv4 ¥¢¥É¥ì¥¹¤·¤«»ý¤¿¤Ê¤¤¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤ËÂФ·¤Æ
185 IPv6 ¤Î¾ðÊó¤ÎÌ䤤¹ç¤ï¤»¤¬¹Ô¤ï¤ì¤¿ (¤ª¤è¤Ó¤½¤ÎµÕ) ¤Ê¤É¤¬¹Í¤¨¤é¤ì¤ë¡£
188 ¥É¥á¥¤¥ó¥Í¡¼¥à¥µ¡¼¥Ð¡¼¤«¤é¹±µ×Ū¤Ê¼ºÇÔ (permanent failure)
189 ¤ò°ÕÌ£¤¹¤ëÊÖ»ö¤¬ÊÖ¤µ¤ì¤¿¡£
192 ¥Í¡¼¥à¥µ¡¼¥Ð¡¼¤«¤é°ì»þŪ¤Ê¼ºÇÔ (temporary failure)
193 ¤ò°ÕÌ£¤¹¤ëÊÖ»ö¤¬ÊÖ¤µ¤ì¤¿¡£¼¡¤Ë¤Ï¤â¤¦¤Á¤ç¤Ã¤È±¿¤¬É¬Íפ«¤â¡£
195 Ì䤤¹ç¤ï¤»¤ËÀ®¸ù¤¹¤ë¤È¡¢
197 ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤¬ÊÖ¤µ¤ì¤ë¡£
198 ¤³¤Î¹½Â¤ÂΤϰʲ¼¤Î¥Õ¥£¡¼¥ë¥É¤«¤é¤Ê¤ë¡£
201 ¤³¤ì¤Ï¤³¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤Î¥ª¥Õ¥£¥·¥ã¥ë¤Ê̾Á°¤Ç¤¢¤ë¡£
204 ¤³¤ì¤Ï¡¢¤½¤Î¥Û¥¹¥È¤Î¥ª¥Õ¥£¥·¥ã¥ë¤Ç¤Ê¤¤ÊÌ̾¤Ø¤Î¥Ý¥¤¥ó¥¿¡¼¤ÎÇÛÎó¤Ç¤¢¤ë¡£
205 ÇÛÎó¤Ï¥Ì¥ë¡¦¥Ý¥¤¥ó¥¿¡¼¤Ç½ªÃ¼¤¹¤ë¡£
209 .BR getipnodebyname ()
211 .BR getipnodebyaddr ()
214 °ú¤¿ô¤Î¥³¥Ô¡¼¤Ç¤¢¤ë¡£
238 .I sizeof(struct in_addr)
244 .I sizeof(struct in6_addr)
248 ¤³¤ì¤Ï¤Ò¤È¤Ä°Ê¾å¤Î¥Ý¥¤¥ó¥¿¡¼¤ÎÇÛÎó¤Ç¡¢
249 ¤½¤ì¤¾¤ì¤Î¥Ý¥¤¥ó¥¿¡¼¤Ï¡¢
250 ¤½¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥Û¥¹¥È¤ËÂбþ¤¹¤ë¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¹½Â¤ÂΤò»Ø¤¹¡£
251 ¤³¤ÎÇÛÎó¤Ï¥Ì¥ë¡¦¥Ý¥¤¥ó¥¿¡¼¤Ç½ªÃ¼¤¹¤ë¡£
254 .\" POSIX.1-2001 ¤Ë¤Ï¤Ê¤¤¡£
256 ¤³¤ì¤é¤Î´Ø¿ô¤Ï glibc 2.1.91-95 ¤Ë¸ºß¤·¤¿¤¬¡¢ºÆ¤Óºï½ü¤µ¤ì¤¿¡£
257 ¤¤¤¯¤Ä¤«¤Î UNIX É÷¥·¥¹¥Æ¥à¤Ï¤³¤ì¤é¤Î´Ø¿ô¤ËÂбþ¤·¤Æ¤¤¤ë¤¬¡¢
258 ¤³¤ì¤é¤Î´Ø¿ô¤ÏÁ´¤Æ¿ä¾©¤µ¤ì¤Ê¤¤¡£