|
Wireshark 4.7.0
The Wireshark network protocol analyzer
|
Go to the source code of this file.
Macros | |
| #define | COL_MAX_LEN 2048 |
| #define | COL_MAX_INFO_LEN 4096 |
| #define | COL_CUSTOM_PRIME_REGEX "(?:^ *| *\\|\\| *| +or +| *$)(?![^(]*\\))" |
| #define | COL_ADD_LSTR_TERMINATOR (const char *) -1 |
Typedefs | |
| typedef struct epan_column_info | column_info |
Functions | |
| WS_DLL_PUBLIC bool | col_get_writable (column_info *cinfo, const int col) |
| Check if a column is writable. | |
| WS_DLL_PUBLIC void | col_set_writable (column_info *cinfo, const int col, const bool writable) |
| Set writability for either all columns or a specific column. | |
| WS_DLL_PUBLIC void | col_set_fence (column_info *cinfo, const int col) |
| Sets a fence for the current column content, so this content won't be affected by further col_... function calls. | |
| WS_DLL_PUBLIC void | col_clear_fence (column_info *cinfo, const int col) |
| Clears a fence for the current column content. | |
| WS_DLL_PUBLIC const char * | col_get_text (column_info *cinfo, const int col) |
| Gets the text of a column element. | |
| WS_DLL_PUBLIC void | col_clear (column_info *cinfo, const int col) |
| Clears the text of a column element. | |
| WS_DLL_PUBLIC void | col_set_str (column_info *cinfo, const int col, const char *str) |
| Set (replace) the text of a column element, the text won't be formatted or copied. | |
| WS_DLL_PUBLIC void | col_add_str (column_info *cinfo, const int col, const char *str) |
| Add (replace) the text of a column element, the text will be formatted and copied. | |
| WS_DLL_PUBLIC void | col_add_lstr (column_info *cinfo, const int el, const char *str,...) |
| Add (replace) the text of a column element using a printf-like format string. | |
| WS_DLL_PUBLIC void | col_add_fstr (column_info *cinfo, const int col, const char *format,...) |
| Add (replace) the text of a column element, the text will be formatted and copied. | |
| WS_DLL_PUBLIC void | col_append_str (column_info *cinfo, const int col, const char *str) |
| Append the given text to a column element, the text will be formatted and copied. | |
| WS_DLL_PUBLIC void | col_append_str_uint (column_info *cinfo, const int col, const char *abbrev, uint32_t val, const char *sep) |
| Append <abbrev>=<val> to a column element, the text will be copied. | |
| WS_DLL_PUBLIC void | col_append_ports (column_info *cinfo, const int col, port_type typ, uint16_t src, uint16_t dst) |
| Append a transport port pair to a column element, the text will be copied. | |
| WS_DLL_PUBLIC void | col_append_frame_number (packet_info *pinfo, const int col, const char *fmt_str, unsigned frame_num) |
| Append a frame number and signal that we have updated column information. | |
| WS_DLL_PUBLIC void | col_append_lstr (column_info *cinfo, const int el, const char *str,...) |
| Append the given strings (terminated by COL_ADD_LSTR_TERMINATOR) to a column element,. | |
| WS_DLL_PUBLIC void | col_append_fstr (column_info *cinfo, const int col, const char *format,...) |
| Append the given text to a column element, the text will be formatted and copied. | |
| WS_DLL_PUBLIC void | col_prepend_fstr (column_info *cinfo, const int col, const char *format,...) |
| Prepend the given text to a column element, the text will be formatted and copied. | |
| WS_DLL_PUBLIC void | col_prepend_fence_fstr (column_info *cinfo, const int col, const char *format,...) |
| Prepend the given text to a column element, the text will be formatted and copied. | |
| WS_DLL_PUBLIC void | col_append_sep_str (column_info *cinfo, const int col, const char *sep, const char *str) |
| Append the given text (prepended by a separator) to a column element. | |
| WS_DLL_PUBLIC void | col_append_sep_fstr (column_info *cinfo, const int col, const char *sep, const char *format,...) |
| Append the given text (prepended by a separator) to a column element. | |
| WS_DLL_PUBLIC void | col_set_time (column_info *cinfo, const int col, const nstime_t *ts, const char *fieldname) |
| Set the given (relative) time to a column element. | |
| WS_DLL_PUBLIC void | set_fd_time (const struct epan_session *epan, frame_data *fd, char *buf) |
| Set the time for a frame data structure. | |
Definitions for column utility structures and routines Utility routines used by packet*.c
Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs
SPDX-License-Identifier: GPL-2.0-or-later
| anonymous enum |
All of the possible columns in summary listing.
NOTE1: The entries MUST remain in this order, or else you need to reorder the slist[] and dlist[] arrays in column.c to match!
NOTE2: Please add the COL_XYZ entry in the appropriate spot, such that the dlist[] array remains in alphabetical order!
| WS_DLL_PUBLIC void col_add_fstr | ( | column_info * | cinfo, |
| const int | col, | ||
| const char * | format, | ||
| ... | |||
| ) |
Add (replace) the text of a column element, the text will be formatted and copied.
Unprintable characters according to g_ascii_isprint() are escaped.
Same function as col_add_str() but using a printf-like format string.
| cinfo | the current packet row |
| col | the column to use, e.g. COL_INFO |
| format | the format string |
| ... | the variable number of parameters |
| WS_DLL_PUBLIC void col_add_lstr | ( | column_info * | cinfo, |
| const int | el, | ||
| const char * | str, | ||
| ... | |||
| ) |
Add (replace) the text of a column element using a printf-like format string.
| cinfo | Pointer to the column information structure. |
| el | Column element index. |
| str | Format string followed by variable arguments. |
| WS_DLL_PUBLIC void col_add_str | ( | column_info * | cinfo, |
| const int | col, | ||
| const char * | str | ||
| ) |
Add (replace) the text of a column element, the text will be formatted and copied.
Unprintable characters according to g_ascii_isprint() are escaped.
| cinfo | the current packet row |
| col | the column to use, e.g. COL_INFO |
| str | the string to add |
| WS_DLL_PUBLIC void col_append_frame_number | ( | packet_info * | pinfo, |
| const int | col, | ||
| const char * | fmt_str, | ||
| unsigned | frame_num | ||
| ) |
Append a frame number and signal that we have updated column information.
| pinfo | the current packet info |
| col | the column to use, e.g. COL_INFO |
| fmt_str | format string, e.g. "reassembled in %u". |
| frame_num | frame number |
| WS_DLL_PUBLIC void col_append_fstr | ( | column_info * | cinfo, |
| const int | col, | ||
| const char * | format, | ||
| ... | |||
| ) |
Append the given text to a column element, the text will be formatted and copied.
Unprintable characters according to g_ascii_isprint() are escaped.
Same function as col_append_str() but using a printf-like format string.
| cinfo | the current packet row |
| col | the column to use, e.g. COL_INFO |
| format | the format string |
| ... | the variable number of parameters |
| WS_DLL_PUBLIC void col_append_lstr | ( | column_info * | cinfo, |
| const int | el, | ||
| const char * | str, | ||
| ... | |||
| ) |
Append the given strings (terminated by COL_ADD_LSTR_TERMINATOR) to a column element,.
Same result as col_append_str() called for every string element.
| WS_DLL_PUBLIC void col_append_ports | ( | column_info * | cinfo, |
| const int | col, | ||
| port_type | typ, | ||
| uint16_t | src, | ||
| uint16_t | dst | ||
| ) |
Append a transport port pair to a column element, the text will be copied.
| cinfo | the current packet row |
| col | the column to use, e.g. COL_INFO |
| typ | the port type to resolve, e.g. PT_UDP |
| src | the source port value to append |
| dst | the destination port value to append |
| WS_DLL_PUBLIC void col_append_sep_fstr | ( | column_info * | cinfo, |
| const int | col, | ||
| const char * | sep, | ||
| const char * | format, | ||
| ... | |||
| ) |
Append the given text (prepended by a separator) to a column element.
Unprintable characters according to g_ascii_isprint() are escaped.
Much like col_append_fstr() but will prepend the given separator if the column isn't empty.
| cinfo | the current packet row |
| col | the column to use, e.g. COL_INFO |
| sep | the separator string or NULL for default: ", " |
| format | the format string |
| ... | the variable number of parameters |
| WS_DLL_PUBLIC void col_append_sep_str | ( | column_info * | cinfo, |
| const int | col, | ||
| const char * | sep, | ||
| const char * | str | ||
| ) |
Append the given text (prepended by a separator) to a column element.
Unprintable characters according to g_ascii_isprint() are escaped.
Much like col_append_str() but will prepend the given separator if the column isn't empty.
| cinfo | the current packet row |
| col | the column to use, e.g. COL_INFO |
| sep | the separator string or NULL for default: ", " |
| str | the string to append |
| WS_DLL_PUBLIC void col_append_str | ( | column_info * | cinfo, |
| const int | col, | ||
| const char * | str | ||
| ) |
Append the given text to a column element, the text will be formatted and copied.
Unprintable characters according to g_ascii_isprint() are escaped.
| cinfo | the current packet row |
| col | the column to use, e.g. COL_INFO |
| str | the string to append |
| WS_DLL_PUBLIC void col_append_str_uint | ( | column_info * | cinfo, |
| const int | col, | ||
| const char * | abbrev, | ||
| uint32_t | val, | ||
| const char * | sep | ||
| ) |
Append <abbrev>=<val> to a column element, the text will be copied.
| cinfo | the current packet row |
| col | the column to use, e.g. COL_INFO |
| abbrev | the string to append |
| val | the value to append |
| sep | an optional separator to prepend to abbrev |
| WS_DLL_PUBLIC void col_clear | ( | column_info * | cinfo, |
| const int | col | ||
| ) |
Clears the text of a column element.
| cinfo | the current packet row |
| col | the column to use, e.g. COL_INFO |
| WS_DLL_PUBLIC void col_clear_fence | ( | column_info * | cinfo, |
| const int | col | ||
| ) |
Clears a fence for the current column content.
This can be useful if a protocol wants to remove whatever a previous protocol has added to the column.
| cinfo | the current packet row |
| col | the column to use, e.g. COL_INFO |
| WS_DLL_PUBLIC const char * col_get_text | ( | column_info * | cinfo, |
| const int | col | ||
| ) |
Gets the text of a column element.
| cinfo | the current packet row |
| col | the column to use, e.g. COL_INFO |
| WS_DLL_PUBLIC bool col_get_writable | ( | column_info * | cinfo, |
| const int | col | ||
| ) |
Check if a column is writable.
| cinfo | the current packet row |
| col | the writable column, -1 for checking the state of all columns |
| WS_DLL_PUBLIC void col_prepend_fence_fstr | ( | column_info * | cinfo, |
| const int | col, | ||
| const char * | format, | ||
| ... | |||
| ) |
Prepend the given text to a column element, the text will be formatted and copied.
Unprintable characters according to g_ascii_isprint() are escaped.
This function is similar to col_prepend_fstr() but this function will unconditionally set a fence to the end of the prepended data even if there were no fence before. The col_prepend_fstr() will only prepend the data before the fence IF there is already a fence created. This function will create a fence in case it does not yet exist.
| WS_DLL_PUBLIC void col_prepend_fstr | ( | column_info * | cinfo, |
| const int | col, | ||
| const char * | format, | ||
| ... | |||
| ) |
Prepend the given text to a column element, the text will be formatted and copied.
Unprintable characters according to g_ascii_isprint() are escaped.
| cinfo | the current packet row |
| col | the column to use, e.g. COL_INFO |
| format | the format string |
| ... | the variable number of parameters |
| WS_DLL_PUBLIC void col_set_fence | ( | column_info * | cinfo, |
| const int | col | ||
| ) |
Sets a fence for the current column content, so this content won't be affected by further col_... function calls.
This can be useful if a protocol is more than once in a single packet, e.g. multiple HTTP calls in a single TCP packet.
| cinfo | the current packet row |
| col | the column to use, e.g. COL_INFO |
| WS_DLL_PUBLIC void col_set_str | ( | column_info * | cinfo, |
| const int | col, | ||
| const char * | str | ||
| ) |
Set (replace) the text of a column element, the text won't be formatted or copied.
Use this for simple static strings like protocol names. Don't use for untrusted strings, strings that may contain unprintable characters, or strings which are freed before the packet_info (and hence column_info) struct.
Usually used to set const strings!
| cinfo | the current packet row |
| col | the column to use, e.g. COL_INFO |
| str | the string to set |
| WS_DLL_PUBLIC void col_set_time | ( | column_info * | cinfo, |
| const int | col, | ||
| const nstime_t * | ts, | ||
| const char * | fieldname | ||
| ) |
Set the given (relative) time to a column element.
Used by dissectors to set the time in a column
| cinfo | the current packet row |
| col | the column to use, e.g. COL_INFO |
| ts | the time to set in the column |
| fieldname | the fieldname to use for creating a filter (when applying/preparing/copying as filter) |
| WS_DLL_PUBLIC void col_set_writable | ( | column_info * | cinfo, |
| const int | col, | ||
| const bool | writable | ||
| ) |
Set writability for either all columns or a specific column.
| cinfo | the current packet row |
| col | the column to set, -1 for all |
| writable | true to be writable, false to not be writable |
| WS_DLL_PUBLIC void set_fd_time | ( | const struct epan_session * | epan, |
| frame_data * | fd, | ||
| char * | buf | ||
| ) |
Set the time for a frame data structure.
| epan | The current epan session. |
| fd | The frame data structure to set the time for. |
| buf | Buffer containing the time string. |