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 /epan/dissectors/packet-null.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 'epan/dissectors/packet-null.c')
-rw-r--r-- | epan/dissectors/packet-null.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/epan/dissectors/packet-null.c b/epan/dissectors/packet-null.c index 277bc20255..e2d3b31579 100644 --- a/epan/dissectors/packet-null.c +++ b/epan/dissectors/packet-null.c @@ -63,7 +63,6 @@ static const value_string family_vals[] = { }; static dissector_handle_t ppp_hdlc_handle; -static dissector_handle_t data_handle; static gboolean capture_null( const guchar *pd, int offset _U_, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_ ) @@ -444,7 +443,7 @@ dissect_null(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ next_tvb = tvb_new_subset_remaining(tvb, 4); if (!dissector_try_uint(ethertype_dissector_table, (guint16) null_header, next_tvb, pinfo, tree)) - call_dissector(data_handle, next_tvb, pinfo, tree); + call_data_dissector(next_tvb, pinfo, tree); } else { /* populate a tree in the second pane with the status of the link layer (ie none) */ @@ -458,7 +457,7 @@ dissect_null(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ if (!dissector_try_uint(null_dissector_table, null_header, next_tvb, pinfo, tree)) { /* No sub-dissector found. Label rest of packet as "Data" */ - call_dissector(data_handle,next_tvb, pinfo, tree); + call_data_dissector(next_tvb, pinfo, tree); } } } @@ -497,7 +496,7 @@ dissect_loop(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ if (!dissector_try_uint(null_dissector_table, loop_family, next_tvb, pinfo, tree)) { /* No sub-dissector found. Label rest of packet as "Data" */ - call_dissector(data_handle,next_tvb, pinfo, tree); + call_data_dissector(next_tvb, pinfo, tree); } return tvb_captured_length(tvb); } @@ -539,7 +538,6 @@ proto_reg_handoff_null(void) * the "I don't know what this is" dissector. */ ppp_hdlc_handle = find_dissector_add_dependency("ppp_hdlc", proto_null); - data_handle = find_dissector("data"); ethertype_dissector_table = find_dissector_table("ethertype"); |