lwres_config.html revision fd2597f75693a2279fdf588bd40dfe2407c42028
845bb3195a4f50d438ec0fcd5d79593010314319Evan Hunt - Copyright (C) 2004, 2005, 2007, 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
845bb3195a4f50d438ec0fcd5d79593010314319Evan Hunt - Copyright (C) 2000, 2001 Internet Software Consortium.
d8680445d6212d5552ea8a22fd2f9951b11c4b10Tatuya JINMEI 神明達哉 - Permission to use, copy, modify, and/or distribute this software for any
d8680445d6212d5552ea8a22fd2f9951b11c4b10Tatuya JINMEI 神明達哉 - purpose with or without fee is hereby granted, provided that the above
9ead684875ab0ab5fdb8b5dd837a88f7dbd0e01dEvan Hunt - copyright notice and this permission notice appear in all copies.
687b6322fb189c41c3672226a59461cc5c24c087Evan Hunt - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
687b6322fb189c41c3672226a59461cc5c24c087Evan Hunt - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
687b6322fb189c41c3672226a59461cc5c24c087Evan Hunt - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
57fb4f7bbec88bc6431a39d4a10f82c265798b1fMark Andrews - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
57fb4f7bbec88bc6431a39d4a10f82c265798b1fMark Andrews - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
57fb4f7bbec88bc6431a39d4a10f82c265798b1fMark Andrews - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
57fb4f7bbec88bc6431a39d4a10f82c265798b1fMark Andrews - PERFORMANCE OF THIS SOFTWARE.
288486df9df0c5a39b3c3d625c7f133d9a8e69fbMark Andrews<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
5773d3c007c0c065f83480aa17e61bea728221f9Mark Andrews<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
5773d3c007c0c065f83480aa17e61bea728221f9Mark Andrews<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry">
0faf1492c711ddb063efda9f3f03b7afa938cff8Francis Dupont<p>lwres_conf_init, lwres_conf_clear, lwres_conf_parse, lwres_conf_print, lwres_conf_get — lightweight resolver configuration</p>
bd31f734eec1884bd14024a232eb3ad3b0b86489Evan Hunt<pre class="funcsynopsisinfo">#include <lwres/lwres.h></pre>
bd31f734eec1884bd14024a232eb3ad3b0b86489Evan Hunt<table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr>
40ad4ed01be1cace49a62214d11ef1309b3029a0Evan Hunt<td>lwres_context_t *<var class="pdparam">ctx</var><code>)</code>;</td>
b09559fd36c5081ffaf58ab64bdef170c1a720f1Evan Hunt<table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr>
aa3415ba49c7f322845ee3dd59c2d0159f37bb34Evan Hunt<b class="fsfunc">lwres_conf_clear</b>(</code></td>
aa3415ba49c7f322845ee3dd59c2d0159f37bb34Evan Hunt<td>lwres_context_t *<var class="pdparam">ctx</var><code>)</code>;</td>
c9630524c7560b27784fca6e456e652ff41ae7f1Mark Andrews<table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;">
4e55893d307162770fbd7e0967043f0aef9d7583Evan Huntlwres_result_t
4e55893d307162770fbd7e0967043f0aef9d7583Evan Hunt<b class="fsfunc">lwres_conf_parse</b>(</code></td>
4e55893d307162770fbd7e0967043f0aef9d7583Evan Hunt<td>lwres_context_t *<var class="pdparam">ctx</var>, </td>
0da859c5a7f17298577616577197cc6c857e4579Evan Hunt<td>const char *<var class="pdparam">filename</var><code>)</code>;</td>
19a6c40c37cd22a07b29542a5cc5c8986c1fbf57Evan Hunt<table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;">
9de98fbbbee124bbb8d609669cfaff17ec7a36e0Evan Huntlwres_result_t
28f4cd0a4503b91d7a48ed4d157347b251ae5686Mark Andrews<b class="fsfunc">lwres_conf_print</b>(</code></td>
c221360e9f511be38c1385b9a647ebd7dceb8b42Mark Andrews<td>lwres_context_t *<var class="pdparam">ctx</var>, </td>
bc04d6ec155564b7f0c0171ac88e9e5918366c9dEvan Hunt<td>FILE *<var class="pdparam">fp</var><code>)</code>;</td>
b8b602f89be848d44472df92320e9d88213a1411Evan Hunt<table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr>
b8b602f89be848d44472df92320e9d88213a1411Evan Huntlwres_conf_t *
12178c86525332bb0ab66155feb61fbf32eca6acEvan Hunt<td>lwres_context_t *<var class="pdparam">ctx</var><code>)</code>;</td>
71ba75c604df3604673232828a68bb28c420e698Mark Andrews<p><code class="function">lwres_conf_init()</code>
71ba75c604df3604673232828a68bb28c420e698Mark Andrews creates an empty
71ba75c604df3604673232828a68bb28c420e698Mark Andrews structure for lightweight resolver context
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews<p><code class="function">lwres_conf_clear()</code>
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews frees up all the internal memory used by
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews structure in resolver context
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews<p><code class="function">lwres_conf_parse()</code>
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews opens the file
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrews <em class="parameter"><code>filename</code></em>
5d850024cb41fdcb0b85efd3f7997bc52e6b33e8Mark Andrews and parses it to initialise the resolver context
8e4f3f1cbceef520ba889270c993de0ac376a2a7Evan Hunt<p><code class="function">lwres_conf_print()</code>
8e4f3f1cbceef520ba889270c993de0ac376a2a7Evan Hunt structure for resolver context
d524a81532c87c7fa8d0ce0261645fb18276b1eeMark Andrews<p><code class="function">lwres_conf_parse()</code>
feeca57f18fe7ae1825bef81a210068d4ddaf4eeEvan Hunt returns <span class="errorcode">LWRES_R_SUCCESS</span>
feeca57f18fe7ae1825bef81a210068d4ddaf4eeEvan Hunt if it successfully read and parsed
8b37c0dd6e1cf3f8849f4f28b77b43ab3fb20ea4Mark Andrews It returns <span class="errorcode">LWRES_R_FAILURE</span>
8b37c0dd6e1cf3f8849f4f28b77b43ab3fb20ea4Mark Andrews if <em class="parameter"><code>filename</code></em>
c073c65719eb5a7a525176d9a62e1b58a11ecab7Evan Hunt could not be opened or contained incorrect
c073c65719eb5a7a525176d9a62e1b58a11ecab7Evan Hunt resolver statements.
c073c65719eb5a7a525176d9a62e1b58a11ecab7Evan Hunt<p><code class="function">lwres_conf_print()</code>
c073c65719eb5a7a525176d9a62e1b58a11ecab7Evan Hunt returns <span class="errorcode">LWRES_R_SUCCESS</span>
5d9922e86f3d7f58f4c6b1234962ee4567108830Vernon Schryver unless an error occurred when converting the network addresses to a
c4e3976707829c3225983b80afb09215e49ea10dMark Andrews numeric host address string.
c4e3976707829c3225983b80afb09215e49ea10dMark Andrews If this happens, the function returns
49f788cbd39eb9218c19e077c7b2519c617e044dMark Andrews <span class="errorcode">LWRES_R_FAILURE</span>.
ce3b2c5189e874f1c45d699cfb4f30fc7a8cd604Evan Hunt<p><span class="citerefentry"><span class="refentrytitle">stdio</span>(3)</span>,
ce3b2c5189e874f1c45d699cfb4f30fc7a8cd604Evan Hunt <span class="citerefentry"><span class="refentrytitle">resolver</span>(5)</span>.
d0ca4e90e2dd584db70e403ef92ab08d78d9cd6dMark Andrews<p><code class="filename">/etc/resolv.conf</code>