3 .\" Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC")
5 .\" Permission to use, copy, modify, and/or distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10 .\" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11 .\" AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12 .\" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13 .\" LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14 .\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15 .\" PERFORMANCE OF THIS SOFTWARE.
17 .\" Id: getnameinfo.3,v 1.4 2009/02/21 01:31:39 jreed Exp
20 .Dt GETNAMEINFO @LIB_NETWORK_EXT@
23 .Nd address-to-name translation in protocol-independent manner
25 .Fd #include <sys/socket.h>
26 .Fd #include <netdb.h>
28 .Fn getnameinfo "const struct sockaddr *sa" "socklen_t salen" \
29 "char *host" "size_t hostlen" "char *serv" "size_t servlen" "int flags"
33 function is defined for protocol-independent address-to-nodename translation.
34 It performs functionality of
35 .Xr gethostbyaddr @LIB_NETWORK_EXT@
37 .Xr getservbyport @LIB_NETWORK_EXT@
38 in more sophisticated manner.
42 arguement is a pointer to a generic socket address structure of size
48 are pointers to buffers to hold the return values.
49 Their sizes are specified by
60 if the hostname or service name is not required.
64 arguement modifies the behaviour of
70 is set only the unqualified hostname is returned for local fully
75 is set then the numeric form of the hostname is returned.
79 is set, then a error is returned if the hostname cannot be looked up.
83 is set then the service is returned in numeric form.
87 is set then the service is UDP based rather than TCP based.
89 .Xr getaddrinfo @LIB_NETWORK_EXT@ ,
90 .Xr gethostbyaddr @LIB_NETWORK_EXT@ ,
91 .Xr getservbyport @LIB_NETWORK_EXT@ ,
92 .Xr hosts @FORMAT_EXT@ ,
93 .Xr services @FORMAT_EXT@ ,
94 .Xr hostname @DESC_EXT@ ,
96 R. Gilligan, S. Thomson, J. Bound, and W. Stevens,
97 ``Basic Socket Interface Extensions for IPv6,'' RFC2133, April 1997.
101 function is defined IEEE POSIX 1003.1g draft specification,
102 and documented in ``Basic Socket Interface Extensions for IPv6''