![Roland Knall](/assets/img/avatar_default.png)
Extcap is a plugin interface, which allows for the usage of external capture interfaces via pipes using a predefined configuration language which results in a graphical gui. This implementation seeks for a generic implementation, which results in a seamless integration with the current system, and does add all external interfaces as simple interfaces. Windows Note: Due to limitations with GTK and Windows, a gspawn-winXX-helper.exe, respective gspawn-winXX-helper-console.exe is needed, which is part of any GTK windows installation. The default installation directory from the build is an extcap subdirectory underneath the run directory. The folder used by extcap may be viewed in the folders tab of the about dialog. The default installation directory for extcap plugins with a pre-build or installer version of wireshark is the extcap subdirectory underneath the main wireshark directory. For more information see: http://youtu.be/Nn84T506SwU bug #9009 Also take a look in doc/extcap_example.py for a Python-example and in extcap.pod for the arguments grammer. Todo: - Integrate with Qt - currently no GUI is generated, but the interfaces are still usable Change-Id: I4f1239b2f1ebd8b2969f73af137915f5be1ce50f Signed-off-by: Mike Ryan <mikeryan+wireshark@lacklustre.net> Signed-off-by: Mike Kershaw <dragorn@kismetwireless.net> Signed-off-by: Roland Knall <rknall@gmail.com> Reviewed-on: https://code.wireshark.org/review/359 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
129 lines
3.6 KiB
C
129 lines
3.6 KiB
C
/* capture_ifinfo.h
|
|
* Definitions for routines to get information about capture interfaces
|
|
*
|
|
* Wireshark - Network traffic analyzer
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
* Copyright 1998 Gerald Combs
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version 2
|
|
* of the License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
*/
|
|
|
|
#ifndef __CAPTURE_IFINFO_H__
|
|
#define __CAPTURE_IFINFO_H__
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif /* __cplusplus */
|
|
|
|
#include <glib.h>
|
|
|
|
typedef enum {
|
|
IF_WIRED,
|
|
IF_AIRPCAP,
|
|
IF_PIPE,
|
|
IF_STDIN,
|
|
IF_BLUETOOTH,
|
|
IF_WIRELESS,
|
|
IF_DIALUP,
|
|
IF_USB,
|
|
#ifdef HAVE_EXTCAP
|
|
IF_EXTCAP,
|
|
#endif
|
|
IF_VIRTUAL
|
|
} interface_type;
|
|
|
|
/*
|
|
* The list of interfaces returned by "get_interface_list()" is
|
|
* a list of these structures.
|
|
*/
|
|
typedef struct {
|
|
char *name; /* e.g. "eth0" */
|
|
char *friendly_name; /* from OS, e.g. "Local Area Connection", or
|
|
NULL if not available */
|
|
char *vendor_description;
|
|
/* vendor description from pcap_findalldevs(),
|
|
e.g. "Realtek PCIe GBE Family Controller",
|
|
or NULL if not available */
|
|
GSList *addrs; /* containing address values of if_addr_t */
|
|
interface_type type; /* type of interface */
|
|
gboolean loopback; /* TRUE if loopback, FALSE otherwise */
|
|
#ifdef HAVE_EXTCAP
|
|
char *extcap; /* extcap arguments, which present the data to call the extcap interface */
|
|
#endif
|
|
} if_info_t;
|
|
|
|
/*
|
|
* An address in the "addrs" list.
|
|
*/
|
|
typedef enum {
|
|
IF_AT_IPv4,
|
|
IF_AT_IPv6
|
|
} if_address_type;
|
|
|
|
typedef struct {
|
|
if_address_type ifat_type;
|
|
union {
|
|
guint32 ip4_addr; /* 4 byte IP V4 address, or */
|
|
guint8 ip6_addr[16];/* 16 byte IP V6 address */
|
|
} addr;
|
|
} if_addr_t;
|
|
|
|
/**
|
|
* Fetch the interface list from a child process.
|
|
*/
|
|
extern GList *capture_interface_list(int *err, char **err_str, void (*update_cb)(void));
|
|
|
|
/* Error values from "get_interface_list()/capture_interface_list()". */
|
|
#define CANT_GET_INTERFACE_LIST 1 /* error getting list */
|
|
#define DONT_HAVE_PCAP 2 /* couldn't load WinPcap */
|
|
|
|
void free_interface_list(GList *if_list);
|
|
|
|
/*
|
|
* "get_if_capabilities()" and "capture_if_capabilities()" return a pointer
|
|
* to an allocated instance of this structure. "free_if_capabilities()"
|
|
* frees the returned instance.
|
|
*/
|
|
typedef struct {
|
|
gboolean can_set_rfmon; /* TRUE if can be put into monitor mode */
|
|
GList *data_link_types; /* GList of data_link_info_t's */
|
|
} if_capabilities_t;
|
|
|
|
/*
|
|
* Information about data link types.
|
|
*/
|
|
typedef struct {
|
|
int dlt; /* e.g. DLT_EN10MB (which is 1) */
|
|
char *name; /* e.g. "EN10MB" or "DLT 1" */
|
|
char *description; /* descriptive name from wiretap e.g. "Ethernet", NULL if unknown */
|
|
} data_link_info_t;
|
|
|
|
/**
|
|
* Fetch the linktype list for the specified interface from a child process.
|
|
*/
|
|
extern if_capabilities_t *
|
|
capture_get_if_capabilities(const char *devname, gboolean monitor_mode,
|
|
char **err_str, void (*update_cb)(void));
|
|
|
|
void free_if_capabilities(if_capabilities_t *caps);
|
|
|
|
void add_interface_to_remote_list(if_info_t *if_info);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif /* __cplusplus */
|
|
|
|
#endif /* __CAPTURE_IFINFO_H__ */
|