lwres_getnameinfo.html revision 52ece689e0265f9a3e518de5b2539e749f6d35ac
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive - Copyright (C) 2000, 2001 Internet Software Consortium.
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive - Permission to use, copy, modify, and distribute this software for any
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive - purpose with or without fee is hereby granted, provided that the above
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive - copyright notice and this permission notice appear in all copies.
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive - PERFORMANCE OF THIS SOFTWARE.
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive<!-- $Id: lwres_getnameinfo.html,v 1.19 2006/04/23 10:14:12 marka Exp $ -->
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
7b02e31b0f0bbca080ed78d2ec5a1398a7388202slive<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
7b02e31b0f0bbca080ed78d2ec5a1398a7388202slive<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive<p>lwres_getnameinfo — lightweight resolver socket address structure to hostname and
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive service name
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive<pre class="funcsynopsisinfo">#include <lwres/netdb.h></pre>
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0">
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive This function is equivalent to the
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive <span class="citerefentry"><span class="refentrytitle">getnameinfo</span>(3)</span> function defined in RFC2133.
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive <code class="function">lwres_getnameinfo()</code> returns the
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive hostname for the
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive <span class="type">struct sockaddr</span> <em class="parameter"><code>sa</code></em> which
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive <em class="parameter"><code>salen</code></em> bytes long. The hostname is of
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive <em class="parameter"><code>hostlen</code></em> and is returned via
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive <em class="parameter"><code>*host.</code></em> The maximum length of the
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive hostname is
7b02e31b0f0bbca080ed78d2ec5a1398a7388202slive<p> The name of the service associated with the port number in
7b02e31b0f0bbca080ed78d2ec5a1398a7388202slive <em class="parameter"><code>sa</code></em> is returned in <em class="parameter"><code>*serv.</code></em>
7b02e31b0f0bbca080ed78d2ec5a1398a7388202slive It is <em class="parameter"><code>servlen</code></em> bytes long. The
7b02e31b0f0bbca080ed78d2ec5a1398a7388202slive maximum length
7b02e31b0f0bbca080ed78d2ec5a1398a7388202slive of the service name is <code class="constant">NI_MAXSERV</code> - 32
7b02e31b0f0bbca080ed78d2ec5a1398a7388202slive The <em class="parameter"><code>flags</code></em> argument sets the
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive<dt><span class="term"><code class="constant">NI_NOFQDN</code></span></dt>
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive A fully qualified domain name is not required for local hosts.
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive The local part of the fully qualified domain name is returned
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive<dt><span class="term"><code class="constant">NI_NUMERICHOST</code></span></dt>
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive Return the address in numeric form, as if calling inet_ntop(),
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive instead of a host name.
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive<dt><span class="term"><code class="constant">NI_NAMEREQD</code></span></dt>
39439c95488c2e66ea8b35c47f75e9ec2508d8fbslive A name is required. If the hostname cannot be found in the DNS