lwres_getnameinfo.html revision 7911e6f9de303bca5a3d8b34f4330c8f7cecffae
c77a61a72b5ecdc507d6cf104142edd371a16c84yz<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
c77a61a72b5ecdc507d6cf104142edd371a16c84yz - Copyright (C) 2000, 2001, 2004, 2005, 2007, 2014-2016 Internet Systems Consortium, Inc. ("ISC")
c77a61a72b5ecdc507d6cf104142edd371a16c84yz - This Source Code Form is subject to the terms of the Mozilla Public
c77a61a72b5ecdc507d6cf104142edd371a16c84yz - License, v. 2.0. If a copy of the MPL was not distributed with this
c77a61a72b5ecdc507d6cf104142edd371a16c84yz - file, You can obtain one at http://mozilla.org/MPL/2.0/.
c77a61a72b5ecdc507d6cf104142edd371a16c84yz<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
c77a61a72b5ecdc507d6cf104142edd371a16c84yz<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
c77a61a72b5ecdc507d6cf104142edd371a16c84yz<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry">
c77a61a72b5ecdc507d6cf104142edd371a16c84yz lwres_getnameinfo
c77a61a72b5ecdc507d6cf104142edd371a16c84yz — lightweight resolver socket address structure to hostname and
c77a61a72b5ecdc507d6cf104142edd371a16c84yz service name
c77a61a72b5ecdc507d6cf104142edd371a16c84yz<pre class="funcsynopsisinfo">#include <lwres/netdb.h></pre>
c77a61a72b5ecdc507d6cf104142edd371a16c84yz<table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;">
c77a61a72b5ecdc507d6cf104142edd371a16c84yz<td>const struct sockaddr *<var class="pdparam">sa</var>, </td>
c77a61a72b5ecdc507d6cf104142edd371a16c84yz<td>int <var class="pdparam">flags</var><code>)</code>;</td>
c77a61a72b5ecdc507d6cf104142edd371a16c84yz This function is equivalent to the
c77a61a72b5ecdc507d6cf104142edd371a16c84yz </span> function defined in RFC2133.
c77a61a72b5ecdc507d6cf104142edd371a16c84yz <code class="function">lwres_getnameinfo()</code> returns the
c77a61a72b5ecdc507d6cf104142edd371a16c84yz hostname for the
c77a61a72b5ecdc507d6cf104142edd371a16c84yz <span class="type">struct sockaddr</span> <em class="parameter"><code>sa</code></em> which
c77a61a72b5ecdc507d6cf104142edd371a16c84yz <em class="parameter"><code>salen</code></em> bytes long. The hostname is of
c77a61a72b5ecdc507d6cf104142edd371a16c84yz <em class="parameter"><code>hostlen</code></em> and is returned via
c77a61a72b5ecdc507d6cf104142edd371a16c84yz <em class="parameter"><code>*host.</code></em> The maximum length of the
c77a61a72b5ecdc507d6cf104142edd371a16c84yz hostname is
c77a61a72b5ecdc507d6cf104142edd371a16c84yz <p> The name of the service associated with the port number in
c77a61a72b5ecdc507d6cf104142edd371a16c84yz <em class="parameter"><code>sa</code></em> is returned in <em class="parameter"><code>*serv.</code></em>
c77a61a72b5ecdc507d6cf104142edd371a16c84yz It is <em class="parameter"><code>servlen</code></em> bytes long. The
c77a61a72b5ecdc507d6cf104142edd371a16c84yz maximum length
c77a61a72b5ecdc507d6cf104142edd371a16c84yz of the service name is <code class="constant">NI_MAXSERV</code> - 32
c77a61a72b5ecdc507d6cf104142edd371a16c84yz The <em class="parameter"><code>flags</code></em> argument sets the
c77a61a72b5ecdc507d6cf104142edd371a16c84yz<dt><span class="term"><code class="constant">NI_NOFQDN</code></span></dt>
c77a61a72b5ecdc507d6cf104142edd371a16c84yz A fully qualified domain name is not required for local hosts.
c77a61a72b5ecdc507d6cf104142edd371a16c84yz The local part of the fully qualified domain name is returned
c77a61a72b5ecdc507d6cf104142edd371a16c84yz<dt><span class="term"><code class="constant">NI_NUMERICHOST</code></span></dt>
c77a61a72b5ecdc507d6cf104142edd371a16c84yz Return the address in numeric form, as if calling inet_ntop(),
c77a61a72b5ecdc507d6cf104142edd371a16c84yz instead of a host name.
c77a61a72b5ecdc507d6cf104142edd371a16c84yz<dt><span class="term"><code class="constant">NI_NAMEREQD</code></span></dt>
c77a61a72b5ecdc507d6cf104142edd371a16c84yz A name is required. If the hostname cannot be found in the DNS
c77a61a72b5ecdc507d6cf104142edd371a16c84yz this flag is set, a non-zero error code is returned.
c77a61a72b5ecdc507d6cf104142edd371a16c84yz If the hostname is not found and the flag is not set, the
c77a61a72b5ecdc507d6cf104142edd371a16c84yz address is returned in numeric form.
c77a61a72b5ecdc507d6cf104142edd371a16c84yz<dt><span class="term"><code class="constant">NI_NUMERICSERV</code></span></dt>
c77a61a72b5ecdc507d6cf104142edd371a16c84yz The service name is returned as a digit string representing the
c77a61a72b5ecdc507d6cf104142edd371a16c84yz port number.
c77a61a72b5ecdc507d6cf104142edd371a16c84yz<dt><span class="term"><code class="constant">NI_DGRAM</code></span></dt>
c77a61a72b5ecdc507d6cf104142edd371a16c84yz Specifies that the service being looked up is a datagram
c77a61a72b5ecdc507d6cf104142edd371a16c84yz service, and causes getservbyport() to be called with a second
c77a61a72b5ecdc507d6cf104142edd371a16c84yz argument of "udp" instead of its default of "tcp". This is
c77a61a72b5ecdc507d6cf104142edd371a16c84yz for the few ports (512-514) that have different services for UDP