diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-06-23 14:55:56 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-06-23 21:56:42 +0000 |
commit | 1d92195de847a30e570ca690ab0a2034cb3a51d3 (patch) | |
tree | 95b000735679f0b957b8c9eecc9ad4d700ea4efc /dumpcap.c | |
parent | dd7134d907350ccc574cdec596f4162860912bb9 (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.c | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -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" |