diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2008-05-22 21:30:28 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2008-05-22 21:30:28 +0000 |
commit | 3c77dcff9ebf51910b01ca770f7a8ffef52b617c (patch) | |
tree | 8424a3ed0b00dfcb1d31428f57817fadf658ba80 /newlib/libc/sys/linux/net/getipnodebyname.3 | |
parent | 8a179967e670032fb2decf0ebcdd0059f9d139d8 (diff) | |
download | cygnal-3c77dcff9ebf51910b01ca770f7a8ffef52b617c.tar.gz cygnal-3c77dcff9ebf51910b01ca770f7a8ffef52b617c.tar.bz2 cygnal-3c77dcff9ebf51910b01ca770f7a8ffef52b617c.zip |
2008-05-22 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/sys/reent.h: Add _h_errno field.
* libc/sys/linux/libc-symbols.h: Add default stubs for new libc macros
now used in net directory.
* libc/sys/linux/bits/libc-lock.h: Always define _IO_MTSAFE_IO.
* libc/sys/linux/include/hesiod.h: Add needed macros for new code
in net directory.
* libc/sys/linux/include/netdb.h: Ditto.
* libc/sys/linux/include/resolv.h: Ditto.
* libc/sys/linux/include/stdint.h: Ditto.
* libc/sys/linux/include/arpa/nameser.h: Ditto.
* libc/sys/linux/include/net/ethernet.h: Ditto.
* libc/sys/linux/include/net/if_ppp.h: Ditto.
* libc/sys/linux/include/netinet/if_ether.h: Ditto.
* libc/sys/linux/machine/i386/get_clockfreq.c: Remove static memmem.
* libc/sys/linux/machine/i386/include/endian.h: Protect macros with
flags to avoid duplicate definition.
* libc/sys/linux/machine/i386/include/param.h: Ditto.
* libc/sys/linux/net/Makefile.am: Modified to account for removed and
added files.
* libc/sys/linux/net/Makefile.in: Regenerated.
* libc/sys/linux/net/base64.c: Replaced with glibc version of code.
* libc/sys/linux/net/getaddrinfo.c: Ditto.
* libc/sys/linux/net/getnameinfo.c: Ditto.
* libc/sys/linux/net/getproto.c: Ditto.
* libc/sys/linux/net/getservent.c: Ditto.
* libc/sys/linux/net/inet_netof.c: Ditto.
* libc/sys/linux/net/inet_lnaof.c: Ditto.
* libc/sys/linux/net/ns_name.c: Ditto.
* libc/sys/linux/net/ns_netint.c: Ditto.
* libc/sys/linux/net/inet_ntoa.c: Ditto.
* libc/sys/linux/net/ns_parse.c: Ditto.
* libc/sys/linux/net/ns_print.c: Ditto.
* libc/sys/linux/net/ns_ttl.c: Ditto.
* libc/sys/linux/net/nsap_addr.c: Ditto.
* libc/sys/linux/net/rcmd.c: Ditto.
* libc/sys/linux/net/res_comp.c: Ditto.
* libc/sys/linux/net/res_data.c: Ditto.
* libc/sys/linux/net/res_debug.c: Ditto.
* libc/sys/linux/net/res_init.c: Ditto.
* libc/sys/linux/net/res_mkquery.c: Ditto.
* libc/sys/linux/net/res_query.c: Ditto.
* libc/sys/linux/net/res_send.c: Ditto.
* libc/sys/linux/net/send.c: Ditto.
* libc/sys/linux/stdlib/collate.c: Ditto.
* libc/sys/linux/sys/ioctl.h: Ditto.
* libc/sys/linux/sys/socket.h: Ditto.
* libc/sys/linux/sys/unistd.h: Ditto.
* libc/sys/linux/iconv/iconvconfig.c: Removed either because no longer
used or because licensing includes advertising clause that cannot be
ignored.
* libc/sys/linux/iconv/strtab.c: Ditto.
* libc/sys/linux/include/libc_private.h: Ditto.
* libc/sys/linux/include/nsswitch.h: Ditto.
* libc/sys/linux/include/net/if_atm.h: Ditto.
* libc/sys/linux/include/net/if_media.h: Ditto.
* libc/sys/linux/include/net/if_pppvar.h: Ditto.
* libc/sys/linux/include/netinet/if_atm.h: Ditto.
* libc/sys/linux/include/netinet/ip_flow.h: Ditto.
* libc/sys/linux/intl/locale.alias: Ditto.
* libc/sys/linux/net/addr2ascii.3: Ditto.
* libc/sys/linux/net/bindresvport.c: Ditto.
* libc/sys/linux/net/byteorder.3: Ditto.
* libc/sys/linux/net/res_config.h: Ditto.
* libc/sys/linux/net/ether_addr.c: Ditto.
* libc/sys/linux/net/ethers.3: Ditto.
* libc/sys/linux/net/getaddrinfo.3: Ditto.
* libc/sys/linux/net/gethostbydns.c: Ditto.
* libc/sys/linux/net/gethostbyht.c: Ditto.
* libc/sys/linux/net/gethostbyname.3: Ditto.
* libc/sys/linux/net/gethostbynis.c: Ditto.
* libc/sys/linux/net/gethostnamadr.c: Ditto.
* libc/sys/linux/net/getifaddrs.3: Ditto.
* libc/sys/linux/net/getifaddrs.c: Ditto.
* libc/sys/linux/net/getipnodebyname.3: Ditto.
* libc/sys/linux/net/getnameinfo.3: Ditto.
* libc/sys/linux/net/getnetbydns.c: Ditto.
* libc/sys/linux/net/getnetbyht.c: Ditto.
* libc/sys/linux/net/getnetbynis.c: Ditto.
* libc/sys/linux/net/getnetent.3: Ditto.
* libc/sys/linux/net/getnetnamadr.c: Ditto.
* libc/sys/linux/net/getprotoent.3: Ditto.
* libc/sys/linux/net/getprotoent.c: Ditto.
* libc/sys/linux/net/getprotoname.c: Ditto.
* libc/sys/linux/net/getservbyname.c: Ditto.
* libc/sys/linux/net/getservbyport.c: Ditto.
* libc/sys/linux/net/getservent.3: Ditto.
* libc/sys/linux/net/herror.c: Ditto.
* libc/sys/linux/net/hesiod.3: Ditto.
* libc/sys/linux/net/hesiod.c: Ditto.
* libc/sys/linux/net/if_indextoname.3: Ditto.
* libc/sys/linux/net/inet.3: Ditto.
* libc/sys/linux/net/inet6_option_space.3: Ditto.
* libc/sys/linux/net/inet6_rthdr_space.3: Ditto.
* libc/sys/linux/net/inet_makeaddr.c: Ditto.
* libc/sys/linux/net/inet_net.3: Ditto.
* libc/sys/linux/net/inet_network.c: Ditto.
* libc/sys/linux/net/innetgr-stub.c: Ditto.
* libc/sys/linux/net/ip6opt.c: Ditto.
* libc/sys/linux/net/iso_addr.3: Ditto.
* libc/sys/linux/net/iso_addr.c: Ditto.
* libc/sys/linux/net/linkaddr.3: Ditto.
* libc/sys/linux/net/linkaddr.c: Ditto.
* libc/sys/linux/net/map_v4v6.c: Ditto.
* libc/sys/linux/net/name6.c: Ditto.
* libc/sys/linux/net/namespace.h: Ditto.
* libc/sys/linux/net/ns.3: Ditto.
* libc/sys/linux/net/ns_addr.c: Ditto.
* libc/sys/linux/net/ns_ntoa.c: Ditto.
* libc/sys/linux/net/nsdispatch.3: Ditto.
* libc/sys/linux/net/nsdispatch.c: Ditto.
* libc/sys/linux/net/nslexer.c: Ditto.
* libc/sys/linux/net/nslexer.l: Ditto.
* libc/sys/linux/net/nsparser.c: Ditto.
* libc/sys/linux/net/nsparser.h: Ditto.
* libc/sys/linux/net/nsparser.y: Ditto.
* libc/sys/linux/net/rcmd.3: Ditto.
* libc/sys/linux/net/rcmdsh.3: Ditto.
* libc/sys/linux/net/res_mkupdate.c: Ditto.
* libc/sys/linux/net/res_update.c: Ditto.
* libc/sys/linux/net/resolver.3: Ditto.
* libc/sys/linux/net/rthdr.c: Ditto.
* libc/sys/linux/net/vars.c: Ditto.
* libc/sys/linux/shlib-compat.h: New file.
* libc/sys/linux/machine/i386/atomic.h: Ditto.
* libc/sys/linux/net/XXX-lookup.c: Ditto.
* libc/sys/linux/net/alias-lookup.c: Ditto.
* libc/sys/linux/net/res_libc.c: Ditto.
* libc/sys/linux/net/aliases.h: Ditto.
* libc/sys/linux/net/check_pf.c: Ditto.
* libc/sys/linux/net/databases.def: Ditto.
* libc/sys/linux/net/digits_dots.c: Ditto.
* libc/sys/linux/net/ether_aton.c: Ditto.
* libc/sys/linux/net/ether_aton_r.c: Ditto.
* libc/sys/linux/net/ether_hton.c: Ditto.
* libc/sys/linux/net/ether_line.c: Ditto.
* libc/sys/linux/net/ether_ntoa.c: Ditto.
* libc/sys/linux/net/ether_ntoa_r.c: Ditto.
* libc/sys/linux/net/ether_ntoh.c: Ditto.
* libc/sys/linux/net/etherent.h: Ditto.
* libc/sys/linux/net/ethers-lookup.c: Ditto.
* libc/sys/linux/net/function.def: Ditto.
* libc/sys/linux/net/getXXbyYY.c: Ditto.
* libc/sys/linux/net/getXXbyYY_r.c: Ditto.
* libc/sys/linux/net/getXXent.c: Ditto.
* libc/sys/linux/net/getXXent_r.c: Ditto.
* libc/sys/linux/net/getaliasent.c: Ditto.
* libc/sys/linux/net/getaliasent_r.c: Ditto.
* libc/sys/linux/net/getaliasname.c: Ditto.
* libc/sys/linux/net/getaliasname_r.c: Ditto.
* libc/sys/linux/net/gethstbyad.c: Ditto.
* libc/sys/linux/net/gethstbyad_r.c: Ditto.
* libc/sys/linux/net/gethstbynm.c: Ditto.
* libc/sys/linux/net/gethstbynm2.c: Ditto.
* libc/sys/linux/net/gethstbynm2_r.c: Ditto.
* libc/sys/linux/net/gethstbynm_r.c: Ditto.
* libc/sys/linux/net/gethstent.c: Ditto.
* libc/sys/linux/net/gethstent_r.c: Ditto.
* libc/sys/linux/net/getnetbyad.c: Ditto.
* libc/sys/linux/net/getnetbyad_r.c: Ditto.
* libc/sys/linux/net/getnetbynm.c: Ditto.
* libc/sys/linux/net/getnetbynm_r.c: Ditto.
* libc/sys/linux/net/getnetent.c: Ditto.
* libc/sys/linux/net/getnetent_r.c: Ditto.
* libc/sys/linux/net/getnetgrent.c: Ditto.
* libc/sys/linux/net/getnetgrent_r.c: Ditto.
* libc/sys/linux/net/getnssent.c: Ditto.
* libc/sys/linux/net/getnssent_r.c: Ditto.
* libc/sys/linux/net/getproto_r.c: Ditto.
* libc/sys/linux/net/getprtent.c: Ditto.
* libc/sys/linux/net/getprtent_r.c: Ditto.
* libc/sys/linux/net/getprtname.c: Ditto.
* libc/sys/linux/net/getprtname_r.c: Ditto.
* libc/sys/linux/net/getrpcbyname.c: Ditto.
* libc/sys/linux/net/getrpcbyname_r.c: Ditto.
* libc/sys/linux/net/getrpcbynumber.c: Ditto.
* libc/sys/linux/net/getrpcbynumber_r.c: Ditto.
* libc/sys/linux/net/getrpcent.c: Ditto.
* libc/sys/linux/net/getrpcent_r.c: Ditto.
* libc/sys/linux/net/getservent_r.c: Ditto.
* libc/sys/linux/net/getsrvbynm.c: Ditto.
* libc/sys/linux/net/getsrvbynm_r.c: Ditto.
* libc/sys/linux/net/getsrvbypt.c: Ditto.
* libc/sys/linux/net/getsrvbypt_r.c: Ditto.
* libc/sys/linux/net/grp-lookup.c: Ditto.
* libc/sys/linux/net/herrno.c: Ditto.
* libc/sys/linux/net/hosts-lookup.c: Ditto.
* libc/sys/linux/net/ifaddrs.h: Ditto.
* libc/sys/linux/net/ifreq.c: Ditto.
* libc/sys/linux/net/ifreq.h: Ditto.
* libc/sys/linux/net/in6_addr.c: Ditto.
* libc/sys/linux/net/inet6_option.c: Ditto.
* libc/sys/linux/net/inet_mkadr.c: Ditto.
* libc/sys/linux/net/inet_net.c: Ditto.
* libc/sys/linux/net/key-lookup.c: Ditto.
* libc/sys/linux/net/local.h: Ditto.
* libc/sys/linux/net/netgroup.h: Ditto.
* libc/sys/linux/net/netgrp-lookup.c: Ditto.
* libc/sys/linux/net/network-lookup.c: Ditto.
* libc/sys/linux/net/not-cancel.h: Ditto.
* libc/sys/linux/net/ns_samedomain.c: Ditto.
* libc/sys/linux/net/nscd-types.h: Ditto.
* libc/sys/linux/net/nss.h: Ditto.
* libc/sys/linux/net/nsswitch.c: Ditto.
* libc/sys/linux/net/nsswitch.h: Ditto.
* libc/sys/linux/net/opensock.c: Ditto.
* libc/sys/linux/net/proto-lookup.c: Ditto.
* libc/sys/linux/net/pwd-lookup.c: Ditto.
* libc/sys/linux/net/res_debug.h: Ditto.
* libc/sys/linux/net/res_hconf.c: Ditto.
* libc/sys/linux/net/res_hconf.h: Ditto.
* libc/sys/linux/net/rexec.c: Ditto.
* libc/sys/linux/net/rpc-lookup.c: Ditto.
* libc/sys/linux/net/ruserpass.c: Ditto.
* libc/sys/linux/net/service-lookup.c: Ditto.
* libc/sys/linux/net/spwd-lookup.c: Ditto.
* libc/sys/linux/net/nscd/nscd-client.h: Ditto.
* libc/sys/linux/net/nscd/nscd_proto.h: Ditto.
Diffstat (limited to 'newlib/libc/sys/linux/net/getipnodebyname.3')
-rw-r--r-- | newlib/libc/sys/linux/net/getipnodebyname.3 | 461 |
1 files changed, 0 insertions, 461 deletions
diff --git a/newlib/libc/sys/linux/net/getipnodebyname.3 b/newlib/libc/sys/linux/net/getipnodebyname.3 deleted file mode 100644 index 5b8ea1ecb..000000000 --- a/newlib/libc/sys/linux/net/getipnodebyname.3 +++ /dev/null @@ -1,461 +0,0 @@ -.\" $FreeBSD: src/lib/libc/net/getipnodebyname.3,v 1.8 2001/10/01 16:08:55 ru Exp $ -.\" $KAME: getipnodebyname.3,v 1.6 2000/08/09 21:16:17 itojun Exp $ -.\" -.\" Copyright (c) 1983, 1987, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -.\" SUCH DAMAGE. -.\" -.\" From: @(#)gethostbyname.3 8.4 (Berkeley) 5/25/95 -.\" -.Dd May 25, 1995 -.Dt GETIPNODEBYNAME 3 -.Os -.\" -.Sh NAME -.Nm getipnodebyname , -.Nm getipnodebyaddr , -.Nm freehostent -.Nd nodename-to-address and address-to-nodename translation -.\" -.Sh LIBRARY -.Lb libc -.Sh SYNOPSIS -.In sys/types.h -.In sys/socket.h -.In netdb.h -.Ft "struct hostent *" -.Fn getipnodebyname "const char *name" "int af" "int flags" "int *error_num" -.Ft "struct hostent *" -.Fn getipnodebyaddr "const void *src" "size_t len" "int af" "int *error_num" -.Ft void -.Fn freehostent "struct hostent *ptr" -.\" -.Sh DESCRIPTION -.Fn getipnodebyname -and -.Fn getipnodebyaddr -functions are very similar to -.Xr gethostbyname 3 , -.Xr gethostbyname2 3 -and -.Xr gethostbyaddr 3 . -The functions cover all the functionalities provided by the older ones, -and provide better interface to programmers. -The functions require additional arguments, -.Ar af , -and -.Ar flags , -for specifying address family and operation mode. -The additional arguments allow programmer to get address for a nodename, -for specific address family -(such as -.Dv AF_INET -or -.Dv AF_INET6 ) . -The functions also require an additional pointer argument, -.Ar error_num -to return the appropriate error code, -to support thread safe error code returns. -.Pp -The type and usage of the return value, -.Li "struct hostent" -is described in -.Xr gethostbyname 3 . -.Pp -For -.Fn getipnodebyname , -the -.Ar name -argument can be either a node name or a numeric address -string -(i.e., a dotted-decimal IPv4 address or an IPv6 hex address). -The -.Ar af -argument specifies the address family, either -.Dv AF_INET -or -.Dv AF_INET6 . -The -.Ar flags -argument specifies the types of addresses that are searched for, -and the types of addresses that are returned. -We note that a special flags value of -.Dv AI_DEFAULT -(defined below) -should handle most applications. -That is, porting simple applications to use IPv6 replaces the call -.Bd -literal -offset - hptr = gethostbyname(name); -.Ed -.Pp -with -.Bd -literal -offset - hptr = getipnodebyname(name, AF_INET6, AI_DEFAULT, &error_num); -.Ed -.Pp -Applications desiring finer control over the types of addresses -searched for and returned, can specify other combinations of the -.Ar flags -argument. -.Pp -A -.Ar flags -of -.Li 0 -implies a strict interpretation of the -.Ar af -argument: -.Bl -bullet -.It -If -.Ar flags -is 0 and -.Ar af -is -.Dv AF_INET , -then the caller wants only IPv4 addresses. -A query is made for -.Li A -records. -If successful, the IPv4 addresses are returned and the -.Li h_length -member of the -.Li hostent -structure will be 4, else the function returns a -.Dv NULL -pointer. -.It -If -.Ar flags -is 0 and if -.Ar af -is -.Li AF_INET6 , -then the caller wants only IPv6 addresses. -A query is made for -.Li AAAA -records. -If successful, the IPv6 addresses are returned and the -.Li h_length -member of the -.Li hostent -structure will be 16, else the function returns a -.Dv NULL -pointer. -.El -.Pp -Other constants can be logically-ORed into the -.Ar flags -argument, to modify the behavior of the function. -.Bl -bullet -.It -If the -.Dv AI_V4MAPPED -flag is specified along with an -.Ar af -of -.Dv AF_INET6 , -then the caller will accept IPv4-mapped IPv6 addresses. -That is, if no -.Li AAAA -records are found then a query is made for -.Li A -records and any found are returned as IPv4-mapped IPv6 addresses -.Li ( h_length -will be 16). -The -.Dv AI_V4MAPPED -flag is ignored unless -.Ar af -equals -.Dv AF_INET6 . -.It -The -.Dv AI_V4MAPPED_CFG -flag is exact same as the -.Dv AI_V4MAPPED -flag only if the kernel supports IPv4-mapped IPv6 address. -.It -If the -.Dv AI_ALL -flag is used in conjunction with the -.Dv AI_V4MAPPED -flag, and only used with the IPv6 address family. -When -.Dv AI_ALL -is logically or'd with -.Dv AI_V4MAPPED -flag then the caller wants all addresses: IPv6 and IPv4-mapped IPv6. -A query is first made for -.Li AAAA -records and if successful, the -IPv6 addresses are returned. Another query is then made for -.Li A -records and any found are returned as IPv4-mapped IPv6 addresses. -.Li h_length -will be 16. Only if both queries fail does the function -return a -.Dv NULL -pointer. This flag is ignored unless af equals -AF_INET6. If both -.Dv AI_ALL -and -.Dv AI_V4MAPPED -are specified, -.Dv AI_ALL -takes precedence. -.It -The -.Dv AI_ADDRCONFIG -flag specifies that a query for -.Li AAAA -records -should occur only if the node has at least one IPv6 source -address configured and a query for -.Li A -records should occur only if the node has at least one IPv4 source address -configured. -.Pp -For example, if the node has no IPv6 source addresses configured, -and -.Ar af -equals AF_INET6, and the node name being looked up has both -.Li AAAA -and -.Li A -records, then: -(a) if only -.Dv AI_ADDRCONFIG -is -specified, the function returns a -.Dv NULL -pointer; -(b) if -.Dv AI_ADDRCONFIG -| -.Dv AI_V4MAPPED -is specified, the -.Li A -records are returned as IPv4-mapped IPv6 addresses; -.El -.Pp -The special flags value of -.Dv AI_DEFAULT -is defined as -.Bd -literal -offset - #define AI_DEFAULT (AI_V4MAPPED_CFG | AI_ADDRCONFIG) -.Ed -.Pp -We noted that the -.Fn getipnodebyname -function must allow the -.Ar name -argument to be either a node name or a literal address string -(i.e., a dotted-decimal IPv4 address or an IPv6 hex address). -This saves applications from having to call -.Xr inet_pton 3 -to handle literal address strings. -When the -.Ar name -argument is a literal address string, -the -.Ar flags -argument is always ignored. -.Pp -There are four scenarios based on the type of literal address string -and the value of the -.Ar af -argument. -The two simple cases are when -.Ar name -is a dotted-decimal IPv4 address and -.Ar af -equals -.Dv AF_INET , -or when -.Ar name -is an IPv6 hex address and -.Ar af -equals -.Dv AF_INET6 . -The members of the -returned hostent structure are: -.Li h_name -points to a copy of the -.Ar name -argument, -.Li h_aliases -is a -.Dv NULL -pointer, -.Li h_addrtype -is a copy of the -.Ar af -argument, -.Li h_length -is either 4 -(for -.Dv AF_INET ) -or 16 -(for -.Dv AF_INET6 ) , -.Li h_addr_list[0] -is a pointer to the 4-byte or 16-byte binary address, -and -.Li h_addr_list[1] -is a -.Dv NULL -pointer. -.Pp -When -.Ar name -is a dotted-decimal IPv4 address and -.Ar af -equals -.Dv AF_INET6 , -and -.Dv AI_V4MAPPED -is specified, -an IPv4-mapped IPv6 address is returned: -.Li h_name -points to an IPv6 hex address containing the IPv4-mapped IPv6 address, -.Li h_aliases -is a -.Dv NULL -pointer, -.Li h_addrtype -is -.Dv AF_INET6 , -.Li h_length -is 16, -.Li h_addr_list[0] -is a pointer to the 16-byte binary address, and -.Li h_addr_list[1] -is a -.Dv NULL -pointer. -.Pp -It is an error when -.Ar name -is an IPv6 hex address and -.Ar af -equals -.Dv AF_INET . -The function's return value is a -.Dv NULL -pointer and the value pointed to by -.Ar error_num -equals -.Dv HOST_NOT_FOUND . -.Pp -.Fn getipnodebyaddr -takes almost the same argument as -.Xr gethostbyaddr 3 , -but adds a pointer to return an error number. -Additionally it takes care of IPv4-mapped IPv6 addresses, -and IPv4-compatible IPv6 addresses. -.Pp -.Fn getipnodebyname -and -.Fn getipnodebyaddr -dynamically allocate the structure to be returned to the caller. -.Fn freehostent -reclaims memory region allocated and returned by -.Fn getipnodebyname -or -.Fn getipnodebyaddr . -.\" -.Sh FILES -.Bl -tag -width /etc/nsswitch.conf -compact -.It Pa /etc/hosts -.It Pa /etc/nsswitch.conf -.It Pa /etc/resolv.conf -.El -.\" -.Sh DIAGNOSTICS -.Fn getipnodebyname -and -.Fn getipnodebyaddr -returns -.Dv NULL -on errors. -The integer values pointed to by -.Ar error_num -may then be checked to see whether this is a temporary failure -or an invalid or unknown host. -The meanings of each error code are described in -.Xr gethostbyname 3 . -.\" -.Sh SEE ALSO -.Xr gethostbyaddr 3 , -.Xr gethostbyname 3 , -.Xr hosts 5 , -.Xr nsswitch.conf 5 , -.Xr services 5 , -.Xr hostname 7 , -.Xr named 8 -.Pp -.Rs -.%A R. Gilligan -.%A S. Thomson -.%A J. Bound -.%A W. Stevens -.%T Basic Socket Interface Extensions for IPv6 -.%R RFC2553 -.%D March 1999 -.Re -.\" -.Sh HISTORY -The implementation first appeared in KAME advanced networking kit. -.\" -.Sh STANDARDS -.Fn getipnodebyname -and -.Fn getipnodebyaddr -are documented in -.Dq Basic Socket Interface Extensions for IPv6 -(RFC2553). -.\" -.Sh BUGS -.Fn getipnodebyname -and -.Fn getipnodebyaddr -do not handle scoped IPv6 address properly. -If you use these functions, -your program will not be able to handle scoped IPv6 addresses. -For IPv6 address manipulation, -.Fn getaddrinfo 3 -and -.Fn getnameinfo 3 -are recommended. -.Pp -The current implementation is not thread-safe. -.Pp -The text was shamelessly copied from RFC2553. |