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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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_UNKNOWN "Unknown"
40 #define AIRPCAP_DECRYPTION_TYPE_STRING_WIRESHARK "Wireshark"
41 #define AIRPCAP_DECRYPTION_TYPE_STRING_AIRPCAP "AirPcap"
42 #define AIRPCAP_DECRYPTION_TYPE_STRING_NONE "None"
44 #define NO_ROW_SELECTED -1
45 #define NO_COLUMN_SELECTED -1
48 * This structure is used because we need to store infos about the currently selected
49 * row in the key list.
54 }airpcap_key_ls_selected_info_t;
57 * Used to retrieve a string containing a list of all the channels
58 * on which at least one adapter is capturing. This is true
59 * if the adapter passed as parameter is "Any" ... if not,
60 * this function returns the only channel number string.
63 airpcap_get_all_channels_list(airpcap_if_info_t* if_info);
66 * set up the airpcap toolbar for the new capture interface
69 airpcap_set_toolbar_start_capture(airpcap_if_info_t* if_info);
72 * Set up the airpcap toolbar for the new capture interface
75 airpcap_set_toolbar_stop_capture(airpcap_if_info_t* if_info);
78 * Add a key (string) to the given list
81 airpcap_add_key_to_list(GtkWidget *keylist, gchar* type, gchar* key, gchar* ssid);
84 * Modify a key given a list and a row
87 airpcap_modify_key_in_list(GtkWidget *keylist, gint row, gchar* type, gchar* key, gchar* ssid);
90 * Fill the list with the keys
93 airpcap_fill_key_list(GtkWidget *keylist,airpcap_if_info_t* if_info);
96 * Function used to retrieve the AirpcapValidationType given the string name.
99 airpcap_get_validation_type(const gchar* name);
102 * Function used to retrieve the string name given an AirpcapValidationType.
105 airpcap_get_validation_name(AirpcapValidationType vt);
108 * Returns the AirpcapLinkType corresponding to the given string name.
111 airpcap_get_link_type(const gchar* name);
114 * Returns the string name corresponding to the given AirpcapLinkType.
117 airpcap_get_link_name(AirpcapLinkType lt);
120 * Sets the entry of the link type combo using the AirpcapLinkType.
123 airpcap_link_type_combo_set_by_type(GtkWidget* c, AirpcapLinkType type);
126 * Retrieves the name in link type the combo entry.
129 airpcap_link_type_combo_get_type(GtkWidget* c);
132 * Sets the entry of the validation combo using the AirpcapValidationType.
135 airpcap_validation_type_combo_set_by_type(GtkWidget* c,AirpcapValidationType type);
138 * Retrieves the name in the validation combo entry.
140 AirpcapValidationType
141 airpcap_validation_type_combo_get_type(GtkWidget* c);
144 * Returns the string corresponding to the given UINT (1-14, for channel only)
147 airpcap_get_channel_number(const gchar* s);
150 * Retrieve the UINT corresponding to the given string (channel only, handle with care!)
153 airpcap_get_channel_name(UINT n);
156 * Set the combo box entry string given an UINT channel number
159 airpcap_channel_combo_set_by_number(GtkWidget* w,UINT channel);
162 * Returns '1' if this is the "Any" adapter, '0' otherwise
165 airpcap_if_is_any(airpcap_if_info_t* if_info);
168 * Takes the keys from the GtkList widget, and add them to the interface list
171 airpcap_add_keys_from_list(GtkWidget *w, airpcap_if_info_t *if_info);
174 * Update channel combo box. If the airpcap interface is "Any", the combo box will be disabled.
177 airpcap_update_channel_combo(GtkWidget* w, airpcap_if_info_t* if_info);
180 * This function will take the current keys (widget list), specified for the
181 * current adapter, and save them as default for ALL the others.
184 airpcap_read_and_save_decryption_keys_from_clist(GtkWidget* key_ls, airpcap_if_info_t* info_if, GList* if_list);
187 * This function will load from the preferences file ALL the
188 * keys (WEP, WPA and WPA2) and will set them as default for
189 * each adapter. To do this, it will save the keys in the registry...
192 airpcap_load_decryption_keys(GList* if_list);
195 * This function will load from the preferences file ALL the
196 * keys (WEP, WPA and WPA2) and will set them as default for
197 * each adapter. To do this, it will save the keys in the registry...
200 airpcap_check_decryption_keys(GList* if_list);
203 * This function will set the gibven GList of decryption_key_t structures
204 * as the defoult for both Wireshark and the AirPcap adapters...
207 airpcap_save_decryption_keys(GList* key_list, GList* adapters_list);