| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations | Functions | Variables
recent.h File Reference
Main window
`#include <glib.h>`
`#include <stdio.h>`
`#include "epan/timestamp.h"`
`#include "ui/ws_ui_util.h"`

Go to the source code of this file.

## Classes
struct | _col_width_data
| Stores the display width and alignment for a single column. More...
struct | recent_settings_tag
| Persisted GUI state and preferences restored across Wireshark sessions. More...

## Macros
#define | RECENT_KEY_CAPTURE_FILE "recent.capture_file"
#define | RECENT_KEY_DISPLAY_FILTER "recent.display_filter"
#define | RECENT_KEY_COL_WIDTH "column.width"
#define | RECENT_KEY_CAPTURE_FILTER "recent.capture_filter"
#define | RECENT_KEY_REMOTE_HOST "recent.remote_host"
#define | COLUMN_XALIGN_DEFAULT 0
#define | COLUMN_XALIGN_LEFT 'L'
#define | COLUMN_XALIGN_CENTER 'C'
#define | COLUMN_XALIGN_RIGHT 'R'

## Typedefs
typedef struct _col_width_data | col_width_data
| Stores the display width and alignment for a single column.
typedef struct recent_settings_tag | recent_settings_t
| Persisted GUI state and preferences restored across Wireshark sessions.

## Enumerations
enum | bytes_view_type { BYTES_HEX , BYTES_BITS , BYTES_DEC , BYTES_OCT }
| Numeric base used to render byte values in the Packet Bytes pane. More...
enum | bytes_encoding_type { BYTES_ENC_FROM_PACKET , BYTES_ENC_ASCII , BYTES_ENC_EBCDIC }
| Character encoding used to render the ASCII side-panel in the Packet Bytes pane. More...
enum | search_in_type { SEARCH_IN_PACKET_LIST , SEARCH_IN_PACKET_DETAILS , SEARCH_IN_PACKET_BYTES }
| Selects which packet pane the Find Packet search operates on. More...
enum | search_char_set_type { SEARCH_CHAR_SET_NARROW_AND_WIDE , SEARCH_CHAR_SET_NARROW , SEARCH_CHAR_SET_WIDE }
| Controls whether string searches match narrow (single-byte), wide (two-byte), or both character encodings. More...
enum | search_type_type { SEARCH_TYPE_DISPLAY_FILTER , SEARCH_TYPE_HEX_VALUE , SEARCH_TYPE_STRING , SEARCH_TYPE_REGEX }
| Specifies the matching method used by the Find Packet dialog. More...
enum | bytes_show_type { SHOW_ASCII , SHOW_ASCII_CONTROL , SHOW_CARRAY , SHOW_EBCDIC , SHOW_HEXDUMP , SHOW_HTML , SHOW_IMAGE , SHOW_JSON , SHOW_RAW , SHOW_RUSTARRAY , SHOW_CODEC , SHOW_YAML }
| Selects the presentation format for payload data in the Follow Stream and Show Packet Bytes dialogs. More...
enum | follow_delta_type { FOLLOW_DELTA_NONE , FOLLOW_DELTA_TURN , FOLLOW_DELTA_ALL }
| Controls display of inter-segment timing deltas in the Follow Stream dialog. More...
enum | bytes_decode_type { DecodeAsNone , DecodeAsBASE64 , DecodeAsCompressed , DecodeAsHexDigits , DecodeAsPercentEncoding , DecodeAsQuotedPrintable , DecodeAsROT13 }
| Secondary decode transformation applied to raw bytes before display in the Show Packet Bytes dialog. More...

