lwres_getrrsetbyname.docbook revision c1a883f2e04d94e99c433b1f6cfd0c0338f4ed85
791N/A<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
791N/A "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
791N/A [<!ENTITY mdash "&#8212;">]>
791N/A<!--
943N/A - Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
791N/A - Copyright (C) 2000, 2001 Internet Software Consortium.
791N/A -
919N/A - Permission to use, copy, modify, and distribute this software for any
919N/A - purpose with or without fee is hereby granted, provided that the above
919N/A - copyright notice and this permission notice appear in all copies.
919N/A -
919N/A - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
919N/A - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
919N/A - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
919N/A - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
919N/A - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
919N/A - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
919N/A - PERFORMANCE OF THIS SOFTWARE.
919N/A-->
919N/A
919N/A<!-- $Id: lwres_getrrsetbyname.docbook,v 1.9 2007/01/29 23:57:22 marka Exp $ -->
919N/A<refentry>
919N/A
919N/A <refentryinfo>
791N/A <date>Oct 18, 2000</date>
791N/A </refentryinfo>
791N/A
791N/A <refmeta>
1035N/A <refentrytitle>lwres_getrrsetbyname</refentrytitle>
791N/A <manvolnum>3</manvolnum>
970N/A <refmiscinfo>BIND9</refmiscinfo>
970N/A </refmeta>
970N/A
970N/A <docinfo>
970N/A <copyright>
970N/A <year>2004</year>
970N/A <year>2005</year>
970N/A <year>2007</year>
970N/A <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
970N/A </copyright>
1033N/A <copyright>
970N/A <year>2000</year>
970N/A <year>2001</year>
970N/A <holder>Internet Software Consortium.</holder>
970N/A </copyright>
1003N/A </docinfo>
970N/A
791N/A <refnamediv>
1033N/A <refname>lwres_getrrsetbyname</refname>
791N/A <refname>lwres_freerrset</refname>
911N/A <refpurpose>retrieve DNS records</refpurpose>
1033N/A </refnamediv>
1033N/A <refsynopsisdiv>
911N/A <funcsynopsis>
791N/A<funcsynopsisinfo>#include &lt;lwres/netdb.h&gt;</funcsynopsisinfo>
791N/A<funcprototype>
791N/A <funcdef>
791N/Aint
791N/A<function>lwres_getrrsetbyname</function></funcdef>
1033N/A <paramdef>const char *<parameter>hostname</parameter></paramdef>
791N/A <paramdef>unsigned int <parameter>rdclass</parameter></paramdef>
791N/A <paramdef>unsigned int <parameter>rdtype</parameter></paramdef>
791N/A <paramdef>unsigned int <parameter>flags</parameter></paramdef>
1035N/A <paramdef>struct rrsetinfo **<parameter>res</parameter></paramdef>
1035N/A </funcprototype>
791N/A<funcprototype>
1033N/A <funcdef>
791N/Avoid
791N/A<function>lwres_freerrset</function></funcdef>
791N/A <paramdef>struct rrsetinfo *<parameter>rrset</parameter></paramdef>
1033N/A </funcprototype>
791N/A</funcsynopsis>
791N/A
791N/A <para>
791N/A The following structures are used:
791N/A </para>
791N/A <para><programlisting>
1033N/Astruct rdatainfo {
1033N/A unsigned int rdi_length; /* length of data */
791N/A unsigned char *rdi_data; /* record data */
791N/A};
791N/A</programlisting>
1033N/A </para>
791N/A <para><programlisting>
791N/Astruct rrsetinfo {
791N/A unsigned int rri_flags; /* RRSET_VALIDATED... */
791N/A unsigned int rri_rdclass; /* class number */
791N/A unsigned int rri_rdtype; /* RR type number */
791N/A unsigned int rri_ttl; /* time to live */
791N/A unsigned int rri_nrdatas; /* size of rdatas array */
791N/A unsigned int rri_nsigs; /* size of sigs array */
791N/A char *rri_name; /* canonical name */
1033N/A struct rdatainfo *rri_rdatas; /* individual records */
1033N/A struct rdatainfo *rri_sigs; /* individual signatures */
1033N/A};
791N/A</programlisting>
791N/A </para>
791N/A </refsynopsisdiv>
791N/A
791N/A <refsect1>
791N/A <title>DESCRIPTION</title>
1033N/A <para><function>lwres_getrrsetbyname()</function>
791N/A gets a set of resource records associated with a
791N/A <parameter>hostname</parameter>, <parameter>class</parameter>,
791N/A and <parameter>type</parameter>.
791N/A <parameter>hostname</parameter> is a pointer a to
1033N/A null-terminated string. The <parameter>flags</parameter> field
791N/A is currently unused and must be zero.
791N/A </para>
1033N/A <para>
1033N/A After a successful call to
791N/A <function>lwres_getrrsetbyname()</function>,
791N/A <parameter>*res</parameter> is a pointer to an
801N/A <type>rrsetinfo</type> structure, containing a list of one or
791N/A more <type>rdatainfo</type> structures containing resource
791N/A records and potentially another list of <type>rdatainfo</type>
1033N/A structures containing SIG resource records associated with those
791N/A records. The members <constant>rri_rdclass</constant> and
791N/A <constant>rri_rdtype</constant> are copied from the parameters.
1033N/A <constant>rri_ttl</constant> and <constant>rri_name</constant>
791N/A are properties of the obtained rrset. The resource records
791N/A contained in <constant>rri_rdatas</constant> and
791N/A <constant>rri_sigs</constant> are in uncompressed DNS wire
791N/A format. Properties of the rdataset are represented in the
791N/A <constant>rri_flags</constant> bitfield. If the RRSET_VALIDATED
1033N/A bit is set, the data has been DNSSEC validated and the
1033N/A signatures verified.
791N/A </para>
791N/A <para>
791N/A All of the information returned by
791N/A <function>lwres_getrrsetbyname()</function> is dynamically
allocated: the <constant>rrsetinfo</constant> and
<constant>rdatainfo</constant> structures, and the canonical
host name strings pointed to by the
<constant>rrsetinfo</constant>structure.
Memory allocated for the dynamically allocated structures
created by a successful call to
<function>lwres_getrrsetbyname()</function> is released by
<function>lwres_freerrset()</function>.
<parameter>rrset</parameter> is a pointer to a <type>struct
rrset</type> created by a call to
<function>lwres_getrrsetbyname()</function>.
</para>
<para></para>
</refsect1>
<refsect1>
<title>RETURN VALUES</title>
<para><function>lwres_getrrsetbyname()</function>
returns zero on success, and one of the following error codes if
an error occurred:
<variablelist>
<varlistentry>
<term><constant>ERRSET_NONAME</constant></term>
<listitem>
<para>
the name does not exist
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>ERRSET_NODATA</constant></term>
<listitem>
<para>
the name exists, but does not have data of the desired type
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>ERRSET_NOMEMORY</constant></term>
<listitem>
<para>
memory could not be allocated
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>ERRSET_INVAL</constant></term>
<listitem>
<para>
a parameter is invalid
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>ERRSET_FAIL</constant></term>
<listitem>
<para>
other failure
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant/></term>
<listitem>
<para></para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1>
<title>SEE ALSO</title>
<para><citerefentry>
<refentrytitle>lwres</refentrytitle><manvolnum>3</manvolnum>
</citerefentry>.
</para>
</refsect1>
</refentry><!--
- Local variables:
- mode: sgml
- End:
-->