aboutsummaryrefslogtreecommitdiffstats
path: root/dumpcap.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 /dumpcap.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 'dumpcap.c')
-rw-r--r--dumpcap.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/dumpcap.c b/dumpcap.c
index f25d6f060d..1e21f56454 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -67,6 +67,10 @@
#include <signal.h>
#include <errno.h>
+#ifdef HAVE_LIBZ
+#include <zlib.h> /* to get the libz version number */
+#endif
+
#include <wsutil/crash_info.h>
#include <wsutil/copyright_info.h>
#include <wsutil/ws_version_info.h>
@@ -4172,6 +4176,19 @@ out:
return ret;
}
+static void
+get_dumpcap_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
+}
+
/* And now our feature presentation... [ fade to music ] */
int
main(int argc, char *argv[])
@@ -4221,7 +4238,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_dumpcap_runtime_info);
/* Add it to the information to be reported on a crash. */
ws_add_crash_info("Dumpcap %s\n"