IEEE80211: handle symbol proprietary tag seperately
authorJaap Keuter <jaap.keuter@xs4all.nl>
Fri, 19 Jul 2019 20:31:06 +0000 (22:31 +0200)
committerAlexis La Goutte <alexis.lagoutte@gmail.com>
Sun, 21 Jul 2019 13:11:20 +0000 (13:11 +0000)
The contents of the Symbol Proprietary TLV was assumbed to be the same
as the Vendor Specific TLV. This proved not to be the case, at least for
Zebra Extreme networks nodes. This change implements the dissection of
the format as defined in the bug.

Bug: 15909
Change-Id: I4c14dde386d33302d187680f9f09f8b5bb1ef213
Reviewed-on: https://code.wireshark.org/review/34023
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
debian/libwireshark0.symbols
epan/dissectors/packet-ieee80211.c
epan/dissectors/packet-srt.c
epan/unit_strings.c
epan/unit_strings.h

index b4b9c5b2ca2956646612a6438c0855598bca0fc5..9b832e5c9607a219192ddf576fc1fc3839586993 100644 (file)
@@ -1924,6 +1924,8 @@ libwireshark.so.0 libwireshark0 #MINVER#
  units_newton_metre@Base 2.3.0
  units_octet_octets@Base 2.3.0
  units_percent@Base 2.3.0
+ units_pkts@Base 3.1.0
+ units_pkts_per_sec@Base 3.1.0
  units_revolutions_per_minute@Base 2.3.0
  units_second_seconds@Base 2.3.0
  units_seconds@Base 2.3.0
index 1d2e28713ad85f65adf729971f64f201f4393a06..b26e4b266c4cfbd88d29deb4e63ca1d920b3f55f 100644 (file)
@@ -5105,6 +5105,15 @@ static int hf_ieee80211_aruba_mtu = -1;
 static int hf_ieee80211_tag_vendor_oui_type = -1;
 static int hf_ieee80211_tag_vendor_data = -1;
 
+static int hf_ieee80211_symbp_extreme_assoc_clients = -1;
+static int hf_ieee80211_symbp_extreme_load_kbps = -1;
+static int hf_ieee80211_symbp_extreme_load_pps = -1;
+static int hf_ieee80211_symbp_extreme_client_tx_power = -1;
+static int hf_ieee80211_symbp_extreme_timestamp = -1;
+
+static int hf_ieee80211_tag_symbol_proprietary_oui = -1;
+static int hf_ieee80211_tag_symbol_proprietary_data = -1;
+
 /* IEEE Std 802.11z-2010 7.3.2.62 */
 static int hf_ieee80211_tag_link_id_bssid = -1;
 static int hf_ieee80211_tag_link_id_init_sta = -1;
@@ -20117,6 +20126,60 @@ ieee80211_tag_vendor_specific_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
   return tvb_captured_length(tvb);
 }
 
+static void
+dissect_symbol_proprietary_ie_extreme(proto_item *item _U_, proto_tree *ietree,
+                                      tvbuff_t *tvb, int offset, guint32 tag_len _U_,
+                                      packet_info *pinfo _U_)
+{
+  proto_tree_add_item(ietree, hf_ieee80211_symbp_extreme_assoc_clients, tvb, offset, 2, ENC_LITTLE_ENDIAN);
+  offset += 2;
+
+  proto_tree_add_item(ietree, hf_ieee80211_symbp_extreme_load_kbps, tvb, offset, 2, ENC_LITTLE_ENDIAN);
+  offset += 2;
+
+  proto_tree_add_item(ietree, hf_ieee80211_symbp_extreme_load_pps, tvb, offset, 2, ENC_LITTLE_ENDIAN);
+  offset += 2;
+
+  proto_tree_add_item(ietree, hf_ieee80211_symbp_extreme_client_tx_power, tvb, offset, 2, ENC_LITTLE_ENDIAN);
+  offset += 2;
+
+  proto_tree_add_item(ietree, hf_ieee80211_symbp_extreme_timestamp, tvb, offset, 4, ENC_TIME_SECS|ENC_LITTLE_ENDIAN);
+}
+
+static int
+ieee80211_tag_symbol_proprietary_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
+{
+  int tag_len = tvb_reported_length(tvb);
+  ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
+  int offset = 0;
+  guint32 tag_vs_len = tag_len;
+  guint32       oui;
+
+  if (tag_len < 3)
+  {
+    expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be >= 3", tag_len);
+    return tvb_captured_length(tvb);
+  }
+
+  proto_tree_add_item_ret_uint(tree, hf_ieee80211_tag_symbol_proprietary_oui, tvb, offset, 3, ENC_BIG_ENDIAN, &oui);
+  proto_item_append_text(field_data->item_tag, ": %s", uint_get_manuf_name_if_known(oui));
+
+  offset += 3;
+  tag_vs_len -= 3;
+
+  switch (oui) {
+    /* 802.11 specific vendor ids */
+    case OUI_ZEBRA_EXTREME:
+      dissect_symbol_proprietary_ie_extreme(field_data->item_tag, tree, tvb, offset, tag_vs_len, pinfo);
+      break;
+    default:
+      proto_tree_add_item(tree, hf_ieee80211_tag_symbol_proprietary_data, tvb, offset, tag_vs_len, ENC_NA);
+      break;
+  }
+
+  return tvb_captured_length(tvb);
+}
+
 #define HE_HTC_HE_SUPPORT                0x00000001
 #define HE_FRAGMENTATION_SUPPORT         0x00000018
 #define HE_ALL_ACK_SUPPORT               0x00000200
@@ -30373,6 +30436,41 @@ proto_register_ieee80211(void)
       FT_BYTES, BASE_NONE, NULL, 0,
       "Unknown/undecoded Vendor Specific Data", HFILL }},
 
