Commit Graph

299 Commits

Author SHA1 Message Date
John Thacker 49540ec646 columns: Allow any field expression syntax to be used in columns
Allow anything that can be used in a display filter to be used in
columns (with the exception that field references don't work without
a notion of a currently selected frame): display filter functions,
slices, arithmetic calculations, logical tests, raw byte addressing,
the layer modifier, display filter macros, etc., alone or in
combination.

Show the results and generate filters. Note that "resolved" values are
not yet supported. They make conceptual sense for some expressions
(e.g., if the layer modifier only is used) but not for others.
Perhaps resolution could be done as a final step in the filter before
returning values.

It would also be useful to be able to get the expected return type
of an expression, so that the functions for right justifying a column
or sorting numerically could work. Right now the results are treated
as strings even if the return field values are numeric.

Multifield columns (i.e., concatenation of field values) are currently
implemented using the OR operator.For backwards compability, continue to
support that. When a true logical OR would give a different result,
surround the expression in parentheses, which the multifield columns did
not previously support (due to the regex used instead of full filter
grammar parsing.)

Perhaps in the future we should introduce a separate operator for
concatenation, possibly only used in column definitions and nowhere
else.

Update release notes.

Fix #7752. Fix #10154. Fix #15990. Fix #18588. Fix #19076.
Related to #16181 - it's now possibly to define new display filter
functions so that is essentially solved, though I suppose there's
always room for more built-in functions.
2024-02-14 08:11:01 +00:00
John Thacker 4c9584ef45 column: Update custom column regex
When splitting a possibly multifield custom column expression
into components, don't match "or" unless it's a word by itself,
i.e. is surrounded by space. "||" by itself is fine as a token.
This is necessary if we allow more complicated filters to match
than just single fields separated by "||" or "or". Also split
at space at the beginning or end of a string (since we don't
always guarantee that whitespace is stripped.)

When spliting into components, only split on "||" and " or " that
are not inside parenthesis. Splitting on operators inside parentheses
results in components which are not fields or valid filter expressions
and has never worked, e.g. splitting "(tcp.srcport or tcp.dstport)"
into "(tcp.srcport" and "tcp.dstport)".

TEST_OR has the lowest possible operator precedence (see
commit 34ad6bb478), so this works,
and also justifies using OR instead of AND for multifield custom
columns.

This means that, e.g., "tcp.srcport or tcp.dstport" will be treated
as a multifield custom column expression that returns the values
for both of the fields, whereas "(tcp.srcport or tcp.dstport)" will
be ultimately treated as a single logical test that returns true
if one of the fields exist and false if neither do. Until tests
and other non single-field expressions are supported, the latter
won't work, but it never has worked.

Related to #7752, #10154, #15990, #18588, and #16181.
2024-02-12 14:48:31 +00:00
Stig Bjørlykke eb4eeb07ca epan: Initialize static proto values to 0
Update epan to not initialize static proto values to -1.
2023-11-07 14:31:03 +00:00
João Valverde 9765f8575c wsutil: Rename inet_netw.[ch]
inet_netw.c -> inet_cidr.c
inet_netw.h -> inet_cidr.h
2023-10-31 13:41:31 +00:00
João Valverde a178ec8a38 wsutil: Move and consolidate CIDR code
Consolidate code to handle CIDR network addresses in inet_netw.[ch].
2023-10-31 10:14:09 +00:00
Guy Harris b532bf4b62 Use INT_MIN instead of -2147483648.
Fun fact: -2147483648 isn't an "integer-constant" in C, it's an
expression that applies the unary minus operator to the integer-constant -
2147483648.  The Visual Studio C compiler, at least, treats 2147483648
as an *unsigned* integer constant and warns about applying the unary
minus operator to it.

What we want is the smallest possible int value (which can't be validly
negated on two's-complement platforms), so just use INT_MIN and rely on
the compiler+header supplier to figure out how to define INT_MIN so as
not to provoke a compiler warning.  (At least some versions of Visual
Studio define it as (-2147483647 - 1).)

Fixes #19340.
2023-09-14 05:44:53 -07:00
Guy Harris 151b85c45e Get rid of some places that handled specific timestamp resolutions.
Replace them with tables supporting everything from seconds to
nanoseconds, or with code that calculates 10^{resolution}.
2023-09-12 17:53:24 -07:00
Guy Harris cc87288b6f Use common routines to handle converting time information to strings.
This means that fractional parts of timestamps are generated with
format_fractional_part_nsecs().
2023-09-12 12:38:23 -07:00
Guy Harris 143533dfe0 Add a routine to format an nstime as an ISO 8601-style date/time.
This replaces code in both absolute_time_string(), in capinfos, and
set_abs_ymd_time(), in libwireshark.  Like absolute_time_string(), it
reports, in the formatted string, an error if the seconds value in the
nstime can't be converted to a struct tm (looking at *you*, Visual
Studio C library),

