diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-02-19 08:00:08 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-02-19 08:00:08 +0000 |
commit | 585268e3e1056e802dcf6507e3613b92ca0d694c (patch) | |
tree | 1cb5d9d7ecc359592c1b10ea73028296927a2894 /tethereal.c | |
parent | 1b401fa9e1b6637b3af0c0297560ac217a033217 (diff) |
Use WTAP_ERR_UNSUPPORTED_ENCAP for all attempts to open or read a
capture file for an unsupported link-layer encapsulation type (as the
nettl reader does), and report it correctly if it occurs on an open or
read attempt rather than a save attempt.
svn path=/trunk/; revision=1647
Diffstat (limited to 'tethereal.c')
-rw-r--r-- | tethereal.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tethereal.c b/tethereal.c index 5a913bef24..72d60cf924 100644 --- a/tethereal.c +++ b/tethereal.c @@ -1,6 +1,6 @@ /* tethereal.c * - * $Id: tethereal.c,v 1.18 2000/02/16 01:38:56 gram Exp $ + * $Id: tethereal.c,v 1.19 2000/02/19 07:59:54 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -690,6 +690,11 @@ load_cap_file(capture_file *cf, int out_file_type) the line. */ switch (err) { + case WTAP_ERR_UNSUPPORTED_ENCAP: + fprintf(stderr, +"tethereal: The capture file is for a network type that Tethereal doesn't support.\n"); + break; + case WTAP_ERR_CANT_READ: fprintf(stderr, "tethereal: An attempt to read from the file failed for some unknown reason.\n"); @@ -913,8 +918,10 @@ file_open_error_message(int err, int for_writing) case WTAP_ERR_UNSUPPORTED_ENCAP: case WTAP_ERR_ENCAP_PER_PACKET_UNSUPPORTED: - /* Seen only when opening a capture file for writing. */ - errmsg = "Tethereal cannot save this capture in that format."; + if (for_writing) + errmsg = "Tethereal cannot save this capture in that format."; + else + errmsg = "The file \"%s\" is a capture for a network type that Tethereal doesn't support."; break; case WTAP_ERR_BAD_RECORD: |