lwres_getaddrinfo.html revision 4abdfc917e6635a7c81d1f931a0c79227e72d025
794b79e6bbc3f5db1ea6ae154d739b9f1ef1a375Tinderbox User - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
9210d8796eaf4125ac58c034f9b5ca167857a55aAutomatic Updater - Copyright (C) 2000, 2001, 2003 Internet Software Consortium.
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt - Permission to use, copy, modify, and distribute this software for any
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt - purpose with or without fee is hereby granted, provided that the above
9210d8796eaf4125ac58c034f9b5ca167857a55aAutomatic Updater - copyright notice and this permission notice appear in all copies.
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9210d8796eaf4125ac58c034f9b5ca167857a55aAutomatic Updater - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt - PERFORMANCE OF THIS SOFTWARE.
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt<!-- $Id: lwres_getaddrinfo.html,v 1.26 2007/01/26 23:29:04 marka Exp $ -->
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt<meta name="generator" content="DocBook XSL Stylesheets V1.71.1">
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt<a name="id2476275"></a><div class="titlepage"></div>
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt<p>lwres_getaddrinfo, lwres_freeaddrinfo — socket address structure to host and service name</p>
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt<pre class="funcsynopsisinfo">#include <lwres/netdb.h></pre>
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
f5ae3cca1d2832239cc821bdef77e90c1739e66dTinderbox User<b class="fsfunc">lwres_getaddrinfo</b>(</code></td>
ec899c963c91c16c393e067996400ae244921110Tinderbox User<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr>
ec899c963c91c16c393e067996400ae244921110Tinderbox User<b class="fsfunc">lwres_freeaddrinfo</b>(</code></td>
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt If the operating system does not provide a
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt the following structure is used:
351b62535d4c4f89883bfdba025999dd32490266Evan Huntstruct addrinfo {
ec899c963c91c16c393e067996400ae244921110Tinderbox User int ai_flags; /* AI_PASSIVE, AI_CANONNAME */
ec899c963c91c16c393e067996400ae244921110Tinderbox User int ai_family; /* PF_xxx */
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt int ai_socktype; /* SOCK_xxx */
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt size_t ai_addrlen; /* length of ai_addr */
ec899c963c91c16c393e067996400ae244921110Tinderbox User char *ai_canonname; /* canonical name for hostname */
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt struct sockaddr *ai_addr; /* binary address */
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt struct addrinfo *ai_next; /* next structure in linked list */
7ae7246a6339bb3a79ffc9f2f9c486de9a2bf65eAutomatic Updater<a name="id2543409"></a><h2>DESCRIPTION</h2>
7ae7246a6339bb3a79ffc9f2f9c486de9a2bf65eAutomatic Updater<p><code class="function">lwres_getaddrinfo()</code>
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt is used to get a list of IP addresses and port numbers for host
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt <em class="parameter"><code>hostname</code></em> and service
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt The function is the lightweight resolver's implementation of
ec899c963c91c16c393e067996400ae244921110Tinderbox User <code class="function">getaddrinfo()</code> as defined in RFC2133.
ec899c963c91c16c393e067996400ae244921110Tinderbox User <em class="parameter"><code>hostname</code></em> and
ec899c963c91c16c393e067996400ae244921110Tinderbox User <em class="parameter"><code>servname</code></em> are pointers to null-terminated
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt <em class="parameter"><code>hostname</code></em> is either a host name or a
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt numeric host address string: a dotted decimal IPv4 address or an
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt IPv6 address. <em class="parameter"><code>servname</code></em> is either a
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt decimal port number or a service name as listed in
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt is an optional pointer to a
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt This structure can be used to provide hints concerning the type of
7ae7246a6339bb3a79ffc9f2f9c486de9a2bf65eAutomatic Updater that the caller supports or wishes to use.
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt The caller can supply the following structure elements in
ec899c963c91c16c393e067996400ae244921110Tinderbox User <em class="parameter"><code>*hints</code></em>:
ec899c963c91c16c393e067996400ae244921110Tinderbox User<dt><span class="term"><code class="constant">ai_family</code></span></dt>
2cbb4ab75757fbb656997a82c14ca07db37d481aAutomatic Updater The protocol family that should be used.
7ae7246a6339bb3a79ffc9f2f9c486de9a2bf65eAutomatic Updater it means the caller will accept any protocol family supported by
ec899c963c91c16c393e067996400ae244921110Tinderbox User operating system.
ec899c963c91c16c393e067996400ae244921110Tinderbox User<dt><span class="term"><code class="constant">ai_socktype</code></span></dt>
7ae7246a6339bb3a79ffc9f2f9c486de9a2bf65eAutomatic Updater denotes the type of socket —
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt — that is wanted.
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt is zero the caller will accept any socket type.
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt<dt><span class="term"><code class="constant">ai_protocol</code></span></dt>
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt indicates which transport protocol is wanted: IPPROTO_UDP or
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt IPPROTO_TCP.
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt is zero the caller will accept any protocol.
351b62535d4c4f89883bfdba025999dd32490266Evan Hunt<dt><span class="term"><code class="constant">ai_flags</code></span></dt>