diff options
author | Dr. Lars Völker <lars.voelker@technica-engineering.de> | 2021-07-15 18:56:16 +0200 |
---|---|---|
committer | Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2021-07-16 08:27:11 +0000 |
commit | 102a9525337c6fa6a02c188d01cb599fee2038bb (patch) | |
tree | f72cd5fa537a28dfa73bdc3ed8b33abc3f38f554 /epan/dissectors/packet-tecmp.c | |
parent | fba16c88f4cf47fb987f8382e325eeecd3b6ae64 (diff) |
CAN: Adding support for more specific tables (2)
This patch changes TECMP, 1722, and caneth to use the new
socketcan_call_subdissectors method.
Diffstat (limited to 'epan/dissectors/packet-tecmp.c')
-rw-r--r-- | epan/dissectors/packet-tecmp.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/epan/dissectors/packet-tecmp.c b/epan/dissectors/packet-tecmp.c index 9c3f6dfd46..06dd607bc4 100644 --- a/epan/dissectors/packet-tecmp.c +++ b/epan/dissectors/packet-tecmp.c @@ -42,10 +42,6 @@ static int proto_vlan; static gboolean heuristic_first = FALSE; -static dissector_table_t can_subdissector_table; -static heur_dissector_list_t can_heur_subdissector_list; -static heur_dtbl_entry_t *can_heur_dtbl_entry; - static dissector_table_t fr_subdissector_table; static heur_dissector_list_t fr_heur_subdissector_list; static heur_dtbl_entry_t *fr_heur_dtbl_entry; @@ -1197,19 +1193,10 @@ dissect_tecmp_log_or_replay_stream(tvbuff_t *tvb, packet_info *pinfo, proto_tree can_info.id |= CAN_ERR_FLAG; } - if (!heuristic_first) { - if (!dissector_try_payload_new(can_subdissector_table, payload_tvb, pinfo, tree, TRUE, &can_info)) { - if (!dissector_try_heuristic(can_heur_subdissector_list, payload_tvb, pinfo, tree, &can_heur_dtbl_entry, &can_info)) { - proto_tree_add_item(tecmp_tree, hf_tecmp_payload_data_payload, payload_tvb, 0, (gint)length2, ENC_NA); - } - } - } else { - if (!dissector_try_heuristic(can_heur_subdissector_list, payload_tvb, pinfo, tree, &can_heur_dtbl_entry, &can_info)) { - if (!dissector_try_payload_new(can_subdissector_table, payload_tvb, pinfo, tree, FALSE, &can_info)) { - proto_tree_add_item(tecmp_tree, hf_tecmp_payload_data_payload, payload_tvb, 0, (gint)length2, ENC_NA); - } - } + if (!socketcan_call_subdissectors(payload_tvb, pinfo, tree, &can_info, heuristic_first)) { + proto_tree_add_item(tecmp_tree, hf_tecmp_payload_data_payload, payload_tvb, 0, (gint)length2, ENC_NA); } + } break; @@ -1805,9 +1792,6 @@ proto_reg_handoff_tecmp(void) { tecmp_handle = create_dissector_handle(dissect_tecmp, proto_tecmp); dissector_add_uint("ethertype", ETHERTYPE_TECMP, tecmp_handle); - can_subdissector_table = find_dissector_table("can.subdissector"); - can_heur_subdissector_list = find_heur_dissector_list("can"); - fr_subdissector_table = find_dissector_table("flexray.subdissector"); fr_heur_subdissector_list = find_heur_dissector_list("flexray"); |