diff options
Diffstat (limited to 'lib/libc/net/res_debug.c')
-rw-r--r-- | lib/libc/net/res_debug.c | 69 |
1 files changed, 31 insertions, 38 deletions
diff --git a/lib/libc/net/res_debug.c b/lib/libc/net/res_debug.c index aff28a4..ad65fc7 100644 --- a/lib/libc/net/res_debug.c +++ b/lib/libc/net/res_debug.c @@ -1,9 +1,7 @@ -/* - * ++Copyright++ 1985, 1990, 1993 - * - +/*- * Copyright (c) 1985, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * + * 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: @@ -14,12 +12,12 @@ * 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. + * 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 @@ -33,14 +31,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,26 +53,24 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93"; -static char rcsid[] = "$Id: res_debug.c,v 8.7 1995/12/22 10:20:39 vixie Exp $"; +static char rcsid[] = "$Id: res_debug.c,v 1.7 1996/02/06 20:35:48 wollman Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> #include <netinet/in.h> +#ifdef ISO +#include <netiso/iso.h> +#endif + #include <arpa/inet.h> #include <arpa/nameser.h> #include <stdio.h> #include <netdb.h> #include <resolv.h> -#if defined(BSD) && (BSD >= 199103) -# include <string.h> -#else -# include "../conf/portability.h" -#endif +#include <string.h> -#if defined(USE_OPTIONS_H) -# include "../conf/options.h" -#endif +#include "res_config.h" extern const char *_res_opcodes[]; extern const char *_res_resultcodes[]; @@ -175,7 +171,7 @@ do_rrset(msg, len, cp, cnt, pflag, file, hs) * Print answer records. */ sflag = (_res.pfcode & pflag); - if (n = ntohs(cnt)) { + if ( (n = ntohs(cnt)) ) { if ((!_res.pfcode) || ((sflag) && (_res.pfcode & RES_PRF_HEAD1))) fprintf(file, hs); @@ -209,18 +205,6 @@ __p_query(msg) __fp_query(msg, stdout); } -#ifdef ultrix -/* ultrix 4.0's packaging has some icky packaging. alias for it here. - * there is more junk of this kind over in res_comp.c. - */ -void -p_query(msg) - const u_char *msg; -{ - __p_query(msg); -} -#endif - /* * Print the current options. * This is intended to be primarily a debugging routine. @@ -302,7 +286,7 @@ __fp_nquery(msg, len, file) /* * Print question records. */ - if (n = ntohs(hp->qdcount)) { + if ( (n = ntohs(hp->qdcount)) ) { if ((!_res.pfcode) || (_res.pfcode & RES_PRF_QUES)) fprintf(file, ";; QUESTIONS:\n"); while (--n >= 0) { @@ -434,6 +418,9 @@ __p_rr(cp, msg, file) { int type, class, dlen, n, c; struct in_addr inaddr; +#ifdef ISO + struct iso_addr isoa; +#endif const u_char *cp1, *cp2; u_int32_t tmpttl, t; int lcnt; @@ -503,7 +490,7 @@ __p_rr(cp, msg, file) case T_HINFO: case T_ISDN: cp2 = cp + dlen; - if (n = *cp++) { + if ( (n = *cp++) ) { fprintf(file, "\t%.*s", n, cp); cp += n; } @@ -562,7 +549,7 @@ __p_rr(cp, msg, file) (void) fputs("\t\"", file); cp2 = cp1 + dlen; while (cp < cp2) { - if (n = (unsigned char) *cp++) { + if ( (n = (unsigned char) *cp++) ) { for (c = n; c > 0 && cp < cp2; c--) if ((*cp == '\n') || (*cp == '"')) { (void) putc('\\', file); @@ -574,10 +561,16 @@ __p_rr(cp, msg, file) putc('"', file); break; - case T_NSAP: - (void) fprintf(file, "\t%s", inet_nsap_ntoa(dlen, cp, NULL)); +#ifdef ISO + case T_NSAP: + 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); + (void) fprintf(file, "\t%s", iso_ntoa(&isoa)); cp += dlen; - break; + break; +#endif case T_MINFO: case T_RP: |