Project

General

Profile

Download (20.7 KB) Statistics
| Branch: | Tag: | Revision:
1
<?
2
/* $Id$ */
3
/*
4
	interfaces_wlan.inc
5
	part of m0n0wall (http://m0n0.ch/wall)
6

    
7
	Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
8
	All rights reserved.
9

    
10
	Redistribution and use in source and binary forms, with or without
11
	modification, are permitted provided that the following conditions are met:
12

    
13
	1. Redistributions of source code must retain the above copyright notice,
14
	   this list of conditions and the following disclaimer.
15

    
16
	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

    
20
	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

    
35
	$pconfig['standard'] = $optcfg['wireless']['standard'];
36
	$pconfig['mode'] = $optcfg['wireless']['mode'];
37
	$pconfig['protmode'] = $optcfg['wireless']['protmode'];
38
	$pconfig['ssid'] = $optcfg['wireless']['ssid'];
39
	$pconfig['channel'] = $optcfg['wireless']['channel'];
40
	$pconfig['txpower'] = $optcfg['wireless']['txpower'];
41
	$pconfig['distance'] = $optcfg['wireless']['distance'];
42
	$pconfig['wme_enable'] = isset($optcfg['wireless']['wme']['enable']);
43
	$pconfig['pureg_enable'] = isset($optcfg['wireless']['pureg']['enable']);
44
	$pconfig['apbridge_enable'] = isset($optcfg['wireless']['apbridge']['enable']);
45
	$pconfig['authmode'] = $optcfg['wireless']['authmode'];
46
	$pconfig['hidessid_enable'] = isset($optcfg['wireless']['hidessid']['enable']);
47
	$pconfig['debug_mode'] = $optcfg['wireless']['wpa']['debug_mode'];
48
	$pconfig['macaddr_acl'] = $optcfg['wireless']['wpa']['macaddr_acl'];
49
	$pconfig['mac_acl_enable'] = isset($optcfg['wireless']['wpa']['mac_acl_enable']);
50
	$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
	$pconfig['wpa_strict_rekey'] = isset($optcfg['wireless']['wpa']['wpa_strict_rekey']);
57
	$pconfig['passphrase'] = $optcfg['wireless']['wpa']['passphrase'];
58
	$pconfig['ieee8021x_enable'] = isset($optcfg['wireless']['wpa']['ieee8021x']['enable']);
59
	$pconfig['ext_wpa_sw'] = $optcfg['wireless']['wpa']['ext_wpa_sw'];
60
	$pconfig['wpa_enable'] = isset($optcfg['wireless']['wpa']['enable']);
61
	$pconfig['wep_enable'] = isset($optcfg['wireless']['wep']['enable']);
62
	$pconfig['mac_acl'] = $optcfg['wireless']['mac_acl'];
63

    
64
	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
	global $optcfg, $pconfig;
79

    
80
	$input_errors = "";
81
	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

    
89
	}
90

    
91
	/* loop through keys and enforce size */
92
	for ($i = 1; $i <= 4; $i++) {
93
		if ($_POST['key' . $i]) {
94
			/* 64 bit */
95
			if(strlen($_POST['key' . $i]) == 5)
96
				continue;
97
			if(strlen($_POST['key' . $i]) == 10) {
98
				/* hex key */
99
				if(stristr($_POST['key' . $i], "0x") == false) {
100
					$_POST['key' . $i] = "0x" . $_POST['key' . $i];
101
				}
102
				continue;
103
			}
104
			if(strlen($_POST['key' . $i]) == 12) {
105
				/* hex key */
106
				if(stristr($_POST['key' . $i], "0x") == false) {
107
					$_POST['key' . $i] = "0x" . $_POST['key' . $i];
108
				}
109
				continue;
110
			}
111
			/* 128 bit */
112
			if(strlen($_POST['key' . $i]) == 13)
113
				continue;
114
			if(strlen($_POST['key' . $i]) == 26) {
115
				/* hex key */
116
				if(stristr($_POST['key' . $i], "0x") == false) {
117
					$_POST['key' . $i] = "0x" . $_POST['key' . $i];
118
				}
119
				continue;
120
			}
121
			if(strlen($_POST['key' . $i]) == 28)
122
				continue;
123
			$input_errors[] =  "Invalid wep key size.   Sizes should be 40 (64) bit keys or 104 (128) bit.";
124
			break;
125
		}
126
	}
