| 1 | /* |
| 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. |
| 16 | * |
| 17 | * @(#)resolv.h 5.6 (Berkeley) %G% |
| 18 | */ |
| 19 | |
| 20 | /* |
| 21 | * Global defines and variables for resolver stub. |
| 22 | */ |
| 23 | #define MAXNS 3 /* max # name servers we'll track */ |
| 24 | #define MAXDNSRCH 3 /* max # default domain levels to try */ |
| 25 | #define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */ |
| 26 | |
| 27 | #define RES_TIMEOUT 4 /* seconds between retries */ |
| 28 | |
| 29 | struct state { |
| 30 | int retrans; /* retransmition time interval */ |
| 31 | int retry; /* number of times to retransmit */ |
| 32 | long options; /* option flags - see below. */ |
| 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 */ |
| 36 | u_short id; /* current packet id */ |
| 37 | char defdname[MAXDNAME]; /* default domain */ |
| 38 | char *dnsrch[MAXDNSRCH+1]; /* components of domain to search */ |
| 39 | }; |
| 40 | |
| 41 | /* |
| 42 | * Resolver options |
| 43 | */ |
| 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 */ |
| 53 | #define RES_DNSRCH 0x0200 /* search up local domain tree */ |
| 54 | |
| 55 | #define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH) |
| 56 | |
| 57 | extern struct state _res; |
| 58 | extern char *p_cdname(), *p_rr(), *p_type(), *p_class(); |