2 - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
3 - Copyright (C) 2000, 2001 Internet Software Consortium.
5 - Permission to use, copy, modify, and distribute this software for any
6 - purpose with or without fee is hereby granted, provided that the above
7 - copyright notice and this permission notice appear in all copies.
9 - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10 - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11 - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12 - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13 - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14 - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15 - PERFORMANCE OF THIS SOFTWARE.
17 <!-- $Id: lwres_getrrsetbyname.html,v 1.5.2.1.4.11 2006/06/29 13:02:31 marka Exp $ -->
20 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
21 <title>lwres_getrrsetbyname</title>
22 <meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
24 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
25 <a name="id2482688"></a><div class="titlepage"></div>
26 <div class="refnamediv">
28 <p>lwres_getrrsetbyname, lwres_freerrset — retrieve DNS records</p>
30 <div class="refsynopsisdiv">
32 <div class="funcsynopsis">
33 <pre class="funcsynopsisinfo">#include <lwres/netdb.h></pre>
34 <table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
36 <td><code class="funcdef">
38 <b class="fsfunc">lwres_getrrsetbyname</b>(</code></td>
69 <table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0">
71 <td><code class="funcdef">
73 <b class="fsfunc">lwres_freerrset</b>(</code></td>
87 The following structures are used:
89 <pre class="programlisting">
91 unsigned int rdi_length; /* length of data */
92 unsigned char *rdi_data; /* record data */
96 unsigned int rri_flags; /* RRSET_VALIDATED... */
97 unsigned int rri_rdclass; /* class number */
98 unsigned int rri_rdtype; /* RR type number */
99 unsigned int rri_ttl; /* time to live */
100 unsigned int rri_nrdatas; /* size of rdatas array */
101 unsigned int rri_nsigs; /* size of sigs array */
102 char *rri_name; /* canonical name */
103 struct rdatainfo *rri_rdatas; /* individual records */
104 struct rdatainfo *rri_sigs; /* individual signatures */
110 <div class="refsect1" lang="en">
111 <a name="id2549443"></a><h2>DESCRIPTION</h2>
113 <code class="function">lwres_getrrsetbyname()</code>
114 gets a set of resource records associated with a
115 <em class="parameter"><code>hostname</code></em>,
117 <em class="parameter"><code>class</code></em>,
120 <em class="parameter"><code>type</code></em>.
122 <em class="parameter"><code>hostname</code></em>
124 a pointer a to null-terminated string. The
125 <em class="parameter"><code>flags</code></em>
126 field is currently unused and must be zero.
129 After a successful call to
130 <code class="function">lwres_getrrsetbyname()</code>,
132 <em class="parameter"><code>*res</code></em>
134 <span class="type">rrsetinfo</span>
135 structure, containing a list of one or more
136 <span class="type">rdatainfo</span>
137 structures containing resource records and potentially another list of
138 <span class="type">rdatainfo</span>
139 structures containing SIG resource records
140 associated with those records.
142 <code class="constant">rri_rdclass</code>
144 <code class="constant">rri_rdtype</code>
145 are copied from the parameters.
146 <code class="constant">rri_ttl</code>
148 <code class="constant">rri_name</code>
149 are properties of the obtained rrset.
150 The resource records contained in
151 <code class="constant">rri_rdatas</code>
153 <code class="constant">rri_sigs</code>
154 are in uncompressed DNS wire format.
155 Properties of the rdataset are represented in the
156 <code class="constant">rri_flags</code>
157 bitfield. If the RRSET_VALIDATED bit is set, the data has been DNSSEC
158 validated and the signatures verified.
161 All of the information returned by
162 <code class="function">lwres_getrrsetbyname()</code>
163 is dynamically allocated: the
164 <code class="constant">rrsetinfo</code>
166 <code class="constant">rdatainfo</code>
168 and the canonical host name strings pointed to by the
169 <code class="constant">rrsetinfo</code>structure.
171 Memory allocated for the dynamically allocated structures created by
173 <code class="function">lwres_getrrsetbyname()</code>
175 <code class="function">lwres_freerrset()</code>.
177 <em class="parameter"><code>rrset</code></em>
179 <span class="type">struct rrset</span>
181 <code class="function">lwres_getrrsetbyname()</code>.
187 <div class="refsect1" lang="en">
188 <a name="id2549623"></a><h2>RETURN VALUES</h2>
190 <code class="function">lwres_getrrsetbyname()</code>
191 returns zero on success, and one of the following error
192 codes if an error occurred:
194 <div class="variablelist"><dl>
195 <dt><span class="term"><code class="constant">ERRSET_NONAME</code></span></dt>
197 the name does not exist
199 <dt><span class="term"><code class="constant">ERRSET_NODATA</code></span></dt>
201 the name exists, but does not have data of the desired type
203 <dt><span class="term"><code class="constant">ERRSET_NOMEMORY</code></span></dt>
205 memory could not be allocated
207 <dt><span class="term"><code class="constant">ERRSET_INVAL</code></span></dt>
209 a parameter is invalid
211 <dt><span class="term"><code class="constant">ERRSET_FAIL</code></span></dt>
215 <dt><span class="term"><code class="constant"></code></span></dt>
223 <div class="refsect1" lang="en">
224 <a name="id2549697"></a><h2>SEE ALSO</h2>
226 <span class="citerefentry"><span class="refentrytitle">lwres</span>(3)</span>.