Just have one value_string table for OUIs.

While we're at it, get rid of duplicate #defines for some OUIs, sort the
OUI #defines, and fix some routine names.

Change-Id: I8f4e5408b44896c3629a0014299b060ebc15bab6
Reviewed-on: https://code.wireshark.org/review/1906
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2014-06-01 02:19:03 -07:00
parent 7c68a8e540
commit d55bb723e2
5 changed files with 20 additions and 39 deletions

View File

@ -199,9 +199,9 @@ dissect_vdp_fi_macvid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, g
return tempOffset-offset; return tempOffset-offset;
} }
/* Dissect VDP TLVs */ /* Dissect Organizationally Defined TLVs */
static gint32 static gint32
dissect_vdp_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset) dissect_vdp_org_specific_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset)
{ {
guint16 tempLen; guint16 tempLen;
guint16 len; guint16 len;
@ -223,7 +223,7 @@ dissect_vdp_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32
oui = tvb_get_ntoh24(tvb, (tempOffset)); oui = tvb_get_ntoh24(tvb, (tempOffset));
/* maintain previous OUI names. If not included, look in manuf database for OUI */ /* maintain previous OUI names. If not included, look in manuf database for OUI */
ouiStr = val_to_str_const(oui, tlv_oui_subtype_vals, "Unknown"); ouiStr = val_to_str_const(oui, oui_vals, "Unknown");
if (strcmp(ouiStr, "Unknown")==0) { if (strcmp(ouiStr, "Unknown")==0) {
ouiStr = uint_get_manuf_name_if_known(oui); ouiStr = uint_get_manuf_name_if_known(oui);
if(ouiStr==NULL) ouiStr="Unknown"; if(ouiStr==NULL) ouiStr="Unknown";
@ -296,7 +296,7 @@ dissect_vdp_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32
/* Dissect End of VDP TLV (Mandatory) */ /* Dissect End of VDP TLV (Mandatory) */
gint32 gint32
dissect_vdp_end_of_vdpdu(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset) dissect_vdp_end_of_vdpdu_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset)
{ {
guint16 tempLen; guint16 tempLen;
guint16 tempShort; guint16 tempShort;
@ -356,10 +356,10 @@ dissect_ecp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
switch (tempType) { switch (tempType) {
case ORG_SPECIFIC_TLV_TYPE: case ORG_SPECIFIC_TLV_TYPE:
tempLen = dissect_vdp_tlv(tvb, pinfo, ecp_tree, offset); tempLen = dissect_vdp_org_specific_tlv(tvb, pinfo, ecp_tree, offset);
break; break;
case END_OF_VDPDU_TLV_TYPE: case END_OF_VDPDU_TLV_TYPE:
tempLen = dissect_vdp_end_of_vdpdu(tvb, pinfo, ecp_tree, offset); tempLen = dissect_vdp_end_of_vdpdu_tlv(tvb, pinfo, ecp_tree, offset);
break; break;
default: default:
tempLen = dissect_ecp_unknown_tlv(tvb, pinfo, ecp_tree, offset); tempLen = dissect_ecp_unknown_tlv(tvb, pinfo, ecp_tree, offset);
@ -407,7 +407,7 @@ void proto_register_ecp_oui(void)
#if 0 #if 0
{ &hf_ecp_vdp_oui, { &hf_ecp_vdp_oui,
{ "Organization Unique Code", "ecp.vdp.oui", FT_UINT24, BASE_HEX, { "Organization Unique Code", "ecp.vdp.oui", FT_UINT24, BASE_HEX,
VALS(tlv_oui_subtype_vals), 0x0, NULL, HFILL } VALS(oui_vals), 0x0, NULL, HFILL }
}, },
#endif #endif
{ &hf_ecp_vdp_mode, { &hf_ecp_vdp_mode,

View File

@ -623,7 +623,7 @@ dissect_snap(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
} }
break; break;
case OUI_BRIDGED: case OUI_IEEE_802_1:
/* /*
* MAC frames bridged over ATM (RFC 2684) or Frame Relay * MAC frames bridged over ATM (RFC 2684) or Frame Relay
* (RFC 2427). * (RFC 2427).

View File

@ -3025,7 +3025,7 @@ dissect_organizational_specific_tlv(tvbuff_t *tvb, packet_info *pinfo, proto_tre
return tLength; return tLength;
} }
/* maintain previous OUI names. If not included, look in manuf database for OUI */ /* maintain previous OUI names. If not included, look in manuf database for OUI */
ouiStr = val_to_str_const(oui, tlv_oui_subtype_vals, "Unknown"); ouiStr = val_to_str_const(oui, oui_vals, "Unknown");
if (strcmp(ouiStr, "Unknown")==0) { if (strcmp(ouiStr, "Unknown")==0) {
ouiStr = uint_get_manuf_name_if_known(oui); ouiStr = uint_get_manuf_name_if_known(oui);
if(ouiStr==NULL) ouiStr="Unknown"; if(ouiStr==NULL) ouiStr="Unknown";
@ -3516,7 +3516,7 @@ proto_register_lldp(void)
}, },
{ &hf_org_spc_oui, { &hf_org_spc_oui,
{ "Organization Unique Code", "lldp.orgtlv.oui", FT_UINT24, BASE_HEX, { "Organization Unique Code", "lldp.orgtlv.oui", FT_UINT24, BASE_HEX,
VALS(tlv_oui_subtype_vals), 0x0, NULL, HFILL } VALS(oui_vals), 0x0, NULL, HFILL }
}, },
{ &hf_dcbx_type, { &hf_dcbx_type,
{ "DCBx Protocol", "lldp.dcbx.proto", FT_UINT8, BASE_HEX, { "DCBx Protocol", "lldp.dcbx.proto", FT_UINT8, BASE_HEX,

View File

@ -48,6 +48,7 @@ http://www.cisco.com/univercd/cc/td/doc/product/software/ios113ed/113ed_cr/ibm_r
{ OUI_CATENA, "Catena Networks" }, { OUI_CATENA, "Catena Networks" },
{ OUI_SONY_ERICSSON, "Sony Ericsson Mobile Communications AB" }, { OUI_SONY_ERICSSON, "Sony Ericsson Mobile Communications AB" },
{ OUI_SONY_ERICSSON_2, "Sony Ericsson Mobile Communications AB" }, { OUI_SONY_ERICSSON_2, "Sony Ericsson Mobile Communications AB" },
/* PROFINET */
{ OUI_PROFINET, "PROFIBUS Nutzerorganisation e.V." }, { OUI_PROFINET, "PROFIBUS Nutzerorganisation e.V." },
{ OUI_SONY_ERICSSON_3, "Sony Ericsson Mobile Communications AB" }, { OUI_SONY_ERICSSON_3, "Sony Ericsson Mobile Communications AB" },
{ OUI_CIMETRICS, "Cimetrics" }, { OUI_CIMETRICS, "Cimetrics" },
@ -60,12 +61,13 @@ http://www.cisco.com/univercd/cc/td/doc/product/software/ios113ed/113ed_cr/ibm_r
{ OUI_SONY_ERICSSON_7, "Sony Ericsson Mobile Communications AB" }, { OUI_SONY_ERICSSON_7, "Sony Ericsson Mobile Communications AB" },
{ OUI_BLUETOOTH, "Bluetooth SIG, Inc." }, { OUI_BLUETOOTH, "Bluetooth SIG, Inc." },
{ OUI_SONY_ERICSSON_8, "Sony Ericsson Mobile Communications AB" }, { OUI_SONY_ERICSSON_8, "Sony Ericsson Mobile Communications AB" },
/* Currently, the manuf file calls this "Procurve", as it's assigned to HP! */
{ OUI_IEEE_802_1QBG, "IEEE 802.1Qbg" }, { OUI_IEEE_802_1QBG, "IEEE 802.1Qbg" },
{ OUI_TURBOCELL, "Karlnet (Turbocell)" }, { OUI_TURBOCELL, "Karlnet (Turbocell)" },
{ OUI_CISCOWL, "Cisco Wireless (Aironet) L2" }, { OUI_CISCOWL, "Cisco Wireless (Aironet) L2" },
{ OUI_MARVELL, "Marvell Semiconductor" }, { OUI_MARVELL, "Marvell Semiconductor" },
{ OUI_BRIDGED, "Frame Relay or ATM bridged frames" }, /* Used for RFC 2427 bridged Frame Relay and RFC 2684 bridged ATM */
{ OUI_IEEE_802_1, "IEEE 802.1 Committee" }, { OUI_IEEE_802_1, "IEEE 802.1" },
{ OUI_ATM_FORUM, "ATM Forum" }, { OUI_ATM_FORUM, "ATM Forum" },
{ OUI_EXTREME, "Extreme Networks" }, { OUI_EXTREME, "Extreme Networks" },
/* RFC 2427, RFC 2684 */ /* RFC 2427, RFC 2684 */
@ -77,22 +79,6 @@ http://www.cisco.com/univercd/cc/td/doc/product/software/ios113ed/113ed_cr/ibm_r
/* Registry Name: PPP Vendor Specific OUI Options */ /* Registry Name: PPP Vendor Specific OUI Options */
{ OUI_3GPP2, "3GPP2 Vendor specific packet ID" }, { OUI_3GPP2, "3GPP2 Vendor specific packet ID" },
{ OUI_ERICSSON_2, "Ericsson Group" }, { OUI_ERICSSON_2, "Ericsson Group" },
{ OUI_DCBX, "Data Center Bridging Capabilities Exchange" },
{ 0, NULL } { 0, NULL }
}; };
const value_string tlv_oui_subtype_vals[] = {
/* Currently, the manuf file calls this "Ieee8021"; "IEEE 802.1" looks better */
{ OUI_IEEE_802_1, "IEEE 802.1" },
/* Currently, the manuf file calls this "Ieee8023"; "IEEE 802.3" looks better */
{ OUI_IEEE_802_3, "IEEE 802.3" },
/* Currently, the manuf file calls this "Telecomm"; "TIA TR-41 Committee" looks better */
{ OUI_MEDIA_ENDPOINT, "TIA TR-41 Committee" },
/* Currently, the manuf file calls this "Profibus" */
{ OUI_PROFINET, "PROFINET" },
/* Currently, the manuf file calls this "Procurve", as it's assigned to HP! */
{ OUI_IEEE_802_1QBG, "IEEE 802.1Qbg" },
/* Data Center Bridging Exchange */
{ OUI_DCBX, "Data Center Bridging Capabilities Exchange" },
{ 0, NULL }
};

View File

@ -46,8 +46,10 @@
#define OUI_CATENA 0x00025A /* Catena Networks */ #define OUI_CATENA 0x00025A /* Catena Networks */
#define OUI_ATHEROS 0x00037F /* Atheros Communications */ #define OUI_ATHEROS 0x00037F /* Atheros Communications */
#define OUI_SONY_ERICSSON 0x000AD9 /* Sony Ericsson Mobile Communications AB */ #define OUI_SONY_ERICSSON 0x000AD9 /* Sony Ericsson Mobile Communications AB */
#define OUI_ARUBA 0x000B86 /* Aruba Networks */
#define OUI_SONY_ERICSSON_2 0x000E07 /* Sony Ericsson Mobile Communications AB */ #define OUI_SONY_ERICSSON_2 0x000E07 /* Sony Ericsson Mobile Communications AB */
#define OUI_PROFINET 0x000ECF /* PROFIBUS Nutzerorganisation e.V. */ #define OUI_PROFINET 0x000ECF /* PROFIBUS Nutzerorganisation e.V. */
#define OUI_RSN 0x000FAC /* Wi-Fi : RSN */
#define OUI_SONY_ERICSSON_3 0x000FDE /* Sony Ericsson Mobile Communications AB */ #define OUI_SONY_ERICSSON_3 0x000FDE /* Sony Ericsson Mobile Communications AB */
#define OUI_CIMETRICS 0x001090 /* Cimetrics, Inc. */ #define OUI_CIMETRICS 0x001090 /* Cimetrics, Inc. */
#define OUI_IEEE_802_3 0x00120F /* IEEE 802.3 */ #define OUI_IEEE_802_3 0x00120F /* IEEE 802.3 */
@ -61,13 +63,14 @@
#define OUI_SONY_ERICSSON_8 0x001963 /* Sony Ericsson Mobile Communications AB */ #define OUI_SONY_ERICSSON_8 0x001963 /* Sony Ericsson Mobile Communications AB */
#define OUI_DCBX 0x001B21 /* Data Center Bridging Capabilities Exchange Protocol */ #define OUI_DCBX 0x001B21 /* Data Center Bridging Capabilities Exchange Protocol */
#define OUI_IEEE_802_1QBG 0x001B3F /* IEEE 802.1 Qbg */ #define OUI_IEEE_802_1QBG 0x001B3F /* IEEE 802.1 Qbg */
#define OUI_NINTENDO 0x001F32
#define OUI_TURBOCELL 0x0020F6 /* KarlNet, who brought you Turbocell */ #define OUI_TURBOCELL 0x0020F6 /* KarlNet, who brought you Turbocell */
#define OUI_CISCOWL 0x004096 /* Cisco Wireless (Aironet) */ #define OUI_CISCOWL 0x004096 /* Cisco Wireless (Aironet) */
#define OUI_MARVELL 0x005043 /* Marvell Semiconductor */ #define OUI_MARVELL 0x005043 /* Marvell Semiconductor */
#define OUI_WPAWME 0x0050F2 /* Wi-Fi : WPA / WME */
#define OUI_ERICSSON_2 0x008037 /* Ericsson Group */ #define OUI_ERICSSON_2 0x008037 /* Ericsson Group */
#define OUI_BRIDGED 0x0080C2 /* Bridged Frame-Relay, RFC 2427 */
/* and Bridged ATM, RFC 2684 */
#define OUI_IEEE_802_1 0x0080C2 /* IEEE 802.1 Committee */ #define OUI_IEEE_802_1 0x0080C2 /* IEEE 802.1 Committee */
#define OUI_PRE11N 0x00904C /* Wi-Fi : 802.11 Pre-N */
#define OUI_ATM_FORUM 0x00A03E /* ATM Forum */ #define OUI_ATM_FORUM 0x00A03E /* ATM Forum */
#define OUI_EXTREME 0x00E02B /* Extreme EDP/ESRP */ #define OUI_EXTREME 0x00E02B /* Extreme EDP/ESRP */
#define OUI_CABLE_BPDU 0x00E02F /* DOCSIS spanning tree BPDU */ #define OUI_CABLE_BPDU 0x00E02F /* DOCSIS spanning tree BPDU */
@ -78,17 +81,9 @@
#define OUI_HP_2 0x00805F /* Hewlett-Packard */ #define OUI_HP_2 0x00805F /* Hewlett-Packard */
#define OUI_WFA 0x506F9A /* Wi-Fi Alliance */ #define OUI_WFA 0x506F9A /* Wi-Fi Alliance */
#define OUI_3GPP2 0xCF0002 /* 3GPP2 */ #define OUI_3GPP2 0xCF0002 /* 3GPP2 */
#define OUI_ARUBA 0x000b86 /* Aruba Networks */
#define OUI_NINTENDO 0x001F32
#define OUI_WPAWME 0x0050F2 /* Wi-Fi : WPA / WME */
#define OUI_RSN 0x000FAC /* Wi-Fi : RSN */
#define OUI_PRE11N 0x00904C /* Wi-Fi : 802.11 Pre-N */
extern const value_string oui_vals[]; extern const value_string oui_vals[];
extern const value_string tlv_oui_subtype_vals[];
#endif #endif
/* /*