127

    
128
	if (!$input_errors) {
129

    
130
		$optcfg['wireless']['standard'] = $_POST['standard'];
131
		$optcfg['wireless']['mode'] = $_POST['mode'];
132
		$optcfg['wireless']['protmode'] = $_POST['protmode'];
133
		$optcfg['wireless']['ssid'] = $_POST['ssid'];
134
		$optcfg['wireless']['channel'] = $_POST['channel'];
135
		$optcfg['wireless']['authmode'] = $_POST['authmode'];
136
		$optcfg['wireless']['txpower'] = $_POST['txpower'];
137
		$optcfg['wireless']['distance'] = $_POST['distance'];
138
		$optcfg['wireless']['wpa']['macaddr_acl'] = $_POST['macaddr_acl'];
139
		$optcfg['wireless']['wpa']['auth_algs'] = $_POST['auth_algs'];
140
		$optcfg['wireless']['wpa']['wpa_mode'] = $_POST['wpa_mode'];
141
		$optcfg['wireless']['wpa']['wpa_key_mgmt'] = $_POST['wpa_key_mgmt'];
142
		$optcfg['wireless']['wpa']['wpa_pairwise'] = $_POST['wpa_pairwise'];
143
		$optcfg['wireless']['wpa']['wpa_group_rekey'] = $_POST['wpa_group_rekey'];
144
		$optcfg['wireless']['wpa']['wpa_gmk_rekey'] = $_POST['wpa_gmk_rekey'];
145
		$optcfg['wireless']['wpa']['passphrase'] = $_POST['passphrase'];
146
		$optcfg['wireless']['wpa']['ext_wpa_sw'] = $_POST['ext_wpa_sw'];
147

    
148
		if($_POST['hidessid_enable'] == "yes")
149
			$optcfg['wireless']['hidessid']['enable'] = true;
150
		else
151
			unset($optcfg['wireless']['hidessid']['enable']);
152

    
153
		if($_POST['mac_acl_enable'] == "yes")
154
			$optcfg['wireless']['wpa']['mac_acl_enable'] = true;
155
		else
156
			unset($optcfg['wireless']['wpa']['mac_acl_enable']);
157

    
158
		if($_POST['ieee8021x_enable'] == "yes")
159
			$optcfg['wireless']['wpa']['ieee8021x']['enable'] = true;
160
		else
161
			unset($optcfg['wireless']['wpa']['ieee8021x']['enable']);
162

    
163
		if($_POST['wpa_strict_rekey'] == "yes")
164
			$optcfg['wireless']['wpa']['wpa_strict_rekey'] = true;
165
		else
166
			unset($optcfg['wireless']['wpa']['wpa_strict_rekey']);
167

    
168
		if($_POST['debug_mode'] == "yes")
169
			$optcfg['wireless']['wpa']['debug_mode'] = true;
170
		else
171
			unset($optcfg['wireless']['wpa']['debug_mode']);
172

    
173
		if($_POST['wpa_enable'] == "yes")
174
			$optcfg['wireless']['wpa']['enable'] = $_POST['wpa_enable'] = true;
175
		else
176
			unset($optcfg['wireless']['wpa']['enable']);
177

    
178
		if($_POST['wep_enable'] == "yes")
179
			$optcfg['wireless']['wep']['enable'] = $_POST['wep_enable'] = true;
180
		else
181
			unset($optcfg['wireless']['wep']['enable']);
182

    
183
		if($_POST['wme_enable'] == "yes")
184
			$optcfg['wireless']['wme']['enable'] = $_POST['wme_enable'] = true;
185
		else
186
			unset($optcfg['wireless']['wme']['enable']);
187

    
188
		if($_POST['pureg_enable'] == "yes")
189
			$optcfg['wireless']['pureg']['enable'] = $_POST['pureg_enable'] = true;
190
		else
191
			unset($optcfg['wireless']['pureg']['enable']);
192

    
193
		if($_POST['apbridge_enable'] == "yes")
194
			$optcfg['wireless']['apbridge']['enable'] = $_POST['apbridge_enable'] = true;
195
		else
196
			unset($optcfg['wireless']['apbridge']['enable']);
197

    
198
		if($_POST['standard'] == "11a Turbo")
199
			$optcfg['wireless']['turbo']['enable'] = true;
200
		else
201
			unset($optcfg['wireless']['turbo']['enable']);
202

    
203
		$optcfg['wireless']['wep']['key'] = array();
204

    
205
		for ($i = 1; $i <= 4; $i++) {
206
			if ($_POST['key' . $i]) {
207
				$newkey = array();
208
				$newkey['value'] = $_POST['key' . $i];
209
				if ($_POST['txkey'] == $i)
210
					$newkey['txkey'] = true;
211
				$optcfg['wireless']['wep']['key'][] = $newkey;
212
			}
213
		}
214
	}
