diff options
author | Michael Mann <mmann78@netscape.net> | 2016-03-09 17:23:22 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-03-12 03:05:07 +0000 |
commit | 7f8b3025ef1cde5b80c1e47e14b66a56f2fb9a5e (patch) | |
tree | 3b78802c59182e466fb5266993fc2e3b1816e162 /ui | |
parent | 28bfb3210537ce60895e10526f0a3e8cdfbd279d (diff) |
Walk up the tree view of Protocol Hierarchy Statistics to look for protocol matches.
Things like [Reassembled TCP segments] can add superfluous leaves so just walking down the tree from current location, so walk up the tree as well.
Bug: 1734
Change-Id: I91af554b59e1a6867dba9189ba37db5e396d892a
Reviewed-on: https://code.wireshark.org/review/14393
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/proto_hier_stats.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/ui/proto_hier_stats.c b/ui/proto_hier_stats.c index 0963a7bcf3..a4a6373099 100644 --- a/ui/proto_hier_stats.c +++ b/ui/proto_hier_stats.c @@ -42,10 +42,11 @@ static int pc_proto_id = -1; static GNode* find_stat_node(GNode *parent_stat_node, header_field_info *needle_hfinfo) { - GNode *needle_stat_node; + GNode *needle_stat_node, *up_parent_stat_node; header_field_info *hfinfo; - ph_stats_node_t *stats; + ph_stats_node_t *stats; + /* Look down the tree */ needle_stat_node = g_node_first_child(parent_stat_node); while (needle_stat_node) { @@ -56,6 +57,22 @@ find_stat_node(GNode *parent_stat_node, header_field_info *needle_hfinfo) needle_stat_node = g_node_next_sibling(needle_stat_node); } + /* Look up the tree */ + up_parent_stat_node = parent_stat_node; + while (up_parent_stat_node && up_parent_stat_node->parent) + { + needle_stat_node = g_node_first_child(up_parent_stat_node->parent); + while (needle_stat_node) { + hfinfo = STAT_NODE_HFINFO(needle_stat_node); + if (hfinfo && hfinfo->id == needle_hfinfo->id) { + return needle_stat_node; + } + needle_stat_node = g_node_next_sibling(needle_stat_node); + } + + up_parent_stat_node = up_parent_stat_node->parent; + } + /* None found. Create one. */ stats = g_new(ph_stats_node_t, 1); |