Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
commandline.h File Reference
#include <epan/cfile.h>
#include "ui/capture_opts.h"

Go to the source code of this file.

Classes

struct  commandline_usage_app_data
 

Typedefs

typedef void(* commandline_usage_output_cb_t) (FILE *const output)
 
typedef struct commandline_usage_app_data commandline_usage_app_data_t
 

Functions

int commandline_early_options (int argc, char *argv[], commandline_usage_app_data_t *app_data)
 Process early command-line options.
 
const struct ws_optioncommandline_long_options (void)
 Retrieve the array of long options for command-line parsing.
 
const char * commandline_optstring (void)
 Returns a string containing all valid command-line options.
 
void commandline_override_prefs (int argc, char *argv[], bool opt_reset)
 Override preferences from command line arguments.
 
void commandline_other_options (capture_options *capture_opts, int argc, char *argv[], commandline_usage_app_data_t *app_data, bool opt_reset)
 Process other command-line options.
 
void commandline_options_drop (const char *module_name, const char *pref_name)
 Drop command line options for a specific module and preference.
 
void commandline_options_reapply (void)
 Reapply user-supplied command line options.
 
void commandline_options_apply_extcap (void)
 Apply external capture options based on command line arguments.
 
void commandline_options_free (void)
 Free command line options.
 
bool commandline_is_full_screen (void)
 Checks if Wireshark is running in full screen mode.
 
char * commandline_get_cf_name (void)
 Get the current capture file name.
 
char * commandline_get_rfilter (void)
 Get the current read filter.
 
char * commandline_get_dfilter (void)
 Get the display filter from the commandline.
 
char * commandline_get_jfilter (void)
 Get the current jump filter.
 
search_direction commandline_get_jump_direction (void)
 Get the jump direction from command line.
 
uint32_t commandline_get_go_to_packet (void)
 Retrieves the packet number to which the user wants to jump.
 

Detailed Description

Common command line handling between GUIs

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

Function Documentation

◆ commandline_early_options()

int commandline_early_options ( int  argc,
char *  argv[],
commandline_usage_app_data_t app_data 
)
extern

Process early command-line options.

Parameters
argcNumber of command-line arguments.
argvArray of command-line argument strings.
app_dataApplication-specific data structure.
Returns
Return code indicating success or failure.

◆ commandline_get_cf_name()

char * commandline_get_cf_name ( void  )
extern

Get the current capture file name.

Returns
The name of the current capture file.

◆ commandline_get_dfilter()

char * commandline_get_dfilter ( void  )
extern

Get the display filter from the commandline.

Returns
The current display filter.

◆ commandline_get_go_to_packet()

uint32_t commandline_get_go_to_packet ( void  )
extern

Retrieves the packet number to which the user wants to jump.

Returns
The packet number.

◆ commandline_get_jfilter()

char * commandline_get_jfilter ( void  )
extern

Get the current jump filter.

Returns
The jump filter as a string.

◆ commandline_get_jump_direction()

search_direction commandline_get_jump_direction ( void  )
extern

Get the jump direction from command line.

Returns
The jump direction (forward or backward).

◆ commandline_get_rfilter()

char * commandline_get_rfilter ( void  )
extern

Get the current read filter.

Returns
The read filter string.

◆ commandline_is_full_screen()

bool commandline_is_full_screen ( void  )
extern

Checks if Wireshark is running in full screen mode.

Returns
true if Wireshark is in full screen mode, false otherwise.

◆ commandline_long_options()

const struct ws_option * commandline_long_options ( void  )
extern

Retrieve the array of long options for command-line parsing.

Returns
Pointer to the array of long options.

◆ commandline_options_apply_extcap()

void commandline_options_apply_extcap ( void  )
extern

Apply external capture options based on command line arguments.

This function processes user-provided options related to external captures, setting preferences accordingly. It skips processing if external captures are disabled.

◆ commandline_options_drop()

void commandline_options_drop ( const char *  module_name,
const char *  pref_name 
)
extern

Drop command line options for a specific module and preference.

Parameters
module_nameThe name of the module.
pref_nameThe name of the preference.

◆ commandline_options_free()

void commandline_options_free ( void  )
extern

Free command line options.

This function frees all allocated memory for command line options.

◆ commandline_options_reapply()

void commandline_options_reapply ( void  )
extern

Reapply user-supplied command line options.

This function iterates through a list of user options and applies them using the prefs_set_pref function. It does not check the validity of these options again, assuming they were checked before being added to the list.

◆ commandline_optstring()

const char * commandline_optstring ( void  )
extern

Returns a string containing all valid command-line options.

Returns
A pointer to a static string containing the option string.

◆ commandline_other_options()

void commandline_other_options ( capture_options capture_opts,
int  argc,
char *  argv[],
commandline_usage_app_data_t app_data,
bool  opt_reset 
)
extern

Process other command-line options.

This function processes additional command-line options after epan_init() is called, handling various capture and display preferences.

Parameters
capture_optsCapture options structure (unused).
argcNumber of command-line arguments.
argvArray of command-line argument strings.
app_dataApplication-specific data structure.
opt_resetFlag indicating whether to reset options.

◆ commandline_override_prefs()

void commandline_override_prefs ( int  argc,
char *  argv[],
bool  opt_reset 
)
extern

Override preferences from command line arguments.

Parameters
argcNumber of command line arguments.
argvArray of command line argument strings.
opt_resetFlag to reset the options parser.