Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations | Functions
/builds/wireshark/wireshark/extcap.h File Reference
#include <glib.h>
#include <wsutil/plugins.h>
#include "capture/capture_session.h"
#include <ui/capture_ui_utils.h>

Go to the source code of this file.

Classes

struct  _extcap_info
 

Macros

#define EXTCAP_BOOLEAN_REGEX   "^.*([yt1-9])"
 
#define EXTCAP_PIPE_PREFIX   "wireshark_extcap"
 
#define EXTCAP_CONTROL_IN_PREFIX   "wireshark_control_ext_to_ws"
 
#define EXTCAP_CONTROL_OUT_PREFIX   "wireshark_control_ws_to_ext"
 
#define EXTCAP_ARGUMENT_CONFIG   "--extcap-config"
 
#define EXTCAP_ARGUMENT_RELOAD_OPTION   "--extcap-reload-option"
 
#define EXTCAP_ARGUMENT_LIST_INTERFACES   "--extcap-interfaces"
 
#define EXTCAP_ARGUMENT_INTERFACE   "--extcap-interface"
 
#define EXTCAP_ARGUMENT_LIST_DLTS   "--extcap-dlts"
 
#define EXTCAP_ARGUMENT_VERSION   "--extcap-version"
 
#define EXTCAP_ARGUMENT_RUN_CAPTURE   "--capture"
 
#define EXTCAP_ARGUMENT_CAPTURE_FILTER   "--extcap-capture-filter"
 
#define EXTCAP_ARGUMENT_RUN_PIPE   "--fifo"
 
#define EXTCAP_ARGUMENT_CONTROL_IN   "--extcap-control-in"
 
#define EXTCAP_ARGUMENT_CONTROL_OUT   "--extcap-control-out"
 

Typedefs

typedef struct _extcap_info extcap_info
 
typedef void(* extcap_plugin_description_callback) (const char *, const char *, const char *, const char *, void *)
 

Enumerations

enum  extcap_filter_status { EXTCAP_FILTER_UNKNOWN , EXTCAP_FILTER_VALID , EXTCAP_FILTER_INVALID }
 

Functions

void extcap_register_preferences (void)
 
if_capabilities_textcap_get_if_dlts (const char *ifname, char **err_str)
 
GList * append_extcap_interface_list (GList *list)
 
extcap_infoextcap_get_tool_info (const char *toolname)
 
extcap_infoextcap_get_tool_by_ifname (const char *ifname)
 
char * extcap_get_help_for_ifname (const char *ifname)
 
void extcap_clear_interfaces (void)
 
void extcap_get_descriptions (extcap_plugin_description_callback callback, void *callback_data)
 
void extcap_dump_all (void)
 
GList * extcap_get_if_configuration (const char *ifname)
 
GList * extcap_get_if_configuration_values (const char *ifname, const char *argname, GHashTable *arguments)
 
extcap_filter_status extcap_verify_capture_filter (const char *ifname, const char *filter, char **err_str)
 
void extcap_free_if_configuration (GList *list, bool free_args)
 
bool extcap_has_configuration (const char *ifname)
 
bool extcap_requires_configuration (const char *ifname)
 
bool extcap_has_toolbar (const char *ifname)
 
void extcap_request_stop (capture_session *cap_session)
 
struct preferenceextcap_pref_for_argument (const char *ifname, struct _extcap_arg *arg)
 
void extcap_cleanup (void)
 

Detailed Description

Definitions for extcap external capture Copyright 2013, Mike Ryan miker.nosp@m.yan@.nosp@m.lackl.nosp@m.ustr.nosp@m.e.net

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

◆ append_extcap_interface_list()

GList * append_extcap_interface_list ( GList *  list)

Append a list of all extcap capture interfaces to the specified list. Initializes the extcap interface list if that hasn't already been done.

Parameters
listAn existing GList of if_info_t.
Returns
An updated list on success, an unchanged list on failure.

◆ extcap_cleanup()

void extcap_cleanup ( void  )

Clean up global extcap stuff on program exit.

Releases the dynamic preference value pointers. Must not be called before prefs_cleanup since these pointers could still be in use.

◆ extcap_clear_interfaces()

void extcap_clear_interfaces ( void  )

Remove all loaded extcap interfaces.

◆ extcap_dump_all()

void extcap_dump_all ( void  )

Print information about all available extcap executables. Initializes the extcap interface list if that hasn't already been done.

◆ extcap_free_if_configuration()

void extcap_free_if_configuration ( GList *  list,
bool  free_args 
)