215

    
216
	return $input_errors;
217
}
218

    
219
$curif = convert_friendly_interface_to_real_interface_name($if);
220
$wl_modes = get_wireless_modes($curif);
221

    
222
function wireless_config_print() {
223
	global $optcfg, $pconfig, $wl_modes, $g;
224
?>
225

    
226
<script language="JavaScript">
227
	function openwindow(url) {
228
		var oWin = window.open(url,"pfSensePop","width=620,height=400,top=150,left=150");
229
		if (oWin==null || typeof(oWin)=="undefined") {
230
			return false;
231
		} else {
232
			return true;
233
		}
234
	}
235
</script>
236
                <tr>
237
                  <td colspan="2" valign="top" height="16"></td>
238
		</tr>
239

    
240
                <tr>
241
                  <td colspan="2" valign="top" class="listtopic">Wireless configuration</td>
242
		</tr>
243
		<tr>
244
			<td valign="top" class="vncellreq">Standard</td>
245
			<td class="vtable">
246
			<select name="standard" class="formselect" id="standard">
247
				<?php
248
				foreach($wl_modes as $wl_standard => $wl_channels) {
249
					PRINT "<option ";
250
					if ($pconfig['standard'] == "$wl_standard") {
251
						PRINT "selected ";
252
					}
253
					PRINT "value=\"$wl_standard\">802.$wl_standard</option>\n";
254
				}
255
				?>
256
				</select>
257
			</td>
258
		</tr>
259
		<tr>
260
			<td valign="top" class="vncellreq">Mode</td>
261
			<td class="vtable">
262
			<select name="mode" class="formselect" id="mode">
263
				<option <? if ($pconfig['mode'] == 'bss') echo "selected";?> value="bss">Infrastructure (BSS)</option>
264
				<option <? if ($pconfig['mode'] == 'adhoc') echo "selected";?> value="adhoc">Ad-hoc (IBSS)</option>
265
				<option <? if ($pconfig['mode'] == 'hostap') echo "selected";?> value="hostap">Access Point</option>
266
			</select>
267
			</td>
268
		</tr>
269
		<tr>
270
			<td valign="top" class="vncellreq">802.11g OFDM Protection Mode</td>
271
			<td class="vtable">
272
			<select name="protmode" class="formselect" id="protmode">
273
				<option <? if ($pconfig['protmode'] == 'off') echo "selected";?> value="off">Protection mode off</option>
274
				<option <? if ($pconfig['protmode'] == 'cts') echo "selected";?> value="cts">Protection mode CTS to self</option>
275
				<option <? if ($pconfig['protmode'] == 'rtscts') echo "selected";?> value="rtscts">Protection mode RTS and CTS</option>
276
			</select>
277
			<br/>
278
			For IEEE 802.11g, use the specified technique for protecting OFDM frames in a mixed 11b/11g network.
279
			<br/>
280
			</td>
281
		</tr>
282
		<tr>
283
			<td valign="top" class="vncellreq">SSID</td>
284
			<td class="vtable"><input name="ssid" type="text" class="formfld unknown" id="ssid" size="20" value="<?=htmlspecialchars($pconfig['ssid']);?>">
285
			</td>
286
                </tr>
287
		<tr>
288
			<td valign="top" class="vncell">802.11g only</td>
289
			<td class="vtable"><input name="pureg_enable" type="checkbox" value="yes"  class="formfld" id="pureg_enable" <? if ($pconfig['pureg_enable']) echo "checked";?>>
290
			<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).