## Functions
void | recent_init (void)
| Initialize recent settings module (done at startup).
void | recent_cleanup (void)
| Cleans up recent settings and frees allocated memory.
bool | write_recent (void)
| Write recent_common settings file.
bool | write_profile_recent (void)
| Write profile recent settings file.
bool | recent_read_static (char **rf_path_return, int *rf_errno_return)
| Read recent settings file (static part).
bool | recent_read_profile_static (char **rf_path_return, int *rf_errno_return)
| Read profile recent settings file (static part).
bool | recent_read_dynamic (char **rf_path_return, int *rf_errno_return)
| Read recent settings file (dynamic part).
int | recent_set_arg (char *prefarg)
| Given a -o command line string, parse it and set the recent value in question. Return an indication of whether it succeeded or failed in some fashion.
void | recent_free_column_width_info (recent_settings_t *rs)
| Free the recent settings list of column width information.
void | recent_insert_column (int col)
| Insert an entry in the recent column width setting for the given column, which should have been just added to the column list preference. (This keeps them in sync.).
void | recent_remove_column (int col)
| Remove an entry in the recent column width setting for the given column, which should have been just removed to the column list preference. (This keeps them in sync.).
void | recent_set_column_format (int col, int format)
| Set the column width for the given column.
int | recent_get_column_width (int col)
| Get the column width for the given column.
void | recent_set_column_width (int col, int width)
| Set the column width for the given column.
char | recent_get_column_xalign (int col)
| Get the column xalign for the given column.
void | recent_set_column_xalign (int col, char xalign)
| Set the column xalign for the given column.
void | window_geom_save (const char *name, window_geometry_t *geom)
| save the window and its current geometry into the geometry hashtable.
bool | window_geom_load (const char *name, window_geometry_t *geom)
| Load the desired geometry for this window from the geometry hashtable.
void | window_splitter_save (const char *name, const char *splitter_state)
| Save the splitter state for a given interface.
const char * | window_splitter_load (const char *name)
| Load the splitter state for a given interface.
GList * | recent_get_cfilter_list (const char *ifname)
| Returns a list of recent capture filters.
void | recent_add_cfilter (const char *ifname, const char *s)
| Add a capture filter to the global recent capture filter list or the recent capture filter list for an interface.
struct remote_host * | recent_get_remote_host (const char *host)
| Get the value of an entry for a remote host from the remote host list.
int | recent_get_remote_host_list_size (void)
| Get the number of entries of the remote host list.
void | recent_remote_host_list_foreach (GFunc func, void *user_data)
| Iterate over all items in the remote host list, calling a function for each member.
void | recent_free_remote_host_list (void)
| Free all entries of the remote host list.
void | recent_add_remote_host (char *host, struct remote_host *rh)
| Add an entry to the remote_host_list.

## Variables
recent_settings_t | recent

## Detailed Description

Definitions for recent "preference" handling routines Copyright 2004, Ulf Lamping ulf.l.nosp@m.ampi.nosp@m.ng@we.nosp@m.b.de

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

Recent user interface settings.

## Macro Definition Documentation

## ◆ COLUMN_XALIGN_DEFAULT

#define COLUMN_XALIGN_DEFAULT 0

Defines used in col_width_data.xalign

## ◆ RECENT_KEY_CAPTURE_FILE

#define RECENT_KEY_CAPTURE_FILE "recent.capture_file"

???.

## ◆ RECENT_KEY_DISPLAY_FILTER

#define RECENT_KEY_DISPLAY_FILTER "recent.display_filter"

???.

## Enumeration Type Documentation

## ◆ bytes_decode_type

enum bytes_decode_type

Secondary decode transformation applied to raw bytes before display in the Show Packet Bytes dialog.

Enumerator
DecodeAsNone | No secondary decoding; display raw bytes
DecodeAsBASE64 | Decode bytes as Base64-encoded data
DecodeAsCompressed | Decompress bytes using zlib/DEFLATE
DecodeAsHexDigits | Interpret bytes as an ASCII hex-digit string and decode to binary
DecodeAsPercentEncoding | Decode percent-encoded (URL-encoded) byte sequences
DecodeAsQuotedPrintable | Decode Quoted-Printable encoded data
DecodeAsROT13 | Apply ROT13 substitution cipher to the bytes

## ◆ bytes_encoding_type

enum bytes_encoding_type

Character encoding used to render the ASCII side-panel in the Packet Bytes pane.

Enumerator
BYTES_ENC_FROM_PACKET | Use the encoding recorded in the frame's frame_data packet_char_enc field
BYTES_ENC_ASCII | Always render characters using ASCII
BYTES_ENC_EBCDIC | Always render characters using EBCDIC

## ◆ bytes_show_type

enum bytes_show_type

Selects the presentation format for payload data in the Follow Stream and Show Packet Bytes dialogs.

Enumerator
SHOW_ASCII | Render payload as printable ASCII text
SHOW_ASCII_CONTROL | Render payload as ASCII with visible representations of control characters
SHOW_CARRAY | Render payload as a C-style byte array literal
SHOW_EBCDIC | Render payload decoded from EBCDIC to ASCII
SHOW_HEXDUMP | Render payload as an annotated hex dump
SHOW_HTML | Render payload as HTML in an embedded web view
SHOW_IMAGE | Render payload as an image
SHOW_JSON | Render payload as pretty-printed JSON
SHOW_RAW | Render payload as raw bytes with no interpretation
SHOW_RUSTARRAY | Render payload as a Rust-style byte array literal
SHOW_CODEC | Render payload decoded with a text codec; maps to UTF-8 in the combo box (other codecs generated at runtime)
SHOW_YAML | Render payload as YAML

