lwres_getnameinfo.docbook revision ddccd5811feff696ba460dabfb666ce61040f545
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews - Copyright (C) 2000, 2001 Internet Software Consortium.
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater - 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.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson - WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt<!-- $Id: lwres_getnameinfo.docbook,v 1.1 2001/03/31 00:08:13 gson Exp $ -->
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<refentryinfo>
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt</refentryinfo>
86b0285d7e65601645db4090d62ee6cb63abad6cAndreas Gustafsson<refentrytitle>lwres_getnameinfo</refentrytitle>
86b0285d7e65601645db4090d62ee6cb63abad6cAndreas Gustafsson<refpurpose>lightweight resolver socket address structure to hostname and service name</refpurpose>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</refnamediv>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<refsynopsisdiv>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<funcsynopsis>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<funcsynopsisinfo>#include <lwres/netdb.h></funcsynopsisinfo>
c1a883f2e04d94e99c433b1f6cfd0c0338f4ed85Mark Andrews<funcprototype>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</funcprototype>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</funcsynopsis>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</refsynopsisdiv>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinThis function is equivalent to the
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<citerefentry>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<refentrytitle>getnameinfo</refentrytitle><manvolnum>3
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</citerefentry>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonfunction defined in RFC2133.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinreturns the hostname for the
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinThe hostname is of length
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonand is returned via
86b0285d7e65601645db4090d62ee6cb63abad6cAndreas GustafssonThe maximum length of the hostname is
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinThe name of the service associated with the port number in
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinis returned in
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinThe maximum length of the service name is
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinargument sets the following bits:
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<varlistentry><term><constant>NI_NOFQDN</constant></term>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinA fully qualified domain name is not required for local hosts.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinThe local part of the fully qualified domain name is returned instead.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<varlistentry><term><constant>NI_NUMERICHOST</constant></term>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinReturn the address in numeric form, as if calling inet_ntop(),
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeininstead of a host name.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<varlistentry><term><constant>NI_NAMEREQD</constant></term>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinA name is required. If the hostname cannot be found in the DNS and
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinthis flag is set, a non-zero error code is returned.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinIf the hostname is not found and the flag is not set, the
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinaddress is returned in numeric form.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<varlistentry><term><constant>NI_NUMERICSERV</constant></term>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinThe service name is returned as a digit string representing the port number.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<varlistentry><term><constant>NI_DGRAM</constant></term>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinSpecifies that the service being looked up is a datagram
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinservice, and causes getservbyport() to be called with a second
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinargument of "udp" instead of its default of "tcp". This is required
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinfor the few ports (512-514) that have different services for UDP and
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</variablelist>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeinreturns 0 on success or a non-zero error code if an error occurs.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<citerefentry>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</citerefentry>,
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<citerefentry>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<refentrytitle>getservbyport</refentrytitle><manvolnum>3</manvolnum>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</citerefentry>,
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<citerefentry>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<refentrytitle>lwres</refentrytitle><manvolnum>3</manvolnum>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</citerefentry>,
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<citerefentry>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<refentrytitle>lwres_getnameinfo</refentrytitle><manvolnum>3</manvolnum>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</citerefentry>,
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<citerefentry>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<refentrytitle>lwres_getnamebyaddr</refentrytitle><manvolnum>3</manvolnum>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</citerefentry>.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<citerefentry>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<refentrytitle>lwres_net_ntop</refentrytitle><manvolnum>3</manvolnum>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</citerefentry>.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntRFC2133 fails to define what the nonzero return values of
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<citerefentry>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein<refentrytitle>getnameinfo</refentrytitle><manvolnum>3</manvolnum>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</citerefentry>