summaryrefslogtreecommitdiff
path: root/file.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-06-05 02:46:54 +0000
committerGuy Harris <guy@alum.mit.edu>2012-06-05 02:46:54 +0000
commit99536cc8da7a484a30863880c475f2e3dd09fd38 (patch)
treec370be6d3442a63888d486f241b0cf5dd754a9ac /file.h
parent7186d034f074cb32ad633762db09784ded1dd262 (diff)
downloadwireshark-99536cc8da7a484a30863880c475f2e3dd09fd38.tar.gz
Distinguish between "failed" and "user stopped it" for "save as" and
"export specified packets". For "failed", let the user try again with a different file, in case it failed due to, for example, running out of space or quota (probably the most likely failure mode for writing, and trying to a different volume might be the best workaround). For "user stopped it", presumably they don't want to try again (the most likely reason is "it was taking too damn long"). Put "Exporting to: ...", not "Saving: ..." in the statusbar if we're doing "export specified packets". In process_specified_packets(), allow a null range pointer to be specified, meaning "save 'em all"; that avoids the possibly-expensive (with a large capture) operation of initializing the range. If a "safe save" atop an existing file fails or is stopped, get rid of the temporary file we created. svn path=/trunk/; revision=43095
Diffstat (limited to 'file.h')
-rw-r--r--file.h33
1 files changed, 23 insertions, 10 deletions
diff --git a/file.h b/file.h
index e3b9acff0e..b40a642d91 100644
--- a/file.h
+++ b/file.h
@@ -51,6 +51,13 @@ typedef enum {
CF_READ_ABORTED /**< operation aborted by user */
} cf_read_status_t;
+/** Return values from functions that write out packets. */
+typedef enum {
+ CF_WRITE_OK, /**< operation succeeded */
+ CF_WRITE_ERROR, /**< operation got an error (function may provide err with details) */
+ CF_WRITE_ABORTED, /**< operation aborted by user */
+} cf_write_status_t;
+
/** Return values from functions that print sets of packets. */
typedef enum {
CF_PRINT_OK, /**< print operation succeeded */
@@ -70,7 +77,12 @@ typedef enum {
cf_cb_field_unselected,
cf_cb_file_save_started,
cf_cb_file_save_finished,
- cf_cb_file_save_failed
+ cf_cb_file_save_failed,
+ cf_cb_file_save_stopped,
+ cf_cb_file_export_specified_packets_started,
+ cf_cb_file_export_specified_packets_finished,
+ cf_cb_file_export_specified_packets_failed,
+ cf_cb_file_export_specified_packets_stopped
} cf_cbs;
typedef void (*cf_callback_t) (gint event, gpointer data, gpointer user_data);
@@ -208,11 +220,11 @@ gboolean cf_can_save_as(capture_file *cf);
* @param compressed whether to gzip compress the file
* @param dont_reopen TRUE if it shouldn't reopen and make that file the
* current capture file
- * @return one of cf_status_t
+ * @return one of cf_write_status_t
*/
-cf_status_t cf_save_packets(capture_file * cf, const char *fname,
- guint save_format, gboolean compressed,
- gboolean dont_reopen);
+cf_write_status_t cf_save_packets(capture_file * cf, const char *fname,
+ guint save_format, gboolean compressed,
+ gboolean dont_reopen);
/**
* Export some or all packets from a capture file to a new file. If there's
@@ -226,12 +238,13 @@ cf_status_t cf_save_packets(capture_file * cf, const char *fname,
* @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
+ * @return one of cf_write_status_t
*/
-cf_status_t cf_export_specified_packets(capture_file *cf, const char *fname,
- packet_range_t *range,
- guint save_format,
- gboolean compressed);
+cf_write_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.