diff options
author | Michael Mann <mmann78@netscape.net> | 2016-03-19 20:33:14 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-03-20 17:38:03 +0000 |
commit | 1e60d63c8c6882c8c0bdb00cf6df594e1bb6fccf (patch) | |
tree | 4147c4f2bee3b93c250a49fa8ec337072c80e713 /plugins/irda/packet-irda.c | |
parent | 2b2fc64447e5f778d969e6c850e9196d248cbbe1 (diff) |
Create call_data_dissector() to call data dissector.
This saves many dissectors the need to find the data dissector and store a handle to it.
There were also some that were finding it, but not using it.
For others this was the only reason for their handoff function, so it could be eliminated.
Change-Id: I5d3f951ee1daa3d30c060d21bd12bbc881a8027b
Reviewed-on: https://code.wireshark.org/review/14530
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'plugins/irda/packet-irda.c')
-rw-r--r-- | plugins/irda/packet-irda.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/plugins/irda/packet-irda.c b/plugins/irda/packet-irda.c index 322b739ba0..f9c46d33da 100644 --- a/plugins/irda/packet-irda.c +++ b/plugins/irda/packet-irda.c @@ -139,8 +139,6 @@ void proto_reg_handoff_irda(void); void proto_register_irda(void); -static dissector_handle_t data_handle; - /* Initialize the protocol and registered fields */ static int proto_irlap = -1; static int hf_lap_a = -1; @@ -645,7 +643,7 @@ static void dissect_iap_request(tvbuff_t* tvb, packet_info* pinfo, proto_tree* r /* If any bytes remain, send it to the generic data dissector */ tvb = tvb_new_subset_remaining(tvb, offset); - call_dissector(data_handle, tvb, pinfo, root); + call_data_dissector(tvb, pinfo, root); } @@ -895,7 +893,7 @@ static void dissect_iap_result(tvbuff_t* tvb, packet_info* pinfo, proto_tree* ro /* If any bytes remain, send it to the generic data dissector */ tvb = tvb_new_subset_remaining(tvb, offset); - call_dissector(data_handle, tvb, pinfo, root); + call_data_dissector(tvb, pinfo, root); } @@ -1007,7 +1005,7 @@ static void dissect_appl_proto(tvbuff_t* tvb, packet_info* pinfo, proto_tree* ro call_dissector_with_data(lmp_conv->dissector, tvb, pinfo, root, GUINT_TO_POINTER(pdu_type)); } else - call_dissector(data_handle, tvb, pinfo, root); + call_data_dissector(tvb, pinfo, root); } @@ -1159,7 +1157,7 @@ static void dissect_irlmp(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root, g else { if ((dlsap == LSAP_IAS) || (slsap == LSAP_IAS)) - call_dissector(data_handle, tvb, pinfo, root); + call_data_dissector(tvb, pinfo, root); else switch (opcode) { @@ -1173,7 +1171,7 @@ static void dissect_irlmp(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root, g break; default: - call_dissector(data_handle, tvb, pinfo, root); + call_data_dissector(tvb, pinfo, root); } } } @@ -1828,7 +1826,7 @@ static void dissect_irlap(tvbuff_t* tvb, packet_info* pinfo, proto_tree* root) if (tvb_reported_length_remaining(tvb, offset) > 0) { tvb = tvb_new_subset_remaining(tvb, offset); - call_dissector(data_handle, tvb, pinfo, root); + call_data_dissector(tvb, pinfo, root); } } @@ -2248,7 +2246,6 @@ void proto_reg_handoff_irda(void) irda_handle = find_dissector("irda"); dissector_add_uint("wtap_encap", WTAP_ENCAP_IRDA, irda_handle); dissector_add_uint("sll.ltype", LINUX_SLL_P_IRDA_LAP, irda_handle); - data_handle = find_dissector("data"); } /* |