diff options
author | peter <peter@FreeBSD.org> | 1995-08-20 22:32:57 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1995-08-20 22:32:57 +0000 |
commit | 16e639215679637a006b04d6a2a6521d49304d29 (patch) | |
tree | 2677989c4b0a8dc94ed90d8738113633ef16ed13 /usr.sbin/nslookup | |
parent | baa68db6b6ff6352a217cee0f6d3710239b986e1 (diff) | |
download | FreeBSD-src-16e639215679637a006b04d6a2a6521d49304d29.zip FreeBSD-src-16e639215679637a006b04d6a2a6521d49304d29.tar.gz |
Update the DNS tools from 4.9.3-b9 -> 4.9.3-b24
Diffstat (limited to 'usr.sbin/nslookup')
-rw-r--r-- | usr.sbin/nslookup/debug.c | 23 | ||||
-rw-r--r-- | usr.sbin/nslookup/list.c | 59 | ||||
-rw-r--r-- | usr.sbin/nslookup/nslookup.help | 2 | ||||
-rw-r--r-- | usr.sbin/nslookup/subr.c | 12 |
4 files changed, 74 insertions, 22 deletions
diff --git a/usr.sbin/nslookup/debug.c b/usr.sbin/nslookup/debug.c index 9f63873..24a5ca7 100644 --- a/usr.sbin/nslookup/debug.c +++ b/usr.sbin/nslookup/debug.c @@ -55,7 +55,7 @@ #ifndef lint static char sccsid[] = "@(#)debug.c 5.26 (Berkeley) 3/21/91"; -static char rcsid[] = "$Id: debug.c,v 1.2 1994/09/22 21:50:31 pst Exp $"; +static char rcsid[] = "$Id: debug.c,v 1.3 1995/05/30 03:49:13 rgrimes Exp $"; #endif /* not lint */ /* @@ -140,8 +140,6 @@ Fprint_query(msg, eom, printHeader,file) fprintf(file,", want recursion"); if (hp->ra) fprintf(file,", recursion avail."); - if (hp->pr) - fprintf(file,", primary"); fprintf(file,"\n\tquestions = %d", ntohs(hp->qdcount)); fprintf(file,", answers = %d", ntohs(hp->ancount)); fprintf(file,", authority records = %d", ntohs(hp->nscount)); @@ -335,6 +333,15 @@ Print_rr(cp, msg, eom, file) cp += INT16SZ; fprintf(file,", mail exchanger = "); goto doname; + case T_PX: + fprintf(file,"\tpreference = %u",_getshort((u_char*)cp)); + cp += INT16SZ; + fprintf(file,", RFC 822 = "); + cp = Print_cdname(cp, msg, eom, file); + fprintf(file,"\nX.400 = "); + cp = Print_cdname(cp, msg, eom, file); + (void) putc('\n', file); + break; case T_RT: fprintf(file,"\tpreference = %u",_getshort((u_char*)cp)); cp += INT16SZ; @@ -356,22 +363,24 @@ doname: break; case T_HINFO: + cp2 = cp + dlen; if (n = *cp++) { fprintf(file,"\tCPU = %.*s", n, cp); cp += n; } - if (n = *cp++) { + if ((cp < cp2) && (n = *cp++)) { fprintf(file,"\tOS = %.*s\n", n, cp); cp += n; - } + } else fprintf(file, "\n*** Warning *** OS-type missing\n"); break; case T_ISDN: + cp2 = cp + dlen; if (n = *cp++) { fprintf(file,"\tISDN = \"%.*s", n, cp); cp += n; } - if (n = *cp++) { + if ((cp < cp2) && (n = *cp++)) { fprintf(file,"-%.*s\"\n", n, cp); cp += n; } else fprintf(file,"\"\n"); @@ -427,7 +436,7 @@ doname: while (cp < cp2) { if (n = (unsigned char) *cp++) { for (c = n; c > 0 && cp < cp2; c--) - if (*cp == '\n') { + if ((*cp == '\n') || (*cp == '"')) { (void) putc('\\', file); (void) putc(*cp++, file); } else diff --git a/usr.sbin/nslookup/list.c b/usr.sbin/nslookup/list.c index bc187fa..da9c7e0 100644 --- a/usr.sbin/nslookup/list.c +++ b/usr.sbin/nslookup/list.c @@ -55,7 +55,7 @@ #ifndef lint static char sccsid[] = "@(#)list.c 5.23 (Berkeley) 3/21/91"; -static char rcsid[] = "$Id: list.c,v 1.2 1994/09/22 21:50:34 pst Exp $"; +static char rcsid[] = "$Id: list.c,v 1.3 1995/05/30 03:49:15 rgrimes Exp $"; #endif /* not lint */ /* @@ -204,6 +204,8 @@ ListHosts(string, putToFile) qtype = T_HINFO; } else if (strcmp("-m", option) == 0) { qtype = T_MX; + } else if (strcmp("-p", option) == 0) { + qtype = T_PX; } else if (strcmp("-s", option) == 0) { qtype = T_WKS; } else if (strcmp("-d", option) == 0) { @@ -357,6 +359,9 @@ ListSubr(qtype, domain, cmd) case T_MX: fprintf(filePtr, " %-30s\n", "Metric & Host"); break; + case T_PX: + fprintf(filePtr, " %-30s\n", "Mapping information"); + break; case T_AFSDB: fprintf(filePtr, " %-30s\n", "Subtype & Host"); break; @@ -402,6 +407,9 @@ ListSubr(qtype, domain, cmd) case T_NSAP: fprintf(filePtr, " %-30s\n", "NSAP address"); break; + case T_NSAP_PTR: + fprintf(filePtr, " %-30s\n", "NSAP pointer"); + break; case T_NS: fprintf(filePtr, " %-30s\n", "Name Servers"); break; @@ -446,7 +454,7 @@ ListSubr(qtype, domain, cmd) * The server sent too much data to fit the existing buffer -- * allocate a new one. */ - if (len > answerLen) { + if (len > (u_int)answerLen) { if (answerLen != 0) { free(answer); } @@ -688,6 +696,7 @@ PrintListInfo(file, msg, eom, qtype, domain) case T_NS: case T_PTR: + case T_NSAP_PTR: putc(' ', file); if (qtype != T_ANY) fprintf(file,"%s = ", type == T_PTR ? "host" : "server"); @@ -696,16 +705,21 @@ PrintListInfo(file, msg, eom, qtype, domain) case T_HINFO: case T_ISDN: - if (n = *cp++) { - (void)sprintf(name,"%.*s", n, cp); - fprintf(file," %-10s", name); - cp += n; - } else { - fprintf(file," %-10s", " "); - } - if (n = *cp++) { - fprintf(file," %.*s", n, cp); - cp += n; + { + u_char *cp2 = cp + dlen; + if (n = *cp++) { + (void)sprintf(name,"%.*s", n, cp); + fprintf(file," %-10s", name); + cp += n; + } else { + fprintf(file," %-10s", " "); + } + if (cp == cp2) + break; + if (n = *cp++) { + fprintf(file," %.*s", n, cp); + cp += n; + } } break; @@ -748,6 +762,25 @@ PrintListInfo(file, msg, eom, qtype, domain) fprintf(file, " %s", name2); break; + case T_PX: + pref = _getshort((u_char*)cp); + cp += INT16SZ; + fprintf(file," %-3d ",pref); + nameLen = dn_expand(msg, eom, cp, name2, sizeof name2); + if (nameLen < 0) { + fprintf(file, " ***\n"); + return (ERROR); + } + fprintf(file, " %s", name2); + cp += strlen((char *)cp) + 1; + nameLen = dn_expand(msg, eom, cp, name2, sizeof name2); + if (nameLen < 0) { + fprintf(file, " ***\n"); + return (ERROR); + } + fprintf(file, " %s", name2); + break; + case T_TXT: case T_X25: { @@ -758,7 +791,7 @@ PrintListInfo(file, msg, eom, qtype, domain) while (cp < cp2) { if (n = (unsigned char) *cp++) { for (c = n; c > 0 && cp < cp2; c--) - if (*cp == '\n') { + if ((*cp == '\n') || (*cp == '"')) { (void) putc('\\', file); (void) putc(*cp++, file); } else diff --git a/usr.sbin/nslookup/nslookup.help b/usr.sbin/nslookup/nslookup.help index 09b6897..00340e3 100644 --- a/usr.sbin/nslookup/nslookup.help +++ b/usr.sbin/nslookup/nslookup.help @@ -1,4 +1,4 @@ -$Id: nslookup.help,v 8.2 1995/06/29 09:26:34 vixie Exp $ +$Id: nslookup.help,v 1.1.1.2 1995/08/18 22:31:32 peter Exp $ Commands: (identifiers are shown in uppercase, [] means optional) NAME - print info about the host/domain NAME using default server diff --git a/usr.sbin/nslookup/subr.c b/usr.sbin/nslookup/subr.c index 9f86d15..d7cca0e 100644 --- a/usr.sbin/nslookup/subr.c +++ b/usr.sbin/nslookup/subr.c @@ -55,7 +55,7 @@ #ifndef lint static char sccsid[] = "@(#)subr.c 5.24 (Berkeley) 3/2/91"; -static char rcsid[] = "$Id: subr.c,v 1.2 1994/09/22 21:50:41 pst Exp $"; +static char rcsid[] = "$Id: subr.c,v 1.3 1995/05/30 03:49:20 rgrimes Exp $"; #endif /* not lint */ /* @@ -372,7 +372,9 @@ DecodeError(result) case NXDOMAIN: return("Non-existent host/domain"); break; case NOTIMP: return("Not implemented"); break; case REFUSED: return("Query refused"); break; +#ifdef NOCHANGE case NOCHANGE: return("No change"); break; +#endif case TIME_OUT: return("Timed out"); break; case NO_INFO: return("No information"); break; case ERROR: return("Unspecified error"); break; @@ -428,6 +430,8 @@ StringToType(type, dflt, errorfile) return(T_NS); /* authoritative server */ if (strcasecmp(type, "MX") == 0) return(T_MX); /* mail exchanger */ + if (strcasecmp(type, "PX") == 0) + return(T_PX); /* mapping information */ if (strcasecmp(type, "CNAME") == 0) return(T_CNAME); /* canonical name */ if (strcasecmp(type, "SOA") == 0) @@ -474,6 +478,8 @@ StringToType(type, dflt, errorfile) return(T_AFSDB); /* DCE or AFS server */ if (strcasecmp(type, "NSAP") == 0) return(T_NSAP); /* NSAP address */ + if (strcasecmp(type, "NSAP_PTR") == 0) + return(T_NSAP_PTR); /* NSAP reverse pointer */ if (errorfile) fprintf(errorfile, "unknown query type: %s\n", type); return(dflt); @@ -524,6 +530,8 @@ DecodeType(type) return("mailbox information"); case T_MX: return("mail exchanger"); + case T_PX: + return("mapping information"); case T_TXT: return("text"); case T_RP: @@ -538,6 +546,8 @@ DecodeType(type) return("router"); case T_NSAP: return("nsap address"); + case T_NSAP_PTR: + return("domain name pointer"); case T_UINFO: return("user information"); case T_UID: |