diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2017-08-29 15:34:31 +0100 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2017-12-14 22:12:38 +0000 |
commit | cebb8ea20ec2d4c1c1c000304c6cc6e7e9ccb8ad (patch) | |
tree | 7f1dfc10f5d802be657a6dcd6d3194b6e723bb9e /epan/epan.h | |
parent | 629596ebefa34a2677c341ab899e51cecbe254f0 (diff) |
Add new plugin type for libwireshark
Allow epan itself to be extended by plugins. Adds the following new plugin
interfaces:
void plugin_epan_init()
void plugin_epan_dissect_init(epan_dissect_t *)
void plugin_epan_dissect_cleanup(epan_dissect_t *)
void plugin_epan_cleanup()
void plugin_epan_register_all_protocols(register_cb, gointer) [OPTIONAL]
void plugin_epan_register_all_handoffs(register_cb, gointer) [OPTIONAL]
Any one of these can be an empty function but the first four must be
present.
The motivation for the change is a better way to implement a language binding
other than registering a fake protocol and stuffing everything into a single
dissector call (and maybe require an extra packet_info field) but I expect
there would be other interesting use cases.
Change-Id: I215d50750ac7561fe25fdcdcfbc6a3f351984785
Reviewed-on: https://code.wireshark.org/review/24813
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'epan/epan.h')
-rw-r--r-- | epan/epan.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/epan/epan.h b/epan/epan.h index 8dc87451f9..a0fca17352 100644 --- a/epan/epan.h +++ b/epan/epan.h @@ -128,6 +128,18 @@ e_prefs *epan_load_settings(void); WS_DLL_PUBLIC void epan_cleanup(void); +#ifdef HAVE_PLUGINS +typedef struct { + void (*init)(void); + void (*dissect_init)(epan_dissect_t *); + void (*dissect_cleanup)(epan_dissect_t *); + void (*cleanup)(void); + void (*register_all_protocols)(register_cb, gpointer); + void (*register_all_handoffs)(register_cb, gpointer); +} epan_plugin; + +WS_DLL_PUBLIC void epan_register_plugin(const epan_plugin *plugin); +#endif /** * Initialize the table of conversations. Conversations are identified by * their endpoints; they are used for protocols such as IP, TCP, and UDP, |