166N/A - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") 166N/A - Copyright (C) 2000, 2001 Internet Software Consortium. 166N/A - Permission to use, copy, modify, and distribute this software for any 166N/A - purpose with or without fee is hereby granted, provided that the above 166N/A - copyright notice and this permission notice appear in all copies. 166N/A - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 166N/A - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 166N/A - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 166N/A - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 166N/A - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 166N/A - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 166N/A - PERFORMANCE OF THIS SOFTWARE. 166N/A<
meta http-
equiv="Content-Type" content="text/html; charset=ISO-8859-1">
166N/A<
title>lwres_getrrsetbyname</
title>
166N/A<
meta name="generator" content="DocBook XSL Stylesheets V1.71.1">
166N/A<
body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><
div class="refentry" lang="en">
166N/A<
a name="id2476419"></
a><
div class="titlepage"></
div>
166N/A<
div class="refnamediv">
166N/A<
p>lwres_getrrsetbyname, lwres_freerrset — retrieve DNS records</
p>
166N/A<
div class="refsynopsisdiv">
166N/A<
div class="funcsynopsis">
844N/A<
table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
166N/A<
td><
code class="funcdef">
166N/A<
b class="fsfunc">lwres_getrrsetbyname</
b>(</
code></
td>
166N/A<
var class="pdparam">hostname</
var>, </
td>
166N/A<
var class="pdparam">rdclass</
var>, </
td>
166N/A<
var class="pdparam">rdtype</
var>, </
td>
166N/A<
var class="pdparam">flags</
var>, </
td>
<
td>struct rrsetinfo **�</
td>
<
var class="pdparam">res</
var><
code>)</
code>;</
td>
<
table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><
tr>
<
td><
code class="funcdef">
<
b class="fsfunc">lwres_freerrset</
b>(</
code></
td>
<
td>struct rrsetinfo *�</
td>
<
var class="pdparam">rrset</
var><
code>)</
code>;</
td>
The following structures are used:
<
pre class="programlisting">
unsigned int rdi_length; /* length of data */
unsigned char *rdi_data; /* record data */
<
pre class="programlisting">
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 */
<
div class="refsect1" lang="en">
<
a name="id2543601"></
a><
h2>DESCRIPTION</
h2>
<
p><
code class="function">lwres_getrrsetbyname()</
code>
gets a set of resource records associated with a
<
em class="parameter"><
code>hostname</
code></
em>, <
em class="parameter"><
code>class</
code></
em>,
and <
em class="parameter"><
code>type</
code></
em>.
<
em class="parameter"><
code>hostname</
code></
em> is a pointer a to
null-terminated string. The <
em class="parameter"><
code>flags</
code></
em> field
is currently unused and must be zero.
After a successful call to
<
code class="function">lwres_getrrsetbyname()</
code>,
<
em class="parameter"><
code>*res</
code></
em> is a pointer to an
<
span class="type">rrsetinfo</
span> structure, containing a list of one or
more <
span class="type">rdatainfo</
span> structures containing resource
records and potentially another list of <
span class="type">rdatainfo</
span>
structures containing SIG resource records associated with those
records. The members <
code class="constant">rri_rdclass</
code> and
<
code class="constant">rri_rdtype</
code> are copied from the parameters.
<
code class="constant">rri_ttl</
code> and <
code class="constant">rri_name</
code>
are properties of the obtained rrset. The resource records
contained in <
code class="constant">rri_rdatas</
code> and
<
code class="constant">rri_sigs</
code> are in uncompressed DNS wire
format. Properties of the rdataset are represented in the
<
code class="constant">rri_flags</
code> bitfield. If the RRSET_VALIDATED
bit is set, the data has been DNSSEC validated and the
All of the information returned by
<
code class="function">lwres_getrrsetbyname()</
code> is dynamically
allocated: the <
code class="constant">rrsetinfo</
code> and
<
code class="constant">rdatainfo</
code> structures, and the canonical
host name strings pointed to by the
<
code class="constant">rrsetinfo</
code>structure.
Memory allocated for the dynamically allocated structures
created by a successful call to
<
code class="function">lwres_getrrsetbyname()</
code> is released by
<
code class="function">lwres_freerrset()</
code>.
<
em class="parameter"><
code>rrset</
code></
em> is a pointer to a <
span class="type">struct
rrset</
span> created by a call to
<
code class="function">lwres_getrrsetbyname()</
code>.
<
div class="refsect1" lang="en">
<
a name="id2543781"></
a><
h2>RETURN VALUES</
h2>
<
p><
code class="function">lwres_getrrsetbyname()</
code>
returns zero on success, and one of the following error codes if
<
div class="variablelist"><
dl>
<
dt><
span class="term"><
code class="constant">ERRSET_NONAME</
code></
span></
dt>
<
dt><
span class="term"><
code class="constant">ERRSET_NODATA</
code></
span></
dt>
the name exists, but does not have data of the desired type
<
dt><
span class="term"><
code class="constant">ERRSET_NOMEMORY</
code></
span></
dt>
memory could not be allocated
<
dt><
span class="term"><
code class="constant">ERRSET_INVAL</
code></
span></
dt>
<
dt><
span class="term"><
code class="constant">ERRSET_FAIL</
code></
span></
dt>
<
dt><
span class="term"><
code class="constant"></
code></
span></
dt>
<
div class="refsect1" lang="en">
<
a name="id2543881"></
a><
h2>SEE ALSO</
h2>
<
p><
span class="citerefentry"><
span class="refentrytitle">lwres</
span>(3)</
span>.