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 */
43 * The list of interfaces returned by "get_interface_list()" is
44 * a list of these structures.
47 char *name; /* e.g. "eth0" */
48 char *friendly_name; /* from OS, e.g. "Local Area Connection", or
49 NULL if not available */
50 char *vendor_description;
51 /* vendor description from pcap_findalldevs(),
52 e.g. "Realtek PCIe GBE Family Controller",
53 or NULL if not available */
54 GSList *addrs; /* containing address values of if_addr_t */
55 interface_type type; /* type of interface */
56 gboolean loopback; /* TRUE if loopback, FALSE otherwise */
60 * An address in the "addrs" list.
68 if_address_type ifat_type;
70 guint32 ip4_addr; /* 4 byte IP V4 address, or */
71 guint8 ip6_addr[16];/* 16 byte IP V6 address */
76 * Fetch the interface list from a child process.
78 extern GList *capture_interface_list(int *err, char **err_str, void (*update_cb)(void));
80 /* Error values from "get_interface_list()/capture_interface_list()". */
81 #define CANT_GET_INTERFACE_LIST 1 /* error getting list */
82 #define NO_INTERFACES_FOUND 2 /* list is empty */
83 #define DONT_HAVE_PCAP 3 /* couldn't load WinPcap */
85 void free_interface_list(GList *if_list);
88 * "get_if_capabilities()" and "capture_if_capabilities()" return a pointer
89 * to an allocated instance of this structure. "free_if_capabilities()"
90 * frees the returned instance.
93 gboolean can_set_rfmon; /* TRUE if can be put into monitor mode */
94 GList *data_link_types; /* GList of data_link_info_t's */
98 * Information about data link types.
101 int dlt; /* e.g. DLT_EN10MB (which is 1) */
102 char *name; /* e.g. "EN10MB" or "DLT 1" */
103 char *description; /* descriptive name from wiretap e.g. "Ethernet", NULL if unknown */
107 * Fetch the linktype list for the specified interface from a child process.
109 extern if_capabilities_t *
110 capture_get_if_capabilities(const char *devname, gboolean monitor_mode,
111 char **err_str, void (*update_cb)(void));
113 void free_if_capabilities(if_capabilities_t *caps);
115 void add_interface_to_remote_list(if_info_t *if_info);
119 #endif /* __cplusplus */
121 #endif /* __CAPTURE_IFINFO_H__ */