resolv.h revision 1.30 1 1.30 perry /* $NetBSD: resolv.h,v 1.30 2005/02/03 04:39:32 perry 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.29 christos * Id: resolv.h,v 1.7.2.11.4.2 2004/06/25 00:41:05 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.30 perry typedef res_sendhookact (*res_send_qhook)(struct sockaddr * const *,
117 1.23 christos const u_char **, int *,
118 1.30 perry u_char *, int, int *);
119 1.23 christos
120 1.30 perry typedef res_sendhookact (*res_send_rhook)(const struct sockaddr *,
121 1.23 christos const u_char *, int, u_char *,
122 1.30 perry int, int *);
123 1.23 christos
124 1.23 christos struct res_sym {
125 1.23 christos int number; /* Identifying number, like T_MX */
126 1.23 christos const char * name; /* Its symbolic name, like "MX" */
127 1.23 christos const char * humanname; /* Its fun name, like "mail exchanger" */
128 1.23 christos };
129 1.23 christos
130 1.1 cgd /*
131 1.1 cgd * Global defines and variables for resolver stub.
132 1.1 cgd */
133 1.1 cgd #define MAXNS 3 /* max # name servers we'll track */
134 1.1 cgd #define MAXDFLSRCH 3 /* # default domain levels to try */
135 1.1 cgd #define MAXDNSRCH 6 /* max # domains in search path */
136 1.1 cgd #define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */
137 1.1 cgd
138 1.1 cgd #define RES_TIMEOUT 5 /* min. seconds between retries */
139 1.9 mrg #define MAXRESOLVSORT 10 /* number of net to sort on */
140 1.9 mrg #define RES_MAXNDOTS 15 /* should reflect bit field size */
141 1.23 christos #define RES_MAXRETRANS 30 /* only for resolv.conf/RES_OPTIONS */
142 1.23 christos #define RES_MAXRETRY 5 /* only for resolv.conf/RES_OPTIONS */
143 1.23 christos #define RES_DFLRETRY 2 /* Default #/tries. */
144 1.23 christos #define RES_MAXTIME 65535 /* Infinity, in milliseconds. */
145 1.23 christos
146 1.23 christos struct __res_state_ext;
147 1.1 cgd
148 1.4 deraadt struct __res_state {
149 1.20 wiz int retrans; /* retransmission time interval */
150 1.1 cgd int retry; /* number of times to retransmit */
151 1.23 christos #ifdef sun
152 1.23 christos u_int options; /* option flags - see below. */
153 1.23 christos #else
154 1.9 mrg u_long options; /* option flags - see below. */
155 1.23 christos #endif
156 1.1 cgd int nscount; /* number of name servers */
157 1.9 mrg struct sockaddr_in
158 1.9 mrg nsaddr_list[MAXNS]; /* address of name server */
159 1.1 cgd #define nsaddr nsaddr_list[0] /* for backward compatibility */
160 1.10 mrg u_short id; /* current message id */
161 1.4 deraadt char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */
162 1.10 mrg char defdname[256]; /* default domain (deprecated) */
163 1.23 christos #ifdef sun
164 1.23 christos u_int pfcode; /* RES_PRF_ flags - see below. */
165 1.23 christos #else
166 1.9 mrg u_long pfcode; /* RES_PRF_ flags - see below. */
167 1.23 christos #endif
168 1.9 mrg unsigned ndots:4; /* threshold for initial abs. query */
169 1.9 mrg unsigned nsort:4; /* number of elements in sort_list[] */
170 1.4 deraadt char unused[3];
171 1.4 deraadt struct {
172 1.9 mrg struct in_addr addr;
173 1.9 mrg u_int32_t mask;
174 1.4 deraadt } sort_list[MAXRESOLVSORT];
175 1.28 christos #ifdef __OLD_RES_STATE
176 1.28 christos char lookups[4];
177 1.28 christos #else
178 1.23 christos res_send_qhook qhook; /* query hook */
179 1.23 christos res_send_rhook rhook; /* response hook */
180 1.23 christos int res_h_errno; /* last one set for this context */
181 1.23 christos int _vcsock; /* PRIVATE: for res_send VC i/o */
182 1.23 christos u_int _flags; /* PRIVATE: see below */
183 1.23 christos u_int _pad; /* make _u 64 bit aligned */
184 1.23 christos union {
185 1.23 christos /* On an 32-bit arch this means 512b total. */
186 1.23 christos char pad[72 - 4*sizeof (int) - 2*sizeof (void *)];
187 1.23 christos struct {
188 1.23 christos u_int16_t nscount;
189 1.23 christos u_int16_t nstimes[MAXNS]; /* ms. */
190 1.23 christos int nssocks[MAXNS];
191 1.23 christos struct __res_state_ext *ext; /* extention for IPv6 */
192 1.23 christos } _ext;
193 1.23 christos } _u;
194 1.28 christos #endif
195 1.23 christos };
196 1.23 christos
197 1.23 christos typedef struct __res_state *res_state;
198 1.23 christos
199 1.23 christos union res_sockaddr_union {
200 1.23 christos struct sockaddr_in sin;
201 1.23 christos #ifdef IN6ADDR_ANY_INIT
202 1.23 christos struct sockaddr_in6 sin6;
203 1.23 christos #endif
204 1.23 christos #ifdef ISC_ALIGN64
205 1.23 christos int64_t __align64; /* 64bit alignment */
206 1.23 christos #else
207 1.23 christos int32_t __align32; /* 32bit alignment */
208 1.23 christos #endif
209 1.23 christos char __space[128]; /* max size */
210 1.1 cgd };
211 1.1 cgd
212 1.18 itojun /*
213 1.23 christos * Resolver flags (used to be discrete per-module statics ints).
214 1.18 itojun */
215 1.23 christos #define RES_F_VC 0x00000001 /* socket is TCP */
216 1.23 christos #define RES_F_CONN 0x00000002 /* socket is connected */
217 1.23 christos #define RES_F_EDNS0ERR 0x00000004 /* EDNS0 caused errors */
218 1.23 christos #define RES_F__UNUSED 0x00000008 /* (unused) */
219 1.23 christos #define RES_F_LASTMASK 0x000000F0 /* ordinal server of last res_nsend */
220 1.23 christos #define RES_F_LASTSHIFT 4 /* bit position of LASTMASK "flag" */
221 1.23 christos #define RES_GETLAST(res) (((res)._flags & RES_F_LASTMASK) >> RES_F_LASTSHIFT)
222 1.23 christos
223 1.23 christos /* res_findzonecut2() options */
224 1.23 christos #define RES_EXHAUSTIVE 0x00000001 /* always do all queries */
225 1.23 christos #define RES_IPV4ONLY 0x00000002 /* IPv4 only */
226 1.23 christos #define RES_IPV6ONLY 0x00000004 /* IPv6 only */
227 1.18 itojun
228 1.1 cgd /*
229 1.9 mrg * Resolver options (keep these in synch with res_debug.c, please)
230 1.1 cgd */
231 1.9 mrg #define RES_INIT 0x00000001 /* address initialized */
232 1.9 mrg #define RES_DEBUG 0x00000002 /* print debug messages */
233 1.9 mrg #define RES_AAONLY 0x00000004 /* authoritative answers only (!IMPL)*/
234 1.9 mrg #define RES_USEVC 0x00000008 /* use virtual circuit */
235 1.9 mrg #define RES_PRIMARY 0x00000010 /* query primary server only (!IMPL) */
236 1.9 mrg #define RES_IGNTC 0x00000020 /* ignore trucation errors */
237 1.9 mrg #define RES_RECURSE 0x00000040 /* recursion desired */
238 1.9 mrg #define RES_DEFNAMES 0x00000080 /* use default domain name */
239 1.9 mrg #define RES_STAYOPEN 0x00000100 /* Keep TCP socket open */
240 1.9 mrg #define RES_DNSRCH 0x00000200 /* search up local domain tree */
241 1.9 mrg #define RES_INSECURE1 0x00000400 /* type 1 security disabled */
242 1.9 mrg #define RES_INSECURE2 0x00000800 /* type 2 security disabled */
243 1.9 mrg #define RES_NOALIASES 0x00001000 /* shuts off HOSTALIASES feature */
244 1.10 mrg #define RES_USE_INET6 0x00002000 /* use/map IPv6 in gethostbyname() */
245 1.23 christos #define RES_ROTATE 0x00004000 /* rotate ns list after each query */
246 1.23 christos #define RES_NOCHECKNAME 0x00008000 /* do not check names for sanity. */
247 1.23 christos #define RES_KEEPTSIG 0x00010000 /* do not strip TSIG records */
248 1.23 christos #define RES_BLAST 0x00020000 /* blast all recursive servers */
249 1.23 christos #define RES_NOTLDQUERY 0x00100000 /* don't unqualified name as a tld */
250 1.23 christos #define RES_USE_DNSSEC 0x00200000 /* use DNSSEC using OK bit in OPT */
251 1.29 christos /* #define RES_DEBUG2 0x00400000 */ /* nslookup internal */
252 1.19 itojun /* KAME extensions: use higher bit to avoid conflict with ISC use */
253 1.23 christos #define RES_USE_DNAME 0x10000000 /* use DNAME */
254 1.23 christos #define RES_USE_EDNS0 0x40000000 /* use EDNS0 if configured */
255 1.23 christos #define RES_NO_NIBBLE2 0x80000000 /* disable alternate nibble lookup */
256 1.1 cgd
257 1.23 christos #define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | \
258 1.23 christos RES_DNSRCH | RES_NO_NIBBLE2)
259 1.1 cgd
260 1.4 deraadt /*
261 1.4 deraadt * Resolver "pfcode" values. Used by dig.
262 1.4 deraadt */
263 1.9 mrg #define RES_PRF_STATS 0x00000001
264 1.23 christos #define RES_PRF_UPDATE 0x00000002
265 1.9 mrg #define RES_PRF_CLASS 0x00000004
266 1.9 mrg #define RES_PRF_CMD 0x00000008
267 1.9 mrg #define RES_PRF_QUES 0x00000010
268 1.9 mrg #define RES_PRF_ANS 0x00000020
269 1.9 mrg #define RES_PRF_AUTH 0x00000040
270 1.9 mrg #define RES_PRF_ADD 0x00000080
271 1.9 mrg #define RES_PRF_HEAD1 0x00000100
272 1.9 mrg #define RES_PRF_HEAD2 0x00000200
273 1.9 mrg #define RES_PRF_TTLID 0x00000400
274 1.9 mrg #define RES_PRF_HEADX 0x00000800
275 1.9 mrg #define RES_PRF_QUERY 0x00001000
276 1.9 mrg #define RES_PRF_REPLY 0x00002000
277 1.23 christos #define RES_PRF_INIT 0x00004000
278 1.23 christos #define RES_PRF_TRUNC 0x00008000
279 1.23 christos /* 0x00010000 */
280 1.9 mrg
281 1.23 christos /* Things involving an internal (static) resolver context. */
282 1.23 christos __BEGIN_DECLS
283 1.23 christos extern struct __res_state *__res_get_state(void);
284 1.23 christos extern void __res_put_state(struct __res_state *);
285 1.23 christos
286 1.24 christos /*
287 1.24 christos * Source and Binary compatibility; _res will not work properly
288 1.24 christos * with multi-threaded programs.
289 1.24 christos */
290 1.24 christos extern struct __res_state *__res_state(void);
291 1.24 christos #define _res (*__res_state())
292 1.9 mrg
293 1.23 christos __END_DECLS
294 1.4 deraadt
295 1.23 christos #ifndef __BIND_NOSTATIC
296 1.23 christos #define fp_nquery __fp_nquery
297 1.23 christos #define fp_query __fp_query
298 1.23 christos #define hostalias __hostalias
299 1.23 christos #define p_query __p_query
300 1.23 christos #define res_close __res_close
301 1.23 christos #define res_opt __res_opt
302 1.23 christos #define res_isourserver __res_isourserver
303 1.25 christos #define res_querydomain __res_querydomain
304 1.23 christos #define res_send __res_send
305 1.23 christos #define res_sendsigned __res_sendsigned
306 1.10 mrg
307 1.25 christos #ifdef BIND_RES_POSIX3
308 1.25 christos #define dn_expand __dn_expand
309 1.25 christos #define res_init __res_init
310 1.25 christos #define res_query __res_query
311 1.25 christos #define res_search __res_search
312 1.25 christos #define res_mkquery __res_mkquery
313 1.25 christos #endif
314 1.25 christos
315 1.23 christos __BEGIN_DECLS
316 1.30 perry void fp_nquery(const u_char *, int, FILE *);
317 1.30 perry void fp_query(const u_char *, FILE *);
318 1.30 perry const char * hostalias(const char *);
319 1.30 perry void p_query(const u_char *);
320 1.30 perry void res_close(void);
321 1.30 perry int res_init(void);
322 1.30 perry int res_opt(int, u_char *, int, int);
323 1.30 perry int res_isourserver(const struct sockaddr_in *);
324 1.30 perry int res_mkquery(int, const char *, int, int, const u_char *,
325 1.30 perry int, const u_char *, u_char *, int);
326 1.30 perry int res_query(const char *, int, int, u_char *, int);
327 1.30 perry int res_querydomain(const char *, const char *, int, int,
328 1.30 perry u_char *, int);
329 1.30 perry int res_search(const char *, int, int, u_char *, int);
330 1.30 perry int res_send(const u_char *, int, u_char *, int);
331 1.30 perry int res_sendsigned(const u_char *, int, ns_tsig_key *,
332 1.30 perry u_char *, int);
333 1.23 christos __END_DECLS
334 1.18 itojun #endif
335 1.23 christos
336 1.23 christos #if !defined(SHARED_LIBBIND) || defined(LIB)
337 1.23 christos /*
338 1.23 christos * If libbind is a shared object (well, DLL anyway)
339 1.23 christos * these externs break the linker when resolv.h is
340 1.23 christos * included by a lib client (like named)
341 1.23 christos * Make them go away if a client is including this
342 1.23 christos *
343 1.23 christos */
344 1.23 christos extern const struct res_sym __p_key_syms[];
345 1.23 christos extern const struct res_sym __p_cert_syms[];
346 1.10 mrg extern const struct res_sym __p_class_syms[];
347 1.10 mrg extern const struct res_sym __p_type_syms[];
348 1.23 christos extern const struct res_sym __p_rcode_syms[];
349 1.23 christos #endif /* SHARED_LIBBIND */
350 1.1 cgd
351 1.23 christos #define b64_ntop __b64_ntop
352 1.23 christos #define b64_pton __b64_pton
353 1.23 christos #define dn_comp __dn_comp
354 1.23 christos #define dn_count_labels __dn_count_labels
355 1.23 christos #define dn_skipname __dn_skipname
356 1.23 christos #define fp_resstat __fp_resstat
357 1.23 christos #define loc_aton __loc_aton
358 1.23 christos #define loc_ntoa __loc_ntoa
359 1.23 christos #define p_cdname __p_cdname
360 1.23 christos #define p_cdnname __p_cdnname
361 1.23 christos #define p_class __p_class
362 1.23 christos #define p_fqname __p_fqname
363 1.23 christos #define p_fqnname __p_fqnname
364 1.23 christos #define p_option __p_option
365 1.23 christos #define p_secstodate __p_secstodate
366 1.23 christos #define p_section __p_section
367 1.23 christos #define p_time __p_time
368 1.23 christos #define p_type __p_type
369 1.23 christos #define p_rcode __p_rcode
370 1.23 christos #define p_sockun __p_sockun
371 1.23 christos #define putlong __putlong
372 1.23 christos #define putshort __putshort
373 1.23 christos #define res_dnok __res_dnok
374 1.23 christos #define res_findzonecut __res_findzonecut
375 1.23 christos #define res_findzonecut2 __res_findzonecut2
376 1.23 christos #define res_hnok __res_hnok
377 1.23 christos #define res_hostalias __res_hostalias
378 1.23 christos #define res_mailok __res_mailok
379 1.23 christos #define res_nameinquery __res_nameinquery
380 1.23 christos #define res_nclose __res_nclose
381 1.23 christos #define res_ninit __res_ninit
382 1.23 christos #define res_nmkquery __res_nmkquery
383 1.23 christos #define res_pquery __res_pquery
384 1.23 christos #define res_nquery __res_nquery
385 1.23 christos #define res_nquerydomain __res_nquerydomain
386 1.23 christos #define res_nsearch __res_nsearch
387 1.23 christos #define res_nsend __res_nsend
388 1.23 christos #define res_nsendsigned __res_nsendsigned
389 1.23 christos #define res_nisourserver __res_nisourserver
390 1.23 christos #define res_ownok __res_ownok
391 1.23 christos #define res_queriesmatch __res_queriesmatch
392 1.23 christos #define res_randomid __res_randomid
393 1.23 christos #define sym_ntop __sym_ntop
394 1.23 christos #define sym_ntos __sym_ntos
395 1.23 christos #define sym_ston __sym_ston
396 1.23 christos #define res_nopt __res_nopt
397 1.23 christos #define res_ndestroy __res_ndestroy
398 1.23 christos #define res_nametoclass __res_nametoclass
399 1.23 christos #define res_nametotype __res_nametotype
400 1.23 christos #define res_setservers __res_setservers
401 1.23 christos #define res_getservers __res_getservers
402 1.23 christos #define res_buildprotolist __res_buildprotolist
403 1.23 christos #define res_destroyprotolist __res_destroyprotolist
404 1.23 christos #define res_destroyservicelist __res_destroyservicelist
405 1.23 christos #define res_get_nibblesuffix __res_get_nibblesuffix
406 1.23 christos #define res_get_nibblesuffix2 __res_get_nibblesuffix2
407 1.23 christos #define res_ourserver_p __res_ourserver_p
408 1.23 christos #define res_protocolname __res_protocolname
409 1.23 christos #define res_protocolnumber __res_protocolnumber
410 1.23 christos #define res_send_setqhook __res_send_setqhook
411 1.23 christos #define res_send_setrhook __res_send_setrhook
412 1.23 christos #define res_servicename __res_servicename
413 1.23 christos #define res_servicenumber __res_servicenumber
414 1.1 cgd __BEGIN_DECLS
415 1.30 perry int res_hnok(const char *);
416 1.30 perry int res_ownok(const char *);
417 1.30 perry int res_mailok(const char *);
418 1.30 perry int res_dnok(const char *);
419 1.30 perry int sym_ston(const struct res_sym *, const char *, int *);
420 1.30 perry const char * sym_ntos(const struct res_sym *, int, int *);
421 1.30 perry const char * sym_ntop(const struct res_sym *, int, int *);
422 1.30 perry int b64_ntop(u_char const *, size_t, char *, size_t);
423 1.30 perry int b64_pton(char const *, u_char *, size_t);
424 1.30 perry int loc_aton(const char *, u_char *);
425 1.30 perry const char * loc_ntoa(const u_char *, char *);
426 1.30 perry int dn_skipname(const u_char *, const u_char *);
427 1.30 perry void putlong(u_int32_t, u_char *);
428 1.30 perry void putshort(u_int16_t, u_char *);
429 1.23 christos #ifndef __ultrix__
430 1.30 perry u_int16_t _getshort(const u_char *);
431 1.30 perry u_int32_t _getlong(const u_char *);
432 1.23 christos #endif
433 1.30 perry const char * p_class(int);
434 1.30 perry const char * p_time(u_int32_t);
435 1.30 perry const char * p_type(int);
436 1.30 perry const char * p_rcode(int);
437 1.30 perry const char * p_sockun(union res_sockaddr_union, char *, size_t);
438 1.30 perry const u_char * p_cdnname(const u_char *, const u_char *, int, FILE *);
439 1.30 perry const u_char * p_cdname(const u_char *, const u_char *, FILE *);
440 1.30 perry const u_char * p_fqnname(const u_char *, const u_char *,
441 1.30 perry int, char *, int);
442 1.30 perry const u_char * p_fqname(const u_char *, const u_char *, FILE *);
443 1.30 perry const char * p_option(u_long);
444 1.30 perry char * p_secstodate(u_long);
445 1.30 perry int dn_count_labels(const char *);
446 1.30 perry int dn_comp(const char *, u_char *, int, u_char **, u_char **);
447 1.30 perry int dn_expand(const u_char *, const u_char *, const u_char *,
448 1.30 perry char *, int);
449 1.30 perry u_int res_randomid(void);
450 1.30 perry int res_nameinquery(const char *, int, int, const u_char *,
451 1.30 perry const u_char *);
452 1.30 perry int res_queriesmatch(const u_char *, const u_char *,
453 1.30 perry const u_char *, const u_char *);
454 1.30 perry const char * p_section(int, int);
455 1.23 christos /* Things involving a resolver context. */
456 1.30 perry int res_ninit(res_state);
457 1.30 perry int res_nisourserver(const res_state, const struct sockaddr_in *);
458 1.30 perry void fp_resstat(const res_state, FILE *);
459 1.30 perry void res_pquery(const res_state, const u_char *, int, FILE *);
460 1.30 perry const char * res_hostalias(const res_state, const char *, char *, size_t);
461 1.30 perry int res_nquery(res_state, const char *, int, int, u_char *, int);
462 1.30 perry int res_nsearch(res_state, const char *, int, int, u_char *, int);
463 1.30 perry int res_nquerydomain(res_state, const char *, const char *,
464 1.30 perry int, int, u_char *, int);
465 1.30 perry int res_nmkquery(res_state, int, const char *, int, int,
466 1.23 christos const u_char *, int, const u_char *,
467 1.30 perry u_char *, int);
468 1.30 perry int res_nsend(res_state, const u_char *, int, u_char *, int);
469 1.30 perry int res_nsendsigned(res_state, const u_char *, int,
470 1.30 perry ns_tsig_key *, u_char *, int);
471 1.30 perry int res_findzonecut(res_state, const char *, ns_class, int,
472 1.30 perry char *, size_t, struct in_addr *, int);
473 1.30 perry int res_findzonecut2(res_state, const char *, ns_class, int,
474 1.23 christos char *, size_t,
475 1.30 perry union res_sockaddr_union *, int);
476 1.30 perry void res_nclose(res_state);
477 1.30 perry int res_nopt(res_state, int, u_char *, int, int);
478 1.30 perry void res_send_setqhook(res_send_qhook);
479 1.30 perry void res_send_setrhook(res_send_rhook);
480 1.30 perry int __res_vinit(res_state, int);
481 1.30 perry void res_destroyservicelist(void);
482 1.30 perry const char * res_servicename(u_int16_t, const char *);
483 1.30 perry const char * res_protocolname(int);
484 1.30 perry void res_destroyprotolist(void);
485 1.30 perry void res_buildprotolist(void);
486 1.30 perry const char * res_get_nibblesuffix(res_state);
487 1.30 perry const char * res_get_nibblesuffix2(res_state);
488 1.30 perry void res_ndestroy(res_state);
489 1.30 perry u_int16_t res_nametoclass(const char *, int *);
490 1.30 perry u_int16_t res_nametotype(const char *, int *);
491 1.30 perry void res_setservers(res_state,
492 1.30 perry const union res_sockaddr_union *, int);
493 1.30 perry int res_getservers(res_state,
494 1.30 perry union res_sockaddr_union *, int);
495 1.1 cgd __END_DECLS
496 1.1 cgd
497 1.1 cgd #endif /* !_RESOLV_H_ */
498