diff options
Diffstat (limited to 'usr.sbin/nslookup')
-rw-r--r-- | usr.sbin/nslookup/Makefile | 134 | ||||
-rw-r--r-- | usr.sbin/nslookup/debug.c | 42 | ||||
-rw-r--r-- | usr.sbin/nslookup/getinfo.c | 13 | ||||
-rw-r--r-- | usr.sbin/nslookup/list.c | 81 | ||||
-rw-r--r-- | usr.sbin/nslookup/main.c | 98 | ||||
-rw-r--r-- | usr.sbin/nslookup/nslookup.8 | 6 | ||||
-rw-r--r-- | usr.sbin/nslookup/pathnames.h | 15 | ||||
-rw-r--r-- | usr.sbin/nslookup/res.h | 12 | ||||
-rw-r--r-- | usr.sbin/nslookup/send.c | 13 | ||||
-rw-r--r-- | usr.sbin/nslookup/skip.c | 11 | ||||
-rw-r--r-- | usr.sbin/nslookup/subr.c | 28 |
11 files changed, 146 insertions, 307 deletions
diff --git a/usr.sbin/nslookup/Makefile b/usr.sbin/nslookup/Makefile index 36d83b4fef57..bb1f2b3f7f41 100644 --- a/usr.sbin/nslookup/Makefile +++ b/usr.sbin/nslookup/Makefile @@ -1,126 +1,14 @@ -# -# @(#)Makefile 5.20 (Berkeley) 10/2/89 -# $Id: Makefile,v 8.2 1995/01/11 08:58:13 vixie Exp $ -# +# @(#)Makefile 8.1 (Berkeley) 6/6/93 -## ++Copyright++ 1987 -## - -## Copyright (c) 1987 -## The Regents of the University of California. All rights reserved. -## -## Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions -## are met: -## 1. Redistributions of source code must retain the above copyright -## notice, this list of conditions and the following disclaimer. -## 2. Redistributions in binary form must reproduce the above copyright -## notice, this list of conditions and the following disclaimer in the -## documentation and/or other materials provided with the distribution. -## 3. All advertising materials mentioning features or use of this software -## must display the following acknowledgement: -## This product includes software developed by the University of -## California, Berkeley and its contributors. -## 4. Neither the name of the University nor the names of its contributors -## may be used to endorse or promote products derived from this software -## without specific prior written permission. -## -## THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -## ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -## SUCH DAMAGE. -## - -## Portions Copyright (c) 1993 by Digital Equipment Corporation. -## -## Permission to use, copy, modify, and distribute this software for any -## purpose with or without fee is hereby granted, provided that the above -## copyright notice and this permission notice appear in all copies, and that -## the name of Digital Equipment Corporation not be used in advertising or -## publicity pertaining to distribution of the document or software without -## specific, written prior permission. -## -## THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL -## WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES -## OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT -## CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL -## DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR -## PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS -## ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -## SOFTWARE. -## - -## --Copyright-- +PROG= nslookup +SRCS= main.c commands.l getinfo.c debug.c send.c skip.c list.c subr.c +MAN8= nslookup.8 +DPADD+= ${LIBL} +LDADD+= -ll +CLEANFILES+=lex.yy.o -DESTDIR = -DESTBIN = /usr/bin -COMPINCL = ../../compat/include -CC= cc -SHELL= /bin/sh -CDEBUG= -O -INCL = ../../include -RES= ../../res/libresolv.a -COMPLIB= ../../compat/lib/lib44bsd.a -LDFLAGS = -LIBS = -ll -LEX = lex -DESTHELP= /usr/lib -DEFS= -D_PATH_HELPFILE=\"$(DESTHELP)/nslookup.help\" +beforeinstall: + ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \ + ${.CURDIR}/nslookup.help ${DESTDIR}/usr/share/misc -#(bsd/386, 4.4bsd, other net2 descendents) -#DESTHELP= /usr/share/misc -#COMPINCL= . -#COMPLIB= -#LIBS = -ll -lutil -#LEX = lex -I - -#(sgi irix4) -#DESTHELP= /usr/bsd -#DEFS= -xansi -signed -D__STDC__ -D_BSD_SIGNALS \ -# -D_PATH_HELPFILE=\"$(DESTHELP)/nslookup.help\" -#COMPLIB= - -#(sgi irix5) -#DESTHELP= /usr/share/misc -#DEFS= -xansi -signed -D__BIT_TYPES_DEFINED__ -D_BSD_SIGNALS \ -# -D_PATH_HELPFILE=\"$(DESTHELP)/nslookup.help\" -#COMPLIB= - -CFLAGS= ${CDEBUG} -I${INCL} -I${COMPINCL} ${DEFS} -CSRCS= main.c getinfo.c debug.c send.c skip.c list.c subr.c -SRCS= ${CSRCS} commands.c -OBJS= main.o getinfo.o debug.o send.o skip.o list.o subr.o commands.o - -all: nslookup - -nslookup: ${OBJS} ${RES} ${COMPLIB} - ${CC} ${CDEBUG} ${LDFLAGS} -o $@ ${OBJS} \ - ${RES} ${COMPLIB} ${LIBS} - -clean: - rm -f ${OBJS} core nslookup commands.c lex.yy.c lex.yy.o - rm -f *.BAK *.CKP *~ - -cleandir: clean - rm -f tags .depend - -depend: ${SRCS} - mkdep ${CPPFLAGS} -I${INCL} -I${COMPINCL} ${DEFS} ${SRCS} - -install: - ${INSTALL} -s -c -o bin -g bin -m 755 nslookup ${DESTDIR}${DESTBIN}/ - ${INSTALL} -c -o bin -g bin -m 444 nslookup.help \ - ${DESTDIR}${DESTHELP}/ - -lint: ${SRCS} - lint ${SRCS} - -tags: ${CSRCS} - ctags ${CSRCS} - -# DO NOT DELETE THIS LINE -- mkdep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. +.include <bsd.prog.mk> diff --git a/usr.sbin/nslookup/debug.c b/usr.sbin/nslookup/debug.c index cdfd5a6048ea..9f63873c1ece 100644 --- a/usr.sbin/nslookup/debug.c +++ b/usr.sbin/nslookup/debug.c @@ -3,7 +3,7 @@ * - * Copyright (c) 1985, 1989 * The Regents of the University of California. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -19,7 +19,7 @@ * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -33,14 +33,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -55,7 +55,7 @@ #ifndef lint static char sccsid[] = "@(#)debug.c 5.26 (Berkeley) 3/21/91"; -static char rcsid[] = "$Id: debug.c,v 8.2 1995/06/29 09:26:34 vixie Exp $"; +static char rcsid[] = "$Id: debug.c,v 1.2 1994/09/22 21:50:31 pst Exp $"; #endif /* not lint */ /* @@ -72,13 +72,13 @@ static char rcsid[] = "$Id: debug.c,v 8.2 1995/06/29 09:26:34 vixie Exp $"; #include <sys/param.h> #include <netinet/in.h> +#include <netiso/iso.h> #include <arpa/nameser.h> #include <arpa/inet.h> #include <resolv.h> #include <netdb.h> #include <stdio.h> #include "res.h" -#include "../../conf/portability.h" /* * Imported from res_debug.c @@ -140,6 +140,8 @@ 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)); @@ -254,6 +256,7 @@ Print_rr(cp, msg, eom, file) int type, class, dlen, n, c; u_int32_t rrttl, ttl; struct in_addr inaddr; + struct iso_addr isoa; u_char *cp1, *cp2; int debug; @@ -281,7 +284,7 @@ Print_rr(cp, msg, eom, file) fprintf(file,"\n\tttl = %lu (%s)", rrttl, p_time(rrttl)); } (void) putc('\n', file); - } + } cp1 = cp; @@ -332,15 +335,6 @@ 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; @@ -362,24 +356,22 @@ doname: break; case T_HINFO: - cp2 = cp + dlen; if (n = *cp++) { fprintf(file,"\tCPU = %.*s", n, cp); cp += n; } - if ((cp < cp2) && (n = *cp++)) { + if (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 ((cp < cp2) && (n = *cp++)) { + if (n = *cp++) { fprintf(file,"-%.*s\"\n", n, cp); cp += n; } else fprintf(file,"\"\n"); @@ -435,7 +427,7 @@ doname: while (cp < cp2) { if (n = (unsigned char) *cp++) { for (c = n; c > 0 && cp < cp2; c--) - if ((*cp == '\n') || (*cp == '"')) { + if (*cp == '\n') { (void) putc('\\', file); (void) putc(*cp++, file); } else @@ -462,7 +454,11 @@ doname: break; case T_NSAP: - fprintf(file, "\tnsap = %s\n", inet_nsap_ntoa(dlen, cp, NULL)); + isoa.isoa_len = dlen; + if (isoa.isoa_len > sizeof(isoa.isoa_genaddr)) + isoa.isoa_len = sizeof(isoa.isoa_genaddr); + bcopy(cp, isoa.isoa_genaddr, isoa.isoa_len); + fprintf(file, "\tnsap = %s\n", iso_ntoa(&isoa)); cp += dlen; break; diff --git a/usr.sbin/nslookup/getinfo.c b/usr.sbin/nslookup/getinfo.c index 4e235669106b..83efe4fcc72a 100644 --- a/usr.sbin/nslookup/getinfo.c +++ b/usr.sbin/nslookup/getinfo.c @@ -3,7 +3,7 @@ * - * Copyright (c) 1985, 1989 * The Regents of the University of California. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -19,7 +19,7 @@ * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -33,14 +33,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -55,7 +55,7 @@ #ifndef lint static char sccsid[] = "@(#)getinfo.c 5.26 (Berkeley) 3/21/91"; -static char rcsid[] = "$Id: getinfo.c,v 8.1 1994/12/15 06:24:31 vixie Exp $"; +static char rcsid[] = "$Id: getinfo.c,v 1.2 1994/09/22 21:50:33 pst Exp $"; #endif /* not lint */ /* @@ -80,7 +80,6 @@ static char rcsid[] = "$Id: getinfo.c,v 8.1 1994/12/15 06:24:31 vixie Exp $"; #include <stdio.h> #include <ctype.h> #include "res.h" -#include "../../conf/portability.h" extern char *_res_resultcodes[]; extern char *res_skip(); @@ -486,7 +485,7 @@ GetAnswer(nsAddrPtr, queryType, msg, msglen, iquery, hostPtr, isServer) if (strcmp((char *)bp, server[j].name) == 0) { server[j].numAddresses++; if (server[j].numAddresses <= MAXADDRS) { - server[j].address[server[j].numAddresses-1] = + server[j].address[server[j].numAddresses-1] = Calloc(1,dlen); bcopy(cp, server[j].address[server[j].numAddresses-1],dlen); diff --git a/usr.sbin/nslookup/list.c b/usr.sbin/nslookup/list.c index 43f18abeedc4..bc187fad8ddc 100644 --- a/usr.sbin/nslookup/list.c +++ b/usr.sbin/nslookup/list.c @@ -3,7 +3,7 @@ * - * Copyright (c) 1985, 1989 * The Regents of the University of California. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -19,7 +19,7 @@ * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -33,14 +33,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -55,7 +55,7 @@ #ifndef lint static char sccsid[] = "@(#)list.c 5.23 (Berkeley) 3/21/91"; -static char rcsid[] = "$Id: list.c,v 8.3 1994/12/19 08:35:16 vixie Exp $"; +static char rcsid[] = "$Id: list.c,v 1.2 1994/09/22 21:50:34 pst Exp $"; #endif /* not lint */ /* @@ -73,6 +73,7 @@ static char rcsid[] = "$Id: list.c,v 8.3 1994/12/19 08:35:16 vixie Exp $"; #include <sys/param.h> #include <sys/socket.h> #include <netinet/in.h> +#include <netiso/iso.h> #include <arpa/nameser.h> #include <arpa/inet.h> #include <resolv.h> @@ -81,8 +82,8 @@ static char rcsid[] = "$Id: list.c,v 8.3 1994/12/19 08:35:16 vixie Exp $"; #include <limits.h> #include <ctype.h> #include <errno.h> +#include <string.h> #include "res.h" -#include "../../conf/portability.h" extern char *_res_resultcodes[]; /* res_debug.c */ extern char *pager; @@ -174,7 +175,7 @@ ListHostsByType(string, putToFile) } result = ListSubr(qtype, namePtr, putToFile ? string : NULL); if (result != SUCCESS) - fprintf(stderr, "*** Can't list domain %s: %s\n", + fprintf(stderr, "*** Can't list domain %s: %s\n", namePtr, DecodeError(result)); } @@ -203,8 +204,6 @@ 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) { @@ -222,7 +221,7 @@ ListHosts(string, putToFile) } result = ListSubr(qtype, namePtr, putToFile ? string : NULL); if (result != SUCCESS) - fprintf(stderr, "*** Can't list domain %s: %s\n", + fprintf(stderr, "*** Can't list domain %s: %s\n", namePtr, DecodeError(result)); } @@ -358,9 +357,6 @@ 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; @@ -406,9 +402,6 @@ 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; @@ -453,7 +446,7 @@ ListSubr(qtype, domain, cmd) * The server sent too much data to fit the existing buffer -- * allocate a new one. */ - if (len > (u_int)answerLen) { + if (len > answerLen) { if (answerLen != 0) { free(answer); } @@ -594,6 +587,7 @@ PrintListInfo(file, msg, eom, qtype, domain) u_int32_t ttl; int n, pref; struct in_addr inaddr; + struct iso_addr isoa; char name[NAME_LEN]; char name2[NAME_LEN]; Boolean stripped; @@ -694,7 +688,6 @@ 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"); @@ -703,21 +696,16 @@ PrintListInfo(file, msg, eom, qtype, domain) case T_HINFO: case T_ISDN: - { - 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; - } + 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; } break; @@ -760,25 +748,6 @@ 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: { @@ -789,7 +758,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') || (*cp == '"')) { + if (*cp == '\n') { (void) putc('\\', file); (void) putc(*cp++, file); } else @@ -801,7 +770,11 @@ PrintListInfo(file, msg, eom, qtype, domain) break; case T_NSAP: - fprintf(file, " %s", inet_nsap_ntoa(dlen, cp, NULL)); + isoa.isoa_len = dlen; + if (isoa.isoa_len > sizeof(isoa.isoa_genaddr)) + isoa.isoa_len = sizeof(isoa.isoa_genaddr); + bcopy(cp, isoa.isoa_genaddr, isoa.isoa_len); + fprintf(file, " %s", iso_ntoa(&isoa)); break; case T_MINFO: diff --git a/usr.sbin/nslookup/main.c b/usr.sbin/nslookup/main.c index f0df230c0c7e..083acecb39cc 100644 --- a/usr.sbin/nslookup/main.c +++ b/usr.sbin/nslookup/main.c @@ -3,7 +3,7 @@ * - * Copyright (c) 1985, 1989 * The Regents of the University of California. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -19,7 +19,7 @@ * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -33,14 +33,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -61,21 +61,21 @@ char copyright[] = #ifndef lint static char sccsid[] = "@(#)main.c 5.42 (Berkeley) 3/3/91"; -static char rcsid[] = "$Id: main.c,v 8.1 1994/12/15 06:24:31 vixie Exp $"; +static char rcsid[] = "$Id: main.c,v 1.2 1994/09/22 21:50:36 pst Exp $"; #endif /* not lint */ /* ****************************************************************************** - * + * * main.c -- - * + * * Main routine and some action routines for the name server * lookup program. * * Andrew Cherenson * U.C. Berkeley Computer Science Div. * CS298-26, Fall 1985 - * + * ****************************************************************************** */ @@ -92,13 +92,13 @@ static char rcsid[] = "$Id: main.c,v 8.1 1994/12/15 06:24:31 vixie Exp $"; #include <stdio.h> #include <errno.h> #include <limits.h> +#include <string.h> +#include <stdlib.h> #include "res.h" #include "pathnames.h" -#include "../../conf/portability.h" - /* - * Name of a top-level name server. Can be changed with + * Name of a top-level name server. Can be changed with * the "set root" command. */ @@ -143,7 +143,7 @@ int queryClass = C_IN; * Stuff for Interrupt (control-C) signal handler. */ -extern SIG_FN IntrHandler(); +extern void IntrHandler(); FILE *filePtr; jmp_buf env; @@ -193,7 +193,7 @@ main(argc, argv) * find the server's address and name. If the resolver library * already has some addresses for a potential name server, * then use them. Otherwise, see if the current host has a server. - * Command line arguments may override the choice of initial server. + * Command line arguments may override the choice of initial server. */ defaultPtr = (HostInfo *) Calloc(1, sizeof(HostInfo)); @@ -203,11 +203,11 @@ main(argc, argv) * no args = go into interactive mode, use default host as server * 1 arg = use as host name to be looked up, default host will be server * non-interactive mode - * 2 args = 1st arg: - * if it is '-', then + * 2 args = 1st arg: + * if it is '-', then * ignore but go into interactive mode - * else - * use as host name to be looked up, + * else + * use as host name to be looked up, * go into non-interactive mode * 2nd arg: name or inet address of server * @@ -226,7 +226,7 @@ main(argc, argv) } if (argc > 2) { Usage(); - } + } if (argc && *argv[0] != '-') { wantedHost = *argv; /* name of host to be looked up */ } @@ -238,7 +238,7 @@ main(argc, argv) /* * Use an explicit name server. If the hostname lookup fails, * default to the server(s) in resolv.conf. - */ + */ if (inet_aton(*++argv, &addr)) { _res.nscount = 1; @@ -246,18 +246,18 @@ main(argc, argv) } else { hp = gethostbyname(*argv); if (hp == NULL) { - fprintf(stderr, "*** Can't find server address for '%s': ", + fprintf(stderr, "*** Can't find server address for '%s': ", *argv); herror((char *)NULL); fputc('\n', stderr); } else { for (i = 0; i < MAXNS && hp->h_addr_list[i] != NULL; i++) { - bcopy(hp->h_addr_list[i], - (char *)&_res.nsaddr_list[i].sin_addr, + bcopy(hp->h_addr_list[i], + (char *)&_res.nsaddr_list[i].sin_addr, hp->h_length); } _res.nscount = i; - } + } } } @@ -270,13 +270,13 @@ main(argc, argv) LocalServer(defaultPtr); break; } else { - result = GetHostInfoByAddr(&(_res.nsaddr_list[i].sin_addr), - &(_res.nsaddr_list[i].sin_addr), + result = GetHostInfoByAddr(&(_res.nsaddr_list[i].sin_addr), + &(_res.nsaddr_list[i].sin_addr), defaultPtr); if (result != SUCCESS) { fprintf(stderr, - "*** Can't find server name for address %s: %s\n", - inet_ntoa(_res.nsaddr_list[i].sin_addr), + "*** Can't find server name for address %s: %s\n", + inet_ntoa(_res.nsaddr_list[i].sin_addr), DecodeError(result)); } else { defaultAddr = _res.nsaddr_list[i].sin_addr; @@ -329,7 +329,7 @@ main(argc, argv) (void) setjmp(env); - /* + /* * Return here after a longjmp. */ @@ -338,7 +338,7 @@ main(argc, argv) /* * Read and evaluate commands. The commands are described in commands.l - * Yylex returns 0 when ^D or 'exit' is typed. + * Yylex returns 0 when ^D or 'exit' is typed. */ printf("> "); @@ -414,11 +414,11 @@ IsAddr(host, addrPtr) if (isdigit(host[0])) { /* Make sure it has only digits and dots. */ for (cp = host; *cp; ++cp) { - if (!isdigit(*cp) && *cp != '.') + if (!isdigit(*cp) && *cp != '.') return FALSE; } /* If it has a trailing dot, don't treat it as an address. */ - if (*--cp != '.') { + if (*--cp != '.') { return inet_aton(host, addrPtr); } } @@ -432,7 +432,7 @@ IsAddr(host, addrPtr) * SetDefaultServer -- * * Changes the default name server to the one specified by - * the first argument. The command "server name" uses the current + * the first argument. The command "server name" uses the current * default server to lookup the info for "name". The command * "lserver name" uses the original server to lookup "name". * @@ -510,9 +510,9 @@ SetDefaultServer(string, local) if (IsAddr(newServer, &addr)) { result = GetHostInfoByAddr(servAddrPtr, &addr, newDefPtr); /* If we can't get the name, fall through... */ - } + } if (result != SUCCESS && result != NONAUTH) { - result = GetHostInfoByName(servAddrPtr, C_IN, T_A, + result = GetHostInfoByName(servAddrPtr, C_IN, T_A, newServer, newDefPtr, 1); } @@ -559,14 +559,14 @@ DoLookup(host, servPtr, serverName) { int result; struct in_addr *servAddrPtr; - struct in_addr addr; + struct in_addr addr; /* Skip escape character */ if (host[0] == '\\') host++; /* - * If the user gives us an address for an address query, + * If the user gives us an address for an address query, * silently treat it as a PTR query. If the query type is already * PTR, then convert the address into the in-addr.arpa format. * @@ -581,8 +581,8 @@ DoLookup(host, servPtr, serverName) servAddrPtr = (struct in_addr *) servPtr->servers[0]->addrList[0]; } - /* - * RFC1123 says we "SHOULD check the string syntactically for a + /* + * RFC1123 says we "SHOULD check the string syntactically for a * dotted-decimal number before looking it up [...]" (p. 13). */ if (queryType == T_A && IsAddr(host, &addr)) { @@ -590,8 +590,8 @@ DoLookup(host, servPtr, serverName) } else { if (queryType == T_PTR) { CvtAddrToPtr(host); - } - result = GetHostInfoByName(servAddrPtr, queryClass, queryType, host, + } + result = GetHostInfoByName(servAddrPtr, queryClass, queryType, host, &curHostInfo, 0); } @@ -618,7 +618,7 @@ DoLookup(host, servPtr, serverName) break; case NO_INFO: - fprintf(stderr, "*** No %s (%s) records available for %s\n", + fprintf(stderr, "*** No %s (%s) records available for %s\n", DecodeType(queryType), p_type(queryType), host); break; @@ -659,7 +659,7 @@ LookupHost(string, putToFile) int result; /* - * Invalidate the current host information to prevent Finger + * Invalidate the current host information to prevent Finger * from using bogus info. */ @@ -699,13 +699,13 @@ LookupHost(string, putToFile) * * LookupHostWithServer -- * - * Asks the name server specified in the second argument for + * Asks the name server specified in the second argument for * information about the host or domain specified in the first * argument. The information is printed if the lookup was successful. * * Address info about the requested name server is obtained * from the default name server. This routine will return an - * error if the default server doesn't have info about the + * error if the default server doesn't have info about the * requested server. Thus an error return status might not * mean the requested name server doesn't have info about the * requested host. @@ -743,11 +743,11 @@ LookupHostWithServer(string, putToFile) } fprintf(filePtr,"> %s\n", string); } - + result = GetHostInfoByName( defaultPtr->addrList ? (struct in_addr *) defaultPtr->addrList[0] : - (struct in_addr *) defaultPtr->servers[0]->addrList[0], + (struct in_addr *) defaultPtr->servers[0]->addrList[0], C_IN, T_A, server, &serverInfo, 1); if (result != SUCCESS) { @@ -768,7 +768,7 @@ LookupHostWithServer(string, putToFile) /* ****************************************************************************** * - * SetOption -- + * SetOption -- * * This routine is used to change the state information * that affect the lookups. The command format is @@ -1017,7 +1017,7 @@ ShowOptions() printf(" retry=%d\n", _res.retry); printf(" root=%s\n", rootServerName); printf(" domain=%s\n", _res.defdname); - + if (cp = _res.dnsrch) { printf(" srchlist=%s", *cp); for (cp++; *cp; cp++) { @@ -1072,7 +1072,7 @@ CvtAddrToPtr(name) if (IsAddr(name, &addr)) { p = inet_ntoa(addr); if (sscanf(p, "%d.%d.%d.%d", &ip[0], &ip[1], &ip[2], &ip[3]) == 4) { - sprintf(name, "%d.%d.%d.%d.in-addr.arpa.", + sprintf(name, "%d.%d.%d.%d.in-addr.arpa.", ip[3], ip[2], ip[1], ip[0]); } } diff --git a/usr.sbin/nslookup/nslookup.8 b/usr.sbin/nslookup/nslookup.8 index de0306aa0972..292028193290 100644 --- a/usr.sbin/nslookup/nslookup.8 +++ b/usr.sbin/nslookup/nslookup.8 @@ -54,7 +54,7 @@ .\" .\" @(#)nslookup.8 5.3 (Berkeley) 6/24/90 .\" -.TH NSLOOKUP @SYS_OPS_EXT_U@ "June 24, 1990" +.TH NSLOOKUP 8 "June 24, 1990" .UC 6 .SH NAME nslookup \- query Internet name servers interactively @@ -177,7 +177,7 @@ When output is directed to a file, hash marks are printed for every .sp 1 .IP "\fBview\fP \fIfilename\fP" Sorts and lists the output of previous \fBls\fP command(s) with -\fImore\fP(@CMD_EXT@). +\fImore\fP(1). .sp 1 .ne 4 .IP "\fBhelp\fP" @@ -378,7 +378,7 @@ HOSTALIASES file containing host aliases. .br LOCALDOMAIN overrides default domain. .SH SEE ALSO -resolver(@LIB_NETWORK_EXT@), resolver(@FORMAT_EXT@), @INDOT@named(@SYS_OPS_EXT@), +resolver(3), resolver(5), named(8), .br RFC-1034 ``Domain Names \- Concepts and Facilities'' .br diff --git a/usr.sbin/nslookup/pathnames.h b/usr.sbin/nslookup/pathnames.h index bfeae4f8ab24..84a2e33cbca0 100644 --- a/usr.sbin/nslookup/pathnames.h +++ b/usr.sbin/nslookup/pathnames.h @@ -3,7 +3,7 @@ * - * Copyright (c) 1990 * The Regents of the University of California. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -19,7 +19,7 @@ * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -33,14 +33,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -55,17 +55,12 @@ /* * @(#)pathnames.h 5.1 (Berkeley) 5/28/90 - * $Id: pathnames.h,v 8.1 1994/12/15 06:24:31 vixie Exp $ + * $Id: pathnames.h,v 1.2 1994/09/22 21:50:37 pst Exp $ */ #define _PATH_NSLOOKUPRC "/.nslookuprc" #define _PATH_PAGERCMD "more" #ifndef _PATH_HELPFILE -#if defined(BSD) && BSD >= 198810 #define _PATH_HELPFILE "/usr/share/misc/nslookup.help" -#else -#define _PATH_HELPFILE "/usr/lib/nslookup.help" #endif -#endif - diff --git a/usr.sbin/nslookup/res.h b/usr.sbin/nslookup/res.h index 9363f38d6663..fcad610ad980 100644 --- a/usr.sbin/nslookup/res.h +++ b/usr.sbin/nslookup/res.h @@ -3,7 +3,7 @@ * - * Copyright (c) 1985, 1989 * The Regents of the University of California. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -19,7 +19,7 @@ * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -33,14 +33,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -55,7 +55,7 @@ /* * @(#)res.h 5.10 (Berkeley) 6/1/90 - * $Id: res.h,v 8.1 1994/12/15 06:24:31 vixie Exp $ + * $Id: res.h,v 1.1.1.1 1994/09/22 21:36:02 pst Exp $ */ /* @@ -69,7 +69,7 @@ * Andrew Cherenson * U.C. Berkeley * CS298-26 Fall 1985 - * + * ******************************************************************************* */ diff --git a/usr.sbin/nslookup/send.c b/usr.sbin/nslookup/send.c index 46c74b51daa4..8f34de38ba74 100644 --- a/usr.sbin/nslookup/send.c +++ b/usr.sbin/nslookup/send.c @@ -3,7 +3,7 @@ * - * Copyright (c) 1985, 1989 * The Regents of the University of California. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -19,7 +19,7 @@ * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -33,14 +33,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -55,7 +55,7 @@ #ifndef lint static char sccsid[] = "@(#)send.c 5.18 (Berkeley) 3/2/91"; -static char rcsid[] = "$Id: send.c,v 8.1 1994/12/15 06:24:31 vixie Exp $"; +static char rcsid[] = "$Id: send.c,v 1.2 1994/09/22 21:50:38 pst Exp $"; #endif /* not lint */ /* @@ -86,7 +86,6 @@ static char rcsid[] = "$Id: send.c,v 8.1 1994/12/15 06:24:31 vixie Exp $"; #include <arpa/inet.h> #include <resolv.h> #include "res.h" -#include "../../conf/portability.h" static int s = -1; /* socket used for communications */ @@ -332,7 +331,7 @@ wait: * timeout */ if (_res.options & RES_DEBUG) - printf("timeout (%d secs)\n", + printf("timeout (%d secs)\n", timeout.tv_sec); #if BSD >= 43 gotsomewhere = 1; diff --git a/usr.sbin/nslookup/skip.c b/usr.sbin/nslookup/skip.c index 2c78377227af..068f8179dbb0 100644 --- a/usr.sbin/nslookup/skip.c +++ b/usr.sbin/nslookup/skip.c @@ -3,7 +3,7 @@ * - * Copyright (c) 1985, 1989 * The Regents of the University of California. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -19,7 +19,7 @@ * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -33,14 +33,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -55,7 +55,7 @@ #ifndef lint static char sccsid[] = "@(#)skip.c 5.12 (Berkeley) 3/21/91"; -static char rcsid[] = "$Id: skip.c,v 8.1 1994/12/15 06:24:31 vixie Exp $"; +static char rcsid[] = "$Id: skip.c,v 1.2 1994/09/22 21:50:39 pst Exp $"; #endif /* not lint */ /* @@ -80,7 +80,6 @@ static char rcsid[] = "$Id: skip.c,v 8.1 1994/12/15 06:24:31 vixie Exp $"; #include <arpa/nameser.h> #include <resolv.h> #include <stdio.h> -#include "../../conf/portability.h" char *res_skip_rr(); diff --git a/usr.sbin/nslookup/subr.c b/usr.sbin/nslookup/subr.c index c1a93afe2418..9f86d1502e9d 100644 --- a/usr.sbin/nslookup/subr.c +++ b/usr.sbin/nslookup/subr.c @@ -3,7 +3,7 @@ * - * Copyright (c) 1985, 1989 * The Regents of the University of California. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -19,7 +19,7 @@ * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -33,14 +33,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -55,7 +55,7 @@ #ifndef lint static char sccsid[] = "@(#)subr.c 5.24 (Berkeley) 3/2/91"; -static char rcsid[] = "$Id: subr.c,v 8.2 1994/12/15 06:27:07 vixie Exp $"; +static char rcsid[] = "$Id: subr.c,v 1.2 1994/09/22 21:50:41 pst Exp $"; #endif /* not lint */ /* @@ -84,9 +84,9 @@ static char rcsid[] = "$Id: subr.c,v 8.2 1994/12/15 06:27:07 vixie Exp $"; #include <signal.h> #include <setjmp.h> #include <stdio.h> +#include <string.h> +#include <stdlib.h> #include "res.h" -#include "../../conf/portability.h" - /* @@ -113,7 +113,7 @@ static char rcsid[] = "$Id: subr.c,v 8.2 1994/12/15 06:27:07 vixie Exp $"; ******************************************************************************* */ -SIG_FN +void IntrHandler() { extern jmp_buf env; @@ -170,7 +170,7 @@ Malloc(size) ptr = malloc((unsigned) size); sigrelse(SIGINT); #else - { SIG_FN (*old)(); + { void (*old)(); old = signal(SIGINT, SIG_IGN); ptr = malloc((unsigned) size); signal(SIGINT, old); @@ -372,9 +372,7 @@ 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; @@ -430,8 +428,6 @@ 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) @@ -478,8 +474,6 @@ 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); @@ -530,8 +524,6 @@ 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: @@ -546,8 +538,6 @@ 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: |