## ◆ bytes_view_type

enum bytes_view_type

Numeric base used to render byte values in the Packet Bytes pane.

Enumerator
BYTES_HEX | Display bytes as hexadecimal (base 16)
BYTES_BITS | Display bytes as binary (base 2)
BYTES_DEC | Display bytes as decimal (base 10)
BYTES_OCT | Display bytes as octal (base 8)

## ◆ follow_delta_type

enum follow_delta_type

Controls display of inter-segment timing deltas in the Follow Stream dialog.

Enumerator
FOLLOW_DELTA_NONE | Do not show timing deltas
FOLLOW_DELTA_TURN | Show elapsed time at each direction change (turn)
FOLLOW_DELTA_ALL | Show elapsed time between every segment

## ◆ search_char_set_type

enum search_char_set_type

Controls whether string searches match narrow (single-byte), wide (two-byte), or both character encodings.

Enumerator
SEARCH_CHAR_SET_NARROW_AND_WIDE | Match both narrow (ASCII/single-byte) and wide (UTF-16/two-byte) strings
SEARCH_CHAR_SET_NARROW | Match narrow (ASCII/single-byte) strings only
SEARCH_CHAR_SET_WIDE | Match wide (UTF-16/two-byte) strings only

## ◆ search_in_type

enum search_in_type

Selects which packet pane the Find Packet search operates on.

Enumerator
SEARCH_IN_PACKET_LIST | Search within the summary strings visible in the packet list
SEARCH_IN_PACKET_DETAILS | Search within the decoded field tree in the packet details pane
SEARCH_IN_PACKET_BYTES | Search within the raw bytes in the packet bytes pane

## ◆ search_type_type

enum search_type_type

Specifies the matching method used by the Find Packet dialog.

Enumerator
SEARCH_TYPE_DISPLAY_FILTER | Match packets using a display filter expression
SEARCH_TYPE_HEX_VALUE | Match packets containing a specific hex byte sequence
SEARCH_TYPE_STRING | Match packets containing a plain text string
SEARCH_TYPE_REGEX | Match packets whose content matches a regular expression

## Function Documentation

## ◆ recent_add_cfilter()

void recent_add_cfilter | ( | const char * | ifname,
|  | const char * | s )
| extern

Add a capture filter to the global recent capture filter list or the recent capture filter list for an interface.

Parameters

  ifname | interface name; NULL refers to the global list.
  s | text of capture filter

Add a capture filter to the global recent capture filter list or the recent capture filter list for an interface.

Parameters

  ifname | interface name; NULL refers to the global list.
  s | text of capture filter

## ◆ recent_add_remote_host()

void recent_add_remote_host | ( | char * | host,
|  | struct remote_host * | rh )
| extern

Add an entry to the remote_host_list.

Parameters

  host | Key of the entry
  rh | Value of the entry

## ◆ recent_cleanup()

void recent_cleanup | ( | void |  | ) |
| extern

Cleans up recent settings and frees allocated memory.

Cleanup/Frees recent settings (done at shutdown)

## ◆ recent_free_column_width_info()

void recent_free_column_width_info | ( | recent_settings_t * | rs | ) |
| extern

Free the recent settings list of column width information.

Parameters

  rs | the recent settings (currently a global)

## ◆ recent_get_cfilter_list()

GList * recent_get_cfilter_list | ( | const char * | ifname | ) |
| extern

Returns a list of recent capture filters.

Parameters

  ifname | interface name; NULL refers to the global list.

Returns
  A GList containing the recent capture filters, or NULL if none are available.

Returns a list of recent capture filters.

Parameters

  ifname | interface name; NULL refers to the global list.

## ◆ recent_get_column_width()

int recent_get_column_width | ( | int | col | ) |
| extern

Get the column width for the given column.

Parameters

  col | column number

## ◆ recent_get_column_xalign()

char recent_get_column_xalign | ( | int | col | ) |
| extern

Get the column xalign for the given column.

Parameters

  col | column number

## ◆ recent_get_remote_host()

struct remote_host * recent_get_remote_host | ( | const char * | host | ) |
| extern

Get the value of an entry for a remote host from the remote host list.

Parameters

  host | host name for the remote host.

Returns
  pointer to the entry for the remote host.

## ◆ recent_get_remote_host_list_size()

int recent_get_remote_host_list_size | ( | void |  | ) |
| extern

Get the number of entries of the remote host list.

