Commit | Line | Data |
---|---|---|
bb0cfa24 | 1 | /* |
7ee32d6e KB |
2 | * Copyright (c) 1983, 1987 The Regents of the University of California. |
3 | * All rights reserved. | |
4 | * | |
5 | * Redistribution and use in source and binary forms are permitted | |
6 | * provided that the above copyright notice and this paragraph are | |
7 | * duplicated in all such forms and that any documentation, | |
8 | * advertising materials, and other materials related to such | |
9 | * distribution and use acknowledge that the software was developed | |
10 | * by the University of California, Berkeley. The name of the | |
11 | * University may not be used to endorse or promote products derived | |
12 | * from this software without specific prior written permission. | |
13 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
14 | * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
15 | * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
bb0cfa24 | 16 | * |
7ee32d6e | 17 | * @(#)resolv.h 5.6 (Berkeley) %G% |
bb0cfa24 DF |
18 | */ |
19 | ||
a4b4ca70 RC |
20 | /* |
21 | * Global defines and variables for resolver stub. | |
22 | */ | |
8fa684c1 | 23 | #define MAXNS 3 /* max # name servers we'll track */ |
e0bab101 MK |
24 | #define MAXDNSRCH 3 /* max # default domain levels to try */ |
25 | #define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */ | |
8fa684c1 | 26 | |
e0bab101 | 27 | #define RES_TIMEOUT 4 /* seconds between retries */ |
8fa684c1 | 28 | |
a4b4ca70 | 29 | struct state { |
8fa684c1 | 30 | int retrans; /* retransmition time interval */ |
a4b4ca70 | 31 | int retry; /* number of times to retransmit */ |
1ca41cc2 | 32 | long options; /* option flags - see below. */ |
8fa684c1 KD |
33 | int nscount; /* number of name servers */ |
34 | struct sockaddr_in nsaddr_list[MAXNS]; /* address of name server */ | |
35 | #define nsaddr nsaddr_list[0] /* for backward compatibility */ | |
a4b4ca70 RC |
36 | u_short id; /* current packet id */ |
37 | char defdname[MAXDNAME]; /* default domain */ | |
e0bab101 | 38 | char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */ |
a4b4ca70 RC |
39 | }; |
40 | ||
41 | /* | |
42 | * Resolver options | |
43 | */ | |
1ca41cc2 JB |
44 | #define RES_INIT 0x0001 /* address initialized */ |
45 | #define RES_DEBUG 0x0002 /* print debug messages */ | |
46 | #define RES_AAONLY 0x0004 /* authoritative answers only */ | |
47 | #define RES_USEVC 0x0008 /* use virtual circuit */ | |
48 | #define RES_PRIMARY 0x0010 /* query primary server only */ | |
49 | #define RES_IGNTC 0x0020 /* ignore trucation errors */ | |
50 | #define RES_RECURSE 0x0040 /* recursion desired */ | |
51 | #define RES_DEFNAMES 0x0080 /* use default domain name */ | |
52 | #define RES_STAYOPEN 0x0100 /* Keep TCP socket open */ | |
e0bab101 MK |
53 | #define RES_DNSRCH 0x0200 /* search up local domain tree */ |
54 | ||
55 | #define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH) | |
a4b4ca70 RC |
56 | |
57 | extern struct state _res; | |
58 | extern char *p_cdname(), *p_rr(), *p_type(), *p_class(); |