If we don't find a NetScaler signature, don't report an error.

It's *NOT* an error; it's just a file that isn't a NetScaler file.
Otherwise, we report errors on files that should just be passed on to
other open routines.

Also, NetScaler files are *NOT* text files, and we should *NOT* use
".txt" as the suffix.

Change-Id: If001abbbbc3de3ea27439a44a47ce1d6071d38ae
Reviewed-on: https://code.wireshark.org/review/3678
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2014-08-17 17:32:16 -07:00
parent 6a8267270f
commit b8293f95ad
2 changed files with 9 additions and 8 deletions

View File

@ -361,7 +361,7 @@ static struct open_info open_info_base[] = {
{ "Cosine", OPEN_INFO_HEURISTIC, cosine_open, "txt", NULL, NULL },
{ "Hcidump", OPEN_INFO_HEURISTIC, hcidump_open, NULL, NULL, NULL },
{ "Commview", OPEN_INFO_HEURISTIC, commview_open, "ncf", NULL, NULL },
{ "Nstrace", OPEN_INFO_HEURISTIC, nstrace_open, "txt", NULL, NULL },
{ "Nstrace", OPEN_INFO_HEURISTIC, nstrace_open, "cap", NULL, NULL },
{ "Logcat ", OPEN_INFO_HEURISTIC, logcat_open, "logcat", NULL, NULL },
{ "Logcat Text", OPEN_INFO_HEURISTIC, logcat_text_open, "txt", NULL, NULL },
/* ASCII trace files from Telnet sessions. */

View File

@ -701,8 +701,7 @@ int nstrace_open(wtap *wth, int *err, gchar **err_info)
break;
default:
*err = WTAP_ERR_UNSUPPORTED;
*err_info = g_strdup_printf("nstrace: file type %d unsupported", wth->file_type_subtype);
/* No known signature found, assume it's not NetScaler */
g_free(nstrace_buf);
return 0;
}
@ -801,10 +800,12 @@ nspm_signature_func(20)
nspm_signature_func(30)
/*
** Check signature and return the version number of the signature.
** If not found, it returns 0. At the time of return from this function
** we might not be at the first page. So after a call to this function, there
** has to be a file seek to return to the start of the first page.
** Check signature and return the file type and subtype for files with
** that signature. If it finds no signature that it recognizes, it
** returns WTAP_FILE_TYPE_SUBTYPE_UNKNOWN. At the time of return from
** this function we might not be at the first page. So after a call to
** this function, there has to be a file seek to return to the start
** of the first page.
*/
static guint32
nspm_signature_version(wtap *wth, gchar *nstrace_buf, gint32 len)
@ -839,7 +840,7 @@ nspm_signature_version(wtap *wth, gchar *nstrace_buf, gint32 len)
}
}
return 0; /* no version found */
return WTAP_FILE_TYPE_SUBTYPE_UNKNOWN; /* no version found */
}
#define nspr_getv10recordtype(hdp) (pletoh16(&(hdp)->nsprRecordType))