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
31typedef struct _fmt_data {
32 char *title;
33 int fmt;
36 bool visible;
37 char display;
39
46WS_DLL_PUBLIC
47const char *col_format_to_string(const int fmt);
48
55WS_DLL_PUBLIC
56const char *col_format_desc(const int fmt_num);
57
64WS_DLL_PUBLIC
65const char *col_format_abbrev(const int fmt_num);
66
73WS_DLL_PUBLIC
74int get_column_format(const int col);
75
82WS_DLL_PUBLIC
83void set_column_format(const int col, const int fmt);
84
91WS_DLL_PUBLIC
92void get_column_format_matches(bool *fmt_list, const int format);
93
100WS_DLL_PUBLIC
101int get_column_format_from_str(const char *str);
102
109WS_DLL_PUBLIC
110char *get_column_title(const int col);
111
118WS_DLL_PUBLIC
119void set_column_title(const int col, const char *title);
120
127WS_DLL_PUBLIC
128bool get_column_visible(const int col);
129
136WS_DLL_PUBLIC
137void set_column_visible(const int col, bool visible);
138
145WS_DLL_PUBLIC
146char get_column_display_format(const int col);
147
154WS_DLL_PUBLIC
155void set_column_display_format(const int col, char display);
156
163WS_DLL_PUBLIC
164const char *get_column_custom_fields(const int col);
165
172WS_DLL_PUBLIC
173void set_column_custom_fields(const int col, const char *custom_fields);
174
181WS_DLL_PUBLIC
182int get_column_custom_occurrence(const int col);
183
190WS_DLL_PUBLIC
191void set_column_custom_occurrence(const int col, const int custom_occurrence);
192
201WS_DLL_PUBLIC
202const char *get_column_longest_string(const int format);
203
213WS_DLL_PUBLIC
214const char *get_column_width_string(const int format, const int col);
215
222WS_DLL_PUBLIC
223int get_column_char_width(const int format);
224
235WS_DLL_PUBLIC
236char *get_column_tooltip(const int col);
237
251WS_DLL_PUBLIC
252const char *get_column_text(column_info *cinfo, const int col);
253
259WS_DLL_PUBLIC
260void
262
270WS_DLL_PUBLIC
271void
272build_column_format_array(column_info *cinfo, const int num_cols, const bool reset_fences);
273
277WS_DLL_PUBLIC
279
294WS_DLL_PUBLIC
295bool parse_column_format(fmt_data *cfmt, const char *fmt);
296
308extern
309char * column_fmt_data_to_str(const fmt_data *cfmt);
310
319WS_DLL_PUBLIC
320void try_convert_to_custom_column(char **fmt);
321
330WS_DLL_PUBLIC
331const char* try_convert_to_column_field(const char *field);
332
340WS_DLL_PUBLIC
341void column_register_fields(void);
342#ifdef __cplusplus
343}
344#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:920
WS_DLL_PUBLIC void set_column_title(const int col, const char *title)
Set the title of a column.
Definition column.c:946
WS_DLL_PUBLIC const char * get_column_custom_fields(const int col)
Get custom fields for a specific column.
Definition column.c:1017
WS_DLL_PUBLIC const char * col_format_abbrev(const int fmt_num)
Get the abbreviation of a column format.
Definition column.c:172
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:1237
WS_DLL_PUBLIC void column_register_fields(void)
Registers all fields for Wireshark columns.
Definition column.c:1277
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:961
WS_DLL_PUBLIC int get_column_format(const int col)
Get the format of a column.
Definition column.c:892
WS_DLL_PUBLIC char * get_column_tooltip(const int col)
Get the tooltip text of a column element.
Definition column.c:1102
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:474
WS_DLL_PUBLIC void set_column_display_format(const int col, char display)
Set the display format for a specific column.
Definition column.c:1003
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:1060
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:790
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:932
WS_DLL_PUBLIC const char * get_column_text(column_info *cinfo, const int col)
Get the text of a column element.
Definition column.c:1144
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:874
WS_DLL_PUBLIC void set_column_format(const int col, const int fmt)
Set the format for a column.
Definition column.c:906
WS_DLL_PUBLIC int get_column_custom_occurrence(const int col)
Get the custom occurrence of a column.
Definition column.c:1046
struct _fmt_data fmt_data
Describes the configuration of a single column in the packet list.
WS_DLL_PUBLIC void col_finalize(column_info *cinfo)
Finalizes a column by compiling custom filters and splitting fields.
Definition column.c:1158
WS_DLL_PUBLIC void set_column_visible(const int col, bool visible)
Set the visibility of a column.
Definition column.c:975
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:1031
WS_DLL_PUBLIC int get_column_char_width(const int format)
Get the character width of a column format.
Definition column.c:886
WS_DLL_PUBLIC char get_column_display_format(const int col)
Get the current display format for a column.
Definition column.c:989
WS_DLL_PUBLIC const char * col_format_desc(const int fmt_num)
Get the description of a column format.
Definition column.c:101
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
Describes the configuration of a single column in the packet list.
Definition column.h:31
bool visible
Definition column.h:36
int custom_occurrence
Definition column.h:35
int fmt
Definition column.h:33
char * title
Definition column.h:32
char display
Definition column.h:37
char * custom_fields
Definition column.h:34
Definition column-info.h:59