291
			</td>
292
		</tr>
293
		<tr>
294
			<td valign="top" class="vncell">Allow intra-BSS communication</td>
295
			<td class="vtable"><input name="apbridge_enable" type="checkbox" value="yes"  class="formfld" id="apbridge_enable" <? if ($pconfig['apbridge_enable']) echo "checked";?>>
296
			<br/>
297
			When operating as an access point, enable this if you want to pass packets between wireless clients directly.
298
			<br/>
299
			Disabling the internal bridging is useful when traffic is to be processed with packet filtering.
300
			</td>
301
		</tr>
302
		<tr>
303
			<td valign="top" class="vncell">Enable WME</td>
304
			<td class="vtable"><input name="wme_enable" type="checkbox" class="formfld" id="wme_enable" value="yes" <? if ($pconfig['wme_enable']) echo "checked";?>>
305
			<br/>Setting this option will force the card to use WME (wireless QoS).
306
			</td>
307
		</tr>
308
		<tr>
309
			<td valign="top" class="vncell">Enable Hide SSID</td>
310
			<td class="vtable"><input name="hidessid_enable" type="checkbox" class="formfld" id="hidessid_enable" value="yes" <? if ($pconfig['hidessid_enable']) echo "checked";?>>
311
			<br/>
312
			Setting this option will force the card to NOT broadcast its SSID
313
			<br/>
314
			(this might create problems for some clients). </td>
315
		</tr>
316
                <tr>
317
			<td valign="top" class="vncellreq">Transmit power</td>
318
			<td class="vtable">
319
			<select name="txpower" class="formselect" id="txpower">
320
			<?
321
				for($x = 99; $x > 0; $x--) {
322
					if($pconfig["txpower"] == $x)
323
						$SELECTED = " SELECTED";
324
					else
325
						$SELECTED = "";
326
					echo "<option {$SELECTED}>{$x}</option>\n";
327
				}
328
			?>
329
			</select><br/>
330
			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.
331
			</td>
332
		</tr>
333
                <tr>
334
			<td valign="top" class="vncellreq">Channel</td>
335
			<td class="vtable"><select name="channel" class="formselect" id="channel">
336
				<option <? if ($pconfig['channel'] == 0) echo "selected"; ?> value="0">Auto</option>
337
				<?php
338
				foreach($wl_modes as $wl_standard => $wl_channels) {
339
					if($wl_standard == "11g") { $wl_standard = "11b/g"; }
340
					foreach($wl_channels as $wl_channel) {
341
						PRINT "<option ";
342
						if ($pconfig['channel'] == "$wl_channel") {
343
							PRINT "selected ";
344
						}
345
						PRINT "value=\"$wl_channel\">$wl_standard - $wl_channel</option>\n";
346
					}
347
				}
348
				?>
349
			</select>
350
			<br/>
351
			Note: Not all channels may be supported by your card
352
		</tr>
353
		<tr>
354
			<td valign="top" class="vncell">Distance setting</td>
355
			<td class="vtable"><input name="distance" type="text" class="formfld unknown" id="distance" size="5" value="<?=htmlspecialchars($pconfig['distance']);?>">
356
			<br/>
357
			Note: This field can be used to tune ACK/CTS timers to fit the distance between AP and Client<br/>
358
			(measured in Meters and works only for Atheros based cards !)
359
			</td>
360
		</tr>
361
		<tr>
362
			<td valign="top" class="vncell">WEP</td>
363
			<td class="vtable"> <input name="wep_enable" type="checkbox" id="wep_enable" value="yes" <? if ($pconfig['wep_enable']) echo "checked"; ?>>
364
			<strong>Enable WEP</strong>
