1 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
2 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
3 [<!ENTITY mdash "—">]>
5 - Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
6 - Copyright (C) 2000, 2001 Internet Software Consortium.
8 - Permission to use, copy, modify, and/or distribute this software for any
9 - purpose with or without fee is hereby granted, provided that the above
10 - copyright notice and this permission notice appear in all copies.
12 - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
13 - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
14 - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
15 - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
16 - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
17 - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
18 - PERFORMANCE OF THIS SOFTWARE.
21 <!-- $Id: lwres_getrrsetbyname.docbook,v 1.3.206.6 2007/08/28 07:19:18 tbox Exp $ -->
27 <date>Oct 18, 2000</date>
30 <refentrytitle>lwres_getrrsetbyname</refentrytitle>
31 <manvolnum>3</manvolnum>
32 <refmiscinfo>BIND9</refmiscinfo>
40 <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
45 <holder>Internet Software Consortium.</holder>
50 <refname>lwres_getrrsetbyname</refname>
51 <refname>lwres_freerrset</refname>
52 <refpurpose>retrieve DNS records</refpurpose>
56 <funcsynopsisinfo>#include <lwres/netdb.h></funcsynopsisinfo>
60 <function>lwres_getrrsetbyname</function></funcdef>
61 <paramdef>const char *hostname</paramdef>
62 <paramdef>unsigned int rdclass</paramdef>
63 <paramdef>unsigned int rdtype</paramdef>
64 <paramdef>unsigned int flags</paramdef>
65 <paramdef>struct rrsetinfo **res</paramdef>
70 <function>lwres_freerrset</function></funcdef>
71 <paramdef>struct rrsetinfo *rrset</paramdef>
76 The following structures are used:
79 unsigned int rdi_length; /* length of data */
80 unsigned char *rdi_data; /* record data */
84 unsigned int rri_flags; /* RRSET_VALIDATED... */
85 unsigned int rri_rdclass; /* class number */
86 unsigned int rri_rdtype; /* RR type number */
87 unsigned int rri_ttl; /* time to live */
88 unsigned int rri_nrdatas; /* size of rdatas array */
89 unsigned int rri_nsigs; /* size of sigs array */
90 char *rri_name; /* canonical name */
91 struct rdatainfo *rri_rdatas; /* individual records */
92 struct rdatainfo *rri_sigs; /* individual signatures */
99 <title>DESCRIPTION</title>
101 <function>lwres_getrrsetbyname()</function>
102 gets a set of resource records associated with a
103 <parameter>hostname</parameter>,
105 <parameter>class</parameter>,
108 <parameter>type</parameter>.
110 <parameter>hostname</parameter>
112 a pointer a to null-terminated string. The
113 <parameter>flags</parameter>
114 field is currently unused and must be zero.
117 After a successful call to
118 <function>lwres_getrrsetbyname()</function>,
120 <parameter>*res</parameter>
122 <type>rrsetinfo</type>
123 structure, containing a list of one or more
124 <type>rdatainfo</type>
125 structures containing resource records and potentially another list of
126 <type>rdatainfo</type>
127 structures containing SIG resource records
128 associated with those records.
130 <constant>rri_rdclass</constant>
132 <constant>rri_rdtype</constant>
133 are copied from the parameters.
134 <constant>rri_ttl</constant>
136 <constant>rri_name</constant>
137 are properties of the obtained rrset.
138 The resource records contained in
139 <constant>rri_rdatas</constant>
141 <constant>rri_sigs</constant>
142 are in uncompressed DNS wire format.
143 Properties of the rdataset are represented in the
144 <constant>rri_flags</constant>
145 bitfield. If the RRSET_VALIDATED bit is set, the data has been DNSSEC
146 validated and the signatures verified.
149 All of the information returned by
150 <function>lwres_getrrsetbyname()</function>
151 is dynamically allocated: the
152 <constant>rrsetinfo</constant>
154 <constant>rdatainfo</constant>
156 and the canonical host name strings pointed to by the
157 <constant>rrsetinfo</constant>structure.
159 Memory allocated for the dynamically allocated structures created by
161 <function>lwres_getrrsetbyname()</function>
163 <function>lwres_freerrset()</function>.
165 <parameter>rrset</parameter>
167 <type>struct rrset</type>
169 <function>lwres_getrrsetbyname()</function>.
176 <title>RETURN VALUES</title>
178 <function>lwres_getrrsetbyname()</function>
179 returns zero on success, and one of the following error
180 codes if an error occurred:
183 <varlistentry><term><constant>ERRSET_NONAME</constant></term>
185 the name does not exist
186 </para></listitem></varlistentry>
188 <varlistentry><term><constant>ERRSET_NODATA</constant></term>
190 the name exists, but does not have data of the desired type
191 </para></listitem></varlistentry>
193 <varlistentry><term><constant>ERRSET_NOMEMORY</constant></term>
195 memory could not be allocated
196 </para></listitem></varlistentry>
198 <varlistentry><term><constant>ERRSET_INVAL</constant></term>
200 a parameter is invalid
201 </para></listitem></varlistentry>
203 <varlistentry><term><constant>ERRSET_FAIL</constant></term>
206 </para></listitem></varlistentry>
208 <varlistentry><term><constant></constant></term>
210 </para></listitem></varlistentry>
217 <title>SEE ALSO</title>
220 <refentrytitle>lwres</refentrytitle><manvolnum>3</manvolnum>