lwres_getrrsetbyname.docbook revision 83a28ca274521e15086fc39febde507bcc4e145e
2086N/A<!--
2086N/A - Copyright (C) 2000, 2001, 2004, 2005, 2007, 2014-2016 Internet Systems Consortium, Inc. ("ISC")
2086N/A -
2086N/A - This Source Code Form is subject to the terms of the Mozilla Public
2086N/A - License, v. 2.0. If a copy of the MPL was not distributed with this
2086N/A - file, You can obtain one at http://mozilla.org/MPL/2.0/.
2086N/A-->
6983N/A
6983N/A<!-- Converted by db4-upgrade version 1.0 -->
2086N/A<refentry xmlns:db="http://docbook.org/ns/docbook" version="5.0">
2086N/A <info>
2086N/A <date>2007-06-18</date>
2086N/A </info>
6983N/A <refentryinfo>
6983N/A <corpname>ISC</corpname>
6983N/A <corpauthor>Internet Systems Consortium, Inc.</corpauthor>
6983N/A </refentryinfo>
2086N/A
2086N/A <refmeta>
2086N/A <refentrytitle>lwres_getrrsetbyname</refentrytitle>
2086N/A <manvolnum>3</manvolnum>
5199N/A <refmiscinfo>BIND9</refmiscinfo>
5303N/A </refmeta>
7044N/A
2086N/A <docinfo>
2086N/A <copyright>
2086N/A <year>2000</year>
2086N/A <year>2001</year>
2086N/A <year>2004</year>
2086N/A <year>2005</year>
2086N/A <year>2007</year>
2086N/A <year>2014</year>
2086N/A <year>2015</year>
2086N/A <year>2016</year>
2086N/A <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
2086N/A </copyright>
2086N/A </docinfo>
2086N/A
2086N/A <refnamediv>
2086N/A <refname>lwres_getrrsetbyname</refname>
2086N/A <refname>lwres_freerrset</refname>
2086N/A <refpurpose>retrieve DNS records</refpurpose>
2086N/A </refnamediv>
2086N/A <refsynopsisdiv>
2086N/A <funcsynopsis>
2086N/A<funcsynopsisinfo>#include &lt;lwres/netdb.h&gt;</funcsynopsisinfo>
2086N/A<funcprototype>
2086N/A <funcdef>
2086N/Aint
2086N/A<function>lwres_getrrsetbyname</function></funcdef>
2086N/A <paramdef>const char *<parameter>hostname</parameter></paramdef>
2086N/A <paramdef>unsigned int <parameter>rdclass</parameter></paramdef>
2086N/A <paramdef>unsigned int <parameter>rdtype</parameter></paramdef>
2086N/A <paramdef>unsigned int <parameter>flags</parameter></paramdef>
2086N/A <paramdef>struct rrsetinfo **<parameter>res</parameter></paramdef>
2086N/A </funcprototype>
2086N/A<funcprototype>
2086N/A <funcdef>
2086N/Avoid
2086N/A<function>lwres_freerrset</function></funcdef>
2086N/A <paramdef>struct rrsetinfo *<parameter>rrset</parameter></paramdef>
2086N/A </funcprototype>
2086N/A</funcsynopsis>
2086N/A
2086N/A <para>
2960N/A The following structures are used:
2086N/A </para>
2086N/A <para><programlisting>
2960N/Astruct rdatainfo {
2086N/A unsigned int rdi_length; /* length of data */
2086N/A unsigned char *rdi_data; /* record data */
2960N/A};
2086N/A</programlisting>
2086N/A </para>
2960N/A <para><programlisting>
2960N/Astruct rrsetinfo {
2960N/A unsigned int rri_flags; /* RRSET_VALIDATED... */
2960N/A unsigned int rri_rdclass; /* class number */
2960N/A unsigned int rri_rdtype; /* RR type number */
2960N/A unsigned int rri_ttl; /* time to live */
2086N/A unsigned int rri_nrdatas; /* size of rdatas array */
2960N/A unsigned int rri_nsigs; /* size of sigs array */
2086N/A char *rri_name; /* canonical name */
2960N/A struct rdatainfo *rri_rdatas; /* individual records */
2960N/A struct rdatainfo *rri_sigs; /* individual signatures */
2960N/A};
2086N/A</programlisting>
2086N/A </para>
2960N/A </refsynopsisdiv>
2086N/A
2086N/A <refsection><info><title>DESCRIPTION</title></info>
2960N/A
2086N/A <para><function>lwres_getrrsetbyname()</function>
2960N/A gets a set of resource records associated with a
2960N/A <parameter>hostname</parameter>, <parameter>class</parameter>,
2086N/A and <parameter>type</parameter>.
2086N/A <parameter>hostname</parameter> is a pointer a to
2960N/A null-terminated string. The <parameter>flags</parameter> field
2086N/A is currently unused and must be zero.
2086N/A </para>
2960N/A <para>
2086N/A After a successful call to
2086N/A <function>lwres_getrrsetbyname()</function>,
2960N/A <parameter>*res</parameter> is a pointer to an
2086N/A <type>rrsetinfo</type> structure, containing a list of one or
2086N/A more <type>rdatainfo</type> structures containing resource
2960N/A records and potentially another list of <type>rdatainfo</type>
2960N/A structures containing SIG resource records associated with those
2086N/A records. The members <constant>rri_rdclass</constant> and
2960N/A <constant>rri_rdtype</constant> are copied from the parameters.
2960N/A <constant>rri_ttl</constant> and <constant>rri_name</constant>
2960N/A are properties of the obtained rrset. The resource records
2086N/A contained in <constant>rri_rdatas</constant> and
2960N/A <constant>rri_sigs</constant> are in uncompressed DNS wire
2086N/A format. Properties of the rdataset are represented in the
2086N/A <constant>rri_flags</constant> bitfield. If the RRSET_VALIDATED
2960N/A bit is set, the data has been DNSSEC validated and the
2960N/A signatures verified.
2086N/A </para>
2960N/A <para>
2960N/A All of the information returned by
2960N/A <function>lwres_getrrsetbyname()</function> is dynamically
2086N/A allocated: the <constant>rrsetinfo</constant> and
2960N/A <constant>rdatainfo</constant> structures, and the canonical
2086N/A host name strings pointed to by the
2086N/A <constant>rrsetinfo</constant>structure.
2086N/A
2960N/A Memory allocated for the dynamically allocated structures
2086N/A created by a successful call to
2086N/A <function>lwres_getrrsetbyname()</function> is released by
2960N/A <function>lwres_freerrset()</function>.
2960N/A
4381N/A <parameter>rrset</parameter> is a pointer to a <type>struct
2960N/A rrset</type> created by a call to
2960N/A <function>lwres_getrrsetbyname()</function>.
2086N/A </para>
2086N/A <para/>
2960N/A </refsection>
2086N/A <refsection><info><title>RETURN VALUES</title></info>
2086N/A
2960N/A <para><function>lwres_getrrsetbyname()</function>
2960N/A returns zero on success, and one of the following error codes if
2960N/A an error occurred:
2960N/A <variablelist>
2960N/A
2960N/A <varlistentry>
2960N/A <term><constant>ERRSET_NONAME</constant></term>
2960N/A <listitem>
2086N/A <para>
2960N/A the name does not exist
2086N/A </para>
2086N/A </listitem>
2086N/A </varlistentry>
2960N/A
2086N/A <varlistentry>
2086N/A <term><constant>ERRSET_NODATA</constant></term>
2086N/A <listitem>
2960N/A <para>
2086N/A the name exists, but does not have data of the desired type
2086N/A </para>
2960N/A </listitem>
2960N/A </varlistentry>
2960N/A
2086N/A <varlistentry>
2086N/A <term><constant>ERRSET_NOMEMORY</constant></term>
2960N/A <listitem>
2086N/A <para>
2086N/A memory could not be allocated
2086N/A </para>
2960N/A </listitem>
2086N/A </varlistentry>
2086N/A
2960N/A <varlistentry>
2960N/A <term><constant>ERRSET_INVAL</constant></term>
2960N/A <listitem>
2960N/A <para>
2960N/A a parameter is invalid
2960N/A </para>
2960N/A </listitem>
2086N/A </varlistentry>
2960N/A
2086N/A <varlistentry>
2086N/A <term><constant>ERRSET_FAIL</constant></term>
2086N/A <listitem>
2086N/A <para>
2086N/A other failure
2086N/A </para>
2086N/A </listitem>
2086N/A </varlistentry>
2086N/A
2086N/A <varlistentry>
2086N/A <term><constant/></term>
2086N/A <listitem>
2086N/A <para/>
2086N/A </listitem>
2086N/A </varlistentry>
2086N/A
2086N/A </variablelist>
2086N/A
2086N/A </para>
2086N/A </refsection>
2086N/A <refsection><info><title>SEE ALSO</title></info>
2086N/A
2086N/A <para><citerefentry>
2086N/A <refentrytitle>lwres</refentrytitle><manvolnum>3</manvolnum>
2086N/A </citerefentry>.
2086N/A </para>
2086N/A
2086N/A </refsection>
2086N/A</refentry>
2086N/A