Commit Graph

1138 Commits

Author SHA1 Message Date
Martin Mathieson 714e568f66 Fix some more spelling errors 2024-02-06 10:46:08 +00:00
John Thacker d74c040e9e file: Use the compiled dfcode in cf_filter_packets
While we do immediately free it and recompile in rescan_packets,
or if we open a capture file in cf_read, if we start a capture
we go from cf_open to cf_continue_tail, and we want to use this
filter since we don't compile during a capture for each group
of packets (for reasons explained in the previous commit.)

Fixup 08cf0e9553
2024-02-02 21:01:20 -05:00
John Thacker 08cf0e9553 file: Don't recompile the dfilter during a live capture
Saving only the dfilter text and recompiling the code when
[re]dissecting or scanning groups of packets operates on the
explicit assumption that previously validated filter text will
always compile to valid filter code

That assumption is not true; while we invalidate the filter and
replace the text with NULL if display filter macros change or
other aspects of the packet matching expressions change so that
the previous text is no longer valid, display filters that match
FT_IPv4 or FT_IPv6 fields to resolved hostnames require a host
name lookup each time they are compiled, which can timeout, especially
if there are too many requests in flight at once. This is particularly
likely if a recompilation is performed each time additional frames
arrive during a live capture.

It is important to stress that the stronger, implicit assumption that
the display filter will compile to the same code is also false.
1) Display filters that require host name lookup can change even if
   it doesn't timeout.
2) Display filter macros can change.
3) Display filters with field references will change if the selected
   frame has changed.

In the case of a rescan, redissection, reload, retap, or opening a
new file, we want the new dfcode. For cf_continue_tail and
cf_finish_tail, when a new batch of frames have arrived, we might
be able to cache the host lookup for 1), and a user might want the
new macro definitions in 2) (but in that case, why not a rescan of
all packets?), but almost surely for 3) wants the field references
of the frame selected in the GUI when the filter was applied, not
whatever frame is currently selected when new packets arrive. So
we keep the old dfcode, and also reduce recompilation (which becomes
more important as the default update interval can be reduced, cf.
f0712606a3 ).

Currently filters with field references don't work at all with
newly arrived frames in live captures, because the references
aren't loaded to the code. This fixes that by using the field
references from the original frame.

Cf. 1370d2f738

Fix #19612. Fix #12517.
2024-01-24 15:42:46 +00:00
Gerald Combs af8643c5ae epan: Make "frames passed the display filter" the default
Set `fdata->passed_dfilter = 1` in frame_data_init. This lets us
simplify things slightly in add_packet_to_packet_list, and lets
dissectors force packets to be hidden if needed.

Note that we might want to add a "visible" element to frame_data
instead.
2024-01-04 02:45:14 +00:00
Guy Harris dd6b58fcb8 Have a common provider routine to provide time stamps.
Replace various almost-the-same get_frame_ts routines with a common
routine.
2023-12-18 18:54:53 +00:00
John Thacker 60a9e1124b Find: Matching multiple occurrences in Packet Bytes
Match multiple occurrence in Find Packet Bytes, both forwards
and backwards.

Also fix an issue highlighting wide strings properly reintroduced by
commit c0885fe390

For backwards searching in string and binary searches, use
the memrchr and backwards mempbrk implementations. For regex,
use PCRE2_ANCHORED to transform the user's regex expression into
one that is anchored at the start byte, and progressively search
backwards.

Fix #11269
2023-10-27 05:56:29 +00:00
John Thacker 861a3eef63 Qt: Edit capture comments in separate dialog
The capture file properties dialog already lists the section
comments in the Details section, so it wastes some space to have
them a second time in the edit box.

Have an edit dialog for the capture comments. Have the edit dialog
use tabs so that we can edit multiple comments in a section, and
all sections. Allow adding new comments, removing comments, and
reordering comments.

Fix a few small leaks.

