lwres_getrrsetbyname.html revision 60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding - Copyright (C) 2000, 2001 Internet Software Consortium
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding - Permission to use, copy, modify, and distribute this software for any
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding - purpose with or without fee is hereby granted, provided that the above
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding - copyright notice and this permission notice appear in all copies.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding - PERFORMANCE OF THIS SOFTWARE.
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding<a name="id2456618"></a><div class="titlepage"></div>
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding<p>lwres_getrrsetbyname, lwres_freerrset — retrieve DNS records</p>
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding<pre class="funcsynopsisinfo">#include <lwres/netdb.h></pre>
64185f9824e42f21ca7b9ae6c004484215c031a7rbb<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
ab2c1c1c83ec91415565da5a71fbc15d9685caa6fielding<b class="fsfunc">lwres_getrrsetbyname</b>(</code></td>
dc80439e9fba60c753cd145cb6799409ffea9b71ronald<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<var class="pdparam">rrset</var><code>)</code>;</td>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding The following structures are used:
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingstruct rdatainfo {
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding unsigned int rdi_length; /* length of data */
dc80439e9fba60c753cd145cb6799409ffea9b71ronald unsigned char *rdi_data; /* record data */
dc80439e9fba60c753cd145cb6799409ffea9b71ronaldstruct rrsetinfo {
dc80439e9fba60c753cd145cb6799409ffea9b71ronald unsigned int rri_flags; /* RRSET_VALIDATED... */
dc80439e9fba60c753cd145cb6799409ffea9b71ronald unsigned int rri_rdclass; /* class number */
dc80439e9fba60c753cd145cb6799409ffea9b71ronald unsigned int rri_rdtype; /* RR type number */
dc80439e9fba60c753cd145cb6799409ffea9b71ronald unsigned int rri_ttl; /* time to live */
dc80439e9fba60c753cd145cb6799409ffea9b71ronald unsigned int rri_nrdatas; /* size of rdatas array */
dc80439e9fba60c753cd145cb6799409ffea9b71ronald unsigned int rri_nsigs; /* size of sigs array */
dc80439e9fba60c753cd145cb6799409ffea9b71ronald char *rri_name; /* canonical name */
c7d0205ec1649076e7742d72a25ac53779768312stoddard struct rdatainfo *rri_rdatas; /* individual records */
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding struct rdatainfo *rri_sigs; /* individual signatures */
032b8a34c3911bbc5ad5385ca40af65af273bff9wrowe<p><code class="function">lwres_getrrsetbyname()</code>
e33b627b40578d0166fdb79ce0487f9e46586befgstein gets a set of resource records associated with a
cd9f429ff62d134cdf6ec903c33430c5ebae12f0trawick <em class="parameter"><code>hostname</code></em>, <em class="parameter"><code>class</code></em>,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <em class="parameter"><code>hostname</code></em> is a pointer a to
e33b627b40578d0166fdb79ce0487f9e46586befgstein null-terminated string. The <em class="parameter"><code>flags</code></em> field
e33b627b40578d0166fdb79ce0487f9e46586befgstein is currently unused and must be zero.
e33b627b40578d0166fdb79ce0487f9e46586befgstein After a successful call to
e33b627b40578d0166fdb79ce0487f9e46586befgstein <code class="function">lwres_getrrsetbyname()</code>,
e33b627b40578d0166fdb79ce0487f9e46586befgstein <em class="parameter"><code>*res</code></em> is a pointer to an
864c5615d55b8ebbde24e72043f6325741335a74fielding <span class="type">rrsetinfo</span> structure, containing a list of one or
e33b627b40578d0166fdb79ce0487f9e46586befgstein more <span class="type">rdatainfo</span> structures containing resource
26dfa083a1662d57ba7cc410eec4e0696b9be469wrowe records and potentially another list of <span class="type">rdatainfo</span>
26dfa083a1662d57ba7cc410eec4e0696b9be469wrowe structures containing SIG resource records associated with those
e9f8410b788ef1e6f1baed6c706ffdf3da395a16jerenkrantz records. The members <code class="constant">rri_rdclass</code> and
e33b627b40578d0166fdb79ce0487f9e46586befgstein <code class="constant">rri_rdtype</code> are copied from the parameters.
322b350d0f1ac750b112ec15481a33efc92d182cjerenkrantz <code class="constant">rri_ttl</code> and <code class="constant">rri_name</code>
322b350d0f1ac750b112ec15481a33efc92d182cjerenkrantz are properties of the obtained rrset. The resource records
5e454e992b9a111a281aa5d76ca38dca7e6d4fcawrowe contained in <code class="constant">rri_rdatas</code> and
5e454e992b9a111a281aa5d76ca38dca7e6d4fcawrowe <code class="constant">rri_sigs</code> are in uncompressed DNS wire
5e454e992b9a111a281aa5d76ca38dca7e6d4fcawrowe format. Properties of the rdataset are represented in the
6c301fa236511682323164ee004007930889786cben <code class="constant">rri_flags</code> bitfield. If the RRSET_VALIDATED
5e454e992b9a111a281aa5d76ca38dca7e6d4fcawrowe bit is set, the data has been DNSSEC validated and the
8ec8f1c8f0f37ca3f5ebb0e0b491dd07481dccbfronald signatures verified.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding All of the information returned by
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <code class="function">lwres_getrrsetbyname()</code> is dynamically
bdfba727693ab86e9914ca90af68e62896946755jerenkrantz allocated: the <code class="constant">rrsetinfo</code> and
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <code class="constant">rdatainfo</code> structures, and the canonical
9db34d31d4df0b29d128ecd724cd177905108b0frbb host name strings pointed to by the
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding Memory allocated for the dynamically allocated structures
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding created by a successful call to
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <code class="function">lwres_getrrsetbyname()</code> is released by
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <em class="parameter"><code>rrset</code></em> is a pointer to a <span class="type">struct
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding rrset</span> created by a call to
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding <code class="function">lwres_getrrsetbyname()</code>.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<p><code class="function">lwres_getrrsetbyname()</code>
0ec6007a40ac877a7c8d87767ca8e306d89f6595aaron returns zero on success, and one of the following error codes if
0ec6007a40ac877a7c8d87767ca8e306d89f6595aaron an error occurred:
0ec6007a40ac877a7c8d87767ca8e306d89f6595aaron<dt><span class="term"><code class="constant">ERRSET_NONAME</code></span></dt>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding the name does not exist
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<dt><span class="term"><code class="constant">ERRSET_NODATA</code></span></dt>
0ec6007a40ac877a7c8d87767ca8e306d89f6595aaron the name exists, but does not have data of the desired type
0ec6007a40ac877a7c8d87767ca8e306d89f6595aaron<dt><span class="term"><code class="constant">ERRSET_NOMEMORY</code></span></dt>
0ec6007a40ac877a7c8d87767ca8e306d89f6595aaron memory could not be allocated
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<dt><span class="term"><code class="constant">ERRSET_INVAL</code></span></dt>
dc80439e9fba60c753cd145cb6799409ffea9b71ronald a parameter is invalid
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<dt><span class="term"><code class="constant">ERRSET_FAIL</code></span></dt>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding other failure
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<dt><span class="term"><code class="constant"></code></span></dt>
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding<p><span class="citerefentry"><span class="refentrytitle">lwres</span>(3)</span>.