diff options
author | guy <guy> | 2002-12-19 09:39:10 +0000 |
---|---|---|
committer | guy <guy> | 2002-12-19 09:39:10 +0000 |
commit | 4bec97f457e593be925e92fa28d73af6a57d81cf (patch) | |
tree | fcb53f0e4e3a5749d84858f128e7f6c7e352c23e /print-sunatm.c | |
parent | 60761585472a90c34d7de7bdf50475f0d7261b2d (diff) | |
download | tcpdump-4bec97f457e593be925e92fa28d73af6a57d81cf.tar.gz |
Hoist a bunch of stuff that should be done by all if_print routines into
tcpdump.c. Have if_print routines return the length of the link-layer
header, so that the common code knows how to skip the link-layer header
when printing the packet in hex/ASCII.
Diffstat (limited to 'print-sunatm.c')
-rw-r--r-- | print-sunatm.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/print-sunatm.c b/print-sunatm.c index 3df26fb2..a7ebe067 100644 --- a/print-sunatm.c +++ b/print-sunatm.c @@ -31,7 +31,7 @@ */ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-sunatm.c,v 1.4 2002-09-05 21:25:49 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-sunatm.c,v 1.5 2002-12-19 09:39:16 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -69,8 +69,8 @@ struct rtentry; * 'h->length' is the length of the packet off the wire, and 'h->caplen' * is the number of bytes actually captured. */ -void -sunatm_if_print(u_char *user _U_, const struct pcap_pkthdr *h, const u_char *p) +u_int +sunatm_if_print(const struct pcap_pkthdr *h, const u_char *p) { u_int caplen = h->caplen; u_int length = h->len; @@ -78,11 +78,9 @@ sunatm_if_print(u_char *user _U_, const struct pcap_pkthdr *h, const u_char *p) u_char vpi; u_int traftype; - ts_print(&h->ts); - if (caplen < PKT_BEGIN_POS) { printf("[|atm]"); - goto out; + return (caplen); } if (eflag) { @@ -115,9 +113,5 @@ sunatm_if_print(u_char *user _U_, const struct pcap_pkthdr *h, const u_char *p) length -= PKT_BEGIN_POS; atm_print(vpi, vci, traftype, p, length, caplen); - out: - putchar('\n'); - --infodelay; - if (infoprint) - info(0); + return (PKT_BEGIN_POS); } |