From 631139b1eb48fdb171c28141e15d2a18854bef15 Mon Sep 17 00:00:00 2001 From: Uli Heilmeier Date: Sat, 13 Aug 2016 21:53:53 +0200 Subject: [PATCH] LLDP: Add Avaya IP Phone OUI Subtypes Used https://downloads.avaya.com/elmodocs2/one-X_Deskphone_Edition/R1.5/output/16_300698_4/admn0711.html as reference for the subtypes. Bug: 12740 Change-Id: Ia9084bca3ab07e484c1d074a2cdf6072b8a3dfa0 Reviewed-on: https://code.wireshark.org/review/17039 Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- epan/dissectors/packet-lldp.c | 142 ++++++++++++++++++++++++++++++++++ epan/oui.c | 1 + epan/oui.h | 1 + 3 files changed, 144 insertions(+) diff --git a/epan/dissectors/packet-lldp.c b/epan/dissectors/packet-lldp.c index 1b87f86d57..e63ca0987a 100644 --- a/epan/dissectors/packet-lldp.c +++ b/epan/dissectors/packet-lldp.c @@ -12,6 +12,9 @@ * Gregor Miernik * Expansion of dissector for Hytec-OUI * + * August 2016 + * Added Avaya IP Phone OUI, Uli Heilmeier + * * Wireshark - Network traffic analyzer * By Gerald Combs * Copyright 1998 Gerald Combs @@ -355,6 +358,16 @@ static int hf_hytec_incoming_port_name = -1; static int hf_hytec_trace_identifier = -1; static int hf_hytec_invalid_object_data = -1; static int hf_hytec_unknown_identifier_content = -1; +static int hf_avaya_subtype = -1; +static int hf_avaya_poe = -1; +static int hf_avaya_call_server = -1; +static int hf_avaya_cna_server = -1; +static int hf_avaya_file_server = -1; +static int hf_avaya_dot1q = -1; +static int hf_avaya_ipphone = -1; +static int hf_avaya_ipphone_ip = -1; +static int hf_avaya_ipphone_mask = -1; +static int hf_avaya_ipphone_gateway = -1; static int hf_unknown_subtype = -1; static int hf_unknown_subtype_content = -1; @@ -426,6 +439,7 @@ static gint ett_802_1qbg_capabilities_flags = -1; static gint ett_media_capabilities = -1; static gint ett_profinet_period = -1; static gint ett_cisco_fourwire_tlv = -1; +static gint ett_avaya_ipphone_tlv = -1; static gint ett_org_spc_hytec_subtype_transceiver = -1; static gint ett_org_spc_hytec_subtype_trace = -1; static gint ett_org_spc_hytec_trace_request = -1; @@ -634,6 +648,24 @@ static const value_string cisco_subtypes[] = { { 0, NULL } }; +/* Avaya Subtypes */ +static const value_string avaya_subtypes[] = { + { 1, "PoE Conservation Level Support" }, + { 3, "Call Server IP Address" }, + { 4, "IP Phone Addresses" }, + { 5, "CNA Server IP Address" }, + { 6, "File Server" }, + { 7, "802.1Q Framing" }, + { 0, NULL } +}; + +/* Avaya 802.1Q Framing Subtypes */ +static const value_string avaya_dot1q_subtypes[] = { + { 1, "Tagging" }, + { 2, "No Tagging" }, + { 0, NULL } +}; + /* 802.3 Power Class */ static const value_string power_class_802_3[] = { { 1, "0" }, @@ -3410,6 +3442,69 @@ dissect_hytec_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint proto_item_append_text(identifier_proto_item, ")"); } +/* Dissect Avaya OUI TLVs */ +static void +dissect_avaya_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset) +{ + guint8 subType; + + proto_tree *avaya_data = NULL; + proto_item *tf = NULL; + + /* Get subtype */ + subType = tvb_get_guint8(tvb, offset); + + proto_tree_add_item(tree, hf_avaya_subtype, tvb, offset, 1, ENC_BIG_ENDIAN); + + offset++; + + switch (subType) + { + case 0x01: /* PoE Conservation Level Support */ + { + proto_tree_add_item(tree, hf_avaya_poe, tvb, offset, 7, ENC_NA); + offset+=7; + break; + } + case 0x03: /* Call Server IP Address */ + { + proto_tree_add_item(tree, hf_avaya_call_server, tvb, offset, 4, ENC_NA); + offset+=4; + break; + } + case 0x04: /* IP Phone Addresses */ + { + tf = proto_tree_add_item(tree, hf_avaya_ipphone, tvb, offset, 12, ENC_NA); + avaya_data = proto_item_add_subtree(tf, ett_avaya_ipphone_tlv); + proto_tree_add_item(avaya_data, hf_avaya_ipphone_ip, tvb, offset, 4, ENC_NA); + proto_tree_add_item(avaya_data, hf_avaya_ipphone_mask, tvb, offset+4, 4, ENC_NA); + proto_tree_add_item(avaya_data, hf_avaya_ipphone_gateway, tvb, offset+8, 4, ENC_NA); + break; + } + case 0x05: /* CNA Server IP Address */ + { + proto_tree_add_item(tree, hf_avaya_cna_server, tvb, offset, 4, ENC_NA); + offset+=4; + break; + } + case 0x06: /* File Server */ + { + proto_tree_add_item(tree, hf_avaya_file_server, tvb, offset, 4, ENC_NA); + offset+=4; + break; + } + case 0x07: /* 802.1Q Framing */ + { + proto_tree_add_item(tree, hf_avaya_dot1q, tvb, offset, 1, ENC_NA); + offset+=1; + break; + } + default: + proto_tree_add_item(tree, hf_unknown_subtype_content, tvb, offset, -1, ENC_NA); + break; + } +} + /* Dissect Organizational Specific TLV */ static gint32 dissect_organizational_specific_tlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset) @@ -3560,6 +3655,9 @@ dissect_organizational_specific_tlv(tvbuff_t *tvb, packet_info *pinfo, proto_tre break; } break; + case OUI_AVAYA: + subTypeStr = val_to_str(subType, avaya_subtypes, "Unknown subtype (0x%x)"); + break; default: subTypeStr = wmem_strdup_printf(wmem_packet_scope(), "Unknown (%d)",subType); break; @@ -3605,6 +3703,9 @@ dissect_organizational_specific_tlv(tvbuff_t *tvb, packet_info *pinfo, proto_tre case OUI_HYTEC_GER: dissect_hytec_tlv(tvb, pinfo, org_tlv_tree, (offset + 5)); break; + case OUI_AVAYA: + dissect_avaya_tlv(tvb, pinfo, org_tlv_tree, (offset + 5)); + break; default: dissect_oui_default_tlv(tvb, pinfo, org_tlv_tree, (offset + 5)); } @@ -4995,6 +5096,46 @@ proto_register_lldp(void) { "Unknown Identifier Content","lldp.hytec.unknown_identifier_content", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } }, + { &hf_avaya_subtype, + { "Avaya Subtype", "lldp.avaya.subtype", FT_UINT8, BASE_HEX, + VALS(avaya_subtypes), 0x0, NULL, HFILL } + }, + { &hf_avaya_poe, + { "PoE Conservation Level Support", "lldp.avaya.poe", FT_BYTES, BASE_NONE, + NULL, 0x0, NULL, HFILL } + }, + { &hf_avaya_call_server, + { "Call Server IP Address", "lldp.avaya.callserver", FT_IPv4, BASE_NONE, + NULL, 0x0, NULL, HFILL } + }, + { &hf_avaya_cna_server, + { "CNA Server IP Address", "lldp.avaya.cnaserver", FT_IPv4, BASE_NONE, + NULL, 0x0, NULL, HFILL } + }, + { &hf_avaya_file_server, + { "File Server", "lldp.avaya.fileserver", FT_IPv4, BASE_NONE, + NULL, 0x0, NULL, HFILL } + }, + { &hf_avaya_dot1q, + { "802.1Q Framing", "lldp.avaya.dot1q", FT_UINT8, BASE_HEX, + VALS(avaya_dot1q_subtypes), 0x0, NULL, HFILL } + }, + { &hf_avaya_ipphone, + { "IP Phone Addresses", "lldp.avaya.ipphone", FT_BYTES, BASE_NONE, + NULL, 0x0, NULL, HFILL } + }, + { &hf_avaya_ipphone_ip, + { "IP Address", "lldp.avaya.ipphone.ip", FT_IPv4, BASE_NONE, + NULL, 0x0, NULL, HFILL } + }, + { &hf_avaya_ipphone_mask, + { "Subnet Mask", "lldp.avaya.ipphone.mask", FT_IPv4, BASE_NONE, + NULL, 0x0, NULL, HFILL } + }, + { &hf_avaya_ipphone_gateway, + { "Gateway IP", "lldp.avaya.ipphone.gateway", FT_IPv4, BASE_NONE, + NULL, 0x0, NULL, HFILL } + }, { &hf_unknown_subtype, { "Unknown Subtype","lldp.unknown_subtype", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } @@ -5071,6 +5212,7 @@ proto_register_lldp(void) &ett_media_capabilities, &ett_profinet_period, &ett_cisco_fourwire_tlv, + &ett_avaya_ipphone_tlv, &ett_org_spc_hytec_subtype_transceiver, &ett_org_spc_hytec_subtype_trace, &ett_org_spc_hytec_trace_request, diff --git a/epan/oui.c b/epan/oui.c index 9bd9b0e00b..7f87abdf2d 100644 --- a/epan/oui.c +++ b/epan/oui.c @@ -85,6 +85,7 @@ http://www.cisco.com/univercd/cc/td/doc/product/software/ios113ed/113ed_cr/ibm_r { OUI_3GPP2, "3GPP2 Vendor specific packet ID" }, { OUI_ERICSSON_2, "Ericsson Group" }, { OUI_DCBX, "Data Center Bridging Capabilities Exchange" }, + { OUI_AVAYA, "Avaya" }, { 0, NULL } }; diff --git a/epan/oui.h b/epan/oui.h index 72f516e598..cebce151c8 100644 --- a/epan/oui.h +++ b/epan/oui.h @@ -69,6 +69,7 @@ #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_AVAYA 0x00400D /* Avaya */ #define OUI_CISCOWL 0x004096 /* Cisco Wireless (Aironet) */ #define OUI_MARVELL 0x005043 /* Marvell Semiconductor */ #define OUI_WPAWME 0x0050F2 /* Wi-Fi : WPA / WME */