5 * Giorgio Tino <giorgio.tino@cacetech.com>
6 * Copyright (c) CACE Technologies, LLC 2006
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 2000 Gerald Combs
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
38 #include <epan/filesystem.h>
39 #include <epan/strutil.h>
40 #include <epan/frequency-utils.h>
41 #include <epan/crypt/airpdcap_ws.h>
44 #include "dlg_utils.h"
45 #include "gui_utils.h"
46 #include "simple_dialog.h"
47 #include "dfilter_expr_dlg.h"
48 #include "compat_macros.h"
49 #include "gtkglobals.h"
53 #include "airpcap_loader.h"
54 #include "airpcap_gui_utils.h"
58 #ifdef NEED_G_ASCII_STRCASECMP_H
59 #include "g_ascii_strcasecmp.h"
62 /* Controls the releay of settings back to the adapter. */
63 gboolean change_airpcap_settings = FALSE;
66 * Used to retrieve a string containing a list of all the channels
67 * on which at least one adapter is capturing. This is true
68 * if the adapter passed as parameter is "Any" ... if not,
69 * this function returns the only channel number string.
72 airpcap_get_all_channels_list(airpcap_if_info_t* if_info)
77 airpcap_if_info_t* current_adapter;
78 GString *freq_str = g_string_new("");
81 if(airpcap_if_is_any(if_info))
83 n = g_list_length(airpcap_if_list);
85 for(i = 0; i < n; i++)
87 current_item = g_list_nth(airpcap_if_list,i);
88 current_adapter = (airpcap_if_info_t*)current_item->data;
89 if(current_adapter != if_info && g_ascii_strncasecmp("AirPcap USB wireless capture adapter nr.", current_adapter->description, 40) == 0)
91 g_string_sprintfa(freq_str, "%s%s", sep,
92 ieee80211_mhz_to_str(current_adapter->channelInfo.Frequency));
98 frequencies = freq_str->str;
99 g_string_free(freq_str, FALSE);
104 * Set up the airpcap toolbar for the new capture interface
107 airpcap_set_toolbar_start_capture(airpcap_if_info_t* if_info)
109 GtkWidget *airpcap_toolbar_label;
110 GtkWidget *airpcap_toolbar_channel;
111 GtkWidget *airpcap_toolbar_channel_lb;
112 GtkWidget *airpcap_toolbar_channel_offset;
113 GtkWidget *airpcap_toolbar_channel_offset_lb;
114 GtkWidget *airpcap_toolbar_button;
115 GtkWidget *airpcap_toolbar_fcs;
116 GtkWidget *airpcap_toolbar_fcs_lb;
117 GtkWidget *airpcap_toolbar_decryption;
118 GtkWidget *airpcap_toolbar_decryption_lb;
119 GtkWidget *airpcap_toolbar_keys_button;
121 gchar *if_label_text;
123 airpcap_toolbar_label = OBJECT_GET_DATA(airpcap_tb,AIRPCAP_TOOLBAR_INTERFACE_KEY);
124 airpcap_toolbar_channel = OBJECT_GET_DATA(airpcap_tb,AIRPCAP_TOOLBAR_CHANNEL_KEY);
125 airpcap_toolbar_channel_lb = OBJECT_GET_DATA(airpcap_tb,AIRPCAP_TOOLBAR_CHANNEL_LABEL_KEY);
126 airpcap_toolbar_channel_offset = OBJECT_GET_DATA(airpcap_tb,AIRPCAP_TOOLBAR_CHANNEL_OFFSET_KEY);
127 airpcap_toolbar_channel_offset_lb = OBJECT_GET_DATA(airpcap_tb,AIRPCAP_TOOLBAR_CHANNEL_OFFSET_LABEL_KEY);
128 airpcap_toolbar_fcs = OBJECT_GET_DATA(airpcap_tb,AIRPCAP_TOOLBAR_FCS_FILTER_KEY);
129 airpcap_toolbar_fcs_lb = OBJECT_GET_DATA(airpcap_tb,AIRPCAP_TOOLBAR_FCS_FILTER_LABEL_KEY);
130 airpcap_toolbar_button = OBJECT_GET_DATA(airpcap_tb,AIRPCAP_TOOLBAR_ADVANCED_KEY);
131 airpcap_toolbar_decryption = OBJECT_GET_DATA(airpcap_tb,AIRPCAP_TOOLBAR_DECRYPTION_KEY);
132 airpcap_toolbar_decryption_lb = OBJECT_GET_DATA(airpcap_tb,AIRPCAP_TOOLBAR_DECRYPTION_LABEL_KEY);
133 airpcap_toolbar_keys_button = OBJECT_GET_DATA(airpcap_tb,AIRPCAP_TOOLBAR_KEY_MANAGEMENT_KEY);
135 /* The current interface is an airpcap interface */
138 gtk_widget_set_sensitive(airpcap_tb,TRUE);
139 gtk_widget_set_sensitive(airpcap_toolbar_label,TRUE);
140 gtk_widget_set_sensitive(airpcap_toolbar_channel,TRUE);
141 gtk_widget_set_sensitive(airpcap_toolbar_channel_lb,TRUE);
142 gtk_widget_set_sensitive(airpcap_toolbar_channel_offset,TRUE);
143 gtk_widget_set_sensitive(airpcap_toolbar_channel_offset_lb,TRUE);
144 gtk_widget_set_sensitive(airpcap_toolbar_fcs,FALSE);
145 gtk_widget_set_sensitive(airpcap_toolbar_fcs_lb,FALSE);
146 gtk_widget_set_sensitive(airpcap_toolbar_button,FALSE);
147 gtk_widget_set_sensitive(airpcap_toolbar_button,FALSE);
148 gtk_widget_set_sensitive(airpcap_toolbar_decryption,FALSE);
149 gtk_widget_set_sensitive(airpcap_toolbar_decryption_lb,FALSE);
150 gtk_widget_set_sensitive(airpcap_toolbar_keys_button,FALSE);
152 /*decription check box*/
153 gtk_signal_handler_block_by_func (GTK_OBJECT(airpcap_toolbar_decryption),GTK_SIGNAL_FUNC(airpcap_toolbar_encryption_cb), airpcap_tb);
154 if(if_info->DecryptionOn == AIRPCAP_DECRYPTION_ON)
155 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(airpcap_toolbar_decryption),TRUE);
157 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(airpcap_toolbar_decryption),FALSE);
158 gtk_signal_handler_unblock_by_func (GTK_OBJECT(airpcap_toolbar_decryption),GTK_SIGNAL_FUNC(airpcap_toolbar_encryption_cb), airpcap_tb);
160 if_label_text = g_strdup_printf("Current Wireless Interface: #%s", airpcap_get_if_string_number(if_info));
161 gtk_label_set_text(GTK_LABEL(airpcap_toolbar_label),if_label_text);
162 g_free(if_label_text);
164 change_airpcap_settings = FALSE;
165 if (if_info->pSupportedChannels != NULL && if_info->numSupportedChannels > 0){
167 GList *channel_list = NULL;
169 for (; i<if_info->numSupportedChannels; i++){
170 channel_list = g_list_append(channel_list, ieee80211_mhz_to_str(if_info->pSupportedChannels[i].Frequency));
172 gtk_combo_set_popdown_strings( GTK_COMBO(airpcap_toolbar_channel), channel_list);
173 g_list_free(channel_list);
176 airpcap_update_channel_combo(GTK_WIDGET(airpcap_toolbar_channel),if_info);
177 airpcap_update_channel_offset_cb(if_info, if_info->channelInfo.Frequency, airpcap_toolbar_channel_offset);
178 airpcap_update_channel_offset_combo_entry(airpcap_toolbar_channel_offset, if_info->channelInfo.ExtChannel);
179 change_airpcap_settings = TRUE;
181 else /* Current interface is NOT an AirPcap one... */
183 gtk_widget_set_sensitive(airpcap_tb,FALSE);
184 gtk_widget_set_sensitive(airpcap_toolbar_label,FALSE);
185 gtk_widget_set_sensitive(airpcap_toolbar_channel,FALSE);
186 gtk_widget_set_sensitive(airpcap_toolbar_channel_lb,FALSE);
187 gtk_widget_set_sensitive(airpcap_toolbar_channel_offset,FALSE);
188 gtk_widget_set_sensitive(airpcap_toolbar_channel_offset_lb,FALSE);
189 gtk_widget_set_sensitive(airpcap_toolbar_fcs,FALSE);
190 gtk_widget_set_sensitive(airpcap_toolbar_fcs_lb,FALSE);
191 gtk_widget_set_sensitive(airpcap_toolbar_button,FALSE);
192 gtk_widget_set_sensitive(airpcap_toolbar_button,FALSE);
193 gtk_widget_set_sensitive(airpcap_toolbar_decryption,FALSE);
194 gtk_widget_set_sensitive(airpcap_toolbar_decryption_lb,FALSE);
195 gtk_widget_set_sensitive(airpcap_toolbar_keys_button,FALSE);
196 airpcap_set_toolbar_no_if(airpcap_tb);
201 * Set up the airpcap toolbar for the new capture interface
204 airpcap_set_toolbar_stop_capture(airpcap_if_info_t* if_info)
206 GtkWidget *airpcap_toolbar_crc_filter_combo;
207 GtkWidget *airpcap_toolbar_label;
208 GtkWidget *airpcap_toolbar_channel;
209 GtkWidget *airpcap_toolbar_channel_lb;
210 GtkWidget *airpcap_toolbar_channel_offset;
211 GtkWidget *airpcap_toolbar_channel_offset_lb;
212 GtkWidget *airpcap_toolbar_button;
213 GtkWidget *airpcap_toolbar_fcs;
214 GtkWidget *airpcap_toolbar_fcs_lb;
215 GtkWidget *airpcap_toolbar_decryption;
216 GtkWidget *airpcap_toolbar_decryption_lb;
217 GtkWidget *airpcap_toolbar_keys_button;
219 gchar *if_label_text;
221 airpcap_toolbar_crc_filter_combo = OBJECT_GET_DATA(airpcap_tb,AIRPCAP_TOOLBAR_FCS_FILTER_KEY);
222 airpcap_toolbar_label = OBJECT_GET_DATA(airpcap_tb,AIRPCAP_TOOLBAR_INTERFACE_KEY);
223 airpcap_toolbar_channel = OBJECT_GET_DATA(airpcap_tb,AIRPCAP_TOOLBAR_CHANNEL_KEY);
224 airpcap_toolbar_channel_lb = OBJECT_GET_DATA(airpcap_tb,AIRPCAP_TOOLBAR_CHANNEL_LABEL_KEY);
225 airpcap_toolbar_channel_offset = OBJECT_GET_DATA(airpcap_tb,AIRPCAP_TOOLBAR_CHANNEL_OFFSET_KEY);
226 airpcap_toolbar_channel_offset_lb = OBJECT_GET_DATA(airpcap_tb,AIRPCAP_TOOLBAR_CHANNEL_OFFSET_LABEL_KEY);
227 airpcap_toolbar_fcs = OBJECT_GET_DATA(airpcap_tb,AIRPCAP_TOOLBAR_FCS_FILTER_KEY);
228 airpcap_toolbar_fcs_lb = OBJECT_GET_DATA(airpcap_tb,AIRPCAP_TOOLBAR_FCS_FILTER_LABEL_KEY);
229 airpcap_toolbar_button = OBJECT_GET_DATA(airpcap_tb,AIRPCAP_TOOLBAR_ADVANCED_KEY);
230 airpcap_toolbar_decryption = OBJECT_GET_DATA(airpcap_tb,AIRPCAP_TOOLBAR_DECRYPTION_KEY);
231 airpcap_toolbar_decryption_lb = OBJECT_GET_DATA(airpcap_tb,AIRPCAP_TOOLBAR_DECRYPTION_LABEL_KEY);
232 airpcap_toolbar_keys_button = OBJECT_GET_DATA(airpcap_tb,AIRPCAP_TOOLBAR_KEY_MANAGEMENT_KEY);
234 /* The current interface is an airpcap interface */
237 gtk_widget_set_sensitive(airpcap_tb,TRUE);
238 gtk_widget_set_sensitive(airpcap_toolbar_label,TRUE);
239 gtk_widget_set_sensitive(airpcap_toolbar_channel,TRUE);
240 gtk_widget_set_sensitive(airpcap_toolbar_channel_lb,TRUE);
241 gtk_widget_set_sensitive(airpcap_toolbar_channel_offset,TRUE);
242 gtk_widget_set_sensitive(airpcap_toolbar_channel_offset_lb,TRUE);
243 gtk_widget_set_sensitive(airpcap_toolbar_fcs,TRUE);
244 gtk_widget_set_sensitive(airpcap_toolbar_fcs_lb,TRUE);
245 gtk_widget_set_sensitive(airpcap_toolbar_button,TRUE);
246 gtk_widget_set_sensitive(airpcap_toolbar_crc_filter_combo,TRUE);
247 gtk_widget_set_sensitive(airpcap_toolbar_decryption,TRUE);
248 gtk_widget_set_sensitive(airpcap_toolbar_decryption_lb,TRUE);
249 gtk_widget_set_sensitive(airpcap_toolbar_keys_button,TRUE);
250 airpcap_validation_type_combo_set_by_type(GTK_WIDGET(airpcap_toolbar_crc_filter_combo),if_info->CrcValidationOn);
252 /*decription check box*/
253 gtk_signal_handler_block_by_func (GTK_OBJECT(airpcap_toolbar_decryption),GTK_SIGNAL_FUNC(airpcap_toolbar_encryption_cb), airpcap_tb);
254 if(if_info->DecryptionOn == AIRPCAP_DECRYPTION_ON)
255 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(airpcap_toolbar_decryption),TRUE);
257 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(airpcap_toolbar_decryption),FALSE);
258 gtk_signal_handler_unblock_by_func (GTK_OBJECT(airpcap_toolbar_decryption),GTK_SIGNAL_FUNC(airpcap_toolbar_encryption_cb), airpcap_tb);
260 if_label_text = g_strdup_printf("Current Wireless Interface: #%s", airpcap_get_if_string_number(if_info));
261 gtk_label_set_text(GTK_LABEL(airpcap_toolbar_label),if_label_text);
262 g_free(if_label_text);
264 change_airpcap_settings = FALSE;
265 if (if_info->pSupportedChannels != NULL && if_info->numSupportedChannels > 0){
267 GList *channel_list = NULL;
269 for (; i<if_info->numSupportedChannels; i++){
270 channel_list = g_list_append(channel_list, ieee80211_mhz_to_str(if_info->pSupportedChannels[i].Frequency));
272 gtk_combo_set_popdown_strings( GTK_COMBO(airpcap_toolbar_channel), channel_list);
273 g_list_free(channel_list);
276 airpcap_update_channel_combo(GTK_WIDGET(airpcap_toolbar_channel),if_info);
277 airpcap_update_channel_offset_cb(if_info, if_info->channelInfo.Frequency, airpcap_toolbar_channel_offset);
278 airpcap_update_channel_offset_combo_entry(airpcap_toolbar_channel_offset, if_info->channelInfo.ExtChannel);
279 change_airpcap_settings = TRUE;
283 gtk_widget_set_sensitive(airpcap_tb,TRUE);
284 gtk_widget_set_sensitive(airpcap_toolbar_label,FALSE);
285 gtk_widget_set_sensitive(airpcap_toolbar_channel,FALSE);
286 gtk_widget_set_sensitive(airpcap_toolbar_channel_lb,FALSE);
287 gtk_widget_set_sensitive(airpcap_toolbar_channel_offset,FALSE);
288 gtk_widget_set_sensitive(airpcap_toolbar_channel_offset_lb,FALSE);
289 gtk_widget_set_sensitive(airpcap_toolbar_fcs,FALSE);
290 gtk_widget_set_sensitive(airpcap_toolbar_fcs_lb,FALSE);
291 gtk_widget_set_sensitive(airpcap_toolbar_button,FALSE);
292 gtk_widget_set_sensitive(airpcap_toolbar_crc_filter_combo,FALSE);
293 gtk_widget_set_sensitive(airpcap_toolbar_decryption,TRUE);
294 gtk_widget_set_sensitive(airpcap_toolbar_decryption_lb,TRUE);
295 gtk_widget_set_sensitive(airpcap_toolbar_keys_button,TRUE);
296 airpcap_set_toolbar_no_if(airpcap_tb);
297 change_airpcap_settings = FALSE;
302 * Add a key (string) to the given list
305 airpcap_add_key_to_list(GtkWidget *keylist, gchar* type, gchar* key, gchar* ssid)
309 new_row[0] = g_strdup(type);
310 new_row[1] = g_strdup(key);
311 new_row[2] = g_strdup(ssid);
313 gtk_clist_append(GTK_CLIST(keylist),new_row);
321 * Modify a key given a list and a row
324 airpcap_modify_key_in_list(GtkWidget *keylist, gint row, gchar* type, gchar* key, gchar* ssid)
328 new_row[0] = g_strdup(type);
329 new_row[1] = g_strdup(key);
330 new_row[2] = g_strdup(ssid);
332 gtk_clist_set_text(GTK_CLIST(keylist),row,0,new_row[0]);
333 gtk_clist_set_text(GTK_CLIST(keylist),row,1,new_row[1]);
334 gtk_clist_set_text(GTK_CLIST(keylist),row,2,new_row[2]);
342 * Fill the list with the keys. BEWARE! At this point, Wireshark and Drivers
343 * keys should be EQUALS! But is better to load keys from Wireshark, because
344 * the driver is not always present, and maybe that cannot support some keys
345 * (i.e. the WPA problem)
348 airpcap_fill_key_list(GtkWidget *keylist)
354 airpcap_if_info_t* fake_if_info;
355 GList* wireshark_key_list=NULL;
356 decryption_key_t* curr_key = NULL;
360 fake_if_info = airpcap_driver_fake_if_info_new();
362 /* We can retrieve the driver's key list (i.e. we have the right .dll)*/
363 wireshark_key_list = get_wireshark_keys();
364 n = g_list_length(wireshark_key_list);
366 for(i = 0; i < n; i++)
368 curr_key = (decryption_key_t*)g_list_nth_data(wireshark_key_list,i);
370 if(curr_key->type == AIRPDCAP_KEY_TYPE_WEP)
372 s = g_strdup(curr_key->key->str);
374 new_row[0] = g_strdup(AIRPCAP_WEP_KEY_STRING);
375 new_row[1] = g_strdup(s);
376 new_row[2] = g_strdup("");
378 gtk_clist_append(GTK_CLIST(keylist),new_row);
386 else if(curr_key->type == AIRPDCAP_KEY_TYPE_WPA_PWD)
388 s = g_strdup(curr_key->key->str);
389 if(curr_key->ssid != NULL)
390 s2= g_strdup(format_uri(curr_key->ssid, ":"));
394 new_row[0] = g_strdup(AIRPCAP_WPA_PWD_KEY_STRING);
395 new_row[1] = g_strdup(s);
397 if(curr_key->ssid != NULL)
398 new_row[2] = g_strdup(s2);
400 new_row[2] = g_strdup("");
402 gtk_clist_append(GTK_CLIST(keylist),new_row);
412 else if(curr_key->type == AIRPDCAP_KEY_TYPE_WPA_PMK)
414 s = g_strdup(curr_key->key->str);
416 new_row[0] = g_strdup(AIRPCAP_WPA_BIN_KEY_STRING);
417 new_row[1] = g_strdup(s);
418 new_row[2] = g_strdup("");
420 gtk_clist_append(GTK_CLIST(keylist),new_row);
430 airpcap_if_info_free(fake_if_info);
435 * Function used to retrieve the AirpcapValidationType given the string name.
437 AirpcapValidationType
438 airpcap_get_validation_type(const gchar* name)
440 if(!(g_ascii_strcasecmp(AIRPCAP_VALIDATION_TYPE_NAME_ALL,name)))
442 return AIRPCAP_VT_ACCEPT_EVERYTHING;
444 else if(!(g_ascii_strcasecmp(AIRPCAP_VALIDATION_TYPE_NAME_CORRECT,name)))
446 return AIRPCAP_VT_ACCEPT_CORRECT_FRAMES;
448 else if(!(g_ascii_strcasecmp(AIRPCAP_VALIDATION_TYPE_NAME_CORRUPT,name)))
450 return AIRPCAP_VT_ACCEPT_CORRUPT_FRAMES;
454 return AIRPCAP_VT_UNKNOWN;
459 * Function used to retrieve the string name given an AirpcapValidationType,
460 * or NULL in case of error
463 airpcap_get_validation_name(AirpcapValidationType vt)
465 if(vt == AIRPCAP_VT_ACCEPT_EVERYTHING)
467 return AIRPCAP_VALIDATION_TYPE_NAME_ALL;
469 else if(vt == AIRPCAP_VT_ACCEPT_CORRECT_FRAMES)
471 return AIRPCAP_VALIDATION_TYPE_NAME_CORRECT;
473 else if(vt == AIRPCAP_VT_ACCEPT_CORRUPT_FRAMES)
475 return AIRPCAP_VALIDATION_TYPE_NAME_CORRUPT;
477 else if(vt == AIRPCAP_VT_UNKNOWN)
479 return AIRPCAP_VALIDATION_TYPE_NAME_UNKNOWN;
485 * Returns the AirpcapLinkType corresponding to the given string name.
488 airpcap_get_link_type(const gchar* name)
490 if(!(g_ascii_strcasecmp(AIRPCAP_LINK_TYPE_NAME_802_11_ONLY,name))){
491 return AIRPCAP_LT_802_11;
492 }else if(!(g_ascii_strcasecmp(AIRPCAP_LINK_TYPE_NAME_802_11_PLUS_RADIO,name))){
493 return AIRPCAP_LT_802_11_PLUS_RADIO;
494 }else if(!(g_ascii_strcasecmp(AIRPCAP_LINK_TYPE_NAME_802_11_PLUS_PPI,name))){
495 return AIRPCAP_LT_802_11_PLUS_PPI;
497 return AIRPCAP_LT_UNKNOWN;
502 * Returns the string name corresponding to the given AirpcapLinkType, or
503 * NULL in case of error.
506 airpcap_get_link_name(AirpcapLinkType lt)
508 if(lt == AIRPCAP_LT_802_11){
509 return AIRPCAP_LINK_TYPE_NAME_802_11_ONLY;
510 }else if(lt == AIRPCAP_LT_802_11_PLUS_RADIO){
511 return AIRPCAP_LINK_TYPE_NAME_802_11_PLUS_RADIO;
512 }else if(lt == AIRPCAP_LT_802_11_PLUS_PPI){
513 return AIRPCAP_LINK_TYPE_NAME_802_11_PLUS_PPI;
514 }else if(lt == AIRPCAP_LT_UNKNOWN){
515 return AIRPCAP_LINK_TYPE_NAME_UNKNOWN;
521 * Sets the entry of the link type combo using the AirpcapLinkType.
524 airpcap_link_type_combo_set_by_type(GtkWidget* c, AirpcapLinkType type)
528 s = airpcap_get_link_name(type);
529 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(c)->entry),s);
533 * Retrieves the name in link type the combo entry.
536 airpcap_link_type_combo_get_type(GtkWidget* c)
540 s = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(c)->entry));
542 return airpcap_get_link_type(s);
546 * Sets the entry of the validation combo using the AirpcapValidationType.
549 airpcap_validation_type_combo_set_by_type(GtkWidget* c, AirpcapValidationType type)
553 s = airpcap_get_validation_name(type);
554 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(c)->entry),s);
558 * Retrieves the name in the validation combo entry.
560 AirpcapValidationType
561 airpcap_validation_type_combo_get_type(GtkWidget* c)
565 s = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(c)->entry));
567 return airpcap_get_validation_type(s);
571 * Retrieve the UINT corresponding to the given string (channel only, handle with care!)
574 airpcap_get_frequency_from_str(const gchar* s)
578 sscanf(s,"%ld",&ch_freq);
580 /* XXX - check for ch_num btween 1-14, and return -1 otherwise??? */
586 * Returns the string corresponding to the given UINT (1-14, for channel only)
589 airpcap_get_channel_name(UINT n)
591 return g_strdup_printf("%d",n);
595 * Set the combo box entry string given an UINT channel number
598 airpcap_channel_combo_set_by_number(GtkWidget* w,UINT chan_freq)
602 entry_text = ieee80211_mhz_to_str(chan_freq);
603 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(w)->entry),ieee80211_mhz_to_str(chan_freq));
608 * Change channel of Airpcap Adapter
611 airpcap_update_frequency_and_offset(airpcap_if_info_t* if_info)
613 gchar ebuf[AIRPCAP_ERRBUF_SIZE];
615 gboolean return_value = FALSE;
617 if (if_info != NULL){
618 ad = airpcap_if_open(if_info->name, ebuf);
621 return_value = airpcap_if_set_device_channel_ex(ad,if_info->channelInfo);
622 airpcap_if_close(ad);
630 * Update the channel offset of the given combobox
633 airpcap_update_channel_offset_cb(airpcap_if_info_t* if_info, ULONG ch_freq, GtkWidget *channel_offset_cb)
635 const gchar *current_offset;
636 gchar current_offset_copy[10];
637 gchar *new_offset_str;
640 if (airpcap_if_is_any(if_info)){
641 gtk_widget_set_sensitive(GTK_WIDGET(channel_offset_cb),FALSE);
642 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(channel_offset_cb)->entry), "0");
646 current_offset = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(channel_offset_cb)->entry));
647 strcpy (current_offset_copy, current_offset);
648 chan_flags = airpcap_load_channel_offset_cb(if_info, channel_offset_cb, ch_freq);
650 new_offset_str = current_offset_copy;
652 /* If current_offset == -1 && new_offset cannot be -1 */
653 if (strcmp(current_offset_copy, "-1") == 0 && !(chan_flags & FLAG_CAN_BE_HIGH)){
654 if ((chan_flags & FLAG_CAN_BE_LOW)){
655 new_offset_str = "+1";
657 new_offset_str = "0";
659 }else if (strcmp(current_offset_copy, "+1") == 0 && !(chan_flags & FLAG_CAN_BE_LOW)){
660 if ((chan_flags & FLAG_CAN_BE_HIGH)){
661 new_offset_str = "-1";
663 new_offset_str = "0";
667 change_airpcap_settings = FALSE;
668 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(channel_offset_cb)->entry), new_offset_str);
669 change_airpcap_settings = TRUE;
671 sscanf(new_offset_str,"%d",&(if_info->channelInfo.ExtChannel));
672 if (!airpcap_update_frequency_and_offset(if_info)){
673 simple_dialog(ESD_TYPE_ERROR,ESD_BTN_OK,"Adapter failed to be set with the following settings: Frequency - %ld Extension Channel - %d", if_info->channelInfo.Frequency, if_info->channelInfo.ExtChannel);
676 g_free(new_offset_str);
680 * Returns '1' if this is the "Any" adapter, '0' otherwise
683 airpcap_if_is_any(airpcap_if_info_t* if_info)
685 if(g_ascii_strcasecmp(if_info->name,AIRPCAP_DEVICE_ANY_EXTRACT_STRING)==0)
692 * Update channel combo box. If the airpcap interface is "Any", the combo box will be disabled.
695 airpcap_update_channel_combo(GtkWidget* w, airpcap_if_info_t* if_info)
697 gchar* frequency_list;
699 if(airpcap_if_is_any(if_info))
701 frequency_list = airpcap_get_all_channels_list(if_info);
702 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(w)->entry),frequency_list);
703 g_free(frequency_list);
704 change_airpcap_settings = FALSE;
705 gtk_widget_set_sensitive(GTK_WIDGET(w),FALSE);
709 airpcap_channel_combo_set_by_number(w,if_info->channelInfo.Frequency);
710 change_airpcap_settings = TRUE;
711 gtk_widget_set_sensitive(GTK_WIDGET(w),TRUE);
716 * Update channel offset combo box to 'offset'.
719 airpcap_update_channel_offset_combo_entry(GtkWidget* w, gchar extChannel)
721 gchar channel_offset_value[3];
724 sprintf(channel_offset_value, "+%d", extChannel);
726 sprintf(channel_offset_value, "%d", extChannel);
729 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(w)->entry), channel_offset_value);
733 * Update channel offset combo box given the selected frequency. Return the flags from the given frequency.
736 airpcap_load_channel_offset_cb(airpcap_if_info_t* if_info, GtkWidget* channel_offset_cb, ULONG chan_freq)
738 GList *channel_offset_list = NULL;
740 if (if_info != NULL && if_info->pSupportedChannels != NULL && if_info->numSupportedChannels > 0){
743 for (; i<if_info->numSupportedChannels; i++){
744 if (if_info->pSupportedChannels[i].Frequency == chan_freq){
745 if ((if_info->pSupportedChannels[i].Flags & FLAG_CAN_BE_HIGH)){
746 channel_offset_list = g_list_append(channel_offset_list, "-1");
748 channel_offset_list = g_list_append(channel_offset_list, "0");
749 if ((if_info->pSupportedChannels[i].Flags & FLAG_CAN_BE_LOW)){
750 channel_offset_list = g_list_append(channel_offset_list, "+1");
752 gtk_combo_set_popdown_strings( GTK_COMBO(channel_offset_cb), channel_offset_list) ;
753 gtk_widget_set_sensitive(channel_offset_cb, g_list_length(channel_offset_list) > 1);
754 g_list_free(channel_offset_list);
755 return if_info->pSupportedChannels[i].Flags;
764 * Takes the keys from the GtkList widget, and add them to the interface list
767 airpcap_add_keys_from_list(GtkWidget *key_ls, airpcap_if_info_t *if_info)
771 gchar *text_entered = NULL;
776 PAirpcapKeysCollection KeysCollection;
777 ULONG KeysCollectionSize;
780 UINT keys_in_list = 0;
786 keys_in_list = GTK_CLIST(key_ls)->rows;
789 * Save the encryption keys, if we have any of them
791 KeysCollectionSize = 0;
794 * Calculate the size of the keys collection
796 KeysCollectionSize = sizeof(AirpcapKeysCollection) + keys_in_list * sizeof(AirpcapKey);
799 * Allocate the collection
801 KeysCollection = (PAirpcapKeysCollection)g_malloc(KeysCollectionSize);
804 /* Simple dialog ERROR */
805 simple_dialog(ESD_TYPE_ERROR,ESD_BTN_OK,"%s","Failed mamory allocation for KeysCollection!");
810 * Populate the key collection
812 KeysCollection->nKeys = keys_in_list;
814 for(i = 0; i < keys_in_list; i++)
816 /* Retrieve the row infos */
817 gtk_clist_get_text(GTK_CLIST(key_ls),i,0,&row_type);
818 gtk_clist_get_text(GTK_CLIST(key_ls),i,1,&row_key);
819 gtk_clist_get_text(GTK_CLIST(key_ls),i,2,&row_ssid);
821 if(g_ascii_strcasecmp(row_type,AIRPCAP_WEP_KEY_STRING) == 0)
822 KeysCollection->Keys[i].KeyType = AIRPDCAP_KEY_TYPE_WEP;
823 else if(g_ascii_strcasecmp(row_type,AIRPCAP_WPA_PWD_KEY_STRING) == 0)
824 KeysCollection->Keys[i].KeyType = AIRPCAP_KEYTYPE_TKIP;
825 else if(g_ascii_strcasecmp(row_type,AIRPCAP_WPA_BIN_KEY_STRING) == 0)
826 KeysCollection->Keys[i].KeyType = AIRPCAP_KEYTYPE_CCMP;
828 /* Retrieve the Item corresponding to the i-th key */
829 new_key = g_string_new(row_key);
831 KeysCollection->Keys[i].KeyLen = new_key->len / 2;
832 memset(&KeysCollection->Keys[i].KeyData, 0, sizeof(KeysCollection->Keys[i].KeyData));
834 for(j = 0 ; j < new_key->len; j += 2)
836 s[0] = new_key->str[j];
837 s[1] = new_key->str[j+1];
839 KeyByte = (UCHAR)strtol(s, NULL, 16);
840 KeysCollection->Keys[i].KeyData[j / 2] = KeyByte;
845 * Free the old adapter key collection!
847 if(airpcap_if_selected->keysCollection != NULL)
848 g_free(airpcap_if_selected->keysCollection);
851 * Set this collection ad the new one
853 airpcap_if_selected->keysCollection = KeysCollection;
854 airpcap_if_selected->keysCollectionSize = KeysCollectionSize;
860 * Takes the keys from the GtkList widget, and add them to the interface list
863 airpcap_add_keys_to_driver_from_list(GtkWidget *key_ls,airpcap_if_info_t *fake_if_info)
867 gchar *text_entered = NULL;
872 PAirpcapKeysCollection KeysCollection;
873 ULONG KeysCollectionSize;
876 UINT keys_in_list = 0;
882 if(fake_if_info == NULL)
885 keys_in_list = GTK_CLIST(key_ls)->rows;
888 * Save the encryption keys, if we have any of them
890 KeysCollectionSize = 0;
893 * Calculate the size of the keys collection
895 KeysCollectionSize = sizeof(AirpcapKeysCollection) + keys_in_list * sizeof(AirpcapKey);
898 * Allocate the collection
900 KeysCollection = (PAirpcapKeysCollection)g_malloc(KeysCollectionSize);
903 /* Simple dialog ERROR */
904 simple_dialog(ESD_TYPE_ERROR,ESD_BTN_OK,"%s","Failed mamory allocation for KeysCollection!");
909 * Populate the key collection
911 KeysCollection->nKeys = keys_in_list;
913 for(i = 0; i < keys_in_list; i++)
915 /* Retrieve the row infos */
916 gtk_clist_get_text(GTK_CLIST(key_ls),i,0,&row_type);
917 gtk_clist_get_text(GTK_CLIST(key_ls),i,1,&row_key);
918 gtk_clist_get_text(GTK_CLIST(key_ls),i,2,&row_ssid);
920 if(g_ascii_strcasecmp(row_type,AIRPCAP_WEP_KEY_STRING) == 0)
921 KeysCollection->Keys[i].KeyType = AIRPDCAP_KEY_TYPE_WEP;
922 else if(g_ascii_strcasecmp(row_type,AIRPCAP_WPA_PWD_KEY_STRING) == 0)
923 KeysCollection->Keys[i].KeyType = AIRPDCAP_KEY_TYPE_WPA_PWD;
924 else if(g_ascii_strcasecmp(row_type,AIRPCAP_WPA_BIN_KEY_STRING) == 0)
925 KeysCollection->Keys[i].KeyType = AIRPDCAP_KEY_TYPE_WPA_PMK;
927 /* Retrieve the Item corresponding to the i-th key */
928 new_key = g_string_new(row_key);
930 KeysCollection->Keys[i].KeyLen = new_key->len / 2;
931 memset(&KeysCollection->Keys[i].KeyData, 0, sizeof(KeysCollection->Keys[i].KeyData));
933 /* Key must be saved in adifferent way, depending on its type... */
934 if(KeysCollection->Keys[i].KeyType == AIRPDCAP_KEY_TYPE_WEP)
936 for(j = 0 ; j < new_key->len; j += 2)
938 s[0] = new_key->str[j];
939 s[1] = new_key->str[j+1];
941 KeyByte = (UCHAR)strtol(s, NULL, 16);
942 KeysCollection->Keys[i].KeyData[j / 2] = KeyByte;
945 /* XXX - Save the keys that are not WEP!!! */
949 * Free the old adapter key collection!
951 if(fake_if_info->keysCollection != NULL)
952 g_free(fake_if_info->keysCollection);
955 * Set this collection ad the new one
957 fake_if_info->keysCollection = KeysCollection;
958 fake_if_info->keysCollectionSize = KeysCollectionSize;
963 * This function will take the current keys (widget list), specified for the
964 * current adapter, and save them as default for ALL the others.
967 airpcap_read_and_save_decryption_keys_from_clist(GtkWidget* key_ls, airpcap_if_info_t* info_if, GList* if_list)
973 airpcap_if_info_t* curr_if = NULL;
974 airpcap_if_info_t* fake_info_if = NULL;
975 GList* key_list=NULL;
977 char* tmp_type = NULL;
978 char* tmp_key = NULL;
979 char* tmp_ssid = NULL;
981 decryption_key_t* tmp_dk=NULL;
984 * Save the keys for Wireshark...
987 /* Create a list of keys from the list widget... */
988 n = GTK_CLIST(key_ls)->rows;
990 for(i = 0; i < n; i++)
992 /* XXX - Create a decryption_key_t struct, and pass a list of those structs!!! */
993 gtk_clist_get_text(GTK_CLIST(key_ls),i,0,&tmp_type);
994 gtk_clist_get_text(GTK_CLIST(key_ls),i,1,&tmp_key);
995 gtk_clist_get_text(GTK_CLIST(key_ls),i,2,&tmp_ssid);
997 if(g_ascii_strcasecmp(tmp_type,AIRPCAP_WEP_KEY_STRING) == 0)
999 tmp_dk = (decryption_key_t*)g_malloc(sizeof(decryption_key_t));
1000 tmp_dk->key = g_string_new(tmp_key);
1001 tmp_dk->ssid = NULL;
1002 tmp_dk->type = AIRPDCAP_KEY_TYPE_WEP;
1003 tmp_dk->bits = tmp_dk->key->len * 4;
1004 key_list = g_list_append(key_list,tmp_dk);
1006 else if(g_ascii_strcasecmp(tmp_type,AIRPCAP_WPA_PWD_KEY_STRING) == 0)
1008 tmp_dk = (decryption_key_t*)g_malloc(sizeof(decryption_key_t));
1009 tmp_dk->key = g_string_new(tmp_key);
1010 tmp_dk->ssid = g_byte_array_new();
1011 uri_str_to_bytes(tmp_ssid, tmp_dk->ssid);
1012 tmp_dk->type = AIRPDCAP_KEY_TYPE_WPA_PWD;
1014 key_list = g_list_append(key_list,tmp_dk);
1016 else if(g_ascii_strcasecmp(tmp_type,AIRPCAP_WPA_BIN_KEY_STRING) == 0)
1018 tmp_dk = (decryption_key_t*)g_malloc(sizeof(decryption_key_t));
1019 tmp_dk->key = g_string_new(tmp_key);
1020 tmp_dk->ssid = NULL; /* No SSID in this case */
1021 tmp_dk->type = AIRPDCAP_KEY_TYPE_WPA_PMK;
1023 key_list = g_list_append(key_list,tmp_dk);
1027 r = save_wlan_wireshark_wep_keys(key_list);
1028 /* The key_list has been freed!!! */
1031 * Save the key list for driver.
1033 if( (if_list == NULL) || (info_if == NULL) ) return;
1035 fake_info_if = airpcap_driver_fake_if_info_new();
1037 airpcap_add_keys_to_driver_from_list(key_ls,fake_info_if);
1038 airpcap_save_driver_if_configuration(fake_info_if);
1039 airpcap_if_info_free(fake_info_if);
1041 if_n = g_list_length(if_list);
1043 /* For all the adapters in the list, empty the key list */
1044 for(i = 0; i < if_n; i++)
1046 curr_if = (airpcap_if_info_t*)g_list_nth_data(if_list,i);
1050 /* XXX - Set an empty collection */
1051 airpcap_if_clear_decryption_settings(curr_if);
1053 /* Save to registry */
1054 airpcap_save_selected_if_configuration(curr_if);
1060 * This function will load from the preferences file ALL the
1061 * keys (WEP, WPA and WPA_BIN) and will set them as default for
1062 * each adapter. To do this, it will save the keys in the registry...
1063 * A check will be performed, to make sure that keys found in
1064 * registry and keys found in Wireshark preferences are the same. If not,
1065 * the user will be asked to choose if use all keys (merge them),
1066 * or use Wireshark preferences ones. In the last case, registry keys will
1067 * be overwritten for all the connected AirPcap adapters.
1068 * In the first case, adapters will use their own keys, but those
1069 * keys will not be accessible via Wireshark...
1072 airpcap_check_decryption_keys(GList* if_list)
1076 gint n_adapters_keys = 0;
1077 gint n_driver_keys = 0;
1078 gint n_wireshark_keys = 0;
1079 airpcap_if_info_t* curr_if = NULL;
1081 GList* wireshark_key_list;
1082 GList* driver_key_list;
1083 GList* curr_adapter_key_list;
1085 gboolean equals = TRUE;
1086 gboolean adapters_keys_equals=TRUE;
1089 * If no AirPcap interface is found, return TRUE, so Wireshark
1090 * will use HIS OWN keys.
1095 if_n = g_list_length(if_list);
1097 /* Get Wireshark preferences keys */
1098 wireshark_key_list = get_wireshark_keys();
1099 n_wireshark_keys = g_list_length(wireshark_key_list);
1101 /* Retrieve AirPcap driver's keys */
1102 driver_key_list = get_airpcap_driver_keys();
1103 n_driver_keys = g_list_length(driver_key_list);
1105 equals &= key_lists_are_equal(wireshark_key_list,driver_key_list);
1107 for(i = 0; i < if_n; i++)
1109 curr_if = (airpcap_if_info_t*)g_list_nth_data(if_list,i);
1110 curr_adapter_key_list = get_airpcap_device_keys(curr_if);
1111 n_adapters_keys += g_list_length(curr_adapter_key_list);
1112 adapters_keys_equals &= key_lists_are_equal(wireshark_key_list,curr_adapter_key_list);
1115 if(n_adapters_keys != 0) /* If for some reason at least one specific key has been found */
1116 equals &= adapters_keys_equals; /* */
1118 if(n_driver_keys == 0) /* No keys set in any of the AirPcap adapters... */
1119 return TRUE; /* Use Wireshark keys and set them ad default for airpcap devices */
1125 * This function will load from the preferences file ALL the
1126 * keys (WEP, WPA_PWD and WPA_BIN) and will set them as default for
1127 * each adapter. To do this, it will save the keys in the registry...
1128 * A check will be performed, to make sure that keys found in
1129 * registry and keys found in Wireshark preferences are the same. If not,
1130 * the user will be asked to choose if use all keys (merge them),
1131 * or use Wireshark preferences ones. In the last case, registry keys will
1132 * be overwritten for all the connected AirPcap adapters.
1133 * In the first case, adapters will use their own keys, but those
1134 * keys will not be accessible via Wireshark...
1137 airpcap_load_decryption_keys(GList* if_list)
1141 airpcap_if_info_t* curr_if = NULL;
1143 if(if_list == NULL) return;
1145 if_n = g_list_length(if_list);
1147 for(i = 0; i < if_n; i++)
1149 curr_if = (airpcap_if_info_t*)g_list_nth_data(if_list,i);
1150 load_wlan_driver_wep_keys();
1155 * This function will set the gibven GList of decryption_key_t structures
1156 * as the defoult for both Wireshark and the AirPcap adapters...
1159 airpcap_save_decryption_keys(GList* key_list, GList* adapters_list)
1164 airpcap_if_info_t* curr_if = NULL;
1165 GList* empty_key_list = NULL;
1167 if( (key_list == NULL) || (adapters_list == NULL)) return;
1169 if_n = g_list_length(adapters_list);
1170 key_n = g_list_length(key_list);
1172 /* Set the driver's global list of keys. */
1173 write_wlan_driver_wep_keys_to_registry(key_list);
1175 /* Empty the key list for each interface */
1176 for(i = 0; i < if_n; i++)
1178 curr_if = (airpcap_if_info_t*)g_list_nth_data(adapters_list,i);
1179 write_wlan_wep_keys_to_registry(curr_if,empty_key_list);
1183 * This will set the keys of the current adapter as Wireshark default...
1184 * Now all the adapters have the same keys, so curr_if is ok as any other...
1186 save_wlan_wireshark_wep_keys(key_list);
1190 * This function is used to enable/disable the toolbar widgets
1191 * depending on the type of interface selected... Not the whole
1192 * toolbar must be grayed/enabled ... Only some widgets...
1195 airpcap_enable_toolbar_widgets(GtkWidget* w, gboolean en)
1197 GtkWidget *toolbar_tb,
1212 if_description_lb = OBJECT_GET_DATA(toolbar_tb,AIRPCAP_TOOLBAR_INTERFACE_KEY);
1213 channel_lb = OBJECT_GET_DATA(toolbar_tb,AIRPCAP_TOOLBAR_CHANNEL_LABEL_KEY);
1214 channel_cb = OBJECT_GET_DATA(toolbar_tb,AIRPCAP_TOOLBAR_CHANNEL_KEY);
1215 channel_offset_cb = OBJECT_GET_DATA(toolbar_tb,AIRPCAP_TOOLBAR_CHANNEL_OFFSET_KEY);
1216 channel_offset_lb = OBJECT_GET_DATA(toolbar_tb,AIRPCAP_TOOLBAR_CHANNEL_OFFSET_LABEL_KEY);
1217 fcs_lb = OBJECT_GET_DATA(toolbar_tb,AIRPCAP_TOOLBAR_FCS_FILTER_LABEL_KEY);
1218 fcs_cb = OBJECT_GET_DATA(toolbar_tb,AIRPCAP_TOOLBAR_FCS_FILTER_KEY);
1219 advanced_bt = OBJECT_GET_DATA(toolbar_tb,AIRPCAP_TOOLBAR_ADVANCED_KEY);
1222 if(if_description_lb != NULL) gtk_widget_set_sensitive(if_description_lb,en);
1223 if(channel_lb != NULL) gtk_widget_set_sensitive(channel_lb,en);
1224 if(channel_cb != NULL) gtk_widget_set_sensitive(channel_cb,en);
1225 if(channel_offset_cb != NULL) gtk_widget_set_sensitive(channel_offset_cb,en);
1226 if(channel_offset_lb != NULL) gtk_widget_set_sensitive(channel_offset_lb,en);
1227 if(fcs_lb != NULL) gtk_widget_set_sensitive(fcs_lb,en);
1228 if(fcs_cb != NULL) gtk_widget_set_sensitive(fcs_cb,en);
1229 if(advanced_bt != NULL) gtk_widget_set_sensitive(advanced_bt,en);
1235 * This function sets up the correct airpcap toolbar that must
1236 * be displayed when no airpcap if is found on the system...
1239 airpcap_set_toolbar_no_if(GtkWidget* w)
1241 GtkWidget *toolbar_tb,
1256 if_description_lb = OBJECT_GET_DATA(toolbar_tb,AIRPCAP_TOOLBAR_INTERFACE_KEY);
1257 channel_lb = OBJECT_GET_DATA(toolbar_tb,AIRPCAP_TOOLBAR_CHANNEL_LABEL_KEY);
1258 channel_cb = OBJECT_GET_DATA(toolbar_tb,AIRPCAP_TOOLBAR_CHANNEL_KEY);
1259 channel_offset_lb = OBJECT_GET_DATA(toolbar_tb,AIRPCAP_TOOLBAR_CHANNEL_OFFSET_LABEL_KEY);
1260 channel_offset_cb = OBJECT_GET_DATA(toolbar_tb,AIRPCAP_TOOLBAR_CHANNEL_OFFSET_KEY);
1261 fcs_lb = OBJECT_GET_DATA(toolbar_tb,AIRPCAP_TOOLBAR_FCS_FILTER_LABEL_KEY);
1262 fcs_cb = OBJECT_GET_DATA(toolbar_tb,AIRPCAP_TOOLBAR_FCS_FILTER_KEY);
1263 advanced_bt = OBJECT_GET_DATA(toolbar_tb,AIRPCAP_TOOLBAR_ADVANCED_KEY);
1265 if(fcs_cb != NULL) gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(fcs_cb)->entry),"");
1266 if(channel_cb != NULL) gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(channel_cb)->entry),"");
1267 if(channel_offset_cb != NULL) gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(channel_offset_cb)->entry),"");
1268 if(if_description_lb != NULL) gtk_label_set_text(GTK_LABEL(if_description_lb),"Current Wireless Interface: None");
1270 /*if(if_description_lb != NULL) gtk_widget_set_sensitive(if_description_lb,FALSE);
1271 if(channel_lb != NULL) gtk_widget_set_sensitive(channel_lb,FALSE);
1272 if(channel_cb != NULL) gtk_widget_set_sensitive(channel_cb,FALSE);
1273 if(fcs_lb != NULL) gtk_widget_set_sensitive(fcs_lb,FALSE);
1274 if(fcs_cb != NULL) gtk_widget_set_sensitive(fcs_cb,FALSE);
1275 if(advanced_bt != NULL) gtk_widget_set_sensitive(advanced_bt,FALSE);*/
1278 #endif /* HAVE_AIRPCAP */