2 * Declarations of utility routines for the "Airpcap" dialog widgets
6 * Giorgio Tino <giorgio.tino@cacetech.com>
7 * Copyright (c) CACE Technologies, LLC 2006
9 * Wireshark - Network traffic analyzer
10 * By Gerald Combs <gerald@wireshark.org>
11 * Copyright 1998 Gerald Combs
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 #ifndef __AIRPCAP_GUI_UTILS_H__
29 #define __AIRPCAP_GUI_UTILS_H__
31 #define AIRPCAP_VALIDATION_TYPE_NAME_ALL "All Frames"
32 #define AIRPCAP_VALIDATION_TYPE_NAME_CORRECT "Valid Frames"
33 #define AIRPCAP_VALIDATION_TYPE_NAME_CORRUPT "Invalid Frames"
34 #define AIRPCAP_VALIDATION_TYPE_NAME_UNKNOWN "Unknown"
36 #define AIRPCAP_LINK_TYPE_NAME_802_11_ONLY "802.11 Only"
37 #define AIRPCAP_LINK_TYPE_NAME_802_11_PLUS_RADIO "802.11 + Radio"
38 #define AIRPCAP_LINK_TYPE_NAME_802_11_PLUS_PPI "802.11 + PPI"
39 #define AIRPCAP_LINK_TYPE_NAME_UNKNOWN "Unknown"
41 #define AIRPCAP_LINK_TYPE_NUM_802_11_ONLY 0
42 #define AIRPCAP_LINK_TYPE_NUM_802_11_PLUS_RADIO 1
43 #define AIRPCAP_LINK_TYPE_NUM_802_11_PLUS_PPI 2
45 #define AIRPCAP_DECRYPTION_TYPE_STRING_WIRESHARK "Wireshark"
46 #define AIRPCAP_DECRYPTION_TYPE_STRING_AIRPCAP "Driver"
47 #define AIRPCAP_DECRYPTION_TYPE_STRING_NONE "None"
49 /* Key list columns */
57 /* Controls the releay of settings back to the adapter. */
58 extern gboolean change_airpcap_settings
;
61 * set up the airpcap toolbar for the new capture interface
64 airpcap_set_toolbar_start_capture(airpcap_if_info_t
* if_info
);
67 * Set up the airpcap toolbar for the new capture interface
70 airpcap_set_toolbar_stop_capture(airpcap_if_info_t
* if_info
);
73 * Add a key (string) to the given list
76 airpcap_add_key_to_list(GtkListStore
*key_list_store
, gchar
* type
, gchar
* key
, gchar
* ssid
);
79 * Fill the list with the keys
82 airpcap_fill_key_list(GtkListStore
*key_list_store
);
85 * Function used to retrieve the AirpcapValidationType given the string name.
88 airpcap_get_validation_type(const gchar
* name
);
91 * Function used to retrieve the string name given an AirpcapValidationType.
94 airpcap_get_validation_name(AirpcapValidationType vt
);
97 * Return an appropriate combo box entry number for the given an AirpcapValidationType.
100 airpcap_get_validation_combo_entry(AirpcapValidationType vt
);
103 * Returns the AirpcapLinkType corresponding to the given string name.
106 airpcap_get_link_type(const gchar
* name
);
109 * Returns the string name corresponding to the given AirpcapLinkType.
112 airpcap_get_link_name(AirpcapLinkType lt
);
115 * Sets the entry of the validation combo using the AirpcapValidationType.
118 airpcap_validation_type_combo_set_by_type(GtkWidget
* c
,AirpcapValidationType type
);
121 * Update channel offset combo box to 'offset'.
124 airpcap_update_channel_offset_combo(airpcap_if_info_t
* if_info
, guint32 ch_freq
, GtkWidget
*channel_offset_cb
, gboolean set
);
128 * Retrieve the guint corresponding to the given string (channel only, handle with care!)
131 airpcap_get_channel_name(guint n
);
134 * Set the combo box entry string given an guint channel number
137 airpcap_channel_combo_set_by_frequency(GtkWidget
* w
,guint channel
);
139 /** Respond to the user changing the channel combo box.
140 * Update the active interface channel and update the offset
142 * Requires AirPcap globals.
144 * @param channel_cb The channel GtkComboBox
145 * @param channel_offset_cb The channel offset GtkComboBox
148 airpcap_channel_changed_set_cb(GtkWidget
*channel_cb
, gpointer channel_offset_cb
);
150 /** Respond to the user changing the channel combo box.
151 * Update the offset combo box but not the channel.
152 * Requires AirPcap globals.
154 * @param channel_cb The channel GtkComboBox
155 * @param channel_offset_cb The channel offset GtkComboBox
158 airpcap_channel_changed_noset_cb(GtkWidget
*channel_cb
, gpointer channel_offset_cb
);
160 /** Respond to the user changing the channel offset combo box.
161 * Update the active interface channel offset.
162 * Requires AirPcap globals.
164 * @param channel_offset_cb The channel offset GtkComboBox
168 airpcap_channel_offset_changed_cb(GtkWidget
*channel_offset_cb
, gpointer data
);
171 * Returns '1' if this is the "Any" adapter, '0' otherwise
174 airpcap_if_is_any(airpcap_if_info_t
* if_info
);
177 * Update channel combo box. If the airpcap interface is "Any", the combo box will be disabled.
180 airpcap_update_channel_combo(GtkWidget
* channel_cb
, airpcap_if_info_t
* if_info
);
183 * This function will take the current keys (widget list), specified for the
184 * current adapter, and save them as default for ALL the others.
187 airpcap_read_and_save_decryption_keys_from_list_store(GtkListStore
* key_list_store
, airpcap_if_info_t
* info_if
, GList
* if_list
);
190 * This function will load from the preferences file ALL the
191 * keys (WEP, WPA and WPA_BIN) and will set them as default for
192 * each adapter. To do this, it will save the keys in the registry...
195 airpcap_load_decryption_keys(GList
* if_list
);
198 * This function will load from the preferences file ALL the
199 * keys (WEP, WPA and WPA_BIN) and will set them as default for
200 * each adapter. To do this, it will save the keys in the registry...
203 airpcap_check_decryption_keys(GList
* if_list
);
206 * This function will set the gibven GList of decryption_key_t structures
207 * as the defoult for both Wireshark and the AirPcap adapters...
210 airpcap_save_decryption_keys(GList
* key_list
, GList
* adapters_list
);
213 * This function is used to enable/disable the toolbar widgets
214 * depending on the type of interface selected...
217 airpcap_enable_toolbar_widgets(GtkWidget
* w
, gboolean en
);