resolv.h revision 1.28 1 1.28 christos /* $NetBSD: resolv.h,v 1.28 2004/06/09 18:04:05 christos Exp $ */
2 1.18 itojun
3 1.18 itojun /*
4 1.23 christos * Copyright (c) 1983, 1987, 1989
5 1.23 christos * The Regents of the University of California. All rights reserved.
6 1.18 itojun *
7 1.18 itojun * Redistribution and use in source and binary forms, with or without
8 1.18 itojun * modification, are permitted provided that the following conditions
9 1.18 itojun * are met:
10 1.18 itojun * 1. Redistributions of source code must retain the above copyright
11 1.18 itojun * notice, this list of conditions and the following disclaimer.
12 1.18 itojun * 2. Redistributions in binary form must reproduce the above copyright
13 1.18 itojun * notice, this list of conditions and the following disclaimer in the
14 1.18 itojun * documentation and/or other materials provided with the distribution.
15 1.23 christos * 3. Neither the name of the University nor the names of its contributors
16 1.18 itojun * may be used to endorse or promote products derived from this software
17 1.18 itojun * without specific prior written permission.
18 1.18 itojun *
19 1.23 christos * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 1.18 itojun * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 1.18 itojun * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 1.23 christos * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 1.18 itojun * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 1.18 itojun * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 1.18 itojun * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 1.18 itojun * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 1.18 itojun * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 1.18 itojun * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 1.18 itojun * SUCH DAMAGE.
30 1.18 itojun */
31 1.12 perry
32 1.23 christos /*
33 1.23 christos * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
34 1.23 christos * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
35 1.12 perry *
36 1.23 christos * Permission to use, copy, modify, and distribute this software for any
37 1.23 christos * purpose with or without fee is hereby granted, provided that the above
38 1.23 christos * copyright notice and this permission notice appear in all copies.
39 1.12 perry *
40 1.23 christos * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
41 1.23 christos * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
42 1.23 christos * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
43 1.23 christos * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
44 1.23 christos * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
45 1.23 christos * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
46 1.23 christos * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
47 1.23 christos */
48 1.23 christos
49 1.23 christos /*
50 1.12 perry * @(#)resolv.h 8.1 (Berkeley) 6/2/93
51 1.23 christos * Id: resolv.h,v 1.7.2.11.4.1 2004/03/09 08:33:29 marka Exp
52 1.9 mrg */
53 1.9 mrg
54 1.1 cgd #ifndef _RESOLV_H_
55 1.1 cgd #define _RESOLV_H_
56 1.1 cgd
57 1.9 mrg #include <sys/param.h>
58 1.23 christos #if (!defined(BSD)) || (BSD < 199306)
59 1.23 christos # include <sys/bitypes.h>
60 1.23 christos #else
61 1.12 perry #include <sys/types.h>
62 1.23 christos #endif
63 1.9 mrg #include <sys/cdefs.h>
64 1.18 itojun #include <sys/socket.h>
65 1.9 mrg #include <stdio.h>
66 1.23 christos #include <arpa/nameser.h>
67 1.9 mrg
68 1.1 cgd /*
69 1.10 mrg * Revision information. This is the release date in YYYYMMDD format.
70 1.10 mrg * It can change every day so the right thing to do with it is use it
71 1.10 mrg * in preprocessor commands such as "#if (__RES > 19931104)". Do not
72 1.4 deraadt * compare for equality; rather, use it to determine whether your resolver
73 1.4 deraadt * is new enough to contain a certain feature.
74 1.4 deraadt */
75 1.4 deraadt
76 1.23 christos #define __RES 20030124
77 1.23 christos
78 1.23 christos /*
79 1.23 christos * This used to be defined in res_query.c, now it's in herror.c.
80 1.23 christos * [XXX no it's not. It's in irs/irs_data.c]
81 1.23 christos * It was
82 1.23 christos * never extern'd by any *.h file before it was placed here. For thread
83 1.23 christos * aware programs, the last h_errno value set is stored in res->h_errno.
84 1.23 christos *
85 1.23 christos * XXX: There doesn't seem to be a good reason for exposing RES_SET_H_ERRNO
86 1.23 christos * (and __h_errno_set) to the public via <resolv.h>.
87 1.23 christos * XXX: __h_errno_set is really part of IRS, not part of the resolver.
88 1.23 christos * If somebody wants to build and use a resolver that doesn't use IRS,
89 1.23 christos * what do they do? Perhaps something like
90 1.23 christos * #ifdef WANT_IRS
91 1.23 christos * # define RES_SET_H_ERRNO(r,x) __h_errno_set(r,x)
92 1.23 christos * #else
93 1.23 christos * # define RES_SET_H_ERRNO(r,x) (h_errno = (r)->res_h_errno = (x))
94 1.23 christos * #endif
95 1.23 christos */
96 1.23 christos
97 1.23 christos #define RES_SET_H_ERRNO(r,x) __h_errno_set(r,x)
98 1.23 christos struct __res_state; /* forward */
99 1.23 christos __BEGIN_DECLS
100 1.27 he void __h_errno_set(struct __res_state *, int);
101 1.23 christos __END_DECLS
102 1.4 deraadt
103 1.4 deraadt /*
104 1.1 cgd * Resolver configuration file.
105 1.1 cgd * Normally not present, but may contain the address of the
106 1.23 christos * initial name server(s) to query and the domain search list.
107 1.1 cgd */
108 1.1 cgd
109 1.1 cgd #ifndef _PATH_RESCONF
110 1.1 cgd #define _PATH_RESCONF "/etc/resolv.conf"
111 1.1 cgd #endif
112 1.1 cgd
113 1.23 christos typedef enum { res_goahead, res_nextns, res_modified, res_done, res_error }
114 1.23 christos res_sendhookact;
115 1.23 christos
116 1.23 christos #ifndef __PMT
117 1.23 christos #if defined(__STDC__) || defined(__cplusplus)
118 1.23 christos #define __PMT(args) args
119 1.23 christos #else
120 1.23 christos #define __PMT(args) ()
121 1.23 christos #endif
122 1.23 christos #endif
123 1.23 christos
124 1.23 christos typedef res_sendhookact (*res_send_qhook)__PMT((struct sockaddr * const *,
125 1.23 christos const u_char **, int *,
126 1.23 christos u_char *, int, int *));
127 1.23 christos
128 1.23 christos typedef res_sendhookact (*res_send_rhook)__PMT((const struct sockaddr *,
129 1.23 christos const u_char *, int, u_char *,
130 1.23 christos int, int *));
131 1.23 christos
132 1.23 christos struct res_sym {
133 1.23 christos int number; /* Identifying number, like T_MX */
134 1.23 christos const char * name; /* Its symbolic name, like "MX" */
135 1.23 christos const char * humanname; /* Its fun name, like "mail exchanger" */
136 1.23 christos };
137 1.23 christos
138 1.1 cgd /*
139 1.1 cgd * Global defines and variables for resolver stub.
140 1.1 cgd */
141 1.1 cgd #define MAXNS 3 /* max # name servers we'll track */
142 1.1 cgd #define MAXDFLSRCH 3 /* # default domain levels to try */
143 1.1 cgd #define MAXDNSRCH 6 /* max # domains in search path */
144 1.1 cgd #define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */
145 1.1 cgd
146 1.1 cgd #define RES_TIMEOUT 5 /* min. seconds between retries */
147 1.9 mrg #define MAXRESOLVSORT 10 /* number of net to sort on */
148 1.9 mrg #define RES_MAXNDOTS 15 /* should reflect bit field size */
149 1.23 christos #define RES_MAXRETRANS 30 /* only for resolv.conf/RES_OPTIONS */
150 1.23 christos #define RES_MAXRETRY 5 /* only for resolv.conf/RES_OPTIONS */
151 1.23 christos #define RES_DFLRETRY 2 /* Default #/tries. */
152 1.23 christos #define RES_MAXTIME 65535 /* Infinity, in milliseconds. */
153 1.23 christos
154 1.23 christos struct __res_state_ext;
155 1.1 cgd
156 1.4 deraadt struct __res_state {
157 1.20 wiz int retrans; /* retransmission time interval */
158 1.1 cgd int retry; /* number of times to retransmit */
159 1.23 christos #ifdef sun
160 1.23 christos u_int options; /* option flags - see below. */
161 1.23 christos #else
162 1.9 mrg u_long options; /* option flags - see below. */
163 1.23 christos #endif
164 1.1 cgd int nscount; /* number of name servers */
165 1.9 mrg struct sockaddr_in
166 1.9 mrg nsaddr_list[MAXNS]; /* address of name server */
167 1.1 cgd #define nsaddr nsaddr_list[0] /* for backward compatibility */
168 1.10 mrg u_short id; /* current message id */
169 1.4 deraadt char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */
170 1.10 mrg char defdname[256]; /* default domain (deprecated) */
171 1.23 christos #ifdef sun
172 1.23 christos u_int pfcode; /* RES_PRF_ flags - see below. */
173 1.23 christos #else
174 1.9 mrg u_long pfcode; /* RES_PRF_ flags - see below. */
175 1.23 christos #endif
176 1.9 mrg unsigned ndots:4; /* threshold for initial abs. query */
177 1.9 mrg unsigned nsort:4; /* number of elements in sort_list[] */
178 1.4 deraadt char unused[3];
179 1.4 deraadt struct {
180 1.9 mrg struct in_addr addr;
181 1.9 mrg u_int32_t mask;
182 1.4 deraadt } sort_list[MAXRESOLVSORT];
183 1.28 christos #ifdef __OLD_RES_STATE
184 1.28 christos char lookups[4];
185 1.28 christos #else
186 1.23 christos res_send_qhook qhook; /* query hook */
187 1.23 christos res_send_rhook rhook; /* response hook */
188 1.23 christos int res_h_errno; /* last one set for this context */
189 1.23 christos int _vcsock; /* PRIVATE: for res_send VC i/o */
190 1.23 christos u_int _flags; /* PRIVATE: see below */
191 1.23 christos u_int _pad; /* make _u 64 bit aligned */
192 1.23 christos union {
193 1.23 christos /* On an 32-bit arch this means 512b total. */
194 1.23 christos char pad[72 - 4*sizeof (int) - 2*sizeof (void *)];
195 1.23 christos struct {
196 1.23 christos u_int16_t nscount;
197 1.23 christos u_int16_t nstimes[MAXNS]; /* ms. */
198 1.23 christos int nssocks[MAXNS];
199 1.23 christos struct __res_state_ext *ext; /* extention for IPv6 */
200 1.23 christos } _ext;
201 1.23 christos } _u;
202 1.28 christos #endif
203 1.23 christos };
204 1.23 christos
205 1.23 christos typedef struct __res_state *res_state;
206 1.23 christos
207 1.23 christos union res_sockaddr_union {
208 1.23 christos struct sockaddr_in sin;
209 1.23 christos #ifdef IN6ADDR_ANY_INIT
210 1.23 christos struct sockaddr_in6 sin6;
211 1.23 christos #endif
212 1.23 christos #ifdef ISC_ALIGN64
213 1.23 christos int64_t __align64; /* 64bit alignment */
214 1.23 christos #else
215 1.23 christos int32_t __align32; /* 32bit alignment */
216 1.23 christos #endif
217 1.23 christos char __space[128]; /* max size */
218 1.1 cgd };
219 1.1 cgd
220 1.18 itojun /*
221 1.23 christos * Resolver flags (used to be discrete per-module statics ints).
222 1.18 itojun */
223 1.23 christos #define RES_F_VC 0x00000001 /* socket is TCP */
224 1.23 christos #define RES_F_CONN 0x00000002 /* socket is connected */
225 1.23 christos #define RES_F_EDNS0ERR 0x00000004 /* EDNS0 caused errors */
226 1.23 christos #define RES_F__UNUSED 0x00000008 /* (unused) */
227 1.23 christos #define RES_F_LASTMASK 0x000000F0 /* ordinal server of last res_nsend */
228 1.23 christos #define RES_F_LASTSHIFT 4 /* bit position of LASTMASK "flag" */
229 1.23 christos #define RES_GETLAST(res) (((res)._flags & RES_F_LASTMASK) >> RES_F_LASTSHIFT)
230 1.23 christos
231 1.23 christos /* res_findzonecut2() options */
232 1.23 christos #define RES_EXHAUSTIVE 0x00000001 /* always do all queries */
233 1.23 christos #define RES_IPV4ONLY 0x00000002 /* IPv4 only */
234 1.23 christos #define RES_IPV6ONLY 0x00000004 /* IPv6 only */
235 1.18 itojun
236 1.1 cgd /*
237 1.9 mrg * Resolver options (keep these in synch with res_debug.c, please)
238 1.1 cgd */
239 1.9 mrg #define RES_INIT 0x00000001 /* address initialized */
240 1.9 mrg #define RES_DEBUG 0x00000002 /* print debug messages */
241 1.9 mrg #define RES_AAONLY 0x00000004 /* authoritative answers only (!IMPL)*/
242 1.9 mrg #define RES_USEVC 0x00000008 /* use virtual circuit */
243 1.9 mrg #define RES_PRIMARY 0x00000010 /* query primary server only (!IMPL) */
244 1.9 mrg #define RES_IGNTC 0x00000020 /* ignore trucation errors */
245 1.9 mrg #define RES_RECURSE 0x00000040 /* recursion desired */
246 1.9 mrg #define RES_DEFNAMES 0x00000080 /* use default domain name */
247 1.9 mrg #define RES_STAYOPEN 0x00000100 /* Keep TCP socket open */
248 1.9 mrg #define RES_DNSRCH 0x00000200 /* search up local domain tree */
249 1.9 mrg #define RES_INSECURE1 0x00000400 /* type 1 security disabled */
250 1.9 mrg #define RES_INSECURE2 0x00000800 /* type 2 security disabled */
251 1.9 mrg #define RES_NOALIASES 0x00001000 /* shuts off HOSTALIASES feature */
252 1.10 mrg #define RES_USE_INET6 0x00002000 /* use/map IPv6 in gethostbyname() */
253 1.23 christos #define RES_ROTATE 0x00004000 /* rotate ns list after each query */
254 1.23 christos #define RES_NOCHECKNAME 0x00008000 /* do not check names for sanity. */
255 1.23 christos #define RES_KEEPTSIG 0x00010000 /* do not strip TSIG records */
256 1.23 christos #define RES_BLAST 0x00020000 /* blast all recursive servers */
257 1.23 christos #define RES_NOTLDQUERY 0x00100000 /* don't unqualified name as a tld */
258 1.23 christos #define RES_USE_DNSSEC 0x00200000 /* use DNSSEC using OK bit in OPT */
259 1.19 itojun /* KAME extensions: use higher bit to avoid conflict with ISC use */
260 1.23 christos #define RES_USE_DNAME 0x10000000 /* use DNAME */
261 1.23 christos #define RES_USE_EDNS0 0x40000000 /* use EDNS0 if configured */
262 1.23 christos #define RES_NO_NIBBLE2 0x80000000 /* disable alternate nibble lookup */
263 1.1 cgd
264 1.23 christos #define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | \
265 1.23 christos RES_DNSRCH | RES_NO_NIBBLE2)
266 1.1 cgd
267 1.4 deraadt /*
268 1.4 deraadt * Resolver "pfcode" values. Used by dig.
269 1.4 deraadt */
270 1.9 mrg #define RES_PRF_STATS 0x00000001
271 1.23 christos #define RES_PRF_UPDATE 0x00000002
272 1.9 mrg #define RES_PRF_CLASS 0x00000004
273 1.9 mrg #define RES_PRF_CMD 0x00000008
274 1.9 mrg #define RES_PRF_QUES 0x00000010
275 1.9 mrg #define RES_PRF_ANS 0x00000020
276 1.9 mrg #define RES_PRF_AUTH 0x00000040
277 1.9 mrg #define RES_PRF_ADD 0x00000080
278 1.9 mrg #define RES_PRF_HEAD1 0x00000100
279 1.9 mrg #define RES_PRF_HEAD2 0x00000200
280 1.9 mrg #define RES_PRF_TTLID 0x00000400
281 1.9 mrg #define RES_PRF_HEADX 0x00000800
282 1.9 mrg #define RES_PRF_QUERY 0x00001000
283 1.9 mrg #define RES_PRF_REPLY 0x00002000
284 1.23 christos #define RES_PRF_INIT 0x00004000
285 1.23 christos #define RES_PRF_TRUNC 0x00008000
286 1.23 christos /* 0x00010000 */
287 1.9 mrg
288 1.23 christos /* Things involving an internal (static) resolver context. */
289 1.23 christos __BEGIN_DECLS
290 1.23 christos extern struct __res_state *__res_get_state(void);
291 1.23 christos extern void __res_put_state(struct __res_state *);
292 1.23 christos
293 1.24 christos /*
294 1.24 christos * Source and Binary compatibility; _res will not work properly
295 1.24 christos * with multi-threaded programs.
296 1.24 christos */
297 1.24 christos extern struct __res_state *__res_state(void);
298 1.24 christos #define _res (*__res_state())
299 1.9 mrg
300 1.23 christos __END_DECLS
301 1.4 deraadt
302 1.23 christos #ifndef __BIND_NOSTATIC
303 1.23 christos #define fp_nquery __fp_nquery
304 1.23 christos #define fp_query __fp_query
305 1.23 christos #define hostalias __hostalias
306 1.23 christos #define p_query __p_query
307 1.23 christos #define res_close __res_close
308 1.23 christos #define res_opt __res_opt
309 1.23 christos #define res_isourserver __res_isourserver
310 1.25 christos #define res_querydomain __res_querydomain
311 1.23 christos #define res_send __res_send
312 1.23 christos #define res_sendsigned __res_sendsigned
313 1.10 mrg
314 1.25 christos #ifdef BIND_RES_POSIX3
315 1.25 christos #define dn_expand __dn_expand
316 1.25 christos #define res_init __res_init
317 1.25 christos #define res_query __res_query
318 1.25 christos #define res_search __res_search
319 1.25 christos #define res_mkquery __res_mkquery
320 1.25 christos #endif
321 1.25 christos
322 1.23 christos __BEGIN_DECLS
323 1.23 christos void fp_nquery __P((const u_char *, int, FILE *));
324 1.23 christos void fp_query __P((const u_char *, FILE *));
325 1.23 christos const char * hostalias __P((const char *));
326 1.23 christos void p_query __P((const u_char *));
327 1.23 christos void res_close __P((void));
328 1.23 christos int res_init __P((void));
329 1.23 christos int res_opt __P((int, u_char *, int, int));
330 1.23 christos int res_isourserver __P((const struct sockaddr_in *));
331 1.23 christos int res_mkquery __P((int, const char *, int, int, const u_char *,
332 1.23 christos int, const u_char *, u_char *, int));
333 1.23 christos int res_query __P((const char *, int, int, u_char *, int));
334 1.23 christos int res_querydomain __P((const char *, const char *, int, int,
335 1.23 christos u_char *, int));
336 1.23 christos int res_search __P((const char *, int, int, u_char *, int));
337 1.23 christos int res_send __P((const u_char *, int, u_char *, int));
338 1.23 christos int res_sendsigned __P((const u_char *, int, ns_tsig_key *,
339 1.23 christos u_char *, int));
340 1.23 christos __END_DECLS
341 1.18 itojun #endif
342 1.23 christos
343 1.23 christos #if !defined(SHARED_LIBBIND) || defined(LIB)
344 1.23 christos /*
345 1.23 christos * If libbind is a shared object (well, DLL anyway)
346 1.23 christos * these externs break the linker when resolv.h is
347 1.23 christos * included by a lib client (like named)
348 1.23 christos * Make them go away if a client is including this
349 1.23 christos *
350 1.23 christos */
351 1.23 christos extern const struct res_sym __p_key_syms[];
352 1.23 christos extern const struct res_sym __p_cert_syms[];
353 1.10 mrg extern const struct res_sym __p_class_syms[];
354 1.10 mrg extern const struct res_sym __p_type_syms[];
355 1.23 christos extern const struct res_sym __p_rcode_syms[];
356 1.23 christos #endif /* SHARED_LIBBIND */
357 1.1 cgd
358 1.23 christos #define b64_ntop __b64_ntop
359 1.23 christos #define b64_pton __b64_pton
360 1.23 christos #define dn_comp __dn_comp
361 1.23 christos #define dn_count_labels __dn_count_labels
362 1.23 christos #define dn_skipname __dn_skipname
363 1.23 christos #define fp_resstat __fp_resstat
364 1.23 christos #define loc_aton __loc_aton
365 1.23 christos #define loc_ntoa __loc_ntoa
366 1.23 christos #define p_cdname __p_cdname
367 1.23 christos #define p_cdnname __p_cdnname
368 1.23 christos #define p_class __p_class
369 1.23 christos #define p_fqname __p_fqname
370 1.23 christos #define p_fqnname __p_fqnname
371 1.23 christos #define p_option __p_option
372 1.23 christos #define p_secstodate __p_secstodate
373 1.23 christos #define p_section __p_section
374 1.23 christos #define p_time __p_time
375 1.23 christos #define p_type __p_type
376 1.23 christos #define p_rcode __p_rcode
377 1.23 christos #define p_sockun __p_sockun
378 1.23 christos #define putlong __putlong
379 1.23 christos #define putshort __putshort
380 1.23 christos #define res_dnok __res_dnok
381 1.23 christos #define res_findzonecut __res_findzonecut
382 1.23 christos #define res_findzonecut2 __res_findzonecut2
383 1.23 christos #define res_hnok __res_hnok
384 1.23 christos #define res_hostalias __res_hostalias
385 1.23 christos #define res_mailok __res_mailok
386 1.23 christos #define res_nameinquery __res_nameinquery
387 1.23 christos #define res_nclose __res_nclose
388 1.23 christos #define res_ninit __res_ninit
389 1.23 christos #define res_nmkquery __res_nmkquery
390 1.23 christos #define res_pquery __res_pquery
391 1.23 christos #define res_nquery __res_nquery
392 1.23 christos #define res_nquerydomain __res_nquerydomain
393 1.23 christos #define res_nsearch __res_nsearch
394 1.23 christos #define res_nsend __res_nsend
395 1.23 christos #define res_nsendsigned __res_nsendsigned
396 1.23 christos #define res_nisourserver __res_nisourserver
397 1.23 christos #define res_ownok __res_ownok
398 1.23 christos #define res_queriesmatch __res_queriesmatch
399 1.23 christos #define res_randomid __res_randomid
400 1.23 christos #define sym_ntop __sym_ntop
401 1.23 christos #define sym_ntos __sym_ntos
402 1.23 christos #define sym_ston __sym_ston
403 1.23 christos #define res_nopt __res_nopt
404 1.23 christos #define res_ndestroy __res_ndestroy
405 1.23 christos #define res_nametoclass __res_nametoclass
406 1.23 christos #define res_nametotype __res_nametotype
407 1.23 christos #define res_setservers __res_setservers
408 1.23 christos #define res_getservers __res_getservers
409 1.23 christos #define res_buildprotolist __res_buildprotolist
410 1.23 christos #define res_destroyprotolist __res_destroyprotolist
411 1.23 christos #define res_destroyservicelist __res_destroyservicelist
412 1.23 christos #define res_get_nibblesuffix __res_get_nibblesuffix
413 1.23 christos #define res_get_nibblesuffix2 __res_get_nibblesuffix2
414 1.23 christos #define res_ourserver_p __res_ourserver_p
415 1.23 christos #define res_protocolname __res_protocolname
416 1.23 christos #define res_protocolnumber __res_protocolnumber
417 1.23 christos #define res_send_setqhook __res_send_setqhook
418 1.23 christos #define res_send_setrhook __res_send_setrhook
419 1.23 christos #define res_servicename __res_servicename
420 1.23 christos #define res_servicenumber __res_servicenumber
421 1.1 cgd __BEGIN_DECLS
422 1.10 mrg int res_hnok __P((const char *));
423 1.10 mrg int res_ownok __P((const char *));
424 1.10 mrg int res_mailok __P((const char *));
425 1.10 mrg int res_dnok __P((const char *));
426 1.23 christos int sym_ston __P((const struct res_sym *, const char *, int *));
427 1.10 mrg const char * sym_ntos __P((const struct res_sym *, int, int *));
428 1.10 mrg const char * sym_ntop __P((const struct res_sym *, int, int *));
429 1.10 mrg int b64_ntop __P((u_char const *, size_t, char *, size_t));
430 1.10 mrg int b64_pton __P((char const *, u_char *, size_t));
431 1.10 mrg int loc_aton __P((const char *, u_char *));
432 1.10 mrg const char * loc_ntoa __P((const u_char *, char *));
433 1.10 mrg int dn_skipname __P((const u_char *, const u_char *));
434 1.10 mrg void putlong __P((u_int32_t, u_char *));
435 1.10 mrg void putshort __P((u_int16_t, u_char *));
436 1.23 christos #ifndef __ultrix__
437 1.23 christos u_int16_t _getshort __P((const u_char *));
438 1.23 christos u_int32_t _getlong __P((const u_char *));
439 1.23 christos #endif
440 1.10 mrg const char * p_class __P((int));
441 1.10 mrg const char * p_time __P((u_int32_t));
442 1.10 mrg const char * p_type __P((int));
443 1.23 christos const char * p_rcode __P((int));
444 1.23 christos const char * p_sockun __P((union res_sockaddr_union, char *, size_t));
445 1.10 mrg const u_char * p_cdnname __P((const u_char *, const u_char *, int, FILE *));
446 1.10 mrg const u_char * p_cdname __P((const u_char *, const u_char *, FILE *));
447 1.23 christos const u_char * p_fqnname __P((const u_char *, const u_char *,
448 1.10 mrg int, char *, int));
449 1.10 mrg const u_char * p_fqname __P((const u_char *, const u_char *, FILE *));
450 1.23 christos const char * p_option __P((u_long));
451 1.10 mrg char * p_secstodate __P((u_long));
452 1.23 christos int dn_count_labels __P((const char *));
453 1.10 mrg int dn_comp __P((const char *, u_char *, int,
454 1.10 mrg u_char **, u_char **));
455 1.10 mrg int dn_expand __P((const u_char *, const u_char *, const u_char *,
456 1.10 mrg char *, int));
457 1.10 mrg u_int res_randomid __P((void));
458 1.23 christos int res_nameinquery __P((const char *, int, int, const u_char *,
459 1.23 christos const u_char *));
460 1.10 mrg int res_queriesmatch __P((const u_char *, const u_char *,
461 1.10 mrg const u_char *, const u_char *));
462 1.23 christos const char * p_section __P((int, int));
463 1.23 christos /* Things involving a resolver context. */
464 1.23 christos int res_ninit __P((res_state));
465 1.23 christos int res_nisourserver __P((const res_state,
466 1.23 christos const struct sockaddr_in *));
467 1.23 christos void fp_resstat __P((const res_state, FILE *));
468 1.23 christos void res_pquery __P((const res_state, const u_char *, int, FILE *));
469 1.23 christos const char * res_hostalias __P((const res_state, const char *,
470 1.23 christos char *, size_t));
471 1.23 christos int res_nquery __P((res_state, const char *, int, int,
472 1.23 christos u_char *, int));
473 1.23 christos int res_nsearch __P((res_state, const char *, int, int, u_char *,
474 1.23 christos int));
475 1.23 christos int res_nquerydomain __P((res_state, const char *, const char *,
476 1.23 christos int, int, u_char *, int));
477 1.23 christos int res_nmkquery __P((res_state, int, const char *, int, int,
478 1.23 christos const u_char *, int, const u_char *,
479 1.23 christos u_char *, int));
480 1.23 christos int res_nsend __P((res_state, const u_char *, int, u_char *, int));
481 1.23 christos int res_nsendsigned __P((res_state, const u_char *, int,
482 1.23 christos ns_tsig_key *, u_char *, int));
483 1.23 christos int res_findzonecut __P((res_state, const char *, ns_class, int,
484 1.23 christos char *, size_t, struct in_addr *, int));
485 1.23 christos int res_findzonecut2 __P((res_state, const char *, ns_class, int,
486 1.23 christos char *, size_t,
487 1.23 christos union res_sockaddr_union *, int));
488 1.23 christos void res_nclose __P((res_state));
489 1.23 christos int res_nopt __P((res_state, int, u_char *, int, int));
490 1.23 christos void res_send_setqhook __P((res_send_qhook));
491 1.23 christos void res_send_setrhook __P((res_send_rhook));
492 1.23 christos int __res_vinit __P((res_state, int));
493 1.23 christos void res_destroyservicelist __P((void));
494 1.23 christos const char * res_servicename __P((u_int16_t, const char *));
495 1.23 christos const char * res_protocolname __P((int));
496 1.23 christos void res_destroyprotolist __P((void));
497 1.23 christos void res_buildprotolist __P((void));
498 1.23 christos const char * res_get_nibblesuffix __P((res_state));
499 1.23 christos const char * res_get_nibblesuffix2 __P((res_state));
500 1.23 christos void res_ndestroy __P((res_state));
501 1.23 christos u_int16_t res_nametoclass __P((const char *, int *));
502 1.23 christos u_int16_t res_nametotype __P((const char *, int *));
503 1.23 christos void res_setservers __P((res_state,
504 1.23 christos const union res_sockaddr_union *, int));
505 1.23 christos int res_getservers __P((res_state,
506 1.23 christos union res_sockaddr_union *, int));
507 1.1 cgd __END_DECLS
508 1.1 cgd
509 1.1 cgd #endif /* !_RESOLV_H_ */
510