#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-domain.c,v 1.75 2001-02-23 08:55:21 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-domain.c,v 1.78 2001-10-19 09:00:48 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include <netinet/in.h>
-#ifdef NOERROR
-#undef NOERROR /* Solaris sucks */
-#endif
-#ifdef NOERROR
-#undef T_UNSPEC /* SINIX does too */
-#endif
#include "nameser.h"
#include <stdio.h>
#include "addrtoname.h"
#include "extract.h" /* must come after interface.h */
-static char *ns_ops[] = {
+static const char *ns_ops[] = {
"", " inv_q", " stat", " op3", " notify", " update", " op6", " op7",
" op8", " updataA", " updateD", " updateDA",
" updateM", " updateMA", " zoneInit", " zoneRef",
};
-static char *ns_resp[] = {
+static const char *ns_resp[] = {
"", " FormErr", " ServFail", " NXDomain",
" NotImp", " Refused", " YXDomain", " YXRRSet",
" NXRRSet", " NotAuth", " NotZone", " Resp11",
{
register const HEADER *np;
register int qdcount, ancount, nscount, arcount;
- register const u_char *cp = NULL;
+ register const u_char *cp;
np = (const HEADER *)bp;
TCHECK(*np);
putchar(',');
if (vflag > 1) {
fputs(" q:", stdout);
- if ((cp = ns_qprint((const u_char *)(np + 1), bp))
- == NULL)
+ if ((cp = ns_qprint(cp, bp)) == NULL)
goto trunc;
} else {
- if ((cp = ns_nskip((const u_char *)(np + 1), bp))
- == NULL)
+ if ((cp = ns_nskip(cp, bp)) == NULL)
goto trunc;
cp += 4; /* skip QTYPE and QCLASS */
}
if (arcount)
printf(" [%dau]", arcount);
+ cp = (const u_char *)(np + 1);
if (qdcount--) {
- cp = ns_qprint((const u_char *)(np + 1),
- (const u_char *)np);
+ cp = ns_qprint(cp, (const u_char *)np);
if (!cp)
goto trunc;
while (cp < snapend && qdcount--) {