epan: Add a post_init() plugin routine
Epan plugins init runs before proto_init() to setup for that but there is also a need to have a routine that runs at the end of epan_init(), which can do pretty much anything using epan, like runnning tests.
This commit is contained in:
parent
06871d27df
commit
caacdae870
|
@ -177,6 +177,12 @@ epan_plugin_init(gpointer data, gpointer user_data _U_)
|
|||
((epan_plugin *)data)->init();
|
||||
}
|
||||
|
||||
static void
|
||||
epan_plugin_post_init(gpointer data, gpointer user_data _U_)
|
||||
{
|
||||
((epan_plugin *)data)->post_init();
|
||||
}
|
||||
|
||||
static void
|
||||
epan_plugin_dissect_init(gpointer data, gpointer user_data)
|
||||
{
|
||||
|
@ -315,6 +321,7 @@ epan_init(register_cb cb, gpointer client_data, gboolean load_plugins)
|
|||
#ifdef HAVE_LUA
|
||||
wslua_init(cb, client_data);
|
||||
#endif
|
||||
g_slist_foreach(epan_plugins, epan_plugin_post_init, NULL);
|
||||
}
|
||||
CATCH(DissectorError) {
|
||||
/*
|
||||
|
|
|
@ -117,7 +117,8 @@ WS_DLL_PUBLIC
|
|||
void epan_cleanup(void);
|
||||
|
||||
typedef struct {
|
||||
void (*init)(void);
|
||||
void (*init)(void); /* Called before proto_init() */
|
||||
void (*post_init)(void); /* Called at the end of epan_init() */
|
||||
void (*dissect_init)(epan_dissect_t *);
|
||||
void (*dissect_cleanup)(epan_dissect_t *);
|
||||
void (*cleanup)(void);
|
||||
|
|
Loading…
Reference in New Issue