Exemplo n.º 1
0
/*
 * Callback for each plugin found.
 */
static gboolean
check_for_wtap_plugin(GModule *handle)
{
	gpointer gp;
	wtap_plugin *plugin;

	/*
	 * Do we have a register_wtap_module routine?
	 */
	if (!g_module_symbol(handle, "register_wtap_module", &gp)) {
		/* No, so this isn't a wiretap module plugin. */
		return FALSE;
	}

	/*
	 * Yes - this plugin includes one or more wiretap modules.
	 * Add this one to the list of wiretap module plugins.
	 */
	plugin = (wtap_plugin *)g_malloc(sizeof (wtap_plugin));
DIAG_OFF(pedantic)
	plugin->register_wtap_module = (void (*)(void))gp;
DIAG_ON(pedantic)
	wtap_plugins = g_slist_append(wtap_plugins, plugin);
	return TRUE;
}
Exemplo n.º 2
0
/*
 * Callback for each plugin found.
 */
static gboolean
check_for_tap_plugin(GModule *handle)
{
	gpointer gp;
	void (*register_tap_listener_fn)(void);
	tap_plugin *plugin;

	/*
	 * Do we have a register_tap_listener routine?
	 */
	if (!g_module_symbol(handle, "plugin_register_tap_listener", &gp)) {
		/* No, so this isn't a tap plugin. */
		return FALSE;
	}

	/*
	 * Yes - this plugin includes one or more taps.
	 */
DIAG_OFF(pedantic)
	register_tap_listener_fn = (void (*)(void))gp;
DIAG_ON(pedantic)

	/*
	 * Add this one to the list of tap plugins.
	 */
	plugin = (tap_plugin *)g_malloc(sizeof (tap_plugin));
	plugin->register_tap_listener_fn = register_tap_listener_fn;
	tap_plugins = g_slist_append(tap_plugins, plugin);
	return TRUE;
}
Exemplo n.º 3
0
static void
free_tap_listener(volatile tap_listener_t *tl)
{
	if(!tl)
		return;
	dfilter_free(tl->code);
	g_free(tl->fstring);
DIAG_OFF(cast-qual)
	g_free((gpointer)tl);
DIAG_ON(cast-qual)
}