aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dfilter
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2016-02-03 23:10:40 +0100
committerAnders Broman <a.broman58@gmail.com>2016-02-05 05:35:02 +0000
commitcc679ca5ce9af9fb0dc9afe360d12654f6b4027a (patch)
treee68fdf9627cfbfbb4a827721d7a2db0d1f2cf421 /epan/dfilter
parent4c144c5d8c4c3f289a8b89a19bb9843cf9584d0e (diff)
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>
Diffstat (limited to 'epan/dfilter')
-rw-r--r--epan/dfilter/dfilter.c6
-rw-r--r--epan/dfilter/dfilter.h4
2 files changed, 10 insertions, 0 deletions
diff --git a/epan/dfilter/dfilter.c b/epan/dfilter/dfilter.c
index a843bbe936..df24b1ced7 100644
--- a/epan/dfilter/dfilter.c
+++ b/epan/dfilter/dfilter.c
@@ -415,6 +415,12 @@ dfilter_prime_proto_tree(const dfilter_t *df, proto_tree *tree)
}
}
+gboolean
+dfilter_has_interesting_fields(const dfilter_t *df)
+{
+ return (df->num_interesting_fields > 0);
+}
+
GPtrArray *
dfilter_deprecated_tokens(dfilter_t *df) {
if (df->deprecated && df->deprecated->len > 0) {
diff --git a/epan/dfilter/dfilter.h b/epan/dfilter/dfilter.h
index 1bbf907ec4..0b24b3d62b 100644
--- a/epan/dfilter/dfilter.h
+++ b/epan/dfilter/dfilter.h
@@ -80,6 +80,10 @@ dfilter_apply(dfilter_t *df, proto_tree *tree);
void
dfilter_prime_proto_tree(const dfilter_t *df, proto_tree *tree);
+/* Check if dfilter has interesting fields */
+gboolean
+dfilter_has_interesting_fields(const dfilter_t *df);
+
WS_DLL_PUBLIC
GPtrArray *
dfilter_deprecated_tokens(dfilter_t *df);