X-Git-Url: http://git.samba.org/samba.git/?a=blobdiff_plain;f=version_info.c;h=065cbd2eae78f8c7a8cc5372132b90581c63246c;hb=edd92458f6a38fdc34f8fcc51b7b7f4b043b5b6f;hp=52836f2b8f3bf76eb9f66e5d2c7d7556347d2bb8;hpb=831d1451d42f58e4d943fa969a8e9c42eb356eb7;p=obnox%2Fwireshark%2Fwip.git diff --git a/version_info.c b/version_info.c index 52836f2b8f..065cbd2eae 100644 --- a/version_info.c +++ b/version_info.c @@ -33,6 +33,10 @@ #include #include +#ifdef HAVE_PYTHON +#include /* to get the Python version number (PY_VERSION) */ +#endif + #ifdef HAVE_LIBZ #include /* to get the libz version number */ #endif @@ -41,10 +45,6 @@ #include /* to get the libpcre version number */ #endif /* HAVE_LIBPCRE */ -#if (defined(HAVE_LIBGCRYPT) || defined(HAVE_LIBGNUTLS)) && defined(_WIN32) -#include -#endif - #ifdef HAVE_LIBGCRYPT #include #endif /* HAVE_LIBGCRYPT */ @@ -88,11 +88,11 @@ #endif #ifdef HAVE_GEOIP -#include +#include #endif #ifdef SVNVERSION - const char *wireshark_svnversion = " (" SVNVERSION ")"; + const char *wireshark_svnversion = " (" SVNVERSION " from " SVNPATH ")"; #else const char *wireshark_svnversion = ""; #endif @@ -182,7 +182,7 @@ get_compiled_version_info(GString *str, void (*additional_info)(GString *)) (*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, "."); @@ -248,6 +248,16 @@ get_epan_compiled_version_info(GString *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 @@ -297,11 +307,12 @@ get_runtime_version_info(GString *str, void (*additional_info)(GString *)) { #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 "); @@ -324,6 +335,8 @@ get_runtime_version_info(GString *str, void (*additional_info)(GString *)) * 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)) { /* @@ -332,6 +345,10 @@ get_runtime_version_info(GString *str, void (*additional_info)(GString *)) 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: @@ -396,28 +413,55 @@ get_runtime_version_info(GString *str, void (*additional_info)(GString *)) 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: - if (info.wProductType == VER_NT_WORKSTATION) - g_string_append_printf(str, "Windows Vista"); - else - g_string_append_printf(str, "Windows Server 2008"); - break; + 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 + is_nt_workstation = ((info.wReserved[1] & 0xff) == VER_NT_WORKSTATION); +#else + is_nt_workstation = (info.wProductType == VER_NT_WORKSTATION); +#endif + 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: @@ -468,12 +512,12 @@ get_runtime_version_info(GString *str, void (*additional_info)(GString *)) 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. */ } @@ -487,6 +531,16 @@ get_runtime_version_info(GString *str, void (*additional_info)(GString *)) g_string_append(str, ", "); get_runtime_pcap_version(str); + /* GnuTLS */ +#ifdef HAVE_LIBGNUTLS + g_string_append_printf(str, ", GnuTLS %s", gnutls_check_version(NULL)); +#endif /* HAVE_LIBGNUTLS */ + + /* Gcrypt */ +#ifdef HAVE_LIBGCRYPT + g_string_append_printf(str, ", Gcrypt %s", gcry_check_version(NULL)); +#endif /* HAVE_LIBGCRYPT */ + /* Additional application-dependent information */ if (additional_info) (*additional_info)(str); @@ -568,7 +622,7 @@ const char * get_copyright_info(void) { return -"Copyright 1998-2008 Gerald Combs and contributors.\n" +"Copyright 1998-2010 Gerald Combs 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"; }