summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2014-06-23 14:55:56 -0700
committerGuy Harris <guy@alum.mit.edu>2014-06-23 21:56:42 +0000
commit1d92195de847a30e570ca690ab0a2034cb3a51d3 (patch)
tree95b000735679f0b957b8c9eecc9ad4d700ea4efc /ui
parentdd7134d907350ccc574cdec596f4162860912bb9 (diff)
downloadwireshark-1d92195de847a30e570ca690ab0a2034cb3a51d3.tar.gz
Have individual programs get libpcap and libz version info.
That way, the code that constructs the runtime version string doesn't itself have to call libpcap and libz, and could be usable in programs that don't call them. While we're at it, add "with" to the run-time version information for GnuTLS and libgcrypt, to match the compile-time version information, and add the version information from libwireshark to TShark. Change-Id: I3726a027d032270b032292da9314c1cec535dcd2 Reviewed-on: https://code.wireshark.org/review/2587 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui')
-rw-r--r--ui/gtk/main.c20
-rw-r--r--ui/qt/main.cpp22
2 files changed, 35 insertions, 7 deletions
diff --git a/ui/gtk/main.c b/ui/gtk/main.c
index a1caf1acfa..5848ea15ef 100644
--- a/ui/gtk/main.c
+++ b/ui/gtk/main.c
@@ -45,6 +45,10 @@
#include "wsutil/wsgetopt.h"
#endif
+#ifdef HAVE_LIBZ
+#include <zlib.h> /* to get the libz version number */
+#endif
+
#ifdef _WIN32 /* Needed for console I/O */
#include <fcntl.h>
@@ -1949,8 +1953,20 @@ get_gui_compiled_info(GString *str)
}
static void
-get_gui_runtime_info(GString *str)
+get_wireshark_runtime_info(GString *str)
{
+#ifdef HAVE_LIBPCAP
+ /* Libpcap */
+ g_string_append(str, ", ");
+ get_runtime_pcap_version(str);
+#endif
+
+ /* zlib */
+#if defined(HAVE_LIBZ) && !defined(_WIN32)
+ g_string_append_printf(str, ", with libz %s", zlibVersion());
+#endif
+
+ /* stuff used by libwireshark */
epan_get_runtime_version_info(str);
#ifdef HAVE_AIRPCAP
@@ -2251,7 +2267,7 @@ main(int argc, char *argv[])
/* Assemble the run-time version information string */
runtime_info_str = g_string_new("Running ");
- get_runtime_version_info(runtime_info_str, get_gui_runtime_info);
+ get_runtime_version_info(runtime_info_str, get_wireshark_runtime_info);
#ifdef _WIN32
ws_add_crash_info(PACKAGE " %s\n"
diff --git a/ui/qt/main.cpp b/ui/qt/main.cpp
index 19087c5789..52bbb7ffb9 100644
--- a/ui/qt/main.cpp
+++ b/ui/qt/main.cpp
@@ -31,6 +31,10 @@
#include <signal.h>
+#ifdef HAVE_LIBZ
+#include <zlib.h> /* to get the libz version number */
+#endif
+
#ifndef HAVE_GETOPT
# include "wsutil/wsgetopt.h"
#else
@@ -419,7 +423,7 @@ get_gui_compiled_info(GString *str)
g_string_append(str, ", ");
g_string_append(str, "without PortAudio");
- g_string_append(str, ", ");
+ g_string_append(str, ", ");
#ifdef HAVE_AIRPCAP
get_compiled_airpcap_version(str);
#else
@@ -429,8 +433,18 @@ get_gui_compiled_info(GString *str)
// xxx copied from ../gtk/main.c
static void
-get_gui_runtime_info(GString *str)
+get_wireshark_runtime_info(GString *str)
{
+ /* Libpcap */
+ g_string_append(str, ", ");
+ get_runtime_pcap_version(str);
+
+ /* zlib */
+#if defined(HAVE_LIBZ) && !defined(_WIN32)
+ g_string_append_printf(str, ", with libz %s", zlibVersion());
+#endif
+
+ /* stuff used by libwireshark */
epan_get_runtime_version_info(str);
#ifdef HAVE_AIRPCAP
@@ -438,12 +452,10 @@ get_gui_runtime_info(GString *str)
get_runtime_airpcap_version(str);
#endif
-
if(u3_active()) {
g_string_append(str, ", ");
u3_runtime_info(str);
}
-
}
/* And now our feature presentation... [ fade to music ] */
@@ -520,7 +532,7 @@ int main(int argc, char *argv[])
/* Assemble the run-time version information string */
runtime_info_str = g_string_new("Running ");
// xxx qtshark
- get_runtime_version_info(runtime_info_str, get_gui_runtime_info);
+ get_runtime_version_info(runtime_info_str, get_wireshark_runtime_info);
ws_add_crash_info(PACKAGE " %s\n"
"\n"