lwres_getrrsetbyname.html revision cedb0bd0c1e3c461b7e479a16d3adfd5b150f1f4
80833bb9a1bf25dcf19e814438a4b311d2e1f4cffuankg - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
cc5a4a08dc9783fcbc52ce86f11e01c281a43810minfrin - Copyright (C) 2000, 2001 Internet Software Consortium.
a4df2cd1e1391575a327c2a90ba4315f805a0a78covener - Permission to use, copy, modify, and distribute this software for any
a4df2cd1e1391575a327c2a90ba4315f805a0a78covener - purpose with or without fee is hereby granted, provided that the above
a4df2cd1e1391575a327c2a90ba4315f805a0a78covener - copyright notice and this permission notice appear in all copies.
cb666b29f81df1d11d65002250153353568021fccovener - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
cb666b29f81df1d11d65002250153353568021fccovener - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
f58fcd9d79be417ef351cac4e4c0ab264c5521e0trawick - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
f58fcd9d79be417ef351cac4e4c0ab264c5521e0trawick - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
f58fcd9d79be417ef351cac4e4c0ab264c5521e0trawick - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
f58fcd9d79be417ef351cac4e4c0ab264c5521e0trawick - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
6a80c3c6f4b8ea7ba5e89402b8b779b09ce020e0covener - PERFORMANCE OF THIS SOFTWARE.
6a80c3c6f4b8ea7ba5e89402b8b779b09ce020e0covener<!-- $Id: lwres_getrrsetbyname.html,v 1.18 2005/10/13 03:14:02 marka Exp $ -->
45dffe6c346dd73571ccaead10295fc7d53b59a6covener<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
75a230a728338d84dcfe81edd375352f34de22d0covener<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
3694b0116c5729804ed6a5ce119bd8efda116c7fcovener<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
3694b0116c5729804ed6a5ce119bd8efda116c7fcovener<a name="id2463721"></a><div class="titlepage"></div>
1f50dc34ae069adeed20b2986e5ffdefa5c410e0covener<p>lwres_getrrsetbyname, lwres_freerrset — retrieve DNS records</p>
63a5ea80bddcc84a462e40f402b4f330e0e05411covener<pre class="funcsynopsisinfo">#include <lwres/netdb.h></pre>
63a5ea80bddcc84a462e40f402b4f330e0e05411covener<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
f502dd154eaf60ccf6a993e83c490d52cd0a385eminfrin<b class="fsfunc">lwres_getrrsetbyname</b>(</code></td>
441d366a564bc6faa7c1eaffbacf8c4f37862199minfrin<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr>
0b9de55d178312ec929dbe417dd61199b269991djailletc<var class="pdparam">rrset</var><code>)</code>;</td>
74e7f6c55fd67b10cb400b3f6d1dc718a303d944minfrin The following structures are used:
9e0d78337da0ce66247fc3254b9d5be262cbcea8minfrinstruct rdatainfo {
9e0d78337da0ce66247fc3254b9d5be262cbcea8minfrin unsigned int rdi_length; /* length of data */
2ae6440d9c0beacb1b2a9726d80b755a8a4a851bjailletc unsigned char *rdi_data; /* record data */
2f073ef2a21b1725addef84f318a2b11541e912aminfrinstruct rrsetinfo {
2f073ef2a21b1725addef84f318a2b11541e912aminfrin unsigned int rri_flags; /* RRSET_VALIDATED... */
a511a29faf2ff7ead3b67680154a624effb31aafminfrin unsigned int rri_rdclass; /* class number */
a511a29faf2ff7ead3b67680154a624effb31aafminfrin unsigned int rri_rdtype; /* RR type number */
a511a29faf2ff7ead3b67680154a624effb31aafminfrin unsigned int rri_ttl; /* time to live */
a511a29faf2ff7ead3b67680154a624effb31aafminfrin unsigned int rri_nrdatas; /* size of rdatas array */
a511a29faf2ff7ead3b67680154a624effb31aafminfrin unsigned int rri_nsigs; /* size of sigs array */
a7584fbbf39ae6a78586ed038d80c31b14ce5461minfrin char *rri_name; /* canonical name */
a7584fbbf39ae6a78586ed038d80c31b14ce5461minfrin struct rdatainfo *rri_rdatas; /* individual records */
a7584fbbf39ae6a78586ed038d80c31b14ce5461minfrin struct rdatainfo *rri_sigs; /* individual signatures */
5b6a4b0e8d6d52394b68b51e0fa439d0eee16e37minfrin<p><code class="function">lwres_getrrsetbyname()</code>
5b6a4b0e8d6d52394b68b51e0fa439d0eee16e37minfrin gets a set of resource records associated with a
5b6a4b0e8d6d52394b68b51e0fa439d0eee16e37minfrin <em class="parameter"><code>hostname</code></em>, <em class="parameter"><code>class</code></em>,
2344a0c1817b88b6df61fc4ed0c6af66bb93ee6bjim <em class="parameter"><code>hostname</code></em> is a pointer a to
2344a0c1817b88b6df61fc4ed0c6af66bb93ee6bjim null-terminated string. The <em class="parameter"><code>flags</code></em> field
2344a0c1817b88b6df61fc4ed0c6af66bb93ee6bjim is currently unused and must be zero.
63921358ef93fcb41bc71d9894221ba3d7fbb87bminfrin After a successful call to
63921358ef93fcb41bc71d9894221ba3d7fbb87bminfrin <code class="function">lwres_getrrsetbyname()</code>,
63921358ef93fcb41bc71d9894221ba3d7fbb87bminfrin <em class="parameter"><code>*res</code></em> is a pointer to an
bbb08feeeef547b0908b16df6cbbb65da656b86fminfrin <span class="type">rrsetinfo</span> structure, containing a list of one or
bbb08feeeef547b0908b16df6cbbb65da656b86fminfrin more <span class="type">rdatainfo</span> structures containing resource
bbb08feeeef547b0908b16df6cbbb65da656b86fminfrin records and potentially another list of <span class="type">rdatainfo</span>
bbb08feeeef547b0908b16df6cbbb65da656b86fminfrin structures containing SIG resource records associated with those
eee20257a5ee9228f4aecdf3d3ca68fd0683ff07minfrin records. The members <code class="constant">rri_rdclass</code> and
eee20257a5ee9228f4aecdf3d3ca68fd0683ff07minfrin <code class="constant">rri_rdtype</code> are copied from the parameters.
eee20257a5ee9228f4aecdf3d3ca68fd0683ff07minfrin <code class="constant">rri_ttl</code> and <code class="constant">rri_name</code>
eee20257a5ee9228f4aecdf3d3ca68fd0683ff07minfrin are properties of the obtained rrset. The resource records
eee20257a5ee9228f4aecdf3d3ca68fd0683ff07minfrin contained in <code class="constant">rri_rdatas</code> and
eee20257a5ee9228f4aecdf3d3ca68fd0683ff07minfrin <code class="constant">rri_sigs</code> are in uncompressed DNS wire
eee20257a5ee9228f4aecdf3d3ca68fd0683ff07minfrin format. Properties of the rdataset are represented in the
decb536ebd4b7b94c7450c2e1daa491943135abdminfrin <code class="constant">rri_flags</code> bitfield. If the RRSET_VALIDATED
decb536ebd4b7b94c7450c2e1daa491943135abdminfrin bit is set, the data has been DNSSEC validated and the
decb536ebd4b7b94c7450c2e1daa491943135abdminfrin signatures verified.
2d2c5cedd0559093c6e88bd92702e369ef949336minfrin All of the information returned by
2d2c5cedd0559093c6e88bd92702e369ef949336minfrin <code class="function">lwres_getrrsetbyname()</code> is dynamically
2d2c5cedd0559093c6e88bd92702e369ef949336minfrin allocated: the <code class="constant">rrsetinfo</code> and
2d2c5cedd0559093c6e88bd92702e369ef949336minfrin <code class="constant">rdatainfo</code> structures, and the canonical
2b82678319a66fd9caad8827ca9b38d2412a5abdminfrin host name strings pointed to by the
c0da461d68518e8f89f4070a709ba1e56381247cminfrin Memory allocated for the dynamically allocated structures
c0da461d68518e8f89f4070a709ba1e56381247cminfrin created by a successful call to
797fb211307298a8a6984c0edc0d8972b35eeac1minfrin <code class="function">lwres_getrrsetbyname()</code> is released by
797fb211307298a8a6984c0edc0d8972b35eeac1minfrin <em class="parameter"><code>rrset</code></em> is a pointer to a <span class="type">struct
f27c90ecdefe634bd5f9c529d8658d3a3b441303minfrin rrset</span> created by a call to
f27c90ecdefe634bd5f9c529d8658d3a3b441303minfrin <code class="function">lwres_getrrsetbyname()</code>.
a2e1bbb77dd09c6a60f2dc18f831000e49add31eminfrin<p><code class="function">lwres_getrrsetbyname()</code>
a2e1bbb77dd09c6a60f2dc18f831000e49add31eminfrin returns zero on success, and one of the following error codes if
a2e1bbb77dd09c6a60f2dc18f831000e49add31eminfrin an error occurred:
deec48c67d4786bc77112ffbf3a4e70b931097edminfrin<dt><span class="term"><code class="constant">ERRSET_NONAME</code></span></dt>
deec48c67d4786bc77112ffbf3a4e70b931097edminfrin the name does not exist
6d601599d3d65df0410eae6e573e75b2dbfb1fb4minfrin<dt><span class="term"><code class="constant">ERRSET_NODATA</code></span></dt>
6d601599d3d65df0410eae6e573e75b2dbfb1fb4minfrin the name exists, but does not have data of the desired type
40d570cf1420f497bcac59045d4ce477f0b5d891minfrin<dt><span class="term"><code class="constant">ERRSET_NOMEMORY</code></span></dt>
40d570cf1420f497bcac59045d4ce477f0b5d891minfrin memory could not be allocated
edab53cc0be707fa71968a95c696b19f0e6c4736minfrin<dt><span class="term"><code class="constant">ERRSET_INVAL</code></span></dt>
806e9ba570ef48df4bfd8364e2f4d57381388a11minfrin a parameter is invalid
806e9ba570ef48df4bfd8364e2f4d57381388a11minfrin<dt><span class="term"><code class="constant">ERRSET_FAIL</code></span></dt>
806e9ba570ef48df4bfd8364e2f4d57381388a11minfrin other failure
a4273e3e513ce8f5e1311c320cbd334cc382950eminfrin<dt><span class="term"><code class="constant"></code></span></dt>
2c487ac43b583db869e743772a7a10b278aa2bcfminfrin<p><span class="citerefentry"><span class="refentrytitle">lwres</span>(3)</span>.