From c0792555392f234ab96917e784d365b5de053836 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 11 Apr 2017 19:53:48 -0700 Subject: Add an API to let a postdissector specify fields whose values it needs. Currently, this is only used to determine whether a protocol tree needs to be built on the first pass or not - if there are postdissectors that need fields, it does - but eventually we should be able to use it to prime the dissection to deliver those fields in cases where we don't need the *entire* protocol tree (rather than using a hack such as cooking up a fake tap with a fake filter to do that). Update MATE and TRANSUM to use it. Clean up code to check whether we need a protocol tree, and add comments before that code indicating, in each case, what the criteria are. The array of postdissectors includes a length, so we don't need to separately keep track of the number of postdissectors. Clean up indentation while we're at it. Change-Id: I71d4025848206d144bc54cc82941089a50e80ab7 Reviewed-on: https://code.wireshark.org/review/21029 Reviewed-by: Guy Harris --- ui/gtk/packet_list_store.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ui/gtk') diff --git a/ui/gtk/packet_list_store.c b/ui/gtk/packet_list_store.c index 76ffb8e6ec..2ea5d00a81 100644 --- a/ui/gtk/packet_list_store.c +++ b/ui/gtk/packet_list_store.c @@ -1148,6 +1148,16 @@ packet_list_dissect_and_cache_record(PacketList *packet_list, PacketListRecord * return; /* error reading the record */ } + /* + * Determine whether we need to create a protocol tree. + * We do if: + * + * we're going to apply a color filter to this packet; + * + * we're need to fill in the columns and we have custom columns + * (which require field values, which currently requires that + * we build a protocol tree). + */ create_proto_tree = (dissect_color && color_filters_used()) || (dissect_columns && have_custom_cols(cinfo)); -- cgit v1.2.3