ssl: set protocol column to "TLS" when possible
[metze/wireshark/wip.git] / captype.c
index 02094b46154a7839b994580961386734f641eb56..d83b21485c4675f369bedaf0caef24710cdb74af 100644 (file)
--- a/captype.c
+++ b/captype.c
 #include <getopt.h>
 #endif
 
-#ifdef HAVE_LIBZ
-#include <zlib.h>     /* to get the libz version number */
-#endif
-
 #include <glib.h>
 
 #include <wiretap/wtap.h>
@@ -48,8 +44,7 @@
 #include <wsutil/file_util.h>
 #include <wsutil/filesystem.h>
 #include <wsutil/privileges.h>
-#include <wsutil/ws_diag_control.h>
-#include <wsutil/ws_version_info.h>
+#include <ws_version_info.h>
 
 #ifdef HAVE_PLUGINS
 #include <wsutil/plugins.h>
@@ -75,42 +70,16 @@ print_usage(FILE *output)
 
 #ifdef HAVE_PLUGINS
 /*
- *  Don't report failures to load plugins because most (non-wiretap) plugins
- *  *should* fail to load (because we're not linked against libwireshark and
- *  dissector plugins need libwireshark).
+ * General errors are reported with an console message in captype.
  */
 static void
-failure_message(const char *msg_format _U_, va_list ap _U_)
-{
-  return;
-}
-#endif
-
-static void
-get_captype_compiled_info(GString *str)
+failure_message(const char *msg_format, va_list ap)
 {
-  /* LIBZ */
-  g_string_append(str, ", ");
-#ifdef HAVE_LIBZ
-  g_string_append(str, "with libz ");
-#ifdef ZLIB_VERSION
-  g_string_append(str, ZLIB_VERSION);
-#else /* ZLIB_VERSION */
-  g_string_append(str, "(version unknown)");
-#endif /* ZLIB_VERSION */
-#else /* HAVE_LIBZ */
-  g_string_append(str, "without libz");
-#endif /* HAVE_LIBZ */
+  fprintf(stderr, "captype: ");
+  vfprintf(stderr, msg_format, ap);
+  fprintf(stderr, "\n");
 }
-
-static void
-get_captype_runtime_info(GString *str)
-{
-  /* zlib */
-#if defined(HAVE_LIBZ) && !defined(_WIN32)
-  g_string_append_printf(str, ", with libz %s", zlibVersion());
 #endif
-}
 
 int
 main(int argc, char *argv[])
@@ -137,10 +106,10 @@ main(int argc, char *argv[])
   setlocale(LC_ALL, "");
 
   /* Get the compile-time version information string */
-  comp_info_str = get_compiled_version_info(NULL, get_captype_compiled_info);
+  comp_info_str = get_compiled_version_info(NULL, NULL);
 
   /* Get the run-time version information string */
-  runtime_info_str = get_runtime_version_info(get_captype_runtime_info);
+  runtime_info_str = get_runtime_version_info(NULL);
 
   /* Add it to the information to be reported on a crash. */
   ws_add_crash_info("Captype (Wireshark) %s\n"
@@ -172,8 +141,12 @@ main(int argc, char *argv[])
     init_report_err(failure_message,NULL,NULL,NULL);
 
     /* Scan for plugins.  This does *not* call their registration routines;
-       that's done later. */
-    scan_plugins();
+       that's done later.
+
+       Don't report failures to load plugins because most (non-wiretap)
+       plugins *should* fail to load (because we're not linked against
+       libwireshark and dissector plugins need libwireshark). */
+    scan_plugins(DONT_REPORT_LOAD_FAILURE);
 
     /* Register all libwiretap plugin modules. */
     register_all_wiretap_modules();