]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ether.c
remove some EXTRACT_ lookalikes plus misc. display cleanup
[tcpdump] / print-ether.c
index 2826c7bbd252f0377fd892b4123017f5192a5965..9b1d85f0289b7fa8a63cc73445ceb16fe306f244 100644 (file)
@@ -20,7 +20,7 @@
  */
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ether.c,v 1.76 2002-12-19 09:39:12 guy 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 %d: ",
-                            etheraddr_string(ESRC(ep)),
-                            etheraddr_string(EDST(ep)),
-                            length);
-       else
-               (void)printf("%s %s %s %d: ",
-                            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