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