lwres_getrrsetbyname.html revision d6fa26d0adaec6c910115be34fe7a5a5f402c14f
d6fa26d0adaec6c910115be34fe7a5a5f402c14fMark Andrews<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson<!--
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User - Copyright (C) 2000, 2001, 2004, 2005, 2007, 2014-2016 Internet Systems Consortium, Inc. ("ISC")
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein -
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User - This Source Code Form is subject to the terms of the Mozilla Public
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User - License, v. 2.0. If a copy of the MPL was not distributed with this
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox User - file, You can obtain one at http://mozilla.org/MPL/2.0/.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson-->
d6fa26d0adaec6c910115be34fe7a5a5f402c14fMark Andrews<html lang="en">
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<head>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<title>lwres_getrrsetbyname</title>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein</head>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry">
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<a name="id-1"></a><div class="titlepage"></div>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<div class="refnamediv">
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<h2>Name</h2>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<p>lwres_getrrsetbyname, lwres_freerrset &#8212; retrieve DNS records</p>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein</div>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<div class="refsynopsisdiv">
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<h2>Synopsis</h2>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<div class="funcsynopsis">
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<pre class="funcsynopsisinfo">#include &lt;lwres/netdb.h&gt;</pre>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;">
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<tr>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<td><code class="funcdef">
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinint
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<b class="fsfunc">lwres_getrrsetbyname</b>(</code></td>
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User<td>const char *<var class="pdparam">hostname</var>, </td>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein</tr>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<tr>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<td>�</td>
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User<td>unsigned int <var class="pdparam">rdclass</var>, </td>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein</tr>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<tr>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<td>�</td>
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User<td>unsigned int <var class="pdparam">rdtype</var>, </td>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein</tr>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<tr>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<td>�</td>
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User<td>unsigned int <var class="pdparam">flags</var>, </td>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein</tr>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<tr>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<td>�</td>
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User<td>struct rrsetinfo **<var class="pdparam">res</var><code>)</code>;</td>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein</tr>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein</table>
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User<div class="funcprototype-spacer">�</div>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<td><code class="funcdef">
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinvoid
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<b class="fsfunc">lwres_freerrset</b>(</code></td>
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User<td>struct rrsetinfo *<var class="pdparam">rrset</var><code>)</code>;</td>
e21a2904f02a03fa06b6db04d348f65fe9c67b2bMark Andrews</tr></table>
2eeb74d1cf5355dd98f6d507a10086e16bb08c4bTinderbox User<div class="funcprototype-spacer">�</div>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein</div>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<p>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein The following structures are used:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </p>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<pre class="programlisting">
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinstruct rdatainfo {
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson unsigned int rdi_length; /* length of data */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson unsigned char *rdi_data; /* record data */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson};
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein</pre>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<p>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </p>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<pre class="programlisting">
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafssonstruct rrsetinfo {
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson unsigned int rri_flags; /* RRSET_VALIDATED... */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson unsigned int rri_rdclass; /* class number */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson unsigned int rri_rdtype; /* RR type number */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson unsigned int rri_ttl; /* time to live */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson unsigned int rri_nrdatas; /* size of rdatas array */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson unsigned int rri_nsigs; /* size of sigs array */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson char *rri_name; /* canonical name */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson struct rdatainfo *rri_rdatas; /* individual records */
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson struct rdatainfo *rri_sigs; /* individual signatures */
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein};
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein</pre>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<p>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </p>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User</div>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<div class="refsection">
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<a name="id-1.7"></a><h2>DESCRIPTION</h2>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<p><code class="function">lwres_getrrsetbyname()</code>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein gets a set of resource records associated with a
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <em class="parameter"><code>hostname</code></em>, <em class="parameter"><code>class</code></em>,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein and <em class="parameter"><code>type</code></em>.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <em class="parameter"><code>hostname</code></em> is a pointer a to
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein null-terminated string. The <em class="parameter"><code>flags</code></em> field
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein is currently unused and must be zero.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </p>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<p>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein After a successful call to
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <code class="function">lwres_getrrsetbyname()</code>,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <em class="parameter"><code>*res</code></em> is a pointer to an
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <span class="type">rrsetinfo</span> structure, containing a list of one or
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein more <span class="type">rdatainfo</span> structures containing resource
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein records and potentially another list of <span class="type">rdatainfo</span>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein structures containing SIG resource records associated with those
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein records. The members <code class="constant">rri_rdclass</code> and
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <code class="constant">rri_rdtype</code> are copied from the parameters.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <code class="constant">rri_ttl</code> and <code class="constant">rri_name</code>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein are properties of the obtained rrset. The resource records
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein contained in <code class="constant">rri_rdatas</code> and
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <code class="constant">rri_sigs</code> are in uncompressed DNS wire
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein format. Properties of the rdataset are represented in the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <code class="constant">rri_flags</code> bitfield. If the RRSET_VALIDATED
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein bit is set, the data has been DNSSEC validated and the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein signatures verified.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </p>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<p>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein All of the information returned by
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <code class="function">lwres_getrrsetbyname()</code> is dynamically
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein allocated: the <code class="constant">rrsetinfo</code> and
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <code class="constant">rdatainfo</code> structures, and the canonical
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein host name strings pointed to by the
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <code class="constant">rrsetinfo</code>structure.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein Memory allocated for the dynamically allocated structures
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein created by a successful call to
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <code class="function">lwres_getrrsetbyname()</code> is released by
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <code class="function">lwres_freerrset()</code>.
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <em class="parameter"><code>rrset</code></em> is a pointer to a <span class="type">struct
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein rrset</span> created by a call to
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein <code class="function">lwres_getrrsetbyname()</code>.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </p>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<p></p>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User</div>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<div class="refsection">
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<a name="id-1.8"></a><h2>RETURN VALUES</h2>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<p><code class="function">lwres_getrrsetbyname()</code>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein returns zero on success, and one of the following error codes if
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein an error occurred:
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </p>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<div class="variablelist"><dl class="variablelist">
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<dt><span class="term"><code class="constant">ERRSET_NONAME</code></span></dt>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<dd><p>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein the name does not exist
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User </p></dd>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<dt><span class="term"><code class="constant">ERRSET_NODATA</code></span></dt>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<dd><p>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein the name exists, but does not have data of the desired type
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User </p></dd>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<dt><span class="term"><code class="constant">ERRSET_NOMEMORY</code></span></dt>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<dd><p>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein memory could not be allocated
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User </p></dd>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<dt><span class="term"><code class="constant">ERRSET_INVAL</code></span></dt>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<dd><p>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein a parameter is invalid
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User </p></dd>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<dt><span class="term"><code class="constant">ERRSET_FAIL</code></span></dt>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<dd><p>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein other failure
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User </p></dd>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<dt><span class="term"><code class="constant"></code></span></dt>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<dd><p></p></dd>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein</dl></div>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein<p>
ddccd5811feff696ba460dabfb666ce61040f545Andreas Gustafsson
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </p>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User</div>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<div class="refsection">
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<a name="id-1.9"></a><h2>SEE ALSO</h2>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<p><span class="citerefentry"><span class="refentrytitle">lwres</span>(3)</span>.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein </p>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User</div>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein</div></body>
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein</html>