Have that routine handle all time precision values from 0 (seconds) to 9
(nanoseconds).

Add a ws_gmtime_r(), matching ws_localtime_r(), for use by that routine.
2023-09-11 09:25:00 +00:00
Guy Harris d3ec353e0d Have diaplay_epoch_time() take an nstime_t as an argument.
And have it handle all time stamp precision values from 0 to 9.

Do that by making it just a wrapper for display_signed_time(); both
routines should just display the secs and nsecs values.

(The difftime() call serves no purpose:

* difftime() exists in order to allow the encoding of times in time_ts
in an arbitrary fashion, such that subtracting their numerical values
won't necessarily return a difference in seconds, and to allow a
difference in seconds to be calculated.  See the C89 rationale at
http://www.lysator.liu.se/c/rat/d12.html#4-12-2-2.

* Howeveer, on UN*Xes and in the Visual Studio C library, time_t is just
a count of "seconds since the Epoch", so difftime(<time_t>, 0) just
converts the integral time_t to a double.)
2023-09-10 19:48:36 -07:00
Guy Harris e40bc0d100 Have diaplay_signed_time() take an nstime_t as an argument.
And have it handle all time stamp precision values from 0 to 9.
2023-09-11 01:34:15 +00:00
Guy Harris 5d04013024 Add a set of time stamp precision values in wsutil/nstime.h and use them.
Add an enum containing a set of symbols for time stamp precisions, where
the value of the symbol is the number of digits of precision after the
decimal point.

Replace to_str_time_res_t with the new enum, ws_tsprec_e.

Deefine the TS_PREC_FIXED_ entries in the ts_precision enum, and the
WTAP_TSPREC_ #defines that correspond to known time stamp precisions, to
have the same values as the corresponding ws_tsprec_e values. This means
that their values are also the number of digits of precision after the
decimal point.
2023-08-16 22:57:51 +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 e449b560c0 epan: Properly generate filter expressions for custom columns
Properly generate filter expressions for custom columns by
using proto_construct_match_selected_string on each value and
then joining them together later instead of trying to split
the column expression value.

This ensures that escaping is done properly for display filter
strings, that commas internal to field values are not confused
with commas between occurrences, that for multifield columns
we can distinguish which field each value matches, etc.

It's not entirely clear whether AND or OR logic is appropriate
for multiple occurrences; currently OR is used.

Bump glib requirement to 2.54 for g_ptr_array_find_with_equal_func
(this doesn't drop support for any major distribution that already
meets our other library requirements, like Qt.)

Fix #18001.
2022-11-02 19:46:11 +00:00
John Thacker 4851b4ceb5 column-utils: Check for UTF-8 truncation
Functions that copy into a fixed sized buffer, like
vnsprintf and g_strlcat can truncate UTF-8 strings in
the middle of a character. Check for that with vnsprintf,
and replace some g_strlcat calls in the column utils with
ws_label_strcpy.

Fix #18554
2022-10-29 07:59:13 -04:00
João Valverde c1cede8d7c epan: Format column string input for display.
Format the input for display, by escaping some non printable characters,
using ws_label_strcpy().

In some cases with vsnprintf() this requires using a temporary buffer.

Add some debug checks for invalid UTF-8 errors.

The intention here is to pass dissection data directly to the column
API, and the column functions are responsible for formatting that
data for display. This avoids having to call format_text() before
adding a string to a column and separates the concerns better.
Display formatting is an UI concern.
2022-10-26 13:28:19 +01:00
Oke Hargens f461e33a41 column-utils: Add missing check for frame_data::has_ts
Adds check for frame_data::has_ts in col_set_delta_time before calling
set_time_seconds. This is the same check that is done in multiple other
methods in column-utils.c. Because frame_data::tsprec might not be
initialized if has_ts is false, this resulted in a failed assertion in
set_time_seconds if the user created a column with "Delta time".

