- AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. <!-- Converted by db4-upgrade version 1.0 --> <
corpauthor>Internet Systems Consortium, Inc.</
corpauthor>
<
refentrytitle>lwres_getrrsetbyname</
refentrytitle>
<
refmiscinfo>BIND9</
refmiscinfo>
<
holder>Internet Systems Consortium, Inc. ("ISC")</
holder>
<
holder>Internet Software Consortium.</
holder>
<
refname>lwres_getrrsetbyname</
refname>
<
refname>lwres_freerrset</
refname>
<
refpurpose>retrieve DNS records</
refpurpose>
<
funcsynopsisinfo>#include <
lwres/
netdb.h></
funcsynopsisinfo>
<
function>lwres_getrrsetbyname</
function></
funcdef>
<
paramdef>const char *<
parameter>hostname</
parameter></
paramdef>
<
paramdef>unsigned int <
parameter>rdclass</
parameter></
paramdef>
<
paramdef>unsigned int <
parameter>rdtype</
parameter></
paramdef>
<
paramdef>unsigned int <
parameter>flags</
parameter></
paramdef>
<
paramdef>struct rrsetinfo **<
parameter>res</
parameter></
paramdef>
<
function>lwres_freerrset</
function></
funcdef>
<
paramdef>struct rrsetinfo *<
parameter>rrset</
parameter></
paramdef>
The following structures are used:
unsigned int rdi_length; /* length of data */
unsigned char *rdi_data; /* record data */
unsigned int rri_flags; /* RRSET_VALIDATED... */
unsigned int rri_rdclass; /* class number */
unsigned int rri_rdtype; /* RR type number */
unsigned int rri_ttl; /* time to live */
unsigned int rri_nrdatas; /* size of rdatas array */
unsigned int rri_nsigs; /* size of sigs array */
char *rri_name; /* canonical name */
struct rdatainfo *rri_rdatas; /* individual records */
struct rdatainfo *rri_sigs; /* individual signatures */
<
refsection><
info><
title>DESCRIPTION</
title></
info>
<
para><
function>lwres_getrrsetbyname()</
function>
gets a set of resource records associated with a
<
parameter>hostname</
parameter>, <
parameter>class</
parameter>,
and <
parameter>type</
parameter>.
<
parameter>hostname</
parameter> is a pointer a to
null-terminated string. The <
parameter>flags</
parameter> field
is currently unused and must be zero.
After a successful call to
<
function>lwres_getrrsetbyname()</
function>,
<
parameter>*res</
parameter> is a pointer to an
<
type>rrsetinfo</
type> structure, containing a list of one or
more <
type>rdatainfo</
type> structures containing resource
records and potentially another list of <
type>rdatainfo</
type>
structures containing SIG resource records associated with those
records. The members <
constant>rri_rdclass</
constant> and
<
constant>rri_rdtype</
constant> are copied from the parameters.
<
constant>rri_ttl</
constant> and <
constant>rri_name</
constant>
are properties of the obtained rrset. The resource records
contained in <
constant>rri_rdatas</
constant> and
<
constant>rri_sigs</
constant> are in uncompressed DNS wire
format. Properties of the rdataset are represented in the
<
constant>rri_flags</
constant> bitfield. If the RRSET_VALIDATED
bit is set, the data has been DNSSEC validated and the
All of the information returned by
<
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>.
<
refsection><
info><
title>RETURN VALUES</
title></
info>
<
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>
<
refsection><
info><
title>SEE ALSO</
title></
info>
<
refentrytitle>lwres</
refentrytitle><
manvolnum>3</
manvolnum>