1 |
bf9ca82a
|
Scott Ullrich
|
<?
|
2 |
8600af6f
|
Scott Ullrich
|
/* $Id$ */
|
3 |
|
|
/*
|
4 |
|
|
interfaces_wlan.inc
|
5 |
|
|
part of m0n0wall (http://m0n0.ch/wall)
|
6 |
bf9ca82a
|
Scott Ullrich
|
|
7 |
8600af6f
|
Scott Ullrich
|
Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
|
8 |
|
|
All rights reserved.
|
9 |
bf9ca82a
|
Scott Ullrich
|
|
10 |
8600af6f
|
Scott Ullrich
|
Redistribution and use in source and binary forms, with or without
|
11 |
|
|
modification, are permitted provided that the following conditions are met:
|
12 |
bf9ca82a
|
Scott Ullrich
|
|
13 |
8600af6f
|
Scott Ullrich
|
1. Redistributions of source code must retain the above copyright notice,
|
14 |
|
|
this list of conditions and the following disclaimer.
|
15 |
bf9ca82a
|
Scott Ullrich
|
|
16 |
8600af6f
|
Scott Ullrich
|
2. Redistributions in binary form must reproduce the above copyright
|
17 |
|
|
notice, this list of conditions and the following disclaimer in the
|
18 |
|
|
documentation and/or other materials provided with the distribution.
|
19 |
bf9ca82a
|
Scott Ullrich
|
|
20 |
8600af6f
|
Scott Ullrich
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
21 |
|
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
22 |
|
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
23 |
|
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
24 |
|
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
25 |
|
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
26 |
|
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
27 |
|
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
28 |
|
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
29 |
|
|
POSSIBILITY OF SUCH DAMAGE.
|
30 |
|
|
*/
|
31 |
|
|
|
32 |
|
|
function wireless_config_init() {
|
33 |
|
|
global $optcfg, $pconfig;
|
34 |
8f71faba
|
Espen Johansen
|
|
35 |
8600af6f
|
Scott Ullrich
|
$pconfig['standard'] = $optcfg['wireless']['standard'];
|
36 |
|
|
$pconfig['mode'] = $optcfg['wireless']['mode'];
|
37 |
bfe7a893
|
Scott Ullrich
|
$pconfig['protmode'] = $optcfg['wireless']['protmode'];
|
38 |
8600af6f
|
Scott Ullrich
|
$pconfig['ssid'] = $optcfg['wireless']['ssid'];
|
39 |
|
|
$pconfig['channel'] = $optcfg['wireless']['channel'];
|
40 |
8f71faba
|
Espen Johansen
|
$pconfig['txpower'] = $optcfg['wireless']['txpower'];
|
41 |
57f13ba8
|
Scott Ullrich
|
$pconfig['distance'] = $optcfg['wireless']['distance'];
|
42 |
d213185e
|
Espen Johansen
|
$pconfig['wme_enable'] = isset($optcfg['wireless']['wme']['enable']);
|
43 |
|
|
$pconfig['pureg_enable'] = isset($optcfg['wireless']['pureg']['enable']);
|
44 |
ac3f8318
|
Espen Johansen
|
$pconfig['apbridge_enable'] = isset($optcfg['wireless']['apbridge']['enable']);
|
45 |
8f71faba
|
Espen Johansen
|
$pconfig['authmode'] = $optcfg['wireless']['authmode'];
|
46 |
d213185e
|
Espen Johansen
|
$pconfig['hidessid_enable'] = isset($optcfg['wireless']['hidessid']['enable']);
|
47 |
8f71faba
|
Espen Johansen
|
$pconfig['debug_mode'] = $optcfg['wireless']['wpa']['debug_mode'];
|
48 |
|
|
$pconfig['macaddr_acl'] = $optcfg['wireless']['wpa']['macaddr_acl'];
|
49 |
ef773bd6
|
Scott Ullrich
|
$pconfig['mac_acl_enable'] = isset($optcfg['wireless']['wpa']['mac_acl_enable']);
|
50 |
8f71faba
|
Espen Johansen
|
$pconfig['auth_algs'] = $optcfg['wireless']['wpa']['auth_algs'];
|
51 |
|
|
$pconfig['wpa_mode'] = $optcfg['wireless']['wpa']['wpa_mode'];
|
52 |
|
|
$pconfig['wpa_key_mgmt'] = $optcfg['wireless']['wpa']['wpa_key_mgmt'];
|
53 |
|
|
$pconfig['wpa_pairwise'] = $optcfg['wireless']['wpa']['wpa_pairwise'];
|
54 |
|
|
$pconfig['wpa_group_rekey'] = $optcfg['wireless']['wpa']['wpa_group_rekey'];
|
55 |
|
|
$pconfig['wpa_gmk_rekey'] = $optcfg['wireless']['wpa']['wpa_gmk_rekey'];
|
56 |
6518f0a6
|
Scott Ullrich
|
$pconfig['wpa_strict_rekey'] = isset($optcfg['wireless']['wpa']['wpa_strict_rekey']);
|
57 |
8f71faba
|
Espen Johansen
|
$pconfig['passphrase'] = $optcfg['wireless']['wpa']['passphrase'];
|
58 |
ac3f8318
|
Espen Johansen
|
$pconfig['ieee8021x_enable'] = isset($optcfg['wireless']['wpa']['ieee8021x']['enable']);
|
59 |
8f71faba
|
Espen Johansen
|
$pconfig['ext_wpa_sw'] = $optcfg['wireless']['wpa']['ext_wpa_sw'];
|
60 |
|
|
$pconfig['wpa_enable'] = isset($optcfg['wireless']['wpa']['enable']);
|
61 |
8600af6f
|
Scott Ullrich
|
$pconfig['wep_enable'] = isset($optcfg['wireless']['wep']['enable']);
|
62 |
8f71faba
|
Espen Johansen
|
$pconfig['mac_acl'] = $optcfg['wireless']['mac_acl'];
|
63 |
|
|
|
64 |
8600af6f
|
Scott Ullrich
|
if (is_array($optcfg['wireless']['wep']['key'])) {
|
65 |
|
|
$i = 1;
|
66 |
|
|
foreach ($optcfg['wireless']['wep']['key'] as $wepkey) {
|
67 |
|
|
$pconfig['key' . $i] = $wepkey['value'];
|
68 |
|
|
if (isset($wepkey['txkey']))
|
69 |
|
|
$pconfig['txkey'] = $i;
|
70 |
|
|
$i++;
|
71 |
|
|
}
|
72 |
|
|
if (!isset($wepkey['txkey']))
|
73 |
|
|
$pconfig['txkey'] = 1;
|
74 |
|
|
}
|
75 |
|
|
}
|
76 |
|
|
|
77 |
|
|
function wireless_config_post() {
|
78 |
d8c67d69
|
Scott Ullrich
|
global $optcfg, $pconfig;
|
79 |
8600af6f
|
Scott Ullrich
|
|
80 |
d8c67d69
|
Scott Ullrich
|
$input_errors = "";
|
81 |
8600af6f
|
Scott Ullrich
|
unset($input_errors);
|
82 |
|
|
|
83 |
|
|
/* input validation */
|
84 |
|
|
if ($_POST['enable']) {
|
85 |
|
|
$reqdfields = explode(" ", "mode ssid");
|
86 |
|
|
$reqdfieldsn = explode(",", "Mode,SSID");
|
87 |
|
|
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
|
88 |
bf9ca82a
|
Scott Ullrich
|
|
89 |
8600af6f
|
Scott Ullrich
|
if (!$input_errors) {
|
90 |
|
|
/* bridge check (hostap only!) */
|
91 |
|
|
if ($pconfig['bridge'] && ($pconfig['mode'] != "hostap"))
|
92 |
|
|
$input_errors[] = "Bridging a wireless interface is only possible in hostap mode.";
|
93 |
|
|
}
|
94 |
|
|
}
|
95 |
|
|
|
96 |
|
|
/* loop through keys and enforce size */
|
97 |
|
|
for ($i = 1; $i <= 4; $i++) {
|
98 |
|
|
if ($_POST['key' . $i]) {
|
99 |
192fd3d1
|
Scott Ullrich
|
/* 64 bit */
|
100 |
ea206efb
|
Scott Ullrich
|
if(strlen($_POST['key' . $i]) == 5)
|
101 |
|
|
continue;
|
102 |
bcf53132
|
Scott Ullrich
|
if(strlen($_POST['key' . $i]) == 10) {
|
103 |
|
|
/* hex key */
|
104 |
|
|
if(stristr($_POST['key' . $i], "0x") == false) {
|
105 |
|
|
$_POST['key' . $i] = "0x" . $_POST['key' . $i];
|
106 |
|
|
}
|
107 |
ea206efb
|
Scott Ullrich
|
continue;
|
108 |
bcf53132
|
Scott Ullrich
|
}
|
109 |
18547c5d
|
Scott Ullrich
|
if(strlen($_POST['key' . $i]) == 12) {
|
110 |
|
|
/* hex key */
|
111 |
|
|
if(stristr($_POST['key' . $i], "0x") == false) {
|
112 |
|
|
$_POST['key' . $i] = "0x" . $_POST['key' . $i];
|
113 |
|
|
}
|
114 |
|
|
continue;
|
115 |
bf9ca82a
|
Scott Ullrich
|
}
|
116 |
192fd3d1
|
Scott Ullrich
|
/* 128 bit */
|
117 |
ea206efb
|
Scott Ullrich
|
if(strlen($_POST['key' . $i]) == 13)
|
118 |
|
|
continue;
|
119 |
bcf53132
|
Scott Ullrich
|
if(strlen($_POST['key' . $i]) == 26) {
|
120 |
|
|
/* hex key */
|
121 |
|
|
if(stristr($_POST['key' . $i], "0x") == false) {
|
122 |
|
|
$_POST['key' . $i] = "0x" . $_POST['key' . $i];
|
123 |
bf9ca82a
|
Scott Ullrich
|
}
|
124 |
ea206efb
|
Scott Ullrich
|
continue;
|
125 |
bcf53132
|
Scott Ullrich
|
}
|
126 |
c33565ad
|
Scott Ullrich
|
if(strlen($_POST['key' . $i]) == 28)
|
127 |
|
|
continue;
|
128 |
ea206efb
|
Scott Ullrich
|
$input_errors[] = "Invalid wep key size. Sizes should be 40 (64) bit keys or 104 (128) bit.";
|
129 |
b4197106
|
Scott Ullrich
|
break;
|
130 |
8600af6f
|
Scott Ullrich
|
}
|
131 |
|
|
}
|
132 |
|
|
|
133 |
|
|
if (!$input_errors) {
|
134 |
8f71faba
|
Espen Johansen
|
|
135 |
8600af6f
|
Scott Ullrich
|
$optcfg['wireless']['standard'] = $_POST['standard'];
|
136 |
|
|
$optcfg['wireless']['mode'] = $_POST['mode'];
|
137 |
bfe7a893
|
Scott Ullrich
|
$optcfg['wireless']['protmode'] = $_POST['protmode'];
|
138 |
8600af6f
|
Scott Ullrich
|
$optcfg['wireless']['ssid'] = $_POST['ssid'];
|
139 |
|
|
$optcfg['wireless']['channel'] = $_POST['channel'];
|
140 |
bf9ca82a
|
Scott Ullrich
|
$optcfg['wireless']['authmode'] = $_POST['authmode'];
|
141 |
8600af6f
|
Scott Ullrich
|
$optcfg['wireless']['txpower'] = $_POST['txpower'];
|
142 |
57f13ba8
|
Scott Ullrich
|
$optcfg['wireless']['distance'] = $_POST['distance'];
|
143 |
8f71faba
|
Espen Johansen
|
$optcfg['wireless']['wpa']['macaddr_acl'] = $_POST['macaddr_acl'];
|
144 |
|
|
$optcfg['wireless']['wpa']['auth_algs'] = $_POST['auth_algs'];
|
145 |
|
|
$optcfg['wireless']['wpa']['wpa_mode'] = $_POST['wpa_mode'];
|
146 |
|
|
$optcfg['wireless']['wpa']['wpa_key_mgmt'] = $_POST['wpa_key_mgmt'];
|
147 |
|
|
$optcfg['wireless']['wpa']['wpa_pairwise'] = $_POST['wpa_pairwise'];
|
148 |
|
|
$optcfg['wireless']['wpa']['wpa_group_rekey'] = $_POST['wpa_group_rekey'];
|
149 |
|
|
$optcfg['wireless']['wpa']['wpa_gmk_rekey'] = $_POST['wpa_gmk_rekey'];
|
150 |
|
|
$optcfg['wireless']['wpa']['passphrase'] = $_POST['passphrase'];
|
151 |
|
|
$optcfg['wireless']['wpa']['ext_wpa_sw'] = $_POST['ext_wpa_sw'];
|
152 |
fa16d51e
|
Scott Ullrich
|
|
153 |
bf9ca82a
|
Scott Ullrich
|
if($_POST['hidessid_enable'] == "yes")
|
154 |
20172515
|
Scott Ullrich
|
$optcfg['wireless']['hidessid']['enable'] = true;
|
155 |
|
|
else
|
156 |
|
|
unset($optcfg['wireless']['hidessid']['enable']);
|
157 |
|
|
|
158 |
bf9ca82a
|
Scott Ullrich
|
if($_POST['mac_acl_enable'] == "yes")
|
159 |
57f13ba8
|
Scott Ullrich
|
$optcfg['wireless']['wpa']['mac_acl_enable'] = true;
|
160 |
f438eed4
|
Scott Ullrich
|
else
|
161 |
57f13ba8
|
Scott Ullrich
|
unset($optcfg['wireless']['wpa']['mac_acl_enable']);
|
162 |
f438eed4
|
Scott Ullrich
|
|
163 |
20172515
|
Scott Ullrich
|
if($_POST['ieee8021x_enable'] == "yes")
|
164 |
|
|
$optcfg['wireless']['wpa']['ieee8021x']['enable'] = true;
|
165 |
|
|
else
|
166 |
|
|
unset($optcfg['wireless']['wpa']['ieee8021x']['enable']);
|
167 |
bf9ca82a
|
Scott Ullrich
|
|
168 |
20172515
|
Scott Ullrich
|
if($_POST['wpa_strict_rekey'] == "yes")
|
169 |
|
|
$optcfg['wireless']['wpa']['wpa_strict_rekey'] = true;
|
170 |
|
|
else
|
171 |
|
|
unset($optcfg['wireless']['wpa']['wpa_strict_rekey']);
|
172 |
|
|
|
173 |
bf9ca82a
|
Scott Ullrich
|
if($_POST['debug_mode'] == "yes")
|
174 |
20172515
|
Scott Ullrich
|
$optcfg['wireless']['wpa']['debug_mode'] = true;
|
175 |
|
|
else
|
176 |
|
|
unset($optcfg['wireless']['wpa']['debug_mode']);
|
177 |
|
|
|
178 |
bf9ca82a
|
Scott Ullrich
|
if($_POST['wpa_enable'] == "yes")
|
179 |
fa16d51e
|
Scott Ullrich
|
$optcfg['wireless']['wpa']['enable'] = $_POST['wpa_enable'] = true;
|
180 |
|
|
else
|
181 |
|
|
unset($optcfg['wireless']['wpa']['enable']);
|
182 |
|
|
|
183 |
bf9ca82a
|
Scott Ullrich
|
if($_POST['wep_enable'] == "yes")
|
184 |
fa16d51e
|
Scott Ullrich
|
$optcfg['wireless']['wep']['enable'] = $_POST['wep_enable'] = true;
|
185 |
|
|
else
|
186 |
|
|
unset($optcfg['wireless']['wep']['enable']);
|
187 |
|
|
|
188 |
bf9ca82a
|
Scott Ullrich
|
if($_POST['wme_enable'] == "yes")
|
189 |
fa16d51e
|
Scott Ullrich
|
$optcfg['wireless']['wme']['enable'] = $_POST['wme_enable'] = true;
|
190 |
|
|
else
|
191 |
|
|
unset($optcfg['wireless']['wme']['enable']);
|
192 |
|
|
|
193 |
20172515
|
Scott Ullrich
|
if($_POST['pureg_enable'] == "yes")
|
194 |
fa16d51e
|
Scott Ullrich
|
$optcfg['wireless']['pureg']['enable'] = $_POST['pureg_enable'] = true;
|
195 |
|
|
else
|
196 |
|
|
unset($optcfg['wireless']['pureg']['enable']);
|
197 |
|
|
|
198 |
bf9ca82a
|
Scott Ullrich
|
if($_POST['apbridge_enable'] == "yes")
|
199 |
fa16d51e
|
Scott Ullrich
|
$optcfg['wireless']['apbridge']['enable'] = $_POST['apbridge_enable'] = true;
|
200 |
|
|
else
|
201 |
|
|
unset($optcfg['wireless']['apbridge']['enable']);
|
202 |
|
|
|
203 |
bf9ca82a
|
Scott Ullrich
|
if($_POST['standard'] == "11a Turbo")
|
204 |
6f17ad79
|
Scott Ullrich
|
$optcfg['wireless']['turbo']['enable'] = true;
|
205 |
fa16d51e
|
Scott Ullrich
|
else
|
206 |
|
|
unset($optcfg['wireless']['turbo']['enable']);
|
207 |
|
|
|
208 |
8600af6f
|
Scott Ullrich
|
$optcfg['wireless']['wep']['key'] = array();
|
209 |
d213185e
|
Espen Johansen
|
|
210 |
8600af6f
|
Scott Ullrich
|
for ($i = 1; $i <= 4; $i++) {
|
211 |
|
|
if ($_POST['key' . $i]) {
|
212 |
|
|
$newkey = array();
|
213 |
|
|
$newkey['value'] = $_POST['key' . $i];
|
214 |
|
|
if ($_POST['txkey'] == $i)
|
215 |
|
|
$newkey['txkey'] = true;
|
216 |
|
|
$optcfg['wireless']['wep']['key'][] = $newkey;
|
217 |
|
|
}
|
218 |
|
|
}
|
219 |
|
|
}
|
220 |
bf9ca82a
|
Scott Ullrich
|
|
221 |
8600af6f
|
Scott Ullrich
|
return $input_errors;
|
222 |
|
|
}
|
223 |
|
|
|
224 |
bf9ca82a
|
Scott Ullrich
|
if($wancfg['if'])
|
225 |
6f17ad79
|
Scott Ullrich
|
$curif = $lancfg['if'];
|
226 |
bf9ca82a
|
Scott Ullrich
|
if($wancfg['if'])
|
227 |
6f17ad79
|
Scott Ullrich
|
$curif = $lancfg['if'];
|
228 |
bf9ca82a
|
Scott Ullrich
|
if($optcfg['if'])
|
229 |
|
|
$curif = $optcfg['if'];
|
230 |
6f17ad79
|
Scott Ullrich
|
|
231 |
|
|
$wl_modes = get_wireless_modes($curif);
|
232 |
|
|
|
233 |
8600af6f
|
Scott Ullrich
|
function wireless_config_print() {
|
234 |
6f17ad79
|
Scott Ullrich
|
global $optcfg, $pconfig, $wl_modes, $g;
|
235 |
8600af6f
|
Scott Ullrich
|
?>
|
236 |
f881baa3
|
Scott Ullrich
|
|
237 |
|
|
<script language="JavaScript">
|
238 |
|
|
function openwindow(url) {
|
239 |
|
|
var oWin = window.open(url,"pfSensePop","width=620,height=400,top=150,left=150");
|
240 |
|
|
if (oWin==null || typeof(oWin)=="undefined") {
|
241 |
|
|
return false;
|
242 |
|
|
} else {
|
243 |
|
|
return true;
|
244 |
|
|
}
|
245 |
|
|
}
|
246 |
|
|
</script>
|
247 |
bf9ca82a
|
Scott Ullrich
|
<tr>
|
248 |
8600af6f
|
Scott Ullrich
|
<td colspan="2" valign="top" height="16"></td>
|
249 |
ac3f8318
|
Espen Johansen
|
</tr>
|
250 |
|
|
|
251 |
bf9ca82a
|
Scott Ullrich
|
<tr>
|
252 |
8600af6f
|
Scott Ullrich
|
<td colspan="2" valign="top" class="listtopic">Wireless configuration</td>
|
253 |
ac3f8318
|
Espen Johansen
|
</tr>
|
254 |
|
|
<tr>
|
255 |
|
|
<td valign="top" class="vncellreq">Standard</td>
|
256 |
|
|
<td class="vtable">
|
257 |
8e13ca40
|
Seth Mos
|
<select name="standard" class="formselect" id="standard">
|
258 |
6f17ad79
|
Scott Ullrich
|
<?php
|
259 |
|
|
foreach($wl_modes as $wl_standard => $wl_channels) {
|
260 |
|
|
PRINT "<option ";
|
261 |
|
|
if ($pconfig['standard'] == "$wl_standard") {
|
262 |
|
|
PRINT "selected ";
|
263 |
|
|
}
|
264 |
|
|
PRINT "value=\"$wl_standard\">802.$wl_standard</option>\n";
|
265 |
|
|
}
|
266 |
|
|
?>
|
267 |
ac3f8318
|
Espen Johansen
|
</select>
|
268 |
|
|
</td>
|
269 |
|
|
</tr>
|
270 |
|
|
<tr>
|
271 |
|
|
<td valign="top" class="vncellreq">Mode</td>
|
272 |
|
|
<td class="vtable">
|
273 |
8e13ca40
|
Seth Mos
|
<select name="mode" class="formselect" id="mode">
|
274 |
ac3f8318
|
Espen Johansen
|
<option <? if ($pconfig['mode'] == 'bss') echo "selected";?> value="bss">Infrastructure (BSS)</option>
|
275 |
|
|
<option <? if ($pconfig['mode'] == 'adhoc') echo "selected";?> value="adhoc">Ad-hoc (IBSS)</option>
|
276 |
|
|
<option <? if ($pconfig['mode'] == 'hostap') echo "selected";?> value="hostap">Access Point</option>
|
277 |
|
|
</select>
|
278 |
|
|
</td>
|
279 |
|
|
</tr>
|
280 |
bfe7a893
|
Scott Ullrich
|
<tr>
|
281 |
|
|
<td valign="top" class="vncellreq">802.11g OFDM Protection Mode</td>
|
282 |
|
|
<td class="vtable">
|
283 |
8e13ca40
|
Seth Mos
|
<select name="protmode" class="formselect" id="protmode">
|
284 |
bfe7a893
|
Scott Ullrich
|
<option <? if ($pconfig['protmode'] == 'off') echo "selected";?> value="off">Protection mode off</option>
|
285 |
|
|
<option <? if ($pconfig['protmode'] == 'cts') echo "selected";?> value="cts">Protection mode CTS to self</option>
|
286 |
|
|
<option <? if ($pconfig['protmode'] == 'rtscts') echo "selected";?> value="rtscts">Protection mode RTS and CTS</option>
|
287 |
|
|
</select>
|
288 |
|
|
<br/>
|
289 |
|
|
For IEEE 802.11g, use the specified technique for protecting OFDM frames in a mixed 11b/11g network.
|
290 |
|
|
<br/>
|
291 |
|
|
</td>
|
292 |
|
|
</tr>
|
293 |
ac3f8318
|
Espen Johansen
|
<tr>
|
294 |
d213185e
|
Espen Johansen
|
<td valign="top" class="vncellreq">SSID</td>
|
295 |
8e13ca40
|
Seth Mos
|
<td class="vtable"><input name="ssid" type="text" class="formfld unknown" id="ssid" size="20" value="<?=htmlspecialchars($pconfig['ssid']);?>">
|
296 |
d213185e
|
Espen Johansen
|
</td>
|
297 |
8600af6f
|
Scott Ullrich
|
</tr>
|
298 |
d213185e
|
Espen Johansen
|
<tr>
|
299 |
8f71faba
|
Espen Johansen
|
<td valign="top" class="vncell">802.11g only</td>
|
300 |
57f13ba8
|
Scott Ullrich
|
<td class="vtable"><input name="pureg_enable" type="checkbox" value="yes" class="formfld" id="pureg_enable" <? if ($pconfig['pureg_enable']) echo "checked";?>>
|
301 |
d213185e
|
Espen Johansen
|
<br/>When operating as an access point in 802.11g mode allow only 11g-capable stations to associate (11b-only stations are not permitted to associate).
|
302 |
|
|
</td>
|
303 |
|
|
</tr>
|
304 |
ac3f8318
|
Espen Johansen
|
<tr>
|
305 |
|
|
<td valign="top" class="vncell">Allow intra-BSS communication</td>
|
306 |
57f13ba8
|
Scott Ullrich
|
<td class="vtable"><input name="apbridge_enable" type="checkbox" value="yes" class="formfld" id="apbridge_enable" <? if ($pconfig['apbridge_enable']) echo "checked";?>>
|
307 |
ac3f8318
|
Espen Johansen
|
<br/>
|
308 |
|
|
When operating as an access point, enable this if you want to pass packets between wireless clients directly.
|
309 |
|
|
<br/>
|
310 |
|
|
Disabling the internal bridging is useful when traffic is to be processed with packet filtering.
|
311 |
8f71faba
|
Espen Johansen
|
</td>
|
312 |
|
|
</tr>
|
313 |
|
|
<tr>
|
314 |
|
|
<td valign="top" class="vncell">Enable WME</td>
|
315 |
57f13ba8
|
Scott Ullrich
|
<td class="vtable"><input name="wme_enable" type="checkbox" class="formfld" id="wme_enable" value="yes" <? if ($pconfig['wme_enable']) echo "checked";?>>
|
316 |
8f71faba
|
Espen Johansen
|
<br/>Setting this option will force the card to use WME (wireless QoS).
|
317 |
|
|
</td>
|
318 |
|
|
</tr>
|
319 |
|
|
<tr>
|
320 |
|
|
<td valign="top" class="vncell">Enable Hide SSID</td>
|
321 |
57f13ba8
|
Scott Ullrich
|
<td class="vtable"><input name="hidessid_enable" type="checkbox" class="formfld" id="hidessid_enable" value="yes" <? if ($pconfig['hidessid_enable']) echo "checked";?>>
|
322 |
ac3f8318
|
Espen Johansen
|
<br/>
|
323 |
|
|
Setting this option will force the card to NOT broadcast it's SSID
|
324 |
|
|
<br/>
|
325 |
|
|
(this might create problems for some clients). </td>
|
326 |
bf9ca82a
|
Scott Ullrich
|
</tr>
|
327 |
|
|
<tr>
|
328 |
8f71faba
|
Espen Johansen
|
<td valign="top" class="vncellreq">Transmit power</td>
|
329 |
|
|
<td class="vtable">
|
330 |
8e13ca40
|
Seth Mos
|
<select name="txpower" class="formselect" id="txpower">
|
331 |
ac3f8318
|
Espen Johansen
|
<?
|
332 |
60ae7b45
|
Scott Ullrich
|
for($x = 99; $x > 0; $x--) {
|
333 |
8600af6f
|
Scott Ullrich
|
if($pconfig["txpower"] == $x)
|
334 |
|
|
$SELECTED = " SELECTED";
|
335 |
|
|
else
|
336 |
|
|
$SELECTED = "";
|
337 |
|
|
echo "<option {$SELECTED}>{$x}</option>\n";
|
338 |
|
|
}
|
339 |
8f71faba
|
Espen Johansen
|
?>
|
340 |
|
|
</select><br/>
|
341 |
8600af6f
|
Scott Ullrich
|
Note: Typically only a few discreet power settings are available and the driver will use the setting closest to the specified value. Not all adaptors support changing the transmit power setting.
|
342 |
8f71faba
|
Espen Johansen
|
</td>
|
343 |
|
|
</tr>
|
344 |
bf9ca82a
|
Scott Ullrich
|
<tr>
|
345 |
57f13ba8
|
Scott Ullrich
|
<td valign="top" class="vncellreq">Channel</td>
|
346 |
8e13ca40
|
Seth Mos
|
<td class="vtable"><select name="channel" class="formselect" id="channel">
|
347 |
522e44e9
|
Scott Ullrich
|
<option <? if ($pconfig['channel'] == 0) echo "selected"; ?> value="0">Auto</option>
|
348 |
6f17ad79
|
Scott Ullrich
|
<?php
|
349 |
|
|
foreach($wl_modes as $wl_standard => $wl_channels) {
|
350 |
|
|
if($wl_standard == "11g") { $wl_standard = "11b/g"; }
|
351 |
|
|
foreach($wl_channels as $wl_channel) {
|
352 |
|
|
PRINT "<option ";
|
353 |
|
|
if ($pconfig['channel'] == "$wl_channel") {
|
354 |
|
|
PRINT "selected ";
|
355 |
|
|
}
|
356 |
|
|
PRINT "value=\"$wl_channel\">$wl_standard - $wl_channel</option>\n";
|
357 |
|
|
}
|
358 |
|
|
}
|
359 |
|
|
?>
|
360 |
eb6ce097
|
Espen Johansen
|
</select>
|
361 |
|
|
<br/>
|
362 |
|
|
Note: Not all channels may be supported by your card
|
363 |
57f13ba8
|
Scott Ullrich
|
</tr>
|
364 |
|
|
<tr>
|
365 |
|
|
<td valign="top" class="vncell">Distance setting</td>
|
366 |
8e13ca40
|
Seth Mos
|
<td class="vtable"><input name="distance" type="text" class="formfld unknown" id="distance" size="5" value="<?=htmlspecialchars($pconfig['distance']);?>">
|
367 |
57f13ba8
|
Scott Ullrich
|
<br/>
|
368 |
fdf8b0a8
|
Scott Ullrich
|
Note: This field can be used to tune ACK/CTS timers to fit the distance between AP and Client<br/>
|
369 |
b6c95929
|
Scott Ullrich
|
(measured in Meters and works only for Atheros based cards !)
|
370 |
57f13ba8
|
Scott Ullrich
|
</td>
|
371 |
|
|
</tr>
|
372 |
|
|
<tr>
|
373 |
8f71faba
|
Espen Johansen
|
<td valign="top" class="vncell">WEP</td>
|
374 |
bf9ca82a
|
Scott Ullrich
|
<td class="vtable"> <input name="wep_enable" type="checkbox" id="wep_enable" value="yes" <? if ($pconfig['wep_enable']) echo "checked"; ?>>
|
375 |
8f71faba
|
Espen Johansen
|
<strong>Enable WEP</strong>
|
376 |
|
|
<table border="0" cellspacing="0" cellpadding="0">
|
377 |
bf9ca82a
|
Scott Ullrich
|
<tr>
|
378 |
8600af6f
|
Scott Ullrich
|
<td> </td>
|
379 |
|
|
<td> </td>
|
380 |
|
|
<td> TX key </td>
|
381 |
8f71faba
|
Espen Johansen
|
</tr>
|
382 |
bf9ca82a
|
Scott Ullrich
|
<tr>
|
383 |
8600af6f
|
Scott Ullrich
|
<td>Key 1: </td>
|
384 |
8e13ca40
|
Seth Mos
|
<td> <input name="key1" type="text" class="formfld unknown" id="key1" size="30" value="<?=htmlspecialchars($pconfig['key1']);?>"></td>
|
385 |
ac3f8318
|
Espen Johansen
|
<td align="center"> <input name="txkey" type="radio" value="1" <? if ($pconfig['txkey'] == 1) echo "checked";?>></td>
|
386 |
8f71faba
|
Espen Johansen
|
</tr>
|
387 |
bf9ca82a
|
Scott Ullrich
|
<tr>
|
388 |
8600af6f
|
Scott Ullrich
|
<td>Key 2: </td>
|
389 |
8e13ca40
|
Seth Mos
|
<td> <input name="key2" type="text" class="formfld unknown" id="key2" size="30" value="<?=htmlspecialchars($pconfig['key2']);?>"></td>
|
390 |
ac3f8318
|
Espen Johansen
|
<td align="center"> <input name="txkey" type="radio" value="2" <? if ($pconfig['txkey'] == 2) echo "checked";?>></td>
|
391 |
8f71faba
|
Espen Johansen
|
</tr>
|
392 |
bf9ca82a
|
Scott Ullrich
|
<tr>
|
393 |
8600af6f
|
Scott Ullrich
|
<td>Key 3: </td>
|
394 |
8e13ca40
|
Seth Mos
|
<td> <input name="key3" type="text" class="formfld unknown" id="key3" size="30" value="<?=htmlspecialchars($pconfig['key3']);?>"></td>
|
395 |
ac3f8318
|
Espen Johansen
|
<td align="center"> <input name="txkey" type="radio" value="3" <? if ($pconfig['txkey'] == 3) echo "checked";?>></td>
|
396 |
8f71faba
|
Espen Johansen
|
</tr>
|
397 |
bf9ca82a
|
Scott Ullrich
|
<tr>
|
398 |
8600af6f
|
Scott Ullrich
|
<td>Key 4: </td>
|
399 |
8e13ca40
|
Seth Mos
|
<td> <input name="key4" type="text" class="formfld unknown" id="key4" size="30" value="<?=htmlspecialchars($pconfig['key4']);?>"></td>
|
400 |
ac3f8318
|
Espen Johansen
|
<td align="center"> <input name="txkey" type="radio" value="4" <? if ($pconfig['txkey'] == 4) echo "checked";?>></td>
|
401 |
8f71faba
|
Espen Johansen
|
</tr>
|
402 |
|
|
</table>
|
403 |
|
|
<br/>
|
404 |
|
|
40 (64) bit keys may be entered as 5 ASCII characters or 10 hex digits preceded by '0x'.<br/>
|
405 |
|
|
104 (128) bit keys may be entered as 13 ASCII characters or 26 hex digits preceded by '0x'.
|
406 |
|
|
</td>
|
407 |
8600af6f
|
Scott Ullrich
|
</tr>
|
408 |
bf9ca82a
|
Scott Ullrich
|
<tr>
|
409 |
8f71faba
|
Espen Johansen
|
<td valign="top" class="vncell"><strong>WPA</strong></td>
|
410 |
bf9ca82a
|
Scott Ullrich
|
<td class="vtable"><input name="wpa_enable" type="checkbox" class="formfld" id="wpa_enable" value="yes" <? if ($pconfig['wpa_enable']) echo "checked"; ?>>
|
411 |
8f71faba
|
Espen Johansen
|
<strong>Enable WPA</strong>
|
412 |
|
|
<br/><br/>
|
413 |
|
|
<table border="0" cellspacing="0" cellpadding="0">
|
414 |
bf9ca82a
|
Scott Ullrich
|
<tr>
|
415 |
8f71faba
|
Espen Johansen
|
<td> </td>
|
416 |
|
|
<td> WPA Pre Shared Key </td>
|
417 |
f438eed4
|
Scott Ullrich
|
</tr>
|
418 |
|
|
<tr>
|
419 |
8f71faba
|
Espen Johansen
|
<td>PSK: </td>
|
420 |
8e13ca40
|
Seth Mos
|
<td><input name="passphrase" type="text" class="formfld unknown" id="passphrase" size="66" value="<?=htmlspecialchars($pconfig['passphrase']);?>"></td>
|
421 |
f438eed4
|
Scott Ullrich
|
</tr>
|
422 |
|
|
</table>
|
423 |
|
|
<br/>Passphrase must be from 8 to 63 chars.
|
424 |
8f71faba
|
Espen Johansen
|
</td>
|
425 |
|
|
</tr>
|
426 |
|
|
<tr>
|
427 |
|
|
<td valign="top" class="vncell">WPA Mode</td>
|
428 |
8e13ca40
|
Seth Mos
|
<td class="vtable"><select name="wpa_mode" class="formselect" id="wpa_mode">
|
429 |
ac3f8318
|
Espen Johansen
|
<option <? if ($pconfig['wpa_mode'] == '1') echo "selected";?> value="1">WPA</option>
|
430 |
|
|
<option <? if ($pconfig['wpa_mode'] == '2') echo "selected";?> value="2">WPA2</option>
|
431 |
|
|
<option <? if ($pconfig['wpa_mode'] == '3') echo "selected";?> value="3">Both</option>
|
432 |
8f71faba
|
Espen Johansen
|
</select>
|
433 |
|
|
</td>
|
434 |
|
|
</tr>
|
435 |
|
|
<tr>
|
436 |
|
|
<td valign="top" class="vncell">WPA Key Management Mode</td>
|
437 |
8e13ca40
|
Seth Mos
|
<td class="vtable"><select name="wpa_key_mgmt" class="formselect" id="wpa_key_mgmt">
|
438 |
ac3f8318
|
Espen Johansen
|
<option <? if ($pconfig['wpa_key_mgmt'] == 'WPA-PSK') echo "selected";?> value="WPA-PSK">Pre Shared Key</option>
|
439 |
|
|
<option <? if ($pconfig['wpa_key_mgmt'] == 'WPA-EAP') echo "selected";?> value="WPA-EAP">Extensible Authentication Protocol</option>
|
440 |
|
|
<option <? if ($pconfig['wpa_key_mgmt'] == 'WPA-PSK WPA-EAP') echo "selected";?> value="WPA-PSK WPA-EAP">Both</option>
|
441 |
8f71faba
|
Espen Johansen
|
</select>
|
442 |
|
|
</td>
|
443 |
|
|
</tr>
|
444 |
ef773bd6
|
Scott Ullrich
|
<? /*
|
445 |
d8c67d69
|
Scott Ullrich
|
<tr>
|
446 |
|
|
<td valign="top" class="vncell">Enable MAC Filtering</td>
|
447 |
bf9ca82a
|
Scott Ullrich
|
<td class="vtable"><input name="mac_acl_enable" type="checkbox" value="yes" class="formfld" id="mac_acl_enable" <? if ($pconfig['mac_acl_enable']) echo "checked"; ?>>
|
448 |
d8c67d69
|
Scott Ullrich
|
Setting this option will enable the use of a mac filterlist to allow/deny association based on mac address
|
449 |
|
|
<br/><br/>
|
450 |
8e13ca40
|
Seth Mos
|
<select name="macaddr_acl" class="formselect" id="macaddr_acl">
|
451 |
d8c67d69
|
Scott Ullrich
|
<option <? if ($pconfig['macaddr_acl'] == '0') echo "selected";?> value="0">Allow</option>
|
452 |
|
|
<option <? if ($pconfig['macaddr_acl'] == '1') echo "selected";?> value="1">Deny</option>
|
453 |
|
|
<option <? if ($pconfig['macaddr_acl'] == '2') echo "selected";?> value="2">Radius</option>
|
454 |
|
|
</select>
|
455 |
|
|
<br/><br/>
|
456 |
|
|
Setting this to "Allow" will allow all clients in not in deny list, while "Deny" will deny all clients not in allow list.
|
457 |
|
|
Radius will cause allow and deny list to be searched and then query radius.</br>
|
458 |
|
|
</td>
|
459 |
|
|
</tr>
|
460 |
ef773bd6
|
Scott Ullrich
|
*/ ?>
|
461 |
8f71faba
|
Espen Johansen
|
<tr>
|
462 |
|
|
<td valign="top" class="vncell">Authentication</td>
|
463 |
8e13ca40
|
Seth Mos
|
<td class="vtable"><select name="auth_algs" class="formselect" id="auth_algs">
|
464 |
ac3f8318
|
Espen Johansen
|
<option <? if ($pconfig['auth_algs'] == '1') echo "selected";?> value="1">Open System Authentication</option>
|
465 |
|
|
<option <? if ($pconfig['auth_algs'] == '2') echo "selected";?> value="2">Shared Key Authentication</option>
|
466 |
ddc01b4d
|
Scott Ullrich
|
<option <? if ($pconfig['auth_algs'] == '3') echo "selected";?> value="3">Both</option>
|
467 |
8f71faba
|
Espen Johansen
|
</select>
|
468 |
|
|
<br/>Note: Shared Key Authentication requires WEP.</br>
|
469 |
|
|
</td>
|
470 |
|
|
</tr>
|
471 |
|
|
<tr>
|
472 |
|
|
<td valign="top" class="vncell">WPA Pairwise</td>
|
473 |
8e13ca40
|
Seth Mos
|
<td class="vtable"><select name="wpa_pairwise" class="formselect" id="wpa_pairwise">
|
474 |
ac3f8318
|
Espen Johansen
|
<option <? if ($pconfig['wpa_pairwise'] == 'CCMP TKIP') echo "selected";?> value="CCMP TKIP">Both</option>
|
475 |
|
|
<option <? if ($pconfig['wpa_pairwise'] == 'CCMP') echo "selected";?> value="CCMP">AES</option>
|
476 |
|
|
<option <? if ($pconfig['wpa_pairwise'] == 'TKIP') echo "selected";?> value="TKIP">TKIP</option>
|
477 |
8f71faba
|
Espen Johansen
|
</select>
|
478 |
|
|
</td>
|
479 |
|
|
</tr>
|
480 |
|
|
<tr>
|
481 |
|
|
<td valign="top" class="vncell">Key Rotation</td>
|
482 |
8e13ca40
|
Seth Mos
|
<td class="vtable"><input name="wpa_group_rekey" type="text" class="formfld unknown" id="wpa_group_rekey" size="30" value="<? echo $pconfig['wpa_group_rekey'] ? $pconfig['wpa_group_rekey'] : "60";?>">
|
483 |
8f71faba
|
Espen Johansen
|
<br/>Allowed values are 1-9999 but should not be longer than Master Key Regeneration time.
|
484 |
|
|
</td>
|
485 |
|
|
</tr>
|
486 |
|
|
<tr>
|
487 |
|
|
<td valign="top" class="vncell">Master Key Regeneration</td>
|
488 |
ac3f8318
|
Espen Johansen
|
<td class="vtable"><input name="wpa_gmk_rekey" type="text" class="formfld" id="wpa_gmk_rekey" size="30" value="<? echo $pconfig['wpa_gmk_rekey'] ? $pconfig['wpa_gmk_rekey'] : "3600";?>">
|
489 |
8f71faba
|
Espen Johansen
|
<br/>Allowed values are 1-9999 but should not be shorter than Key Rotation time.
|
490 |
|
|
</td>
|
491 |
|
|
</tr>
|
492 |
|
|
<tr>
|
493 |
|
|
<td valign="top" class="vncell">Strict Key Regeneration</td>
|
494 |
20172515
|
Scott Ullrich
|
<td class="vtable"><input name="wpa_strict_rekey" type="checkbox" value="yes" class="formfld" id="wpa_strict_rekey" <? if ($pconfig['wpa_strict_rekey']) echo "checked"; ?>>
|
495 |
d213185e
|
Espen Johansen
|
<br/>Setting this option will force the AP to rekey whenever a client disassociates.
|
496 |
8f71faba
|
Espen Johansen
|
</td>
|
497 |
|
|
</tr>
|
498 |
|
|
<tr>
|
499 |
|
|
<td valign="top" class="vncell">Enable IEEE802.1X</td>
|
500 |
20172515
|
Scott Ullrich
|
<td class="vtable"><input name="ieee8021x" type="checkbox" value="yes" class="formfld" id="ieee8021x" <? if ($pconfig['ieee8021x']) echo "checked";?>>
|
501 |
d213185e
|
Espen Johansen
|
<br/>Setting this option will enable 802.1x authentication.
|
502 |
8f71faba
|
Espen Johansen
|
</td>
|
503 |
|
|
</tr>
|
504 |
ac3f8318
|
Espen Johansen
|
<? } ?>
|