Frees the memory from extcap_get_if_configuration.

Parameters
listThe list returned by extcap_get_if_configuration.
free_argstrue if all arguments in the list must be freed too or false if the ownership of the arguments is taken by the caller.

◆ extcap_get_descriptions()

void extcap_get_descriptions ( extcap_plugin_description_callback  callback,
void *  callback_data 
)

Retrieves information about all available extcap executables. Initializes the extcap interface list if that hasn't already been done.

Parameters
callbackThe description callback routine.
callback_dataData to be passed to the callback routine.

◆ extcap_get_help_for_ifname()

char * extcap_get_help_for_ifname ( const char *  ifname)

Retrieves help information for an extcap interface. Initializes the extcap interface list if that hasn't already been done.

Parameters
ifnameThe extcap interface name.
Returns
A help string on success or NULL on failure.

◆ extcap_get_if_configuration()

GList * extcap_get_if_configuration ( const char *  ifname)

Returns the configuration for the given interface name, or an empty list, if no configuration has been found. Initializes the extcap interface list if that hasn't already been done.

Parameters
ifnameThe interface name.

◆ extcap_get_if_configuration_values()

GList * extcap_get_if_configuration_values ( const char *  ifname,
const char *  argname,
GHashTable *  arguments 
)

Returns the configuration values for the given argument, or an empty list, if no values could been found. Initializes the extcap interface list if that hasn't already been done.

Parameters
ifnameThe interface name.
argnameThe name of the argument for which the values should be retrieved.

◆ extcap_get_if_dlts()

if_capabilities_t * extcap_get_if_dlts ( const char *  ifname,
char **  err_str 
)

Fetches the interface capabilities for the named extcap interface. Initializes the extcap interface list if that hasn't already been done.

Parameters
ifnameThe interface name.
err_strSet to NULL on success, error description on failure.
Returns
The interface capabilities on success, NULL on failure.

◆ extcap_get_tool_by_ifname()

extcap_info * extcap_get_tool_by_ifname ( const char *  ifname)

Retrieves information about an extcap interface. Initializes the extcap interface list if that hasn't already been done.

Parameters
ifnameThe extcap interface name.
Returns
The extcap information on success, NULL on failure.

◆ extcap_get_tool_info()

extcap_info * extcap_get_tool_info ( const char *  toolname)

Retrieves information about an extcap executable. Initializes the extcap interface list if that hasn't already been done.

Parameters
toolnameThe extcap name.
Returns
The extcap information on success, NULL on failure.

◆ extcap_has_configuration()

bool extcap_has_configuration ( const char *  ifname)

Checks to see if an interface has configurable options. Initializes the extcap interface list if that hasn't already been done.

Parameters
ifnameInterface to check.

◆ extcap_has_toolbar()

bool extcap_has_toolbar ( const char *  ifname)

Checks to see if the interface has an associated toolbar. Initializes the extcap interface list if that hasn't already been done.

Parameters
ifnameInterface to check.
Returns
true if the interface has a toolbar, false otherwise.

◆ extcap_pref_for_argument()

struct preference * extcap_pref_for_argument ( const char *  ifname,
struct _extcap_arg arg 
)

Fetch an extcap preference for a given argument. Initializes the extcap interface list if that hasn't already been done.

Parameters
ifnameThe interface to check.
argThe command line argument to check.
Returns
The associated preference on success, NULL on failure.

◆ extcap_register_preferences()

void extcap_register_preferences ( void  )

Registers preferences for all interfaces. Initializes the extcap interface list if that hasn't already been done.

◆ extcap_request_stop()

void extcap_request_stop ( capture_session cap_session)

Notify all extcaps that capture session should be stopped. Forcefully stop session if extcaps do not finish before timeout.

Parameters
cap_sessionCapture session.

◆ extcap_requires_configuration()

bool extcap_requires_configuration ( const char *  ifname)

Checks if an interface has configurable options and if all are configured. Returns true when the extcap interface has configurable options that required modification. (For example, when an argument is required but empty.) Initializes the extcap interface list if that hasn't already been done.

Parameters
ifnameInterface to check.

◆ extcap_verify_capture_filter()

extcap_filter_status extcap_verify_capture_filter ( const char *  ifname,
const char *  filter,
char **  err_str 
)

Check if the capture filter for the given interface name is valid. Initializes the extcap interface list if that hasn't already been done.

Parameters
ifnameInterface to check
filterCapture filter to check
err_strError string returned if filter is invalid
Returns
Filter check status.