Beispiel #1
0
void
epan_dissect_cleanup(epan_dissect_t* edt)
{
	g_assert(edt);

	g_slist_free(edt->pi.proto_data);
	g_slist_free(edt->pi.dependent_frames);

	/* Free the data sources list. */
	free_data_sources(&edt->pi);

	if (edt->tvb) {
		/* Free all tvb's chained from this tvb */
		tvb_free_chain(edt->tvb);
	}

	if (edt->tree) {
		proto_tree_free(edt->tree);
	}

	if (pinfo_pool_cache == NULL) {
		wmem_free_all(edt->pi.pool);
		pinfo_pool_cache = edt->pi.pool;
	}
	else {
		wmem_destroy_allocator(edt->pi.pool);
	}
}
Beispiel #2
0
void
epan_dissect_reset(epan_dissect_t *edt)
{
	/* We have to preserve the pool pointer across the memzeroing */
	wmem_allocator_t *tmp;

	g_assert(edt);

	g_slist_free(edt->pi.proto_data);
	g_slist_free(edt->pi.dependent_frames);

	/* Free the data sources list. */
	free_data_sources(&edt->pi);

	if (edt->tvb) {
		/* Free all tvb's chained from this tvb */
		tvb_free_chain(edt->tvb);
		edt->tvb = NULL;
	}

	if (edt->tree)
		proto_tree_reset(edt->tree);

	tmp = edt->pi.pool;
	wmem_free_all(tmp);

	memset(&edt->pi, 0, sizeof(edt->pi));
	edt->pi.pool = tmp;
}
Beispiel #3
0
void
epan_dissect_reset(epan_dissect_t *edt)
{
	/* epan_dissect_cleanup(edt) without freeing tree */
	g_slist_free(edt->pi.dependent_frames);
	free_data_sources(&edt->pi);
	tvb_free_chain(edt->tvb);

	/* epan_dissect_init(edt, create_proto, visible_proto) */
	edt->pi.dependent_frames = NULL;
	if (edt->tree)
		proto_tree_reset(edt->tree);
}
/* APB: from wireshark-1.4.0/epan/epan.c, backported for wireshark pre-1.4.0 support */
void
epan_dissect_cleanup(epan_dissect_t* edt)
{
	g_assert(edt);

	/* Free the data sources list. */
	free_data_sources(&edt->pi);

	/* Free all tvb's created from this tvb, unless dissector
	 * wanted to store the pointer (in which case, the dissector
	 * would have incremented the usage count on that tvbuff_t*) */
	tvb_free_chain(edt->tvb);

	if (edt->tree) {
		proto_tree_free(edt->tree);
	}
}
Beispiel #5
0
void
epan_dissect_cleanup(epan_dissect_t* edt)
{
	g_assert(edt);

	g_slist_free(edt->pi.dependent_frames);

	/* Free the data sources list. */
	free_data_sources(&edt->pi);

	/* Free all tvb's chained from this tvb */
	tvb_free_chain(edt->tvb);

	if (edt->tree) {
		proto_tree_free(edt->tree);
	}
}