diff options
-rw-r--r-- | file.c | 10 | ||||
-rw-r--r-- | tshark.c | 15 | ||||
-rw-r--r-- | wiretap/pcapng.c | 4 |
3 files changed, 25 insertions, 4 deletions
@@ -688,6 +688,14 @@ cf_read(capture_file *cf, gboolean from_save) if any. */ switch (err) { + case WTAP_ERR_UNSUPPORTED: + g_snprintf(errmsg_errno, sizeof(errmsg_errno), + "The capture file contains record data that TShark doesn't support.\n(%s)", + err_info); + g_free(err_info); + errmsg = errmsg_errno; + break; + case WTAP_ERR_UNSUPPORTED_ENCAP: g_snprintf(errmsg_errno, sizeof(errmsg_errno), "The capture file has a packet with a network type that Wireshark doesn't support.\n(%s)", @@ -3996,7 +4004,7 @@ cf_open_failure_alert_box(const char *filename, int err, gchar *err_info, case WTAP_ERR_COMPRESSION_NOT_SUPPORTED: simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, - "Gzip compression not supported by this file type."); + "This file type cannot be written as a compressed file."); break; case WTAP_ERR_DECOMPRESS: @@ -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), diff --git a/wiretap/pcapng.c b/wiretap/pcapng.c index 5a038f66a3..32611c4257 100644 --- a/wiretap/pcapng.c +++ b/wiretap/pcapng.c @@ -587,9 +587,7 @@ pcapng_read_section_header_block(FILE_T fh, gboolean first_block, g_free(option_content); if (pn->interface_data != NULL) { - g_array_free(pn->interface_data, TRUE); - pn->interface_data = NULL; - *err = WTAP_ERR_BAD_FILE; + *err = WTAP_ERR_UNSUPPORTED; *err_info = g_strdup_printf("pcapng: multiple section header blocks not supported."); return 0; } |