sq FSCTL_PIPE_WAIT
[metze/wireshark/wip.git] / proto_hier_stats.c
index e01b3893aa5ce84e277aec6c09890eb2c620c93c..d1ac0232b6872e4c2aa806dbd12fa80a75d47e12 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "config.h"
 
 #include <stdio.h>
 
 #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>
@@ -142,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);
@@ -170,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 */
 }