aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-pcli.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2017-07-09 13:47:59 -0400
committerMichael Mann <mmann78@netscape.net>2017-09-16 11:12:29 +0000
commit7d65b573f2734017be416f31852c4ede42bd987b (patch)
tree5fc5e6ebe6c44a5060292541f9664f0244a5e0e4 /epan/dissectors/packet-pcli.c
parentd992e85fe8e9192cb730abf8796336d3b6d6fd50 (diff)
Have register_decode_as_next_proto create dissector table.
For protocols that have don't have a unique identifier for their payload, have register_decode_as_next_proto be a one stop shop to create Decode As functionality and a dissector table of type FT_NONE. Change-Id: Ic1f2e9ed0aee0554a4eb8f232630b99c0604dfc0 Reviewed-on: https://code.wireshark.org/review/22575 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-pcli.c')
-rw-r--r--epan/dissectors/packet-pcli.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/epan/dissectors/packet-pcli.c b/epan/dissectors/packet-pcli.c
index 3e35dcd1ea..5aa3ccdcf9 100644
--- a/epan/dissectors/packet-pcli.c
+++ b/epan/dissectors/packet-pcli.c
@@ -135,11 +135,7 @@ dissect_pcli_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int of
next_tvb = tvb_new_subset_remaining(tvb, offset);
- /*
- * Implement "Decode As", as PCLI doesn't
- * have a unique identifier to determine subdissector
- */
- if (!dissector_try_uint(pcli_subdissector_table, 0, next_tvb, pinfo, tree)) {
+ if (!dissector_try_payload(pcli_subdissector_table, next_tvb, pinfo, tree)) {
call_data_dissector(next_tvb, pinfo, tree);
}
}
@@ -249,11 +245,8 @@ proto_register_pcli(void)
"Whether the PCLI summary line should be shown in the protocol tree",
&pcli_summary_in_tree);
- pcli_subdissector_table = register_dissector_table(
- "pcli.payload", "PCLI payload dissector",
- proto_pcli, FT_UINT32, BASE_DEC);
-
- register_decode_as_next_proto("pcli", "PCLI payload", "pcli.payload", (build_label_func*)&pcli_prompt);
+ pcli_subdissector_table = register_decode_as_next_proto(proto_pcli, "PCLI payload", "pcli.payload",
+ "PCLI payload dissector", (build_label_func*)&pcli_prompt);
}
/* The registration hand-off routing */