#include "fileset.h"
#include "tempfile.h"
#include "merge.h"
-#include "alert_box.h"
-#include "simple_dialog.h"
-#include "main_statusbar.h"
-#include "progress_dlg.h"
-#include "ui_util.h"
+
#include <epan/prefs.h>
#include <epan/dfilter/dfilter.h>
#include <epan/epan_dissect.h>
#include <epan/strutil.h>
#include <epan/addr_resolv.h>
+#include "ui/alert_box.h"
+#include "ui/simple_dialog.h"
+#include "ui/main_statusbar.h"
+#include "ui/progress_dlg.h"
+#include "ui/ui_util.h"
+
#ifdef HAVE_LIBPCAP
gboolean auto_scroll_live;
#endif
#define MIN_QUANTUM 200000
#define MIN_NUMBER_OF_PACKET 1500
-/* Number of "frame_data" structures per memory chunk.
- XXX - is this the right number? */
-#define FRAME_DATA_CHUNK_SIZE 1024
-
-
/*
* We could probably use g_signal_...() instead of the callbacks below but that
* would require linking our CLI programs to libgobject and creating an object
" in the middle of a packet.";
break;
- case WTAP_ERR_BAD_RECORD:
+ case WTAP_ERR_BAD_FILE:
g_snprintf(errmsg_errno, sizeof(errmsg_errno),
"The capture file appears to be damaged or corrupt.\n(%s)",
err_info);
" in the middle of a packet.";
break;
- case WTAP_ERR_BAD_RECORD:
+ case WTAP_ERR_BAD_FILE:
g_snprintf(errmsg_errno, sizeof(errmsg_errno),
"The capture file %%s appears to be damaged or corrupt.\n(%s)",
err_info);
g_free(err_info);
break;
- case WTAP_ERR_BAD_RECORD:
+ case WTAP_ERR_BAD_FILE:
g_snprintf(errmsg_errno, sizeof(errmsg_errno),
"An error occurred while reading from the file \"%%s\": %s.\n(%s)",
wtap_strerror(err), err_info);
cf->elapsed_time = fdata->rel_ts;
}
- /* Get the time elapsed between the previous displayed packet and
- this packet. */
- nstime_delta(&fdata->del_dis_ts, &fdata->abs_ts, &prev_dis_ts);
-
- prev_dis_ts = fdata->abs_ts;
+ /* 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;
+ }
/*
* Byte counts
result = MR_NOTMATCHED;
buf_len = fdata->pkt_len;
- for (i = 0; i < buf_len; i++) {
+ i = 0;
+ while (i < buf_len) {
c_char = cf->pd[i];
if (cf->case_type)
c_char = toupper(c_char);
- if (c_char != 0) {
+ if (c_char != '\0') {
if (c_char == ascii_text[c_match]) {
- c_match++;
+ c_match += 1;
if (c_match == textlen) {
result = MR_MATCHED;
cf->search_pos = i; /* Save the position of the last character
for highlighting the field. */
break;
}
- } else
+ }
+ else {
+ g_assert(i>=c_match);
+ i -= (guint32)c_match;
c_match = 0;
+ }
}
+ i += 1;
}
return result;
}
result = MR_NOTMATCHED;
buf_len = fdata->pkt_len;
- for (i = 0; i < buf_len; i++) {
+ i = 0;
+ while (i < buf_len) {
c_char = cf->pd[i];
if (cf->case_type)
c_char = toupper(c_char);
if (c_char == ascii_text[c_match]) {
- c_match++;
+ c_match += 1;
if (c_match == textlen) {
result = MR_MATCHED;
cf->search_pos = i; /* Save the position of the last character
for highlighting the field. */
break;
}
- } else
+ }
+ else {
+ g_assert(i>=c_match);
+ i -= (guint32)c_match;
c_match = 0;
+ }
+ i += 1;
}
+
return result;
}
result = MR_NOTMATCHED;
buf_len = fdata->pkt_len;
- for (i = 0; i < buf_len; i++) {
+ i = 0;
+ while (i < buf_len) {
c_char = cf->pd[i];
if (cf->case_type)
c_char = toupper(c_char);
if (c_char == ascii_text[c_match]) {
- c_match++;
- i++;
+ c_match += 1;
if (c_match == textlen) {
result = MR_MATCHED;
cf->search_pos = i; /* Save the position of the last character
for highlighting the field. */
break;
}
- } else
+ i += 1;
+ }
+ else {
+ g_assert(i>=(c_match*2));
+ i -= (guint32)c_match*2;
c_match = 0;
+ }
+ i += 1;
}
return result;
}
result = MR_NOTMATCHED;
buf_len = fdata->pkt_len;
- for (i = 0; i < buf_len; i++) {
+ i = 0;
+ while (i < buf_len) {
if (cf->pd[i] == binary_data[c_match]) {
- c_match++;
+ c_match += 1;
if (c_match == datalen) {
result = MR_MATCHED;
cf->search_pos = i; /* Save the position of the last character
for highlighting the field. */
break;
}
- } else
+ }
+ else {
+ g_assert(i>=c_match);
+ i -= (guint32)c_match;
c_match = 0;
+ }
+ i += 1;
}
return result;
}
if (fdata == NULL) {
/* XXX - if a GtkCList's selection mode is GTK_SELECTION_BROWSE, when
the first entry is added to it by "real_insert_row()", that row
- is selected (see "real_insert_row()", in "gtk/gtkclist.c", in both
+ is selected (see "real_insert_row()", in "ui/gtk/gtkclist.c", in both
our version and the vanilla GTK+ version).
This means that a "select-row" signal is emitted; this causes
}
break;
- case WTAP_ERR_BAD_RECORD:
+ case WTAP_ERR_BAD_FILE:
/* Seen only when opening a capture file for reading. */
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"The file \"%s\" appears to be damaged or corrupt.\n"