lwres_getrrsetbyname.docbook revision c651f15b30f1dae5cc2f00878fb5da5b3a35a468
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg<!--
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg - Copyright (C) 2000, 2001 Internet Software Consortium.
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg -
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg - Permission to use, copy, modify, and distribute this software for any
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg - purpose with or without fee is hereby granted, provided that the above
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg - copyright notice and this permission notice appear in all copies.
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg -
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg - PERFORMANCE OF THIS SOFTWARE.
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg-->
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg
7190e58eec40192c9719d2f2593471eda14e7e7cfuankg<!-- $Id: lwres_getrrsetbyname.docbook,v 1.5 2005/04/07 03:50:03 marka Exp $ -->
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg<refentry>
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg<refentryinfo>
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg<date>Oct 18, 2000</date>
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg</refentryinfo>
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg<refmeta>
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg<refentrytitle>lwres_getrrsetbyname</refentrytitle>
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg<manvolnum>3</manvolnum>
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg<refmiscinfo>BIND9</refmiscinfo>
95ca7cc2aa11b41497ffab3a1003bc09d24b6bc1fuankg</refmeta>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<refnamediv>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<refname>lwres_getrrsetbyname</refname>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<refname>lwres_freerrset</refname>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<refpurpose>retrieve DNS records</refpurpose>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</refnamediv>
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholes<refsynopsisdiv>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<funcsynopsis>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<funcsynopsisinfo>#include &lt;lwres/netdb.h&gt;</funcsynopsisinfo>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<funcprototype>
ce22ce4743d79a889dca64df4459c598e2c188c7fuankg<funcdef>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesint
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<function>lwres_getrrsetbyname</function></funcdef>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<paramdef>const char *hostname</paramdef>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<paramdef>unsigned int rdclass</paramdef>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<paramdef>unsigned int rdtype</paramdef>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<paramdef>unsigned int flags</paramdef>
0662ed52e814f8f08ef0e09956413a792584eddffuankg<paramdef>struct rrsetinfo **res</paramdef>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</funcprototype>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<funcprototype>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<funcdef>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesvoid
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<function>lwres_freerrset</function></funcdef>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<paramdef>struct rrsetinfo *rrset</paramdef>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</funcprototype>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</funcsynopsis>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesThe following structures are used:
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<programlisting>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesstruct rdatainfo {
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholes unsigned int rdi_length; /* length of data */
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholes unsigned char *rdi_data; /* record data */
8d6e239d0e0aa0593fd93b4fef193d8c51b61b3cfuankg};
b387b9d37fc71c534f4718777454a8f5a1169017fuankg
b387b9d37fc71c534f4718777454a8f5a1169017fuankgstruct rrsetinfo {
b387b9d37fc71c534f4718777454a8f5a1169017fuankg unsigned int rri_flags; /* RRSET_VALIDATED... */
b387b9d37fc71c534f4718777454a8f5a1169017fuankg unsigned int rri_rdclass; /* class number */
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes unsigned int rri_rdtype; /* RR type number */
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes unsigned int rri_ttl; /* time to live */
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes unsigned int rri_nrdatas; /* size of rdatas array */
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes unsigned int rri_nsigs; /* size of sigs array */
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes char *rri_name; /* canonical name */
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes struct rdatainfo *rri_rdatas; /* individual records */
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes struct rdatainfo *rri_sigs; /* individual signatures */
8492a2583e10c69f40de92f9d5da884b64d9f379fuankg};
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</programlisting>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</refsynopsisdiv>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<refsect1>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<title>DESCRIPTION</title>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<function>lwres_getrrsetbyname()</function>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesgets a set of resource records associated with a
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<parameter>hostname</parameter>,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<parameter>class</parameter>,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesand
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<parameter>type</parameter>.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<parameter>hostname</parameter>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesis
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesa pointer a to null-terminated string. The
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<parameter>flags</parameter>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesfield is currently unused and must be zero.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesAfter a successful call to
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<function>lwres_getrrsetbyname()</function>,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<parameter>*res</parameter>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesis a pointer to an
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<type>rrsetinfo</type>
ce22ce4743d79a889dca64df4459c598e2c188c7fuankgstructure, containing a list of one or more
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<type>rdatainfo</type>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesstructures containing resource records and potentially another list of
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<type>rdatainfo</type>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesstructures containing SIG resource records
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesassociated with those records.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesThe members
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<constant>rri_rdclass</constant>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesand
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<constant>rri_rdtype</constant>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesare copied from the parameters.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<constant>rri_ttl</constant>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesand
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<constant>rri_name</constant>
ce22ce4743d79a889dca64df4459c598e2c188c7fuankgare properties of the obtained rrset.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesThe resource records contained in
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<constant>rri_rdatas</constant>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesand
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<constant>rri_sigs</constant>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesare in uncompressed DNS wire format.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesProperties of the rdataset are represented in the
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<constant>rri_flags</constant>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesbitfield. If the RRSET_VALIDATED bit is set, the data has been DNSSEC
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesvalidated and the signatures verified.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesAll of the information returned by
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<function>lwres_getrrsetbyname()</function>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesis dynamically allocated: the
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<constant>rrsetinfo</constant>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesand
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<constant>rdatainfo</constant>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesstructures,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesand the canonical host name strings pointed to by the
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<constant>rrsetinfo</constant>structure.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
ce22ce4743d79a889dca64df4459c598e2c188c7fuankgMemory allocated for the dynamically allocated structures created by
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesa successful call to
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<function>lwres_getrrsetbyname()</function>
ce22ce4743d79a889dca64df4459c598e2c188c7fuankgis released by
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<function>lwres_freerrset()</function>.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
6c080a25f5991f40225209541c989d7e76c4a39dbnicholes<parameter>rrset</parameter>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesis a pointer to a
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<type>struct rrset</type>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholescreated by a call to
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<function>lwres_getrrsetbyname()</function>.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
b387b9d37fc71c534f4718777454a8f5a1169017fuankg</para>
41022996c916eb4ab2ec3204eb491b64779eb100bnicholes<para>
41022996c916eb4ab2ec3204eb491b64779eb100bnicholes</para>
41022996c916eb4ab2ec3204eb491b64779eb100bnicholes</refsect1>
41022996c916eb4ab2ec3204eb491b64779eb100bnicholes<refsect1>
41022996c916eb4ab2ec3204eb491b64779eb100bnicholes<title>RETURN VALUES</title>
036436f4f4cdcd76186c0058891216545967043bbnicholes<para>
41022996c916eb4ab2ec3204eb491b64779eb100bnicholes<function>lwres_getrrsetbyname()</function>
41022996c916eb4ab2ec3204eb491b64779eb100bnicholesreturns zero on success, and one of the following error
bb2b38cd44b032118359afbc743efbea12f48e61bnicholescodes if an error occurred:
ce22ce4743d79a889dca64df4459c598e2c188c7fuankg<variablelist>
0662ed52e814f8f08ef0e09956413a792584eddffuankg
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<varlistentry><term><constant>ERRSET_NONAME</constant></term>
ce22ce4743d79a889dca64df4459c598e2c188c7fuankg<listitem><para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesthe name does not exist
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</para></listitem></varlistentry>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<varlistentry><term><constant>ERRSET_NODATA</constant></term>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<listitem><para>
ce22ce4743d79a889dca64df4459c598e2c188c7fuankgthe name exists, but does not have data of the desired type
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</para></listitem></varlistentry>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<varlistentry><term><constant>ERRSET_NOMEMORY</constant></term>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<listitem><para>
0662ed52e814f8f08ef0e09956413a792584eddffuankgmemory could not be allocated
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</para></listitem></varlistentry>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<varlistentry><term><constant>ERRSET_INVAL</constant></term>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<listitem><para>
0662ed52e814f8f08ef0e09956413a792584eddffuankga parameter is invalid
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</para></listitem></varlistentry>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<varlistentry><term><constant>ERRSET_FAIL</constant></term>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<listitem><para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesother failure
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</para></listitem></varlistentry>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<varlistentry><term><constant></constant></term>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<listitem><para>
ce22ce4743d79a889dca64df4459c598e2c188c7fuankg</para></listitem></varlistentry>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</variablelist>
ce22ce4743d79a889dca64df4459c598e2c188c7fuankg
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</refsect1>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<refsect1>
ce22ce4743d79a889dca64df4459c598e2c188c7fuankg<title>SEE ALSO</title>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<citerefentry>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<refentrytitle>lwres</refentrytitle><manvolnum>3</manvolnum>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</citerefentry>.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</para>
b387b9d37fc71c534f4718777454a8f5a1169017fuankg
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</refsect1>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</refentry>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes