# include "config.h"
#endif
+#ifdef HAVE_PYTHON
+#include <Python.h> /* to get the Python version number (PY_VERSION) */
+#endif
+
#include <glib.h>
#include <stdlib.h>
#include <pcre.h> /* to get the libpcre version number */
#endif /* HAVE_LIBPCRE */
-#if (defined(HAVE_LIBGCRYPT) || defined(HAVE_LIBGNUTLS)) && defined(_WIN32)
-#include <winposixtype.h>
-#endif
-
#ifdef HAVE_LIBGCRYPT
#include <gcrypt.h>
#endif /* HAVE_LIBGCRYPT */
#endif
#ifdef SVNVERSION
- const char *wireshark_svnversion = " (" SVNVERSION ")";
+ const char *wireshark_svnversion = " (" SVNVERSION " from " SVNPATH ")";
#else
const char *wireshark_svnversion = "";
#endif
void
get_compiled_version_info(GString *str, void (*additional_info)(GString *))
{
+ if (sizeof(str) == 4)
+ g_string_append(str, "(32-bit) ");
+ else
+ g_string_append(str, "(64-bit) ");
+
/* GLIB */
g_string_append(str, "with ");
g_string_append_printf(str,
(*additional_info)(str);
g_string_append(str, ".");
-#ifndef HAVE_LIBPCRE
+#if !defined(HAVE_LIBPCRE) && !GLIB_CHECK_VERSION(2,14,0)
g_string_append(str,
"\nNOTE: this build doesn't support the \"matches\" operator for Wireshark filter syntax");
g_string_append(str, ".");
g_string_append(str, "without Lua");
#endif /* HAVE_LUA_5_1 */
+ g_string_append(str, ", ");
+#ifdef HAVE_PYTHON
+ g_string_append(str, "with Python");
+#ifdef PY_VERSION
+ g_string_append(str, " " PY_VERSION);
+#endif /* PY_VERSION */
+#else
+ g_string_append(str, "without Python");
+#endif /* HAVE_PYTHON */
+
/* GnuTLS */
g_string_append(str, ", ");
#ifdef HAVE_LIBGNUTLS
{
#if defined(_WIN32)
OSVERSIONINFOEX info;
+ SYSTEM_INFO system_info;
#elif defined(HAVE_SYS_UTSNAME_H)
struct utsname name;
#endif
#if HAVE_OS_X_FRAMEWORKS
- long macosx_ver, macosx_major_ver, macosx_minor_ver, macosx_bugfix_ver;
+ SInt32 macosx_ver, macosx_major_ver, macosx_minor_ver, macosx_bugfix_ver;
#endif
g_string_append(str, "on ");
* not even be able to compile code that *uses* that structure with
* older versions of the SDK.
*/
+
+ memset(&info, '\0', sizeof info);
info.dwOSVersionInfoSize = sizeof info;
if (!GetVersionEx((OSVERSIONINFO *)&info)) {
/*
g_string_append(str, "unknown Windows version");
return;
}
+
+ memset(&system_info, '\0', sizeof system_info);
+ GetSystemInfo(&system_info); /* only for W2K or greater .... (which is what we support) */
+
switch (info.dwPlatformId) {
case VER_PLATFORM_WIN32s:
break;
case 2:
- g_string_append_printf(str, "Windows Server 2003");
+ if ((info.wProductType == VER_NT_WORKSTATION) &&
+ (system_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)) {
+ g_string_append_printf(str, "Windows XP Professional x64 Edition");
+ } else {
+ g_string_append_printf(str, "Windows Server 2003");
+ if (system_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
+ g_string_append_printf(str, " x64 Edition");
+ }
break;
default:
g_string_append_printf(str, "Windows NT, unknown version %lu.%lu",
- info.dwMajorVersion, info.dwMinorVersion);
+ info.dwMajorVersion, info.dwMinorVersion);
break;
}
break;
- case 6:
+ case 6: {
+ gboolean is_nt_workstation;
+
+ if (system_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
+ g_string_append(str, "64-bit ");
+ else if (system_info.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
+ g_string_append(str, "32-bit ");
#ifndef VER_NT_WORKSTATION
#define VER_NT_WORKSTATION 0x01
- if ((info.wReserved[1] & 0xff) == VER_NT_WORKSTATION)
+ is_nt_workstation = ((info.wReserved[1] & 0xff) == VER_NT_WORKSTATION);
#else
- if (info.wProductType == VER_NT_WORKSTATION)
+ is_nt_workstation = (info.wProductType == VER_NT_WORKSTATION);
#endif
- g_string_append_printf(str, "Windows Vista");
- else
- g_string_append_printf(str, "Windows Server 2008");
+ switch (info.dwMinorVersion) {
+ case 0:
+ g_string_append_printf(str, is_nt_workstation ? "Windows Vista" : "Windows Server 2008");
+ break;
+ case 1:
+ g_string_append_printf(str, is_nt_workstation ? "Windows 7" : "Windows Server 2008 R2");
+ break;
+ default:
+ g_string_append_printf(str, "Windows NT, unknown version %lu.%lu",
+ info.dwMajorVersion, info.dwMinorVersion);
+ break;
+ }
break;
-
+ } /* case 6 */
default:
g_string_append_printf(str, "Windows NT, unknown version %lu.%lu",
info.dwMajorVersion, info.dwMinorVersion);
break;
- }
+ } /* info.dwMajorVersion */
break;
default:
Gestalt(gestaltSystemVersionBugFix, &macosx_bugfix_ver);
g_string_append_printf(str, " (MacOS %ld.%ld.%ld)",
- macosx_major_ver,
- macosx_minor_ver,
- macosx_bugfix_ver);
+ (long)macosx_major_ver,
+ (long)macosx_minor_ver,
+ (long)macosx_bugfix_ver);
} else {
g_string_append_printf(str, " (MacOS X < 10.4 [%lx])",
- macosx_ver);
+ (long)macosx_ver);
/* See Apple's Gestalt Manager Reference for meanings
* of the macosx_ver values. */
}
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
+
/* GnuTLS */
#ifdef HAVE_LIBGNUTLS
g_string_append_printf(str, ", GnuTLS %s", gnutls_check_version(NULL));
get_copyright_info(void)
{
return
-"Copyright 1998-2009 Gerald Combs <gerald@wireshark.org> and contributors.\n"
+"Copyright 1998-2010 Gerald Combs <gerald@wireshark.org> and contributors.\n"
"This is free software; see the source for copying conditions. There is NO\n"
"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
}