From 89cfdc35590c515e19654cddde7a7c1018f9ccc2 Mon Sep 17 00:00:00 2001 From: Jeff Morriss Date: Tue, 28 Feb 2012 03:19:49 +0000 Subject: Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3315 - make Save-As/Displayed/All-Packets save not only the displayed packets but also any other packets needed (e.g., for reassembly) to fully dissect the displayed packets. This works only for the "All packets" case; choosing only the Selected packet, the Marked packets, or a range of packets would require actually storing which packets depend on which (too much memory) or going through the packet list many times (too slow). Also, this behavior is always the case: you can't save the displayed packets without their dependencies (I don't see why this would be desirable). So far this is done for SCTP and things using the reassembly routines (TCP has been tested). The Win32 dialog was modified but hasn't been tested yet. One confusing aspect of the UI is that the Displayed count in the Save-As dialog does not match the number of displayed packets. (I tried renaming the button "Displayed + Dependencies" but it looked too big.) The tooltip tries to explain this and the fact that this works only in the All-Packets case; suggestions for improvement are welcome. Implementation details: Dissectors (or the reassembly code) can list frames which were needed to build the current frame's tree. If the current frame passes the display filter then each listed frame is marked as "depended upon" (this takes up the last free frame_data flag). When performing a Save-As/Displayed/All-Packets then choose packets which passed the dfilter _or_ are depended upon. svn path=/trunk/; revision=41216 --- packet-range.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'packet-range.c') diff --git a/packet-range.c b/packet-range.c index ed9955e094..6e0e49fd54 100644 --- a/packet-range.c +++ b/packet-range.c @@ -66,6 +66,7 @@ static void packet_range_calc(packet_range_t *range) { range->displayed_cnt = 0L; range->displayed_marked_cnt = 0L; range->displayed_mark_range_cnt=0L; + range->displayed_plus_dependents_cnt = 0L; range->displayed_ignored_cnt = 0L; range->displayed_ignored_marked_cnt = 0L; range->displayed_ignored_mark_range_cnt = 0L; @@ -95,6 +96,10 @@ static void packet_range_calc(packet_range_t *range) { if (packet->flags.passed_dfilter) { range->displayed_cnt++; } + if (packet->flags.passed_dfilter || + packet->flags.dependent_of_displayed) { + range->displayed_plus_dependents_cnt++; + } if (packet->flags.marked) { if (packet->flags.ignored) { range->ignored_marked_cnt++; @@ -292,8 +297,12 @@ range_process_e packet_range_process_packet(packet_range_t *range, frame_data *f g_assert_not_reached(); } - /* this packet has to pass the display filter but didn't? -> try next */ - if (range->process_filtered && fdata->flags.passed_dfilter == FALSE) { + /* This packet has to pass the display filter but didn't? + * Try next, but only if we're not including dependent packets and this + * packet happens to be a dependency on something that is displayed. + */ + if ((range->process_filtered && fdata->flags.passed_dfilter == FALSE) && + !(range->include_dependents && fdata->flags.dependent_of_displayed)) { return range_process_next; } -- cgit v1.2.3