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, 2012 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.
25 <date>Oct 18, 2000</date>
29 <refentrytitle>lwres_getrrsetbyname</refentrytitle>
30 <manvolnum>3</manvolnum>
31 <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 *<parameter>hostname</parameter></paramdef>
62 <paramdef>unsigned int <parameter>rdclass</parameter></paramdef>
63 <paramdef>unsigned int <parameter>rdtype</parameter></paramdef>
64 <paramdef>unsigned int <parameter>flags</parameter></paramdef>
65 <paramdef>struct rrsetinfo **<parameter>res</parameter></paramdef>
70 <function>lwres_freerrset</function></funcdef>
71 <paramdef>struct rrsetinfo *<parameter>rrset</parameter></paramdef>
76 The following structures are used:
78 <para><programlisting>
80 unsigned int rdi_length; /* length of data */
81 unsigned char *rdi_data; /* record data */
85 <para><programlisting>
87 unsigned int rri_flags; /* RRSET_VALIDATED... */
88 unsigned int rri_rdclass; /* class number */
89 unsigned int rri_rdtype; /* RR type number */
90 unsigned int rri_ttl; /* time to live */
91 unsigned int rri_nrdatas; /* size of rdatas array */
92 unsigned int rri_nsigs; /* size of sigs array */
93 char *rri_name; /* canonical name */
94 struct rdatainfo *rri_rdatas; /* individual records */
95 struct rdatainfo *rri_sigs; /* individual signatures */
102 <title>DESCRIPTION</title>
103 <para><function>lwres_getrrsetbyname()</function>
104 gets a set of resource records associated with a
105 <parameter>hostname</parameter>, <parameter>class</parameter>,
106 and <parameter>type</parameter>.
107 <parameter>hostname</parameter> is a pointer a to
108 null-terminated string. The <parameter>flags</parameter> field
109 is currently unused and must be zero.
112 After a successful call to
113 <function>lwres_getrrsetbyname()</function>,
114 <parameter>*res</parameter> is a pointer to an
115 <type>rrsetinfo</type> structure, containing a list of one or
116 more <type>rdatainfo</type> structures containing resource
117 records and potentially another list of <type>rdatainfo</type>
118 structures containing SIG resource records associated with those
119 records. The members <constant>rri_rdclass</constant> and
120 <constant>rri_rdtype</constant> are copied from the parameters.
121 <constant>rri_ttl</constant> and <constant>rri_name</constant>
122 are properties of the obtained rrset. The resource records
123 contained in <constant>rri_rdatas</constant> and
124 <constant>rri_sigs</constant> are in uncompressed DNS wire
125 format. Properties of the rdataset are represented in the
126 <constant>rri_flags</constant> bitfield. If the RRSET_VALIDATED
127 bit is set, the data has been DNSSEC validated and the
131 All of the information returned by
132 <function>lwres_getrrsetbyname()</function> is dynamically
133 allocated: the <constant>rrsetinfo</constant> and
134 <constant>rdatainfo</constant> structures, and the canonical
135 host name strings pointed to by the
136 <constant>rrsetinfo</constant>structure.
138 Memory allocated for the dynamically allocated structures
139 created by a successful call to
140 <function>lwres_getrrsetbyname()</function> is released by
141 <function>lwres_freerrset()</function>.
143 <parameter>rrset</parameter> is a pointer to a <type>struct
144 rrset</type> created by a call to
145 <function>lwres_getrrsetbyname()</function>.
150 <title>RETURN VALUES</title>
151 <para><function>lwres_getrrsetbyname()</function>
152 returns zero on success, and one of the following error codes if
157 <term><constant>ERRSET_NONAME</constant></term>
160 the name does not exist
166 <term><constant>ERRSET_NODATA</constant></term>
169 the name exists, but does not have data of the desired type
175 <term><constant>ERRSET_NOMEMORY</constant></term>
178 memory could not be allocated
184 <term><constant>ERRSET_INVAL</constant></term>
187 a parameter is invalid
193 <term><constant>ERRSET_FAIL</constant></term>
202 <term><constant/></term>
213 <title>SEE ALSO</title>
215 <refentrytitle>lwres</refentrytitle><manvolnum>3</manvolnum>