Project

General

Profile

Download (21.6 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
$wlchannels = array(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,34,36,38,40,42,44,46,48,50,52,56,58,60,64,100,104,108,112,116,120,124,128,132,136,140,149,152,153,157,160,161,165);
33

    
34
function wireless_config_init() {
35
	global $optcfg, $pconfig;
36

    
37
	$pconfig['standard'] = $optcfg['wireless']['standard'];
38
	$pconfig['mode'] = $optcfg['wireless']['mode'];
39
	$pconfig['protmode'] = $optcfg['wireless']['protmode'];
40
	$pconfig['ssid'] = $optcfg['wireless']['ssid'];
41
	$pconfig['stationname'] = $optcfg['wireless']['stationname'];
42
	$pconfig['channel'] = $optcfg['wireless']['channel'];
43
	$pconfig['txpower'] = $optcfg['wireless']['txpower'];
44
	$pconfig['distance'] = $optcfg['wireless']['distance'];
45
	$pconfig['wme_enable'] = isset($optcfg['wireless']['wme']['enable']);
46
	$pconfig['pureg_enable'] = isset($optcfg['wireless']['pureg']['enable']);
47
	$pconfig['apbridge_enable'] = isset($optcfg['wireless']['apbridge']['enable']);
48
	$pconfig['turbo_enable'] = isset($optcfg['wireless']['turbo']['enable']);
49
	$pconfig['authmode'] = $optcfg['wireless']['authmode'];
50
	$pconfig['hidessid_enable'] = isset($optcfg['wireless']['hidessid']['enable']);
51
	$pconfig['debug_mode'] = $optcfg['wireless']['wpa']['debug_mode'];
52
	$pconfig['macaddr_acl'] = $optcfg['wireless']['wpa']['macaddr_acl'];
53
	$pconfig['mac_acl_enable'] = isset($optcfg['wireless']['wpa']['mac_acl_enable']);
54
	$pconfig['auth_algs'] = $optcfg['wireless']['wpa']['auth_algs'];
55
	$pconfig['wpa_mode'] = $optcfg['wireless']['wpa']['wpa_mode'];
56
	$pconfig['wpa_key_mgmt'] = $optcfg['wireless']['wpa']['wpa_key_mgmt'];
57
	$pconfig['wpa_pairwise'] = $optcfg['wireless']['wpa']['wpa_pairwise'];
58
	$pconfig['wpa_group_rekey'] = $optcfg['wireless']['wpa']['wpa_group_rekey'];
59
	$pconfig['wpa_gmk_rekey'] = $optcfg['wireless']['wpa']['wpa_gmk_rekey'];
60
	$pconfig['wpa_strict_rekey'] = isset($optcfg['wireless']['wpa']['wpa_strict_rekey']);
61
	$pconfig['passphrase'] = $optcfg['wireless']['wpa']['passphrase'];
62
	$pconfig['ieee8021x_enable'] = isset($optcfg['wireless']['wpa']['ieee8021x']['enable']);
63
	$pconfig['ext_wpa_sw'] = $optcfg['wireless']['wpa']['ext_wpa_sw'];
64
	$pconfig['wpa_enable'] = isset($optcfg['wireless']['wpa']['enable']);
65
	$pconfig['wep_enable'] = isset($optcfg['wireless']['wep']['enable']);
66
	$pconfig['mac_acl'] = $optcfg['wireless']['mac_acl'];
67

    
68
	if (is_array($optcfg['wireless']['wep']['key'])) {
69
		$i = 1;
70
		foreach ($optcfg['wireless']['wep']['key'] as $wepkey) {
71
			$pconfig['key' . $i] = $wepkey['value'];
72
			if (isset($wepkey['txkey']))
73
				$pconfig['txkey'] = $i;
74
			$i++;
75
		}
76
		if (!isset($wepkey['txkey']))
77
			$pconfig['txkey'] = 1;
78
	}
79
}
80

    
81
function wireless_config_post() {
82
	global $optcfg, $pconfig, $input_errors;
83

    
84
	unset($input_errors);
85

    
86
	/* input validation */
87
	if ($_POST['enable']) {
88
		$reqdfields = explode(" ", "mode ssid");
89
		$reqdfieldsn = explode(",", "Mode,SSID");
90
		do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
91
		
92
		if (!$input_errors) {
93
			/* bridge check (hostap only!) */
94
			if ($pconfig['bridge'] && ($pconfig['mode'] != "hostap"))
95
				$input_errors[] = "Bridging a wireless interface is only possible in hostap mode.";
96
		}
97
	}
98

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

    
136
	if (!$input_errors) {
137

    
138
		$optcfg['wireless']['standard'] = $_POST['standard'];
139
		$optcfg['wireless']['mode'] = $_POST['mode'];
140
		$optcfg['wireless']['protmode'] = $_POST['protmode'];
141
		$optcfg['wireless']['ssid'] = $_POST['ssid'];
142
		$optcfg['wireless']['stationname'] = $_POST['stationname'];
143
		$optcfg['wireless']['channel'] = $_POST['channel'];
144
		$optcfg['wireless']['authmode'] = $_POST['authmode'];		
145
		$optcfg['wireless']['txpower'] = $_POST['txpower'];
146
		$optcfg['wireless']['distance'] = $_POST['distance'];
147
		$optcfg['wireless']['wpa']['macaddr_acl'] = $_POST['macaddr_acl'];
148
		$optcfg['wireless']['wpa']['auth_algs'] = $_POST['auth_algs'];
149
		$optcfg['wireless']['wpa']['wpa_mode'] = $_POST['wpa_mode'];
150
		$optcfg['wireless']['wpa']['wpa_key_mgmt'] = $_POST['wpa_key_mgmt'];
151
		$optcfg['wireless']['wpa']['wpa_pairwise'] = $_POST['wpa_pairwise'];
152
		$optcfg['wireless']['wpa']['wpa_group_rekey'] = $_POST['wpa_group_rekey'];
153
		$optcfg['wireless']['wpa']['wpa_gmk_rekey'] = $_POST['wpa_gmk_rekey'];
154
		$optcfg['wireless']['wpa']['passphrase'] = $_POST['passphrase'];
155
		$optcfg['wireless']['wpa']['ext_wpa_sw'] = $_POST['ext_wpa_sw'];
156

    
157
		if($_POST['hidessid_enable'] == "yes") 
158
			$optcfg['wireless']['hidessid']['enable'] = true;
159
		else
160
			unset($optcfg['wireless']['hidessid']['enable']);
161

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

    
167
		if($_POST['ieee8021x_enable'] == "yes")
168
			$optcfg['wireless']['wpa']['ieee8021x']['enable'] = true;
169
		else
170
			unset($optcfg['wireless']['wpa']['ieee8021x']['enable']);
171
		
172
		if($_POST['wpa_strict_rekey'] == "yes")
173
			$optcfg['wireless']['wpa']['wpa_strict_rekey'] = true;
174
		else
175
			unset($optcfg['wireless']['wpa']['wpa_strict_rekey']);
176

    
177
		if($_POST['debug_mode'] == "yes") 
178
			$optcfg['wireless']['wpa']['debug_mode'] = true;
179
		else
180
			unset($optcfg['wireless']['wpa']['debug_mode']);
181

    
182
		if($_POST['wpa_enable'] == "yes") 
183
			$optcfg['wireless']['wpa']['enable'] = $_POST['wpa_enable'] = true;
184
		else
185
			unset($optcfg['wireless']['wpa']['enable']);
186

    
187
		if($_POST['wep_enable'] == "yes") 
188
			$optcfg['wireless']['wep']['enable'] = $_POST['wep_enable'] = true;
189
		else
190
			unset($optcfg['wireless']['wep']['enable']);
191

    
192
		if($_POST['wme_enable'] == "yes") 
193
			$optcfg['wireless']['wme']['enable'] = $_POST['wme_enable'] = true;
194
		else
195
			unset($optcfg['wireless']['wme']['enable']);
196

    
197
		if($_POST['pureg_enable'] == "yes")
198
			$optcfg['wireless']['pureg']['enable'] = $_POST['pureg_enable'] = true;
199
		else
200
			unset($optcfg['wireless']['pureg']['enable']);
201

    
202
		if($_POST['apbridge_enable'] == "yes") 
203
			$optcfg['wireless']['apbridge']['enable'] = $_POST['apbridge_enable'] = true;
204
		else
205
			unset($optcfg['wireless']['apbridge']['enable']);
206

    
207
		if($_POST['turbo_enable'] == "yes") 
208
			$optcfg['wireless']['turbo']['enable'] = $_POST['turbo_enable'] = true;
209
		else
210
			unset($optcfg['wireless']['turbo']['enable']);
211

    
212
		$optcfg['wireless']['wep']['key'] = array();
213

    
214
		for ($i = 1; $i <= 4; $i++) {
215
			if ($_POST['key' . $i]) {
216
				$newkey = array();
217
				$newkey['value'] = $_POST['key' . $i];
218
				if ($_POST['txkey'] == $i)
219
					$newkey['txkey'] = true;
220
				$optcfg['wireless']['wep']['key'][] = $newkey;
221
			}
222
		}
223
	}
224
	
225
	return $input_errors;
226
}
227

    
228
function wireless_config_print() {
229
	global $optcfg, $pconfig, $wlchannels, $g;
230
?>
231

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

    
246
                <tr> 
247
                  <td colspan="2" valign="top" class="listtopic">Wireless configuration</td>
248
		</tr>
249
		<tr>
250
			<td valign="top" class="vncellreq">Standard</td>
251
			<td class="vtable">
252
			<select name="standard" class="formfld" id="standard">
253
				<option <? if ($pconfig['standard'] == '11b') echo "selected";?> value="11b">802.11b</option>
254
				<option <? if ($pconfig['standard'] == '11g') echo "selected";?> value="11g">802.11g</option>
255
				<option <? if ($pconfig['standard'] == '11a') echo "selected";?> value="11a">802.11a</option>
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="formfld" 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="formfld" 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" 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 turbo mode</td>
304
			<td class="vtable"><input name="turbo_enable" type="checkbox" class="formfld" id="turbo_enable" value="yes" <? if ($pconfig['turbo_enable']) echo "checked";?>>
305
			<br/>Setting this option will force the card to use turbo mode.
306
			<br/>use "ifconfig interface list channel" to list turbo capable channels.
307
			</td>
308
		</tr>
309
		<tr>
310
			<td valign="top" class="vncell">Enable WME</td>
311
			<td class="vtable"><input name="wme_enable" type="checkbox" class="formfld" id="wme_enable" value="yes" <? if ($pconfig['wme_enable']) echo "checked";?>>
312
			<br/>Setting this option will force the card to use WME (wireless QoS).
313
			</td>
314
		</tr>
315
		<tr>
316
			<td valign="top" class="vncell">Enable Hide SSID</td>
317
			<td class="vtable"><input name="hidessid_enable" type="checkbox" class="formfld" id="hidessid_enable" value="yes" <? if ($pconfig['hidessid_enable']) echo "checked";?>>
318
			<br/>
319
			Setting this option will force the card to NOT broadcast it's SSID
320
			<br/>
321
			(this might create problems for some clients). </td>
322
		</tr> 
323
                <tr> 
324
			<td valign="top" class="vncellreq">Transmit power</td>
325
			<td class="vtable">
326
			<select name="txpower">
327
			<?
328
				for($x = 99; $x > 0; $x--) {
329
					if($pconfig["txpower"] == $x)
330
						$SELECTED = " SELECTED";
331
					else
332
						$SELECTED = "";
333
					echo "<option {$SELECTED}>{$x}</option>\n";
334
				}
335
			?>
336
			</select><br/>
337
			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.
338
			</td>
339
		</tr>
340
                <tr> 
341
			<td valign="top" class="vncellreq">Channel</td>
342
			<td class="vtable"><select name="channel" class="formfld" id="channel">
343
				<option <? if ($pconfig['channel'] == 0) echo "selected";?> value="0">Auto</option>
344
				<? foreach ($wlchannels as $channel): ?>
345
				<option <? if ($channel == $pconfig['channel']) echo "selected";?> value="<?=$channel;?>">
346
			<?=$channel;?>
347
			</option>
348
			<? endforeach; ?>
349
			</select>
350
			<br/>
351
			Note: Not all channels may be supported by your card
352
			<br/>
353
			use "ifconfig interface list channel" to list channels.</td>
354
		</tr>
355
		<tr>
356
			<td valign="top" class="vncell">Interface capabilities</td>
357
			<?php
358
				if($wancfg['if']) 
359
					$if = $lancfg['if'];
360
				if($wancfg['if']) 
361
					$if = $lancfg['if'];
362
				if($optcfg['if']) 
363
					$if = $optcfg['if'];				
364
				$results = `/sbin/ifconfig {$if} list channel`;
365
			?>			
366
			<td class="vtable"><textarea readonly onFocus="blur()" name="noedit" id="noedit" cols="73" rows="3"><?=$results?>;</textarea>
367
			<br/>This is a list of the channels and the capabilities of your card.
368
			</td>
369
		</tr>		
370
		<tr>
371
			<td valign="top" class="vncell">Distance setting</td>
372
			<td class="vtable"><input name="distance" type="text" class="formfld" id="distance" size="5" value="<?=htmlspecialchars($pconfig['distance']);?>">
373
			<br/>
374
			Note: This field can be used to tune ACK/CTS timers to fit the distance between AP and Client<br/>
375
			(measured in Meters and works only for Atheros based cards !)
376
			</td>
377
		</tr>
378
		<tr>
379
			<td valign="top" class="vncell">Station name</td>
380
			<td class="vtable"><input name="stationname" type="text" class="formfld" id="stationname" size="20" value="<?=htmlspecialchars($pconfig['stationname']);?>">
381
			<br/>
382
			Hint: this field can usually be left blank</td>
383
		</tr>
384
		<tr>
385
			<td valign="top" class="vncell">WEP</td>
386
			<td class="vtable"> <input name="wep_enable" type="checkbox" id="wep_enable" value="yes" <? if ($pconfig['wep_enable']) echo "checked"; ?>> 
387
			<strong>Enable WEP</strong>
388
			<table border="0" cellspacing="0" cellpadding="0">
389
		<tr> 
390
                        <td>&nbsp;</td>
391
                        <td>&nbsp;</td>
392
                        <td>&nbsp;TX key&nbsp;</td>
393
		</tr>
394
		<tr> 
395
                        <td>Key 1:&nbsp;&nbsp;</td>
396
                        <td> <input name="key1" type="text" class="formfld" id="key1" size="30" value="<?=htmlspecialchars($pconfig['key1']);?>"></td>
397
                        <td align="center"> <input name="txkey" type="radio" value="1" <? if ($pconfig['txkey'] == 1) echo "checked";?>></td>
398
		</tr>
399
		<tr> 
400
                        <td>Key 2:&nbsp;&nbsp;</td>
401
                        <td> <input name="key2" type="text" class="formfld" id="key2" size="30" value="<?=htmlspecialchars($pconfig['key2']);?>"></td>
402
                        <td align="center"> <input name="txkey" type="radio" value="2" <? if ($pconfig['txkey'] == 2) echo "checked";?>></td>
403
		</tr>
404
		<tr> 
405
                        <td>Key 3:&nbsp;&nbsp;</td>
406
                        <td> <input name="key3" type="text" class="formfld" id="key3" size="30" value="<?=htmlspecialchars($pconfig['key3']);?>"></td>
407
                        <td align="center"> <input name="txkey" type="radio" value="3" <? if ($pconfig['txkey'] == 3) echo "checked";?>></td>
408
		</tr>
409
		<tr> 
410
                        <td>Key 4:&nbsp;&nbsp;</td>
411
                        <td> <input name="key4" type="text" class="formfld" id="key4" size="30" value="<?=htmlspecialchars($pconfig['key4']);?>"></td>
412
                        <td align="center"> <input name="txkey" type="radio" value="4" <? if ($pconfig['txkey'] == 4) echo "checked";?>></td>
413
		</tr>
414
			</table>
415
			<br/>
416
			40 (64) bit keys may be entered as 5 ASCII characters or 10 hex digits preceded by '0x'.<br/>
417
			104 (128) bit keys may be entered as 13 ASCII characters or 26 hex digits preceded by '0x'.
418
			<p>For assistance with creating keys, please see
419
			<a href="javascript:if(openwindow('/wlan_strong_key_generator/generator.php') == false) alert('Popup blocker detected.  Action aborted.');">WLAN Strong Key Generator</a>.
420
		   	</td>
421
                </tr>
422
                <tr> 
423
			<td valign="top" class="vncell"><strong>WPA</strong></td>
424
			<td class="vtable"><input name="wpa_enable" type="checkbox" class="formfld" id="wpa_enable" value="yes" <? if ($pconfig['wpa_enable']) echo "checked"; ?>> 
425
			<strong>Enable WPA</strong>
426
			<br/><br/>
427
			<table border="0" cellspacing="0" cellpadding="0">
428
			<tr> 
429
                        <td>&nbsp;</td>
430
                        <td>&nbsp;WPA Pre Shared Key&nbsp;</td>
431
			</tr>
432
			<tr>
433
			<td>PSK:&nbsp;&nbsp;</td>
434
			<td><input name="passphrase" type="text" class="formfld" id="passphrase" size="66" value="<?=htmlspecialchars($pconfig['passphrase']);?>"></td>
435
			</tr>
436
			</table>
437
			<br/>Passphrase must be from 8 to 63 chars.
438
			</td>
439
	        </tr>
440
		<tr>
441
			<td valign="top" class="vncell">WPA Mode</td>
442
			<td class="vtable"><select name="wpa_mode" class="formfld" id="wpa_mode">
443
			<option <? if ($pconfig['wpa_mode'] == '1') echo "selected";?> value="1">WPA</option>
444
			<option <? if ($pconfig['wpa_mode'] == '2') echo "selected";?> value="2">WPA2</option>
445
			<option <? if ($pconfig['wpa_mode'] == '3') echo "selected";?> value="3">Both</option>
446
			</select>
447
			</td>
448
		</tr>
449
		<tr>
450
			<td valign="top" class="vncell">WPA Key Management Mode</td>
451
			<td class="vtable"><select name="wpa_key_mgmt" class="formfld" id="wpa_key_mgmt">
452
			<option <? if ($pconfig['wpa_key_mgmt'] == 'WPA-PSK') echo "selected";?> value="WPA-PSK">Pre Shared Key</option>
453
			<option <? if ($pconfig['wpa_key_mgmt'] == 'WPA-EAP') echo "selected";?> value="WPA-EAP">Extensible Authentication Protocol</option>
454
			<option <? if ($pconfig['wpa_key_mgmt'] == 'WPA-PSK WPA-EAP') echo "selected";?> value="WPA-PSK WPA-EAP">Both</option>
455
 			</select>
456
			</td>
457
		</tr>
458
		<? /*
459
		*/ ?>
460
		<tr>
461
			<td valign="top" class="vncell">Authentication</td>
462
			<td class="vtable"><select name="auth_algs" class="formfld" id="auth_algs">
463
			<option <? if ($pconfig['auth_algs'] == '1') echo "selected";?> value="1">Open System Authentication</option>
464
			<option <? if ($pconfig['auth_algs'] == '2') echo "selected";?> value="2">Shared Key Authentication</option>
465
			<option <? if ($pconfig['auth_algs'] == 'both') echo "selected";?> value="3">Both</option>
466
			</select>
467
			<br/>Note: Shared Key Authentication requires WEP.</br>
468
			</td>
469
		</tr>
470
		<tr>
471
			<td valign="top" class="vncell">WPA Pairwise</td>
472
			<td class="vtable"><select name="wpa_pairwise" class="formfld" id="wpa_pairwise">
473
			<option <? if ($pconfig['wpa_pairwise'] == 'CCMP TKIP') echo "selected";?> value="CCMP TKIP">Both</option>
474
			<option <? if ($pconfig['wpa_pairwise'] == 'CCMP') echo "selected";?> value="CCMP">AES</option>
475
			<option <? if ($pconfig['wpa_pairwise'] == 'TKIP') echo "selected";?> value="TKIP">TKIP</option>
476
			</select>
477
			</td>
478
		</tr>
479
		<tr>
480
			<td valign="top" class="vncell">Key Rotation</td>
481
			<td class="vtable"><input name="wpa_group_rekey" type="text" class="formfld" id="wpa_group_rekey" size="30" value="<? echo $pconfig['wpa_group_rekey'] ? $pconfig['wpa_group_rekey'] : "60";?>">
482
			<br/>Allowed values are 1-9999 but should not be longer than Master Key Regeneration time.
483
			</td>
484
		</tr>
485
		<tr>
486
			<td valign="top" class="vncell">Master Key Regeneration</td>
487
			<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";?>">
488
			<br/>Allowed values are 1-9999 but should not be shorter than Key Rotation time.
489
			</td>
490
		</tr>
491
		<tr>
492
			<td valign="top" class="vncell">Strict Key Regeneration</td>
493
			<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"; ?>>
494
			<br/>Setting this option will force the AP to rekey whenever a client disassociates.
495
			</td>
496
		</tr>
497
		<tr>
498
			<td valign="top" class="vncell">Enable IEEE802.1X</td>
499
			<td class="vtable"><input name="ieee8021x" type="checkbox" value="yes"  class="formfld" id="ieee8021x" <? if ($pconfig['ieee8021x']) echo "checked";?>>
500
			<br/>Setting this option will enable 802.1x authentication.
501
			</td>
502
		</tr>
503
		<script language="JavaScript">
504
		document.iform.noedit.enabled = false;
505
		</script>
506
<? } ?>
(69-69/159)