lwres_getrrsetbyname.docbook revision 938440694b33cd752e9e4b71a526368b4811c177
5cd4555ad444fd391002ae32450572054369fd42Rob Austein<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
5cd4555ad444fd391002ae32450572054369fd42Rob Austein "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein [<!ENTITY mdash "—">]>
938440694b33cd752e9e4b71a526368b4811c177Tinderbox User - Copyright (C) 2004, 2005, 2007, 2014 Internet Systems Consortium, Inc. ("ISC")
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews - Copyright (C) 2000, 2001 Internet Software Consortium.
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater - Permission to use, copy, modify, and/or distribute this software for any
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson - purpose with or without fee is hereby granted, provided that the above
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson - copyright notice and this permission notice appear in all copies.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - PERFORMANCE OF THIS SOFTWARE.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <refentryinfo>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein </refentryinfo>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <refentrytitle>lwres_getrrsetbyname</refentrytitle>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein </copyright>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein </copyright>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <refnamediv>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein </refnamediv>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <refsynopsisdiv>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <funcsynopsis>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<funcsynopsisinfo>#include <lwres/netdb.h></funcsynopsisinfo>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<funcprototype>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<function>lwres_getrrsetbyname</function></funcdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <paramdef>const char *<parameter>hostname</parameter></paramdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <paramdef>unsigned int <parameter>rdclass</parameter></paramdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <paramdef>unsigned int <parameter>rdtype</parameter></paramdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <paramdef>unsigned int <parameter>flags</parameter></paramdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <paramdef>struct rrsetinfo **<parameter>res</parameter></paramdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein </funcprototype>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<funcprototype>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<function>lwres_freerrset</function></funcdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <paramdef>struct rrsetinfo *<parameter>rrset</parameter></paramdef>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein </funcprototype>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson</funcsynopsis>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein The following structures are used:
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonstruct rdatainfo {
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson unsigned int rdi_length; /* length of data */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson unsigned char *rdi_data; /* record data */
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein</programlisting>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonstruct rrsetinfo {
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson unsigned int rri_flags; /* RRSET_VALIDATED... */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson unsigned int rri_rdclass; /* class number */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson unsigned int rri_rdtype; /* RR type number */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson unsigned int rri_ttl; /* time to live */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson unsigned int rri_nrdatas; /* size of rdatas array */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson unsigned int rri_nsigs; /* size of sigs array */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson char *rri_name; /* canonical name */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson struct rdatainfo *rri_rdatas; /* individual records */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson struct rdatainfo *rri_sigs; /* individual signatures */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson</programlisting>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein </refsynopsisdiv>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <para><function>lwres_getrrsetbyname()</function>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein gets a set of resource records associated with a
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <parameter>hostname</parameter>, <parameter>class</parameter>,
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <parameter>hostname</parameter> is a pointer a to
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein null-terminated string. The <parameter>flags</parameter> field
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein is currently unused and must be zero.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein After a successful call to
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <type>rrsetinfo</type> structure, containing a list of one or
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein more <type>rdatainfo</type> structures containing resource
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein records and potentially another list of <type>rdatainfo</type>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein structures containing SIG resource records associated with those
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein records. The members <constant>rri_rdclass</constant> and
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <constant>rri_rdtype</constant> are copied from the parameters.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <constant>rri_ttl</constant> and <constant>rri_name</constant>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein are properties of the obtained rrset. The resource records
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein contained in <constant>rri_rdatas</constant> and
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <constant>rri_sigs</constant> are in uncompressed DNS wire
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein format. Properties of the rdataset are represented in the
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <constant>rri_flags</constant> bitfield. If the RRSET_VALIDATED
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein bit is set, the data has been DNSSEC validated and the
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein signatures verified.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein All of the information returned by
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <function>lwres_getrrsetbyname()</function> is dynamically
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein allocated: the <constant>rrsetinfo</constant> and
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <constant>rdatainfo</constant> structures, and the canonical
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein host name strings pointed to by the
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein Memory allocated for the dynamically allocated structures
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein created by a successful call to
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <function>lwres_getrrsetbyname()</function> is released by
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <parameter>rrset</parameter> is a pointer to a <type>struct
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein rrset</type> created by a call to
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <para><function>lwres_getrrsetbyname()</function>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein returns zero on success, and one of the following error codes if
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein an error occurred:
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <variablelist>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <varlistentry>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein the name does not exist
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein </varlistentry>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <varlistentry>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein the name exists, but does not have data of the desired type
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein </varlistentry>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <varlistentry>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <term><constant>ERRSET_NOMEMORY</constant></term>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein memory could not be allocated
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein </varlistentry>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <varlistentry>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein a parameter is invalid
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein </varlistentry>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <varlistentry>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein other failure
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein </varlistentry>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <varlistentry>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein </varlistentry>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein </variablelist>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein <refentrytitle>lwres</refentrytitle><manvolnum>3</manvolnum>
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein </citerefentry>.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein - Local variables:
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein - mode: sgml