36
36
<td><code class="funcdef">
38
38
<b class="fsfunc">lwres_getrrsetbyname</b>(</code></td>
39
<td>const char *�</td>
41
<var class="pdparam">hostname</var>, </td>
45
<td>unsigned int �</td>
47
<var class="pdparam">rdclass</var>, </td>
51
<td>unsigned int �</td>
53
<var class="pdparam">rdtype</var>, </td>
57
<td>unsigned int �</td>
59
<var class="pdparam">flags</var>, </td>
63
<td>struct rrsetinfo **�</td>
65
<var class="pdparam">res</var><code>)</code>;</td>
64
68
<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr>
65
69
<td><code class="funcdef">
67
71
<b class="fsfunc">lwres_freerrset</b>(</code></td>
72
<td>struct rrsetinfo *�</td>
74
<var class="pdparam">rrset</var><code>)</code>;</td>
74
The following structures are used:
78
The following structures are used:
76
80
<pre class="programlisting">
78
82
unsigned int rdi_length; /* length of data */
79
83
unsigned char *rdi_data; /* record data */
88
<pre class="programlisting">
83
90
unsigned int rri_flags; /* RRSET_VALIDATED... */
84
91
unsigned int rri_rdclass; /* class number */
97
<div class="refsect1" lang="en">
98
<a name="id2525878"></a><h2>DESCRIPTION</h2>
100
<code class="function">lwres_getrrsetbyname()</code>
101
gets a set of resource records associated with a
102
<em class="parameter"><code>hostname</code></em>,
104
<em class="parameter"><code>class</code></em>,
107
<em class="parameter"><code>type</code></em>.
109
<em class="parameter"><code>hostname</code></em>
111
a pointer a to null-terminated string. The
112
<em class="parameter"><code>flags</code></em>
113
field is currently unused and must be zero.
116
After a successful call to
117
<code class="function">lwres_getrrsetbyname()</code>,
119
<em class="parameter"><code>*res</code></em>
121
<span class="type">rrsetinfo</span>
122
structure, containing a list of one or more
123
<span class="type">rdatainfo</span>
124
structures containing resource records and potentially another list of
125
<span class="type">rdatainfo</span>
126
structures containing SIG resource records
127
associated with those records.
129
<code class="constant">rri_rdclass</code>
131
<code class="constant">rri_rdtype</code>
132
are copied from the parameters.
133
<code class="constant">rri_ttl</code>
135
<code class="constant">rri_name</code>
136
are properties of the obtained rrset.
137
The resource records contained in
138
<code class="constant">rri_rdatas</code>
140
<code class="constant">rri_sigs</code>
141
are in uncompressed DNS wire format.
142
Properties of the rdataset are represented in the
143
<code class="constant">rri_flags</code>
144
bitfield. If the RRSET_VALIDATED bit is set, the data has been DNSSEC
145
validated and the signatures verified.
148
All of the information returned by
149
<code class="function">lwres_getrrsetbyname()</code>
150
is dynamically allocated: the
151
<code class="constant">rrsetinfo</code>
153
<code class="constant">rdatainfo</code>
155
and the canonical host name strings pointed to by the
156
<code class="constant">rrsetinfo</code>structure.
158
Memory allocated for the dynamically allocated structures created by
160
<code class="function">lwres_getrrsetbyname()</code>
162
<code class="function">lwres_freerrset()</code>.
164
<em class="parameter"><code>rrset</code></em>
166
<span class="type">struct rrset</span>
168
<code class="function">lwres_getrrsetbyname()</code>.
174
<div class="refsect1" lang="en">
175
<a name="id2526058"></a><h2>RETURN VALUES</h2>
177
<code class="function">lwres_getrrsetbyname()</code>
178
returns zero on success, and one of the following error
179
codes if an error occurred:
104
<div class="refsect1" lang="en">
105
<a name="id2543414"></a><h2>DESCRIPTION</h2>
106
<p><code class="function">lwres_getrrsetbyname()</code>
107
gets a set of resource records associated with a
108
<em class="parameter"><code>hostname</code></em>, <em class="parameter"><code>class</code></em>,
109
and <em class="parameter"><code>type</code></em>.
110
<em class="parameter"><code>hostname</code></em> is a pointer a to
111
null-terminated string. The <em class="parameter"><code>flags</code></em> field
112
is currently unused and must be zero.
115
After a successful call to
116
<code class="function">lwres_getrrsetbyname()</code>,
117
<em class="parameter"><code>*res</code></em> is a pointer to an
118
<span class="type">rrsetinfo</span> structure, containing a list of one or
119
more <span class="type">rdatainfo</span> structures containing resource
120
records and potentially another list of <span class="type">rdatainfo</span>
121
structures containing SIG resource records associated with those
122
records. The members <code class="constant">rri_rdclass</code> and
123
<code class="constant">rri_rdtype</code> are copied from the parameters.
124
<code class="constant">rri_ttl</code> and <code class="constant">rri_name</code>
125
are properties of the obtained rrset. The resource records
126
contained in <code class="constant">rri_rdatas</code> and
127
<code class="constant">rri_sigs</code> are in uncompressed DNS wire
128
format. Properties of the rdataset are represented in the
129
<code class="constant">rri_flags</code> bitfield. If the RRSET_VALIDATED
130
bit is set, the data has been DNSSEC validated and the
134
All of the information returned by
135
<code class="function">lwres_getrrsetbyname()</code> is dynamically
136
allocated: the <code class="constant">rrsetinfo</code> and
137
<code class="constant">rdatainfo</code> structures, and the canonical
138
host name strings pointed to by the
139
<code class="constant">rrsetinfo</code>structure.
141
Memory allocated for the dynamically allocated structures
142
created by a successful call to
143
<code class="function">lwres_getrrsetbyname()</code> is released by
144
<code class="function">lwres_freerrset()</code>.
146
<em class="parameter"><code>rrset</code></em> is a pointer to a <span class="type">struct
147
rrset</span> created by a call to
148
<code class="function">lwres_getrrsetbyname()</code>.
152
<div class="refsect1" lang="en">
153
<a name="id2543526"></a><h2>RETURN VALUES</h2>
154
<p><code class="function">lwres_getrrsetbyname()</code>
155
returns zero on success, and one of the following error codes if
181
158
<div class="variablelist"><dl>
182
159
<dt><span class="term"><code class="constant">ERRSET_NONAME</code></span></dt>
184
the name does not exist
161
the name does not exist
186
163
<dt><span class="term"><code class="constant">ERRSET_NODATA</code></span></dt>
188
the name exists, but does not have data of the desired type
165
the name exists, but does not have data of the desired type
190
167
<dt><span class="term"><code class="constant">ERRSET_NOMEMORY</code></span></dt>
192
memory could not be allocated
169
memory could not be allocated
194
171
<dt><span class="term"><code class="constant">ERRSET_INVAL</code></span></dt>
196
a parameter is invalid
173
a parameter is invalid
198
175
<dt><span class="term"><code class="constant">ERRSET_FAIL</code></span></dt>
202
179
<dt><span class="term"><code class="constant"></code></span></dt>
210
186
<div class="refsect1" lang="en">
211
<a name="id2526132"></a><h2>SEE ALSO</h2>
213
<span class="citerefentry"><span class="refentrytitle">lwres</span>(3)</span>.
187
<a name="id2543626"></a><h2>SEE ALSO</h2>
188
<p><span class="citerefentry"><span class="refentrytitle">lwres</span>(3)</span>.