From b87a2be0810f6758f4782aaf6424da23d030f902 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Mon, 21 Nov 2016 14:33:00 +0100 Subject: [PATCH] ieee80211: Add Meru (Fortinet) Vendor Specific TLV Change-Id: Iaa554ac94d248c67c635ac180ea2d1c1e3775b6a Reviewed-on: https://code.wireshark.org/review/18915 Petri-Dish: Alexis La Goutte Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- epan/dissectors/packet-ieee80211.c | 70 ++++++++++++++++++++++++++++++ epan/oui.c | 1 + epan/oui.h | 1 + 3 files changed, 72 insertions(+) diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c index f2a06841c5..5707251f07 100644 --- a/epan/dissectors/packet-ieee80211.c +++ b/epan/dissectors/packet-ieee80211.c @@ -4327,6 +4327,11 @@ static int hf_ieee80211_vs_mikrotik_subtype = -1; static int hf_ieee80211_vs_mikrotik_sublength = -1; static int hf_ieee80211_vs_mikrotik_subdata = -1; +static int hf_ieee80211_vs_meru_subitem = -1; +static int hf_ieee80211_vs_meru_subtype = -1; +static int hf_ieee80211_vs_meru_sublength = -1; +static int hf_ieee80211_vs_meru_subdata = -1; + static int hf_ieee80211_rsn_ie_pmkid = -1; static int hf_ieee80211_rsn_ie_unknown = -1; @@ -4965,6 +4970,8 @@ static gint ett_nintendo = -1; static gint ett_mikrotik = -1; +static gint ett_meru = -1; + static gint ett_qos_map_set_exception = -1; static gint ett_qos_map_set_range = -1; @@ -10503,6 +10510,42 @@ dissect_vendor_ie_nintendo(proto_item *item _U_, proto_tree *ietree, } } +static void +dissect_vendor_ie_meru(proto_item *item _U_, proto_tree *ietree, + tvbuff_t *tvb, int offset, guint32 tag_len, + packet_info *pinfo) +{ + guint32 type, length; + proto_item *subitem, *ti_len; + proto_tree *subtree; + + while (tag_len >= 2) { + subitem = proto_tree_add_item(ietree, hf_ieee80211_vs_meru_subitem, tvb, offset, 2, ENC_NA); + subtree = proto_item_add_subtree(subitem, ett_meru); + + proto_tree_add_item_ret_uint(subtree, hf_ieee80211_vs_meru_subtype, tvb, offset, 1, ENC_NA, &type); + offset += 1; + tag_len -= 1; + + ti_len = proto_tree_add_item_ret_uint(subtree, hf_ieee80211_vs_meru_sublength, tvb, offset, 1, ENC_NA, &length); + offset += 1; + tag_len -= 1; + + if (tag_len < length) { + expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag length < Sub Length"); + length = tag_len; + } + + proto_item_append_text(subitem, " (t=%d, l=%d)", type, length); + proto_item_set_len(subitem, 2+length); + + proto_tree_add_item(subtree, hf_ieee80211_vs_meru_subdata, tvb, offset, length, ENC_NA); + offset += length; + tag_len -= length; + + } +} + /* 802.11-2012 8.4.2.37 QoS Capability element */ static int dissect_qos_capability(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int ftype) @@ -15140,6 +15183,9 @@ add_tagged_field(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset case OUI_MIKROTIK: dissect_vendor_ie_mikrotik(ti, tree, tvb, offset, tag_vs_len); break; + case OUI_MERU: + dissect_vendor_ie_meru(ti, tree, tvb, offset, tag_vs_len, pinfo); + break; default: proto_tree_add_item(tree, hf_ieee80211_tag_vendor_data, tvb, offset, tag_vs_len, ENC_NA); break; @@ -25897,6 +25943,27 @@ proto_register_ieee80211(void) FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }}, + /* Vendor Specific : Meru (Fortinet) */ + {&hf_ieee80211_vs_meru_subitem, + {"Sub IE", "wlan.vs.meru.unknown", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL }}, + + {&hf_ieee80211_vs_meru_subtype, + {"Subtype", "wlan.vs.meru.subtype", + FT_UINT8, BASE_DEC, NULL, 0, + NULL, HFILL }}, + + {&hf_ieee80211_vs_meru_sublength, + {"Sublength", "wlan.vs.meru.sublength", + FT_UINT8, BASE_DEC, NULL, 0, + NULL, HFILL }}, + + {&hf_ieee80211_vs_meru_subdata, + {"Subdata", "wlan.vs.meru.subdata", + FT_BYTES, BASE_NONE, NULL, 0, + NULL, HFILL }}, + {&hf_ieee80211_tsinfo, {"Traffic Stream (TS) Info", "wlan.ts_info", FT_UINT24, BASE_HEX, NULL, 0, @@ -27089,8 +27156,11 @@ proto_register_ieee80211(void) &ett_ssid_list, &ett_nintendo, + &ett_mikrotik, + &ett_meru, + &ett_qos_map_set_exception, &ett_qos_map_set_range, diff --git a/epan/oui.c b/epan/oui.c index 7f87abdf2d..535c671bd0 100644 --- a/epan/oui.c +++ b/epan/oui.c @@ -86,6 +86,7 @@ http://www.cisco.com/univercd/cc/td/doc/product/software/ios113ed/113ed_cr/ibm_r { OUI_ERICSSON_2, "Ericsson Group" }, { OUI_DCBX, "Data Center Bridging Capabilities Exchange" }, { OUI_AVAYA, "Avaya" }, + { OUI_MERU, "Meru Network (Fortinet)" }, { 0, NULL } }; diff --git a/epan/oui.h b/epan/oui.h index cebce151c8..c0c6a9f5a4 100644 --- a/epan/oui.h +++ b/epan/oui.h @@ -87,6 +87,7 @@ #define OUI_HYTEC_GER 0x30B216 /* Hytec Geraetebau GmbH */ #define OUI_WFA 0x506F9A /* Wi-Fi Alliance */ #define OUI_3GPP2 0xCF0002 /* 3GPP2 */ +#define OUI_MERU 0x000ce6 /* Meru Network (Fortinet) */ extern const value_string oui_vals[];