lwres_getrrsetbyname.docbook revision 19c7b1a0293498a3e36692c59646ed6e15ffc8d0
10139N/A<!--
10139N/A - Copyright (C) 2004, 2005, 2007, 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
10139N/A - Copyright (C) 2000, 2001 Internet Software Consortium.
10139N/A -
10139N/A - Permission to use, copy, modify, and/or distribute this software for any
10139N/A - purpose with or without fee is hereby granted, provided that the above
10139N/A - copyright notice and this permission notice appear in all copies.
11904N/A -
10139N/A - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10139N/A - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10139N/A - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
10139N/A - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
10139N/A - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
10139N/A - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
11904N/A - PERFORMANCE OF THIS SOFTWARE.
10139N/A-->
10139N/A
10139N/A<!-- Converted by db4-upgrade version 1.0 -->
10139N/A<refentry xmlns="http://docbook.org/ns/docbook" version="5.0">
10139N/A <info>
10139N/A <date>2007-06-18</date>
10139N/A </info>
10139N/A <refentryinfo>
10139N/A <corpname>ISC</corpname>
10139N/A <corpauthor>Internet Systems Consortium, Inc.</corpauthor>
11904N/A </refentryinfo>
11904N/A
11904N/A <refmeta>
10139N/A <refentrytitle>lwres_getrrsetbyname</refentrytitle>
10139N/A <manvolnum>3</manvolnum>
10139N/A <refmiscinfo>BIND9</refmiscinfo>
11904N/A </refmeta>
11904N/A
10139N/A <docinfo>
10139N/A <copyright>
11904N/A <year>2004</year>
11904N/A <year>2005</year>
11904N/A <year>2007</year>
10139N/A <year>2014</year>
10139N/A <year>2015</year>
10139N/A <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
10139N/A </copyright>
11904N/A <copyright>
11904N/A <year>2000</year>
11904N/A <year>2001</year>
11904N/A <holder>Internet Software Consortium.</holder>
11904N/A </copyright>
11904N/A </docinfo>
11904N/A
11904N/A <refnamediv>
11904N/A <refname>lwres_getrrsetbyname</refname>
11904N/A <refname>lwres_freerrset</refname>
11904N/A <refpurpose>retrieve DNS records</refpurpose>
10139N/A </refnamediv>
10139N/A <refsynopsisdiv>
10139N/A <funcsynopsis>
10139N/A<funcsynopsisinfo>#include &lt;lwres/netdb.h&gt;</funcsynopsisinfo>
10139N/A<funcprototype>
10139N/A <funcdef>
10139N/Aint
10139N/A<function>lwres_getrrsetbyname</function></funcdef>
10139N/A <paramdef>const char *<parameter>hostname</parameter></paramdef>
10139N/A <paramdef>unsigned int <parameter>rdclass</parameter></paramdef>
10139N/A <paramdef>unsigned int <parameter>rdtype</parameter></paramdef>
10139N/A <paramdef>unsigned int <parameter>flags</parameter></paramdef>
10139N/A <paramdef>struct rrsetinfo **<parameter>res</parameter></paramdef>
10139N/A </funcprototype>
10139N/A<funcprototype>
10139N/A <funcdef>
10139N/Avoid
10139N/A<function>lwres_freerrset</function></funcdef>
10139N/A <paramdef>struct rrsetinfo *<parameter>rrset</parameter></paramdef>
10139N/A </funcprototype>
10139N/A</funcsynopsis>
10139N/A
10139N/A <para>
10139N/A The following structures are used:
10139N/A </para>
10139N/A <para><programlisting>
10139N/Astruct rdatainfo {
10139N/A unsigned int rdi_length; /* length of data */
10139N/A unsigned char *rdi_data; /* record data */
10139N/A};
10139N/A</programlisting>
10139N/A </para>
10139N/A <para><programlisting>
10139N/Astruct rrsetinfo {
10139N/A unsigned int rri_flags; /* RRSET_VALIDATED... */
10139N/A unsigned int rri_rdclass; /* class number */
10139N/A unsigned int rri_rdtype; /* RR type number */
10139N/A unsigned int rri_ttl; /* time to live */
10139N/A unsigned int rri_nrdatas; /* size of rdatas array */
10139N/A unsigned int rri_nsigs; /* size of sigs array */
10139N/A char *rri_name; /* canonical name */
10139N/A struct rdatainfo *rri_rdatas; /* individual records */
10139N/A struct rdatainfo *rri_sigs; /* individual signatures */
10139N/A};
10139N/A</programlisting>
10139N/A </para>
10139N/A </refsynopsisdiv>
10139N/A
10139N/A <refsection><info><title>DESCRIPTION</title></info>
10139N/A
10139N/A <para><function>lwres_getrrsetbyname()</function>
10139N/A gets a set of resource records associated with a
10139N/A <parameter>hostname</parameter>, <parameter>class</parameter>,
10139N/A and <parameter>type</parameter>.
10139N/A <parameter>hostname</parameter> is a pointer a to
10139N/A null-terminated string. The <parameter>flags</parameter> field
10139N/A is currently unused and must be zero.
10139N/A </para>
10139N/A <para>
10139N/A After a successful call to
10139N/A <function>lwres_getrrsetbyname()</function>,
11904N/A <parameter>*res</parameter> is a pointer to an
11904N/A <type>rrsetinfo</type> structure, containing a list of one or
11904N/A more <type>rdatainfo</type> structures containing resource
11904N/A records and potentially another list of <type>rdatainfo</type>
11904N/A structures containing SIG resource records associated with those
11904N/A records. The members <constant>rri_rdclass</constant> and
11904N/A <constant>rri_rdtype</constant> are copied from the parameters.
10139N/A <constant>rri_ttl</constant> and <constant>rri_name</constant>
10139N/A are properties of the obtained rrset. The resource records
10139N/A contained in <constant>rri_rdatas</constant> and
10139N/A <constant>rri_sigs</constant> are in uncompressed DNS wire
11904N/A format. Properties of the rdataset are represented in the
10139N/A <constant>rri_flags</constant> bitfield. If the RRSET_VALIDATED
10139N/A bit is set, the data has been DNSSEC validated and the
signatures verified.
</para>
<para>
All of the information returned by
<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/>
</refsection>
<refsection><info><title>RETURN VALUES</title></info>
<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/>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsection>
<refsection><info><title>SEE ALSO</title></info>
<para><citerefentry>
<refentrytitle>lwres</refentrytitle><manvolnum>3</manvolnum>
</citerefentry>.
</para>
</refsection>
</refentry>