Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
column.h
Go to the documentation of this file.
1
13#pragma once
14#include "ws_symbol_export.h"
15#include <epan/column-utils.h>
16
17#ifdef __cplusplus
18extern "C" {
19#endif /* __cplusplus */
20
24#define COLUMN_DISPLAY_VALUES 'U'
25#define COLUMN_DISPLAY_STRINGS 'R'
26#define COLUMN_DISPLAY_DETAILS 'D'
27
28typedef struct _fmt_data {
29 char *title; /* title of the column */
30 int fmt; /* format of column */
31 char *custom_fields; /* fields names for COL_CUSTOM */
32 int custom_occurrence; /* optional ordinal of occurrence of that field */
33 bool visible; /* if false, hide this column */
34 char display; /* how to display a custom field value */
35} fmt_data;
36
43WS_DLL_PUBLIC
44const char *col_format_to_string(const int fmt);
45
46WS_DLL_PUBLIC
47const char *col_format_desc(const int fmt_num);
48
49WS_DLL_PUBLIC
50const char *col_format_abbrev(const int fmt_num);
51
52WS_DLL_PUBLIC
53int get_column_format(const int col);
54
61WS_DLL_PUBLIC
62void set_column_format(const int col, const int fmt);
63
70WS_DLL_PUBLIC
71void get_column_format_matches(bool *fmt_list, const int format);
72
79WS_DLL_PUBLIC
80int get_column_format_from_str(const char *str);
81
88WS_DLL_PUBLIC
89char *get_column_title(const int col);
90
97WS_DLL_PUBLIC
98void set_column_title(const int col, const char *title);
99
106WS_DLL_PUBLIC
107bool get_column_visible(const int col);
108
115WS_DLL_PUBLIC
116void set_column_visible(const int col, bool visible);
117
124WS_DLL_PUBLIC
125char get_column_display_format(const int col);
126
133WS_DLL_PUBLIC
134void set_column_display_format(const int col, char display);
135
142WS_DLL_PUBLIC
143const char *get_column_custom_fields(const int col);
144
151WS_DLL_PUBLIC
152void set_column_custom_fields(const int col, const char *custom_fields);
153
160WS_DLL_PUBLIC
161int get_column_custom_occurrence(const int col);
162
169WS_DLL_PUBLIC
170void set_column_custom_occurrence(const int col, const int custom_occurrence);
171
180WS_DLL_PUBLIC
181const char *get_column_longest_string(const int format);
182
192WS_DLL_PUBLIC
193const char *get_column_width_string(const int format, const int col);
194
201WS_DLL_PUBLIC
202int get_column_char_width(const int format);
203
214WS_DLL_PUBLIC
215char *get_column_tooltip(const int col);
216
230WS_DLL_PUBLIC
231const char *get_column_text(column_info *cinfo, const int col);
232
238WS_DLL_PUBLIC
239void
241
249WS_DLL_PUBLIC
250void
251build_column_format_array(column_info *cinfo, const int num_cols, const bool reset_fences);
252
256WS_DLL_PUBLIC
258
273WS_DLL_PUBLIC
274bool parse_column_format(fmt_data *cfmt, const char *fmt);
275
287extern
288char * column_fmt_data_to_str(const fmt_data *cfmt);
289
298WS_DLL_PUBLIC
299void try_convert_to_custom_column(char **fmt);
300
309WS_DLL_PUBLIC
310const char* try_convert_to_column_field(const char *field);
311
319WS_DLL_PUBLIC
320void column_register_fields(void);
321#ifdef __cplusplus
322}
323#endif /* __cplusplus */
WS_DLL_PUBLIC int get_column_format_from_str(const char *str)
Get the column format number from a string representation.
Definition column.c:918
WS_DLL_PUBLIC void set_column_title(const int col, const char *title)
Set the title of a column.
Definition column.c:944
WS_DLL_PUBLIC const char * get_column_custom_fields(const int col)
Get custom fields for a specific column.
Definition column.c:1015
WS_DLL_PUBLIC void build_column_format_array(column_info *cinfo, const int num_cols, const bool reset_fences)
Build an array of column formats based on the provided parameters.
Definition column.c:1234
WS_DLL_PUBLIC void column_register_fields(void)
Registers all fields for Wireshark columns.
Definition column.c:1274
WS_DLL_PUBLIC void column_dump_column_formats(void)
Dump the available column formats and their descriptions to the console.
Definition column.c:403
WS_DLL_PUBLIC const char * try_convert_to_column_field(const char *field)
Checks a column field string to see if it is a name of a filter field created using a default column ...
Definition column.c:271
WS_DLL_PUBLIC bool get_column_visible(const int col)
Get the visibility status of a column.
Definition column.c:959
WS_DLL_PUBLIC char * get_column_tooltip(const int col)
Get the tooltip text of a column element.
Definition column.c:1100
WS_DLL_PUBLIC void get_column_format_matches(bool *fmt_list, const int format)
Get column format matches based on a boolean array and an integer value.
Definition column.c:472
WS_DLL_PUBLIC void set_column_display_format(const int col, char display)
Set the display format for a specific column.
Definition column.c:1001
WS_DLL_PUBLIC void set_column_custom_occurrence(const int col, const int custom_occurrence)
Set a custom occurrence for a specific column.
Definition column.c:1058
char * column_fmt_data_to_str(const fmt_data *cfmt)
Given a fmt_data struct, returns the column format string that should be written to the preferences t...
Definition column.c:366
WS_DLL_PUBLIC void try_convert_to_custom_column(char **fmt)
Checks a column format string to see if it is a deprecated column that has been migrated to a custom ...
Definition column.c:384
WS_DLL_PUBLIC const char * get_column_longest_string(const int format)
Get the text of a column element.
Definition column.c:788
WS_DLL_PUBLIC const char * col_format_to_string(const int fmt)
Convert a column format number to its corresponding string representation.
Definition column.c:36
WS_DLL_PUBLIC char * get_column_title(const int col)
Get the title of a column.
Definition column.c:930
WS_DLL_PUBLIC const char * get_column_text(column_info *cinfo, const int col)
Get the text of a column element.
Definition column.c:1142
WS_DLL_PUBLIC const char * get_column_width_string(const int format, const int col)
Get a string representing the width of a column.
Definition column.c:872
WS_DLL_PUBLIC void set_column_format(const int col, const int fmt)
Set the format for a column.
Definition column.c:904
WS_DLL_PUBLIC int get_column_custom_occurrence(const int col)
Get the custom occurrence of a column.
Definition column.c:1044
WS_DLL_PUBLIC void col_finalize(column_info *cinfo)
Finalizes a column by compiling custom filters and splitting fields.
Definition column.c:1156
WS_DLL_PUBLIC void set_column_visible(const int col, bool visible)
Set the visibility of a column.
Definition column.c:973
WS_DLL_PUBLIC void set_column_custom_fields(const int col, const char *custom_fields)
Set custom fields for a specific column.
Definition column.c:1029
WS_DLL_PUBLIC int get_column_char_width(const int format)
Get the character width of a column format.
Definition column.c:884
WS_DLL_PUBLIC char get_column_display_format(const int col)
Get the current display format for a column.
Definition column.c:987
WS_DLL_PUBLIC bool parse_column_format(fmt_data *cfmt, const char *fmt)
Parse a column format string into a fmt_data struct.
Definition column.c:299
Definition column.h:28
Definition column-info.h:59