| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
column-info.h
Go to the documentation of this file.
1/* column-info.h
2 * Definitions for internal column structures and routines
3 *
4 * For internal Wireshark use only. Don't include this header in dissectors!
5 *
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
9 *
10 * SPDX-License-Identifier: GPL-2.0-or-later
11 */
12#pragma once
13#include <epan/column-utils.h>
14
15#ifdef __cplusplus
16 extern "C" {
17#endif /* __cplusplus */
18
22
23 typedef struct _proto_node proto_tree;
24
25#define COLUMN_FIELD_FILTER "_ws.col."
26
28 typedef struct {
29 const char **col_expr;
30 char **col_expr_val;
31} col_expr_t;
32
36 typedef struct {
37 char *dftext;
38 struct epan_dfilter *dfilter;
39 int field_id;
40} col_custom_t;
41
43 typedef struct {
44 int col_fmt;
45 bool *fmt_matx;
46 char *col_title;
47 char *col_custom_fields;
48 int col_custom_occurrence;
49 GSList *col_custom_fields_ids;
50 struct epan_dfilter *col_custom_dfilter;
51 const char *col_data;
52 char *col_buf;
53 int col_fence;
54 bool writable;
55 int hf_id;
56} col_item_t;
57
59 struct epan_column_info {
60 const struct epan_session *epan;
61 unsigned num_cols;
62 col_item_t *columns;
63 int *col_first;
64 int *col_last;
65 col_expr_t col_expr;
66 bool writable;
67 GRegex *prime_regex;
68};
69
80WS_DLL_PUBLIC void col_setup(column_info *cinfo, const int num_cols);
81
89WS_DLL_PUBLIC void col_cleanup(column_info *cinfo);
90
97 extern void col_init(column_info *cinfo, const struct epan_session *epan);
98
101WS_DLL_PUBLIC void col_fill_in_frame_data(const frame_data *fd, column_info *cinfo, const int col, bool const fill_col_exprs);
102
105WS_DLL_PUBLIC void col_fill_in(packet_info *pinfo, const bool fill_col_exprs, const bool fill_fd_colums);
106
111WS_DLL_PUBLIC void col_fill_in_error(column_info *cinfo, frame_data *fdata, const bool fill_col_exprs, const bool fill_fd_colums);
112
115WS_DLL_PUBLIC bool col_data_changed(void);
116
125 void col_custom_set_edt(struct epan_dissect *edt, column_info *cinfo);
126
133WS_DLL_PUBLIC
134 void col_custom_prime_edt(struct epan_dissect *edt, column_info *cinfo);
135
138WS_DLL_PUBLIC
139 char* col_custom_get_filter(struct epan_dissect *edt, column_info *cinfo, const unsigned col);
140
147WS_DLL_PUBLIC
148 bool have_custom_cols(column_info *cinfo);
149
155WS_DLL_PUBLIC
156 bool have_field_extractors(void);
157
165WS_DLL_PUBLIC
166 bool col_has_time_fmt(column_info *cinfo, const unsigned col);
167
175WS_DLL_PUBLIC
176 bool col_based_on_frame_data(column_info *cinfo, const unsigned col);
177
183 void
184 col_register_protocol(void);
185
196 extern
197 void col_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
198
199#ifdef __cplusplus
200}
201#endif /* __cplusplus */
col_custom_set_edt
void col_custom_set_edt(struct epan_dissect *edt, column_info *cinfo)
Set custom data type for a column in an epan_dissect structure.
Definition column-utils.c:356
have_custom_cols
WS_DLL_PUBLIC bool have_custom_cols(column_info *cinfo)
Checks if there are custom columns in the given column_info structure.
Definition column-utils.c:340
col_init
void col_init(column_info *cinfo, const struct epan_session *epan)
Initialize the data structures for constructing column data.
Definition column-utils.c:144
have_field_extractors
WS_DLL_PUBLIC bool have_field_extractors(void)
Checks if field extractors are available.
Definition column-utils.c:346
col_fill_in
WS_DLL_PUBLIC void col_fill_in(packet_info *pinfo, const bool fill_col_exprs, const bool fill_fd_colums)
Definition column-utils.c:2038
col_data_changed
WS_DLL_PUBLIC bool col_data_changed(void)
Definition column-utils.c:2195
col_fill_in_error
WS_DLL_PUBLIC void col_fill_in_error(column_info *cinfo, frame_data *fdata, const bool fill_col_exprs, const bool fill_fd_colums)
Definition column-utils.c:2165
col_fill_in_frame_data
WS_DLL_PUBLIC void col_fill_in_frame_data(const frame_data *fd, column_info *cinfo, const int col, bool const fill_col_exprs)
Definition column-utils.c:1958
col_dissect
void col_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
Dissects and populates columns in a packet display tree.
Definition column-utils.c:2220
col_custom_prime_edt
WS_DLL_PUBLIC void col_custom_prime_edt(struct epan_dissect *edt, column_info *cinfo)
Prime custom columns in an epan_dissect structure.
Definition column-utils.c:411
col_register_protocol
void col_register_protocol(void)
Registers the protocol columns for Wireshark.
Definition column-utils.c:2202
col_custom_get_filter
WS_DLL_PUBLIC char * col_custom_get_filter(struct epan_dissect *edt, column_info *cinfo, const unsigned col)
Definition column-utils.c:435
col_has_time_fmt
WS_DLL_PUBLIC bool col_has_time_fmt(column_info *cinfo, const unsigned col)
Check if a column has any time format.
Definition column-utils.c:976
col_cleanup
WS_DLL_PUBLIC void col_cleanup(column_info *cinfo)
Release all column‑handling data structures.
Definition column-utils.c:106
col_setup
WS_DLL_PUBLIC void col_setup(column_info *cinfo, const int num_cols)
Allocate and initialize column‑handling structures.
Definition column-utils.c:61
col_based_on_frame_data
WS_DLL_PUBLIC bool col_based_on_frame_data(column_info *cinfo, const unsigned col)
Determines if a column is based on frame data.
Definition column-utils.c:1930
column-utils.h
frame_data
DIAG_OFF_PEDANTIC struct _frame_data frame_data
Frame data structure.
packet_info
struct _packet_info packet_info
Represents the metadata and indexing information for a single captured frame.
_proto_node
Definition proto.h:914
col_custom_t
Definition column-info.h:36
col_custom_t::dftext
char * dftext
Definition column-info.h:37
col_custom_t::dfilter
struct epan_dfilter * dfilter
Definition column-info.h:38
col_custom_t::field_id
int field_id
Definition column-info.h:39
col_expr_t
Definition column-info.h:28
col_expr_t::col_expr
const char ** col_expr
Definition column-info.h:29
col_expr_t::col_expr_val
char ** col_expr_val
Definition column-info.h:30
col_item_t
Definition column-info.h:43
col_item_t::col_data
const char * col_data
Definition column-info.h:51
col_item_t::col_custom_occurrence
int col_custom_occurrence
Definition column-info.h:48
col_item_t::col_custom_dfilter
struct epan_dfilter * col_custom_dfilter
Definition column-info.h:50
col_item_t::col_custom_fields_ids
GSList * col_custom_fields_ids
Definition column-info.h:49
col_item_t::col_fence
int col_fence
Definition column-info.h:53
col_item_t::col_buf
char * col_buf
Definition column-info.h:52
col_item_t::col_fmt
int col_fmt
Definition column-info.h:44
col_item_t::fmt_matx
bool * fmt_matx
Definition column-info.h:45
col_item_t::col_title
char * col_title
Definition column-info.h:46
col_item_t::col_custom_fields
char * col_custom_fields
Definition column-info.h:47
col_item_t::writable
bool writable
Definition column-info.h:54
epan_column_info
Definition column-info.h:59
epan_column_info::col_first
int * col_first
Definition column-info.h:63
epan_column_info::prime_regex
GRegex * prime_regex
Definition column-info.h:67
epan_column_info::num_cols
unsigned num_cols
Definition column-info.h:61
epan_column_info::col_expr
col_expr_t col_expr
Definition column-info.h:65
epan_column_info::writable
bool writable
Definition column-info.h:66
epan_column_info::col_last
int * col_last
Definition column-info.h:64
epan_column_info::columns
col_item_t * columns
Definition column-info.h:62
epan_dfilter
The compiled display filter object passed back to the user.
Definition dfilter-int.h:46
epan_dissect
Holds all state for the dissection of a single byte array, including session, buffer,...
Definition epan_dissect.h:28
epan_session
Definition epan.c:532