sec_vt_header: dissect drep
[wireshark-wip.git] / capture_ifinfo.h
blobb19454f89980f1f5e5cf0fc1dbb153b1005059df
1 /* capture_ifinfo.h
2 * Definitions for routines to get information about capture interfaces
4 * $Id$
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 #ifndef __CAPTURE_IFINFO_H__
26 #define __CAPTURE_IFINFO_H__
28 #ifdef __cplusplus
29 extern "C" {
30 #endif /* __cplusplus */
32 typedef enum {
33 IF_WIRED,
34 IF_AIRPCAP,
35 IF_PIPE,
36 IF_STDIN,
37 IF_BLUETOOTH,
38 IF_WIRELESS,
39 IF_DIALUP,
40 IF_USB,
41 IF_VIRTUAL
42 } interface_type;
45 * The list of interfaces returned by "get_interface_list()" is
46 * a list of these structures.
48 typedef struct {
49 char *name; /* e.g. "eth0" */
50 char *friendly_name; /* from OS, e.g. "Local Area Connection", or
51 NULL if not available */
52 char *vendor_description;
53 /* vendor description from pcap_findalldevs(),
54 e.g. "Realtek PCIe GBE Family Controller",
55 or NULL if not available */
56 GSList *addrs; /* containing address values of if_addr_t */
57 interface_type type; /* type of interface */
58 gboolean loopback; /* TRUE if loopback, FALSE otherwise */
59 } if_info_t;
62 * An address in the "addrs" list.
64 typedef enum {
65 IF_AT_IPv4,
66 IF_AT_IPv6
67 } if_address_type;
69 typedef struct {
70 if_address_type ifat_type;
71 union {
72 guint32 ip4_addr; /* 4 byte IP V4 address, or */
73 guint8 ip6_addr[16];/* 16 byte IP V6 address */
74 } addr;
75 } if_addr_t;
77 /**
78 * Fetch the interface list from a child process.
80 extern GList *capture_interface_list(int *err, char **err_str, void (*update_cb)(void));
82 /* Error values from "get_interface_list()/capture_interface_list()". */
83 #define CANT_GET_INTERFACE_LIST 1 /* error getting list */
84 #define NO_INTERFACES_FOUND 2 /* list is empty */
85 #define DONT_HAVE_PCAP 3 /* couldn't load WinPcap */
87 void free_interface_list(GList *if_list);
90 * "get_if_capabilities()" and "capture_if_capabilities()" return a pointer
91 * to an allocated instance of this structure. "free_if_capabilities()"
92 * frees the returned instance.
94 typedef struct {
95 gboolean can_set_rfmon; /* TRUE if can be put into monitor mode */
96 GList *data_link_types; /* GList of data_link_info_t's */
97 } if_capabilities_t;
100 * Information about data link types.
102 typedef struct {
103 int dlt; /* e.g. DLT_EN10MB (which is 1) */
104 char *name; /* e.g. "EN10MB" or "DLT 1" */
105 char *description; /* descriptive name from wiretap e.g. "Ethernet", NULL if unknown */
106 } data_link_info_t;
109 * Fetch the linktype list for the specified interface from a child process.
111 extern if_capabilities_t *
112 capture_get_if_capabilities(const char *devname, gboolean monitor_mode,
113 char **err_str, void (*update_cb)(void));
115 void free_if_capabilities(if_capabilities_t *caps);
117 void add_interface_to_remote_list(if_info_t *if_info);
119 #ifdef __cplusplus
121 #endif /* __cplusplus */
123 #endif /* __CAPTURE_IFINFO_H__ */