Commit Graph

82900 Commits

Author SHA1 Message Date
João Valverde dcbd79584d epan/str_util: Remove unused functions
Remove ws_strdup_escape_char(). I don't think it is generic enough to keep,
and it does not seem very efficient either.

Remove string_replace(). This function was used in the GTK GUI.
2021-11-29 18:37:03 +00:00
João Valverde 8e63faff95 Fix Debian symbols 2021-11-29 17:47:53 +00:00
João Valverde 9c61142195 wsutil: Add more character escapes to ws_escape_string()
Add whitespace and other escapes for a better display of strings
in the UI.
2021-11-29 17:47:53 +00:00
João Valverde 54bdc20e45 epan: Rewrite ws_escape_string() to use wmem
Return a wmem-allocated string.

Add boolean argument to enable/disable adding double quotes.
2021-11-29 17:47:53 +00:00
João Valverde 44121e2c3b Move escape_string() to wsutil
Move this utility function to wsutil. Rename to
ws_escape_string().

Also add tests.
2021-11-29 17:47:53 +00:00
Martin Mathieson e11cdf2f46 Fix some spelling errors 2021-11-29 17:46:16 +00:00
Marius David 54cf8b01a4 :q! 2021-11-29 13:29:39 +00:00
Marius David 7990dfdf81 Add new netflow fields for Keysight/Ixia. 2021-11-29 13:29:39 +00:00
Роман Донченко 9afa7413f1 jpeg: implement dissection of large Exif IFD values
That is, those that don't fit in the offset field. This includes support
for RATIONAL/SRATIONAL types.
2021-11-29 09:11:04 +00:00
Stéphane Lapie 2b1c34b243 Fixed the ERSPAN Cisco marker packet dissector 2021-11-29 05:25:42 +00:00
Tomasz Moń 890555b8bd Qt: Qt6.2 compatibility fixes
Wireshark successfully compiles on Windows with Qt6.2 with following
cmake options:
  -DUSE_qt6=ON -DDISABLE_ERROR=ON

QCustomPlot QT 6.2 patch is taken from QCustomPlot forum post by miccs.
2021-11-29 04:55:12 +00:00
Uli Heilmeier c8c9ef0c1c OS Version Info: Improve Windows detection
Figuring out the right Windows version for 10/11 or Server 2016/2019/2022
by using the build number.
2021-11-28 22:16:19 +00:00
Jaap Keuter 32b2018ea9 LTE RLC graph: plug possible memory leak 2021-11-28 22:15:27 +00:00
Gerald Combs 5e345d390b NSIS: Remove some confusing error message text.
If the Visual C++ Redistributable installation fails, don't point users
to KB2999226. It applied to Windows 8.1 and earlier, and is more likely
to cause confusion than help fix the problem. Ping #17748.
2021-11-28 21:31:35 +00:00
Dr. Lars Völker 08f56e6f72 AUTOSAR I-PduM: list of hash table keys freed (fixing memory leak)
This patch does for packet-autosar-ipdum.c what MR !5196 does to
packet-signal.c
2021-11-28 21:09:47 +00:00
Dr. Lars Völker 8b907ad356 AUTOSAR I-PduM: remove unneeded dynamic key allocation
Minor optimization and cleanup of the code. Similar to cleanup in
packet-signal-pdu.c. See MR !5236.
2021-11-28 20:55:54 +00:00
Dr. Lars Völker ad6b128d97 Signal-Pdu: list of hash table keys freed (fixing memory leak) 2021-11-28 20:40:57 +00:00
Dr. Lars Völker 2bc77f2335 Signal-Pdu: Cleanup Functions Proto Reg Handoff
After refactoring in an old patch some features were moved into new
functions starting with proto_reg_handoff. This was wrong and is
corrected by this patch.
2021-11-28 20:25:29 +00:00
Gerald Combs 2452270c4e [Automatic update for 2021-11-28]
Update manuf, services enterprise numbers, translations, and other items.
2021-11-28 16:24:55 +00:00
Dr. Lars Völker 1785bd9799 Signal-Pdu: optimization to reduce strcmps
This patch converts the data type from char* to enum when loading the
config to speed up the packet dissection.
2021-11-28 14:39:15 +00:00
Dr. Lars Völker 890b5c2182 FlexRay: Fixing tvb_bytes_to_str_punct warnings 2021-11-28 14:24:15 +00:00
Dr. Lars Völker a6c4446968 AUTOSAR I-PDU Multiplexer: remove dead code 2021-11-28 14:09:48 +00:00
Dr. Lars Völker 4895f35718 Signal-Pdu: return the parsed length (bugfix)
Before the code was return length - (offset + 1). This did not make any
sense and caused lots of problems.
2021-11-28 13:55:06 +00:00
Dr. Lars Völker 72e74f9661 Signal-Pdu: remove unneeded dynamic key allocation
Minor optimzation and cleanup of the code.
2021-11-28 13:40:47 +00:00
João Valverde ef8125e3ae Move two functions from epan to wsutil/str_util
Move epan_memmem() and epan_strcasestr() to wsutil/str_util.
Rename to ws_memmem() and ws_strcasestr(). Add compile time
check for a system implementation and use that if available.

