Go to the source code of this file.
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.
◆ IFLIST_QUOTE_IF_DESCRIPTION
#define IFLIST_QUOTE_IF_DESCRIPTION 0x00000001 |
Get a descriptive string for a list of interfaces.
- Parameters
-
capture_opts | The capture_options structure that contains the interfaces |
style | flags 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
◆ build_capture_combo_list()
GList * build_capture_combo_list |
( |
GList * |
if_list, |
|
|
bool |
do_hide |
|
) |
| |
◆ 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_name | The 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_name | The 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_name | The 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_name | The name of the interface. |
pmode | Pointer 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_name | The name of the interface. |
hassnap | Pointer 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. |
snaplen | Pointer 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 | ) |
|
◆ 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_text | A 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_opts | The capture options to use to find the interface |
if_name | The 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
-
device | the device on which to set the active DLT |
global_default_dlt | the global default DLT |