getipnodebyname.3 (84306) | getipnodebyname.3 (108037) |
---|---|
1.\" $FreeBSD: head/lib/libc/net/getipnodebyname.3 84306 2001-10-01 16:09:29Z ru $ | |
2.\" $KAME: getipnodebyname.3,v 1.6 2000/08/09 21:16:17 itojun Exp $ 3.\" 4.\" Copyright (c) 1983, 1987, 1991, 1993 5.\" The Regents of the University of California. All rights reserved. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions 9.\" are met: --- 18 unchanged lines hidden (view full) --- 28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33.\" SUCH DAMAGE. 34.\" 35.\" From: @(#)gethostbyname.3 8.4 (Berkeley) 5/25/95 | 1.\" $KAME: getipnodebyname.3,v 1.6 2000/08/09 21:16:17 itojun Exp $ 2.\" 3.\" Copyright (c) 1983, 1987, 1991, 1993 4.\" The Regents of the University of California. All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: --- 18 unchanged lines hidden (view full) --- 27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32.\" SUCH DAMAGE. 33.\" 34.\" From: @(#)gethostbyname.3 8.4 (Berkeley) 5/25/95 |
35.\" $FreeBSD: head/lib/libc/net/getipnodebyname.3 108037 2002-12-18 12:45:11Z ru $ |
|
36.\" 37.Dd May 25, 1995 38.Dt GETIPNODEBYNAME 3 39.Os 40.\" 41.Sh NAME 42.Nm getipnodebyname , 43.Nm getipnodebyaddr , --- 9 unchanged lines hidden (view full) --- 53.Ft "struct hostent *" 54.Fn getipnodebyname "const char *name" "int af" "int flags" "int *error_num" 55.Ft "struct hostent *" 56.Fn getipnodebyaddr "const void *src" "size_t len" "int af" "int *error_num" 57.Ft void 58.Fn freehostent "struct hostent *ptr" 59.\" 60.Sh DESCRIPTION | 36.\" 37.Dd May 25, 1995 38.Dt GETIPNODEBYNAME 3 39.Os 40.\" 41.Sh NAME 42.Nm getipnodebyname , 43.Nm getipnodebyaddr , --- 9 unchanged lines hidden (view full) --- 53.Ft "struct hostent *" 54.Fn getipnodebyname "const char *name" "int af" "int flags" "int *error_num" 55.Ft "struct hostent *" 56.Fn getipnodebyaddr "const void *src" "size_t len" "int af" "int *error_num" 57.Ft void 58.Fn freehostent "struct hostent *ptr" 59.\" 60.Sh DESCRIPTION |
61The |
|
61.Fn getipnodebyname 62and 63.Fn getipnodebyaddr 64functions are very similar to 65.Xr gethostbyname 3 , 66.Xr gethostbyname2 3 67and 68.Xr gethostbyaddr 3 . --- 301 unchanged lines hidden (view full) --- 370.Dv AF_INET . 371The function's return value is a 372.Dv NULL 373pointer and the value pointed to by 374.Ar error_num 375equals 376.Dv HOST_NOT_FOUND . 377.Pp | 62.Fn getipnodebyname 63and 64.Fn getipnodebyaddr 65functions are very similar to 66.Xr gethostbyname 3 , 67.Xr gethostbyname2 3 68and 69.Xr gethostbyaddr 3 . --- 301 unchanged lines hidden (view full) --- 371.Dv AF_INET . 372The function's return value is a 373.Dv NULL 374pointer and the value pointed to by 375.Ar error_num 376equals 377.Dv HOST_NOT_FOUND . 378.Pp |
379The |
|
378.Fn getipnodebyaddr | 380.Fn getipnodebyaddr |
381function |
|
379takes almost the same argument as 380.Xr gethostbyaddr 3 , 381but adds a pointer to return an error number. 382Additionally it takes care of IPv4-mapped IPv6 addresses, 383and IPv4-compatible IPv6 addresses. 384.Pp | 382takes almost the same argument as 383.Xr gethostbyaddr 3 , 384but adds a pointer to return an error number. 385Additionally it takes care of IPv4-mapped IPv6 addresses, 386and IPv4-compatible IPv6 addresses. 387.Pp |
388The |
|
385.Fn getipnodebyname 386and 387.Fn getipnodebyaddr | 389.Fn getipnodebyname 390and 391.Fn getipnodebyaddr |
392functions |
|
388dynamically allocate the structure to be returned to the caller. | 393dynamically allocate the structure to be returned to the caller. |
394The |
|
389.Fn freehostent | 395.Fn freehostent |
396function |
|
390reclaims memory region allocated and returned by 391.Fn getipnodebyname 392or 393.Fn getipnodebyaddr . 394.\" 395.Sh FILES 396.Bl -tag -width /etc/nsswitch.conf -compact 397.It Pa /etc/hosts 398.It Pa /etc/nsswitch.conf 399.It Pa /etc/resolv.conf 400.El 401.\" 402.Sh DIAGNOSTICS | 397reclaims memory region allocated and returned by 398.Fn getipnodebyname 399or 400.Fn getipnodebyaddr . 401.\" 402.Sh FILES 403.Bl -tag -width /etc/nsswitch.conf -compact 404.It Pa /etc/hosts 405.It Pa /etc/nsswitch.conf 406.It Pa /etc/resolv.conf 407.El 408.\" 409.Sh DIAGNOSTICS |
410The |
|
403.Fn getipnodebyname 404and 405.Fn getipnodebyaddr | 411.Fn getipnodebyname 412and 413.Fn getipnodebyaddr |
414functions |
|
406returns 407.Dv NULL 408on errors. 409The integer values pointed to by 410.Ar error_num 411may then be checked to see whether this is a temporary failure 412or an invalid or unknown host. 413The meanings of each error code are described in --- 17 unchanged lines hidden (view full) --- 431.%R RFC2553 432.%D March 1999 433.Re 434.\" 435.Sh HISTORY 436The implementation first appeared in KAME advanced networking kit. 437.\" 438.Sh STANDARDS | 415returns 416.Dv NULL 417on errors. 418The integer values pointed to by 419.Ar error_num 420may then be checked to see whether this is a temporary failure 421or an invalid or unknown host. 422The meanings of each error code are described in --- 17 unchanged lines hidden (view full) --- 440.%R RFC2553 441.%D March 1999 442.Re 443.\" 444.Sh HISTORY 445The implementation first appeared in KAME advanced networking kit. 446.\" 447.Sh STANDARDS |
448The |
|
439.Fn getipnodebyname 440and 441.Fn getipnodebyaddr | 449.Fn getipnodebyname 450and 451.Fn getipnodebyaddr |
452functions |
|
442are documented in 443.Dq Basic Socket Interface Extensions for IPv6 444(RFC2553). 445.\" 446.Sh BUGS | 453are documented in 454.Dq Basic Socket Interface Extensions for IPv6 455(RFC2553). 456.\" 457.Sh BUGS |
458The |
|
447.Fn getipnodebyname 448and 449.Fn getipnodebyaddr | 459.Fn getipnodebyname 460and 461.Fn getipnodebyaddr |
462functions |
|
450do not handle scoped IPv6 address properly. 451If you use these functions, 452your program will not be able to handle scoped IPv6 addresses. 453For IPv6 address manipulation, 454.Fn getaddrinfo 3 455and 456.Fn getnameinfo 3 457are recommended. 458.Pp 459The current implementation is not thread-safe. 460.Pp 461The text was shamelessly copied from RFC2553. | 463do not handle scoped IPv6 address properly. 464If you use these functions, 465your program will not be able to handle scoped IPv6 addresses. 466For IPv6 address manipulation, 467.Fn getaddrinfo 3 468and 469.Fn getnameinfo 3 470are recommended. 471.Pp 472The current implementation is not thread-safe. 473.Pp 474The text was shamelessly copied from RFC2553. |