lwres_getnameinfo.html revision 8a66318e41ed14c5a88130e8c362610e8faa2121
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews - Copyright (C) 2001 Internet Software Consortium.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson - Permission to use, copy, modify, and distribute this software for any
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson - purpose with or without fee is hereby granted, provided that the above
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson - copyright notice and this permission notice appear in all copies.
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews - PERFORMANCE OF THIS SOFTWARE.
8a66318e41ed14c5a88130e8c362610e8faa2121Mark Andrews<!-- $Id: lwres_getnameinfo.html,v 1.6 2004/03/05 08:32:20 marka Exp $ -->
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>lwres_getnameinfo</TITLE
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonNAME="GENERATOR"
8a66318e41ed14c5a88130e8c362610e8faa2121Mark AndrewsCONTENT="Modular DocBook HTML Stylesheet Version 1.73
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="REFENTRY"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonBGCOLOR="#FFFFFF"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonVLINK="#840084"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonALINK="#0000FF"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>lwres_getnameinfo</A
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="REFNAMEDIV"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>lwres_getnameinfo -- lightweight resolver socket address structure to hostname and service name</DIV
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="REFSYNOPSISDIV"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="FUNCSYNOPSIS"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="FUNCSYNOPSISINFO"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="FUNCDEF"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonlwres_getnameinfo</CODE
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>(const struct sockaddr *sa, size_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags);</CODE
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="REFSECT1"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>DESCRIPTION</H2
ac299c4f5ca236370b9df2a91b18b149b1d344a7Andreas Gustafsson> This function is equivalent to the <SPAN
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="CITEREFENTRY"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="REFENTRYTITLE"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>getnameinfo</SPAN
ac299c4f5ca236370b9df2a91b18b149b1d344a7Andreas Gustafsson> function defined in RFC2133.
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="FUNCTION"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>lwres_getnameinfo()</TT
ac299c4f5ca236370b9df2a91b18b149b1d344a7Andreas Gustafsson> returns the hostname for the
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>struct sockaddr</SPAN
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="PARAMETER"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="PARAMETER"
ac299c4f5ca236370b9df2a91b18b149b1d344a7Andreas Gustafsson> bytes long. The hostname is of length
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="PARAMETER"
ac299c4f5ca236370b9df2a91b18b149b1d344a7Andreas Gustafsson> and is returned via
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="PARAMETER"
ac299c4f5ca236370b9df2a91b18b149b1d344a7Andreas Gustafsson> The maximum length of the hostname is
ac299c4f5ca236370b9df2a91b18b149b1d344a7Andreas Gustafsson1025 bytes: <TT
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="CONSTANT"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>NI_MAXHOST</TT
ac299c4f5ca236370b9df2a91b18b149b1d344a7Andreas Gustafsson> The name of the service associated with the port number in
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="PARAMETER"
ac299c4f5ca236370b9df2a91b18b149b1d344a7Andreas Gustafsson> is returned in <TT
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="PARAMETER"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="PARAMETER"
ac299c4f5ca236370b9df2a91b18b149b1d344a7Andreas Gustafsson> bytes long. The maximum length
ac299c4f5ca236370b9df2a91b18b149b1d344a7Andreas Gustafssonof the service name is <TT
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="CONSTANT"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>NI_MAXSERV</TT
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson> - 32 bytes.</P
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="PARAMETER"
ac299c4f5ca236370b9df2a91b18b149b1d344a7Andreas Gustafsson> argument sets the following
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="VARIABLELIST"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="CONSTANT"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>A fully qualified domain name is not required for local hosts.
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonThe local part of the fully qualified domain name is returned instead.</P
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="CONSTANT"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>NI_NUMERICHOST</TT
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>Return the address in numeric form, as if calling inet_ntop(),
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssoninstead of a host name.</P
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="CONSTANT"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>NI_NAMEREQD</TT
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>A name is required. If the hostname cannot be found in the DNS and
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonthis flag is set, a non-zero error code is returned.
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonIf the hostname is not found and the flag is not set, the
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonaddress is returned in numeric form.</P
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="CONSTANT"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>NI_NUMERICSERV</TT
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>The service name is returned as a digit string representing the port number.</P
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="CONSTANT"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>Specifies that the service being looked up is a datagram
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonservice, and causes getservbyport() to be called with a second
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonargument of "udp" instead of its default of "tcp". This is required
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonfor the few ports (512-514) that have different services for UDP and
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="REFSECT1"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>RETURN VALUES</H2
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="FUNCTION"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>lwres_getnameinfo()</TT
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonreturns 0 on success or a non-zero error code if an error occurs.</P
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="REFSECT1"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="CITEREFENTRY"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="REFENTRYTITLE"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="CITEREFENTRY"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="REFENTRYTITLE"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>getservbyport</SPAN
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="CITEREFENTRY"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="REFENTRYTITLE"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="CITEREFENTRY"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="REFENTRYTITLE"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>lwres_getnameinfo</SPAN
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="CITEREFENTRY"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="REFENTRYTITLE"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>lwres_getnamebyaddr</SPAN
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="CITEREFENTRY"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="REFENTRYTITLE"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>lwres_net_ntop</SPAN
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="REFSECT1"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>RFC2133 fails to define what the nonzero return values of
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="CITEREFENTRY"
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonCLASS="REFENTRYTITLE"
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson>getnameinfo</SPAN