365
			<table border="0" cellspacing="0" cellpadding="0">
366
		<tr>
367
                        <td>&nbsp;</td>
368
                        <td>&nbsp;</td>
369
                        <td>&nbsp;TX key&nbsp;</td>
370
		</tr>
371
		<tr>
372
                        <td>Key 1:&nbsp;&nbsp;</td>
373
                        <td> <input name="key1" type="text" class="formfld unknown" id="key1" size="30" value="<?=htmlspecialchars($pconfig['key1']);?>"></td>
374
                        <td align="center"> <input name="txkey" type="radio" value="1" <? if ($pconfig['txkey'] == 1) echo "checked";?>></td>
375
		</tr>
376
		<tr>
377
                        <td>Key 2:&nbsp;&nbsp;</td>
378
                        <td> <input name="key2" type="text" class="formfld unknown" id="key2" size="30" value="<?=htmlspecialchars($pconfig['key2']);?>"></td>
379
                        <td align="center"> <input name="txkey" type="radio" value="2" <? if ($pconfig['txkey'] == 2) echo "checked";?>></td>
380
		</tr>
381
		<tr>
382
                        <td>Key 3:&nbsp;&nbsp;</td>
383
                        <td> <input name="key3" type="text" class="formfld unknown" id="key3" size="30" value="<?=htmlspecialchars($pconfig['key3']);?>"></td>
384
                        <td align="center"> <input name="txkey" type="radio" value="3" <? if ($pconfig['txkey'] == 3) echo "checked";?>></td>
385
		</tr>
386
		<tr>
387
                        <td>Key 4:&nbsp;&nbsp;</td>
388
                        <td> <input name="key4" type="text" class="formfld unknown" id="key4" size="30" value="<?=htmlspecialchars($pconfig['key4']);?>"></td>
389
                        <td align="center"> <input name="txkey" type="radio" value="4" <? if ($pconfig['txkey'] == 4) echo "checked";?>></td>
390
		</tr>
391
			</table>
392
			<br/>
393
			40 (64) bit keys may be entered as 5 ASCII characters or 10 hex digits preceded by '0x'.<br/>
394
			104 (128) bit keys may be entered as 13 ASCII characters or 26 hex digits preceded by '0x'.
395
		   	</td>
396
                </tr>
397
                <tr>
398
			<td valign="top" class="vncell"><strong>WPA</strong></td>
399
			<td class="vtable"><input name="wpa_enable" type="checkbox" class="formfld" id="wpa_enable" value="yes" <? if ($pconfig['wpa_enable']) echo "checked"; ?>>
400
			<strong>Enable WPA</strong>
401
			<br/><br/>
402
			<table border="0" cellspacing="0" cellpadding="0">
403
			<tr>
404
                        <td>&nbsp;</td>
405
                        <td>&nbsp;WPA Pre Shared Key&nbsp;</td>
406
			</tr>
407
			<tr>
408
			<td>PSK:&nbsp;&nbsp;</td>
409
			<td><input name="passphrase" type="text" class="formfld unknown" id="passphrase" size="66" value="<?=htmlspecialchars($pconfig['passphrase']);?>"></td>
410
			</tr>
411
			</table>
412
			<br/>Passphrase must be from 8 to 63 chars.
413
			</td>
414
	        </tr>
415
		<tr>
416
			<td valign="top" class="vncell">WPA Mode</td>
417
			<td class="vtable"><select name="wpa_mode" class="formselect" id="wpa_mode">
418
			<option <? if ($pconfig['wpa_mode'] == '1') echo "selected";?> value="1">WPA</option>
419
			<option <? if ($pconfig['wpa_mode'] == '2') echo "selected";?> value="2">WPA2</option>
420
			<option <? if ($pconfig['wpa_mode'] == '3') echo "selected";?> value="3">Both</option>
421
			</select>
422
			</td>
423
		</tr>
424
		<tr>
425
			<td valign="top" class="vncell">WPA Key Management Mode</td>
426
			<td class="vtable"><select name="wpa_key_mgmt" class="formselect" id="wpa_key_mgmt">
