]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-lane.c
Get rid of unneeded includes of <netinet/in_systm.h> and <netinet/ip.h>.
[tcpdump] / print-lane.c
index 501031400afde8ba7a11342af70834bba060d9f8..2836f788f56b184c4160b39ff1a5b63e9d8e0f83 100644 (file)
@@ -22,7 +22,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-lane.c,v 1.9 2000-09-29 04:58:43 guy 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
@@ -81,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)) {
@@ -112,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)));
@@ -123,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));
@@ -134,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);
 }