summaryrefslogtreecommitdiff
path: root/tshark.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-02-16 18:58:40 +0000
committerGuy Harris <guy@alum.mit.edu>2012-02-16 18:58:40 +0000
commit55001ef1989ef30f1cab74e513193e11a4344d7f (patch)
treefe72535c08298fbb0d41cb5d6491eb221913dc5e /tshark.c
parent149f655c58229153e7045ea5a4cb91bf54299b7d (diff)
downloadwireshark-55001ef1989ef30f1cab74e513193e11a4344d7f.tar.gz
With the WTAP_ERR_UNSUPPORTED error, Wiretap supplies a string giving
the details of what in particular is unsupported; report it in TShark and Wireshark. Handle WTAP_ERR_RANDOM_OPEN_PIPE in TShark. Handle WTAP_ERR_COMPRESSION_NOT_SUPPORTED in TShark, and have its error message in Wireshark not speak of gzip, in case we support compressed output in other formats in the future. If we see a second section header block in a pcap-NG file, don't report it as "the file is corrupted", report it as "the file uses a feature we don't support", as that's the case - and don't free up the interface data array, as the file remains open, and Wireshark might still try to access the packets we were able to read. svn path=/trunk/; revision=41041
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tshark.c b/tshark.c
index efe2936d73..6b3827a439 100644
--- a/tshark.c
+++ b/tshark.c
@@ -2911,6 +2911,12 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type,
#endif
switch (err) {
+ case WTAP_ERR_UNSUPPORTED:
+ cmdarg_err("The file \"%s\" contains record data that TShark doesn't support.\n(%s)",
+ cf->filename, err_info);
+ g_free(err_info);
+ break;
+
case WTAP_ERR_UNSUPPORTED_ENCAP:
cmdarg_err("The file \"%s\" has a packet with a network type that TShark doesn't support.\n(%s)",
cf->filename, err_info);
@@ -3617,6 +3623,11 @@ cf_open_error_message(int err, gchar *err_info, gboolean for_writing,
errmsg = "The file \"%s\" is a \"special file\" or socket or other non-regular file.";
break;
+ case WTAP_ERR_RANDOM_OPEN_PIPE:
+ /* Seen only when opening a capture file for reading. */
+ errmsg = "The file \"%s\" is a pipe or FIFO; TShark can't read pipe or FIFO files in two-pass mode.";
+ break;
+
case WTAP_ERR_FILE_UNKNOWN_FORMAT:
/* Seen only when opening a capture file for reading. */
errmsg = "The file \"%s\" isn't a capture file in a format TShark understands.";
@@ -3693,6 +3704,10 @@ cf_open_error_message(int err, gchar *err_info, gboolean for_writing,
errmsg = "A full header couldn't be written to the file \"%s\".";
break;
+ case WTAP_ERR_COMPRESSION_NOT_SUPPORTED:
+ errmsg = "This file type cannot be written as a compressed file.";
+ break;
+
case WTAP_ERR_DECOMPRESS:
/* Seen only when opening a capture file for reading. */
g_snprintf(errmsg_errno, sizeof(errmsg_errno),