From cc152014362fa584cfff97cc99afa5822b99af74 Mon Sep 17 00:00:00 2001 From: Martin Kaiser Date: Sun, 14 Jul 2019 15:15:43 +0200 Subject: helper function to get a payload dissector table's current handle Add a simple helper function to get the dissector handle that's currently selected in a given payload dissector table. We have similar functions already for string and uint dissector tables. Change-Id: Ia1092fe2b8d038bae2b26db99fd08cd9d6979fcd Reviewed-on: https://code.wireshark.org/review/33933 Petri-Dish: Martin Kaiser Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu Reviewed-by: Martin Kaiser --- epan/packet.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'epan/packet.c') diff --git a/epan/packet.c b/epan/packet.c index ed224f6cc3..0762bc57b2 100644 --- a/epan/packet.c +++ b/epan/packet.c @@ -1965,6 +1965,15 @@ void dissector_reset_payload(const char *name) dissector_reset_uint(name, 0); } +/* Given a payload dissector table (type FT_NONE), return the handle of + the dissector that is currently active, i.e. that was selected via + Decode As. */ +dissector_handle_t +dissector_get_payload_handle(dissector_table_t const dissector_table) +{ + return dissector_get_uint_handle(dissector_table, 0); +} + dissector_handle_t dtbl_entry_get_handle (dtbl_entry_t *dtbl_entry) { -- cgit v1.2.3