aboutsummaryrefslogtreecommitdiffstats
path: root/proto_hier_stats.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-06-16 00:20:00 +0000
committerGuy Harris <guy@alum.mit.edu>2013-06-16 00:20:00 +0000
commit8c9edf12800bc6d68894dc457e7ebaf994429da8 (patch)
treeec6efefbd4e7f8227a7b96661f721ff4ba2986c3 /proto_hier_stats.c
parent3846abe34d6861c6ee0bba61fcd5baa4d213885c (diff)
Have the seek-read routines take a Buffer rather than a guint8 pointer
as the "where to put the packet data" argument. This lets more of the libwiretap code be common between the read and seek-read code paths, and also allows for more flexibility in the "fill in the data" path - we can expand the buffer as needed in both cases. svn path=/trunk/; revision=49949
Diffstat (limited to 'proto_hier_stats.c')
-rw-r--r--proto_hier_stats.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/proto_hier_stats.c b/proto_hier_stats.c
index b950623937..95b99aeac4 100644
--- a/proto_hier_stats.c
+++ b/proto_hier_stats.c
@@ -141,18 +141,19 @@ process_frame(frame_data *frame, column_info *cinfo, ph_stats_t* ps)
{
epan_dissect_t edt;
struct wtap_pkthdr phdr;
- guint8 pd[WTAP_MAX_PACKET_SIZE];
+ Buffer buf;
double cur_time;
/* Load the frame from the capture file */
- if (!cf_read_frame_r(&cfile, frame, &phdr, pd))
+ buffer_init(&buf, 1500);
+ if (!cf_read_frame_r(&cfile, frame, &phdr, &buf))
return FALSE; /* failure */
/* Dissect the frame tree not visible */
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_run(&edt, &phdr, buffer_start_ptr(&buf), frame, cinfo);
/* Get stats from this protocol tree */
process_tree(edt.tree, ps, frame->pkt_len);
@@ -168,6 +169,7 @@ process_frame(frame_data *frame, column_info *cinfo, ph_stats_t* ps)
/* Free our memory. */
epan_dissect_cleanup(&edt);
+ buffer_free(&buf);
return TRUE; /* success */
}