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-atalk.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-atalk.c')
-rw-r--r-- | epan/dissectors/packet-atalk.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/epan/dissectors/packet-atalk.c b/epan/dissectors/packet-atalk.c index bd8d87d99a..e6db3c2ad3 100644 --- a/epan/dissectors/packet-atalk.c +++ b/epan/dissectors/packet-atalk.c @@ -365,8 +365,6 @@ static value_string_ext pap_function_vals_ext = VALUE_STRING_EXT_INIT(pap_functi static dissector_table_t ddp_dissector_table; -static dissector_handle_t data_handle; - #define DDP_SHORT_HEADER_SIZE 5 /* @@ -879,7 +877,7 @@ dissect_atp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) } else if (!try_conversation_dissector(&pinfo->src, &pinfo->dst, pinfo->ptype, pinfo->srcport, pinfo->destport, new_tvb,pinfo, tree, &aspinfo)) { - call_dissector(data_handle, new_tvb, pinfo, tree); + call_data_dissector(new_tvb, pinfo, tree); } } @@ -887,7 +885,7 @@ dissect_atp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) else { /* Just show this as a fragment. */ new_tvb = tvb_new_subset_remaining (tvb, ATP_HDRSIZE -1); - call_dissector(data_handle, new_tvb, pinfo, tree); + call_data_dissector(new_tvb, pinfo, tree); } pinfo->fragmented = save_fragmented; return tvb_captured_length(tvb); @@ -958,7 +956,7 @@ dissect_pap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) offset++; PAD(1); /* follow by data */ - call_dissector(data_handle,tvb_new_subset_remaining(tvb, offset), pinfo, tree); + call_data_dissector(tvb_new_subset_remaining(tvb, offset), pinfo, tree); break; case PAPTickle: @@ -1105,7 +1103,7 @@ dissect_asp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) default: proto_item_set_len(asp_tree, 4); offset += 3; - call_dissector(data_handle,tvb_new_subset_remaining(tvb, offset), pinfo, tree); + call_data_dissector(tvb_new_subset_remaining(tvb, offset), pinfo, tree); break; } } @@ -1154,7 +1152,7 @@ dissect_asp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) default: proto_item_set_len(asp_tree, 4); offset += 4; - call_dissector(data_handle,tvb_new_subset_remaining(tvb, offset), pinfo, tree); + call_data_dissector(tvb_new_subset_remaining(tvb, offset), pinfo, tree); break; } } @@ -1478,7 +1476,7 @@ dissect_ddp_short(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat new_tvb = tvb_new_subset_remaining(tvb, DDP_SHORT_HEADER_SIZE); if (!dissector_try_uint(ddp_dissector_table, type, new_tvb, pinfo, tree)) - call_dissector(data_handle,new_tvb, pinfo, tree); + call_data_dissector(new_tvb, pinfo, tree); return tvb_captured_length(tvb); } @@ -1557,7 +1555,7 @@ dissect_ddp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) if (!dissector_try_uint(ddp_dissector_table, ddp.type, new_tvb, pinfo, tree)) { - call_dissector(data_handle,new_tvb, pinfo, tree); + call_data_dissector(new_tvb, pinfo, tree); } return tvb_captured_length(tvb); } @@ -1619,7 +1617,7 @@ dissect_llap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ return tvb_captured_length(tvb); break; } - call_dissector(data_handle,new_tvb, pinfo, tree); + call_data_dissector(new_tvb, pinfo, tree); return tvb_captured_length(tvb); } @@ -2126,7 +2124,6 @@ proto_reg_handoff_atalk(void) afp_handle = find_dissector_add_dependency("afp", proto_asp); afp_server_status_handle = find_dissector_add_dependency("afp_server_status", proto_asp); - data_handle = find_dissector("data"); } /* |