diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2012-02-28 03:19:49 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2012-02-28 03:19:49 +0000 |
commit | 89cfdc35590c515e19654cddde7a7c1018f9ccc2 (patch) | |
tree | c87777778582b85628c9b87d197fcc16d8f47eee /ui/win32 | |
parent | 76652d9d4a65646af45bbaffa818b775a519bff2 (diff) |
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
Diffstat (limited to 'ui/win32')
-rw-r--r-- | ui/win32/file_dlg_win32.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ui/win32/file_dlg_win32.c b/ui/win32/file_dlg_win32.c index 67bb7b9d92..1a11b8d25c 100644 --- a/ui/win32/file_dlg_win32.c +++ b/ui/win32/file_dlg_win32.c @@ -1571,6 +1571,7 @@ save_as_file_hook_proc(HWND sf_hwnd, UINT msg, WPARAM w_param, LPARAM l_param) { packet_range_init(&g_range); /* default to displayed packets */ g_range.process_filtered = TRUE; + g_range.include_dependents = TRUE; /* Fill in the file format list */ /*build_file_format_list(sf_hwnd);*/ @@ -1662,6 +1663,7 @@ range_update_dynamics(HWND dlg_hwnd, packet_range_t *range) { TCHAR static_val[STATIC_LABEL_CHARS]; gint selected_num; guint32 ignored_cnt = 0, displayed_ignored_cnt = 0; + guint32 displayed_cnt; cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_DISPLAYED_BTN); if (SendMessage(cur_ctrl, BM_GETCHECK, 0, 0) == BST_CHECKED) @@ -1679,10 +1681,14 @@ range_update_dynamics(HWND dlg_hwnd, packet_range_t *range) { cur_ctrl = GetDlgItem(dlg_hwnd, EWFD_ALL_PKTS_DISP); EnableWindow(cur_ctrl, filtered_active); + if (range->include_dependents) + displayed_cnt = range->displayed_plus_dependents_cnt; + else + displayed_cnt = range->displayed_cnt; if (range->remove_ignored) { - _snwprintf(static_val, STATIC_LABEL_CHARS, _T("%u"), range->displayed_cnt - range->displayed_ignored_cnt); + _snwprintf(static_val, STATIC_LABEL_CHARS, _T("%u"), displayed_cnt - range->displayed_ignored_cnt); } else { - _snwprintf(static_val, STATIC_LABEL_CHARS, _T("%u"), range->displayed_cnt); + _snwprintf(static_val, STATIC_LABEL_CHARS, _T("%u"), displayed_cnt); } SetWindowText(cur_ctrl, static_val); |