Witness: move packet-dcerpc-witness-cnf.c to witness.cnf
[metze/wireshark/wip.git] / proto_hier_stats.c
index 50c8bd54e03d60fb1e98523011059034e671f4f5..d1ac0232b6872e4c2aa806dbd12fa80a75d47e12 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "globals.h"
 #include "proto_hier_stats.h"
+#include "frame_tvbuff.h"
 #include "ui/progress_dlg.h"
 #include <epan/epan_dissect.h>
 #include <wtap.h>
@@ -140,19 +141,20 @@ static gboolean
 process_frame(frame_data *frame, column_info *cinfo, ph_stats_t* ps)
 {
        epan_dissect_t                  edt;
-       union wtap_pseudo_header        phdr;
-       guint8                          pd[WTAP_MAX_PACKET_SIZE];
+       struct wtap_pkthdr              phdr;
+       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);
+       epan_dissect_init(&edt, cfile.epan, 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, frame_tvbuff_new_buffer(frame, &buf), frame, cinfo);
 
        /* Get stats from this protocol tree */
        process_tree(edt.tree, ps, frame->pkt_len);
@@ -168,6 +170,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 */
 }