aboutsummaryrefslogtreecommitdiffstats
path: root/tshark.c
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 /tshark.c
parentdd7134d907350ccc574cdec596f4162860912bb9 (diff)
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 'tshark.c')
-rw-r--r--tshark.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/tshark.c b/tshark.c
index 70db566b68..e4c9a98a65 100644
--- a/tshark.c
+++ b/tshark.c
@@ -51,6 +51,10 @@
# include <sys/stat.h>
#endif
+#ifdef HAVE_LIBZ
+#include <zlib.h> /* to get the libz version number */
+#endif
+
#ifndef HAVE_GETOPT
#include "wsutil/wsgetopt.h"
#endif
@@ -918,6 +922,24 @@ show_version(GString *comp_info_str, GString *runtime_info_str)
runtime_info_str->str);
}
+static void
+get_tshark_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);
+}
+
int
main(int argc, char *argv[])
{
@@ -989,7 +1011,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, NULL);
+ get_runtime_version_info(runtime_info_str, get_tshark_runtime_info);
/* Add it to the information to be reported on a crash. */
ws_add_crash_info("TShark %s\n"