Also adds an assertion for frame_data::has_ts in set_time_seconds.
2022-03-04 12:03:36 +00:00
João Valverde c5a19582e4 epan: Convert to use stdio.h from GLib
Replace:
    g_snprintf() -> snprintf()
    g_vsnprintf() -> vsnprintf()
    g_strdup_printf() -> ws_strdup_printf()
    g_strdup_vprintf() -> ws_strdup_vprintf()

This is more portable, user-friendly and faster on platforms
where GLib does not like the native I/O.

Adjust the format string to use macros from intypes.h.
2021-12-19 19:29:53 +00:00
João Valverde cace66d45d The macro 'va_copy' is C99, use that 2021-12-12 11:56:17 +00:00
João Valverde 0e50979b3f Replace g_assert() with ws_assert() 2021-06-19 01:23:31 +00:00
Guy Harris 57a1514ac7 Cast away the return value of g_strlcpy() and g_strlcat().
Most of the time, the return value tells us nothing useful, as we've
already decided that we're perfectly willing to live with string
truncation.  Hopefully this keeps Coverity from whining that those
routines could return an error code (NARRATOR: They don't) and thus that
we're ignoring the possibility of failure (as indicated, we've already
decided that we can live with string truncation, so truncation is *NOT*
a failure).
2021-04-30 03:19:19 -07:00
João Valverde 291a8b8bc1 Replace g_assert(FALSE) with g_assert_not_reached() 2021-03-24 22:24:37 +00:00
Darius Davis a3be7e898c column-utils: Get snprintf prototype from stdio.h.
Commit 73d793788c removed ws_printf.h from
column-utils.c, but left no prototype for snprintf, causing a build failure on
my Debian testing host.  Let's #include <stdio.h> here.
2021-03-01 07:13:12 +00:00
João Valverde 73d793788c Remove and replace obsolete ws_snprintf() definition
Since fe94133f0d ws_snprintf()
and ws_vsnprintf() don't actually do anything anymore.

The return value of ws_[v]snprintf was discarded before,
now it too conforms to C99.
2021-02-28 22:03:42 +00:00
Guy Harris a58ed646aa Handle relative times with >2^31 seconds.
Make display_signed_time() take a 64-bit signed number of seconds, and,
in calls to it, cast the argument to gint64, not gint32.

Addresses issue #16909.
2020-10-18 02:06:07 -07:00
Peter Wu 720c3bdc04 column: set G_REGEX_RAW for the custom column filter
Neither the pattern nor the intended subject (a custom fields filter)
contain UTF-8, so set G_REGEX_RAW accordingly. While a filter such as
`tcp matches "foo\xff"` (with `\xff` being a single byte) was accepted,
it did not trigger a crash though even if the precondition was violated.

Change-Id: I45d76b9abbd942d186dcf70f581121769bbd2d0a
Ping-Bug: 14905
Reviewed-on: https://code.wireshark.org/review/31940
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-02-10 16:12:59 +00:00
Guy Harris 7eb3e47fa4 Try to squeeze some bytes out of the frame_data structure.
Make the time stamp precision a 4-bit bitfield, so, when combined with
the other bitfields, we have 32 bits.  That means we put the flags at
the same structure level as the time stamp precision, so they can be
combined; that gets rid of an extra "flags." for references to the flags.

Put the two pointers next to each other, and after a multiple of 8 bytes
worth of other fields, so that there's no padding before or between them.

It's still not down to 64 bytes, which is the next lower power of 2, so
there's more work to do.

Change-Id: I6f3e9d9f6f48137bbee8f100c152d2c42adb8fbe
Reviewed-on: https://code.wireshark.org/review/31213
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-12-27 04:34:29 +00:00
chinarulezzz ec0f8e6c36 fix missing parentheses in 'if' statement
Change-Id: I47f8566c4410d6aac1111b35fff3b044c14bc70b
Reviewed-on: https://code.wireshark.org/review/27079
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-03 04:09:42 +00:00
Anders 25a337cdb0 glib: Use g_slist_free_full() in a couple of places.
Change-Id: Iff833bf5c197959c8decb62d6ce794c6d0415fb7
Reviewed-on: https://code.wireshark.org/review/26978
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-17 15:01:24 +00:00
Gerald Combs be1af00448 Properly reset a variable.
Change-Id: I72b125dd4c9d9033ce3e3d779bf28005ee6b52ad
Reviewed-on: https://code.wireshark.org/review/26482
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-03-15 16:30:27 +00:00
Gerald Combs bbe5fc1028 Epan+Qt: Invalidate cached column strings.
Add col_data_changed, which checks to see if we have updated column
info. Add col_append_frame_number, which adds a frame number and sets
col_data_changed. Call col_append_frame_number instead of
col_append_fstr from some dissectors.

