]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ether.c
remove some EXTRACT_ lookalikes plus misc. display cleanup
[tcpdump] / print-ether.c
index 4b6527cca81e8264decaabd47bd38ebf9285bfd0..9b1d85f0289b7fa8a63cc73445ceb16fe306f244 100644 (file)
@@ -20,7 +20,7 @@
  */
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ether.c,v 1.78 2003-05-08 14:40:54 hannes Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ether.c,v 1.80 2003-05-22 14:31:36 hannes Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -44,19 +44,21 @@ static inline void
 ether_hdr_print(register const u_char *bp, u_int length)
 {
        register const struct ether_header *ep;
-
        ep = (const struct ether_header *)bp;
-       if (qflag)
-               (void)printf("%s > %s (length: %u): ",
-                            etheraddr_string(ESRC(ep)),
-                            etheraddr_string(EDST(ep)),
-                            length);
-       else
-               (void)printf("%s > %s %s (length: %u): ",
-                            etheraddr_string(ESRC(ep)),
-                            etheraddr_string(EDST(ep)),
-                            etherproto_string(ep->ether_type),
-                            length);
+
+       (void)printf("%s > %s",
+                    etheraddr_string(ESRC(ep)),
+                    etheraddr_string(EDST(ep)));
+
+       if (!qflag) {
+               if (ntohs(ep->ether_type) <= ETHERMTU)
+                         (void)printf(", 802.2");
+                else 
+                         (void)printf(", ethertype %s",
+                                      etherproto_string(ep->ether_type));            
+        }
+
+       (void)printf(", length %u: ", length);
 }
 
 void