aboutsummaryrefslogtreecommitdiffstats
path: root/epan/column-info.h
diff options
context:
space:
mode:
authorJohn Thacker <johnthacker@gmail.com>2022-11-02 09:11:30 -0400
committerJohn Thacker <johnthacker@gmail.com>2022-11-02 19:46:11 +0000
commite449b560c02d363603224a7558758eb7da0c6a73 (patch)
tree11c5ac11bc7a8598d06c7dbbb9242eb8ec40fddd /epan/column-info.h
parentc6a0b9b64adcd5cbca616b0806045513523be08d (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-info.h')
-rw-r--r--epan/column-info.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/epan/column-info.h b/epan/column-info.h
index 89fb024b22..85cccb16ae 100644
--- a/epan/column-info.h
+++ b/epan/column-info.h
@@ -75,7 +75,7 @@ extern void col_init(column_info *cinfo, const struct epan_session *epan);
*/
WS_DLL_PUBLIC void col_fill_in_frame_data(const frame_data *fd, column_info *cinfo, const gint col, gboolean const fill_col_exprs);
-/** Fill in all columns of the given packet.
+/** Fill in all (non-custom) columns of the given packet.
*/
WS_DLL_PUBLIC void col_fill_in(packet_info *pinfo, const gboolean fill_col_exprs, const gboolean fill_fd_colums);
@@ -94,6 +94,11 @@ void col_custom_set_edt(struct epan_dissect *edt, column_info *cinfo);
WS_DLL_PUBLIC
void col_custom_prime_edt(struct epan_dissect *edt, column_info *cinfo);
+/** Get a filter expression for a custom column. This string must be g_free'd.
+ */
+WS_DLL_PUBLIC
+char* col_custom_get_filter(struct epan_dissect *edt, column_info *cinfo, const gint col);
+
WS_DLL_PUBLIC
gboolean have_custom_cols(column_info *cinfo);