diff options
author | Martin Kaiser <wireshark@kaiser.cx> | 2019-07-14 15:15:43 +0200 |
---|---|---|
committer | Martin Kaiser <wireshark@kaiser.cx> | 2019-07-22 15:44:08 +0000 |
commit | cc152014362fa584cfff97cc99afa5822b99af74 (patch) | |
tree | aa9b5ba3994287772619bd65f500de6e4b28e76b /epan/packet.c | |
parent | 1d1679f061cbd035cdc68c7d0ceaa4b08f0f7e0e (diff) |
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 <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'epan/packet.c')
-rw-r--r-- | epan/packet.c | 9 |
1 files changed, 9 insertions, 0 deletions
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) { |