lwres_getrrsetbyname.docbook revision 19c7b1a0293498a3e36692c59646ed6e15ffc8d0
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd - Copyright (C) 2004, 2005, 2007, 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd - Copyright (C) 2000, 2001 Internet Software Consortium.
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd - Permission to use, copy, modify, and/or distribute this software for any
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd - purpose with or without fee is hereby granted, provided that the above
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd - copyright notice and this permission notice appear in all copies.
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd - PERFORMANCE OF THIS SOFTWARE.
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd<!-- Converted by db4-upgrade version 1.0 -->
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd<refentry xmlns="http://docbook.org/ns/docbook" version="5.0">
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <refentryinfo>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <corpauthor>Internet Systems Consortium, Inc.</corpauthor>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd </refentryinfo>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd </refmeta>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <copyright>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd </copyright>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <copyright>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd </copyright>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd </docinfo>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <refnamediv>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd </refnamediv>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <refsynopsisdiv>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <funcsynopsis>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd<funcsynopsisinfo>#include <lwres/netdb.h></funcsynopsisinfo>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd<funcprototype>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <paramdef>const char *<parameter>hostname</parameter></paramdef>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <paramdef>unsigned int <parameter>rdclass</parameter></paramdef>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <paramdef>unsigned int <parameter>rdtype</parameter></paramdef>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <paramdef>unsigned int <parameter>flags</parameter></paramdef>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <paramdef>struct rrsetinfo **<parameter>res</parameter></paramdef>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd </funcprototype>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd<funcprototype>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <paramdef>struct rrsetinfo *<parameter>rrset</parameter></paramdef>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd </funcprototype>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd</funcsynopsis>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd The following structures are used:
53a17e7ebf0eec94856bc1c63d4bee52c412f662ndstruct rdatainfo {
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd unsigned int rdi_length; /* length of data */
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd unsigned char *rdi_data; /* record data */
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd</programlisting>
53a17e7ebf0eec94856bc1c63d4bee52c412f662ndstruct rrsetinfo {
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd unsigned int rri_flags; /* RRSET_VALIDATED... */
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd unsigned int rri_rdclass; /* class number */
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd unsigned int rri_rdtype; /* RR type number */
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd unsigned int rri_ttl; /* time to live */
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd unsigned int rri_nrdatas; /* size of rdatas array */
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd unsigned int rri_nsigs; /* size of sigs array */
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd char *rri_name; /* canonical name */
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd struct rdatainfo *rri_rdatas; /* individual records */
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd struct rdatainfo *rri_sigs; /* individual signatures */
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd</programlisting>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd </refsynopsisdiv>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd gets a set of resource records associated with a
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <parameter>hostname</parameter>, <parameter>class</parameter>,
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd null-terminated string. The <parameter>flags</parameter> field
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd is currently unused and must be zero.
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd After a successful call to
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <type>rrsetinfo</type> structure, containing a list of one or
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd more <type>rdatainfo</type> structures containing resource
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd records and potentially another list of <type>rdatainfo</type>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd structures containing SIG resource records associated with those
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd records. The members <constant>rri_rdclass</constant> and
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <constant>rri_rdtype</constant> are copied from the parameters.
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <constant>rri_ttl</constant> and <constant>rri_name</constant>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd are properties of the obtained rrset. The resource records
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <constant>rri_sigs</constant> are in uncompressed DNS wire
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd format. Properties of the rdataset are represented in the
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <constant>rri_flags</constant> bitfield. If the RRSET_VALIDATED
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd bit is set, the data has been DNSSEC validated and the
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd signatures verified.
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd All of the information returned by
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <function>lwres_getrrsetbyname()</function> is dynamically
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <constant>rdatainfo</constant> structures, and the canonical
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd host name strings pointed to by the
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd Memory allocated for the dynamically allocated structures
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd created by a successful call to
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <function>lwres_getrrsetbyname()</function> is released by
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <parameter>rrset</parameter> is a pointer to a <type>struct
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd rrset</type> created by a call to
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd </refsection>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd returns zero on success, and one of the following error codes if
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd an error occurred:
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <variablelist>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <varlistentry>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <listitem>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd the name does not exist
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd </listitem>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd </varlistentry>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <varlistentry>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <listitem>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd the name exists, but does not have data of the desired type
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd </listitem>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd </varlistentry>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <varlistentry>
53a17e7ebf0eec94856bc1c63d4bee52c412f662nd <listitem>
ea981941b1e5ecfb1a27b9e9aff32b9c98640ed9nd memory could not be allocated
ea981941b1e5ecfb1a27b9e9aff32b9c98640ed9nd </listitem>
ea981941b1e5ecfb1a27b9e9aff32b9c98640ed9nd </varlistentry>
ea981941b1e5ecfb1a27b9e9aff32b9c98640ed9nd <varlistentry>
ea981941b1e5ecfb1a27b9e9aff32b9c98640ed9nd <listitem>
ea981941b1e5ecfb1a27b9e9aff32b9c98640ed9nd a parameter is invalid
ea981941b1e5ecfb1a27b9e9aff32b9c98640ed9nd </listitem>
ea981941b1e5ecfb1a27b9e9aff32b9c98640ed9nd </varlistentry>
ea981941b1e5ecfb1a27b9e9aff32b9c98640ed9nd <varlistentry>
ea981941b1e5ecfb1a27b9e9aff32b9c98640ed9nd <listitem>
ea981941b1e5ecfb1a27b9e9aff32b9c98640ed9nd other failure
ea981941b1e5ecfb1a27b9e9aff32b9c98640ed9nd </listitem>
ea981941b1e5ecfb1a27b9e9aff32b9c98640ed9nd </varlistentry>
ea981941b1e5ecfb1a27b9e9aff32b9c98640ed9nd <varlistentry>
1d76334bbce94162d9135b43b7d2517ab6f9ffacstoddard </listitem>
1d76334bbce94162d9135b43b7d2517ab6f9ffacstoddard </varlistentry>
1d76334bbce94162d9135b43b7d2517ab6f9ffacstoddard </variablelist>
1d76334bbce94162d9135b43b7d2517ab6f9ffacstoddard </refsection>
1d76334bbce94162d9135b43b7d2517ab6f9ffacstoddard <refentrytitle>lwres</refentrytitle><manvolnum>3</manvolnum>
1d76334bbce94162d9135b43b7d2517ab6f9ffacstoddard </citerefentry>.
1d76334bbce94162d9135b43b7d2517ab6f9ffacstoddard </refsection>