aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil
AgeCommit message (Collapse)AuthorFilesLines
2022-06-08dfilter: Make regex matches case insensitive by defaultJoão Valverde2-3/+23
2022-06-01cpuid: clean up, update. and expand some comments.Guy Harris2-7/+25
2022-06-01cpuid: don't use __cpuid on non-x86 Windows.Guy Harris1-0/+19
We aren't *yet* building ARM64 Wireshark for Windows, but throw in a bit of future-proofing. (I guess nobody ever built it for Itanium.)
2022-05-16extcap: Close pipe on windows properlyRoland Knall2-0/+23
Windows implements so called CRT handlers, which will catch any assertions happening inside so called crt routines and either displays a debug dialog (Cancel, Retry, Ignore) or outright crashes the application. See https://docs.microsoft.com/en-us/cpp/c-runtime-library/parameter-validation?view=msvc-170 for an explanation of the behaviour. Now, in the current situation here, close will detect (correctly) that the pipe it is supposed to be closing is already closed. This happens (again correctly) because it had been closed by the extcap application. The change added, checks for a closed pipe first, and if so just returns -1 (as it should) silently without calling the CRT routine, therefore not crashing
2022-04-29Fix "generated by" comments in configuration files.Gerald Combs2-3/+17
Add get_configuration_namespace() and use it in code that writes "generated by" comments at the top of various configuration files. Update our Logwolf colorfilters.
2022-04-22glib: Bump required version to 2.50John Thacker2-11/+1
All the currently supported distributions have at least 2.50. Remove a version check.
2022-04-21libgcrypt: Remove HAVE_GCRYPT_AEAD , _CHACHA20John Thacker1-15/+3
Libgcrypt 1.8.0 is required now, so these are always defined.
2022-04-20libgcrypt: Require version 1.8.0John Thacker4-34/+0
Libgcrypt 1.8.x is required for a large amount of decryption support and is the current LTS version of libgcrypt. The 1.6 and 1.7 series have been end-of-life since 2017-06-30 and 2019-06-30, respectively. The Linux distributions that have versions of libgcrypt before 1.8.0 are nearing or at end of support (RHEL7, SLES 12, Debian stretch, Ubuntu 16.04LTS) and can be supported by the Wireshark 3.6 LTS release series. Remove an enormous amount of ifdefs based on libgcrypt versions 1.6.0, 1.7.0, and 1.8.0. There will be a second pass for the commons defines HAVE_LIBGCRYPT_AEAD, HAVE_LIBGCRYPT_CHACHA20, and HAVE_LIBGCRYPT_CHACHA20_POLY1305, which are now always defined. The ISAKMP dissector has some comments noting that some workarounds were used for libgcrypt 1.6 that aren't needed with 1.7; perhaps that could be updated now.
2022-04-18Revert "wsutil: Use a separate "extlog" directory for Logwolf extcaps."Gerald Combs2-6/+4
This reverts commit 54553de59d24175ede07d3b423080cb9824c3360. As noted in !6694, it would probably make more sense to handle this a different way.
2022-04-11Try to fix a narrowing warningJoão Valverde2-2/+2
"C:\Development\wsbuild64\Wireshark.sln" (default target) (1) -> "C:\Development\wsbuild64\epan\dfilter\dfilter.vcxproj.metaproj" (default target) (18) -> "C:\Development\wsbuild64\epan\dfilter\dfilter.vcxproj" (default target) (108) -> (ClCompile target) -> C:/Development/wireshark/epan/dfilter/scanner.l(463,54): warning C4267: '+=': conversion from 'size_t' to 'int ', possible loss of data [C:\Development\wsbuild64\epan\dfilter\dfilter.vcxproj] C:/Development/wireshark/epan/dfilter/scanner.l(463,54): warning C4267: state->location.col_start += sta te->location.col_len; [C:\Development\wsbuild64\epan\dfilter\dfilter.vcxproj] C:/Development/wireshark/epan/dfilter/scanner.l(463,54): warning C4267: ^ (compiling source file C:\Development\wsbuild64\epan\dfilter\scanner.c) [C:\Development\ws build64\epan\dfilter\dfilter.vcxproj]
2022-04-11tshark: Add underline to dfilter errorsJoão Valverde2-0/+23
$ tshark -Y 'frame.number == 123foobar and ip' -r /dev/null tshark: "123foobar" is not a valid number. frame.number == 123foobar and ip ^~~~~~~~~
2022-04-07wsutil: Use a separate "extlog" directory for Logwolf extcaps.Gerald Combs2-4/+6
If we're running in the Logwolf configuration namespace, look for extcaps in a directory named "extlog". This paves the way for adding log-specific capture utilities.
2022-04-05wsutil: Use the correct variable.Gerald Combs1-2/+2
Check our configuration namespace, not its name.
2022-04-04wsutil: Add configuration namespaces.Gerald Combs3-33/+99
Rename init_progfile_dir to configuration_init. Add an argument which specifies our configuration namespace, which can be "Wireshark" (default) or "Logwolf".
2022-03-31safe-math: Remove unnecessary clutterJoão Valverde1-23/+0
2022-03-31safe-math: Fix non-existent built-insJoão Valverde1-2/+2
Divison and modulo are not built-ins implemented by GCC or Clang. Replace the spurious macro definition with the internal implementation.
2022-03-31dfilter: Add binary arithmetic (add/subtract)João Valverde1-0/+1071
Add support for display filter binary addition and subtraction. The grammar is intentionally kept simple for now. The use case is to add a constant to a protocol field, or (maybe) add two fields in an expression. We use signed arithmetic with unsigned numbers, checking for overflow and casting where necessary to do the conversion. We could legitimately opt to use traditional modular arithmetic instead (like C) and if it turns out that that is more useful for some reason we may want to in the future. Fixes #15504.
2022-03-26wslog: Refactor ws_log_set_fatal() for consistencyJoão Valverde2-12/+10
2022-03-10mpeg: handle the presence of an image in the ID3v2 header.Jeff Morriss2-0/+30
Fixes #17985.
2022-03-09Rename the "image" directory to "resources".Gerald Combs1-1/+1
The "image" directory contains resource compiler assets and other application resources, so name it "resources."
2022-03-03json_dumper: Adding support to dump JSON to GStringHuang Qiangxiong2-31/+84
2022-02-24Windows: Fix buildJoão Valverde1-1/+1
For some reason this was not caught by the CI.
2022-02-24wsutil: New API to gather compile/runtime infoDavid Perry3-0/+133
2022-02-09Specify directory for temporary capturesDavid Perry2-6/+61
2022-02-05wsutil: Just use g_utf8_validate for nowJohn Thacker1-1/+1
g_utf8_validate_len doesn't exist until glib 2.60, so just use g_utf8_validate. It does the same thing when the length parameter is unsigned. Fixes CentOS 7.
2022-02-06epan: Add BASE_SHOW_UTF_8_PRINTABLEJohn Thacker2-8/+34
Add BASE_SHOW_UTF_8_PRINTABLE and related function tvb_utf_8_isprint for supporting fields of bytes that are "maybe UTF-8" (default or SHOULD be UTF-8 but could be something else, with no encoding indicator), such as SSID fields in IEEE 802.11 (See #16208), certain OctetString fields in Diameter or PFCP, and other places where BASE_SHOW_ASCII_PRINTABLE is currently used. Fix #5307
2022-01-27Fix Linux build issuePaul Koning1-0/+1
This fixes an error due to memcpy not being declared. Closes #17911.
2022-01-05ws_assert: refactor assertionsJoão Valverde5-51/+27
2022-01-05wslog: Replace ws_assert()João Valverde1-1/+3
2022-01-05wslog: Convert to C99/POSIX typesJoão Valverde2-40/+39
2022-01-05Remove some circular dependencies on wireshark.hJoão Valverde5-8/+7
2022-01-05wslog: Rewrite macrosJoão Valverde2-56/+71
2022-01-05wslog: Use a wider type for lineJoão Valverde4-18/+18
2022-01-03nstime: "localtime()" is an API, "local time" is local time.Guy Harris1-2/+2
2022-01-01Happy New Year 2022Stig Bjørlykke1-1/+1
2021-12-30wsutil: Fix time zone handling.John Thacker2-5/+8
Time zone handling was reversed, partially due to the tests having it backwards.
2021-12-29wslog: Add WS_DEBUG_HERE() macroJoão Valverde2-22/+36
Add a LOG_LEVEL_ECHO that is always active and always non-fatal. Use that to implement a WS_DEBUG_HERE() macro for quick print outs during debugging sessions.
2021-12-29epan: Add back ABSOLUTE_TIME_NTP_UTC representationJoão Valverde2-7/+3
It is a special case the prints "NULL" if time is zero.
2021-12-27wsutil/nstime: Fix ISO8601 parsing with tz offset separatorJoão Valverde2-12/+24
The format "23:59:59+2000" is valid but the code assumes that if the date/time format uses separators, the timezone offset must have them too. Fix that. Add test cases for timezone offsets +HHMM and +HH.
2021-12-27wsutil/nstime: Add tests for iso8601_to_nstime()João Valverde1-0/+49
2021-12-27wsutil/inet_addr: Add a cast to squelch a narrowing warningJoão Valverde1-1/+3
2021-12-27wsutil/inet_addr: Refactor to use C99/POSIX typesJoão Valverde5-64/+126
Rewrite ws_inet_pton{4,6} and ws_inet_ntop{4,6} without GLib types. Check for strerrorname_np() and use that is available, to simplify error handling. Add some minimal tests.
2021-12-27Use a wrapper function to call strptime()João Valverde5-18/+30
Encapsulate the feature requirements for strptime() in a portability wrapper. Use _GNU_SOURCE to expose strptime. It should be enough on glibc without the side-effect of selecting a particular SUS version, which we don't need and might hide other definitions.
2021-12-27wsutil: Declare ws_inet_* with extern "C"John Thacker1-0/+8
Specify C linkage for ws_inet_pton[4|6] in order to use them from the GUI.
2021-12-22Corrects repeated words throughout the code.Moshe Kaplan2-2/+2
Repeated words were found with: egrep "(\b[a-zA-Z]+) +\1\b" . -Ir and then manually reviewed. Non-displayed strings (e.g., in comments) were also corrected, to ease future review.
2021-12-21Fixup -Wshorten-64-to-32 warnings with ClangJoão Valverde2-1/+8
On Windows the POSIX read() and write() don't use the C99/POSIX types size_t and ssize_t so we must do the same to avoid gymnastics to squelch narrowing warnings. This adds two types for that purpose that have the correct definition for both Windows and POSIX.
2021-12-21Add a ws_posix_compat.h headerJoão Valverde1-1/+1
Currently used to define ssize_t on platforms that lack it. Fix some Windows build errors caused by moving the definition into a separate header. Fix some narrowing warnings on Windows x64 from changing the definition of ssize_t from long int to int64_t. The casts in dumpcap are ugly but necessary. The whole code needs to be rewritten for portability, or the warnings disabled.
2021-12-21wsutil: Split ws_regex_matches() into two functionsJoão Valverde2-10/+22
Split ws_regex_matches() into two functions with better semantics and remove the WS_REGEX_ZERO_TERMINATED symbol. ws_regex_matches() matches zero terminated strings. ws_regex_matches_length() matches a string length in code units.
2021-12-19Replace g_snprintf() with snprintf()João Valverde1-0/+2
Use macros from inttypes.h with format strings.
2021-12-19Add missing header, fix macOS buildJoão Valverde2-4/+1