forked from osmocom/wireshark
Move zlib version check to wsutil
Change-Id: I0950f61e90af5bb21c0017204de0c0b509616e5c Reviewed-on: https://code.wireshark.org/review/14747 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
parent
a14e7a7ce1
commit
f95976eefc
39
capinfos.c
39
capinfos.c
|
@ -69,10 +69,6 @@
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
|
||||||
#include <zlib.h> /* to get the libz version number */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <wiretap/wtap.h>
|
#include <wiretap/wtap.h>
|
||||||
|
|
||||||
#include <wsutil/crash_info.h>
|
#include <wsutil/crash_info.h>
|
||||||
|
@ -1366,37 +1362,6 @@ hash_to_str(const unsigned char *hash, size_t length, char *str) {
|
||||||
}
|
}
|
||||||
#endif /* HAVE_LIBGCRYPT */
|
#endif /* HAVE_LIBGCRYPT */
|
||||||
|
|
||||||
static void
|
|
||||||
get_capinfos_compiled_info(GString *str)
|
|
||||||
{
|
|
||||||
/* 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 */
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
get_capinfos_runtime_info(
|
|
||||||
#if defined(HAVE_LIBZ) && !defined(_WIN32)
|
|
||||||
GString *str)
|
|
||||||
#else
|
|
||||||
GString *str _U_)
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
/* zlib */
|
|
||||||
#if defined(HAVE_LIBZ) && !defined(_WIN32)
|
|
||||||
g_string_append_printf(str, ", with libz %s", zlibVersion());
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
@ -1428,10 +1393,10 @@ main(int argc, char *argv[])
|
||||||
setlocale(LC_ALL, "");
|
setlocale(LC_ALL, "");
|
||||||
|
|
||||||
/* Get the compile-time version information string */
|
/* Get the compile-time version information string */
|
||||||
comp_info_str = get_compiled_version_info(NULL, get_capinfos_compiled_info);
|
comp_info_str = get_compiled_version_info(NULL, NULL);
|
||||||
|
|
||||||
/* Get the run-time version information string */
|
/* Get the run-time version information string */
|
||||||
runtime_info_str = get_runtime_version_info(get_capinfos_runtime_info);
|
runtime_info_str = get_runtime_version_info(NULL);
|
||||||
|
|
||||||
/* Add it to the information to be reported on a crash. */
|
/* Add it to the information to be reported on a crash. */
|
||||||
ws_add_crash_info("Capinfos (Wireshark) %s\n"
|
ws_add_crash_info("Capinfos (Wireshark) %s\n"
|
||||||
|
|
39
captype.c
39
captype.c
|
@ -36,10 +36,6 @@
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
|
||||||
#include <zlib.h> /* to get the libz version number */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
#include <wiretap/wtap.h>
|
#include <wiretap/wtap.h>
|
||||||
|
@ -86,37 +82,6 @@ failure_message(const char *msg_format _U_, va_list ap _U_)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void
|
|
||||||
get_captype_compiled_info(GString *str)
|
|
||||||
{
|
|
||||||
/* 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 */
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
get_captype_runtime_info(
|
|
||||||
#if defined(HAVE_LIBZ) && !defined(_WIN32)
|
|
||||||
GString *str)
|
|
||||||
#else
|
|
||||||
GString *str _U_)
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
/* zlib */
|
|
||||||
#if defined(HAVE_LIBZ) && !defined(_WIN32)
|
|
||||||
g_string_append_printf(str, ", with libz %s", zlibVersion());
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
@ -142,10 +107,10 @@ main(int argc, char *argv[])
|
||||||
setlocale(LC_ALL, "");
|
setlocale(LC_ALL, "");
|
||||||
|
|
||||||
/* Get the compile-time version information string */
|
/* 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 */
|
/* 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. */
|
/* Add it to the information to be reported on a crash. */
|
||||||
ws_add_crash_info("Captype (Wireshark) %s\n"
|
ws_add_crash_info("Captype (Wireshark) %s\n"
|
||||||
|
|
22
dumpcap.c
22
dumpcap.c
|
@ -54,10 +54,6 @@
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
|
||||||
#include <zlib.h> /* to get the libz version number */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <wsutil/cmdarg_err.h>
|
#include <wsutil/cmdarg_err.h>
|
||||||
#include <wsutil/crash_info.h>
|
#include <wsutil/crash_info.h>
|
||||||
#include <wsutil/ws_diag_control.h>
|
#include <wsutil/ws_diag_control.h>
|
||||||
|
@ -3706,19 +3702,6 @@ get_dumpcap_compiled_info(GString *str)
|
||||||
/* Capture libraries */
|
/* Capture libraries */
|
||||||
g_string_append(str, ", ");
|
g_string_append(str, ", ");
|
||||||
get_compiled_caplibs_version(str);
|
get_compiled_caplibs_version(str);
|
||||||
|
|
||||||
/* 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 */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -3727,11 +3710,6 @@ get_dumpcap_runtime_info(GString *str)
|
||||||
/* Capture libraries */
|
/* Capture libraries */
|
||||||
g_string_append(str, ", ");
|
g_string_append(str, ", ");
|
||||||
get_runtime_caplibs_version(str);
|
get_runtime_caplibs_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 ] */
|
/* And now our feature presentation... [ fade to music ] */
|
||||||
|
|
39
editcap.c
39
editcap.c
|
@ -54,10 +54,6 @@
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
|
||||||
#include <zlib.h> /* to get the libz version number */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <wiretap/wtap.h>
|
#include <wiretap/wtap.h>
|
||||||
|
|
||||||
#include "epan/etypes.h"
|
#include "epan/etypes.h"
|
||||||
|
@ -908,37 +904,6 @@ failure_message(const char *msg_format _U_, va_list ap _U_)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void
|
|
||||||
get_editcap_compiled_info(GString *str)
|
|
||||||
{
|
|
||||||
/* 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 */
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
get_editcap_runtime_info(
|
|
||||||
#if defined(HAVE_LIBZ) && !defined(_WIN32)
|
|
||||||
GString *str)
|
|
||||||
#else
|
|
||||||
GString *str _U_)
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
/* zlib */
|
|
||||||
#if defined(HAVE_LIBZ) && !defined(_WIN32)
|
|
||||||
g_string_append_printf(str, ", with libz %s", zlibVersion());
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static wtap_dumper *
|
static wtap_dumper *
|
||||||
editcap_dump_open(const char *filename, guint32 snaplen,
|
editcap_dump_open(const char *filename, guint32 snaplen,
|
||||||
wtap_optionblock_t shb_hdr,
|
wtap_optionblock_t shb_hdr,
|
||||||
|
@ -1017,10 +982,10 @@ main(int argc, char *argv[])
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
/* Get the compile-time version information string */
|
/* Get the compile-time version information string */
|
||||||
comp_info_str = get_compiled_version_info(NULL, get_editcap_compiled_info);
|
comp_info_str = get_compiled_version_info(NULL, NULL);
|
||||||
|
|
||||||
/* Get the run-time version information string */
|
/* Get the run-time version information string */
|
||||||
runtime_info_str = get_runtime_version_info(get_editcap_runtime_info);
|
runtime_info_str = get_runtime_version_info(NULL);
|
||||||
|
|
||||||
/* Add it to the information to be reported on a crash. */
|
/* Add it to the information to be reported on a crash. */
|
||||||
ws_add_crash_info("Editcap (Wireshark) %s\n"
|
ws_add_crash_info("Editcap (Wireshark) %s\n"
|
||||||
|
|
40
mergecap.c
40
mergecap.c
|
@ -34,10 +34,6 @@
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
|
||||||
#include <zlib.h> /* to get the libz version number */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <wiretap/wtap.h>
|
#include <wiretap/wtap.h>
|
||||||
|
@ -177,38 +173,6 @@ list_idb_merge_modes(void) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
get_mergecap_compiled_info(GString *str)
|
|
||||||
{
|
|
||||||
/* 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 */
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
get_mergecap_runtime_info(
|
|
||||||
#if defined(HAVE_LIBZ) && !defined(_WIN32)
|
|
||||||
GString *str)
|
|
||||||
#else
|
|
||||||
GString *str _U_)
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
/* zlib */
|
|
||||||
#if defined(HAVE_LIBZ) && !defined(_WIN32)
|
|
||||||
g_string_append_printf(str, ", with libz %s", zlibVersion());
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
merge_callback(merge_event event, int num,
|
merge_callback(merge_event event, int num,
|
||||||
const merge_in_file_t in_files[], const guint in_file_count,
|
const merge_in_file_t in_files[], const guint in_file_count,
|
||||||
|
@ -317,10 +281,10 @@ main(int argc, char *argv[])
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
/* Get the compile-time version information string */
|
/* Get the compile-time version information string */
|
||||||
comp_info_str = get_compiled_version_info(NULL, get_mergecap_compiled_info);
|
comp_info_str = get_compiled_version_info(NULL, NULL);
|
||||||
|
|
||||||
/* Get the run-time version information string */
|
/* Get the run-time version information string */
|
||||||
runtime_info_str = get_runtime_version_info(get_mergecap_runtime_info);
|
runtime_info_str = get_runtime_version_info(NULL);
|
||||||
|
|
||||||
/* Add it to the information to be reported on a crash. */
|
/* Add it to the information to be reported on a crash. */
|
||||||
ws_add_crash_info("Mergecap (Wireshark) %s\n"
|
ws_add_crash_info("Mergecap (Wireshark) %s\n"
|
||||||
|
|
39
reordercap.c
39
reordercap.c
|
@ -32,10 +32,6 @@
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
|
||||||
#include <zlib.h> /* to get the libz version number */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <wiretap/wtap.h>
|
#include <wiretap/wtap.h>
|
||||||
|
|
||||||
#ifndef HAVE_GETOPT_LONG
|
#ifndef HAVE_GETOPT_LONG
|
||||||
|
@ -151,37 +147,6 @@ frames_compare(gconstpointer a, gconstpointer b)
|
||||||
return nstime_cmp(time1, time2);
|
return nstime_cmp(time1, time2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
get_reordercap_compiled_info(GString *str)
|
|
||||||
{
|
|
||||||
/* 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 */
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
get_reordercap_runtime_info(
|
|
||||||
#if defined(HAVE_LIBZ) && !defined(_WIN32)
|
|
||||||
GString *str)
|
|
||||||
#else
|
|
||||||
GString *str _U_)
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
/* zlib */
|
|
||||||
#if defined(HAVE_LIBZ) && !defined(_WIN32)
|
|
||||||
g_string_append_printf(str, ", with libz %s", zlibVersion());
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HAVE_PLUGINS
|
#ifdef HAVE_PLUGINS
|
||||||
/*
|
/*
|
||||||
* Don't report failures to load plugins because most (non-wiretap) plugins
|
* Don't report failures to load plugins because most (non-wiretap) plugins
|
||||||
|
@ -236,10 +201,10 @@ main(int argc, char *argv[])
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Get the compile-time version information string */
|
/* Get the compile-time version information string */
|
||||||
comp_info_str = get_compiled_version_info(NULL, get_reordercap_compiled_info);
|
comp_info_str = get_compiled_version_info(NULL, NULL);
|
||||||
|
|
||||||
/* Get the run-time version information string */
|
/* Get the run-time version information string */
|
||||||
runtime_info_str = get_runtime_version_info(get_reordercap_runtime_info);
|
runtime_info_str = get_runtime_version_info(NULL);
|
||||||
|
|
||||||
/* Add it to the information to be reported on a crash. */
|
/* Add it to the information to be reported on a crash. */
|
||||||
ws_add_crash_info("Reordercap (Wireshark) %s\n"
|
ws_add_crash_info("Reordercap (Wireshark) %s\n"
|
||||||
|
|
34
text2pcap.c
34
text2pcap.c
|
@ -126,10 +126,6 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
|
||||||
#include <zlib.h> /* to get the libz version number */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef HAVE_GETOPT_LONG
|
#ifndef HAVE_GETOPT_LONG
|
||||||
#include "wsutil/wsgetopt.h"
|
#include "wsutil/wsgetopt.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -1438,32 +1434,6 @@ print_usage (FILE *output)
|
||||||
MAX_PACKET);
|
MAX_PACKET);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
get_text2pcap_compiled_info(GString *str)
|
|
||||||
{
|
|
||||||
/* 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 */
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
get_text2pcap_runtime_info(GString *str)
|
|
||||||
{
|
|
||||||
/* zlib */
|
|
||||||
#if defined(HAVE_LIBZ) && !defined(_WIN32)
|
|
||||||
g_string_append_printf(str, ", with libz %s", zlibVersion());
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
* Parse CLI options
|
* Parse CLI options
|
||||||
*/
|
*/
|
||||||
|
@ -1486,10 +1456,10 @@ parse_options (int argc, char *argv[])
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
/* Get the compile-time version information string */
|
/* Get the compile-time version information string */
|
||||||
comp_info_str = get_compiled_version_info(NULL, get_text2pcap_compiled_info);
|
comp_info_str = get_compiled_version_info(NULL, NULL);
|
||||||
|
|
||||||
/* get the run-time version information string */
|
/* get the run-time version information string */
|
||||||
runtime_info_str = get_runtime_version_info(get_text2pcap_runtime_info);
|
runtime_info_str = get_runtime_version_info(NULL);
|
||||||
|
|
||||||
/* Add it to the information to be reported on a crash. */
|
/* Add it to the information to be reported on a crash. */
|
||||||
ws_add_crash_info("Text2pcap (Wireshark) %s\n"
|
ws_add_crash_info("Text2pcap (Wireshark) %s\n"
|
||||||
|
|
28
tfshark.c
28
tfshark.c
|
@ -35,10 +35,6 @@
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
|
||||||
#include <zlib.h> /* to get the libz version number */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef HAVE_GETOPT_LONG
|
#ifndef HAVE_GETOPT_LONG
|
||||||
#include "wsutil/wsgetopt.h"
|
#include "wsutil/wsgetopt.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -726,30 +722,9 @@ print_current_user(void) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
get_tfshark_compiled_version_info(GString *str)
|
|
||||||
{
|
|
||||||
/* LIBZ */
|
|
||||||
#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 */
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_tfshark_runtime_version_info(GString *str)
|
get_tfshark_runtime_version_info(GString *str)
|
||||||
{
|
{
|
||||||
/* zlib */
|
|
||||||
#if defined(HAVE_LIBZ) && !defined(_WIN32)
|
|
||||||
g_string_append_printf(str, ", with libz %s", zlibVersion());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* stuff used by libwireshark */
|
/* stuff used by libwireshark */
|
||||||
epan_get_runtime_version_info(str);
|
epan_get_runtime_version_info(str);
|
||||||
}
|
}
|
||||||
|
@ -844,8 +819,7 @@ main(int argc, char *argv[])
|
||||||
initialize_funnel_ops();
|
initialize_funnel_ops();
|
||||||
|
|
||||||
/* Get the compile-time version information string */
|
/* Get the compile-time version information string */
|
||||||
comp_info_str = get_compiled_version_info(get_tfshark_compiled_version_info,
|
comp_info_str = get_compiled_version_info(NULL, epan_get_compiled_version_info);
|
||||||
epan_get_compiled_version_info);
|
|
||||||
|
|
||||||
/* Get the run-time version information string */
|
/* Get the run-time version information string */
|
||||||
runtime_info_str = get_runtime_version_info(get_tfshark_runtime_version_info);
|
runtime_info_str = get_runtime_version_info(get_tfshark_runtime_version_info);
|
||||||
|
|
22
tshark.c
22
tshark.c
|
@ -40,10 +40,6 @@
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
|
||||||
#include <zlib.h> /* to get the libz version number */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_LIBCAP
|
#ifdef HAVE_LIBCAP
|
||||||
# include <sys/capability.h>
|
# include <sys/capability.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -921,19 +917,6 @@ get_tshark_compiled_version_info(GString *str)
|
||||||
{
|
{
|
||||||
/* Capture libraries */
|
/* Capture libraries */
|
||||||
get_compiled_caplibs_version(str);
|
get_compiled_caplibs_version(str);
|
||||||
|
|
||||||
/* 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 */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -945,11 +928,6 @@ get_tshark_runtime_version_info(GString *str)
|
||||||
get_runtime_caplibs_version(str);
|
get_runtime_caplibs_version(str);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* zlib */
|
|
||||||
#if defined(HAVE_LIBZ) && !defined(_WIN32)
|
|
||||||
g_string_append_printf(str, ", with libz %s", zlibVersion());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* stuff used by libwireshark */
|
/* stuff used by libwireshark */
|
||||||
epan_get_runtime_version_info(str);
|
epan_get_runtime_version_info(str);
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,10 +44,6 @@
|
||||||
#include "wsutil/wsgetopt.h"
|
#include "wsutil/wsgetopt.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
|
||||||
#include <zlib.h> /* to get the libz version number */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_EXTCAP
|
#ifdef HAVE_EXTCAP
|
||||||
#include <extcap.h>
|
#include <extcap.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -1969,19 +1965,6 @@ get_wireshark_gtk_compiled_info(GString *str)
|
||||||
/* Capture libraries */
|
/* Capture libraries */
|
||||||
g_string_append(str, ", ");
|
g_string_append(str, ", ");
|
||||||
get_compiled_caplibs_version(str);
|
get_compiled_caplibs_version(str);
|
||||||
|
|
||||||
/* 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 */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -2018,11 +2001,6 @@ get_wireshark_runtime_info(GString *str)
|
||||||
get_runtime_caplibs_version(str);
|
get_runtime_caplibs_version(str);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* zlib */
|
|
||||||
#if defined(HAVE_LIBZ) && !defined(_WIN32)
|
|
||||||
g_string_append_printf(str, ", with libz %s", zlibVersion());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* stuff used by libwireshark */
|
/* stuff used by libwireshark */
|
||||||
epan_get_runtime_version_info(str);
|
epan_get_runtime_version_info(str);
|
||||||
|
|
||||||
|
|
|
@ -27,10 +27,6 @@
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
|
||||||
#include <zlib.h> /* to get the libz version number */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_GETOPT_H
|
#ifdef HAVE_GETOPT_H
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -311,19 +307,6 @@ get_wireshark_qt_compiled_info(GString *str)
|
||||||
/* Capture libraries */
|
/* Capture libraries */
|
||||||
g_string_append(str, ", ");
|
g_string_append(str, ", ");
|
||||||
get_compiled_caplibs_version(str);
|
get_compiled_caplibs_version(str);
|
||||||
|
|
||||||
/* 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 */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// xxx copied from ../gtk/main.c
|
// xxx copied from ../gtk/main.c
|
||||||
|
@ -357,11 +340,6 @@ get_wireshark_runtime_info(GString *str)
|
||||||
get_runtime_caplibs_version(str);
|
get_runtime_caplibs_version(str);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* zlib */
|
|
||||||
#if defined(HAVE_LIBZ) && !defined(_WIN32)
|
|
||||||
g_string_append_printf(str, ", with libz %s", zlibVersion());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* stuff used by libwireshark */
|
/* stuff used by libwireshark */
|
||||||
epan_get_runtime_version_info(str);
|
epan_get_runtime_version_info(str);
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,10 @@
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBZ
|
||||||
|
#include <zlib.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
#include <wsutil/ws_version_info.h>
|
#include <wsutil/ws_version_info.h>
|
||||||
|
@ -71,6 +75,20 @@ end_string(GString *str)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const gchar *
|
||||||
|
get_zlib_compiled_version_info(void)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_LIBZ
|
||||||
|
#ifdef ZLIB_VERSION
|
||||||
|
return "with libz "ZLIB_VERSION;
|
||||||
|
#else
|
||||||
|
return "with libz (version unknown)";
|
||||||
|
#endif /* ZLIB_VERSION */
|
||||||
|
#else
|
||||||
|
return "without libz";
|
||||||
|
#endif /* HAVE_LIBZ */
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get various library compile-time versions, put them in a GString,
|
* Get various library compile-time versions, put them in a GString,
|
||||||
* and return the GString.
|
* and return the GString.
|
||||||
|
@ -112,6 +130,8 @@ get_compiled_version_info(void (*prepend_info)(GString *),
|
||||||
"GLib (version unknown)");
|
"GLib (version unknown)");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
g_string_append_printf(str, ", %s", get_zlib_compiled_version_info());
|
||||||
|
|
||||||
/* Additional application-dependent information */
|
/* Additional application-dependent information */
|
||||||
if (append_info)
|
if (append_info)
|
||||||
(*append_info)(str);
|
(*append_info)(str);
|
||||||
|
@ -334,6 +354,11 @@ get_runtime_version_info(void (*additional_info)(GString *))
|
||||||
if (additional_info)
|
if (additional_info)
|
||||||
(*additional_info)(str);
|
(*additional_info)(str);
|
||||||
|
|
||||||
|
/* zlib */
|
||||||
|
#if defined(HAVE_LIBZ) && !defined(_WIN32)
|
||||||
|
g_string_append_printf(str, ", with libz %s", zlibVersion());
|
||||||
|
#endif
|
||||||
|
|
||||||
g_string_append(str, ".");
|
g_string_append(str, ".");
|
||||||
|
|
||||||
/* CPU Info */
|
/* CPU Info */
|
||||||
|
|
Loading…
Reference in New Issue