diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2016-09-22 13:23:37 +0200 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2016-09-23 08:13:43 +0000 |
commit | 0703c7b4145f1ec23172b261356ca65bb17d12dc (patch) | |
tree | fc45171b65a56537b30534539480c999e6521b62 /ws_version_info.c | |
parent | 00c862e4056be43d91beb2c6b66b996140e5d280 (diff) | |
download | wireshark-0703c7b4145f1ec23172b261356ca65bb17d12dc.tar.gz |
dumpcap: Include CPU info as hardware description in SHB
Add CPU info as hardware description in session header block when
using pcapng.
Use capture_comment from the capture_options structure when using
ring buffer.
Change-Id: I5e688fc2d6ab61de1f64ad9a8a96e6e39e8cf708
Reviewed-on: https://code.wireshark.org/review/17862
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'ws_version_info.c')
-rw-r--r-- | ws_version_info.c | 40 |
1 files changed, 2 insertions, 38 deletions
diff --git a/ws_version_info.c b/ws_version_info.c index 036956aa7b..436d33248a 100644 --- a/ws_version_info.c +++ b/ws_version_info.c @@ -41,7 +41,7 @@ #include "ws_version_info.h" -#include <wsutil/ws_cpuid.h> +#include <wsutil/cpu_info.h> #include <wsutil/copyright_info.h> #include <wsutil/os_version_info.h> #include <wsutil/ws_printf.h> /* ws_debug_printf */ @@ -143,42 +143,6 @@ get_compiled_version_info(void (*prepend_info)(GString *), return str; } -/* - * Get the CPU info, and append it to the GString - */ -static void -get_cpu_info(GString *str) -{ - guint32 CPUInfo[4]; - char CPUBrandString[0x40]; - unsigned nExIds; - - /* http://msdn.microsoft.com/en-us/library/hskdteyh(v=vs.100).aspx */ - - /* Calling __cpuid with 0x80000000 as the InfoType argument*/ - /* gets the number of valid extended IDs.*/ - if (!ws_cpuid(CPUInfo, 0x80000000)) - return; - nExIds = CPUInfo[0]; - - if( nExIds<0x80000005) - return; - memset(CPUBrandString, 0, sizeof(CPUBrandString)); - - /* Interpret CPU brand string.*/ - ws_cpuid(CPUInfo, 0x80000002); - memcpy(CPUBrandString, CPUInfo, sizeof(CPUInfo)); - ws_cpuid(CPUInfo, 0x80000003); - memcpy(CPUBrandString + 16, CPUInfo, sizeof(CPUInfo)); - ws_cpuid(CPUInfo, 0x80000004); - memcpy(CPUBrandString + 32, CPUInfo, sizeof(CPUInfo)); - - g_string_append_printf(str, "\n%s", CPUBrandString); - - if (ws_cpuid_sse42()) - g_string_append(str, " (with SSE4.2)"); -} - static void get_mem_info(GString *str _U_) { @@ -356,7 +320,7 @@ get_runtime_version_info(void (*additional_info)(GString *)) g_string_append_printf(str, ", with zlib %s", zlibVersion()); #endif - g_string_append(str, "."); + g_string_append(str, ".\n"); /* CPU Info */ get_cpu_info(str); |