Deleted Added
full compact
resolv.h (1540) resolv.h (3070)
1/*-
2 * Copyright (c) 1983, 1987, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 16 unchanged lines hidden (view full) ---

25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
1/*-
2 * Copyright (c) 1983, 1987, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 16 unchanged lines hidden (view full) ---

25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)resolv.h 8.1 (Berkeley) 6/2/93
34 * $Id: resolv.h,v 4.9.1.2 1993/05/17 09:59:01 vixie Exp $
35 * -
36 * Portions Copyright (c) 1993 by Digital Equipment Corporation.
37 *
38 * Permission to use, copy, modify, and distribute this software for any
39 * purpose with or without fee is hereby granted, provided that the above
40 * copyright notice and this permission notice appear in all copies, and that
41 * the name of Digital Equipment Corporation not be used in advertising or
42 * publicity pertaining to distribution of the document or software without

--- 4 unchanged lines hidden (view full) ---

47 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
48 * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
49 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
50 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
51 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
52 * SOFTWARE.
53 * -
54 * --Copyright--
33 * -
34 * Portions Copyright (c) 1993 by Digital Equipment Corporation.
35 *
36 * Permission to use, copy, modify, and distribute this software for any
37 * purpose with or without fee is hereby granted, provided that the above
38 * copyright notice and this permission notice appear in all copies, and that
39 * the name of Digital Equipment Corporation not be used in advertising or
40 * publicity pertaining to distribution of the document or software without

--- 4 unchanged lines hidden (view full) ---

45 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
46 * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
47 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
48 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
49 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
50 * SOFTWARE.
51 * -
52 * --Copyright--
53 *
54 * @(#)resolv.h 8.1 (Berkeley) 6/2/93
55 * From Id: resolv.h,v 4.9.1.2 1993/05/17 09:59:01 vixie Exp
56 * $Id$
55 */
56
57#ifndef _RESOLV_H_
58#define _RESOLV_H_
59
57 */
58
59#ifndef _RESOLV_H_
60#define _RESOLV_H_
61
62#include <sys/param.h>
60#include <sys/types.h>
63#include <sys/types.h>
64#include <sys/cdefs.h>
65#include <stdio.h>
66
61/*
67/*
68 * revision information. this is the release date in YYYYMMDD format.
69 * it can change every day so the right thing to do with it is use it
70 * in preprocessor commands such as "#if (__RES > 19931104)". do not
71 * compare for equality; rather, use it to determine whether your resolver
72 * is new enough to contain a certain feature.
73 */
74
75#define __RES 19940415
76
77/*
62 * Resolver configuration file.
63 * Normally not present, but may contain the address of the
64 * inital name server(s) to query and the domain search list.
65 */
66
67#ifndef _PATH_RESCONF
78 * Resolver configuration file.
79 * Normally not present, but may contain the address of the
80 * inital name server(s) to query and the domain search list.
81 */
82
83#ifndef _PATH_RESCONF
68#define _PATH_RESCONF "/etc/resolv.conf"
84#define _PATH_RESCONF "/etc/resolv.conf"
69#endif
70
71/*
72 * Global defines and variables for resolver stub.
73 */
74#define MAXNS 3 /* max # name servers we'll track */
75#define MAXDFLSRCH 3 /* # default domain levels to try */
76#define MAXDNSRCH 6 /* max # domains in search path */
77#define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */
78
79#define RES_TIMEOUT 5 /* min. seconds between retries */
85#endif
86
87/*
88 * Global defines and variables for resolver stub.
89 */
90#define MAXNS 3 /* max # name servers we'll track */
91#define MAXDFLSRCH 3 /* # default domain levels to try */
92#define MAXDNSRCH 6 /* max # domains in search path */
93#define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */
94
95#define RES_TIMEOUT 5 /* min. seconds between retries */
96#define MAXRESOLVSORT 10 /* number of net to sort on */
97#define RES_MAXNDOTS 15 /* should reflect bit field size */
80
81struct __res_state {
82 int retrans; /* retransmition time interval */
83 int retry; /* number of times to retransmit */
98
99struct __res_state {
100 int retrans; /* retransmition time interval */
101 int retry; /* number of times to retransmit */
84 long options; /* option flags - see below. */
102 u_long options; /* option flags - see below. */
85 int nscount; /* number of name servers */
103 int nscount; /* number of name servers */
86 struct sockaddr_in nsaddr_list[MAXNS]; /* address of name server */
104 struct sockaddr_in
105 nsaddr_list[MAXNS]; /* address of name server */
87#define nsaddr nsaddr_list[0] /* for backward compatibility */
88 u_short id; /* current packet id */
89 char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */
90 char defdname[MAXDNAME]; /* default domain */
106#define nsaddr nsaddr_list[0] /* for backward compatibility */
107 u_short id; /* current packet id */
108 char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */
109 char defdname[MAXDNAME]; /* default domain */
91 long pfcode; /* RES_PRF_ flags - see below. */
110 u_long pfcode; /* RES_PRF_ flags - see below. */
111 unsigned ndots:4; /* threshold for initial abs. query */
112 unsigned nsort:4; /* number of elements in sort_list[] */
113 char unused[3];
114 struct {
115 struct in_addr addr;
116 u_int32_t mask;
117 } sort_list[MAXRESOLVSORT];
92};
93
94/*
95 * Resolver options (keep these in synch with res_debug.c, please)
96 */
118};
119
120/*
121 * Resolver options (keep these in synch with res_debug.c, please)
122 */
97#define RES_INIT 0x0001 /* address initialized */
98#define RES_DEBUG 0x0002 /* print debug messages */
99#define RES_AAONLY 0x0004 /* authoritative answers only */
100#define RES_USEVC 0x0008 /* use virtual circuit */
101#define RES_PRIMARY 0x0010 /* query primary server only */
102#define RES_IGNTC 0x0020 /* ignore trucation errors */
103#define RES_RECURSE 0x0040 /* recursion desired */
104#define RES_DEFNAMES 0x0080 /* use default domain name */
105#define RES_STAYOPEN 0x0100 /* Keep TCP socket open */
106#define RES_DNSRCH 0x0200 /* search up local domain tree */
123#define RES_INIT 0x00000001 /* address initialized */
124#define RES_DEBUG 0x00000002 /* print debug messages */
125#define RES_AAONLY 0x00000004 /* authoritative answers only */
126#define RES_USEVC 0x00000008 /* use virtual circuit */
127#define RES_PRIMARY 0x00000010 /* query primary server only */
128#define RES_IGNTC 0x00000020 /* ignore trucation errors */
129#define RES_RECURSE 0x00000040 /* recursion desired */
130#define RES_DEFNAMES 0x00000080 /* use default domain name */
131#define RES_STAYOPEN 0x00000100 /* Keep TCP socket open */
132#define RES_DNSRCH 0x00000200 /* search up local domain tree */
133#define RES_INSECURE1 0x00000400 /* type 1 security disabled */
134#define RES_INSECURE2 0x00000800 /* type 2 security disabled */
107
135
108#define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH)
136#define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH)
109
110/*
111 * Resolver "pfcode" values. Used by dig.
112 */
137
138/*
139 * Resolver "pfcode" values. Used by dig.
140 */
113#define RES_PRF_STATS 0x0001
114/* 0x0002 */
115#define RES_PRF_CLASS 0x0004
116#define RES_PRF_CMD 0x0008
117#define RES_PRF_QUES 0x0010
118#define RES_PRF_ANS 0x0020
119#define RES_PRF_AUTH 0x0040
120#define RES_PRF_ADD 0x0080
121#define RES_PRF_HEAD1 0x0100
122#define RES_PRF_HEAD2 0x0200
123#define RES_PRF_TTLID 0x0400
124#define RES_PRF_HEADX 0x0800
125#define RES_PRF_QUERY 0x1000
126#define RES_PRF_REPLY 0x2000
127#define RES_PRF_INIT 0x4000
128/* 0x8000 */
141#define RES_PRF_STATS 0x00000001
142/* 0x00000002 */
143#define RES_PRF_CLASS 0x00000004
144#define RES_PRF_CMD 0x00000008
145#define RES_PRF_QUES 0x00000010
146#define RES_PRF_ANS 0x00000020
147#define RES_PRF_AUTH 0x00000040
148#define RES_PRF_ADD 0x00000080
149#define RES_PRF_HEAD1 0x00000100
150#define RES_PRF_HEAD2 0x00000200
151#define RES_PRF_TTLID 0x00000400
152#define RES_PRF_HEADX 0x00000800
153#define RES_PRF_QUERY 0x00001000
154#define RES_PRF_REPLY 0x00002000
155#define RES_PRF_INIT 0x00004000
156/* 0x00008000 */
129
157
130#include <sys/cdefs.h>
131#include <stdio.h>
158/* hooks are still experimental as of 4.9.2 */
159typedef enum { res_goahead, res_nextns, res_modified, res_done, res_error }
160 res_sendhookact;
132
161
162typedef res_sendhookact (*res_send_qhook)__P((struct sockaddr_in * const *ns,
163 const u_char **query,
164 int *querylen,
165 u_char *ans,
166 int anssiz,
167 int *resplen));
168
169typedef res_sendhookact (*res_send_rhook)__P((const struct sockaddr_in *ns,
170 const u_char *query,
171 int querylen,
172 u_char *ans,
173 int anssiz,
174 int *resplen));
175
133extern struct __res_state _res;
134
135/* Private routines shared between libc/net, named, nslookup and others. */
136#define dn_skipname __dn_skipname
137#define fp_query __fp_query
176extern struct __res_state _res;
177
178/* Private routines shared between libc/net, named, nslookup and others. */
179#define dn_skipname __dn_skipname
180#define fp_query __fp_query
181#define fp_nquery __fp_nquery
138#define hostalias __hostalias
139#define putlong __putlong
140#define putshort __putshort
182#define hostalias __hostalias
183#define putlong __putlong
184#define putshort __putshort
141#define p_class __p_class
142#define p_time __p_time
143#define p_type __p_type
185#define p_class __p_class
186#define p_time __p_time
187#define p_type __p_type
188#define p_cdnname __p_cdnname
189#define p_cdname __p_cdname
190#define p_fqname __p_fqname
191#define p_rr __p_rr
192#define p_option __p_option
193
144__BEGIN_DECLS
145int __dn_skipname __P((const u_char *, const u_char *));
146void __fp_resstat __P((struct __res_state *, FILE *));
194__BEGIN_DECLS
195int __dn_skipname __P((const u_char *, const u_char *));
196void __fp_resstat __P((struct __res_state *, FILE *));
147void __fp_query __P((char *, FILE *));
197void __fp_query __P((const u_char *, FILE *));
198void __fp_nquery __P((const u_char *, int, FILE *));
148char *__hostalias __P((const char *));
149void __putlong __P((u_int32_t, u_char *));
199char *__hostalias __P((const char *));
200void __putlong __P((u_int32_t, u_char *));
150void __putshort __P((u_short, u_char *));
151char *__p_class __P((int));
201void __putshort __P((u_int16_t, u_char *));
152char *__p_time __P((u_int32_t));
202char *__p_time __P((u_int32_t));
153char *__p_type __P((int));
154
155int dn_comp __P((const u_char *, u_char *, int, u_char **, u_char **));
203void __p_query __P((const u_char *));
204const u_char *__p_cdnname __P((const u_char *, const u_char *, int, FILE *));
205const u_char *__p_cdname __P((const u_char *, const u_char *, FILE *));
206const u_char *__p_fqname __P((const u_char *, const u_char *, FILE *));
207const u_char *__p_rr __P((const u_char *, const u_char *, FILE *));
208const char *__p_type __P((int));
209const char *__p_class __P((int));
210const char *__p_option __P((u_long option));
211int dn_comp __P((const char *, u_char *, int, u_char **, u_char **));
156int dn_expand __P((const u_char *, const u_char *, const u_char *,
212int dn_expand __P((const u_char *, const u_char *, const u_char *,
157 u_char *, int));
213 char *, int));
158int res_init __P((void));
214int res_init __P((void));
159int res_mkquery __P((int, const char *, int, int, const char *, int,
160 const char *, char *, int));
161int res_send __P((const char *, int, char *, int));
215int res_query __P((const char *, int, int, u_char *, int));
216int res_search __P((const char *, int, int, u_char *, int));
217int res_querydomain __P((const char *, const char *, int, int,
218 u_char *, int));
219int res_mkquery __P((int, const char *, int, int, const u_char *, int,
220 const u_char *, u_char *, int));
221int res_send __P((const u_char *, int, u_char *, int));
162__END_DECLS
163
164#endif /* !_RESOLV_H_ */
222__END_DECLS
223
224#endif /* !_RESOLV_H_ */