diff options
author | Guy Harris <guy@alum.mit.edu> | 2004-07-08 07:45:46 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2004-07-08 07:45:46 +0000 |
commit | 5f1b5daf6bae66123c58cb6697374091a19191b8 (patch) | |
tree | 2085cfa2f5470bfe8313891cb45e995977db656f /file.c | |
parent | 6216591bdf1095c68a7d423c07f364048eb0c09a (diff) |
A read can return WTAP_ERR_UNSUPPORTED_ENCAP if the encapsulation type
is per-packet and the packet has an encapsulation type we don't know
about, so handle it on reads as well as errors - show an error message
noting that we had a packet with a network type we don't know about, and
show the extra info returned for that error giving details.
It shouldn't return WTAP_ERR_UNSUPPORTED, however, so just give the
"wtap_strerror()" error for that case.
svn path=/trunk/; revision=11340
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -1,7 +1,7 @@ /* file.c * File I/O routines * - * $Id: file.c,v 1.386 2004/06/30 06:58:56 guy Exp $ + * $Id: file.c,v 1.387 2004/07/08 07:45:46 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -488,7 +488,10 @@ cf_read(capture_file *cf) switch (err) { case WTAP_ERR_UNSUPPORTED_ENCAP: - errmsg = "The capture file is for a network type that Ethereal doesn't support."; + snprintf(errmsg_errno, sizeof(errmsg_errno), + "The capture file has a packet with a network type that Ethereal doesn't support.\n(%s)", + err_info); + errmsg = errmsg_errno; break; case WTAP_ERR_CANT_READ: @@ -2983,8 +2986,12 @@ cf_read_error_message(int err, gchar *err_info) switch (err) { - case WTAP_ERR_UNSUPPORTED: case WTAP_ERR_UNSUPPORTED_ENCAP: + snprintf(errmsg_errno, sizeof(errmsg_errno), + "The file \"%%s\" has a packet with a network type that Ethereal doesn't support.\n(%s)", + err_info); + break; + case WTAP_ERR_BAD_RECORD: snprintf(errmsg_errno, sizeof(errmsg_errno), "An error occurred while reading from the file \"%%s\": %s.\n(%s)", |