diff options
author | guy <guy> | 2002-12-18 09:41:13 +0000 |
---|---|---|
committer | guy <guy> | 2002-12-18 09:41:13 +0000 |
commit | cfabfb053b4bf5b50f4d98d59053e1cc97ff5014 (patch) | |
tree | 10efd1cd1e600c79a34ccd70d9204af466fc475b /print-lane.c | |
parent | e070cf232ffadbdbbca68b132ef369675890e566 (diff) | |
download | tcpdump-cfabfb053b4bf5b50f4d98d59053e1cc97ff5014.tar.gz |
Add a new routine "default_print_packet()", which takes a pointer to the
beginning of the raw packet data, the captured length of the raw packet
data, and the length of the link-layer header, and:
if "-e" was specified, prints all the raw packet data;
if "-e" was not specified, prints all the raw packet data past
the link-layer header, if there is any.
Use that routine in all the "xxx_if_print()" routines if "-x" was
specified.
Make "arcnet_encap_print()" static - it's not used outside
"print-arcnet.c".
Add missing info printing code to "atm_if_print()".
Print the packet data in "lane_if_print()", not in "lane_print()", as
"lane_print()" can be called from other "xxx_if_print()" routines, and
those routines will also print the packet data if "-x" was specified -
no need to print it twice.
Diffstat (limited to 'print-lane.c')
-rw-r--r-- | print-lane.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/print-lane.c b/print-lane.c index fe0afb4b..c727b9ff 100644 --- a/print-lane.c +++ b/print-lane.c @@ -22,7 +22,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-lane.c,v 1.18 2002-12-18 08:53:22 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-lane.c,v 1.19 2002-12-18 09:41:16 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -128,6 +128,9 @@ lane_print(const u_char *p, u_int length, u_int caplen) */ snapend = p + caplen; + /* + * Go past the LANE header. + */ length -= sizeof(struct lecdatahdr_8023); caplen -= sizeof(struct lecdatahdr_8023); ep = (struct lecdatahdr_8023 *)p; @@ -161,8 +164,6 @@ lane_print(const u_char *p, u_int length, u_int caplen) if (!xflag && !qflag) default_print(p, caplen); } - if (xflag) - default_print(p, caplen); } void @@ -176,6 +177,13 @@ lane_if_print(u_char *user _U_, const struct pcap_pkthdr *h, const u_char *p) lane_print(p, length, caplen); + /* + * If "-x" was specified, print packet data in hex. + */ + if (xflag) + default_print_packet(p, caplen, + sizeof(struct lecdatahdr_8023)); + putchar('\n'); --infodelay; if (infoprint) |