It'd be actually good idea to seperate packet_info data (packet.c) from epan_dissect_t (epan.c),
but this rule is already violated.
Strict seperation could allow for example allow multiple dissection on the same epan_dissect_t
(I think it was idea behind it), but it's not working.
svn path=/trunk/; revision=52705
g_assert(edt);
edt->session = session;
- edt->pi.pool = wmem_allocator_new(WMEM_ALLOCATOR_SIMPLE);
if (create_proto_tree) {
edt->tree = proto_tree_create_root(&edt->pi);
edt->tree = NULL;
}
- edt->pi.dependent_frames = NULL;
+ memset(&edt->pi, 0, sizeof(edt->pi));
+ edt->pi.pool = wmem_allocator_new(WMEM_ALLOCATOR_SIMPLE);
return edt;
}
dissect_packet(epan_dissect_t *edt, struct wtap_pkthdr *phdr,
tvbuff_t *tvb, frame_data *fd, column_info *cinfo)
{
- /* We have to preserve the pool pointer across the memzeroing */
- wmem_allocator_t *tmp = edt->pi.pool;
-
if (cinfo != NULL)
col_init(cinfo, edt->session);
- memset(&edt->pi, 0, sizeof(edt->pi));
edt->pi.epan = edt->session;
- edt->pi.pool = tmp;
+ /* edt->pi.pool created in epan_dissect_init() */
edt->pi.current_proto = "<Missing Protocol Name>";
edt->pi.cinfo = cinfo;
edt->pi.fd = fd;