aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-6lowpan.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-03-19 20:33:14 -0400
committerMichael Mann <mmann78@netscape.net>2016-03-20 17:38:03 +0000
commit1e60d63c8c6882c8c0bdb00cf6df594e1bb6fccf (patch)
tree4147c4f2bee3b93c250a49fa8ec337072c80e713 /epan/dissectors/packet-6lowpan.c
parent2b2fc64447e5f778d969e6c850e9196d248cbbe1 (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 'epan/dissectors/packet-6lowpan.c')
-rw-r--r--epan/dissectors/packet-6lowpan.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/epan/dissectors/packet-6lowpan.c b/epan/dissectors/packet-6lowpan.c
index 512c243686..754b61fd8b 100644
--- a/epan/dissectors/packet-6lowpan.c
+++ b/epan/dissectors/packet-6lowpan.c
@@ -296,7 +296,6 @@ static expert_field ei_6lowpan_bad_ext_header_length = EI_INIT;
/* Subdissector handles. */
static dissector_handle_t handle_6lowpan;
-static dissector_handle_t data_handle;
static dissector_handle_t ipv6_handle;
/* Value Strings */
@@ -1963,7 +1962,7 @@ dissect_6lowpan_iphc_nhc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gi
*/
if (!tvb_bytes_exist(tvb, offset, ext_len)) {
/* Call the data dissector for the remainder. */
- call_dissector(data_handle, tvb_new_subset_remaining(tvb, offset), pinfo, nhc_tree);
+ call_data_dissector(tvb_new_subset_remaining(tvb, offset), pinfo, nhc_tree);
/* Copy the remainder, and truncate the real buffer length. */
nhdr->length = tvb_captured_length_remaining(tvb, offset) + ext_hlen;
@@ -1975,10 +1974,10 @@ dissect_6lowpan_iphc_nhc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gi
if (ext_proto == IP_PROTO_FRAGMENT) {
/* Display the extension header using the data dissector. */
- call_dissector(data_handle, tvb_new_subset_length(tvb, offset+1, ext_len-1), pinfo, nhc_tree);
+ call_data_dissector(tvb_new_subset_length(tvb, offset+1, ext_len-1), pinfo, nhc_tree);
} else {
/* Display the extension header using the data dissector. */
- call_dissector(data_handle, tvb_new_subset_length(tvb, offset, ext_len), pinfo, nhc_tree);
+ call_data_dissector(tvb_new_subset_length(tvb, offset, ext_len), pinfo, nhc_tree);
}
/* Copy the extension header into the struct. */
@@ -2445,7 +2444,7 @@ dissect_6lowpan_frag_first(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
/* Reassembly was unsuccessful; show this fragment. This may
just mean that we don't yet have all the fragments, so
we should not just continue dissecting. */
- call_dissector(data_handle, frag_tvb, pinfo, proto_tree_get_root(tree));
+ call_data_dissector(frag_tvb, pinfo, proto_tree_get_root(tree));
return NULL;
}
} /* dissect_6lowpan_frag_first */
@@ -2526,7 +2525,7 @@ dissect_6lowpan_frag_middle(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* If reassembly failed, display the payload fragment using the data dissector. */
else {
new_tvb = tvb_new_subset_remaining(tvb, offset);
- call_dissector(data_handle, new_tvb, pinfo, proto_tree_get_root(tree));
+ call_data_dissector(new_tvb, pinfo, proto_tree_get_root(tree));
return NULL;
}
} /* dissect_6lowpan_frag_middle */
@@ -2563,7 +2562,7 @@ dissect_6lowpan_unknown(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Create a tvbuff subset for the remaining data. */
data_tvb = tvb_new_subset_remaining(tvb, 1);
- call_dissector(data_handle, data_tvb, pinfo, proto_tree_get_root(tree));
+ call_data_dissector(data_tvb, pinfo, proto_tree_get_root(tree));
} /* dissect_6lowpan_unknown */
/*FUNCTION:------------------------------------------------------
@@ -2977,7 +2976,6 @@ prefs_6lowpan_apply(void)
void
proto_reg_handoff_6lowpan(void)
{
- data_handle = find_dissector("data");
ipv6_handle = find_dissector_add_dependency("ipv6", proto_6lowpan);
/* Register the 6LoWPAN dissector with IEEE 802.15.4 */