Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Macros | Functions
capture_ui_utils.h File Reference
#include "capture_opts.h"

Go to the source code of this file.

Macros

#define IFLIST_QUOTE_IF_DESCRIPTION   0x00000001
 
#define IFLIST_SHOW_FILTER   0x00000002
 

Functions

char * capture_dev_user_descr_find (const char *if_name)
 
int capture_dev_user_linktype_find (const char *if_name)
 
bool capture_dev_user_snaplen_find (const char *if_name, bool *hassnap, int *snaplen)
 
bool capture_dev_user_pmode_find (const char *if_name, bool *pmode)
 
char * capture_dev_user_cfilter_find (const char *if_name)
 
char * get_interface_descriptive_name (const capture_options *capture_opts, const char *if_name)
 
GList * build_capture_combo_list (GList *if_list, bool do_hide)
 
void free_capture_combo_list (GList *combo_list)
 
const char * get_if_name (const char *if_text)
 
void set_active_dlt (interface_t *device, int global_default_dlt)
 
GString * get_iface_list_string (capture_options *capture_opts, uint32_t style)
 

Detailed Description

Declarations of utilities for capture user interfaces

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

GList of available capture interfaces.

Macro Definition Documentation

◆ IFLIST_QUOTE_IF_DESCRIPTION

#define IFLIST_QUOTE_IF_DESCRIPTION   0x00000001

Get a descriptive string for a list of interfaces.

Parameters
capture_optsThe capture_options structure that contains the interfaces
styleflags to indicate the style of string to use:

IFLIST_QUOTE_IF_DESCRIPTION: put the interface descriptive string in single quotes

IFLIST_SHOW_FILTER: include the capture filters in the string

Returns
A GString set to the descriptive string

Function Documentation

◆ build_capture_combo_list()

GList * build_capture_combo_list ( GList *  if_list,
bool  do_hide 
)

Build the GList of available capture interfaces.

Parameters
if_listAn interface list from capture_interface_list().
do_hideHide the "hidden" interfaces.
Returns
A list of if_info_t structs (use free_capture_combo_list() later).

◆ capture_dev_user_cfilter_find()

char * capture_dev_user_cfilter_find ( const char *  if_name)

Find user-specified capture filter that matches interface name, if any.

This is deprecated and should not be used in new code.

Parameters
if_nameThe name of the interface.
Returns
The capture filter (must be g_free'd later) or NULL if not found.

◆ capture_dev_user_descr_find()

char * capture_dev_user_descr_find ( const char *  if_name)

Find user-specified capture device description that matches interface name, if any.

Parameters
if_nameThe name of the interface.
Returns
The device description (must be g_free'd later) or NULL if not found.

◆ capture_dev_user_linktype_find()

int capture_dev_user_linktype_find ( const char *  if_name)

Find user-specified link-layer header type that matches interface name, if any.

Parameters
if_nameThe name of the interface.
Returns
The link-layer header type (a DLT_) or -1 if not found.

◆ capture_dev_user_pmode_find()

bool capture_dev_user_pmode_find ( const char *  if_name,
bool *  pmode 
)

Find user-specified promiscuous mode that matches interface name, if any.

Parameters
if_nameThe name of the interface.
pmodePointer to a variable to be set to true if promiscuous mode should be used and false if it shouldn't be used.
Returns
true if found or false if not found.

◆ capture_dev_user_snaplen_find()

bool capture_dev_user_snaplen_find ( const char *  if_name,
bool *  hassnap,
int *  snaplen 
)

Find user-specified snap length that matches interface name, if any.

Parameters
if_nameThe name of the interface.
hassnapPointer to a variable to be set to true if the interface should be given a snap length or false if it shouldn't be given a snap length.
snaplenPointer to a variable to be set to the snap length if the interface should be given a snap length or the maximum snap length if it shouldn't be given a snap length.
Returns
true if found or false if not found.

◆ free_capture_combo_list()

void free_capture_combo_list ( GList *  combo_list)

Free the GList from build_capture_combo_list().

Parameters
combo_listthe interface list from build_capture_combo_list()

◆ get_if_name()

const char * get_if_name ( const char *  if_text)

Given text that contains an interface name possibly prefixed by an interface description, extract the interface name.

Parameters
if_textA string containing the interface description + name. This is usually the data from one of the list elements returned by build_capture_combo_list().
Returns
The raw interface name, without description (must NOT be g_free'd later)

◆ get_interface_descriptive_name()

char * get_interface_descriptive_name ( const capture_options capture_opts,
const char *  if_name 
)

Return as descriptive a name for an interface as we can get. If the user has specified a comment, use that. Otherwise, if the get_iface_list() method of capture_opts supplies a description, use that, otherwise use the interface name.

Parameters
capture_optsThe capture options to use to find the interface
if_nameThe name of the interface.
Returns
The descriptive name (must be g_free'd later)

◆ set_active_dlt()

void set_active_dlt ( interface_t device,
int  global_default_dlt 
)
extern

Set the active DLT for a device appropriately.

Parameters
devicethe device on which to set the active DLT
global_default_dltthe global default DLT