summaryrefslogtreecommitdiff
path: root/plugins/wimax/msg_rng_req.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2013-09-24 18:45:39 +0000
committerMichael Mann <mmann78@netscape.net>2013-09-24 18:45:39 +0000
commit1ac3997acb378af43aa4397df807b320ce56b134 (patch)
treea2ad59ae862f5cca90370d7c580535c1a430fcc4 /plugins/wimax/msg_rng_req.c
parent019e64f58d78f88846021cd15ae5af2bab853442 (diff)
downloadwireshark-1ac3997acb378af43aa4397df807b320ce56b134.tar.gz
Wimax dissector improvements:
1. Remove message type field from all MAC Management "sub"dissectors and place it in Mac Management subdissector itself. This may cause backwards-compatibility issues (malformed packets) with third-party subdissectors of the MAC Management dissector, but it didn't make sense to have so many filters for a single enumerated value, especially when the various "protocol" filters covers many of them. 2. Removed some if(tree) checks as column info and calling other dissectors are sometimes executed underneath. Some of this is in preparation for addressing bug 5349. 3. Make all dissector functions (and a few others) static, and use register_dissector() when necessary. 4. Convert generic decoder CRC errors into expert info, rather than have it be a "protocol" filter (it just looks funny that way) In general, these dissectors seem "over-protocolized". I understand the need for all of the dissectors, but I don't know if they all need "protocol" status. svn path=/trunk/; revision=52203
Diffstat (limited to 'plugins/wimax/msg_rng_req.c')
-rw-r--r--plugins/wimax/msg_rng_req.c35
1 files changed, 8 insertions, 27 deletions
diff --git a/plugins/wimax/msg_rng_req.c b/plugins/wimax/msg_rng_req.c
index b460c752cb..6f93bc5fc8 100644
--- a/plugins/wimax/msg_rng_req.c
+++ b/plugins/wimax/msg_rng_req.c
@@ -39,13 +39,10 @@
extern gboolean include_cor2_changes;
-extern gint man_ofdma;
-
static gint proto_mac_mgmt_msg_rng_req_decoder = -1;
static gint ett_mac_mgmt_msg_rng_req_decoder = -1;
/* RNG-REQ fields */
-static gint hf_rng_req_message_type = -1;
static gint hf_rng_req_reserved = -1;
static gint hf_rng_req_dl_burst_profile_diuc = -1;
static gint hf_rng_req_dl_burst_profile_lsb_ccc = -1;
@@ -216,38 +213,29 @@ void dissect_power_saving_class(proto_tree *rng_req_tree, gint tlv_type, tvbuff_
/* Decode RNG-REQ messages. */
-void dissect_mac_mgmt_msg_rng_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static void dissect_mac_mgmt_msg_rng_req_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint offset = 0;
guint tlv_offset;
- guint tvb_len, payload_type;
- proto_item *rng_req_item = NULL;
- proto_tree *rng_req_tree = NULL;
+ guint tvb_len;
+ proto_item *rng_req_item;
+ proto_tree *rng_req_tree;
proto_tree *tlv_tree = NULL;
tlv_info_t tlv_info;
gint tlv_type;
gint tlv_len;
- /* Ensure the right payload type */
- payload_type = tvb_get_guint8(tvb, offset);
- if(payload_type != MAC_MGMT_MSG_RNG_REQ)
- {
- return;
- }
-
- if (tree)
{ /* we are being asked for details */
/* Get the tvb reported length */
tvb_len = tvb_reported_length(tvb);
/* display MAC payload type RNG-REQ */
- rng_req_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_rng_req_decoder, tvb, offset, tvb_len, "MAC Management Message, RNG-REQ (4)");
+ rng_req_item = proto_tree_add_protocol_format(tree, proto_mac_mgmt_msg_rng_req_decoder, tvb, offset, tvb_len, "MAC Management Message, RNG-REQ");
/* add MAC RNG-REQ subtree */
rng_req_tree = proto_item_add_subtree(rng_req_item, ett_mac_mgmt_msg_rng_req_decoder);
/* display the Message Type */
- proto_tree_add_item(rng_req_tree, hf_rng_req_message_type, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(rng_req_tree, hf_rng_req_reserved, tvb, 1, 1, ENC_BIG_ENDIAN);
- offset += 2;
+ proto_tree_add_item(rng_req_tree, hf_rng_req_reserved, tvb, 0, 1, ENC_BIG_ENDIAN);
+ offset += 1;
while(offset < tvb_len)
{
@@ -338,7 +326,7 @@ void dissect_mac_mgmt_msg_rng_req_decoder(tvbuff_t *tvb, packet_info *pinfo, pro
}
break;
case MAC_VERSION_ENCODING:
- offset += wimax_common_tlv_encoding_decoder(tvb_new_subset(tvb, offset, (tvb_len - offset), (tvb_len - offset)), pinfo, rng_req_tree);
+ offset += wimax_common_tlv_encoding_decoder(tvb_new_subset_remaining(tvb, offset), pinfo, rng_req_tree);
continue;
break;
case RNG_REQ_POWER_SAVING_CLASS_PARAMETERS:
@@ -461,13 +449,6 @@ void proto_register_mac_mgmt_msg_rng_req(void)
}
},
{
- &hf_rng_req_message_type,
- {
- "MAC Management Message Type", "wmx.macmgtmsgtype.rng_req",
- FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL
- }
- },
- {
&hf_rng_req_aas_broadcast,
{
"AAS broadcast capability", "wmx.rng_req.aas_broadcast",