lwres_config.html revision 89da2a56413ba6294315bdde04f7547b9d71b062
<!--
- Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2001 Internet Software Consortium.
-
- Permission to use, copy, modify, and distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
-
- 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.
-->
<!-- $Id: lwres_config.html,v 1.9 2005/04/03 03:31:36 marka Exp $ -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>lwres_config</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"></HEAD
><BODY
CLASS="REFENTRY"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><H1
><A
NAME="AEN1"
></A
>lwres_config</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN8"
></A
><H2
>Name</H2
>lwres_conf_init, lwres_conf_clear, lwres_conf_parse, lwres_conf_print, lwres_conf_get&nbsp;--&nbsp;lightweight resolver configuration</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN15"
></A
><H2
>Synopsis</H2
><DIV
CLASS="FUNCSYNOPSIS"
><P
></P
><A
NAME="AEN16"
></A
><PRE
CLASS="FUNCSYNOPSISINFO"
>#include &lt;lwres/lwres.h&gt;</PRE
><P
><CODE
><CODE
CLASS="FUNCDEF"
>void
lwres_conf_init</CODE
>(lwres_context_t *ctx);</CODE
></P
><P
><CODE
><CODE
CLASS="FUNCDEF"
>void
lwres_conf_clear</CODE
>(lwres_context_t *ctx);</CODE
></P
><P
><CODE
><CODE
CLASS="FUNCDEF"
>lwres_result_t
lwres_conf_parse</CODE
>(lwres_context_t *ctx, const char *filename);</CODE
></P
><P
><CODE
><CODE
CLASS="FUNCDEF"
>lwres_result_t
lwres_conf_print</CODE
>(lwres_context_t *ctx, FILE *fp);</CODE
></P
><P
><CODE
><CODE
CLASS="FUNCDEF"
>lwres_conf_t *
lwres_conf_get</CODE
>(lwres_context_t *ctx);</CODE
></P
><P
></P
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN40"
></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
<CODE
CLASS="PARAMETER"
>ctx</CODE
>.</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
<CODE
CLASS="PARAMETER"
>ctx</CODE
>.</P
><P
><CODE
CLASS="FUNCTION"
>lwres_conf_parse()</CODE
>
opens the file
<CODE
CLASS="PARAMETER"
>filename</CODE
>
and parses it to initialise the resolver context
<CODE
CLASS="PARAMETER"
>ctx</CODE
>'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
<CODE
CLASS="PARAMETER"
>ctx</CODE
>
to the
<SPAN
CLASS="TYPE"
>FILE</SPAN
>
<CODE
CLASS="PARAMETER"
>fp</CODE
>.</P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN61"
></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
<CODE
CLASS="PARAMETER"
>filename</CODE
>.
It returns
<SPAN
CLASS="ERRORCODE"
>LWRES_R_FAILURE</SPAN
>
if
<CODE
CLASS="PARAMETER"
>filename</CODE
>
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"
><A
NAME="AEN73"
></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"
><A
NAME="AEN82"
></A
><H2
>FILES</H2
><P
><TT
CLASS="FILENAME"
>/etc/resolv.conf</TT
></P
></DIV
></BODY
></HTML
>