1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
|
<!--
- 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.
-->
<!-- $ISC: lwres_config.html,v 1.4.2.1.4.2 2004/08/22 23:39:03 marka Exp $ -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML
><HEAD
><TITLE
>lwres_config</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"></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 -- 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 <lwres/lwres.h></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
<VAR
CLASS="PARAMETER"
>ctx</VAR
>.</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
<VAR
CLASS="PARAMETER"
>ctx</VAR
>.</P
><P
><CODE
CLASS="FUNCTION"
>lwres_conf_parse()</CODE
>
opens the file
<VAR
CLASS="PARAMETER"
>filename</VAR
>
and parses it to initialise the resolver context
<VAR
CLASS="PARAMETER"
>ctx</VAR
>'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
<VAR
CLASS="PARAMETER"
>ctx</VAR
>
to the
<SPAN
CLASS="TYPE"
>FILE</SPAN
>
<VAR
CLASS="PARAMETER"
>fp</VAR
>.</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
<VAR
CLASS="PARAMETER"
>filename</VAR
>.
It returns
<SPAN
CLASS="ERRORCODE"
>LWRES_R_FAILURE</SPAN
>
if
<VAR
CLASS="PARAMETER"
>filename</VAR
>
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
>
|