diff options
author | Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> | 2009-08-13 19:42:46 +0000 |
---|---|---|
committer | Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> | 2009-08-13 19:42:46 +0000 |
commit | 80a6d3fbcf1d8ee469fbdb6c2d6423f942cbe712 (patch) | |
tree | 41a0430751c01d746062340b6b29c96147592b9f /proto_hier_stats.c | |
parent | 97fda7386c87b840410a1804feee134ab0572276 (diff) |
Introduce epan_dissect_init()/epan_dissect_cleanup(). These are used to initialise/cleanup stack allocated 'edt' structures. This should speed up dissection since we avoid some malloc traffic.
svn path=/trunk/; revision=29404
Diffstat (limited to 'proto_hier_stats.c')
-rw-r--r-- | proto_hier_stats.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/proto_hier_stats.c b/proto_hier_stats.c index 8e6b58acff..edbad8c265 100644 --- a/proto_hier_stats.c +++ b/proto_hier_stats.c @@ -138,7 +138,7 @@ process_tree(proto_tree *protocol_tree, ph_stats_t* ps, guint pkt_len) static gboolean process_frame(frame_data *frame, column_info *cinfo, ph_stats_t* ps) { - epan_dissect_t *edt; + epan_dissect_t edt; union wtap_pseudo_header phdr; guint8 pd[WTAP_MAX_PACKET_SIZE]; int err; @@ -154,13 +154,13 @@ process_frame(frame_data *frame, column_info *cinfo, ph_stats_t* ps) } /* Dissect the frame tree not visible */ - edt = epan_dissect_new(TRUE, FALSE); + epan_dissect_init(&edt, TRUE, FALSE); /* Don't fake protocols. We need them for the protocol hierarchy */ - epan_dissect_fake_protocols(edt, FALSE); - epan_dissect_run(edt, &phdr, pd, frame, cinfo); + epan_dissect_fake_protocols(&edt, FALSE); + epan_dissect_run(&edt, &phdr, pd, frame, cinfo); /* Get stats from this protocol tree */ - process_tree(edt->tree, ps, frame->pkt_len); + process_tree(edt.tree, ps, frame->pkt_len); /* Update times */ cur_time = nstime_to_sec(&frame->abs_ts); @@ -172,7 +172,7 @@ process_frame(frame_data *frame, column_info *cinfo, ph_stats_t* ps) } /* Free our memory. */ - epan_dissect_free(edt); + epan_dissect_cleanup(&edt); return TRUE; /* success */ } |