a9a7dcec21 broke the build by using std::as_const (new in C++17, we require
C++11). 189d93b4b8 switched to using a for loop with indices, but that
still fails on Qt5, because Qt5 uses int instead of qsizetype.
Switch back to the foreach-style loop, but using C++11 range-for instead of
Qt's foreach (which is semi-deprecated). Also, use qAsConst, which works in
C++11, instead of std::as_const.
Some classes, most notably Mass Storage, use STALL (instead of ZLP) to
prematurely end transfer. Finish reassembly when dissecting STALL. For
IN transfers ending reassembly is pretty straightforward and resembles
ZLP packet. For OUT transfers the reassembled URB is opposite direction
than the STALL handshake itself and last data packet may not be part of
reassembled URB. The last OUT data packet is part of reassembled URB
only if packet was acknowledged with NYET before endpoint was STALLed.
According to the Bluetooth Core Specification v5.3, Volume 2, Part C,
Section 5.1, the Name_Offset parameter of the LMP_NAME_RES PDU should be at
offset 2 in the payload and Name_Length should be at offset 3.
Set some models to have the Traffic Tab or Traffic Type List
that creates them as parent, so that they will be deleted
properly. Setting a model does not cause it to be deleted
unless it is parented, because models can be shared among
multiple views. Since these models are only used by the
one view, parenting them is fine.
Add functions to PacketListRecord to invalidate a single record's
colorization and column strings, used for a record is modified in a
way that needs to trigger redrawing, but we don't need to redraw
all packets.
Move the functionality for adding, deleting, and setting frame comments
into PacketListModel, operating on QModelIndexes (or on all physical
rows in the case of deleting all comments from a file.) Trigger
recolorization of any record with an updated comment.
Only set a block as modified when deleting comments if we actually
deleted comments. This avoids marking a file as modified if we
delete all comments from all frames, or all comments from selected
frames, when those comments do not actually have frames.
If cf_set_modified_block is used to modify a block that is already
modified, it can't update the comment count. In that case, return
false and have the callers update the comment count. (It already
has a return value, which is always true.) This avoids having the
GUI warning about saving into a format that doesn't support comments
when comments have been added and then removed.
Note that, unlike with time references and time shifts, there
are no fields (and hence no columns nor color filters) that depend
on whether other fields have comments. If for some reason some
were added, then the model data for all frames would have to be
updated instead. Since there aren't, we don't need to
redrawVisiblePackets, but we do need to drawCurrentPacket to ensure
the packet details are redissected.
Fix#12519
Store the field filter strings in a wmem_map pointing to the
field flags for each string. This allows specifying multiple
filter options (-j or -J) on the command line, including some
of both.
Fix#17470
The kernel unfortunately doesn't indicate which payload type
it is. In particular, it might be an Ethernet packet or an IP one,
depending on how the SKB has been generated.
We work around this issue by guessing if the packet contains the
EtherType at the right offset to be an Ethernet packet, and decode
accordingly the payload.
Don't call resize in applyRecentColumnWidths(). It doesn't seem
to be necessary in Qt5 or Qt6 to stretch the packet list last column
when the main window is wider than the total columns, and it doesn't
seem to be necessary to get the horizontal scroll bar to appear if
the columns are wider than the window frame either.
(When adding and removing columns, resizing the main window, etc.,
the columns all behave as expected, including if the wide Info
column is removed).
Resizing the packet list makes the scrollbar (and minimap) disappear.
It reappears when selecting another packet, but since it's not
necessary to resize, don't.
Fix#13597
If MSP_FLAGS_REASSEMBLE_ENTIRE_SEGMENT is set (because the dissector
asked for one more segment) but the new segment didn't result in
a completed reassembly (because it overlapped and didn't add new
data), don't clear the REASSEMBLE_ENTIRE_SEGMENT flag.
Related to #18411
If we have payload on TCP with a single octet that is not printable ASCII,
just reject it rather than waiting for the next CRLF line end (and
marking it as Continuation Data then). It is more likely to be a TCP Keep
Alive at the beginning of a capture file or connection.
At best, this change means that a correct SIP request or response is
interpreted rather than marking as Continuation Data. At worst,
Continuation Data has one less non printable octet at the beginning.
Fix#18411.
The `color_t_to_rgb` method returns an unsigned int, taking a 32-bit
color code and reducing it to an integer. Sharkd displays these as hex
colors.
However, if this color is missing a Red or Green component, the hex
output is missing the zero-padding for those parts of the color,
resulting in the wrong or invalid hex code.
This patch simply pads the output with zeros.
Dumpcap depends on wsutil.so. The path to the shared library
is encoded in the RPATH (or RUNPATH) property of ELF binaries.
This is currently an absolute path on most Unixy systems.
Dumpcap could not be made to work with a relative RPATH because it
uses elevated privileges and some loaders will ignore relative
RPATHs and non-standard paths under those circumstances, because of
(justified) security concerns.
To enable relocation of the program we link dumpcap statically
with wsutil instead.
This provides a fully working relocatable installation on Linux
and other platforms that support relative RPATHs.
This prevents checking sse4.2 compiler flag in non-x86 architectures.
Also set COMPILE_CAN_HANDLE_SSE4_2 and SSE4_2_FLAG variables to false
and empty values respectively to skip subsequent checks.
When device responds with STALL, the host will clear the halt using
ClearFeature(ENDPOINT_HALT) request. The request always results in data
toggle being reinitialized to DATA0. Because USBLL dissector does not
track all control transfers, it is unaware of the expected data toggle
change and thus would treat next DATA0 packet as retransmission if the
last data packet before STALL was DATA0.
USB transfer never spans across STALL, i.e. data packet after STALL
cannot be retransmission nor continuation of any earlier transfer.
Avoid continuing reassembly after a STALL by clearing active transfer
information from endpoint info on every STALL handshake.
Dumpcap depends on wsutil.so. The path to the shared library
is encoded in the RPATH (or RUNPATH) property of ELF binaries.
This is currently an absolute path on most Unixy systems.
Dumpcap could not be made to work with a relative RPATH because it
uses elevated privileges and some loaders will ignore relative
RPATHs and non-standard paths under those circumstances, because of
(justified) security concerns.
To enable relocation of the program we link dumpcap statically
with wsutil instead.
This provides a fully working relocatable installation on Linux
and other platforms that support relative RPATHs.