lwres_getrrsetbyname.docbook revision dafcb997e390efa4423883dafd100c975c4095d6
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews - Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington - Copyright (C) 2001 Internet Software Consortium.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson - Permission to use, copy, modify, and 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.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews<!-- $Id: lwres_getrrsetbyname.docbook,v 1.4 2004/03/05 05:12:57 marka Exp $ -->
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson</refentryinfo>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<refentrytitle>lwres_getrrsetbyname</refentrytitle>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<refpurpose>retrieve DNS records</refpurpose>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<refsynopsisdiv>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<funcsynopsisinfo>#include <lwres/netdb.h></funcsynopsisinfo>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<funcprototype>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<function>lwres_getrrsetbyname</function></funcdef>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<paramdef>struct rrsetinfo **res</paramdef>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson</funcprototype>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<funcprototype>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<function>lwres_freerrset</function></funcdef>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<paramdef>struct rrsetinfo *rrset</paramdef>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson</funcprototype>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson</funcsynopsis>
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonThe following structures are used:
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<programlisting>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonstruct rdatainfo {
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson unsigned int rdi_length; /* length of data */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson unsigned char *rdi_data; /* record data */
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>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson</refsynopsisdiv>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<function>lwres_getrrsetbyname()</function>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssongets a set of resource records associated with a
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssona pointer a to null-terminated string. The
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonfield is currently unused and must be zero.
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonAfter a successful call to
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<function>lwres_getrrsetbyname()</function>,
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonis a pointer to an
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonstructure, containing a list of one or more
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonstructures containing resource records and potentially another list of
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonstructures containing SIG resource records
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonassociated with those records.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonare copied from the parameters.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonare properties of the obtained rrset.
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonThe resource records contained in
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonare in uncompressed DNS wire format.
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonProperties of the rdataset are represented in the
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonbitfield. If the RRSET_VALIDATED bit is set, the data has been DNSSEC
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonvalidated and the signatures verified.
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonAll of the information returned by
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<function>lwres_getrrsetbyname()</function>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonis dynamically allocated: the
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonand the canonical host name strings pointed to by the
ddccd5811feff696ba460dabfb666ce61040f545Andreas GustafssonMemory allocated for the dynamically allocated structures created by
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssona successful call to
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<function>lwres_getrrsetbyname()</function>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonis a pointer to a
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssoncreated by a call to
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<function>lwres_getrrsetbyname()</function>.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<function>lwres_getrrsetbyname()</function>
47ad4fad771b9c570bcf57793d6a931e0ca9856cAndreas Gustafssonreturns zero on success, and one of the following error
47ad4fad771b9c570bcf57793d6a931e0ca9856cAndreas Gustafssoncodes if an error occurred:
47ad4fad771b9c570bcf57793d6a931e0ca9856cAndreas Gustafsson<varlistentry><term><constant>ERRSET_NONAME</constant></term>
47ad4fad771b9c570bcf57793d6a931e0ca9856cAndreas Gustafssonthe name does not exist
47ad4fad771b9c570bcf57793d6a931e0ca9856cAndreas Gustafsson<varlistentry><term><constant>ERRSET_NODATA</constant></term>
47ad4fad771b9c570bcf57793d6a931e0ca9856cAndreas Gustafssonthe name exists, but does not have data of the desired type
47ad4fad771b9c570bcf57793d6a931e0ca9856cAndreas Gustafsson<varlistentry><term><constant>ERRSET_NOMEMORY</constant></term>
47ad4fad771b9c570bcf57793d6a931e0ca9856cAndreas Gustafssonmemory could not be allocated
47ad4fad771b9c570bcf57793d6a931e0ca9856cAndreas Gustafsson<varlistentry><term><constant>ERRSET_INVAL</constant></term>
47ad4fad771b9c570bcf57793d6a931e0ca9856cAndreas Gustafssona parameter is invalid
47ad4fad771b9c570bcf57793d6a931e0ca9856cAndreas Gustafsson<varlistentry><term><constant>ERRSET_FAIL</constant></term>
47ad4fad771b9c570bcf57793d6a931e0ca9856cAndreas Gustafsson<varlistentry><term><constant></constant></term>
47ad4fad771b9c570bcf57793d6a931e0ca9856cAndreas Gustafsson</variablelist>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<refentrytitle>lwres</refentrytitle><manvolnum>3</manvolnum>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson</citerefentry>.