- WSADATA wsaData;
-#endif /* _WIN32 */
-
- char *gpf_path, *pf_path;
- char *gdp_path, *dp_path;
- int gpf_open_errno, gpf_read_errno;
- int pf_open_errno, pf_read_errno;
- int gdp_open_errno, gdp_read_errno;
- int dp_open_errno, dp_read_errno;
- int err;
- gchar *pipe_name = NULL;
- gchar *rfilters[64];
- e_prefs *prefs;
- char badopt;
- GLogLevelFlags log_flags;
- GPtrArray *disp_fields = g_ptr_array_new();
- guint fc;
- gboolean skip_pcap_header = FALSE;
-
- #define OPTSTRING_INIT "d:F:hlnN:o:r:R:sS:t:v"
-
- static const char optstring[] = OPTSTRING_INIT;
-
- /*
- * Get credential information for later use.
- */
- get_credential_info();
-
- /*
- * Clear the filters arrays
- */
- memset(rfilters, 0, sizeof(rfilters));
- memset(rfcodes, 0, sizeof(rfcodes));
- n_rfilters = 0;
- n_rfcodes = 0;
-
- /*
- * Initialize our string format
- */
- string_fmts = g_ptr_array_new();
-
- /*
- * Attempt to get the pathname of the executable file.
- */
- init_progfile_dir_error = init_progfile_dir(argv[0], main);
- if (init_progfile_dir_error != NULL) {
- fprintf(stderr, "rawshark: Can't get pathname of rawshark program: %s.\n",
- init_progfile_dir_error);
- }
-
- /*
- * Get credential information for later use.
- */
- get_credential_info();
-
- /* nothing more than the standard GLib handler, but without a warning */
- log_flags =
- G_LOG_LEVEL_WARNING |
- G_LOG_LEVEL_MESSAGE |
- G_LOG_LEVEL_INFO |
- G_LOG_LEVEL_DEBUG;
-
- g_log_set_handler(NULL,
- log_flags,
- log_func_ignore, NULL /* user_data */);
- g_log_set_handler(LOG_DOMAIN_CAPTURE_CHILD,
- log_flags,
- log_func_ignore, NULL /* user_data */);
-
- timestamp_set_type(TS_RELATIVE);
- timestamp_set_precision(TS_PREC_AUTO);
-
- /* Register all dissectors; we must do this before checking for the
- "-G" flag, as the "-G" flag dumps information registered by the
- dissectors, and we must do it before we read the preferences, in
- case any dissectors register preferences. */
- epan_init(register_all_protocols, register_all_protocol_handoffs, NULL, NULL,
- failure_message, open_failure_message, read_failure_message,
- write_failure_message);
-
- /* Now register the preferences for any non-dissector modules.
- We must do that before we read the preferences as well. */
- prefs_register_modules();
-
- /* Set the C-language locale to the native environment. */
- setlocale(LC_ALL, "");
-
- prefs = read_prefs(&gpf_open_errno, &gpf_read_errno, &gpf_path,
- &pf_open_errno, &pf_read_errno, &pf_path);
- if (gpf_path != NULL) {
- if (gpf_open_errno != 0) {
- cmdarg_err("Can't open global preferences file \"%s\": %s.",
- pf_path, strerror(gpf_open_errno));
- }
- if (gpf_read_errno != 0) {
- cmdarg_err("I/O error reading global preferences file \"%s\": %s.",
- pf_path, strerror(gpf_read_errno));
- }
- }
- if (pf_path != NULL) {
- if (pf_open_errno != 0) {
- cmdarg_err("Can't open your preferences file \"%s\": %s.", pf_path,
- strerror(pf_open_errno));
- }
- if (pf_read_errno != 0) {
- cmdarg_err("I/O error reading your preferences file \"%s\": %s.",
- pf_path, strerror(pf_read_errno));
- }
- g_free(pf_path);
- pf_path = NULL;
- }
-
- /* Set the name resolution code's flags from the preferences. */
- g_resolv_flags = prefs->name_resolve;
-
- /* Read the disabled protocols file. */
- read_disabled_protos_list(&gdp_path, &gdp_open_errno, &gdp_read_errno,
- &dp_path, &dp_open_errno, &dp_read_errno);
- if (gdp_path != NULL) {
- if (gdp_open_errno != 0) {
- cmdarg_err("Could not open global disabled protocols file\n\"%s\": %s.",
- gdp_path, strerror(gdp_open_errno));
- }
- if (gdp_read_errno != 0) {
- cmdarg_err("I/O error reading global disabled protocols file\n\"%s\": %s.",
- gdp_path, strerror(gdp_read_errno));
- }
- g_free(gdp_path);
- }
- if (dp_path != NULL) {
- if (dp_open_errno != 0) {
- cmdarg_err(
- "Could not open your disabled protocols file\n\"%s\": %s.", dp_path,
- strerror(dp_open_errno));
- }
- if (dp_read_errno != 0) {
- cmdarg_err(
- "I/O error reading your disabled protocols file\n\"%s\": %s.", dp_path,
- strerror(dp_read_errno));
- }
- g_free(dp_path);
- }
+ WSADATA wsaData;
+#endif /* _WIN32 */
+
+ char *gpf_path, *pf_path;
+ char *gdp_path, *dp_path;
+ int gpf_open_errno, gpf_read_errno;
+ int pf_open_errno, pf_read_errno;
+ int gdp_open_errno, gdp_read_errno;
+ int dp_open_errno, dp_read_errno;
+ int err;
+ gchar *pipe_name = NULL;
+ gchar *rfilters[64];
+ e_prefs *prefs_p;
+ char badopt;
+ int log_flags;
+ GPtrArray *disp_fields = g_ptr_array_new();
+ guint fc;
+ gboolean skip_pcap_header = FALSE;
+
+#define OPTSTRING_INIT "d:F:hlnN:o:pr:R:sS:t:v"
+
+ static const char optstring[] = OPTSTRING_INIT;
+
+ /* Assemble the compile-time version information string */
+ comp_info_str = g_string_new("Compiled ");
+ get_compiled_version_info(comp_info_str, NULL, epan_get_compiled_version_info);
+
+ /* Assemble the run-time version information string */
+ runtime_info_str = g_string_new("Running ");
+ get_runtime_version_info(runtime_info_str, NULL);
+
+ /* Add it to the information to be reported on a crash. */
+ ws_add_crash_info("Rawshark " VERSION "%s\n"
+ "\n"
+ "%s"
+ "\n"
+ "%s",
+ wireshark_svnversion, comp_info_str->str, runtime_info_str->str);