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 .\"O getipnodebyname, getipnodebyaddr, freehostent \- get network
34 .\"O hostnames and addresses
36 getipnodebyname, getipnodebyaddr, freehostent \- ネットワークホストの名前とアドレスの取得
40 .B #include <sys/types.h>
41 .B #include <sys/socket.h>
44 .BI "struct hostent *getipnodebyname(const char *" name ", int " af ,
45 .BI " int " flags ", int *" error_num );
47 .BI "struct hostent *getipnodebyaddr(const void *" addr ", size_t " len ,
48 .BI " int " af ", int *" "error_num" );
50 .BI "void freehostent(struct hostent *" "ip" );
54 .\"O These functions are deprecated (and unavailable in glibc).
56 .\"O .BR getaddrinfo (3)
58 .\"O .BR getnameinfo (3)
60 これらの関数は非推奨である (glibc では利用できない)。
68 .\"O .BR getipnodebyname ()
70 .\"O .BR getipnodebyaddr ()
71 .\"O functions return the names and addresses of a network host.
72 .\"O These functions return a pointer to the
73 .\"O following structure:
74 .BR getipnodebyname ()
76 .BR getipnodebyaddr ()
77 は、ネットワークホストの名前とアドレスを返す。
78 これらの関数は、以下の構造体へのポインタを返す。
92 .\"O These functions replace the
93 .\"O .BR gethostbyname (3)
95 .\"O .BR gethostbyaddr (3)
96 .\"O functions, which could only access the IPv4 network address family.
98 .\"O .BR getipnodebyname ()
100 .\"O .BR getipnodebyaddr ()
101 .\"O functions can access multiple network address families.
102 これらの関数は、 IPv4 ネットワークアドレスファミリにしかアクセスできない
103 .BR gethostbyname (3)
105 .BR gethostbyaddr (3)
107 .BR getipnodebyname ()
109 .BR getipnodebyaddr ()
110 関数は複数のネットワークアドレスファミリーにアクセス可能になっている。
115 .\"O these functions return pointers to dynamically allocated memory.
117 .\"O .BR freehostent ()
118 .\"O function is used to release the dynamically allocated memory
119 .\"O after the caller no longer needs the
124 の関数群と異なり、動的に割り当てられたメモリへのポインタを返す。
129 関数を用いれば動的な割り当てメモリを解放できる。
130 .\"O .SS getipnodebyname() arguments
131 .SS getipnodebyname() の引き数
133 .\"O .BR getipnodebyname ()
135 .\"O looks up network addresses for the host
136 .\"O specified by the
141 .\"O argument specifies one of the following values:
142 .BR getipnodebyname ()
145 引き数で指定されたホストのネットワークアドレスを引く。
152 .\"O argument points to a dotted-quad IPv4 address or a name
153 .\"O of an IPv4 network host.
155 引き数は、ドットで 4 つに区切られた IPv4 アドレスか、
156 IPv4 ネットワークホストの名前へのポインタである。
161 .\"O argument points to a hexadecimal IPv6 address or a name
162 .\"O of an IPv6 network host.
164 引き数は、16 進の IPv6 アドレスか、
165 IPv6 ネットワークホストの名前へのポインタである。
169 .\"O argument specifies additional options.
170 .\"O More than one option can be specified by bitwise OR-ing
173 .\"O should be set to 0
174 .\"O if no options are desired.
176 パラメータには追加のオプションを指定する。
177 複数のフラグを指定するには、それらのビット単位の OR をとって指定すればよい。
178 オプションをひとつも指定したくないときには、
183 .\"O This flag is used with
185 .\"O to request a query for IPv4 addresses instead of
186 .\"O IPv6 addresses; the IPv4 addresses will
187 .\"O be mapped to IPv6 addresses.
190 と共に用いられ、IPv6 アドレスの代わりに IPv4 アドレスを問い合わせる。
191 問い合わせる IPv4 アドレスは IPv6 アドレスにマップされる。
194 .\"O This flag is used with
196 .\"O to request a query for both IPv4 and IPv6 addresses.
197 .\"O Any IPv4 address found will be mapped to an IPv6 address.
200 と共に用いられ、IPv4 アドレスと IPv6 アドレスの両方を問い合わせる。
201 見つかった IPv4 アドレスは、すべて IPv6 アドレスにマップされる。
204 .\"O This flag is used with
207 .\"O further request that queries for IPv6 addresses should not be made unless
208 .\"O the system has at least one IPv6 address assigned to a network interface,
209 .\"O and that queries for IPv4 addresses should not be made unless the
210 .\"O system has at least one IPv4 address assigned to a network interface.
211 .\"O This flag may be used by itself or with the
217 IPv6 が割り当てられたネットワークインターフェースが
218 システムにひとつもなければ IPv6 アドレスの問い合わせを行わず、
219 IPv4 が割り当てられたネットワークインターフェースが
220 システムにひとつもなければ IPv4 アドレスの問い合わせを行わないように要求する。
226 .\"O This flag is equivalent to
227 .\"O .BR "(AI_ADDRCONFIG | AI_V4MAPPED)" .
229 .BR (AI_ADDRCONFIG | AI_V4MAPPED)
231 .\"O .SS getipnodebyaddr() arguments
232 .SS "getipnodebyaddr() の引き数"
234 .\"O .BR getipnodebyaddr ()
236 .\"O looks up the name of the host whose
237 .\"O network address is
238 .\"O specified by the
243 .\"O argument specifies one of the following values:
244 .BR getipnodebyaddr ()
254 .\"O argument points to a
255 .\"O .I struct in_addr
259 .\"O .IR "sizeof(struct in_addr)" .
266 .I sizeof(struct in_addr)
272 .\"O argument points to a
273 .\"O .I struct in6_addr
277 .\"O .IR "sizeof(struct in6_addr)" .
284 .I sizeof(struct in6_addr)
286 .\"O .SH "RETURN VALUE"
288 .\"O A NULL pointer is returned if an error occurred, and
290 .\"O will contain an error code from the following list:
291 エラーが起こるとヌル・ポインターが返され、
293 に以下にリストされたエラーコードのいずれかが設定される。
296 .\"O The hostname or network address was not found.
297 ホスト名またはネットワークアドレスが見つからなかった。
300 .\"O The domain name server recognized the network address or name,
301 .\"O but no answer was returned.
302 .\"O This can happen if the network host has only IPv4 addresses and
303 .\"O a request has been made for IPv6 information only, or vice versa.
305 そのネットワークアドレスまたはネットワーク名を認識したが、
307 例えば IPv4 アドレスしか持たないネットワークホストに対して
308 IPv6 の情報の問い合わせが行われた (およびその逆) などが考えられる。
311 .\"O The domain name server returned a permanent failure response.
312 ドメインネームサーバーから恒久的な失敗 (permanent failure)
316 .\"O The domain name server returned a temporary failure response.
317 .\"O You might have better luck next time.
318 ネームサーバーから一時的な失敗 (temporary failure)
319 を意味する返事が返された。次にはもうちょっと運が必要かも。
321 .\"O A successful query returns a pointer to a
323 .\"O structure that contains the following fields:
330 .\"O This is the official name of this network host.
331 これはこのネットワークホストのオフィシャルな名前である。
334 .\"O This is an array of pointers to unofficial aliases for the same host.
335 .\"O The array is terminated by a NULL pointer.
336 これは、そのホストのオフィシャルでない別名へのポインターの配列である。
340 .\"O This is a copy of the
343 .\"O .BR getipnodebyname ()
345 .\"O .BR getipnodebyaddr ().
361 .BR getipnodebyname ()
363 .BR getipnodebyaddr ()
385 .\"O This field will be set to
386 .\"O .I sizeof(struct in_addr)
392 .\"O .I sizeof(struct in6_addr)
402 .I sizeof(struct in_addr)
408 .I sizeof(struct in6_addr)
412 .\"O This is an array of one or more pointers to network address structures for the
414 .\"O The array is terminated by a NULL pointer.
417 そのネットワークホストに対応するネットワークアドレス構造体を指す。
419 .\"O .SH "CONFORMING TO"
422 .\"O .\" Not in POSIX.1-2001.
423 .\" POSIX.1-2001 にはない。
426 .\"O These functions were present in glibc 2.1.91-95, but were
428 .\"O Several UNIX-like systems support them, but all
429 .\"O call them deprecated.
430 これらの関数は glibc 2.1.91-95 に存在したが、再び削除された。
431 いくつかの UNIX 風システムはこれらの関数に対応しているが、