aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/wimax/wimax_pdu_decoder.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/wimax_pdu_decoder.c
parent019e64f58d78f88846021cd15ae5af2bab853442 (diff)
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/wimax_pdu_decoder.c')
-rw-r--r--plugins/wimax/wimax_pdu_decoder.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/plugins/wimax/wimax_pdu_decoder.c b/plugins/wimax/wimax_pdu_decoder.c
index 1ac76c7b2a..81612a9762 100644
--- a/plugins/wimax/wimax_pdu_decoder.c
+++ b/plugins/wimax/wimax_pdu_decoder.c
@@ -36,11 +36,12 @@
extern gint proto_wimax;
+static dissector_handle_t mac_generic_decoder_handle = NULL;
+static dissector_handle_t mac_header_type1_handle = NULL;
+static dissector_handle_t mac_header_type2_handle = NULL;
+static dissector_handle_t wimax_harq_map_handle = NULL;
+
/* MAC Header dissector prototypes */
-extern void dissect_mac_header_generic_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
-extern void dissect_mac_header_type_1_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
-extern void dissect_mac_header_type_2_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
-extern void dissector_wimax_harq_map_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
extern gboolean is_down_link(packet_info *pinfo);
extern gint wimax_decode_dlmap_reduced_aas(tvbuff_t *tvb, packet_info *pinfo, proto_tree *base_tree);
extern gint wimax_decode_dlmapc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *pdu_tree);
@@ -117,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 */
}
- dissector_wimax_harq_map_decoder(tvb_new_subset(tvb,offset,length,length), pinfo, tree);
+ call_dissector(wimax_harq_map_handle, tvb_new_subset(tvb,offset,length,length), pinfo, tree);
offset += length;
continue;
}
@@ -201,17 +202,17 @@ static void dissect_wimax_pdu_decoder(tvbuff_t *tvb, packet_info *pinfo, proto_t
if(mac_ec)
{ /* MAC Signaling Header Type II Header */
proto_item_append_text(pdu_item, " - Mac Type II Header: ");
- dissect_mac_header_type_2_decoder(tvb_new_subset(tvb,offset,length,length), pinfo, pdu_tree);
+ call_dissector(mac_header_type2_handle, tvb_new_subset_length(tvb,offset,length), pinfo, pdu_tree);
}
else
{ /* MAC Signaling Header Type I Header */
proto_item_append_text(pdu_item, " - Mac Type I Header: ");
- dissect_mac_header_type_1_decoder(tvb_new_subset(tvb,offset,length,length), pinfo, pdu_tree);
+ call_dissector(mac_header_type1_handle, tvb_new_subset_length(tvb,offset,length), pinfo, pdu_tree);
}
}
else /* Generic MAC Header with payload */
{
- dissect_mac_header_generic_decoder(tvb_new_subset(tvb,offset,length,length), pinfo, pdu_tree);
+ call_dissector(mac_generic_decoder_handle, tvb_new_subset_length(tvb,offset,length), pinfo, pdu_tree);
}
offset += length;
}
@@ -245,3 +246,12 @@ void proto_register_wimax_pdu(void)
proto_register_field_array(proto_wimax_pdu_decoder, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}
+
+void
+proto_reg_handoff_wimax_pdu(void)
+{
+ mac_generic_decoder_handle = find_dissector("mac_header_generic_handler");
+ mac_header_type1_handle = find_dissector("mac_header_type_1_handler");
+ mac_header_type2_handle = find_dissector("mac_header_type_2_handler");
+ wimax_harq_map_handle = find_dissector("wimax_harq_map_handler");
+}