Fix WEP key bug in the AirPcap code that could cause a crash. Enable
[obnox/wireshark/wip.git] / gtk / airpcap_gui_utils.h
1 /* airpcap_utils.h
2  * Declarations of utility routines for the "Airpcap" dialog widgets
3  *
4  * $Id$
5  *
6  * Giorgio Tino <giorgio.tino@cacetech.com>
7  * Copyright (c) CACE Technologies, LLC 2006
8  *
9  * Wireshark - Network traffic analyzer
10  * By Gerald Combs <gerald@wireshark.org>
11  * Copyright 1998 Gerald Combs
12  *
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.
17  *
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.
22  *
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.
26  */
27
28 #ifndef __AIRPCAP_GUI_UTILS_H__
29 #define __AIRPCAP_GUI_UTILS_H__
30
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"
35
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"
39
40 /*
41  * set up the airpcap toolbar for the new capture interface
42  */
43 void
44 airpcap_set_toolbar_start_capture(airpcap_if_info_t* if_info);
45
46 /*
47  * Set up the airpcap toolbar for the new capture interface
48  */
49 void
50 airpcap_set_toolbar_stop_capture(airpcap_if_info_t* if_info);
51
52 /*
53  * Add a key (string) to the given list
54  */
55 void
56 airpcap_add_key_to_list(GtkWidget *keylist, gchar* s);
57
58 /*
59  * Fill the list with the keys
60  */
61 void
62 airpcap_fill_key_list(GtkWidget *keylist,airpcap_if_info_t* if_info);
63
64 /*
65  * Function used to retrieve the AirpcapValidationType given the string name.
66  */
67 AirpcapValidationType
68 airpcap_get_validation_type(const gchar* name);
69
70 /*
71  * Function used to retrieve the string name given an AirpcapValidationType.
72  */
73 gchar*
74 airpcap_get_validation_name(AirpcapValidationType vt);
75
76 /*
77  * Returns the AirpcapLinkType corresponding to the given string name.
78  */
79 AirpcapLinkType
80 airpcap_get_link_type(const gchar* name);
81
82 /*
83  * Returns the string name corresponding to the given AirpcapLinkType.
84  */
85 gchar*
86 airpcap_get_link_name(AirpcapLinkType lt);
87
88 /*
89  * Sets the entry of the link type combo using the AirpcapLinkType.
90  */
91 void
92 airpcap_link_type_combo_set_by_type(GtkWidget* c, AirpcapLinkType type);
93
94 /*
95  * Retrieves the name in link type the combo entry.
96  */
97 AirpcapLinkType
98 airpcap_link_type_combo_get_type(GtkWidget* c);
99
100 /*
101  * Sets the entry of the validation combo using the AirpcapValidationType.
102  */
103 void
104 airpcap_validation_type_combo_set_by_type(GtkWidget* c,AirpcapValidationType type);
105
106 /*
107  * Retrieves the name in the validation combo entry.
108  */
109 AirpcapValidationType
110 airpcap_validation_type_combo_get_type(GtkWidget* c);
111
112 /*
113  * Returns the string corresponding to the given UINT (1-14, for channel only)
114  */
115 UINT
116 airpcap_get_channel_number(const gchar* s);
117
118 /*
119  * Retrieve the UINT corresponding to the given string (channel only, handle with care!)
120  */
121 gchar*
122 airpcap_get_channel_name(UINT n);
123
124 /*
125  * Set the combo box entry string given an UINT channel number
126  */
127 void
128 airpcap_channel_combo_set_by_number(GtkWidget* w,UINT channel);
129
130 /*
131  * Returns '1' if this is the "Any" adapter, '0' otherwise
132  */
133 int
134 airpcap_if_is_any(airpcap_if_info_t* if_info);
135
136 /*
137  * Update channel combo box. If the airpcap interface is "Any", the combo box will be disabled.
138  */
139 void
140 airpcap_update_channel_combo(GtkWidget* w, airpcap_if_info_t* if_info);
141
142 #endif