lwres_config.html revision 60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews<!--
598b502695802c3d4e23316b85368e54f39f5cabMark Andrews - Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews - Copyright (C) 2000, 2001 Internet Software Consortium
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews -
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews - Permission to use, copy, modify, and distribute this software for any
598b502695802c3d4e23316b85368e54f39f5cabMark Andrews - purpose with or without fee is hereby granted, provided that the above
598b502695802c3d4e23316b85368e54f39f5cabMark Andrews - copyright notice and this permission notice appear in all copies.
598b502695802c3d4e23316b85368e54f39f5cabMark Andrews -
598b502695802c3d4e23316b85368e54f39f5cabMark Andrews - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>lwres_config</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en">
<a name="id2456618"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p>lwres_conf_init, lwres_conf_clear, lwres_conf_parse, lwres_conf_print, lwres_conf_get &#8212; lightweight resolver configuration</p>
</div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<div class="funcsynopsis">
<pre class="funcsynopsisinfo">#include &lt;lwres/lwres.h&gt;</pre>
<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr>
<td><code class="funcdef">
void
<b class="fsfunc">lwres_conf_init</b>(</code></td>
<td>lwres_context_t *�</td>
<td>
<var class="pdparam">ctx</var><code>)</code>;</td>
</tr></table>
<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr>
<td><code class="funcdef">
void
<b class="fsfunc">lwres_conf_clear</b>(</code></td>
<td>lwres_context_t *�</td>
<td>
<var class="pdparam">ctx</var><code>)</code>;</td>
</tr></table>
<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
<tr>
<td><code class="funcdef">
lwres_result_t
<b class="fsfunc">lwres_conf_parse</b>(</code></td>
<td>lwres_context_t *�</td>
<td>
<var class="pdparam">ctx</var>, </td>
</tr>
<tr>
<td>�</td>
<td>const char *�</td>
<td>
<var class="pdparam">filename</var><code>)</code>;</td>
</tr>
</table>
<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em">
<tr>
<td><code class="funcdef">
lwres_result_t
<b class="fsfunc">lwres_conf_print</b>(</code></td>
<td>lwres_context_t *�</td>
<td>
<var class="pdparam">ctx</var>, </td>
</tr>
<tr>
<td>�</td>
<td>FILE *�</td>
<td>
<var class="pdparam">fp</var><code>)</code>;</td>
</tr>
</table>
<table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr>
<td><code class="funcdef">
lwres_conf_t *
<b class="fsfunc">lwres_conf_get</b>(</code></td>
<td>lwres_context_t *�</td>
<td>
<var class="pdparam">ctx</var><code>)</code>;</td>
</tr></table>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id2514055"></a><h2>DESCRIPTION</h2>
<p><code class="function">lwres_conf_init()</code>
creates an empty
<span class="type">lwres_conf_t</span>
structure for lightweight resolver context
<em class="parameter"><code>ctx</code></em>.
</p>
<p><code class="function">lwres_conf_clear()</code>
frees up all the internal memory used by
that
<span class="type">lwres_conf_t</span>
structure in resolver context
<em class="parameter"><code>ctx</code></em>.
</p>
<p><code class="function">lwres_conf_parse()</code>
opens the file
<em class="parameter"><code>filename</code></em>
and parses it to initialise the resolver context
<em class="parameter"><code>ctx</code></em>'s
<span class="type">lwres_conf_t</span>
structure.
</p>
<p><code class="function">lwres_conf_print()</code>
prints the
<span class="type">lwres_conf_t</span>
structure for resolver context
<em class="parameter"><code>ctx</code></em>
to the
<span class="type">FILE</span>
<em class="parameter"><code>fp</code></em>.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2514122"></a><h2>RETURN VALUES</h2>
<p><code class="function">lwres_conf_parse()</code>
returns <span class="errorcode">LWRES_R_SUCCESS</span>
if it successfully read and parsed
<em class="parameter"><code>filename</code></em>.
It returns <span class="errorcode">LWRES_R_FAILURE</span>
if <em class="parameter"><code>filename</code></em>
could not be opened or contained incorrect
resolver statements.
</p>
<p><code class="function">lwres_conf_print()</code>
returns <span class="errorcode">LWRES_R_SUCCESS</span>
unless an error occurred when converting the network addresses to a
numeric host address string.
If this happens, the function returns
<span class="errorcode">LWRES_R_FAILURE</span>.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2514228"></a><h2>SEE ALSO</h2>
<p><span class="citerefentry"><span class="refentrytitle">stdio</span>(3)</span>,
<span class="citerefentry"><span class="refentrytitle">resolver</span>(5)</span>.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2514253"></a><h2>FILES</h2>
<p><code class="filename">/etc/resolv.conf</code>
</p>
</div>
</div></body>
</html>