427
			<option <? if ($pconfig['wpa_key_mgmt'] == 'WPA-PSK') echo "selected";?> value="WPA-PSK">Pre Shared Key</option>
428
			<option <? if ($pconfig['wpa_key_mgmt'] == 'WPA-EAP') echo "selected";?> value="WPA-EAP">Extensible Authentication Protocol</option>
429
			<option <? if ($pconfig['wpa_key_mgmt'] == 'WPA-PSK WPA-EAP') echo "selected";?> value="WPA-PSK WPA-EAP">Both</option>
430
 			</select>
431
			</td>
432
		</tr>
433
		<? /*
434
		<tr>
435
			<td valign="top" class="vncell">Enable MAC Filtering</td>
436
			<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"; ?>>
437
			Setting this option will enable the use of a mac filterlist to allow/deny association based on mac address
438
			<br/><br/>
439
			<select name="macaddr_acl" class="formselect" id="macaddr_acl">
440
                        <option <? if ($pconfig['macaddr_acl'] == '0') echo "selected";?> value="0">Allow</option>
441
			<option <? if ($pconfig['macaddr_acl'] == '1') echo "selected";?> value="1">Deny</option>
442
			<option <? if ($pconfig['macaddr_acl'] == '2') echo "selected";?> value="2">Radius</option>
443
			</select>
444
			<br/><br/>
445
			Setting this to "Allow" will allow all clients in not in deny list, while "Deny" will deny all clients not in allow list.
446
			Radius will cause allow and deny list to be searched and then query radius.</br>
447
			</td>
448
		</tr>
449
		*/ ?>
450
		<tr>
451
			<td valign="top" class="vncell">Authentication</td>
452
			<td class="vtable"><select name="auth_algs" class="formselect" id="auth_algs">
453
			<option <? if ($pconfig['auth_algs'] == '1') echo "selected";?> value="1">Open System Authentication</option>
454
			<option <? if ($pconfig['auth_algs'] == '2') echo "selected";?> value="2">Shared Key Authentication</option>
455
			<option <? if ($pconfig['auth_algs'] == '3') echo "selected";?> value="3">Both</option>
456
			</select>
457
			<br/>Note: Shared Key Authentication requires WEP.</br>
458
			</td>
459
		</tr>
460
		<tr>
461
			<td valign="top" class="vncell">WPA Pairwise</td>
462
			<td class="vtable"><select name="wpa_pairwise" class="formselect" id="wpa_pairwise">
463
			<option <? if ($pconfig['wpa_pairwise'] == 'CCMP TKIP') echo "selected";?> value="CCMP TKIP">Both</option>
464
			<option <? if ($pconfig['wpa_pairwise'] == 'CCMP') echo "selected";?> value="CCMP">AES</option>
465
			<option <? if ($pconfig['wpa_pairwise'] == 'TKIP') echo "selected";?> value="TKIP">TKIP</option>
466
			</select>
467
			</td>
468
		</tr>
469
		<tr>
470
			<td valign="top" class="vncell">Key Rotation</td>
471
			<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";?>">
472
			<br/>Allowed values are 1-9999 but should not be longer than Master Key Regeneration time.
473
			</td>
474
		</tr>
475
		<tr>
476
			<td valign="top" class="vncell">Master Key Regeneration</td>
477
			<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";?>">
478
			<br/>Allowed values are 1-9999 but should not be shorter than Key Rotation time.
479
			</td>
480
		</tr>
481
		<tr>
482
			<td valign="top" class="vncell">Strict Key Regeneration</td>
483
			<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"; ?>>
484
			<br/>Setting this option will force the AP to rekey whenever a client disassociates.
485
			</td>
486
		</tr>
487
		<tr>
488
			<td valign="top" class="vncell">Enable IEEE802.1X</td>
489
			<td class="vtable"><input name="ieee8021x" type="checkbox" value="yes"  class="formfld" id="ieee8021x" <? if ($pconfig['ieee8021x']) echo "checked";?>>
490
			<br/>Setting this option will enable 802.1x authentication.
491
			</td>
492
		</tr>
493
<? } ?>
(91-91/210)