10139N/A - Copyright (C) 2004, 2005, 2007, 2014, 2015 Internet Systems Consortium, Inc. ("ISC") 10139N/A - Copyright (C) 2000, 2001 Internet Software Consortium. 10139N/A - Permission to use, copy, modify, and/or distribute this software for any 10139N/A - purpose with or without fee is hereby granted, provided that the above 10139N/A - copyright notice and this permission notice appear in all copies. 10139N/A - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 10139N/A - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 10139N/A - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 10139N/A - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 10139N/A - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 10139N/A - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 11904N/A - PERFORMANCE OF THIS SOFTWARE. 10139N/A<!-- Converted by db4-upgrade version 1.0 --> 10139N/A <
corpauthor>Internet Systems Consortium, Inc.</
corpauthor>
10139N/A <
refentrytitle>lwres_getrrsetbyname</
refentrytitle>
10139N/A <
refmiscinfo>BIND9</
refmiscinfo>
10139N/A <
holder>Internet Systems Consortium, Inc. ("ISC")</
holder>
11904N/A <
holder>Internet Software Consortium.</
holder>
11904N/A <
refname>lwres_getrrsetbyname</
refname>
11904N/A <
refname>lwres_freerrset</
refname>
11904N/A <
refpurpose>retrieve DNS records</
refpurpose>
10139N/A<
function>lwres_getrrsetbyname</
function></
funcdef>
10139N/A <
paramdef>const char *<
parameter>hostname</
parameter></
paramdef>
10139N/A <
paramdef>unsigned int <
parameter>rdclass</
parameter></
paramdef>
10139N/A <
paramdef>unsigned int <
parameter>rdtype</
parameter></
paramdef>
10139N/A <
paramdef>unsigned int <
parameter>flags</
parameter></
paramdef>
10139N/A <
paramdef>struct rrsetinfo **<
parameter>res</
parameter></
paramdef>
10139N/A<
function>lwres_freerrset</
function></
funcdef>
10139N/A <
paramdef>struct rrsetinfo *<
parameter>rrset</
parameter></
paramdef>
10139N/A The following structures are used:
10139N/A unsigned int rdi_length; /* length of data */
10139N/A unsigned char *rdi_data; /* record data */
10139N/A unsigned int rri_flags; /* RRSET_VALIDATED... */
10139N/A unsigned int rri_rdclass; /* class number */
10139N/A unsigned int rri_rdtype; /* RR type number */
10139N/A unsigned int rri_ttl; /* time to live */
10139N/A unsigned int rri_nrdatas; /* size of rdatas array */
10139N/A unsigned int rri_nsigs; /* size of sigs array */
10139N/A char *rri_name; /* canonical name */
10139N/A struct rdatainfo *rri_rdatas; /* individual records */
10139N/A struct rdatainfo *rri_sigs; /* individual signatures */
10139N/A <
refsection><
info><
title>DESCRIPTION</
title></
info>
10139N/A <
para><
function>lwres_getrrsetbyname()</
function>
10139N/A gets a set of resource records associated with a
10139N/A <
parameter>hostname</
parameter>, <
parameter>class</
parameter>,
10139N/A and <
parameter>type</
parameter>.
10139N/A <
parameter>hostname</
parameter> is a pointer a to
10139N/A null-terminated string. The <
parameter>flags</
parameter> field
10139N/A is currently unused and must be zero.
10139N/A <
function>lwres_getrrsetbyname()</
function>,
11904N/A <
parameter>*res</
parameter> is a pointer to an
11904N/A <
type>rrsetinfo</
type> structure, containing a list of one or
11904N/A more <
type>rdatainfo</
type> structures containing resource
11904N/A records and potentially another list of <
type>rdatainfo</
type>
11904N/A structures containing SIG resource records associated with those
11904N/A records. The members <
constant>rri_rdclass</
constant> and
11904N/A <
constant>rri_rdtype</
constant> are copied from the parameters.
10139N/A <
constant>rri_ttl</
constant> and <
constant>rri_name</
constant>
10139N/A are properties of the obtained rrset. The resource records
10139N/A contained in <
constant>rri_rdatas</
constant> and
10139N/A <
constant>rri_sigs</
constant> are in uncompressed DNS wire
11904N/A format. Properties of the rdataset are represented in the
10139N/A <
constant>rri_flags</
constant> bitfield. If the RRSET_VALIDATED
10139N/A 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>