diff options
author | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2012-01-10 12:08:43 +0000 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2012-01-10 12:08:43 +0000 |
commit | 668e23f9feddd058f3dff4be9cc6964c621e1c65 (patch) | |
tree | df9eb969903a2459024eab3d38af3b5964d362f2 | |
parent | 17fb65a364a131fd067b60e95d23074878c78f64 (diff) |
From Wojciech Dubowik via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6720
Add STBC flag to MCS field in radiotap packet dissector.
From me:
Replace VALS by TFS (and use boolean hf)
svn path=/trunk/; revision=40422
-rw-r--r-- | epan/dissectors/packet-radiotap-defs.h | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-radiotap.c | 18 |
2 files changed, 20 insertions, 0 deletions
diff --git a/epan/dissectors/packet-radiotap-defs.h b/epan/dissectors/packet-radiotap-defs.h index 038f4fa649..68c017cb83 100644 --- a/epan/dissectors/packet-radiotap-defs.h +++ b/epan/dissectors/packet-radiotap-defs.h @@ -258,6 +258,7 @@ enum ieee80211_radiotap_type { #define IEEE80211_RADIOTAP_MCS_HAVE_GI 0x04 #define IEEE80211_RADIOTAP_MCS_HAVE_FMT 0x08 #define IEEE80211_RADIOTAP_MCS_HAVE_FEC 0x10 +#define IEEE80211_RADIOTAP_MCS_HAVE_STBC 0x20 #define IEEE80211_RADIOTAP_MCS_BW_MASK 0x03 #define IEEE80211_RADIOTAP_MCS_BW_20 0 @@ -267,5 +268,6 @@ enum ieee80211_radiotap_type { #define IEEE80211_RADIOTAP_MCS_SGI 0x04 #define IEEE80211_RADIOTAP_MCS_FMT_GF 0x08 #define IEEE80211_RADIOTAP_MCS_FEC_LDPC 0x10 +#define IEEE80211_RADIOTAP_MCS_STBC 0x20 #endif /* IEEE80211_RADIOTAP_H */ diff --git a/epan/dissectors/packet-radiotap.c b/epan/dissectors/packet-radiotap.c index 8454d6dc6c..2a6fcd5ba2 100644 --- a/epan/dissectors/packet-radiotap.c +++ b/epan/dissectors/packet-radiotap.c @@ -546,11 +546,13 @@ static int hf_radiotap_mcs_have_index = -1; static int hf_radiotap_mcs_have_gi = -1; static int hf_radiotap_mcs_have_format = -1; static int hf_radiotap_mcs_have_fec = -1; +static int hf_radiotap_mcs_have_stbc = -1; static int hf_radiotap_mcs_bw = -1; static int hf_radiotap_mcs_index = -1; static int hf_radiotap_mcs_gi = -1; static int hf_radiotap_mcs_format = -1; static int hf_radiotap_mcs_fec = -1; +static int hf_radiotap_mcs_stbc = -1; /* "Present" flags */ static int hf_radiotap_present_tsft = -1; @@ -1226,6 +1228,10 @@ void proto_register_radiotap(void) {"FEC", "radiotap.mcs.have_fec", FT_BOOLEAN, 8, NULL, IEEE80211_RADIOTAP_MCS_HAVE_FEC, "Forward error correction information present", HFILL}}, + {&hf_radiotap_mcs_have_stbc, + {"STBC", "radiotap.mcs.have_stbc", + FT_BOOLEAN, 8, NULL, IEEE80211_RADIOTAP_MCS_HAVE_STBC, + "Space Time Block Coding information present", HFILL}}, {&hf_radiotap_mcs_have_index, {"MCS index", "radiotap.mcs.have_index", FT_BOOLEAN, 8, NULL, IEEE80211_RADIOTAP_MCS_HAVE_MCS, @@ -1246,6 +1252,11 @@ void proto_register_radiotap(void) {"FEC", "radiotap.mcs.fec", FT_UINT8, BASE_DEC, VALS(mcs_fec), IEEE80211_RADIOTAP_MCS_FEC_LDPC, "forward error correction", HFILL}}, + {&hf_radiotap_mcs_stbc, + {"STBC", "radiotap.mcs.stbc", + FT_BOOLEAN, 8, TFS(&tfs_on_off), IEEE80211_RADIOTAP_MCS_STBC, + "Space Time Block Code", HFILL}}, + {&hf_radiotap_mcs_index, {"MCS index", "radiotap.mcs.index", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}}, @@ -1964,6 +1975,8 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) tvb, offset, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(mcs_known_tree, hf_radiotap_mcs_have_fec, tvb, offset, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(mcs_known_tree, hf_radiotap_mcs_have_stbc, + tvb, offset, 1, ENC_LITTLE_ENDIAN); } if (mcs_known & IEEE80211_RADIOTAP_MCS_HAVE_BW) { bandwidth = ((mcs_flags & IEEE80211_RADIOTAP_MCS_BW_MASK) == IEEE80211_RADIOTAP_MCS_BW_40) ? @@ -1995,6 +2008,11 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree) proto_tree_add_uint(mcs_tree, hf_radiotap_mcs_fec, tvb, offset + 1, 1, mcs_flags); } + if (mcs_known & IEEE80211_RADIOTAP_MCS_HAVE_STBC) { + if (mcs_tree) + proto_tree_add_boolean(mcs_tree, hf_radiotap_mcs_stbc, + tvb, offset + 1, 1, mcs_flags); + } if (mcs_known & IEEE80211_RADIOTAP_MCS_HAVE_MCS) { if (mcs_tree) proto_tree_add_uint(mcs_tree, hf_radiotap_mcs_index, |