Add PacketListRecord::invalidateAllRecords, which invalidates any cached
record data. Add PacketListModel::invalidateAllColumnStrings which calls
invalidateAllRecords and signals that our data has changed. Call
invalidateAllColumnStrings when we have new name resolution or column
information.

Bug: 11414
Bug: 11468
Change-Id: I2671594a722f4f9436fe1df84d43489a148e0cee
Reviewed-on: https://code.wireshark.org/review/26373
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2018-03-15 12:19:23 +00:00
Dario Lombardo 55c68ee69c epan: use SPDX indentifiers.
Skipping dissectors dir for now.

Change-Id: I717b66bfbc7cc81b83f8c2cbc011fcad643796aa
Reviewed-on: https://code.wireshark.org/review/25694
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-08 19:29:45 +00:00
Guy Harris 4d2d423106 Rename routines to clarify what they do.
XXX_prime_with_YYY makes it a bit clearer than does XXX_prime_YYY that
we're not priming YYY, we're priming XXX *using* YYY.

Change-Id: I1686b8b5469bc0f0bd6db8551fb6301776a1b133
Reviewed-on: https://code.wireshark.org/review/21031
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-12 04:56:49 +00:00
Michael Mann 1f5c3044f9 Localize decimal point on time formatted columns.
Have the decimal point for sub-second values be locale specific.

Change-Id: I670471e8e5db6291e364d124eb48ddbaa6d8ff26
Ping-Bug: 12500
Reviewed-on: https://code.wireshark.org/review/20621
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-03-22 04:59:39 +00:00
Dario Lombardo 7c0c580c4b wiretap: add cleanup routine.
The cleanup routine has been added to exit section of the applications.
Those which required a exit restyle have been patched as well.

Change-Id: I3a8787f0718ac7fef00dc58176869c7510fda7b1
Reviewed-on: https://code.wireshark.org/review/19949
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
2017-02-14 10:22:20 +00:00
Dario Lombardo 59fc668845 Clean columns on exit.
Change-Id: I950295c35fc67193d9825ebc741da151ad99e077
Reviewed-on: https://code.wireshark.org/review/19941
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-10 13:31:01 +00:00
Dario Lombardo 61956b8bf3 column-utils: add space to improve readability.
In tshark the UTF8 arrow overlaps the ports.
When pcap file has more than 999 packets the output is
no more aligned.

Bug: 12502
Change-Id: I07f90bbc0d2f065458bc07b7fde8f6a651951b60
Reviewed-on: https://code.wireshark.org/review/18109
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
2016-10-08 18:16:05 +00:00
Gerald Combs cf4fc7baf9 Use ws_printf routines everywhere in column-utils.c.
Change-Id: I8764b67b5ab320323c96fe21e5ebaa03815905fd
Reviewed-on: https://code.wireshark.org/review/16591
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-07-22 21:57:13 +00:00
Gerald Combs 913e0f408c Use Windows CRT string functions in some places.
Copy wsutil/wsprintf.h from change 16537. Update it to use functions
appropriate to Visual C++ >= 2015, < 2015, and everything else. Add
notes about specific API issues.

Update epan/expert.c to use ws_snprintf, since the VS profiler shows it
as a minor hot spot. This reduces load time for a large-ish capture from
~14s to ~12s here.

Migrate a previous column-utils change.

Change-Id: Id4064b7c06c35fd447b63c73f731afee181df4f9
Reviewed-on: https://code.wireshark.org/review/16483
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-21 20:09:03 +00:00
Gerald Combs 998ab7f7e5 Speed up col_append_ports on Windows.
Fill in our port information using StringCchPrintf on Windows instead
of g_snprintf. Loading a large-ish test capture here under the VS 2013
profiler showed that we spent 620 samples in col_append_ports. Switching
from g_snprintf to StringCchPrintf reduced that to six samples.

