1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
|
<!--
- Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2000, 2001 Internet Software Consortium.
-
- Permission to use, copy, modify, and distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
-
- THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- 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.
-->
<!-- $ISC: lwres_getrrsetbyname.html,v 1.5.2.1.4.11 2006/06/29 13:02:31 marka Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>lwres_getrrsetbyname</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.70.1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
<a name="id2482688"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>lwres_getrrsetbyname, lwres_freerrset — retrieve DNS records</p>
</div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<div class="funcsynopsis">
<pre class="funcsynopsisinfo">#include <lwres/netdb.h></pre>
<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
<tr>
<td><code class="funcdef">
int
<b class="fsfunc">lwres_getrrsetbyname</b>(</code></td>
<td> </td>
<td>, </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td>, </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td>, </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td>, </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td>, </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td>
<code>)</code>;</td>
</tr>
</table>
<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0">
<tr>
<td><code class="funcdef">
void
<b class="fsfunc">lwres_freerrset</b>(</code></td>
<td> </td>
<td>
<code>)</code>;</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td>
<code>)</code>;</td>
</tr>
</table>
</div>
<p>
The following structures are used:
</p>
<pre class="programlisting">
struct rdatainfo {
unsigned int rdi_length; /* length of data */
unsigned char *rdi_data; /* record data */
};
struct rrsetinfo {
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 */
};
</pre>
<p>
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2549443"></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.
</p>
<p>
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 signatures verified.
</p>
<p>
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>.
</p>
<p>
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2549623"></a><h2>RETURN VALUES</h2>
<p>
<code class="function">lwres_getrrsetbyname()</code>
returns zero on success, and one of the following error
codes if an error occurred:
</p>
<div class="variablelist"><dl>
<dt><span class="term"><code class="constant">ERRSET_NONAME</code></span></dt>
<dd><p>
the name does not exist
</p></dd>
<dt><span class="term"><code class="constant">ERRSET_NODATA</code></span></dt>
<dd><p>
the name exists, but does not have data of the desired type
</p></dd>
<dt><span class="term"><code class="constant">ERRSET_NOMEMORY</code></span></dt>
<dd><p>
memory could not be allocated
</p></dd>
<dt><span class="term"><code class="constant">ERRSET_INVAL</code></span></dt>
<dd><p>
a parameter is invalid
</p></dd>
<dt><span class="term"><code class="constant">ERRSET_FAIL</code></span></dt>
<dd><p>
other failure
</p></dd>
<dt><span class="term"><code class="constant"></code></span></dt>
<dd><p>
</p></dd>
</dl></div>
<p>
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2549697"></a><h2>SEE ALSO</h2>
<p>
<span class="citerefentry"><span class="refentrytitle">lwres</span>(3)</span>.
</p>
</div>
</div></body>
</html>
|