diff options
author | John Thacker <johnthacker@gmail.com> | 2022-11-02 09:11:30 -0400 |
---|---|---|
committer | John Thacker <johnthacker@gmail.com> | 2022-11-02 19:46:11 +0000 |
commit | e449b560c02d363603224a7558758eb7da0c6a73 (patch) | |
tree | 11c5ac11bc7a8598d06c7dbbb9242eb8ec40fddd /epan/column-utils.c | |
parent | c6a0b9b64adcd5cbca616b0806045513523be08d (diff) |
epan: Properly generate filter expressions for custom columns
Properly generate filter expressions for custom columns by
using proto_construct_match_selected_string on each value and
then joining them together later instead of trying to split
the column expression value.
This ensures that escaping is done properly for display filter
strings, that commas internal to field values are not confused
with commas between occurrences, that for multifield columns
we can distinguish which field each value matches, etc.
It's not entirely clear whether AND or OR logic is appropriate
for multiple occurrences; currently OR is used.
Bump glib requirement to 2.54 for g_ptr_array_find_with_equal_func
(this doesn't drop support for any major distribution that already
meets our other library requirements, like Qt.)
Fix #18001.
Diffstat (limited to 'epan/column-utils.c')
-rw-r--r-- | epan/column-utils.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/epan/column-utils.c b/epan/column-utils.c index 62e1c423f0..a07e8cced3 100644 --- a/epan/column-utils.c +++ b/epan/column-utils.c @@ -383,6 +383,25 @@ col_custom_prime_edt(epan_dissect_t *edt, column_info *cinfo) } } +char* +col_custom_get_filter(epan_dissect_t *edt, column_info *cinfo, const gint col) +{ + col_item_t* col_item; + + ws_assert(cinfo); + ws_assert(col < cinfo->num_cols); + + col_item = &cinfo->columns[col]; + if (col_item->fmt_matx[COL_CUSTOM] && + col_item->col_custom_fields && + col_item->col_custom_fields_ids) { + + return proto_custom_get_filter(edt, col_item->col_custom_fields_ids, + col_item->col_custom_occurrence); + } + return NULL; +} + void col_append_lstr(column_info *cinfo, const gint el, const gchar *str1, ...) { |