link-layer print routines if no other print routine claimed the packet.
Test whether that flag is set rather than testing whether neither of -x
or -q were specified, and have -x, -q, *and* -X set that flag, so that
-X suppresses it just as -x does. That way you don't get those pckets
dumped twice if -X was specified.
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.256 2005-07-06 20:53:30 guy Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.257 2005-07-07 01:22:15 guy Exp $ (LBL)
*/
#ifndef tcpdump_interface_h
#define Xflag gndo->ndo_Xflag
#define Cflag gndo->ndo_Cflag
#define Aflag gndo->ndo_Aflag
+#define suppress_default_print gndo->ndo_suppress_default_print
#define packettype gndo->ndo_packettype
#define tcpmd5secret gndo->ndo_tcpmd5secret
#define Wflag gndo->ndo_Wflag
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /tcpdump/master/tcpdump/netdissect.h,v 1.17 2005-07-06 20:53:31 guy Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/netdissect.h,v 1.18 2005-07-07 01:22:16 guy Exp $ (LBL)
*/
#ifndef netdissect_h
int ndo_Cflag; /* rotate dump files after this many bytes */
int ndo_Cflag_count; /* Keep track of which file number we're writing */
int ndo_Wflag; /* recycle output files after this number of files */
- int ndo_WflagChars;
+ int ndo_WflagChars;
+ int ndo_suppress_default_print; /* don't use default_print() for unknown packet types */
const char *ndo_dltname;
char *ndo_espsecret;
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-802_11.c,v 1.32 2005-04-20 19:32:16 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-802_11.c,v 1.33 2005-07-07 01:22:16 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
printf("(LLC %s) ",
etherproto_string(
htons(extracted_ethertype)));
- if (!xflag && !qflag)
+ if (!suppress_default_print)
default_print(p, caplen);
}
break;
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ap1394.c,v 1.3 2004-03-17 23:24:35 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ap1394.c,v 1.4 2005-07-07 01:22:17 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
if (!eflag)
ap1394_hdr_print((u_char *)fp, length + FIREWIRE_HDRLEN);
- if (!xflag && !qflag)
+ if (!suppress_default_print)
default_print(p, caplen);
}
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-atm.c,v 1.40 2005-06-20 07:37:02 hannes Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-atm.c,v 1.41 2005-07-07 01:22:17 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
printf("(LLC %s) ",
etherproto_string(htons(extracted_ethertype)));
}
- if (!xflag && !qflag)
+ if (!suppress_default_print)
default_print(p, caplen);
}
}
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-cip.c,v 1.25 2005-04-06 21:32:39 mcr Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-cip.c,v 1.26 2005-07-07 01:22:17 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
printf("(LLC %s) ",
etherproto_string(htons(extracted_ethertype)));
}
- if (!xflag && !qflag)
+ if (!suppress_default_print)
default_print(p, caplen);
}
} else {
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ether.c,v 1.97 2005-07-01 16:15:59 hannes Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ether.c,v 1.98 2005-07-07 01:22:17 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
if (!eflag)
ether_hdr_print((u_char *)ep, length + ETHER_HDRLEN);
- if (!xflag && !qflag)
+ if (!suppress_default_print)
default_print(p, caplen);
}
} else if (ether_encap_print(ether_type, p, length, caplen,
if (!eflag)
ether_hdr_print((u_char *)ep, length + ETHER_HDRLEN);
- if (!xflag && !qflag)
+ if (!suppress_default_print)
default_print(p, caplen);
}
}
ether_hdr_print(p - 18, length + 4);
}
- if (!xflag && !qflag)
+ if (!suppress_default_print)
default_print(p - 18, caplen + 4);
return (1);
ether_hdr_print(p - 16, length + 2);
}
- if (!xflag && !qflag)
+ if (!suppress_default_print)
default_print(p - 16, caplen + 2);
return (1);
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-fddi.c,v 1.64 2004-03-17 23:24:37 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-fddi.c,v 1.65 2005-07-07 01:22:18 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
printf("(LLC %s) ",
etherproto_string(htons(extracted_ethertype)));
}
- if (!xflag && !qflag)
+ if (!suppress_default_print)
default_print(p, caplen);
}
} else if ((fddip->fddi_fc & FDDIFC_CLFF) == FDDIFC_SMT)
if (!eflag)
fddi_hdr_print(fddip, length + FDDI_HDRLEN, ESRC(&ehdr),
EDST(&ehdr));
- if (!xflag && !qflag)
+ if (!suppress_default_print)
default_print(p, caplen);
}
}
#ifndef lint
static const char rcsid[] _U_ =
- "@(#)$Header: /tcpdump/master/tcpdump/print-fr.c,v 1.36 2005-05-27 14:53:48 hannes Exp $ (LBL)";
+ "@(#)$Header: /tcpdump/master/tcpdump/print-fr.c,v 1.37 2005-07-07 01:22:18 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
if (!eflag)
fr_hdr_print(length + hdr_len, hdr_len,
dlci, flags, nlpid);
- if (!xflag && !qflag)
+ if (!suppress_default_print)
default_print(p - hdr_len, length + hdr_len);
}
break;
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ipfc.c,v 1.7 2004-03-17 23:24:37 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ipfc.c,v 1.8 2005-07-07 01:22:19 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
printf("(LLC %s) ",
etherproto_string(htons(extracted_ethertype)));
}
- if (!xflag && !qflag)
+ if (!suppress_default_print)
default_print(p, caplen);
}
}
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-lane.c,v 1.23 2004-03-17 23:24:37 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-lane.c,v 1.24 2005-07-07 01:22:19 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
printf("(LLC %s) ",
etherproto_string(htons(extracted_ethertype)));
}
- if (!xflag && !qflag)
+ if (!suppress_default_print)
default_print(p, caplen);
}
} else if (ether_encap_print(ether_type, p, length, caplen,
/* ether_type not known, print raw packet */
if (!eflag)
lane_hdr_print((u_char *)ep, length + sizeof(*ep));
- if (!xflag && !qflag)
+ if (!suppress_default_print)
default_print(p, caplen);
}
}
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.55 2005-05-19 07:25:49 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.56 2005-07-07 01:22:19 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
/* unknown AF_ value */
if (!eflag)
null_hdr_print(family, length + NULL_HDRLEN);
- if (!xflag && !qflag)
+ if (!suppress_default_print)
default_print(p, caplen);
}
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-pflog.c,v 1.13 2005-04-06 21:32:41 mcr Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-pflog.c,v 1.14 2005-07-07 01:22:20 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
/* address family not handled, print raw packet */
if (!eflag)
pflog_print(hdr);
- if (!xflag && !qflag)
+ if (!suppress_default_print)
default_print(p, caplen);
}
#ifndef lint
static const char rcsid[] _U_ =
-"@(#) $Header: /tcpdump/master/tcpdump/print-sctp.c,v 1.19 2005-05-06 10:53:01 guy Exp $ (NETLAB/PEL)";
+"@(#) $Header: /tcpdump/master/tcpdump/print-sctp.c,v 1.20 2005-07-07 01:22:20 guy Exp $ (NETLAB/PEL)";
#endif
#ifdef HAVE_CONFIG_H
printf("[Payload");
- if (!xflag && !qflag) {
+ if (!suppress_default_print) {
payloadPtr = (const u_char *) (++dataHdrPtr);
printf(":");
if (htons(chunkDescPtr->chunkLength) <
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-sll.c,v 1.17 2005-04-26 00:16:28 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-sll.c,v 1.18 2005-07-07 01:22:21 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
printf("(LLC %s) ",
etherproto_string(htons(extracted_ethertype)));
}
- if (!xflag && !qflag)
+ if (!suppress_default_print)
default_print(p, caplen);
break;
}
/* ether_type not known, print raw packet */
if (!eflag)
sll_print(sllp, length + SLL_HDR_LEN);
- if (!xflag && !qflag)
+ if (!suppress_default_print)
default_print(p, caplen);
}
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-symantec.c,v 1.4 2004-04-05 00:13:59 mcr Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-symantec.c,v 1.5 2005-07-07 01:22:21 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
if (!eflag)
symantec_hdr_print((u_char *)sp, length + sizeof (struct symantec_header));
- if (!xflag && !qflag)
+ if (!suppress_default_print)
default_print(p, caplen);
} else if (ether_encap_print(ether_type, p, length, caplen,
&extracted_ether_type) == 0) {
if (!eflag)
symantec_hdr_print((u_char *)sp, length + sizeof (struct symantec_header));
- if (!xflag && !qflag)
+ if (!suppress_default_print)
default_print(p, caplen);
}
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-token.c,v 1.25 2004-03-17 23:24:38 guy Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-token.c,v 1.26 2005-07-07 01:22:21 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
printf("(LLC %s) ",
etherproto_string(htons(extracted_ethertype)));
}
- if (!xflag && !qflag)
+ if (!suppress_default_print)
default_print(p, caplen);
}
} else {
if (!eflag)
token_hdr_print(trp, length + TOKEN_HDRLEN + route_len,
ESRC(&ehdr), EDST(&ehdr));
- if (!xflag && !qflag)
+ if (!suppress_default_print)
default_print(p, caplen);
}
return (hdr_len);
"@(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000\n\
The Regents of the University of California. All rights reserved.\n";
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.259 2005-07-06 20:53:32 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.260 2005-07-07 01:22:21 guy Exp $ (LBL)";
#endif
/*
case 'q':
++qflag;
+ ++suppress_default_print;
break;
case 'r':
case 'x':
++xflag;
+ ++suppress_default_print;
break;
case 'X':
++Xflag;
+ ++suppress_default_print;
break;
case 'y':