Inline col_snprint_port while we're here.

Change-Id: I955e5baa66ebb9cc950fc0eb1682d3c015c7a55a
Reviewed-on: https://code.wireshark.org/review/16416
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-07-13 22:23:05 +00:00
Michael Mann 0ef1d941ea Allow control of individual columns to be (un)writable.
Most protocols just want to limit COL_INFO or COL_PROTOCOL
so give that level of granularity.

Bug: 12144
Bug: 5117
Bug: 11144
Change-Id: I8de9b7d2c69e90d3fbfc0a52c2bd78c3de58e2f8
Reviewed-on: https://code.wireshark.org/review/15894
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-15 06:03:57 +00:00
Stig Bjørlykke cc679ca5ce Qt: Add check for field extractors
The proto tree is needed in several cases when using Lua field extractors,
because they fetch values from the tree.  Without a valid field extractor
a Lua plugin may misbehave and display wrong column info.

This fixes column issues when:
- Calling resetColumns() in Qt.  This involves adding a display filter,
  change time display format, change name resolution and other changes
  in UI which requires column updates.
- Print summary lines.
- Export as CSV and PSML.

Change-Id: Ieed6f8578cdf2759f1f836cd8413a4529b7bbd80
Reviewed-on: https://code.wireshark.org/review/13708
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-02-05 05:35:02 +00:00
Michael Mann 850f5d3be0 Remove the deprecated column types so users don't think they still exist.
Bug: 11559
Change-Id: I51836dc9a4fa399835c7bdabcba577ebd40327ad
Reviewed-on: https://code.wireshark.org/review/13538
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-01-27 07:54:24 +00:00
Guy Harris fa7cf8737c Rename ipv6-utils.h to ipv6.h.
By analogy to ipv4.h.

Change-Id: I147565b332024b1bb88e9cd15889255773d04524
Reviewed-on: https://code.wireshark.org/review/13034
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-03 21:42:32 +00:00
Stig Bjørlykke a6de714ee1 ui: Optimize col_custom_prime_edt()
The col_item->col_custom_fields_ids list does not change between
packet so this can be initialized in build_column_format_array().

Change-Id: I171b583912dbd1568c3d85159fac1ab435dcaa7c
Reviewed-on: https://code.wireshark.org/review/12801
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-12-22 05:17:02 +00:00
Stig Bjørlykke 8fe68db944 Add COL_CUSTOM_PRIME_REGEX
Use this as a common regex to split multi-field custom columns.

Change-Id: I40f76743284c5981c95d2e47d6d1d2a7f357d2ea
Reviewed-on: https://code.wireshark.org/review/12753
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-12-20 20:26:20 +00:00
Michal Labedzki 9bb3f6be4c Qt: Add missing multi-field column validation
GTK already has it, but Qt forgot about it, so multi-field custom column
works ok if previously saved in GTK-shark. Invalid validation prevent from
modifying and saving multi-field custom column in Qt version.

While at it, rename "custom field" to "custom fields" to ensure
we think about multi-field custom column.

Change-Id: I99588150ccb38be11b75f5dd5b0f6443e7055ebb
Reviewed-on: https://code.wireshark.org/review/12685
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-12-20 08:21:02 +00:00
João Valverde 24bfb7e35d column-utils: Refactor col_append_port() to col_append_ports()
Having a single function call to format source-destination port column info serves the
current (and presently only) use case better by having a single place to manage the
display format.

This commit does not introduce any actual formatting changes.

Change-Id: I1d479d0fd5690d12afb47e538057fdc2dd369ca2
Reviewed-on: https://code.wireshark.org/review/11539
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-07 21:15:11 +00:00
João Valverde 5823e6e50b Remove duplicate transport ports from proto tree summary
Don't display duplicate ports if transport name resolution is not
enabled (for UDP/TCP/DCCP).

Also introduce col_append_port() to handle info column port display
with name resolution in a uniform format.

Change-Id: Icb8ac45f726b7c539b4534c62061473e9b582753
Reviewed-on: https://code.wireshark.org/review/10804
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-11 23:54:28 +00:00
João Valverde 5d0b3c2f24 UDP: Make port column info similar to TCP, add length information
Change-Id: I3f7a35db53a1ecc9d543b80f143eb6082616e458
Reviewed-on: https://code.wireshark.org/review/10702
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-10-05 02:32:31 +00:00