summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2009-12-17 01:18:14 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2009-12-17 01:18:14 +0000
commit47be3577a731492ab1667fdc39233094051c01a6 (patch)
tree8239ff427bfe4e5c475b4f8429f0fef9186cf773 /file.c
parentfaec4bde007d7d17da690477b7736059394c09fd (diff)
downloadwireshark-47be3577a731492ab1667fdc39233094051c01a6.tar.gz
Introduce "Ignore Packet" in the packet list.
This will remove the package from the dissection functions without removing it from the capture file. svn path=/trunk/; revision=31287
Diffstat (limited to 'file.c')
-rw-r--r--file.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/file.c b/file.c
index feafb226a2..d4b6a30db0 100644
--- a/file.c
+++ b/file.c
@@ -310,6 +310,7 @@ cf_open(capture_file *cf, const char *fname, gboolean is_tempfile, int *err)
cf->count = 0;
cf->displayed_count = 0;
cf->marked_count = 0;
+ cf->ignored_count = 0;
cf->drops_known = FALSE;
cf->drops = 0;
cf->snap = wtap_snapshot_length(cf->wth);
@@ -1273,6 +1274,9 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf,
if (fdata->flags.marked) {
packet_list_set_colors(row, &prefs.gui_marked_fg, &prefs.gui_marked_bg);
}
+ if (fdata->flags.ignored) {
+ packet_list_set_colors(row, &prefs.gui_ignored_fg, &prefs.gui_ignored_bg);
+ }
cf->displayed_count++;
}
@@ -4072,6 +4076,32 @@ cf_unmark_frame(capture_file *cf, frame_data *frame)
}
}
+/*
+ * Ignore a particular frame.
+ */
+void
+cf_ignore_frame(capture_file *cf, frame_data *frame)
+{
+ if (! frame->flags.ignored) {
+ frame->flags.ignored = TRUE;
+ if (cf->count > cf->ignored_count)
+ cf->ignored_count++;
+ }
+}
+
+/*
+ * Un-ignore a particular frame.
+ */
+void
+cf_unignore_frame(capture_file *cf, frame_data *frame)
+{
+ if (frame->flags.ignored) {
+ frame->flags.ignored = FALSE;
+ if (cf->ignored_count > 0)
+ cf->ignored_count--;
+ }
+}
+
typedef struct {
wtap_dumper *pdh;
const char *fname;