1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263
|
.\" Copyright 2000 Sam Varshavchik <mrsam@courier-mta.com>
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date. The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein. The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" References: RFC 2553
.\"
.\" Japanese Version Copyright (c) 2001 NAKANO Takeo all rights reserved.
.\" Translated Sun Jan 14 2001 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
.\" Updated Tue Nov 26 2002 by Kentaro Shirakata <argrath@ub32.org>
.\"
.\"WORD: null pointer ̥롦ݥ
.\"
.TH GETIPNODEBYNAME 3 2007-11-15 "Linux" "Linux Programmer's Manual"
.SH ̾
getipnodebyname, getipnodebyaddr, freehostent \- ͥåȥۥȤ̾ȥɥ쥹μ
.SH
.nf
.B #include <sys/types.h>
.B #include <sys/socket.h>
.B #include <netdb.h>
.sp
.BI "struct hostent *getipnodebyname(const char *" name ", int " af ,
.BI " int " flags ", int *" error_num );
.sp
.BI "struct hostent *getipnodebyaddr(const void *" addr ", size_t " len ,
.BI " int " af ", int *" "error_num" );
.sp
.BI "void freehostent(struct hostent *" "ip" );
.fi
.SH
δؿ侩Ǥ (glibc ǤѤǤʤ)
.BR getaddrinfo (3)
.BR getnameinfo (3)
Ȥȡ
.LP
.BR getipnodebyname ()
.BR getipnodebyaddr ()
ϡͥåȥۥȤ̾ȥɥ쥹֤
δؿϡʲι¤ΤؤΥݥ֤
.sp
.in +4n
.nf
struct hostent {
char *h_name;
char **h_aliases;
int h_addrtype;
int h_length;
char **h_addr_list;
};
.fi
.in
.PP
δؿϡ IPv4 ͥåȥɥ쥹եߥˤǤʤ
.BR gethostbyname (3)
.BR gethostbyaddr (3)
֤ΤǤ롣
.BR getipnodebyname ()
ؿ
.BR getipnodebyaddr ()
ؿʣΥͥåȥɥ쥹եߥ˥ǽˤʤäƤ롣
.PP
δؿϡ
.B gethostby
δؿȰۤʤꡢưŪ˳Ƥ줿ؤΥݥ֤
ƤӽФ
.I hostent
¤ΤɬפȤʤʤäϡ
.BR freehostent ()
ؿѤưŪʳƥǤ롣
.SS getipnodebyname() ΰ
.BR getipnodebyname ()
ؿ
.I name
ǻꤵ줿ۥȤΥͥåȥɥ쥹
.I af
ˤϰʲͤΤ줫ꤹ롣
.TP
.B AF_INET
.I name
ϡɥåȤ 4 Ĥ˶ڤ줿 IPv4 ɥ쥹
IPv4 ͥåȥۥȤ̾ؤΥݥǤ롣
.TP
.B AF_INET6
.I name
ϡ16 ʤ IPv6 ɥ쥹
IPv6 ͥåȥۥȤ̾ؤΥݥǤ롣
.PP
.I flags
ѥˤɲäΥץꤹ롣
ʣΥե饰ꤹˤϡ OR ȤäƻꤹФ褤
ץҤȤĤꤷʤȤˤϡ
.I flags
0 ꤹɬפ롣
.TP
.B AI_V4MAPPED
Υե饰
.B AF_INET6
ȶѤ졢IPv6 ɥ쥹 IPv4 ɥ쥹䤤碌롣
䤤碌 IPv4 ɥ쥹 IPv6 ɥ쥹˥ޥåפ롣
.TP
.B AI_ALL
Υե饰
.B AI_V4MAPPED
ȶѤ졢IPv4 ɥ쥹 IPv6 ɥ쥹ξ䤤碌롣
Ĥä IPv4 ɥ쥹ϡ٤ IPv6 ɥ쥹˥ޥåפ롣
.TP
.B AI_ADDRCONFIG
Υե饰
.B AF_INET6
ȶѤ졢
IPv6 Ƥ줿ͥåȥե
ƥˤҤȤĤʤ IPv6 ɥ쥹䤤碌Ԥ鷺
IPv4 Ƥ줿ͥåȥե
ƥˤҤȤĤʤ IPv4 ɥ쥹䤤碌Ԥʤ褦᤹롣
Υե饰ñȤǤ⡢뤤
.B AI_V4MAPPED
ե饰ȶˤǤѤ뤳ȤǤ롣
.TP
.B AI_DEFAULT
Υե饰
.BR (AI_ADDRCONFIG | AI_V4MAPPED)
Ǥ롣
.SS "getipnodebyaddr() ΰ"
.BR getipnodebyaddr ()
ؿϡͥåȥɥ쥹
.I addr
ǻꤵ줿ۥȤ̾
.I af
ˤϰʲͤΤ줫ꤹ롣
.TP
.B AF_INET
.I addr
.I struct in_addr
ؤΥݥǤꡢ
.I len
.I sizeof(struct in_addr)
ꤷʤФʤʤ
.TP
.B AF_INET6
.I addr
.I struct in6_addr
ؤΥݥǤꡢ
.I len
.I sizeof(struct in6_addr)
ꤷʤФʤʤ
.SH ֤
顼ȥ̥롦ݥ֤졢
.I error_num
˰ʲ˥ꥹȤ줿顼ɤΤ줫ꤵ롣
.TP
.B HOST_NOT_FOUND
ۥ̾ޤϥͥåȥɥ쥹Ĥʤä
.TP
.B NO_ADDRESS
ɥᥤ͡ॵС
Υͥåȥɥ쥹ޤϥͥåȥ̾ǧ
ֻ֤äƤʤäȤƤϡ
㤨 IPv4 ɥ쥹ʤͥåȥۥȤФ
IPv6 ξ䤤碌Ԥ줿 (Ӥε) ʤɤͤ롣
.TP
.B NO_RECOVERY
ɥᥤ͡ॵС鹱Ūʼ (permanent failure)
ֻ̣֤줿
.TP
.B TRY_AGAIN
͡ॵСŪʼ (temporary failure)
ֻ̣֤줿ˤϤ⤦äȱɬפ⡣
.PP
䤤碌ȡ
.I hostent
¤ΤؤΥݥ֤롣
ι¤ΤϰʲΥեɤʤ롣
.TP
.I h_name
ϤΥͥåȥۥȤΥե̾Ǥ롣
.TP
.I h_aliases
ϡΥۥȤΥեǤʤ̾ؤΥݥǤ롣
ϥ̥롦ݥǽü롣
.TP
.I h_addrtype
.BR getipnodebyname ()
ޤ
.BR getipnodebyaddr ()
Ϳ줿
.I af
ΥԡǤ롣
.I af
.B AF_INET
ʤ
.I h_addrtype
Ͼ
.B AF_INET
ˤʤꡢ
.I af
.B AF_INET6
ʤ
.I h_addrtype
.B AF_INET6
ˤʤ롣
.TP
.I h_length
Υեɤϡ
.I h_addrtype
.B AF_INET
ʤ
.I sizeof(struct in_addr)
ˡ
.I h_addrtype
.B AF_INET6
ʤ
.I sizeof(struct in6_addr)
ꤵ롣
.TP
.I h_addr_list
ϤҤȤİʾΥݥǡ
줾Υݥϡ
ΥͥåȥۥȤбͥåȥɥ쥹¤Τؤ
ϥ̥롦ݥǽü롣
.SH
RFC\ 2553.
.\" POSIX.1-2001 ˤϤʤ
.SH
δؿ glibc 2.1.91-95 ¸ߤƤӺ줿
Ĥ Unix ƥϤδؿбƤ뤬
δؿƿ侩ʤ
.SH Ϣ
.BR getaddrinfo (3),
.BR getnameinfo (3),
.BR inet_ntop (3),
.BR inet_pton (3)
|