1 | /* Modified for EMX by hv 1994,1996
|
---|
2 | *
|
---|
3 | * Copyright (c) 1983, 1987, 1989 The Regents of the University of California.
|
---|
4 | * All rights reserved.
|
---|
5 | *
|
---|
6 | * Redistribution and use in source and binary forms, with or without
|
---|
7 | * modification, are permitted provided that the following conditions
|
---|
8 | * are met:
|
---|
9 | * 1. Redistributions of source code must retain the above copyright
|
---|
10 | * notice, this list of conditions and the following disclaimer.
|
---|
11 | * 2. Redistributions in binary form must reproduce the above copyright
|
---|
12 | * notice, this list of conditions and the following disclaimer in the
|
---|
13 | * documentation and/or other materials provided with the distribution.
|
---|
14 | * 3. All advertising materials mentioning features or use of this software
|
---|
15 | * must display the following acknowledgement:
|
---|
16 | * This product includes software developed by the University of
|
---|
17 | * California, Berkeley and its contributors.
|
---|
18 | * 4. Neither the name of the University nor the names of its contributors
|
---|
19 | * may be used to endorse or promote products derived from this software
|
---|
20 | * without specific prior written permission.
|
---|
21 | *
|
---|
22 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
---|
23 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
---|
24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
---|
25 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
---|
26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
---|
27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
---|
28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
---|
29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
---|
30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
---|
31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
---|
32 | * SUCH DAMAGE.
|
---|
33 | *
|
---|
34 | * from: @(#)resolv.h 5.15 (Berkeley) 4/3/91
|
---|
35 | * resolv.h,v 1.1 2003/04/16 15:53:07 bird Exp
|
---|
36 | */
|
---|
37 |
|
---|
38 | #ifndef _RESOLV_H_
|
---|
39 | #define _RESOLV_H_
|
---|
40 |
|
---|
41 | #if defined (__cplusplus)
|
---|
42 | extern "C" {
|
---|
43 | #endif
|
---|
44 |
|
---|
45 | #pragma pack(4)
|
---|
46 |
|
---|
47 | /*
|
---|
48 | * Resolver configuration file.
|
---|
49 | * Normally not present, but may contain the address of the
|
---|
50 | * inital name server(s) to query and the domain search list.
|
---|
51 | */
|
---|
52 |
|
---|
53 | #ifndef _PATH_RESCONF
|
---|
54 | #define _PATH_RESCONF "/tcpip/etc/resolv.conf"
|
---|
55 | #endif
|
---|
56 |
|
---|
57 | /*
|
---|
58 | * Global defines and variables for resolver stub.
|
---|
59 | */
|
---|
60 | #define MAXNS 3 /* max # name servers we'll track */
|
---|
61 | #define MAXDFLSRCH 3 /* # default domain levels to try */
|
---|
62 | #define MAXDNSRCH 6 /* max # domains in search path */
|
---|
63 | #define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */
|
---|
64 | #define MAXDNSLUS 4 /* max # of host lookup types */
|
---|
65 |
|
---|
66 | #define RES_TIMEOUT 5 /* min. seconds between retries */
|
---|
67 |
|
---|
68 | #pragma pack(4)
|
---|
69 | struct state {
|
---|
70 | int retrans; /* retransmition time interval */
|
---|
71 | int retry; /* number of times to retransmit */
|
---|
72 | long options; /* option flags - see below. */
|
---|
73 | int nscount; /* number of name servers */
|
---|
74 | struct sockaddr_in nsaddr_list[MAXNS]; /* address of name server */
|
---|
75 | #define nsaddr nsaddr_list[0] /* for backward compatibility */
|
---|
76 | u_short id; /* current packet id */
|
---|
77 | char defdname[MAXDNAME]; /* default domain */
|
---|
78 | char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */
|
---|
79 | /* char lookups[MAXDNSLUS];*/ /* not in OS/2 */
|
---|
80 | };
|
---|
81 | #pragma pack(1)
|
---|
82 |
|
---|
83 | /*
|
---|
84 | * Resolver options
|
---|
85 | */
|
---|
86 | #define RES_INIT 0x0001 /* address initialized */
|
---|
87 | #define RES_DEBUG 0x0002 /* print debug messages */
|
---|
88 | #define RES_AAONLY 0x0004 /* authoritative answers only */
|
---|
89 | #define RES_USEVC 0x0008 /* use virtual circuit */
|
---|
90 | #define RES_PRIMARY 0x0010 /* query primary server only */
|
---|
91 | #define RES_IGNTC 0x0020 /* ignore trucation errors */
|
---|
92 | #define RES_RECURSE 0x0040 /* recursion desired */
|
---|
93 | #define RES_DEFNAMES 0x0080 /* use default domain name */
|
---|
94 | #define RES_STAYOPEN 0x0100 /* Keep TCP socket open */
|
---|
95 | #define RES_DNSRCH 0x0200 /* search up local domain tree */
|
---|
96 |
|
---|
97 | #define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH)
|
---|
98 |
|
---|
99 | extern struct state _res;
|
---|
100 |
|
---|
101 | /* Private routines shared between libc/net, named, nslookup and others. */
|
---|
102 | int dn_skipname (__const__ u_char *, __const__ u_char *);
|
---|
103 | void putlong (u_long, u_char *);
|
---|
104 | void putshort (u_short, u_char *);
|
---|
105 |
|
---|
106 | /* public routines */
|
---|
107 | int dn_comp(__const__ u_char *, u_char *, int, u_char **, u_char **);
|
---|
108 | int dn_expand(__const__ u_char *, __const__ u_char *, __const__ u_char *,
|
---|
109 | u_char *, int);
|
---|
110 | int res_init(void);
|
---|
111 | int res_mkquery(int, __const__ char *, int, int, __const__ char *, int,
|
---|
112 | __const__ struct rrec *, char *, int);
|
---|
113 | int res_send(__const__ char *, int, char *, int);
|
---|
114 |
|
---|
115 | #if defined (__cplusplus)
|
---|
116 | }
|
---|
117 | #endif
|
---|
118 |
|
---|
119 | #endif /* !_RESOLV_H_ */
|
---|