Related to #14599, #16133.
2023-10-18 05:53:31 +00:00
John Thacker f1f6c1369d Don't use frames without timestamp for delta time calculations
pcapng allows simple packet blocks (which don't have timestamps),
enhanced packet blocks (which do) and custom blocks (which might
or might not have timestamps, and even if they do have timestamps,
libwiretap might not know about them), and so some records may have
timestamps while others do not.

Do not use frames without timestamps in delta time calculations.
Don't use them as reference frames for time calculations, or for
the previously displayed frame for time calculations, where the
previously displayed frame that actually has a timestamp is used.

Have the various _get_frame_ts functions return null instead of
their ts value (that is currently handled; if records without
timestamps set their abs_ts to the special "unset" value of nstime_t
that could work too, except that isn't currently handled.)

Still allow the GUI to set frames without timestamps as "Time
References", because that does still affect the "Cumulative Bytes"
column, so it's not entirely pointless; unset the reference time
so that the timestamp from the next frame that does have a timestamp
will be used as reference time.

The "previous captured frame" will show a 0 time delta when
the previous frame doeesn't have a timestamp. Perhaps a user
would also want "previous captured frame with a timestamp,"
but we'd have to store that in frame data (adding memory to
that struct.)

Fix #19397
2023-10-15 13:47:14 +00:00
John Thacker 5b3e32acb5 regex: Accept a subj_offset in ws_regex_matches_pos
As the PCRE2 documentation notes, "Setting startoffset differs from passing
over a shortened string and setting PCRE2_NOTBOL in the case of a pattern
that begins with any kind of lookbehind."

For the purposes of finding regex matches starting at a particular
offset in the packet bytes, we will need to handle that properly.
2023-10-03 23:36:03 +00:00
John Thacker c0885fe390 Find: Switch search_pos to the start byte
There's a lot of potentially confusing arithmetic from setting
search_pos to the last byte of a match. We can always test
search_len against zero to see if we actually had a match for
hightlighting purposes. (The ordinary byte searches won't find
zero length matches, but the regex search might, and not even
necessarily at the start of the bytes if there's a lookbehind term,
and currently they're handled incorrectly.)

We can't find fields with length zero based on an offset currently
anyway. (If we tried, would we match fields that contained the byte
before or after the zero length offset?)

Perhaps we shouldn't allow zero length regex matches for packet
byte searches at all; PCRE2 has an option to prevent such matches.
2023-10-03 08:38:49 -04:00
John Thacker 8e59e06395 find: Use ws_memmem in match_binary 2023-10-01 17:49:22 -04:00
John Thacker 9c90105c36 Find: Remove redundant match_narrow function
The case sensitive exact match of a needle of a given length
in packet bytes is the same whether the value originally came from
a string or a converted hex string. We don't need two static functions
that are exactly the same.
2023-10-01 11:26:07 -04:00
John Thacker 147b95d2d5 Find: Update search frame for Finding multiple fields
Add GUI support to turning on and off finding multiple occurrences
in a frame.

Also add a checkbox for searching backwards.

This makes the number of controls large, so split it into two rows.
2023-10-01 08:56:32 +00:00
John Thacker 4c69b8facf Find Packet: Find packet details multiple matches in a frame
When searching packet details with Find Packet, step through
each field that matches the search, using the currently selected
field as a starting point for searching the current frame before
going onto another frame.

Handle both forwards and backwards, so that backwards searching
initially finds the last match in each frame.

Part of #11269. (Packet bytes searching should presumably also
be handled.)
2023-10-01 08:56:32 +00:00
Moshe Kaplan f8d48d04d5 Fix misppellings in root and ui directories
Fix misppellings in root and ui directories.
Most of these are comments, but some are in
error messages.
2023-09-26 00:26:25 -04:00
John Thacker 1e451b30d8 file: Fix leaks in Save As
When rescanning the file, free the filename and array of linktypes
if they already exist.

Reset the wtap record while rescanning the file, so that each block
is freed when we're done with it.

Cleanup the wtap dumper parameters after writing (the new SHB, etc.)
2023-09-06 15:18:57 +00:00
John Thacker 9ad2f8ee52 Fix storing first previously displayed packet in cf_reftime_packets
If we don't have the timestamp of the previously displayed packet,
we set the current packet as the previously displayed packet so
that the delta time displayed is zero.

Only do this if the current packet is actually displayed; otherwise,
when setting or unsetting a time reference, the first displayed
packet is given a delta time displayed from the first frame in
the capture, regardless of whether the first frame is displayed
or not. (The rest of the code properly handles cf->provider.prev_dis
being NULL.)

Fix #19324
2023-09-05 23:55:49 +00:00
John Thacker acab67d234 Fix progress_is_slow check arithmetic
The first condition was only true if the second condition was also true.
Change the arithmetic to what is presumably intended - if half
PROGBAR_SHOW_DELAY has passed and we are less than half done, show
the progress bar.

Note that since this only gets checked between records, there's still
an issue with frames that take a very long time to dissect, e.g. the
first TLS packet if the SSLKEYLOGFILE is very large (#17051.)
The progress bar won't appear (nor any other GUI indication) while
that packet is being dissected.
2023-08-01 01:02:03 +00:00
John Thacker 1b82eda9eb epan: Register dynamic column fields and make them filterable
Make the text of each registered column a FT_STRING field that can be
filtered, prefixed with _ws.col - these work in display filters, filters
in taps, coloring rules, Wireshark read filters, and in the -Y, -R, -e,
and -j options to tshark. Use them as the default "Apply as Filter" value
for the columns that aren't handled by anything else currently.

Because only the columns formats that actually correspond to columns
get filled in (invisible columns work), register and deregister the
fields when the columns change.

Use the lower case version of the rest of the COL_* define for each
column as the field name.

This adds a number of conditions to "when are the columns needed",
including when the main display filter or any filter on a tap is
using one of these fields.

Custom columns are currently not implemented. For custom columns, the
tree then has to be further primed with any fields used by the custom
columns as well. (Perhaps that should happen in epan_dissect_run() -
are there any cases where we construct the columns and don't want to
prime with any field that custom columns contains? Possibly in taps
that we know only use build in columns.)

Thus, for performance reasons, you're better off matching an ordinary
field if possible; it takes extra time to generate the columns and many
of them are numeric types. (Note that you can always convert a non-string
field to a string field if you want regex matching, consult the
*wireshark-filter(4)* man page.) It does save a bit on typing (especially
for a multifield custom column) and remembering the column title might
be easier in some cases.

The columns are set before the color filters, which means that you
can have a color filter that depends on a built-in column like Info or
Protocol.

Remove the special handling for the -e option to tshark. Note that
the behavior is a little different now, because fixed field names
are used instead of the titles (using the titles allowed illegal
filter names, because it wasn't going through the filter engine.)
For default names, this means that they're no longer capitalized,
so "_ws.col.info" instead of "_ws.col.Info" - hopefully a small
price in exchange for the filters working everywhere.

The output format for -T fields remains the same; all that special
handling is removed (except for remembering if someone asked for
a column field to know that columns should be constructed.)

They're also set before the postdissectors, so postdissectors can
have access.

Anything that depends on whether a packet and previous packets are
displayed (COL_DELTA_TIME_DIS or COL_CUMULATIVE_BYTES) doesn't work
the way most people expect, so don't register fields for those.
(The same is already true of color filters that use those, along with
color filters that use the color filter fields.)

Fix #16576. Fix #17971. Fix #4684. Fix #13491. Fix #13941.
2023-07-25 00:49:52 +00:00
John Thacker 9c57f9061d export: Free wtap_dump_params
Fix a leak by calling wtap_dump_params_cleanup
2023-07-18 18:33:21 -04:00
John Thacker 33567d31c5 print: Move protocolfilter inside output_fields
Move the protocolfilter map to being a member of output_fields,
consolidating some of the API. The only functions that accept
one accept both, and callers that always pass either as NULL
always pass both as NULL.
2023-06-14 23:58:02 +00:00
John Thacker 801554fb79 Add a capture file state for a pending read
When not updating the packet list during a capture, the capture
file structure isn't set up, but there is a pending capture.

We currently treat that as "finished reading", but that means
that other code assumes that all the structures are set up and
can crash, and also don't prompt regarding unsaved packets when
trying to close Wireshark.

Add a state for FILE_READ_PENDING that sometimes should be treated
similar to FILE_CLOSED and sometimes should be treated similar to
FILE_READ_IN_PROGRESS.

This fixes a crash when enabling "update packet list during a capture"
while a capture is in progress, as well a crash when applying a filter
while a capture is in progress but real time packet list updates are
off.

Keep track of the number of packets that the capture child has reported
that haven't been read yet, so that the capture statistics stay accurate
even if the pref is toggled. Also run the main status bar statistics at
the end, so that if any packets are processed in cf_finish_tail() they
are reported.

This also restores status bar statistics for when update packet list
during a capture is off, which 461fb517d1
accidentally disabled.

Fix #4035
2023-06-13 17:09:50 +00:00
Joakim Karlsson 001930e1e5 file: fix might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered] 2023-06-12 17:03:11 +00:00
Gilbert Ramirez acbc327faf Change how the packet dedup structures are handled during a live capture 2023-06-11 17:01:55 +00:00
Gilbert Ramirez 68526daf24 Add packet dedup support for live captures too 2023-06-09 07:21:08 +00:00
Gilbert Ramirez d2c9f1824a Add a preference for ignoring duplicate frames
Sometimes you have a capture file that has many duplicate frames
because of how the capture was made, and its convenient to ignore
the duplicates so you can concentrate on the data and not all
the TCP warnings.

This adds a preference in the "Protocols" section to ignore
duplicates. This currently only works while reading a capture file
*not* during a live capture.
2023-06-09 07:21:08 +00:00
John Thacker da5b21f5ec Save time-shifted time stamps when writing out a capture file
If a time shift has been applied to frames, save the time-shifted
value to the newly written file.

If we're doing Save/Save As, so that the newly written file replaces
the currently open file, make sure to clear the shift offset from
the frame data, for the same reason that we mark the file as no longer
being modified. If we're Exporting packets and not changing the
currently open capture file, leave the shift offset the same.

If there's color rules based on the frame protocol, recolorize.
We also really should reapply the current filter, if any, if it
depends on something in the frame protocol.

Fix #14306
2023-05-31 21:34:43 -04:00
João Valverde 62b427c611 Initialize some variables [-Wmaybe-uninitialized] 2023-05-21 13:57:32 +00:00
John Thacker f69e0ca6bc dfilter+taps: Load field references for taps
When rescanning or retapping, if there is a currently selected packet
in the GUI, load any field references in any filters for any tap
listeners.

Note that Lua plugins can register some filtering tap listeners later
after we reset the dissection tree, but those are for field extraction
in the new tree and can't contain field references.

Fix #18912
2023-05-06 23:28:40 -04:00
João Valverde c053b96f08 dfilter: Assert on invalid dfilter_compile input 2023-04-21 18:04:33 +01:00
João Valverde 81a8777b9f dfilter: Make error a pointer
Make it easier and more natural to test for errors and hand-over
error results.
2023-04-20 14:12:39 +00:00
João Valverde 7595af96a0 ftypes: Hide fvalue implementation
Exposing the fvalue_t implementation is exposing internal
details of the implementation. Fix that by making the fvalue_t
internal to the ftypes implementation and using setters/getters
where necessary.
2023-04-19 15:12:25 +00:00
John Thacker 2b45c16f1a Fix leak in Find Packet searching tree details
The string used to search the selected packet's protocol tree for
the field we already found is leaked.

The function prototype is prone to leaks; all the components of the
match_data are filled in inside the function, and it only needs to
return the field info. Restructure it so that the match_data is
created (and the string freed) inside the function, and only
the field_info is returned.
2023-03-25 12:38:24 +00:00
Preben Guldberg 4af661a035 String search may fail when partial matches occur
When searching for string matches in packet list and details, save index of
next possible start location inside a partial match and rewind to that
position if the ongoing match is not successful.

While here, also terminate search when the search string is longer than
the remainder of the text string being matched against.

As suggested by John Thacker, use strstr() for case sensitive search.

Full bug description:

Currently, searching for strings in "Packet list" and "Packet detail" may fail
to find matches if a partial match is encountered. Examples of both are present
in nfsv4.1_pnfs.cap in the Wireshark sample trace collection.

Searching for "Win=29200 Len=0" in Packet list finds frame 1, based on:

    880 → 2049 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM TSval=360391592 TSecr=0 WS=128

However, searching for jsut "0 Len=0" skips this frame when searching.

Similarly, searching for "netapp-26" in Packet detail will find many frames
(if TCP port 2049 is decoded as RPC) based on the RPC credentials:

    Machine Name: netapp-26

Similarly, if searching for "p-26", no frames are found.

The problem is how match_summary_line() and match_subtree_text() will start a
comparison against the search string based on the first character and scan
ahead to check if each subsequent character also matches. However, if there is
no match, the search continues only after the partial match.

In practice, if "p-26" is against "Machine Name: netapp-26" will:

- Test against against characters, but find no match until the first 'p'.
- Find that the first 'p' matches the leading 'p' in the search string.
- Compare the second 'p' against '-' in the search string, which fails.
- Continue checking the second 'p' where neither '-', '2' nor '6' match the
  leading 'p' in the search string.

The proposed fix will, when a partial match is in progress, store the first
location where a new match might occur. If the partial match is not
successful, the search is restarted at that stored position.

As far as I can tell, other match_xxx functions in file.c do not have
share this problem.
2023-03-22 00:55:40 +00:00
Guy Harris d7a863b9df wiretap: give a routine a clearer name.
wtap_dump_file_encap_type() could be read as indicating that, given a
handle for an encapsulation type, it returns the encapsulation type for
the file being written, rather than, given a list of encapsulation
types, returning the encapsulation type that would be required for all
of those types, which is what it does.

Rename it to wtap_dump_required_file_encap_type().
2023-03-17 18:22:59 -07:00
John Thacker a9a7dcec21 Qt: Ensure that add frame comments trigger recoloring, count updates
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
2023-02-17 20:49:11 -05:00
John Thacker 01172f5a1d tshark: Support multiple -j and -J options, including mixed
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
2023-02-16 12:46:44 +00:00
João Valverde 84f963dfa2 Move ui/version_info.[ch] to wsutil 2023-02-07 23:17:37 +00:00
John Thacker fd183cb40b Qt: Add ability to cancel sorting
Add the ability to cancel sorting. Since we now parse user inputs
during the sort, test and set the capture file read lock. Try to
sort in PacketList::captureFileReadFinished, since now sorting during
thawing won't happen if it's in the middle of a rescan.

Fix #17640
2023-02-07 00:03:24 +00:00
Tomasz Moń e7d5c49fe1
epan: Use hash table for dependent frames
Dependent frames list order does not matter and thus significantly
faster data structure can be used. Replace the list with hash table to
avoid excessive CPU usage when opening files containing reassembled
packets consisting of large number of fragments.
2023-01-28 15:17:42 +01:00
John Thacker c65d5a0a80 wiretap: Reprocess Name Resolution Blocks during redissect
Keep name resolution information as mandatory elements for
NRBs, and when the ipv4 or ipv6 callback is set, have name
resolution entries from already read NRBs sent to the callback.
rescan_packets can use this when redissecting to reobtain the
name resolution entries from the NRB, similar to what is done
with Decryption Secrets Blocks. (This can also later be used
if we read NRBs and DSBs in pcapng_open before the first packet,
and before the callbacks are set.)

This doesn't yet make the changes to wtap_dumper to write them out,
but is a step towards that too. (It's not clear in cases where we
dissect packets whether we want to copy the entire NRB, or only
write out actually used addresses as done now. For copying without
reading a file, like with editcap, we presumably do want to copy them.)

Fix #13425. Ping #15502
2023-01-21 22:25:03 +00:00
João Valverde 7641ba7416 dftest: More code cleanups and enhancements 2023-01-07 19:16:16 +00:00
Sake Blok f870c6085d epan: Allow nested dependent packets
Save all dependent frames when there are multiple levels
of reassembly.

This is a retry of !6329, combined with the fix in !6509 which
were reverted in !6545.

epan: fix a segfault, introduced in !6329
2023-01-06 23:15:48 +00:00
João Valverde a0d77e9329 dfilter: Return an error object instead of string
Return an struct containing error information. This simplifies
the interface to more easily provide richer diagnostics in the future.

Add an error code besides a human-readable error string to allow
checking programmatically for errors in a robust manner. Currently
there is only a generic error code, it is expected to increase
in the future.

Move error location information to the struct. Change callers and
implementation to use the new interface.
2022-11-28 15:46:44 +00:00
Gerald Combs 85357ae721 Fix more unused variables and enable unused-but-set-variable errors.
Add -Werror=unused-but-set-variable to our default compiler flags and fix

```
epan/dissectors/packet-dcerpc-frsrpc.c:709:10: error: variable 'nb_chunk' set but not used [-Werror,-Wunused-but-set-variable]
        guint32 nb_chunk = 0;
                ^
```

```
epan/dissectors/packet-dcom-oxid.c:175:13: error: variable 'u32ItemIdx' set but not used [-Werror,-Wunused-but-set-variable]
    guint32 u32ItemIdx;
            ^
```

```
epan/dissectors/packet-l2tp.c:1775:104: error: parameter 'ccid' set but not used [-Werror,-Wunused-but-set-parameter]
static int dissect_l2tp_ericsson_avps(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 ccid)
                                                                                                       ^
```

```
epan/dissectors/packet-ldp.c:1922:19: error: variable 'ix' set but not used [-Werror,-Wunused-but-set-variable]
    guint8        ix;
                  ^
```

```
epan/dissectors/packet-nas_5gs.c:4757:14: error: variable 'curr_len' set but not used [-Werror,-Wunused-but-set-variable]
    guint i, curr_len;
             ^
```

```
epan/dissectors/packet-per.c:1769:6: error: variable 'extension_addition_entries' set but not used [-Werror,-Wunused-but-set-variable]
        int extension_addition_entries;
            ^
```

```
epan/dissectors/packet-rtitcp.c:618:11: error: variable 'messages_count' set but not used [-Werror,-Wunused-but-set-variable]
    guint messages_count, offset;
          ^
```

```
epan/dissectors/packet-tcp.c:2130:9: error: variable 'ackcount' set but not used [-Werror,-Wunused-but-set-variable]
    int ackcount;
        ^
epan/dissectors/packet-tcp.c:3317:12: error: variable 'nbOptionsChanged' set but not used [-Werror,-Wunused-but-set-variable]
    guint8 nbOptionsChanged = 0;
           ^
```

```
epan/dissectors/packet-zbee-zcl-se.c:11802:15: error: variable 'i' set but not used [-Werror,-Wunused-but-set-variable]
    for (gint i = 0; tvb_reported_length_remaining(tvb, *offset) >= 5; i++) {
              ^
```

```
ui/iface_lists.c:142:23: error: variable 'linktype_count' set but not used [-Werror,-Wunused-but-set-variable]
    gint              linktype_count;
                      ^
```

```
ui/voip_calls.c:456:15: error: variable 'item_num' set but not used [-Werror,-Wunused-but-set-variable]
    guint     item_num;
              ^
```

```
file.c:572:17: error: variable 'count' set but not used [-Werror,-Wunused-but-set-variable]
        guint32 count             = 0;
                ^
```

```
file.c:3667:24: warning: cast from 'const unsigned char *' to 'unsigned char *' drops const qualifier [-Wcast-qual]
        pd = (guint8 *)ws_mempbrk_exec(pd, buf_end - pd, pattern, &c_char);
                       ^
```

```
ui/qt/io_graph_dialog.cpp:1932:60: error: variable 'mavg_right' set but not used [-Werror,-Wunused-but-set-variable]
    unsigned int mavg_in_average_count = 0, mavg_left = 0, mavg_right = 0;
                                                           ^
```

```
ui/qt/stats_tree_dialog.cpp:166:9: error: variable 'node_count' set but not used [-Werror,-Wunused-but-set-variable]
    int node_count = 0;
        ^
```

```
ui/qt/models/profile_model.cpp:1142:13: error: variable 'entryCount' set but not used [-Werror,-Wunused-but-set-variable]
        int entryCount = 0;
            ^
```
2022-11-08 13:49:44 -08:00
João Valverde e7f439bc2f Convert capture file regex search to PCRE2.
Replace the use of the obsolete GRegex with PCRE2.

Fixes a crash reported in issue #17500.
2022-07-27 11:21:03 +00:00
John Thacker 8ac995578c epan: Respect custom column resolved/unresolved status everywhere
Add a function to get the column text of the nth column, taking
into account whether the column is resolved or unresolved. Use
this function in the GUI, as well as in tshark, when writing
PSML, exporting dissection to PSML, etc., instead of accessing
col_data directly.

This removes the direct accesses of col_data from outside
column.c and column-utils.c

Fix #18168.
2022-07-12 00:22:11 +00:00
David Perry 82408922fd Prevent null dereference in `rescan_file()` 2022-07-05 16:59:19 +00:00
Roland Knall 505226d1e2 Ui: Centralize PacketList helper prototypes
To implement loading a packet list, a lot of helper
methods are required. Those prototypes where split up
over two places and have been moved to packet_list_utils.h
to ensure a single place for lookup
2022-06-29 09:31:09 +00:00
Roland Knall c3b2cec3f2 Ui: Cleanup row number and select packet
Remove unneeded row number in capture file. The packet list is
the only object that should know the correct number, propagating
it further only complicates things. At the same time, rework
cf_select_packet to select the packet based on frame_data not on
the row (which can be unreliable).
2022-06-28 14:56:06 +02:00