+    {&hf_ieee80211_symbp_extreme_assoc_clients,
+     {"Associated clients", "wlan.tag.symbol_proprietary.extreme.assoc_clients",
+      FT_UINT16, BASE_DEC, NULL, 0,
+      NULL, HFILL }},
+
+    {&hf_ieee80211_symbp_extreme_load_kbps,
+     {"Load", "wlan.tag.symbol_proprietary.extreme.load_kbps",
+      FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_kbps, 0,
+      NULL, HFILL }},
+
+    {&hf_ieee80211_symbp_extreme_load_pps,
+     {"Load", "wlan.tag.symbol_proprietary.extreme.load_pps",
+      FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_pkts_per_sec, 0,
+      NULL, HFILL }},
+
+    {&hf_ieee80211_symbp_extreme_client_tx_power,
+     {"Desired client Tx power", "wlan.tag.symbol_proprietary.extreme.client_txpower",
+      FT_UINT16, BASE_DEC, NULL, 0,
+      NULL, HFILL }},
+
+    {&hf_ieee80211_symbp_extreme_timestamp,
+     {"Timestamp", "wlan.tag.symbol_proprietary.extreme.timestamp",
+      FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0,
+      NULL, HFILL }},
+
+    {&hf_ieee80211_tag_symbol_proprietary_oui,
+     {"Symbol Propritary OUI", "wlan.tag.symbol_proprietary.oui",
+      FT_UINT24, BASE_OUI, NULL, 0,
+      NULL, HFILL }},
+
+    {&hf_ieee80211_tag_symbol_proprietary_data,
+     {"Symbol Proprietary Data", "wlan.tag.symbol_proprietary.data",
+      FT_BYTES, BASE_NONE, NULL, 0,
+      "Unknown/undecoded Symbol Proprietary Data", HFILL }},
+
     {&hf_ieee80211_tim_dtim_count,
      {"DTIM count", "wlan.tim.dtim_count",
       FT_UINT8, BASE_DEC, NULL, 0,
@@ -37920,8 +38018,7 @@ proto_reg_handoff_ieee80211(void)
   dissector_add_uint("wlan.tag.number", TAG_VENDOR_SPECIFIC_IE, create_dissector_handle(ieee80211_tag_vendor_specific_ie, -1));
   /* This Cisco proprietary IE seems to mimic 221 */
   dissector_add_uint("wlan.tag.number", TAG_CISCO_VENDOR_SPECIFIC, create_dissector_handle(ieee80211_tag_vendor_specific_ie, -1));
-  /* This Symbol proprietary IE seems to mimic 221 */
-  dissector_add_uint("wlan.tag.number", TAG_SYMBOL_PROPRIETARY, create_dissector_handle(ieee80211_tag_vendor_specific_ie, -1));
+  dissector_add_uint("wlan.tag.number", TAG_SYMBOL_PROPRIETARY, create_dissector_handle(ieee80211_tag_symbol_proprietary_ie, -1));
   dissector_add_uint("wlan.tag.number", TAG_MOBILITY_DOMAIN, create_dissector_handle(dissect_mobility_domain, -1));
   dissector_add_uint("wlan.tag.number", TAG_FAST_BSS_TRANSITION, create_dissector_handle(dissect_fast_bss_transition, -1));
   dissector_add_uint("wlan.tag.number", TAG_MMIE, create_dissector_handle(dissect_mmie, -1));
index 0272fe4523e583e32e7d42f3a8edaa88bbfcf669..df1e9da53706dda08dc977c2f7d39547851166ea 100644 (file)
@@ -101,11 +101,6 @@ static expert_field ei_srt_hs_ext_type = EI_INIT;
 static dissector_handle_t srt_udp_handle;
 
 
-/* Base Unit Strings Definitions */
-const unit_name_string units_pkts         = { " pkts", NULL };
-const unit_name_string units_pkts_per_sec = { " pkts/s", NULL };
-
-
 /* This defines the firstmost bit of the packet, so it can stay this way. */
 #define SRT_TYPE_DATA            0
 #define SRT_TYPE_CONTROL        1
index 0cd49774577ea5ccfea4431d9471a929caba393d..7b6be98d1c0748c7e3d1cd25bad94d499aa164d3 100644 (file)
@@ -83,6 +83,8 @@ const unit_name_string units_hz_s = { "Hz/s", NULL };
 const unit_name_string units_kbit = { "kbit", NULL };
 const unit_name_string units_kbps = { "Kbps", NULL };
 const unit_name_string units_kibps = { "KiB/s", NULL };
+const unit_name_string units_pkts = { " pkts", NULL };
+const unit_name_string units_pkts_per_sec = { " pkts/s", NULL };
 const unit_name_string units_km = { "km", NULL };
 const unit_name_string units_kmh = { "km/h", NULL };
 const unit_name_string units_bit_sec = { "bits/s", NULL };
index 1b19597c892d8ecc4f34302cc1178555193e331e..d539febe24eab1dc3138e05ed03ed9ddb67520cc 100644 (file)
@@ -75,6 +75,8 @@ WS_DLL_PUBLIC const unit_name_string units_hz_s;
 WS_DLL_PUBLIC const unit_name_string units_kbit;
 WS_DLL_PUBLIC const unit_name_string units_kbps;
 WS_DLL_PUBLIC const unit_name_string units_kibps;
+WS_DLL_PUBLIC const unit_name_string units_pkts;
+WS_DLL_PUBLIC const unit_name_string units_pkts_per_sec;
 WS_DLL_PUBLIC const unit_name_string units_km;
 WS_DLL_PUBLIC const unit_name_string units_kmh;
 WS_DLL_PUBLIC const unit_name_string units_milliamps;