lwres_config.html revision d6fa26d0adaec6c910115be34fe7a5a5f402c14f
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<!--
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt - Copyright (C) 2000, 2001, 2004, 2005, 2007, 2014-2016 Internet Systems Consortium, Inc. ("ISC")
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt -
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt - This Source Code Form is subject to the terms of the Mozilla Public
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt - License, v. 2.0. If a copy of the MPL was not distributed with this
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt - file, You can obtain one at http://mozilla.org/MPL/2.0/.
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt-->
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<html lang="en">
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<head>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<title>lwres_config</title>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt</head>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry">
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<a name="id-1"></a><div class="titlepage"></div>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<div class="refnamediv">
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<h2>Name</h2>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<p>lwres_conf_init, lwres_conf_clear, lwres_conf_parse, lwres_conf_print, lwres_conf_get &#8212; lightweight resolver configuration</p>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt</div>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<div class="refsynopsisdiv">
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<h2>Synopsis</h2>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<div class="funcsynopsis">
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<pre class="funcsynopsisinfo">#include &lt;lwres/lwres.h&gt;</pre>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<td><code class="funcdef">
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Huntvoid
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<b class="fsfunc">lwres_conf_init</b>(</code></td>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<td>lwres_context_t *<var class="pdparam">ctx</var><code>)</code>;</td>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt</tr></table>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<div class="funcprototype-spacer">�</div>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<td><code class="funcdef">
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Huntvoid
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<b class="fsfunc">lwres_conf_clear</b>(</code></td>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<td>lwres_context_t *<var class="pdparam">ctx</var><code>)</code>;</td>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt</tr></table>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<div class="funcprototype-spacer">�</div>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;">
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<tr>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<td><code class="funcdef">
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Huntlwres_result_t
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<b class="fsfunc">lwres_conf_parse</b>(</code></td>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<td>lwres_context_t *<var class="pdparam">ctx</var>, </td>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt</tr>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<tr>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<td>�</td>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<td>const char *<var class="pdparam">filename</var><code>)</code>;</td>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt</tr>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt</table>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<div class="funcprototype-spacer">�</div>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;">
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<tr>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<td><code class="funcdef">
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Huntlwres_result_t
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<b class="fsfunc">lwres_conf_print</b>(</code></td>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<td>lwres_context_t *<var class="pdparam">ctx</var>, </td>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt</tr>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<tr>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<td>�</td>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<td>FILE *<var class="pdparam">fp</var><code>)</code>;</td>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt</tr>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt</table>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<div class="funcprototype-spacer">�</div>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<td><code class="funcdef">
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Huntlwres_conf_t *
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<b class="fsfunc">lwres_conf_get</b>(</code></td>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<td>lwres_context_t *<var class="pdparam">ctx</var><code>)</code>;</td>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt</tr></table>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<div class="funcprototype-spacer">�</div>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt</div>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt</div>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<div class="refsection">
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<a name="id-1.7"></a><h2>DESCRIPTION</h2>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<p><code class="function">lwres_conf_init()</code>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt creates an empty
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt <span class="type">lwres_conf_t</span>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt structure for lightweight resolver context
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt <em class="parameter"><code>ctx</code></em>.
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt </p>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<p><code class="function">lwres_conf_clear()</code>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt frees up all the internal memory used by
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt that
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt <span class="type">lwres_conf_t</span>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt structure in resolver context
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt <em class="parameter"><code>ctx</code></em>.
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt </p>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<p><code class="function">lwres_conf_parse()</code>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt opens the file
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt <em class="parameter"><code>filename</code></em>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt and parses it to initialise the resolver context
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt <em class="parameter"><code>ctx</code></em>'s
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt <span class="type">lwres_conf_t</span>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt structure.
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt </p>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<p><code class="function">lwres_conf_print()</code>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt prints the
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt <span class="type">lwres_conf_t</span>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt structure for resolver context
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt <em class="parameter"><code>ctx</code></em>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt to the
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt <span class="type">FILE</span>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt <em class="parameter"><code>fp</code></em>.
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt </p>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt</div>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<div class="refsection">
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<a name="id-1.8"></a><h2>RETURN VALUES</h2>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<p><code class="function">lwres_conf_parse()</code>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt returns <span class="errorcode">LWRES_R_SUCCESS</span>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt if it successfully read and parsed
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt <em class="parameter"><code>filename</code></em>.
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt It returns <span class="errorcode">LWRES_R_FAILURE</span>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt if <em class="parameter"><code>filename</code></em>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt could not be opened or contained incorrect
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt resolver statements.
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt </p>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt<p><code class="function">lwres_conf_print()</code>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt returns <span class="errorcode">LWRES_R_SUCCESS</span>
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt unless an error occurred when converting the network addresses to a
1bc5499c2a0fc5d2b11849e97cdd6305a64eb242Evan Hunt numeric host address string.
If this happens, the function returns
<span class="errorcode">LWRES_R_FAILURE</span>.
</p>
</div>
<div class="refsection">
<a name="id-1.9"></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="refsection">
<a name="id-1.10"></a><h2>FILES</h2>
<p><code class="filename">/etc/resolv.conf</code>
</p>
</div>
</div></body>
</html>