diff --git a/epan/packet.c b/epan/packet.c index 3275f8ed0c..96a6e5bed8 100644 --- a/epan/packet.c +++ b/epan/packet.c @@ -3296,6 +3296,12 @@ create_dissector_handle_with_name_and_description(dissector_t dissector, return new_dissector_handle(DISSECTOR_TYPE_SIMPLE, dissector, proto, name, description, NULL); } +dissector_handle_t +create_dissector_handle_with_data(dissector_cb_t dissector, const int proto, void* cb_data) +{ + return new_dissector_handle(DISSECTOR_TYPE_CALLBACK, dissector, proto, NULL, NULL, cb_data); +} + /* Destroy an anonymous handle for a dissector. */ static void destroy_dissector_handle(dissector_handle_t handle) diff --git a/epan/packet.h b/epan/packet.h index 63955ea340..e3a1a25065 100644 --- a/epan/packet.h +++ b/epan/packet.h @@ -598,6 +598,8 @@ WS_DLL_PUBLIC dissector_handle_t create_dissector_handle_with_name(dissector_t d const int proto, const char* name); WS_DLL_PUBLIC dissector_handle_t create_dissector_handle_with_name_and_description(dissector_t dissector, const int proto, const char* name, const char* description); +WS_DLL_PUBLIC dissector_handle_t create_dissector_handle_with_data(dissector_cb_t dissector, + const int proto, void* cb_data); /** Call a dissector through a handle and if no dissector was found * pass it over to the "data" dissector instead.