summaryrefslogtreecommitdiff
path: root/epan/color_filters.c
AgeCommit message (Collapse)AuthorFilesLines
2017-06-09Handle filter open and read errors better.Guy Harris1-70/+67
If the user's color filter file exists but can't be opened, fail and return a failure indication. If it doesn't exist, just try reading the global color filter file. If *that* exists but can't be opened, fail and return a failure indication; if it doesn't exist, don't treat that as an error. Change-Id: I5ebdc0eb1ada3cc190990be9228639304f32147e Reviewed-on: https://code.wireshark.org/review/22054 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-12Rename routines to clarify what they do.Guy Harris1-1/+1
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>
2016-10-04Color filters: Initialize a variable.Gerald Combs1-1/+1
Make sure temp_dfilter is initialized so that we don't end up freeing invalid memory. Change-Id: Id31969573690574846422b67c950188fd6ee4ef3 Reviewed-on: https://code.wireshark.org/review/18066 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-10-03Be more forgiving about invalid Coloring Rules.Gerald Combs1-1/+9
In ColoringRulesDialog: Only check a rule's display filter if that rule is enabled. This keeps us from disabling the OK button when we shouldn't. Adjust the "Your coloring rules file contains unknown rules" dialog text and buttons for accuracy. In color_filters.c: Don't try to compile disabled filters in color_filters_apply. Don't warn about disabled and invalid filters in read_filters_file. Bug: 12814 Change-Id: I7143bf8e7a6162d296f1e93769344b69763195c8 Reviewed-on: https://code.wireshark.org/review/17823 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: Michael Mann <mmann78@netscape.net>
2016-08-04Report the pathname of the color filter file in "Could not compile" messages.Guy Harris1-10/+10
This also fixes some cases where we wouldn't report the path in a read error message, as we'd already freed the path up and set the path string pointer to null. Change-Id: Ia0e1ca0bf4880075bfa1957b0778a177de1a824f Reviewed-on: https://code.wireshark.org/review/16868 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-29Don't discard unknown coloring rules.Gerald Combs1-2/+2
When processing the colorfilters file, keep and disable unknown coloring rules instead of skipping over and discarding them. This should hopefully keep people from losing the standard "Checksum Errors" rule (and it's less rude in general). Change-Id: I21796c25045d9dbf7612238ce3d27b613f1ec75f Reviewed-on: https://code.wireshark.org/review/16673 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: Michael Mann <mmann78@netscape.net>
2016-07-26Fix some of the checkAPIs.pl warnings for g_warning.Michael Mann1-1/+2
1. Create ws_g_warning for legitimate uses of g_warning 2. Use proto_tree_add_debug_text 3. Comment some out Change-Id: Ida044bf40286b955fdd529c4f9907c8e09b3d7c5 Reviewed-on: https://code.wireshark.org/review/16678 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-06-13Use getc_unlocked in a few places.Gerald Combs1-4/+4
Use getc_unlocked or _fgetc_nolock instead of getc in a few places. This reduces startup time by about 100ms here. Change-Id: I59ceb09678457c871cce79fcc3ce71998fe4f5af Reviewed-on: https://code.wireshark.org/review/14518 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-02-16const gpointer -> gconstpointerJoão Valverde1-1/+1
'const gpointer' is the same as 'void *const'. Replace with gconstpointer where straightforward (assuming that was the intent) and use gpointer everywhere else for clarity (that does not change *API* constness contract; it just means a variable is not declared immutable inside the called funtion). Change-Id: Iad2ef13205bfb4ff0056b2bce056353b58942267 Reviewed-on: https://code.wireshark.org/review/13945 Petri-Dish: Anders Broman <a.broman58@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-01-21Fix warning for epan/color-filters.c -[-Wcast-qual]João Valverde1-3/+3
Change-Id: I99ec380c844c597d397ec5d261d6bddac8d1999b Reviewed-on: https://code.wireshark.org/review/13449 Reviewed-by: João Valverde <j@v6e.pt>
2016-01-01Make color filters part of dissectionMichael Mann1-3/+4
Color filters can be seen as a function that takes a tree and display filters as input and a (possibly empty) coloring rule as output. This coloring rule is then added to the frame tree and used by the GUI for coloring the packets list. From an architectural POV, "coloring" is part of the UI component, but since it influences the tree, it is something for the dissection component. Bug: 5703 Bug: 6099 Change-Id: I73d132ec1dca7262bcb1b55c8481ca564c6161d1 Reviewed-on: https://code.wireshark.org/review/12507 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-01Get rid of trailing whitespace.Guy Harris1-3/+3
Change-Id: If6347938525194c08465b9b383edf8fb7eaf1e49 Reviewed-on: https://code.wireshark.org/review/12986 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-01No need for toolkit-dependent color initialization.Guy Harris1-48/+63
We're not allocating colors ourselves in GTK+ (and haven't been doing so since at least 1.12), and all color_t values are valid colors, so we don't need any toolkit-specific processing to fill in a color_t. While we're at it, catch read errors when reading color filter files. Change-Id: Ieb520d141cf15e371a31a01459d466c95ba2209b Reviewed-on: https://code.wireshark.org/review/12985 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-28Refactor GUI dependencies out of color_filters.[ch] and move it to epan ↵Michael Mann1-0/+843
directory. This also moved color.h into color_filters.h Change-Id: Ic19e27aa1b3ec67e764aa7ee8bbef7b1187bb12e Reviewed-on: https://code.wireshark.org/review/12831 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>