Have the makefile run windepoyqt if it exists to copy the required dlls to the instal...
[metze/wireshark/wip.git] / capture_ui_utils.h
1 /* capture_ui_utils.c
2  * Declarations of utilities for capture user interfaces
3  *
4  * Wireshark - Network traffic analyzer
5  * By Gerald Combs <gerald@wireshark.org>
6  * Copyright 1998 Gerald Combs
7  *
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.
12  *
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.
17  *
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.
21  */
22
23 #ifndef __CAPTURE_UI_UTILS_H__
24 #define __CAPTURE_UI_UTILS_H__
25
26 #include "capture_opts.h"
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif /* __cplusplus */
31
32 /** @file
33  *  GList of available capture interfaces.
34  */
35
36 /**
37  * Find user-specified capture device description that matches interface
38  * name, if any.
39  */
40 char *capture_dev_user_descr_find(const gchar *if_name);
41
42 /**
43  * Find user-specified link-layer header type that matches interface
44  * name, if any.
45  */
46 gint capture_dev_user_linktype_find(const gchar *if_name);
47
48 #if defined(_WIN32) || defined(HAVE_PCAP_CREATE)
49 /**
50  * Find user-specified buffer size that matches interface
51  * name, if any.
52  */
53 gint capture_dev_user_buffersize_find(const gchar *if_name);
54 #endif
55
56 /**
57  * Find user-specified snap length that matches interface
58  * name, if any.
59  */
60 gint capture_dev_user_snaplen_find(const gchar *if_name);
61 gboolean capture_dev_user_hassnap_find(const gchar *if_name);
62
63 /**
64  * Find user-specified promiscuous mode that matches interface
65  * name, if any.
66  */
67 gboolean capture_dev_user_pmode_find(const gchar *if_name);
68
69 /**
70  * Find user-specified capture filter that matches interface
71  * name, if any.
72  */
73 gchar* capture_dev_user_cfilter_find(const gchar *if_name);
74
75 /** Return as descriptive a name for an interface as we can get.
76  * If the user has specified a comment, use that.  Otherwise,
77  * if capture_interface_list() supplies a description, use that,
78  * otherwise use the interface name.
79  *
80  * @param if_name The name of the interface.
81  *
82  * @return The descriptive name (must be g_free'd later)
83  */
84 char *get_interface_descriptive_name(const char *if_name);
85
86 /** Build the GList of available capture interfaces.
87  *
88  * @param if_list An interface list from capture_interface_list().
89  * @param do_hide Hide the "hidden" interfaces.
90  *
91  * @return A list of if_info_t structs (use free_capture_combo_list() later).
92  */
93 GList *build_capture_combo_list(GList *if_list, gboolean do_hide);
94
95 /** Free the GList from build_capture_combo_list().
96  *
97  * @param combo_list the interface list from build_capture_combo_list()
98  */
99 void free_capture_combo_list(GList *combo_list);
100
101
102 /** Given text that contains an interface name possibly prefixed by an
103  * interface description, extract the interface name.
104  *
105  * @param if_text A string containing the interface description + name.
106  * This is usually the data from one of the list elements returned by
107  * build_capture_combo_list().
108  *
109  * @return The raw interface name, without description (must NOT be g_free'd later)
110  */
111 const char *get_if_name(const char *if_text);
112
113 /** Convert plain interface name to the displayed name in the combo box.
114  *
115  * @param if_list The list of interfaces returned by build_capture_combo_list()
116  * @param if_name The name of the interface.
117  *
118  * @return The descriptive name (must be g_free'd later)
119  */
120 char *build_capture_combo_name(GList *if_list, gchar *if_name);
121
122 /** Return the interface description (after setting it if not already set)
123  *
124  * @param capture_opts The capture_options structure that contains the used interface
125  * @param i The index of the interface
126  *
127  * @return A pointer to interface_opts->descr
128  */
129 const char *get_iface_description_for_interface(capture_options *capture_opts, guint i);
130
131 #ifdef __cplusplus
132 }
133 #endif /* __cplusplus */
134
135 #endif /* __CAPTURE_UI_UTILS_H__ */