We invoke those functions using a wrapper to avoid exposing
_GNU_SOURCE outside of the implementation.
2021-11-28 12:32:51 +00:00
Tomasz Moń ede0bc5d61 Qt: Add missing QRegularExpression include 2021-11-28 13:13:31 +01:00
Jaap Keuter 4d338d97a9 Foundation Fieldbus: handle multiple PDUs per UDP payload 2021-11-28 10:03:29 +00:00
Huang Qiangxiong f029fa6b71 http2: fix building error caused by fake header feature without nghttp2
Fix a building error caused by fake header feature of
MR 4877 when building without nghttp2 library.
2021-11-28 11:29:48 +08:00
João Valverde f5d8d9e306 wmem: Use better names in the API 2021-11-27 19:39:27 +00:00
João Valverde fbfb4959ae dfilter: Better representation for charconst 2021-11-27 18:38:22 +00:00
John Thacker c595ecfc28 tvbuff: Use iso8601_to_nstime
Have tvb_get_string_time use iso8601_to_nstime for
ENC_ISO_8601_DATE_TIME (which seems to be the only time in a string
encoding any built in dissector actually uses, in syslog). It is
strictly superior; among other things it handles fractional seconds.

Also, tvbuff.c does not use strptime, so remove that include.
2021-11-27 17:49:49 +00:00
João Valverde 352390aa97 dfilter: Need to handle a charconst on the LHS 2021-11-27 17:19:11 +00:00
João Valverde 01a95db9b7 epan: Add binary search to introspection API 2021-11-27 14:31:53 +00:00
João Valverde f4f9bf1d9e epan: Add ipproto.h to instrospection enums 2021-11-27 12:54:32 +00:00
João Valverde c15f2aadc1 epan: Initialize wiretap
Clients of libwireshark should not be required to initialize
explicitly wiretap, if they don't use it themselves.
2021-11-27 08:41:01 +00:00
John Thacker ba85d8ef4d wustil: Fix timezone handling in iso8601_to_nstime
Convert the tm struct to nstime first, then apply the timezone
offset, because applying the offset to the hours and minutes fields
directly can require carrying or borrowing in base 24 and 60 arithmetic.
2021-11-26 22:07:11 -05:00
John Thacker 9413658b7c wsutil: Clarify NT epoch explanation in comment 2021-11-27 00:53:38 +00:00
João Valverde 6fab4cbeff epan: Add introspection API to export some constants
C is notoriously difficult to bind from other languages
without additional metadata. The C ABI does not include
enums and macros that are an essential component of the
API.

