aboutsummaryrefslogtreecommitdiffstats
path: root/file.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-05-22 22:17:57 +0000
committerGuy Harris <guy@alum.mit.edu>2012-05-22 22:17:57 +0000
commitc2bb7956c234af4babe33f84628dff9e869ba2e0 (patch)
tree7f0c83d0778a8578ee3d157f1369de1a3e8be968 /file.h
parent4e7d87caa2b9d1c091a09dd773df057286169112 (diff)
"Save As" always saves everything and, when the save is done, makes the
new file the current file, as is the case in most if not all other GUI applications. A new "Export Specified Packets" menu option allows you to specify which packets to write out, with the default being the displayed packets (and those on which the displayed packets depend for, e.g. reassembly), and never makes the resulting file the current file. The two operations are conceptually distinct. Lumping them into one menu item, with the default for "Save As" being "displayed packets only" and thus making it behave like the latter operation, was causing some confusion; see, for example, bug 6640. Make the dialog popped up if you try to "Save As" or "Export Specified Packets" on top of an existing file ask the "do you want to do this?" question in the main part of the message, and note in the secondary text that doing that will overwrite what's in the file; that matches what TextEdit on OS X and the GNOME text editor say. svn path=/trunk/; revision=42792
Diffstat (limited to 'file.h')
-rw-r--r--file.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/file.h b/file.h
index 6371b611c4..ea6b908e90 100644
--- a/file.h
+++ b/file.h
@@ -208,17 +208,33 @@ gboolean cf_can_save_as(capture_file *cf);
cf_status_t cf_save(capture_file * cf, const char *fname, guint save_format, gboolean compressed);
/**
- * Save a capture file (or a range of it). Fails if the specified
- * pathname already exists.
+ * Save all packets in a capture file to a new file, and, if that succeeds,
+ * make that file the current capture file. Fails if the specified
+ * target file already exists.
*
* @param cf the capture file to save to
* @param fname the filename to save to
- * @param range the range of packets to save
* @param save_format the format of the file to save (libpcap, ...)
* @param compressed whether to gzip compress the file
* @return one of cf_status_t
*/
-cf_status_t cf_save_as(capture_file * cf, const char *fname, packet_range_t *range, guint save_format, gboolean compressed);
+cf_status_t cf_save_as(capture_file * cf, const char *fname, guint save_format, gboolean compressed);
+
+/**
+ * Export some or all packets from a capture file to a new file. Fails if
+ * the specified target file already exists.
+ *
+ * @param cf the capture file to write to
+ * @param fname the filename to write to
+ * @param range the range of packets to write
+ * @param save_format the format of the file to write (libpcap, ...)
+ * @param compressed whether to gzip compress the file
+ * @return one of cf_status_t
+ */
+cf_status_t cf_export_specified_packets(capture_file *cf, const char *fname,
+ packet_range_t *range,
+ guint save_format,
+ gboolean compressed);
/**
* Get a displayable name of the capture file.