*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * 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>
GNode *stat_node;
finfo = PNODE_FINFO(ptree_node);
- /* We don't fake protocol nodes we expect them to have a field_info */
- g_assert(finfo && "dissection with faked proto tree?");
+ /* We don't fake protocol nodes we expect them to have a field_info.
+ * Dissection with faked proto tree? */
+ g_assert(finfo);
/* If the field info isn't related to a protocol but to a field,
* don't count them, as they don't belong to any protocol.
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);
/* 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);
/* Free our memory. */
epan_dissect_cleanup(&edt);
+ buffer_free(&buf);
return TRUE; /* success */
}
to get to the next progress bar step). */
if (progbar == NULL)
progbar = delayed_create_progress_dlg(
- "Computing", "protocol hierarchy statistics",
+ cfile.window, "Computing",
+ "protocol hierarchy statistics",
TRUE, &stop_flag, &start_time, progbar_val);
/* Update the progress bar, but do it only N_PROGBAR_UPDATES