* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include "config.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
static guint32 cum_bytes;
static nstime_t first_ts;
-static nstime_t prev_dis_ts;
-static nstime_t prev_cap_ts;
+static frame_data *prev_dis;
+static frame_data *prev_cap;
static gulong computed_elapsed;
"command-line-specified" format. */
for (i = 0; i < cf->cinfo.num_cols; i++) {
if (col_has_time_fmt(&cf->cinfo, i)) {
- new_packet_list_resize_column(i);
+ packet_list_resize_column(i);
}
}
}
nstime_set_zero(&cf->elapsed_time);
nstime_set_unset(&first_ts);
- nstime_set_unset(&prev_dis_ts);
- nstime_set_unset(&prev_cap_ts);
+ prev_dis = NULL;
+ prev_cap = NULL;
cum_bytes = 0;
/* Adjust timestamp precision if auto is selected, col width will be adjusted */
cf_timestamp_auto_precision(cf);
/* XXX needed ? */
- new_packet_list_queue_draw();
+ packet_list_queue_draw();
fileset_file_opened(fname);
if (cf->cd_t == WTAP_FILE_BER) {
cf->linktypes = NULL;
/* Clear the packet list. */
- new_packet_list_freeze();
- new_packet_list_clear();
- new_packet_list_thaw();
+ packet_list_freeze();
+ packet_list_clear();
+ packet_list_thaw();
cf->f_datalen = 0;
nstime_set_zero(&cf->elapsed_time);
progbar_val = 0.0f;
/* The packet list window will be empty until the file is completly loaded */
- new_packet_list_freeze();
+ packet_list_freeze();
stop_flag = FALSE;
g_get_current_time(&start_time);
cf->current_frame = frame_data_sequence_find(cf->frames, cf->first_displayed);
cf->current_row = 0;
- new_packet_list_thaw();
+ packet_list_thaw();
if (reloading)
cf_callback_invoke(cf_cb_file_reload_finished, cf);
else
/* If we have any displayed packets to select, select the first of those
packets by making the first row the selected row. */
if (cf->first_displayed != 0) {
- new_packet_list_select_first_row();
+ packet_list_select_first_row();
}
if (stop_flag) {
*err = 0;
- new_packet_list_check_end();
+ packet_list_check_end();
/* Don't freeze/thaw the list when doing live capture */
- /*new_packet_list_freeze();*/
+ /*packet_list_freeze();*/
/*g_log(NULL, G_LOG_LEVEL_MESSAGE, "cf_continue_tail: %u new: %u", cf->count, to_read);*/
cf->count, cf->state, *err);*/
/* Don't freeze/thaw the list when doing live capture */
- /*new_packet_list_thaw();*/
+ /*packet_list_thaw();*/
/* With the new packet list the first packet
* isn't automatically selected.
*/
if (!cf->current_frame)
- new_packet_list_select_first_row();
+ packet_list_select_first_row();
/* moving to the end of the packet list - if the user requested so and
we have some new packets. */
if (newly_displayed_packets && auto_scroll_live && cf->count != 0)
- new_packet_list_moveto_end();
+ packet_list_moveto_end();
if (cf->state == FILE_READ_ABORTED) {
/* Well, the user decided to exit Wireshark. Return CF_READ_ABORTED
} else if (*err != 0) {
/* We got an error reading the capture file.
XXX - pop up a dialog box instead? */
- g_warning("Error \"%s\" while reading: \"%s\"\n",
- wtap_strerror(*err), cf->filename);
+ g_warning("Error \"%s\" while reading: \"%s\" (\"%s\")",
+ wtap_strerror(*err), err_info, cf->filename);
+ g_free(err_info);
return CF_READ_ERROR;
} else
return CF_READ_ERROR;
}
- new_packet_list_check_end();
+ packet_list_check_end();
/* Don't freeze/thaw the list when doing live capture */
- /*new_packet_list_freeze();*/
+ /*packet_list_freeze();*/
while ((wtap_read(cf->wth, err, &err_info, &data_offset))) {
if (cf->state == FILE_READ_ABORTED) {
}
/* Don't freeze/thaw the list when doing live capture */
- /*new_packet_list_thaw();*/
+ /*packet_list_thaw();*/
if (cf->state == FILE_READ_ABORTED) {
/* Well, the user decided to abort the read. We're only called
}
if (auto_scroll_live && cf->count != 0)
- new_packet_list_moveto_end();
+ packet_list_moveto_end();
/* We're done reading sequentially through the file. */
cf->state = FILE_READ_DONE;
if (*err != 0) {
/* We got an error reading the capture file.
XXX - pop up a dialog box? */
+
+ g_warning("Error \"%s\" while reading: \"%s\" (\"%s\")",
+ wtap_strerror(*err), err_info, cf->filename);
+ g_free(err_info);
return CF_READ_ERROR;
} else {
return CF_READ_OK;
cinfo = (tap_flags & TL_REQUIRES_COLUMNS) ? &cf->cinfo : NULL;
frame_data_set_before_dissect(fdata, &cf->elapsed_time,
- &first_ts, &prev_dis_ts, &prev_cap_ts);
+ &first_ts, prev_dis, prev_cap);
+ prev_cap = fdata;
/* If either
+ we have a display filter and are re-applying it;
if (add_to_packet_list) {
/* We fill the needed columns from new_packet_list */
- row = new_packet_list_append(cinfo, fdata, &edt.pi);
+ row = packet_list_append(cinfo, fdata, &edt.pi);
}
if (fdata->flags.passed_dfilter || fdata->flags.ref_time)
{
- frame_data_set_after_dissect(fdata, &cum_bytes, &prev_dis_ts);
+ frame_data_set_after_dissect(fdata, &cum_bytes);
+ prev_dis = fdata;
/* If we haven't yet seen the first frame, this is it.
/* Freeze the packet list while we redo it, so we don't get any
screen updates while it happens. */
- new_packet_list_freeze();
+ packet_list_freeze();
if (redissect) {
/* We need to re-initialize all the state information that protocols
/* We need to redissect the packets so we have to discard our old
* packet list store. */
- new_packet_list_clear();
+ packet_list_clear();
add_to_packet_list = TRUE;
}
to check whether it should be displayed and, if so, add it to
the display list. */
nstime_set_unset(&first_ts);
- nstime_set_unset(&prev_dis_ts);
- nstime_set_unset(&prev_cap_ts);
+ prev_dis = NULL;
+ prev_cap = NULL;
cum_bytes = 0;
/* Update the progress bar when it gets to this value. */
/* Unfreeze the packet list. */
if (!add_to_packet_list)
- new_packet_list_recreate_visible_rows();
+ packet_list_recreate_visible_rows();
/* Compute the time it took to filter the file */
compute_elapsed(&start_time);
- new_packet_list_thaw();
+ packet_list_thaw();
if (selected_frame_num == -1) {
/* The selected frame didn't pass the filter. */
/* Set to invalid to force update of packet list and packet details */
cf->current_row = -1;
if (selected_frame_num == 0) {
- new_packet_list_select_first_row();
+ packet_list_select_first_row();
}else{
- if (!new_packet_list_select_row_from_data(selected_frame)) {
+ if (!packet_list_select_row_from_data(selected_frame)) {
/* We didn't find a row corresponding to this frame.
This means that the frame isn't being displayed currently,
so we can't select it. */
frame_data *fdata;
nstime_set_unset(&first_ts);
- nstime_set_unset(&prev_dis_ts);
+ prev_dis = NULL;
cum_bytes = 0;
for (framenum = 1; framenum <= cf->count; framenum++) {
it's because this is the first displayed packet. Save the time
stamp of this packet as the time stamp of the previous displayed
packet. */
- if (nstime_is_unset(&prev_dis_ts)) {
- prev_dis_ts = fdata->abs_ts;
+ if (prev_dis == NULL) {
+ prev_dis = fdata;
}
/* Get the time elapsed between the first packet and this packet. */
/* If this frame is displayed, get the time elapsed between the
previous displayed packet and this packet. */
if ( fdata->flags.passed_dfilter ) {
- nstime_delta(&fdata->del_dis_ts, &fdata->abs_ts, &prev_dis_ts);
- prev_dis_ts = fdata->abs_ts;
+ fdata->prev_dis = prev_dis;
+ prev_dis = fdata;
}
/*
guint8 c_char;
size_t c_match = 0;
- g_assert(fi && "dissection with an invisible proto tree?");
+ /* dissection with an invisible proto tree? */
+ g_assert(fi);
if (mdata->frame_matched) {
/* We already had a match; don't bother doing any more work. */
if (new_fd != NULL) {
/* Find and select */
cf->search_in_progress = TRUE;
- found = new_packet_list_select_row_from_data(new_fd);
+ found = packet_list_select_row_from_data(new_fd);
cf->search_in_progress = FALSE;
cf->search_pos = 0; /* Reset the position */
if (!found) {
return FALSE; /* we failed to go to that packet */
}
- if (!new_packet_list_select_row_from_data(fdata)) {
+ if (!packet_list_select_row_from_data(fdata)) {
/* We didn't find a row corresponding to this frame.
This means that the frame isn't being displayed currently,
so we can't select it. */
cf_goto_top_frame(void)
{
/* Find and select */
- new_packet_list_select_first_row();
+ packet_list_select_first_row();
return TRUE; /* we got to that packet */
}
cf_goto_bottom_frame(void)
{
/* Find and select */
- new_packet_list_select_last_row();
+ packet_list_select_last_row();
return TRUE; /* we got to that packet */
}
frame_data *fdata;
/* Get the frame data struct pointer for this frame */
- fdata = new_packet_list_get_row_data(row);
+ fdata = packet_list_get_row_data(row);
if (fdata == NULL) {
/* XXX - if a GtkCList's selection mode is GTK_SELECTION_BROWSE, when