To make Wireshark instrospectable and more binding friendly
include an introspection API to export enums and integer macros.

To avoid the tedious need to manually keep the code up to date
it uses the excellent pyclibrary python package to automatically
parse C headers and extract this data.

This is not a process that should be done automatically during
the build.

This could be used for example to replace most of the wslua
make-init-lua.pl perl script, which tries to do the same thing
using regular expressions.

Besides the downside of using Perl using regular expressions
is inferior to pyclibrary in 2 ways: 1) pyclibrary understands
most of C99 grammar so it is much more powerful; 2) pyclibrary
has a specific API to extract "values" (enums and constants)
automagically. We just need to take care to use only integer
values, for our purposes.
2021-11-26 20:38:42 +00:00
John Thacker 80ebcc90bc RTMPT: Fix infinite loops harder.
Just break out of this loop if we wraparound sequence numbers in
the middle of a segment. That guarantees that the sequence of lookups
in the tree with _le will terminate at some point. This probably
makes the dissection a little worse in a few cases with sequence
number wrap around but non erroneous sequence numbers, so a more
complete fix would be ideal. Fix #17749, at least the infinite loop.
2021-11-26 13:36:26 -05:00
Huang Qiangxiong 2af95cbe1b HTTP2/GRPC: support using fake headers if first HEADERS frame is missing
Add an UAT for configuring fake headers according to the server port, stream
id and direction of the long-lived stream that we start capturing packets
after it is established. That helps to parsing the DATAs captured subsequently.
A testcase also added.

close #17691
2021-11-26 17:34:23 +00:00
Paul Tyler 9f56c07638 RTPS: Dissect PID_DEFAULT_MULTICAST_LOCATOR for vendors other than RTI 2021-11-26 17:31:34 +00:00
Joerg Mayer 3594a05ba7 CMakeLists.txt: Fix enabling the use of C++ 2017 with MSVC 2021-11-26 14:42:47 +01:00
Stig Bjørlykke 11c6ed177f at: Fix typo in cme_error_vals
Also remove a leading space in at_type_vals.
2021-11-26 13:22:04 +00:00
John Thacker 9da9c4e388 wsutil: Prevent buffer overflow in iso8601_to_nstime
Don't blindly examine the fifth byte in the input string without testing
earlier bytes.  Instead, process the year by hand before calling sscanf.

ISO 8601 times don't switch between Basic and Extended format in the
middle, so for the later possible buffer overflows just use the
previously determined format.
2021-11-26 13:06:27 +00:00
John Thacker a839ee1c2b wmem: Fix filename in header comment
If the name is going to be in the header, might as well spell it
correctly
2021-11-26 07:46:11 -05:00
Moshe Kaplan b031a2a470 wsar: Document prefs.h
Add @file to prefs.h so it's included
by Doxygen. Then documented the associated
functions.
2021-11-26 09:40:22 +00:00
Pascal Quantin bc566318bc Websocket: do not register proto_reg_handoff_websocket() for preference change
It is not required and fixes a "Protocol Websocket is already registered
in tcp table" warning at startup
2021-11-26 09:25:35 +00:00
Tomasz Moń e51a0cb4f4 Qt: Use QRegularExpression instead of QRegExp
Qt5 recommended to use QRegularExpression instead of QRegExp.
Qt6 deprecated QRegExp and provides it in Qt5 compatibility module.

QRegularExpression is generally faster and safer to use as the results
are returned in separate QRegularExpressionMatch instead of modifying
interal QRegExp object state.
2021-11-26 09:10:42 +00:00
Gerald Combs 0385e7448a Tools: Add our branch name to fuzz error reports. 2021-11-25 11:41:12 -08:00
Nardi Ivan 4e879c5d16 QUIC: add support for QUICv2 (draft-00)
See: https://datatracker.ietf.org/doc/html/draft-ietf-quic-v2
2021-11-25 16:47:59 +01:00