summaryrefslogtreecommitdiffstats
path: root/lib/lwres/man/lwres_getrrsetbyname.html
blob: 0e8312104a859088688491925c56cd7f966c18a2 (plain)
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
 - Copyright (C) 2000, 2001, 2004, 2005, 2007, 2014-2016, 2018, 2019 Internet Systems Consortium, Inc. ("ISC")
 - 
 - This Source Code Form is subject to the terms of the Mozilla Public
 - License, v. 2.0. If a copy of the MPL was not distributed with this
 - file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<html lang="en">
<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.78.1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry">
<a name="id-1"></a><div class="titlepage"></div>
  
  

  

  

  <div class="refnamediv">
<h2>Name</h2>
<p>
    lwres_getrrsetbyname, 
    lwres_freerrset
     &#8212; retrieve DNS records
  </p>
</div>
  <div class="refsynopsisdiv">
<h2>Synopsis</h2>
    <div class="funcsynopsis">
<pre class="funcsynopsisinfo">#include &lt;lwres/netdb.h&gt;</pre>
<table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;">
<tr>
<td><code class="funcdef">
int
<b class="fsfunc">lwres_getrrsetbyname</b>(</code></td>
<td>const char *<var class="pdparam">hostname</var>, </td>
</tr>
<tr>
<td></td>
<td>unsigned int <var class="pdparam">rdclass</var>, </td>
</tr>
<tr>
<td></td>
<td>unsigned int <var class="pdparam">rdtype</var>, </td>
</tr>
<tr>
<td></td>
<td>unsigned int <var class="pdparam">flags</var>, </td>
</tr>
<tr>
<td></td>
<td>struct rrsetinfo **<var class="pdparam">res</var><code>)</code>;</td>
</tr>
</table>
<div class="funcprototype-spacer"></div>
<table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr>
<td><code class="funcdef">
void
<b class="fsfunc">lwres_freerrset</b>(</code></td>
<td>struct rrsetinfo *<var class="pdparam">rrset</var><code>)</code>;</td>
</tr></table>
<div class="funcprototype-spacer"></div>
</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 */
};
</pre>
<p>
    </p>
    <pre class="programlisting">
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="refsection">
<a name="id-1.7"></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="refsection">
<a name="id-1.8"></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 class="variablelist">
<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="refsection">
<a name="id-1.9"></a><h2>SEE ALSO</h2>

    <p><span class="citerefentry">
        <span class="refentrytitle">lwres</span>(3)
      </span>.
    </p>

  </div>
</div></body>
</html>