#endif /* HAVE_LIBPCAP */
#include "log.h"
+#ifdef _WIN32
+#include <wsutil/unicode-utils.h>
+#endif /* _WIN32 */
+
/*
* This is the template for the decode as option; it is shared between the
* various functions that output the usage for this parameter.
raw_pipe_open(const char *pipe_name)
{
#ifndef _WIN32
- struct stat pipe_stat;
+ ws_statb64 pipe_stat;
#else
char *pncopy, *pos;
DWORD err;
#endif /* _WIN32 */
} else {
#ifndef _WIN32
- if (ws_stat(pipe_name, &pipe_stat) < 0) {
+ if (ws_stat64(pipe_name, &pipe_stat) < 0) {
fprintf(stderr, "rawshark: The pipe %s could not be checked: %s\n",
pipe_name, strerror(errno));
return -1;
gboolean arg_error = FALSE;
#ifdef _WIN32
- WSADATA wsaData;
+ WSADATA wsaData;
#endif /* _WIN32 */
char *gpf_path, *pf_path;
static const char optstring[] = OPTSTRING_INIT;
+#ifdef _WIN32
+ arg_list_utf_16to8(argc, argv);
+#endif /* _WIN32 */
+
/*
* Get credential information for later use.
*/
switch (err) {
case WTAP_ERR_UNSUPPORTED_ENCAP:
- cmdarg_err("\"%s\" has a packet with a network type that Rawshark doesn't support.\n(%s)",
+ cmdarg_err("The file \"%s\" has a packet with a network type that Rawshark doesn't support.\n(%s)",
cf->filename, err_info);
break;
case WTAP_ERR_CANT_READ:
- cmdarg_err("An attempt to read from \"%s\" failed for some unknown reason.",
+ cmdarg_err("An attempt to read from the file \"%s\" failed for some unknown reason.",
cf->filename);
break;
case WTAP_ERR_SHORT_READ:
- cmdarg_err("\"%s\" appears to have been cut short in the middle of a packet.",
+ cmdarg_err("The file \"%s\" appears to have been cut short in the middle of a packet.",
cf->filename);
break;
case WTAP_ERR_BAD_RECORD:
- cmdarg_err("\"%s\" appears to be damaged or corrupt.\n(%s)",
+ cmdarg_err("The file \"%s\" appears to be damaged or corrupt.\n(%s)",
+ cf->filename, err_info);
+ break;
+
+ case WTAP_ERR_DECOMPRESS:
+ cmdarg_err("The compressed file \"%s\" appears to be damaged or corrupt.\n(%s)",
cf->filename, err_info);
break;
default:
- cmdarg_err("An error occurred while reading \"%s\": %s.",
+ cmdarg_err("An error occurred while reading the file \"%s\": %s.",
cf->filename, wtap_strerror(err));
break;
}
svalue = fvalue_get_sinteger(&finfo->value);
if (hfinfo->display & BASE_RANGE_STRING) {
g_string_append(label_s, rval_to_str(svalue, RVALS(hfinfo->strings), "Unknown"));
+ } else if (hfinfo->display & BASE_EXT_STRING) {
+ g_string_append(label_s, val_to_str_ext(svalue, (value_string_ext *) hfinfo->strings, "Unknown"));
} else {
g_string_append(label_s, val_to_str(svalue, cVALS(hfinfo->strings), "Unknown"));
}
uvalue = fvalue_get_uinteger(&finfo->value);
if (!hfinfo->bitmask && hfinfo->display & BASE_RANGE_STRING) {
g_string_append(label_s, rval_to_str(uvalue, RVALS(hfinfo->strings), "Unknown"));
+ } else if (hfinfo->display & BASE_EXT_STRING) {
+ g_string_append(label_s, val_to_str_ext(uvalue, (value_string_ext *) hfinfo->strings, "Unknown"));
} else {
g_string_append(label_s, val_to_str(uvalue, cVALS(hfinfo->strings), "Unknown"));
}