Import more of bind-4.9.3-REL (part 2 of several)

This commit is contained in:
Peter Wemm 1996-01-07 06:14:57 +00:00
parent 36c86aa181
commit 7bc9f47a48
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/vendor/bind4/dist/; revision=13302
3 changed files with 46 additions and 9 deletions

View File

@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "$Id: dig.c,v 8.4 1995/06/19 08:35:06 vixie Exp $";
static char rcsid[] = "$Id: dig.c,v 8.6 1995/12/29 21:08:13 vixie Exp $";
#endif
/*
@ -288,6 +288,7 @@ main(argc, argv)
res_init();
_res.pfcode = PRF_DEF;
qtypeSet = 0;
bzero(domain, (sizeof domain));
gethostname(myhostname, (sizeof myhostname));
defsrv = strcat(defbuf, inet_ntoa(_res.nsaddr.sin_addr));
res_x = _res;
@ -648,7 +649,8 @@ main(argc, argv)
continue;
}
eecode = 0;
__fp_resstat(NULL, stdout);
if (_res.pfcode & RES_PRF_HEAD1)
__fp_resstat(NULL, stdout);
(void) gettimeofday(&start_time, NULL);
if ((bytes_in = n = res_send(packet, n,
answer, sizeof(answer))) < 0) {
@ -902,14 +904,19 @@ res_re_init()
static char localdomain[] = "LOCALDOMAIN";
char *buf;
long pfcode = _res.pfcode;
#if defined(__RES) && (__RES >= 19931104)
long ndots = _res.ndots;
#endif
/* this is ugly but putenv() is more portable than setenv() */
buf = malloc((sizeof localdomain) +strlen(_res.defdname) +10/*fuzz*/);
sprintf(buf, "%s=%s", localdomain, _res.defdname);
putenv(buf); /* keeps the argument, so we won't free it */
_res.options &= ~RES_INIT;
res_init();
_res.pfcode = pfcode;
#if defined(__RES) && (__RES >= 19931104)
_res.ndots = ndots;
#endif
}

View File

@ -72,10 +72,22 @@ char *argv[];
type = T_A;
else if (!strcasecmp(optarg, "NS"))
type = T_NS;
else if (!strcasecmp(optarg, "MD"))
type = T_MD;
else if (!strcasecmp(optarg, "MF"))
type = T_MF;
else if (!strcasecmp(optarg, "CNAME"))
type = T_CNAME;
else if (!strcasecmp(optarg, "SOA"))
type = T_SOA;
else if (!strcasecmp(optarg, "MB"))
type = T_MB;
else if (!strcasecmp(optarg, "MG"))
type = T_MG;
else if (!strcasecmp(optarg, "MR"))
type = T_MR;
else if (!strcasecmp(optarg, "NULL"))
type = T_NULL;
else if (!strcasecmp(optarg, "WKS"))
type = T_WKS;
else if (!strcasecmp(optarg, "PTR"))
@ -86,16 +98,34 @@ char *argv[];
type = T_MINFO;
else if (!strcasecmp(optarg, "MX"))
type = T_MX;
else if (!strcasecmp(optarg, "MG"))
type = T_MG;
else if (!strcasecmp(optarg, "RP"))
type = T_RP;
else if (!strcasecmp(optarg, "TXT"))
type = T_TXT;
else if (!strcasecmp(optarg, "RP"))
type = T_RP;
else if (!strcasecmp(optarg, "AFSDB"))
type = T_AFSDB;
else if (!strcasecmp(optarg, "ANY"))
type = T_ANY;
else if (!strcasecmp(optarg, "X25"))
type = T_X25;
else if (!strcasecmp(optarg, "ISDN"))
type = T_ISDN;
else if (!strcasecmp(optarg, "RT"))
type = T_RT;
else if (!strcasecmp(optarg, "NSAP"))
type = T_NSAP;
else if (!strcasecmp(optarg, "SIG"))
type = T_SIG;
else if (!strcasecmp(optarg, "KEY"))
type = T_KEY;
else if (!strcasecmp(optarg, "PX"))
type = T_PX;
else if (!strcasecmp(optarg, "GPOS"))
type = T_GPOS;
else if (!strcasecmp(optarg, "AAAA"))
type = T_AAAA;
else if (!strcasecmp(optarg, "LOC"))
type = T_LOC;
else {
fprintf(stderr, "Bad type (%s)\n", optarg);
exit(-1);

View File

@ -67,7 +67,7 @@ char copyright[] =
*/
#ifndef lint
static char rcsid[] = "$Id: host.c,v 8.7 1995/08/22 05:01:49 vixie Exp $";
static char rcsid[] = "$Id: host.c,v 8.8 1995/12/06 20:34:52 vixie Exp $";
#endif /* not lint */
#include <sys/types.h>
@ -813,7 +813,7 @@ pr_rr(cp, msg, file, filter)
case T_AFSDB:
case T_RT:
if (doprint)
if (type == T_MX)
if (type == T_MX && !verbose)
fprintf(file," (pri=%d) by ", _getshort(cp));
else
if (verbose)