lwres_getrrsetbyname.docbook revision d4ef65050feac78554addf6e16a06c6e2e0bd331
f743002678eb67b99bbc29fee116b65d9530fec0wrowe<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
80833bb9a1bf25dcf19e814438a4b311d2e1f4cffuankg<!--
6736c640e65e06990ef33af71ee81fac4df4ff5fjim - Copyright (C) 2001 Internet Software Consortium.
e81785da447b469da66f218b3f0244aab507958djorton -
e81785da447b469da66f218b3f0244aab507958djorton - Permission to use, copy, modify, and distribute this software for any
e81785da447b469da66f218b3f0244aab507958djorton - purpose with or without fee is hereby granted, provided that the above
e81785da447b469da66f218b3f0244aab507958djorton - copyright notice and this permission notice appear in all copies.
424b4e796cde9df955948c354cb4df6080a92d4esf -
424b4e796cde9df955948c354cb4df6080a92d4esf - THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
424b4e796cde9df955948c354cb4df6080a92d4esf - DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
5cc1d035c9293c4d64b2344b5eac35edd1bd4537rpluem - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
5cc1d035c9293c4d64b2344b5eac35edd1bd4537rpluem - INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
5cc1d035c9293c4d64b2344b5eac35edd1bd4537rpluem - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
5cc1d035c9293c4d64b2344b5eac35edd1bd4537rpluem - FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
3e4e54d4e3fc0123c63d57aa84ac7ad7a8c73ff8jorton - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
3e4e54d4e3fc0123c63d57aa84ac7ad7a8c73ff8jorton - WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3e4e54d4e3fc0123c63d57aa84ac7ad7a8c73ff8jorton-->
00f53c09b10014571b639d5e9df993fb188220a6sf
00f53c09b10014571b639d5e9df993fb188220a6sf<!-- $Id: lwres_getrrsetbyname.docbook,v 1.2 2001/04/10 21:51:50 bwelling Exp $ -->
00f53c09b10014571b639d5e9df993fb188220a6sf
00f53c09b10014571b639d5e9df993fb188220a6sf<refentry>
459eaf0826f995b73a0dc066f59ea10d2824e72dsf<refentryinfo>
459eaf0826f995b73a0dc066f59ea10d2824e72dsf
459eaf0826f995b73a0dc066f59ea10d2824e72dsf
459eaf0826f995b73a0dc066f59ea10d2824e72dsf<date>Oct 18, 2000</date>
6d6cd31bddca0b7d9cf9d18e46cd2361530e24f3sf</refentryinfo>
6d6cd31bddca0b7d9cf9d18e46cd2361530e24f3sf<refmeta>
6d6cd31bddca0b7d9cf9d18e46cd2361530e24f3sf<refentrytitle>lwres_getrrsetbyname</refentrytitle>
53e9b27aba029b18be814df40bcf6f0428771d1efuankg<manvolnum>3</manvolnum>
53e9b27aba029b18be814df40bcf6f0428771d1efuankg<refmiscinfo>BIND9</refmiscinfo>
53e9b27aba029b18be814df40bcf6f0428771d1efuankg</refmeta>
53e9b27aba029b18be814df40bcf6f0428771d1efuankg<refnamediv>
53e9b27aba029b18be814df40bcf6f0428771d1efuankg<refname>lwres_getrrsetbyname</refname>
347074f011eae59e518ddf8d8474d35e029a2056sf<refname>lwres_freerrset</refname>
fe2e0971201136f2dbc6b000ad5c006a1a6ff672sf<refpurpose>retrieve DNS records</refpurpose>
fe2e0971201136f2dbc6b000ad5c006a1a6ff672sf</refnamediv>
347074f011eae59e518ddf8d8474d35e029a2056sf<refsynopsisdiv>
21da42a6b8f551ef603bd06356d3bf71d6d0c21dsf<funcsynopsis>
21da42a6b8f551ef603bd06356d3bf71d6d0c21dsf<funcsynopsisinfo>#include &lt;lwres/netdb.h&gt;</funcsynopsisinfo>
21da42a6b8f551ef603bd06356d3bf71d6d0c21dsf<funcprototype>
2876a591f17b0c6ed0cf28da929643965e67c953sf<funcdef>
2876a591f17b0c6ed0cf28da929643965e67c953sfint
2876a591f17b0c6ed0cf28da929643965e67c953sf<function>lwres_getrrsetbyname</function></funcdef>
2876a591f17b0c6ed0cf28da929643965e67c953sf<paramdef>const char *hostname</paramdef>
38eb64d29a17648e108852de42f23335aecaa8f8sf<paramdef>unsigned int rdclass</paramdef>
976f49eaf81ffe917272e4f1834115dec06962b0sf<paramdef>unsigned int rdtype</paramdef>
38eb64d29a17648e108852de42f23335aecaa8f8sf<paramdef>unsigned int flags</paramdef>
5a1f28ac93914b4bae892c69ac4b3e670bc10da8nd<paramdef>struct rrsetinfo **res</paramdef>
5a1f28ac93914b4bae892c69ac4b3e670bc10da8nd</funcprototype>
5a1f28ac93914b4bae892c69ac4b3e670bc10da8nd<funcprototype>
0361488d59792d052a9f8024c0e5a1ef909252e6rpluem<funcdef>
0361488d59792d052a9f8024c0e5a1ef909252e6rpluemvoid
0361488d59792d052a9f8024c0e5a1ef909252e6rpluem<function>lwres_freerrset</function></funcdef>
6135cc8178d75a52828ad225b1d568cd1e97799erpluem<paramdef>struct rrsetinfo *rrset</paramdef>
6135cc8178d75a52828ad225b1d568cd1e97799erpluem</funcprototype>
6135cc8178d75a52828ad225b1d568cd1e97799erpluem</funcsynopsis>
44761f3e3072cf78a4997a88bb9a515ca101a1f4covener
44761f3e3072cf78a4997a88bb9a515ca101a1f4covener<para>
44761f3e3072cf78a4997a88bb9a515ca101a1f4covenerThe following structures are used:
2ba1586475aa4ec972ca7c19b06d53bf76f0ee7efuankg<programlisting>
2ba1586475aa4ec972ca7c19b06d53bf76f0ee7efuankgstruct rdatainfo {
c7502880be24058c7fc03771fda61f95bc238339sf unsigned int rdi_length; /* length of data */
c7502880be24058c7fc03771fda61f95bc238339sf unsigned char *rdi_data; /* record data */
c7502880be24058c7fc03771fda61f95bc238339sf};
ca61ccd0c306c2c72df153688ba1b49f3eceed80sf
ca61ccd0c306c2c72df153688ba1b49f3eceed80sfstruct rrsetinfo {
ca61ccd0c306c2c72df153688ba1b49f3eceed80sf unsigned int rri_flags; /* RRSET_VALIDATED... */
6bb524f1895f30265a1431afc460977d391cb36bsf unsigned int rri_rdclass; /* class number */
6bb524f1895f30265a1431afc460977d391cb36bsf unsigned int rri_rdtype; /* RR type number */
ca61ccd0c306c2c72df153688ba1b49f3eceed80sf unsigned int rri_ttl; /* time to live */
6bb524f1895f30265a1431afc460977d391cb36bsf unsigned int rri_nrdatas; /* size of rdatas array */
8233250a7f6c06225752db92bf32117bd9648c1dsf unsigned int rri_nsigs; /* size of sigs array */
8233250a7f6c06225752db92bf32117bd9648c1dsf char *rri_name; /* canonical name */
8233250a7f6c06225752db92bf32117bd9648c1dsf struct rdatainfo *rri_rdatas; /* individual records */
b40bfdb714672f972887f9f1f1e154e00125bb68covener struct rdatainfo *rri_sigs; /* individual signatures */
b40bfdb714672f972887f9f1f1e154e00125bb68covener};
b40bfdb714672f972887f9f1f1e154e00125bb68covener</programlisting>
b40bfdb714672f972887f9f1f1e154e00125bb68covener</para>
e6dd71992459d05a676b98b7963423dc5dc1e24aminfrin</refsynopsisdiv>
e6dd71992459d05a676b98b7963423dc5dc1e24aminfrin
e6dd71992459d05a676b98b7963423dc5dc1e24aminfrin<refsect1>
e6dd71992459d05a676b98b7963423dc5dc1e24aminfrin<title>DESCRIPTION</title>
23f1535d6a60817d2846bac0aea230ea475d7dccminfrin<para>
23f1535d6a60817d2846bac0aea230ea475d7dccminfrin<function>lwres_getrrsetbyname()</function>
23f1535d6a60817d2846bac0aea230ea475d7dccminfringets a set of resource records associated with a
23f1535d6a60817d2846bac0aea230ea475d7dccminfrin<parameter>hostname</parameter>,
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjung
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjung<parameter>class</parameter>,
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjung
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjungand
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjung<parameter>type</parameter>.
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjung
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjung<parameter>hostname</parameter>
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjungis
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjunga pointer a to null-terminated string. The
ec7520b24cd80d34d82bbcaca153cbb23cc04bc0rjung<parameter>flags</parameter>
6249dfa569d3b4f1f539665b979a80c6e335d93etrawickfield is currently unused and must be zero.
6249dfa569d3b4f1f539665b979a80c6e335d93etrawick</para>
0827cb14e550f6f65018431c22c2c913631c8f25kbrand<para>
6249dfa569d3b4f1f539665b979a80c6e335d93etrawickAfter a successful call to
ae600ca541efc686b34f8b1f21bd3d0741d37674covener<function>lwres_getrrsetbyname()</function>,
6249dfa569d3b4f1f539665b979a80c6e335d93etrawick
cfa64348224b66dd1c9979b809406c4d15b1c137fielding<parameter>*res</parameter>
74499a117b3b2cd9666715a14f90c0e5d1a4ee8ajimis a pointer to an
cfa64348224b66dd1c9979b809406c4d15b1c137fielding<type>rrsetinfo</type>
74499a117b3b2cd9666715a14f90c0e5d1a4ee8ajimstructure, containing a list of one or more
cfa64348224b66dd1c9979b809406c4d15b1c137fielding<type>rdatainfo</type>
74499a117b3b2cd9666715a14f90c0e5d1a4ee8ajimstructures containing resource records and potentially another list of
cfa64348224b66dd1c9979b809406c4d15b1c137fielding<type>rdatainfo</type>
74499a117b3b2cd9666715a14f90c0e5d1a4ee8ajimstructures containing SIG resource records
cfa64348224b66dd1c9979b809406c4d15b1c137fieldingassociated with those records.
The members
<constant>rri_rdclass</constant>
and
<constant>rri_rdtype</constant>
are copied from the parameters.
<constant>rri_ttl</constant>
and
<constant>rri_name</constant>
are properties of the obtained rrset.
The resource records contained in
<constant>rri_rdatas</constant>
and
<constant>rri_sigs</constant>
are in uncompressed DNS wire format.
Properties of the rdataset are represented in the
<constant>rri_flags</constant>
bitfield. If the RRSET_VALIDATED bit is set, the data has been DNSSEC
validated and the signatures verified.
</para>
<para>
All of the information returned by
<function>lwres_getrrsetbyname()</function>
is dynamically allocated: the
<constant>rrsetinfo</constant>
and
<constant>rdatainfo</constant>
structures,
and the canonical host name strings pointed to by the
<constant>rrsetinfo</constant>structure.
Memory allocated for the dynamically allocated structures created by
a successful call to
<function>lwres_getrrsetbyname()</function>
is released by
<function>lwres_freerrset()</function>.
<parameter>rrset</parameter>
is a pointer to a
<type>struct rrset</type>
created by a call to
<function>lwres_getrrsetbyname()</function>.
</para>
<para>
</para>
</refsect1>
<refsect1>
<title>RETURN VALUES</title>
<para>
<function>lwres_getrrsetbyname()</function>
returns zero on success or an error code if an error occurs. The defined
error codes are ERRSET_NOMEMORY (memory could not be allocated),
ERRSET_INVAL (a parameter is invalid) and ERRSET_FAIL (other failure).
</para>
</refsect1>
<refsect1>
<title>SEE ALSO</title>
<para>
<citerefentry>
<refentrytitle>lwres</refentrytitle><manvolnum>3</manvolnum>
</citerefentry>.
</para>
</refsect1>
</refentry>