791N/A<!
DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" 791N/A [<!ENTITY mdash "—">]>
943N/A - Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC") 791N/A - Copyright (C) 2000, 2001 Internet Software Consortium. 919N/A - Permission to use, copy, modify, and distribute this software for any 919N/A - purpose with or without fee is hereby granted, provided that the above 919N/A - copyright notice and this permission notice appear in all copies. 919N/A - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 919N/A - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 919N/A - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 919N/A - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 919N/A - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 919N/A - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 919N/A - PERFORMANCE OF THIS SOFTWARE. 791N/A <
date>Oct 18, 2000</
date>
1035N/A <
refentrytitle>lwres_getrrsetbyname</
refentrytitle>
791N/A <
manvolnum>3</
manvolnum>
970N/A <
refmiscinfo>BIND9</
refmiscinfo>
970N/A <
holder>Internet Systems Consortium, Inc. ("ISC")</
holder>
970N/A <
holder>Internet Software Consortium.</
holder>
1033N/A <
refname>lwres_getrrsetbyname</
refname>
791N/A <
refname>lwres_freerrset</
refname>
911N/A <
refpurpose>retrieve DNS records</
refpurpose>
791N/A<
function>lwres_getrrsetbyname</
function></
funcdef>
1033N/A <
paramdef>const char *<
parameter>hostname</
parameter></
paramdef>
791N/A <
paramdef>unsigned int <
parameter>rdclass</
parameter></
paramdef>
791N/A <
paramdef>unsigned int <
parameter>rdtype</
parameter></
paramdef>
791N/A <
paramdef>unsigned int <
parameter>flags</
parameter></
paramdef>
1035N/A <
paramdef>struct rrsetinfo **<
parameter>res</
parameter></
paramdef>
791N/A<
function>lwres_freerrset</
function></
funcdef>
791N/A <
paramdef>struct rrsetinfo *<
parameter>rrset</
parameter></
paramdef>
791N/A The following structures are used:
1033N/A unsigned int rdi_length; /* length of data */
791N/A unsigned char *rdi_data; /* record data */
791N/A unsigned int rri_flags; /* RRSET_VALIDATED... */
791N/A unsigned int rri_rdclass; /* class number */
791N/A unsigned int rri_rdtype; /* RR type number */
791N/A unsigned int rri_ttl; /* time to live */
791N/A unsigned int rri_nrdatas; /* size of rdatas array */
791N/A unsigned int rri_nsigs; /* size of sigs array */
791N/A char *rri_name; /* canonical name */
1033N/A struct rdatainfo *rri_rdatas; /* individual records */
1033N/A struct rdatainfo *rri_sigs; /* individual signatures */
791N/A <
title>DESCRIPTION</
title>
1033N/A <
para><
function>lwres_getrrsetbyname()</
function>
791N/A gets a set of resource records associated with a
791N/A <
parameter>hostname</
parameter>, <
parameter>class</
parameter>,
791N/A and <
parameter>type</
parameter>.
791N/A <
parameter>hostname</
parameter> is a pointer a to
1033N/A null-terminated string. The <
parameter>flags</
parameter> field
791N/A is currently unused and must be zero.
791N/A <
function>lwres_getrrsetbyname()</
function>,
791N/A <
parameter>*res</
parameter> is a pointer to an
801N/A <
type>rrsetinfo</
type> structure, containing a list of one or
791N/A more <
type>rdatainfo</
type> structures containing resource
791N/A records and potentially another list of <
type>rdatainfo</
type>
1033N/A structures containing SIG resource records associated with those
791N/A records. The members <
constant>rri_rdclass</
constant> and
791N/A <
constant>rri_rdtype</
constant> are copied from the parameters.
1033N/A <
constant>rri_ttl</
constant> and <
constant>rri_name</
constant>
791N/A are properties of the obtained rrset. The resource records
791N/A contained in <
constant>rri_rdatas</
constant> and
791N/A <
constant>rri_sigs</
constant> are in uncompressed DNS wire
791N/A format. Properties of the rdataset are represented in the
791N/A <
constant>rri_flags</
constant> bitfield. If the RRSET_VALIDATED
1033N/A bit is set, the data has been DNSSEC validated and the
791N/A All of the information returned by
791N/A <
function>lwres_getrrsetbyname()</
function> is dynamically
allocated: the <
constant>rrsetinfo</
constant> and
<
constant>rdatainfo</
constant> structures, and the canonical
host name strings pointed to by the
<
constant>rrsetinfo</
constant>structure.
Memory allocated for the dynamically allocated structures
created by a successful call to
<
function>lwres_getrrsetbyname()</
function> is released by
<
function>lwres_freerrset()</
function>.
<
parameter>rrset</
parameter> is a pointer to a <
type>struct
rrset</
type> created by a call to
<
function>lwres_getrrsetbyname()</
function>.
<
title>RETURN VALUES</
title>
<
para><
function>lwres_getrrsetbyname()</
function>
returns zero on success, and one of the following error codes if
<
term><
constant>ERRSET_NONAME</
constant></
term>
<
term><
constant>ERRSET_NODATA</
constant></
term>
the name exists, but does not have data of the desired type
<
term><
constant>ERRSET_NOMEMORY</
constant></
term>
memory could not be allocated
<
term><
constant>ERRSET_INVAL</
constant></
term>
<
term><
constant>ERRSET_FAIL</
constant></
term>
<
refentrytitle>lwres</
refentrytitle><
manvolnum>3</
manvolnum>