/* main.c
- *
- * $Id$
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
#endif
#ifdef _WIN32 /* Needed for console I/O */
-#if _MSC_VER < 1500
-/* AttachConsole() needs this #define! */
-/* But we're not calling it from here any more; do we need this? */
-#define _WIN32_WINNT 0x0501
-#endif
#include <fcntl.h>
#include <conio.h>
"See http://www.wireshark.org for more information.\n"
"\n"
"%s",
- wireshark_svnversion, get_copyright_info());
+ wireshark_gitversion, get_copyright_info());
} else {
output = stderr;
}
"%s"
"\n"
"%s",
- wireshark_svnversion, get_copyright_info(), comp_info_str->str,
+ wireshark_gitversion, get_copyright_info(), comp_info_str->str,
runtime_info_str->str);
}
g_string_append(str, ", ");
#ifdef HAVE_AIRPCAP
get_compiled_airpcap_version(str);
-#e lse
- g_string_append(str, "without AirPcap");
+#else
+ g_string_append(str, "without AirPcap");
#endif
}
search_direction jump_backwards = SD_FORWARD;
dfilter_t *jump_to_filter = NULL;
int optind_initial;
+ unsigned int in_file_type = WTAP_TYPE_AUTO;
#ifdef HAVE_GTKOSXAPPLICATION
GtkosxApplication *theApp;
#endif
"%s"
"\n"
"%s",
- wireshark_svnversion, comp_info_str->str, runtime_info_str->str);
+ wireshark_gitversion, comp_info_str->str, runtime_info_str->str);
/* Start windows sockets */
WSAStartup( MAKEWORD( 1, 1 ), &wsaData );
}
}
- /* Init the "Open file" dialog directory */
- /* (do this after the path settings are processed) */
+ /* Init the "Open file" dialog directory */
+ /* (do this after the path settings are processed) */
- /* Read the profile dependent (static part) of the recent file. */
- /* Only the static part of it will be read, as we don't have the gui now to fill the */
- /* recent lists which is done in the dynamic part. */
- /* We have to do this already here, so command line parameters can overwrite these values. */
- recent_read_profile_static(&rf_path, &rf_open_errno);
- if (rf_path != NULL && rf_open_errno != 0) {
- simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK,
- "Could not open recent file\n\"%s\": %s.",
- rf_path, g_strerror(rf_open_errno));
- }
+ /* Read the profile dependent (static part) of the recent file. */
+ /* Only the static part of it will be read, as we don't have the gui now to fill the */
+ /* recent lists which is done in the dynamic part. */
+ /* We have to do this already here, so command line parameters can overwrite these values. */
+ recent_read_profile_static(&rf_path, &rf_open_errno);
+ if (rf_path != NULL && rf_open_errno != 0) {
+ simple_dialog(ESD_TYPE_WARN, ESD_BTN_OK,
+ "Could not open recent file\n\"%s\": %s.",
+ rf_path, g_strerror(rf_open_errno));
+ }
- if (recent.gui_fileopen_remembered_dir &&
- test_for_directory(recent.gui_fileopen_remembered_dir) == EISDIR) {
- set_last_open_dir(recent.gui_fileopen_remembered_dir);
- } else {
- set_last_open_dir(get_persdatafile_dir());
- }
+ if (recent.gui_fileopen_remembered_dir &&
+ test_for_directory(recent.gui_fileopen_remembered_dir) == EISDIR) {
+ set_last_open_dir(recent.gui_fileopen_remembered_dir);
+ } else {
+ set_last_open_dir(get_persdatafile_dir());
+ }
/* Set getopt index back to initial value, so it will start with the
first command line parameter again. Also reset opterr to 1, so that
g_free(init_progfile_dir_error);
}
+ init_open_routines();
+
#ifdef HAVE_PLUGINS
/* Register all the plugin types we have. */
epan_register_plugin_types(); /* Types known to libwireshark */
prefs_p = read_configuration_files (&gdp_path, &dp_path);
/* Removed thread code:
- * http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=35027
+ * https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=9e277ae6154fd04bf6a0a34ec5655a73e5a736a3
*/
/* this is to keep tap extensions updating once every 3 seconds */
rfilter_parse_failed = TRUE;
}
}
+ if (ex_opt_count("read_format") > 0) {
+ in_file_type = open_info_name_to_type(ex_opt_get_next("read_format"));
+ }
if (!rfilter_parse_failed) {
- if (cf_open(&cfile, cf_name, FALSE, &err) == CF_OK) {
+ if (cf_open(&cfile, cf_name, in_file_type, FALSE, &err) == CF_OK) {
/* "cf_open()" succeeded, so it closed the previous
capture file, and thus destroyed any previous read filter
attached to "cf". */
/*
* A comment in gdkkeysyms.h says that it's autogenerated from
* freedesktop.org/x.org's keysymdef.h. Although the GDK docs
- * don't explicitly say so, isprint() should work as expected
+ * don't explicitly say so, g_ascii_isprint() should work as expected
* for values < 127.
*/
- } else if (isascii(event->keyval) && isprint(event->keyval)) {
+ } else if (event->keyval < 256 && g_ascii_isprint(event->keyval)) {
/* Forward the keypress on to the display filter entry */
if (main_display_filter_widget && !gtk_widget_is_focus(main_display_filter_widget)) {
gtk_window_set_focus(GTK_WINDOW(top_level), main_display_filter_widget);