aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2011-01-31 12:19:15 +0000
committerAnders Broman <anders.broman@ericsson.com>2011-01-31 12:19:15 +0000
commitb7527dd063ca82726c88981f9d61eb951a2b9a12 (patch)
tree5d7b7b9c4e230107bb89622f2b77c3429ab90ba1 /file.c
parent502ddd6cdb42f2dd779e9c16a5a9594ad5e0378e (diff)
From Cal Turney:
Bug 5621 - With String in Packet details searches, highlight row in tree https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5621 svn path=/trunk/; revision=35718
Diffstat (limited to 'file.c')
-rw-r--r--file.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/file.c b/file.c
index 65b35b554b..34526aed71 100644
--- a/file.c
+++ b/file.c
@@ -3408,14 +3408,6 @@ cf_change_time_formats(capture_file *cf)
}
#endif /* NEW_PACKET_LIST */
-
-typedef struct {
- const char *string;
- size_t string_len;
- capture_file *cf;
- gboolean frame_matched;
-} match_data;
-
gboolean
cf_find_packet_protocol_tree(capture_file *cf, const char *string,
search_direction dir)
@@ -3427,6 +3419,18 @@ cf_find_packet_protocol_tree(capture_file *cf, const char *string,
return find_packet(cf, match_protocol_tree, &mdata, dir);
}
+gboolean
+cf_find_string_protocol_tree(capture_file *cf, proto_tree *tree, match_data *mdata)
+{
+ mdata->frame_matched = FALSE;
+ mdata->string = convert_string_case(cf->sfilter, cf->case_type);
+ mdata->string_len = strlen(mdata->string);
+ mdata->cf = cf;
+ /* Iterate through all the nodes looking for matching text */
+ proto_tree_children_foreach(tree, match_subtree_text, mdata);
+ return mdata->frame_matched ? MR_MATCHED : MR_NOTMATCHED;
+}
+
static match_result
match_protocol_tree(capture_file *cf, frame_data *fdata, void *criterion)
{
@@ -3498,6 +3502,7 @@ match_subtree_text(proto_node *node, gpointer data)
if (c_match == string_len) {
/* No need to look further; we have a match */
mdata->frame_matched = TRUE;
+ mdata->finfo = fi;
return;
}
} else