diff options
author | Michael Mann <mmann78@netscape.net> | 2013-09-28 00:45:44 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2013-09-28 00:45:44 +0000 |
commit | e5379de1261b0f36a7a7900ba0137a9aae0cd9b6 (patch) | |
tree | 104390344fa343c0c1babcf3124e1e0af22626d1 /plugins/wimax/wimax_pdu_decoder.c | |
parent | 21bcd56a6952f6ec06d1911c9d0c2034f9e2c907 (diff) |
1. Remove PITEM_FINFO from add_tlv_subtree and add_protocol_subtree (as well as some other minor cleanup) and adjust the calling functions accordingly.
2. Converted several add_protocol_subtree calls to add_tlv_subtree to get true filterability. Many of the add_protocol_subtree are effectively being (ab)used as proto_tree_add_text with different highlighting.
3. Convert tvb_new_subset into tvb_new_subset_length.
Still looks like some of the remaining "protocols" need more specific filters, and should just be regular FT_BYTES fields.
svn path=/trunk/; revision=52235
Diffstat (limited to 'plugins/wimax/wimax_pdu_decoder.c')
-rw-r--r-- | plugins/wimax/wimax_pdu_decoder.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/wimax/wimax_pdu_decoder.c b/plugins/wimax/wimax_pdu_decoder.c index 81612a9762..78c3fbc361 100644 --- a/plugins/wimax/wimax_pdu_decoder.c +++ b/plugins/wimax/wimax_pdu_decoder.c @@ -105,7 +105,7 @@ static void dissect_wimax_pdu_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_t /* display message */ pdu_item = proto_tree_add_protocol_format(tree, proto_wimax_pdu_decoder, tvb, offset, length, "Padding (%u bytes)", length); /* add subtree */ - pdu_tree = proto_item_add_subtree(pdu_item, ett_wimax_pdu_decoder); + pdu_tree = proto_item_add_subtree(pdu_item, ett_wimax_pdu_decoder); /* display the padding in Hex */ proto_tree_add_item(pdu_tree, hf_wimax_value_bytes, tvb, offset, length, ENC_NA); break; @@ -118,7 +118,7 @@ static void dissect_wimax_pdu_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_t { length = 3; /* At least 3 bytes. This prevents endless loop */ } - call_dissector(wimax_harq_map_handle, tvb_new_subset(tvb,offset,length,length), pinfo, tree); + call_dissector(wimax_harq_map_handle, tvb_new_subset_length(tvb,offset,length), pinfo, tree); offset += length; continue; } @@ -162,7 +162,7 @@ static void dissect_wimax_pdu_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_t /* display message */ pdu_item = proto_tree_add_protocol_format(tree, proto_wimax_pdu_decoder, tvb, offset, WIMAX_MAC_HEADER_SIZE, "MAC Header CRC error %X (in header) and %X (calculated)", mac_hcs, mac_hcs_calculated); /* add subtree */ - pdu_tree = proto_item_add_subtree(pdu_item, ett_wimax_pdu_decoder); + pdu_tree = proto_item_add_subtree(pdu_item, ett_wimax_pdu_decoder); /* display the bad MAC Header in Hex */ proto_tree_add_item(pdu_tree, hf_wimax_value_bytes, tvb, offset, length, ENC_NA); break; @@ -183,15 +183,15 @@ static void dissect_wimax_pdu_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_t length = WIMAX_MAC_HEADER_SIZE; } /* display PDU frame info */ - /* + /* pdu_item = proto_tree_add_protocol_format(tree, proto_wimax_pdu_decoder, tvb, offset, length, "PDU Frame (%u bytes)", length); - */ + */ pdu_item = proto_tree_add_protocol_format(tree, proto_wimax_pdu_decoder, tvb, offset, length, "PDU (%u bytes)", length); /* add PDU subtree */ pdu_tree = proto_item_add_subtree(pdu_item, ett_wimax_pdu_decoder); if (length == 0) { offset += 6; /* Add header size. */ - /* Must skip the code below or tvb_new_subset() + /* Must skip the code below or tvb_new_subset_length() * keeps allocating memory until it runs out. */ continue; } |