Returns
  number of entries in the list.

## ◆ recent_insert_column()

void recent_insert_column | ( | int | col | ) |
| extern

Insert an entry in the recent column width setting for the given column, which should have been just added to the column list preference. (This keeps them in sync.).

Parameters

  col | column number

## ◆ recent_read_dynamic()

bool recent_read_dynamic | ( | char ** | rf_path_return,
|  | int * | rf_errno_return )
| extern

Read recent settings file (dynamic part).

Parameters

  rf_path_return | path to recent file if function failed
  rf_errno_return | if failed

Returns
  true if succeeded, false if failed (check parameters for reason).

## ◆ recent_read_profile_static()

bool recent_read_profile_static | ( | char ** | rf_path_return,
|  | int * | rf_errno_return )
| extern

Read profile recent settings file (static part).

Parameters

  rf_path_return | path to recent file if function failed
  rf_errno_return | if failed

Returns
  true if succeeded, false if failed (check parameters for reason).

## ◆ recent_read_static()

bool recent_read_static | ( | char ** | rf_path_return,
|  | int * | rf_errno_return )
| extern

Read recent settings file (static part).

Parameters

  rf_path_return | path to recent file if function failed
  rf_errno_return | if failed

Returns
  true if succeeded, false if failed (check parameters for reason).

## ◆ recent_remote_host_list_foreach()

void recent_remote_host_list_foreach | ( | GFunc | func,
|  | void * | user_data )
| extern

Iterate over all items in the remote host list, calling a function for each member.

Parameters

  func | function to be called
  user_data | argument to pass as user data to the function

## ◆ recent_remove_column()

void recent_remove_column | ( | int | col | ) |
| extern

Remove an entry in the recent column width setting for the given column, which should have been just removed to the column list preference. (This keeps them in sync.).

Parameters

  col | column number

## ◆ recent_set_arg()

int recent_set_arg | ( | char * | prefarg | ) |
| extern

Given a -o command line string, parse it and set the recent value in question. Return an indication of whether it succeeded or failed in some fashion.

Parameters

  prefarg | a string of the form "<recent name>:<recent value>", as might appear as an argument to a "-o" command line option

Returns
  PREFS_SET_OK or PREFS_SET_SYNTAX_ERR

## ◆ recent_set_column_format()

void recent_set_column_format | ( | int | col,
|  | int | format )
| extern

Set the column width for the given column.

Parameters

  col | column number
  format | column format

## ◆ recent_set_column_width()

void recent_set_column_width | ( | int | col,
|  | int | width )
| extern

Set the column width for the given column.

Parameters

  col | column number
  width | column width

## ◆ recent_set_column_xalign()

void recent_set_column_xalign | ( | int | col,
|  | char | xalign )
| extern

Set the column xalign for the given column.

Parameters

  col | column number
  xalign | column alignment

## ◆ window_geom_load()

bool window_geom_load | ( | const char * | name,
|  | window_geometry_t * | geom )
| extern

Load the desired geometry for this window from the geometry hashtable.

Parameters

  name | The name of the window.
  geom | Pointer to the window_geometry_t structure to be filled with the geometry data.

Returns
  bool True if the geometry was successfully loaded, false otherwise.

## ◆ window_geom_save()

void window_geom_save | ( | const char * | name,
|  | window_geometry_t * | geom )
| extern

save the window and its current geometry into the geometry hashtable.

Parameters

  name | The name of the window.
  geom | Pointer to the window_geometry_t structure containing the geometry data.

Note
  This deep copies the window_geometry_t struct (including the qt_geom member) and does NOT take ownership of the original.

## ◆ window_splitter_load()

const char * window_splitter_load | ( | const char * | name | ) |
| extern

Load the splitter state for a given interface.

Parameters

  name | Interface name; NULL refers to the global list.

Returns
  const char* The state of the splitter, or NULL if not found.

## ◆ window_splitter_save()

void window_splitter_save | ( | const char * | name,
|  | const char * | splitter_state )
| extern

Save the splitter state for a given interface.

Parameters

  name | Interface name; NULL refers to the global list.
  splitter_state | The state of the splitter.

## ◆ write_profile_recent()

bool write_profile_recent | ( | void |  | ) |
| extern

Write profile recent settings file.

Returns
  true if succeeded, false if failed

## ◆ write_recent()

bool write_recent | ( | void |  | ) |
| extern

Write recent_common settings file.

Returns
  true if succeeded, false if failed

## Variable Documentation

## ◆ recent

recent_settings_t recent
| extern

Global recent settings.