X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/b9ac23ce92ca22483d56ee3192c54aa8f782f9ac..ad6df73f5a6c46a409c7629f5588b1b81dff6357:/print-lane.c diff --git a/print-lane.c b/print-lane.c index 7ff6fe8d..2836f788 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.2 1999-11-21 09:36:56 fenner Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-lane.c,v 1.12 2001-07-05 18:54:15 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -34,28 +34,17 @@ static const char rcsid[] = #include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include #include #include #include "interface.h" #include "addrtoname.h" +#include "ether.h" #include "lane.h" -static const u_char *packetp; -static const u_char *snapend; - static inline void lane_print(register const u_char *bp, int length) { @@ -92,6 +81,7 @@ lane_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p) u_short ether_type; u_short extracted_ethertype; + ++infodelay; ts_print(&h->ts); if (caplen < sizeof(struct lecdatahdr_8023)) { @@ -123,10 +113,11 @@ lane_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p) extracted_ethertype = 0; if (ether_type < ETHERMTU) { /* Try to print the LLC-layer header & higher layers */ - if (llc_print(p, length, caplen, ep->h_source,ep->h_dest)==0) { + if (llc_print(p, length, caplen, ep->h_source, ep->h_dest, + &extracted_ethertype) == 0) { /* ether_type not known, print raw packet */ if (!eflag) - lane_print((u_char *)ep, length); + lane_print((u_char *)ep, length + sizeof(*ep)); if (extracted_ethertype) { printf("(LLC %s) ", etherproto_string(htons(extracted_ethertype))); @@ -134,7 +125,8 @@ lane_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p) if (!xflag && !qflag) default_print(p, caplen); } - } else if (ether_encap_print(ether_type, p, length, caplen) == 0) { + } else if (ether_encap_print(ether_type, p, length, caplen, + &extracted_ethertype) == 0) { /* ether_type not known, print raw packet */ if (!eflag) lane_print((u_char *)ep, length + sizeof(*ep)); @@ -145,4 +137,7 @@ lane_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p) default_print(p, caplen); out: putchar('\n'); + --infodelay; + if (infoprint) + info(0); }