Have separate "struct tok" PID-to-name tables for different OUIs; don't
diff --git a/print-ether.c b/print-ether.c
index a12e7b0..c845ae4 100644
--- a/print-ether.c
+++ b/print-ether.c
@@ -20,7 +20,7 @@
  */
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ether.c,v 1.95 2005-04-06 21:32:39 mcr Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ether.c,v 1.96 2005-04-25 17:56:43 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -37,24 +37,8 @@
 #include "ethertype.h"
 
 #include "ether.h"
-#include "llc.h"
 
 const struct tok ethertype_values[] = { 
-    /* not really ethertypes but PIDs that are used
-       in the SNAP printer - its more convenient
-       to put them into a single tokentable */
-    { PID_RFC2684_ETH_FCS,      "Ethernet + FCS" },
-    { PID_RFC2684_ETH_NOFCS,    "Ethernet no FCS" },
-    { PID_RFC2684_802_4_FCS,    "802.4 + FCS" },
-    { PID_RFC2684_802_4_NOFCS,  "w/o FCS" },
-    { PID_RFC2684_802_5_FCS,    "Tokenring + FCS" },
-    { PID_RFC2684_802_5_NOFCS,  "Tokenring no FCS" },
-    { PID_RFC2684_FDDI_FCS,     "FDDI + FCS" },
-    { PID_RFC2684_FDDI_NOFCS,   "FDDI no FCS" },
-    { PID_RFC2684_802_6_FCS,    "802.6 + FCS" },
-    { PID_RFC2684_802_6_NOFCS,  "802.6 no FCS" },
-    { PID_RFC2684_BPDU,         "BPDU" },
-    /* the real Ethertypes */
     { ETHERTYPE_IP,		"IPv4" },
     { ETHERTYPE_MPLS,		"MPLS unicast" },
     { ETHERTYPE_MPLS_MULTI,	"MPLS multicast" },
diff --git a/print-llc.c b/print-llc.c
index 52250f2..114a30d 100644
--- a/print-llc.c
+++ b/print-llc.c
@@ -24,7 +24,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-llc.c,v 1.61 2005-04-06 21:32:41 mcr Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-llc.c,v 1.62 2005-04-25 17:56:43 guy Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -73,6 +73,32 @@
 	{ 0,		NULL }
 };
 
+struct oui_tok {
+	u_int32_t	oui;
+	const struct tok *tok;
+};
+
+static const struct tok bridged_values[] = { 
+    { PID_RFC2684_ETH_FCS,      "Ethernet + FCS" },
+    { PID_RFC2684_ETH_NOFCS,    "Ethernet w/o FCS" },
+    { PID_RFC2684_802_4_FCS,    "802.4 + FCS" },
+    { PID_RFC2684_802_4_NOFCS,  "802.4 w/o FCS" },
+    { PID_RFC2684_802_5_FCS,    "Token Ring + FCS" },
+    { PID_RFC2684_802_5_NOFCS,  "Token Ring w/o FCS" },
+    { PID_RFC2684_FDDI_FCS,     "FDDI + FCS" },
+    { PID_RFC2684_FDDI_NOFCS,   "FDDI w/o FCS" },
+    { PID_RFC2684_802_6_FCS,    "802.6 + FCS" },
+    { PID_RFC2684_802_6_NOFCS,  "802.6 w/o FCS" },
+    { PID_RFC2684_BPDU,         "BPDU" },
+    { 0,                        NULL },
+};
+
+static const struct oui_tok oui_to_tok[] = {
+	{ 0x000000, ethertype_values },
+	{ 0x0080C2, bridged_values },	/* bridged, RFC 2427 FR or RFC 2864 ATM */
+	{ 0, NULL }
+};
+
 /*
  * Returns non-zero IFF it succeeds in printing the header
  */
@@ -221,12 +247,23 @@
 		orgcode = EXTRACT_24BITS(&llc.llc_orgcode[0]);
 		et = EXTRACT_16BITS(&llc.llc_ethertype[0]);
 
-                if (eflag)
-                    (void)printf("oui %s (0x%06x), ethertype %s (0x%04x): ",
-                                 tok2str(oui_values,"Unknown",orgcode),
-                                 orgcode,
-                                 tok2str(ethertype_values,"Unknown", et),
-                                 et);
+		if (eflag) {
+			const struct tok *tok = NULL;
+			const struct oui_tok *otp;
+
+			for (otp = &oui_to_tok[0]; otp->tok != NULL; otp++) {
+				if (otp->oui == orgcode) {
+					tok = otp->tok;
+					break;
+				}
+			}
+			(void)printf("oui %s (0x%06x), %s %s (0x%04x): ",
+			     tok2str(oui_values, "Unknown", orgcode),
+			     orgcode,
+			     (orgcode == 0x000000 ? "ethertype" : "pid"),
+			     tok2str(tok, "Unknown", et),
+			     et);
+		}
 
 		/*
 		 * XXX - what *is* the right bridge pad value here?