1 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
2 "http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"
3 [<!ENTITY mdash "—">]>
5 - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
6 - Copyright (C) 2000, 2001 Internet Software Consortium.
8 - Permission to use, copy, modify, and 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.3 2005/05/12 21:36:15 sra Exp $ -->
27 <date>Oct 18, 2000</date>
30 <refentrytitle>lwres_getrrsetbyname</refentrytitle>
31 <manvolnum>3</manvolnum>
32 <refmiscinfo>BIND9</refmiscinfo>
39 <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
44 <holder>Internet Software Consortium.</holder>
49 <refname>lwres_getrrsetbyname</refname>
50 <refname>lwres_freerrset</refname>
51 <refpurpose>retrieve DNS records</refpurpose>
55 <funcsynopsisinfo>#include <lwres/netdb.h></funcsynopsisinfo>
59 <function>lwres_getrrsetbyname</function></funcdef>
60 <paramdef>const char *hostname</paramdef>
61 <paramdef>unsigned int rdclass</paramdef>
62 <paramdef>unsigned int rdtype</paramdef>
63 <paramdef>unsigned int flags</paramdef>
64 <paramdef>struct rrsetinfo **res</paramdef>
69 <function>lwres_freerrset</function></funcdef>
70 <paramdef>struct rrsetinfo *rrset</paramdef>
75 The following structures are used:
78 unsigned int rdi_length; /* length of data */
79 unsigned char *rdi_data; /* record data */
83 unsigned int rri_flags; /* RRSET_VALIDATED... */
84 unsigned int rri_rdclass; /* class number */
85 unsigned int rri_rdtype; /* RR type number */
86 unsigned int rri_ttl; /* time to live */
87 unsigned int rri_nrdatas; /* size of rdatas array */
88 unsigned int rri_nsigs; /* size of sigs array */
89 char *rri_name; /* canonical name */
90 struct rdatainfo *rri_rdatas; /* individual records */
91 struct rdatainfo *rri_sigs; /* individual signatures */
98 <title>DESCRIPTION</title>
100 <function>lwres_getrrsetbyname()</function>
101 gets a set of resource records associated with a
102 <parameter>hostname</parameter>,
104 <parameter>class</parameter>,
107 <parameter>type</parameter>.
109 <parameter>hostname</parameter>
111 a pointer a to null-terminated string. The
112 <parameter>flags</parameter>
113 field is currently unused and must be zero.
116 After a successful call to
117 <function>lwres_getrrsetbyname()</function>,
119 <parameter>*res</parameter>
121 <type>rrsetinfo</type>
122 structure, containing a list of one or more
123 <type>rdatainfo</type>
124 structures containing resource records and potentially another list of
125 <type>rdatainfo</type>
126 structures containing SIG resource records
127 associated with those records.
129 <constant>rri_rdclass</constant>
131 <constant>rri_rdtype</constant>
132 are copied from the parameters.
133 <constant>rri_ttl</constant>
135 <constant>rri_name</constant>
136 are properties of the obtained rrset.
137 The resource records contained in
138 <constant>rri_rdatas</constant>
140 <constant>rri_sigs</constant>
141 are in uncompressed DNS wire format.
142 Properties of the rdataset are represented in the
143 <constant>rri_flags</constant>
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 <function>lwres_getrrsetbyname()</function>
150 is dynamically allocated: the
151 <constant>rrsetinfo</constant>
153 <constant>rdatainfo</constant>
155 and the canonical host name strings pointed to by the
156 <constant>rrsetinfo</constant>structure.
158 Memory allocated for the dynamically allocated structures created by
160 <function>lwres_getrrsetbyname()</function>
162 <function>lwres_freerrset()</function>.
164 <parameter>rrset</parameter>
166 <type>struct rrset</type>
168 <function>lwres_getrrsetbyname()</function>.
175 <title>RETURN VALUES</title>
177 <function>lwres_getrrsetbyname()</function>
178 returns zero on success, and one of the following error
179 codes if an error occurred:
182 <varlistentry><term><constant>ERRSET_NONAME</constant></term>
184 the name does not exist
185 </para></listitem></varlistentry>
187 <varlistentry><term><constant>ERRSET_NODATA</constant></term>
189 the name exists, but does not have data of the desired type
190 </para></listitem></varlistentry>
192 <varlistentry><term><constant>ERRSET_NOMEMORY</constant></term>
194 memory could not be allocated
195 </para></listitem></varlistentry>
197 <varlistentry><term><constant>ERRSET_INVAL</constant></term>
199 a parameter is invalid
200 </para></listitem></varlistentry>
202 <varlistentry><term><constant>ERRSET_FAIL</constant></term>
205 </para></listitem></varlistentry>
207 <varlistentry><term><constant></constant></term>
209 </para></listitem></varlistentry>
216 <title>SEE ALSO</title>
219 <refentrytitle>lwres</refentrytitle><manvolnum>3</manvolnum>