2 * Definitions for routines to get information about capture interfaces
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #ifndef __CAPTURE_IFINFO_H__
24 #define __CAPTURE_IFINFO_H__
28 #endif /* __cplusplus */
48 * The list of interfaces returned by "get_interface_list()" is
49 * a list of these structures.
52 char *name; /* e.g. "eth0" */
53 char *friendly_name; /* from OS, e.g. "Local Area Connection", or
54 NULL if not available */
55 char *vendor_description;
56 /* vendor description from pcap_findalldevs(),
57 e.g. "Realtek PCIe GBE Family Controller",
58 or NULL if not available */
59 GSList *addrs; /* containing address values of if_addr_t */
60 interface_type type; /* type of interface */
61 gboolean loopback; /* TRUE if loopback, FALSE otherwise */
63 char *extcap; /* extcap arguments, which present the data to call the extcap interface */
68 * An address in the "addrs" list.
76 if_address_type ifat_type;
78 guint32 ip4_addr; /* 4 byte IP V4 address, or */
79 guint8 ip6_addr[16];/* 16 byte IP V6 address */
84 * Fetch the interface list from a child process.
86 extern GList *capture_interface_list(int *err, char **err_str, void (*update_cb)(void));
88 /* Error values from "get_interface_list()/capture_interface_list()". */
89 #define CANT_GET_INTERFACE_LIST 1 /* error getting list */
90 #define DONT_HAVE_PCAP 2 /* couldn't load WinPcap */
92 void free_interface_list(GList *if_list);
95 * "get_if_capabilities()" and "capture_if_capabilities()" return a pointer
96 * to an allocated instance of this structure. "free_if_capabilities()"
97 * frees the returned instance.
100 gboolean can_set_rfmon; /* TRUE if can be put into monitor mode */
101 GList *data_link_types; /* GList of data_link_info_t's */
105 * Information about data link types.
108 int dlt; /* e.g. DLT_EN10MB (which is 1) */
109 char *name; /* e.g. "EN10MB" or "DLT 1" */
110 char *description; /* descriptive name from wiretap e.g. "Ethernet", NULL if unknown */
114 * Fetch the linktype list for the specified interface from a child process.
116 extern if_capabilities_t *
117 capture_get_if_capabilities(const gchar *devname, gboolean monitor_mode,
118 const gchar *auth_string,
119 char **err_str, void (*update_cb)(void));
121 void free_if_capabilities(if_capabilities_t *caps);
123 void add_interface_to_remote_list(if_info_t *if_info);
127 #endif /* __cplusplus */
129 #endif /* __CAPTURE_IFINFO_H__ */