* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /tcpdump/master/tcpdump/ethertype.h,v 1.23 2004-06-12 16:32:56 hannes Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/ethertype.h,v 1.24 2004-10-07 16:04:07 hannes Exp $ (LBL)
*/
/*
* <netinet/if_ether.h> if all it needs are ETHERTYPE_ values.
*/
+#ifndef ETHERTYPE_LEN
+#define ETHERTYPE_LEN 2
+#endif
+
#ifndef ETHERTYPE_GRE_ISO
#define ETHERTYPE_GRE_ISO 0x00FE /* not really an ethertype only used in GRE */
#endif
#ifndef lint
static const char rcsid[] _U_ =
- "@(#)$Header: /tcpdump/master/tcpdump/print-fr.c,v 1.22 2004-10-07 14:53:10 hannes Exp $ (LBL)";
+ "@(#)$Header: /tcpdump/master/tcpdump/print-fr.c,v 1.23 2004-10-07 16:04:06 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
return caplen;
}
- if (p[addr_len] != 0x03)
- printf("UI %02x! ", p[addr_len]);
+ if (p[addr_len] != 0x03) {
+
+ /* lets figure out if we have cisco style encapsulation: */
+ extracted_ethertype = EXTRACT_16BITS(p+addr_len);
+
+ if (eflag)
+ printf("%s (0x%04x), length %u: ",
+ tok2str(ethertype_values, "unknown", extracted_ethertype),
+ extracted_ethertype,
+ length);
+
+ if (ether_encap_print(extracted_ethertype,
+ p+addr_len+ETHERTYPE_LEN,
+ length-(addr_len),
+ caplen-(addr_len),
+ &extracted_ethertype) == 0)
+ /* ether_type not known, probably it wasn't one */
+ printf("UI %02x! ", p[addr_len]);
+ else
+ return hdr_len;
+ }
if (!p[addr_len + 1]) { /* pad byte should be used with 3-byte Q.922 */
if (addr_len != 3)