lwres_getrrsetbyname.html revision d6fa26d0adaec6c910115be34fe7a5a5f402c14f
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater<!--
7a2a1b8b14fc804ac80612d7b98064095e445be5Automatic Updater - Copyright (C) 2000, 2001, 2004, 2005, 2007, 2014-2016 Internet Systems Consortium, Inc. ("ISC")
7a42357217528037bdfedcb17eeebfe96ae4266aAutomatic Updater -
1167fc7904c5f0a472f8df207ac46dd52c7f1ec8Automatic Updater - This Source Code Form is subject to the terms of the Mozilla Public
0c39b3ed9409ecb277d5e32fa763a4e4d6598df8Automatic Updater - License, v. 2.0. If a copy of the MPL was not distributed with this
46da3117812814a29432a8d9a9ccf8acdbfdadceAutomatic Updater - file, You can obtain one at http://mozilla.org/MPL/2.0/.
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User-->
fe84edc17e0d582cf7b4270f8df9d4742a107b1cAutomatic Updater<html lang="en">
79b273c187a4aa1016a62181983dfdd0521681aeMark Andrews<head>
3349f0044fda807e1fd6681c833d3593a22dad86Tinderbox User<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
9e3a7b0faf417a10f5f689edf288807b2d5eedc5Brian Wellington<title>lwres_getrrsetbyname</title>
b253dcf9668f95e141bce9556dc88e30d3305a1dTinderbox User<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User</head>
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry">
1ac49378a458420bc685293d12e567d7222d17b6Tinderbox User<a name="id-1"></a><div class="titlepage"></div>
bbde8dc56605130058a1540609264fa109da3b63Automatic Updater<div class="refnamediv">
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<h2>Name</h2>
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater<p>lwres_getrrsetbyname, lwres_freerrset &#8212; retrieve DNS records</p>
3cc98b8ecedcbc8465f1cf2740b966b315662430Automatic Updater</div>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<div class="refsynopsisdiv">
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<h2>Synopsis</h2>
a01aa536188bb3535dfc1107a623e6355a8e6b7cMark Andrews<div class="funcsynopsis">
89623368b8f662d458d9964b923050f33c5f75b0Tinderbox User<pre class="funcsynopsisinfo">#include &lt;lwres/netdb.h&gt;</pre>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;">
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater<tr>
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews<td><code class="funcdef">
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updaterint
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson<b class="fsfunc">lwres_getrrsetbyname</b>(</code></td>
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater<td>const char *<var class="pdparam">hostname</var>, </td>
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater</tr>
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson<tr>
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater<td>�</td>
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User<td>unsigned int <var class="pdparam">rdclass</var>, </td>
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User</tr>
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt<tr>
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater<td>�</td>
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater<td>unsigned int <var class="pdparam">rdtype</var>, </td>
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt</tr>
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater<tr>
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater<td>�</td>
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater<td>unsigned int <var class="pdparam">flags</var>, </td>
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt</tr>
e130ab53e992670e2a2ecf043976ac09f21358d1Automatic Updater<tr>
2d2dc37599979c83495510f8af8d1756753aa2c5Automatic Updater<td>�</td>
aa9c561961e9d877946ebaa8795fa2be054ab7bfEvan Hunt<td>struct rrsetinfo **<var class="pdparam">res</var><code>)</code>;</td>
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User</tr>
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater</table>
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater<div class="funcprototype-spacer">�</div>
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater<table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr>
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic Updater<td><code class="funcdef">
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic Updatervoid
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater<b class="fsfunc">lwres_freerrset</b>(</code></td>
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater<td>struct rrsetinfo *<var class="pdparam">rrset</var><code>)</code>;</td>
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater</tr></table>
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater<div class="funcprototype-spacer">�</div>
eabc9c3c07cd956d3c436bd7614cb162dabdda76Mark Andrews</div>
eabc9c3c07cd956d3c436bd7614cb162dabdda76Mark Andrews<p>
eabc9c3c07cd956d3c436bd7614cb162dabdda76Mark Andrews The following structures are used:
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User </p>
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User<pre class="programlisting">
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrewsstruct rdatainfo {
6fe48fb46e53ffc37542853a1edb74cb481b7d94Automatic Updater unsigned int rdi_length; /* length of data */
8e9f3b69914ee02a80b87c97b1f8093edb3e9ae0Automatic Updater unsigned char *rdi_data; /* record data */
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews};
a80993946f29ff39df38818ee9b2e58a4e46cb7eTinderbox User</pre>
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews<p>
c59750de3ea3c7d5890000fb4606e8f5835a52aaTinderbox User </p>
80faf1588895fd26490f82f95a7a1b771df1c324Automatic Updater<pre class="programlisting">
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrewsstruct rrsetinfo {
ec7751119a08c6a7250f3187beed69a8b836d349Tinderbox User unsigned int rri_flags; /* RRSET_VALIDATED... */
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews unsigned int rri_rdclass; /* class number */
114f7780384371121918624ae2c80ecfce545683Tinderbox User unsigned int rri_rdtype; /* RR type number */
693c4232dfdffaff672197d4b9fea944c64cf80aAutomatic Updater unsigned int rri_ttl; /* time to live */
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews unsigned int rri_nrdatas; /* size of rdatas array */
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater unsigned int rri_nsigs; /* size of sigs array */
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson char *rri_name; /* canonical name */
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater struct rdatainfo *rri_rdatas; /* individual records */
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater struct rdatainfo *rri_sigs; /* individual signatures */
efb0e886f18894a1d2489f1ad74ad14b579e11c7Mark Andrews};
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater</pre>
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson<p>
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater </p>
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater</div>
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson<div class="refsection">
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater<a name="id-1.7"></a><h2>DESCRIPTION</h2>
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User<p><code class="function">lwres_getrrsetbyname()</code>
b871c7156eb037d41f53828c6fcb9cc876128962Mark Andrews gets a set of resource records associated with a
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews <em class="parameter"><code>hostname</code></em>, <em class="parameter"><code>class</code></em>,
3349f0044fda807e1fd6681c833d3593a22dad86Tinderbox User and <em class="parameter"><code>type</code></em>.
3349f0044fda807e1fd6681c833d3593a22dad86Tinderbox User <em class="parameter"><code>hostname</code></em> is a pointer a to
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews null-terminated string. The <em class="parameter"><code>flags</code></em> field
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont is currently unused and must be zero.
3349f0044fda807e1fd6681c833d3593a22dad86Tinderbox User </p>
3349f0044fda807e1fd6681c833d3593a22dad86Tinderbox User<p>
2a31bd531072824ef252c18303859d6af7451b00Francis Dupont After a successful call to
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews <code class="function">lwres_getrrsetbyname()</code>,
3349f0044fda807e1fd6681c833d3593a22dad86Tinderbox User <em class="parameter"><code>*res</code></em> is a pointer to an
3349f0044fda807e1fd6681c833d3593a22dad86Tinderbox User <span class="type">rrsetinfo</span> structure, containing a list of one or
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews more <span class="type">rdatainfo</span> structures containing resource
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews records and potentially another list of <span class="type">rdatainfo</span>
24bf1e02f03577db0feb50b80238c4150c96d05dAutomatic Updater structures containing SIG resource records associated with those
24bf1e02f03577db0feb50b80238c4150c96d05dAutomatic Updater records. The members <code class="constant">rri_rdclass</code> and
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews <code class="constant">rri_rdtype</code> are copied from the parameters.
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews <code class="constant">rri_ttl</code> and <code class="constant">rri_name</code>
7500521cecdff3c00e594ec41d3a17292332ffbcTinderbox User are properties of the obtained rrset. The resource records
a308b69ac66fadf66863484f301314d6e6a3f1d2Automatic Updater contained in <code class="constant">rri_rdatas</code> and
78f3ed4bc2fcd3d270bfd599804f3b27a1db4d91Mark Andrews <code class="constant">rri_sigs</code> are in uncompressed DNS wire
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews format. Properties of the rdataset are represented in the
a01aa536188bb3535dfc1107a623e6355a8e6b7cMark Andrews <code class="constant">rri_flags</code> bitfield. If the RRSET_VALIDATED
89623368b8f662d458d9964b923050f33c5f75b0Tinderbox User bit is set, the data has been DNSSEC validated and the
c651f15b30f1dae5cc2f00878fb5da5b3a35a468Mark Andrews signatures verified.
b871c7156eb037d41f53828c6fcb9cc876128962Mark Andrews </p>
b871c7156eb037d41f53828c6fcb9cc876128962Mark Andrews<p>
b871c7156eb037d41f53828c6fcb9cc876128962Mark Andrews All of the information returned by
01a5c5503482fb3ba52088bf0178a7213273bf96Mark Andrews <code class="function">lwres_getrrsetbyname()</code> is dynamically
b871c7156eb037d41f53828c6fcb9cc876128962Mark Andrews allocated: the <code class="constant">rrsetinfo</code> and
b871c7156eb037d41f53828c6fcb9cc876128962Mark Andrews <code class="constant">rdatainfo</code> structures, and the canonical
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater host name strings pointed to by the
cdfc81e048bd34c1d628380247bda6b80a89e20eAutomatic Updater <code class="constant">rrsetinfo</code>structure.
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater
fe80a4909bf62b602feaf246866e9d29f7654194Automatic Updater Memory allocated for the dynamically allocated structures
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater created by a successful call to
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater <code class="function">lwres_getrrsetbyname()</code> is released by
fe80a4909bf62b602feaf246866e9d29f7654194Automatic Updater <code class="function">lwres_freerrset()</code>.
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater <em class="parameter"><code>rrset</code></em> is a pointer to a <span class="type">struct
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson rrset</span> created by a call to
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater <code class="function">lwres_getrrsetbyname()</code>.
aa1d397c4736cd86540555193d71e55fa3b37b2aMark Andrews </p>
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson<p></p>
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updater</div>
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updater<div class="refsection">
dd65eb1efb40b1c47d57963192bfc54873b219beAutomatic Updater<a name="id-1.8"></a><h2>RETURN VALUES</h2>
133e6d43fa82e80d3798be4de00f4540f485ec6cAutomatic Updater<p><code class="function">lwres_getrrsetbyname()</code>
133e6d43fa82e80d3798be4de00f4540f485ec6cAutomatic Updater returns zero on success, and one of the following error codes if
133e6d43fa82e80d3798be4de00f4540f485ec6cAutomatic Updater an error occurred:
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater </p>
91216cff91b34c9ff6e846dc23f248219cafe660Andreas Gustafsson<div class="variablelist"><dl class="variablelist">
f2770f6b39a9b2a98afb7a11ed105f73f1570c1eAutomatic Updater<dt><span class="term"><code class="constant">ERRSET_NONAME</code></span></dt>
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User<dd><p>
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User the name does not exist
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User </p></dd>
1368e4b34cef64604c874fcc40201c78e548714cTinderbox User<dt><span class="term"><code class="constant">ERRSET_NODATA</code></span></dt>
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User<dd><p>
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User the name exists, but does not have data of the desired type
f132a836c4e386b1af045dd8fe7106ae61b90bffAutomatic Updater </p></dd>
8f2c45a35dd8c40bcc9caba8f7d40ce64fc27bcdAutomatic Updater<dt><span class="term"><code class="constant">ERRSET_NOMEMORY</code></span></dt>
c6a0f4ae1d7183a16ffb196b86b647f870694796Automatic Updater<dd><p>
8f2c45a35dd8c40bcc9caba8f7d40ce64fc27bcdAutomatic Updater memory could not be allocated
b886b04d8d2b085cbf3e1bf4442dee87f43ba5e4Tinderbox User </p></dd>
710bce1a85c96e85ca1a90471382055acd29d51fTinderbox User<dt><span class="term"><code class="constant">ERRSET_INVAL</code></span></dt>
269519eeb959d905ed125f96426e01d725c3b597Tinderbox User<dd><p>
8711e5c73ca872d59810760af0332194cbdd619bAutomatic Updater a parameter is invalid
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater </p></dd>
8f2c45a35dd8c40bcc9caba8f7d40ce64fc27bcdAutomatic Updater<dt><span class="term"><code class="constant">ERRSET_FAIL</code></span></dt>
9513a2a6670951f5cf5477fcfec9f933fcaff628Automatic Updater<dd><p>
8f2c45a35dd8c40bcc9caba8f7d40ce64fc27bcdAutomatic Updater other failure
4e0e18467f8ec5a9e5d0c538ce46bf07409ecf9bTinderbox User </p></dd>
e85565067cf73f8cc21ee29b11761659f1d47ee9Automatic Updater<dt><span class="term"><code class="constant"></code></span></dt>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater<dd><p></p></dd>
bc0a53583d92309bebcf93c408e2f3247ebd3d3cAutomatic Updater</dl></div>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater<p>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater </p>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater</div>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater<div class="refsection">
7f79131f9a8e804b93c57f3c679065cce878b726Automatic Updater<a name="id-1.9"></a><h2>SEE ALSO</h2>
59528addd704f8d5757b54e540520f74e588a7c7Automatic Updater<p><span class="citerefentry"><span class="refentrytitle">lwres</span>(3)</span>.
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater </p>
3f616e6f846be57b1717c6beaba0f74de9d5a7c6Automatic Updater</div>
8f2c45a35dd8c40bcc9caba8f7d40ce64fc27bcdAutomatic Updater</div></body>
ce9cad6bb04869c5e94d9dc721032b25117f9210Automatic Updater</html>
19b3dc94bce93fa76bd7e066f9298630dbc9dcb4Automatic Updater