Project

General

Profile

Download (21.5 KB) Statistics
| Branch: | Tag: | Revision:
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 45335fc4 Ermal Luçi
function wireless_config_init(&$optcfg) {
33
	global $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 a5d223c6 Ermal Luçi
	if (is_array($optcfg['wireless']['wpa'])) {
48
		$pconfig['debug_mode'] = $optcfg['wireless']['wpa']['debug_mode'];
49
		$pconfig['macaddr_acl'] = $optcfg['wireless']['wpa']['macaddr_acl'];
50
		$pconfig['mac_acl_enable'] = isset($optcfg['wireless']['wpa']['mac_acl_enable']);
51
		$pconfig['auth_algs'] = $optcfg['wireless']['wpa']['auth_algs'];
52
		$pconfig['wpa_mode'] = $optcfg['wireless']['wpa']['wpa_mode'];
53
		$pconfig['wpa_key_mgmt'] = $optcfg['wireless']['wpa']['wpa_key_mgmt'];
54
		$pconfig['wpa_pairwise'] = $optcfg['wireless']['wpa']['wpa_pairwise'];
55
		$pconfig['wpa_group_rekey'] = $optcfg['wireless']['wpa']['wpa_group_rekey'];
56
		$pconfig['wpa_gmk_rekey'] = $optcfg['wireless']['wpa']['wpa_gmk_rekey'];
57
		$pconfig['wpa_strict_rekey'] = isset($optcfg['wireless']['wpa']['wpa_strict_rekey']);
58
		$pconfig['passphrase'] = $optcfg['wireless']['wpa']['passphrase'];
59
		$pconfig['ieee8021x_enable'] = isset($optcfg['wireless']['wpa']['ieee8021x']['enable']);
60
		$pconfig['ext_wpa_sw'] = $optcfg['wireless']['wpa']['ext_wpa_sw'];
61
		$pconfig['wpa_enable'] = isset($optcfg['wireless']['wpa']['enable']);
62
	}
63 8600af6f Scott Ullrich
	$pconfig['wep_enable'] = isset($optcfg['wireless']['wep']['enable']);
64 8f71faba Espen Johansen
	$pconfig['mac_acl'] = $optcfg['wireless']['mac_acl'];
65
66 16f9b391 Ermal Luçi
	if (is_array($optcfg['wireless']['wep']) &&
67
		is_array($optcfg['wireless']['wep']['key'])) {
68 8600af6f Scott Ullrich
		$i = 1;
69
		foreach ($optcfg['wireless']['wep']['key'] as $wepkey) {
70
			$pconfig['key' . $i] = $wepkey['value'];
71
			if (isset($wepkey['txkey']))
72
				$pconfig['txkey'] = $i;
73
			$i++;
74
		}
75
		if (!isset($wepkey['txkey']))
76
			$pconfig['txkey'] = 1;
77
	}
78
}
79
80 45335fc4 Ermal Luçi
function wireless_config_post(&$optcfg) {
81
	global $pconfig;
82 8600af6f Scott Ullrich
83 d8c67d69 Scott Ullrich
	$input_errors = "";
84 8600af6f Scott Ullrich
	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 bf9ca82a Scott Ullrich
92 8600af6f Scott Ullrich
	}
93
94
	/* loop through keys and enforce size */
95
	for ($i = 1; $i <= 4; $i++) {
96
		if ($_POST['key' . $i]) {
97 192fd3d1 Scott Ullrich
			/* 64 bit */
98 ea206efb Scott Ullrich
			if(strlen($_POST['key' . $i]) == 5)
99
				continue;
100 bcf53132 Scott Ullrich
			if(strlen($_POST['key' . $i]) == 10) {
101
				/* hex key */
102
				if(stristr($_POST['key' . $i], "0x") == false) {
103
					$_POST['key' . $i] = "0x" . $_POST['key' . $i];
104
				}
105 ea206efb Scott Ullrich
				continue;
106 bcf53132 Scott Ullrich
			}
107 18547c5d Scott Ullrich
			if(strlen($_POST['key' . $i]) == 12) {
108
				/* hex key */
109
				if(stristr($_POST['key' . $i], "0x") == false) {
110
					$_POST['key' . $i] = "0x" . $_POST['key' . $i];
111
				}
112
				continue;
113 bf9ca82a Scott Ullrich
			}
114 192fd3d1 Scott Ullrich
			/* 128 bit */
115 ea206efb Scott Ullrich
			if(strlen($_POST['key' . $i]) == 13)
116
				continue;
117 bcf53132 Scott Ullrich
			if(strlen($_POST['key' . $i]) == 26) {
118
				/* hex key */
119
				if(stristr($_POST['key' . $i], "0x") == false) {
120
					$_POST['key' . $i] = "0x" . $_POST['key' . $i];
121 bf9ca82a Scott Ullrich
				}
122 ea206efb Scott Ullrich
				continue;
123 bcf53132 Scott Ullrich
			}
124 c33565ad Scott Ullrich
			if(strlen($_POST['key' . $i]) == 28)
125
				continue;
126 ea206efb Scott Ullrich
			$input_errors[] =  "Invalid wep key size.   Sizes should be 40 (64) bit keys or 104 (128) bit.";
127 b4197106 Scott Ullrich
			break;
128 8600af6f Scott Ullrich
		}
129
	}
130
131
	if (!$input_errors) {
132 8f71faba Espen Johansen
133 8600af6f Scott Ullrich
		$optcfg['wireless']['standard'] = $_POST['standard'];
134
		$optcfg['wireless']['mode'] = $_POST['mode'];
135 bfe7a893 Scott Ullrich
		$optcfg['wireless']['protmode'] = $_POST['protmode'];
136 8600af6f Scott Ullrich
		$optcfg['wireless']['ssid'] = $_POST['ssid'];
137
		$optcfg['wireless']['channel'] = $_POST['channel'];
138 bf9ca82a Scott Ullrich
		$optcfg['wireless']['authmode'] = $_POST['authmode'];
139 8600af6f Scott Ullrich
		$optcfg['wireless']['txpower'] = $_POST['txpower'];
140 57f13ba8 Scott Ullrich
		$optcfg['wireless']['distance'] = $_POST['distance'];
141 a5d223c6 Ermal Luçi
		if (!is_array($optcfg['wireless']['wpa']))
142
			$optcfg['wireless']['wpa'] = array();
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 16f9b391 Ermal Luçi
		if($_POST['wep_enable'] == "yes") {
184
			if (!is_array($optcfg['wireless']['wep']))
185
                        	$optcfg['wireless']['wep'] = array();
186 fa16d51e Scott Ullrich
			$optcfg['wireless']['wep']['enable'] = $_POST['wep_enable'] = true;
187 16f9b391 Ermal Luçi
		} else
188 fa16d51e Scott Ullrich
			unset($optcfg['wireless']['wep']['enable']);
189
190 16f9b391 Ermal Luçi
191
		if($_POST['wme_enable'] == "yes") {
192
			if (!is_array($optcfg['wireless']['wme']))
193
                        	$optcfg['wireless']['wme'] = array();
194 fa16d51e Scott Ullrich
			$optcfg['wireless']['wme']['enable'] = $_POST['wme_enable'] = true;
195 16f9b391 Ermal Luçi
		} else
196 fa16d51e Scott Ullrich
			unset($optcfg['wireless']['wme']['enable']);
197
198 16f9b391 Ermal Luçi
199
		if($_POST['pureg_enable'] == "yes") {
200
			if (!is_array($optcfg['wireless']['pureg']))
201
                        	$optcfg['wireless']['pureg'] = array();
202 fa16d51e Scott Ullrich
			$optcfg['wireless']['pureg']['enable'] = $_POST['pureg_enable'] = true;
203 16f9b391 Ermal Luçi
		} else
204 fa16d51e Scott Ullrich
			unset($optcfg['wireless']['pureg']['enable']);
205
206 16f9b391 Ermal Luçi
207
		if($_POST['apbridge_enable'] == "yes") {
208
			if (!is_array($optcfg['wireless']['apbridge']))
209
                        	$optcfg['wireless']['apbridge'] = array();
210 fa16d51e Scott Ullrich
			$optcfg['wireless']['apbridge']['enable'] = $_POST['apbridge_enable'] = true;
211 16f9b391 Ermal Luçi
		} else
212 fa16d51e Scott Ullrich
			unset($optcfg['wireless']['apbridge']['enable']);
213
214 16f9b391 Ermal Luçi
215
		if($_POST['standard'] == "11a Turbo") {
216
			if (!is_array($optcfg['wireless']['turbo']))
217
                        	$optcfg['wireless']['turbo'] = array();
218 6f17ad79 Scott Ullrich
			$optcfg['wireless']['turbo']['enable'] = true;
219 16f9b391 Ermal Luçi
		} else
220 fa16d51e Scott Ullrich
			unset($optcfg['wireless']['turbo']['enable']);
221
222 8600af6f Scott Ullrich
		$optcfg['wireless']['wep']['key'] = array();
223 d213185e Espen Johansen
224 8600af6f Scott Ullrich
		for ($i = 1; $i <= 4; $i++) {
225
			if ($_POST['key' . $i]) {
226
				$newkey = array();
227
				$newkey['value'] = $_POST['key' . $i];
228
				if ($_POST['txkey'] == $i)
229
					$newkey['txkey'] = true;
230
				$optcfg['wireless']['wep']['key'][] = $newkey;
231
			}
232
		}
233
	}
234 bf9ca82a Scott Ullrich
235 8600af6f Scott Ullrich
	return $input_errors;
236
}
237
238 e53c01b2 Seth Mos
$curif = convert_friendly_interface_to_real_interface_name($if);
239 6f17ad79 Scott Ullrich
$wl_modes = get_wireless_modes($curif);
240
241 45335fc4 Ermal Luçi
function wireless_config_print(&$optcfg) {
242
	global $pconfig, $wl_modes, $g;
243 8600af6f Scott Ullrich
?>
244 f881baa3 Scott Ullrich
245
<script language="JavaScript">
246
	function openwindow(url) {
247
		var oWin = window.open(url,"pfSensePop","width=620,height=400,top=150,left=150");
248
		if (oWin==null || typeof(oWin)=="undefined") {
249
			return false;
250
		} else {
251
			return true;
252
		}
253
	}
254
</script>
255 bf9ca82a Scott Ullrich
                <tr>
256 8600af6f Scott Ullrich
                  <td colspan="2" valign="top" height="16"></td>
257 ac3f8318 Espen Johansen
		</tr>
258
259 bf9ca82a Scott Ullrich
                <tr>
260 8600af6f Scott Ullrich
                  <td colspan="2" valign="top" class="listtopic">Wireless configuration</td>
261 ac3f8318 Espen Johansen
		</tr>
262
		<tr>
263
			<td valign="top" class="vncellreq">Standard</td>
264
			<td class="vtable">
265 8e13ca40 Seth Mos
			<select name="standard" class="formselect" id="standard">
266 6f17ad79 Scott Ullrich
				<?php
267
				foreach($wl_modes as $wl_standard => $wl_channels) {
268
					PRINT "<option ";
269
					if ($pconfig['standard'] == "$wl_standard") {
270
						PRINT "selected ";
271
					}
272
					PRINT "value=\"$wl_standard\">802.$wl_standard</option>\n";
273
				}
274
				?>
275 ac3f8318 Espen Johansen
				</select>
276
			</td>
277
		</tr>
278
		<tr>
279
			<td valign="top" class="vncellreq">Mode</td>
280
			<td class="vtable">
281 8e13ca40 Seth Mos
			<select name="mode" class="formselect" id="mode">
282 ac3f8318 Espen Johansen
				<option <? if ($pconfig['mode'] == 'bss') echo "selected";?> value="bss">Infrastructure (BSS)</option>
283
				<option <? if ($pconfig['mode'] == 'adhoc') echo "selected";?> value="adhoc">Ad-hoc (IBSS)</option>
284
				<option <? if ($pconfig['mode'] == 'hostap') echo "selected";?> value="hostap">Access Point</option>
285
			</select>
286
			</td>
287
		</tr>
288 bfe7a893 Scott Ullrich
		<tr>
289
			<td valign="top" class="vncellreq">802.11g OFDM Protection Mode</td>
290
			<td class="vtable">
291 8e13ca40 Seth Mos
			<select name="protmode" class="formselect" id="protmode">
292 bfe7a893 Scott Ullrich
				<option <? if ($pconfig['protmode'] == 'off') echo "selected";?> value="off">Protection mode off</option>
293
				<option <? if ($pconfig['protmode'] == 'cts') echo "selected";?> value="cts">Protection mode CTS to self</option>
294
				<option <? if ($pconfig['protmode'] == 'rtscts') echo "selected";?> value="rtscts">Protection mode RTS and CTS</option>
295
			</select>
296
			<br/>
297
			For IEEE 802.11g, use the specified technique for protecting OFDM frames in a mixed 11b/11g network.
298
			<br/>
299
			</td>
300
		</tr>
301 ac3f8318 Espen Johansen
		<tr>
302 d213185e Espen Johansen
			<td valign="top" class="vncellreq">SSID</td>
303 8e13ca40 Seth Mos
			<td class="vtable"><input name="ssid" type="text" class="formfld unknown" id="ssid" size="20" value="<?=htmlspecialchars($pconfig['ssid']);?>">
304 d213185e Espen Johansen
			</td>
305 8600af6f Scott Ullrich
                </tr>
306 d213185e Espen Johansen
		<tr>
307 8f71faba Espen Johansen
			<td valign="top" class="vncell">802.11g only</td>
308 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";?>>
309 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).
310
			</td>
311
		</tr>
312 ac3f8318 Espen Johansen
		<tr>
313
			<td valign="top" class="vncell">Allow intra-BSS communication</td>
314 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";?>>
315 ac3f8318 Espen Johansen
			<br/>
316
			When operating as an access point, enable this if you want to pass packets between wireless clients directly.
317
			<br/>
318
			Disabling the internal bridging is useful when traffic is to be processed with packet filtering.
319 8f71faba Espen Johansen
			</td>
320
		</tr>
321
		<tr>
322
			<td valign="top" class="vncell">Enable WME</td>
323 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";?>>
324 8f71faba Espen Johansen
			<br/>Setting this option will force the card to use WME (wireless QoS).
325
			</td>
326
		</tr>
327
		<tr>
328
			<td valign="top" class="vncell">Enable Hide SSID</td>
329 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";?>>
330 ac3f8318 Espen Johansen
			<br/>
331 a4339e57 Chris Buechler
			Setting this option will force the card to NOT broadcast its SSID
332 ac3f8318 Espen Johansen
			<br/>
333
			(this might create problems for some clients). </td>
334 bf9ca82a Scott Ullrich
		</tr>
335
                <tr>
336 8f71faba Espen Johansen
			<td valign="top" class="vncellreq">Transmit power</td>
337
			<td class="vtable">
338 8e13ca40 Seth Mos
			<select name="txpower" class="formselect" id="txpower">
339 ac3f8318 Espen Johansen
			<?
340 60ae7b45 Scott Ullrich
				for($x = 99; $x > 0; $x--) {
341 8600af6f Scott Ullrich
					if($pconfig["txpower"] == $x)
342
						$SELECTED = " SELECTED";
343
					else
344
						$SELECTED = "";
345
					echo "<option {$SELECTED}>{$x}</option>\n";
346
				}
347 8f71faba Espen Johansen
			?>
348
			</select><br/>
349 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.
350 8f71faba Espen Johansen
			</td>
351
		</tr>
352 bf9ca82a Scott Ullrich
                <tr>
353 57f13ba8 Scott Ullrich
			<td valign="top" class="vncellreq">Channel</td>
354 8e13ca40 Seth Mos
			<td class="vtable"><select name="channel" class="formselect" id="channel">
355 522e44e9 Scott Ullrich
				<option <? if ($pconfig['channel'] == 0) echo "selected"; ?> value="0">Auto</option>
356 6f17ad79 Scott Ullrich
				<?php
357
				foreach($wl_modes as $wl_standard => $wl_channels) {
358
					if($wl_standard == "11g") { $wl_standard = "11b/g"; }
359
					foreach($wl_channels as $wl_channel) {
360
						PRINT "<option ";
361
						if ($pconfig['channel'] == "$wl_channel") {
362
							PRINT "selected ";
363
						}
364
						PRINT "value=\"$wl_channel\">$wl_standard - $wl_channel</option>\n";
365
					}
366
				}
367
				?>
368 eb6ce097 Espen Johansen
			</select>
369
			<br/>
370
			Note: Not all channels may be supported by your card
371 57f13ba8 Scott Ullrich
		</tr>
372
		<tr>
373
			<td valign="top" class="vncell">Distance setting</td>
374 8e13ca40 Seth Mos
			<td class="vtable"><input name="distance" type="text" class="formfld unknown" id="distance" size="5" value="<?=htmlspecialchars($pconfig['distance']);?>">
375 57f13ba8 Scott Ullrich
			<br/>
376 fdf8b0a8 Scott Ullrich
			Note: This field can be used to tune ACK/CTS timers to fit the distance between AP and Client<br/>
377 b6c95929 Scott Ullrich
			(measured in Meters and works only for Atheros based cards !)
378 57f13ba8 Scott Ullrich
			</td>
379
		</tr>
380
		<tr>
381 8f71faba Espen Johansen
			<td valign="top" class="vncell">WEP</td>
382 bf9ca82a Scott Ullrich
			<td class="vtable"> <input name="wep_enable" type="checkbox" id="wep_enable" value="yes" <? if ($pconfig['wep_enable']) echo "checked"; ?>>
383 8f71faba Espen Johansen
			<strong>Enable WEP</strong>
384
			<table border="0" cellspacing="0" cellpadding="0">
385 bf9ca82a Scott Ullrich
		<tr>
386 8600af6f Scott Ullrich
                        <td>&nbsp;</td>
387
                        <td>&nbsp;</td>
388
                        <td>&nbsp;TX key&nbsp;</td>
389 8f71faba Espen Johansen
		</tr>
390 bf9ca82a Scott Ullrich
		<tr>
391 8600af6f Scott Ullrich
                        <td>Key 1:&nbsp;&nbsp;</td>
392 8e13ca40 Seth Mos
                        <td> <input name="key1" type="text" class="formfld unknown" id="key1" size="30" value="<?=htmlspecialchars($pconfig['key1']);?>"></td>
393 ac3f8318 Espen Johansen
                        <td align="center"> <input name="txkey" type="radio" value="1" <? if ($pconfig['txkey'] == 1) echo "checked";?>></td>
394 8f71faba Espen Johansen
		</tr>
395 bf9ca82a Scott Ullrich
		<tr>
396 8600af6f Scott Ullrich
                        <td>Key 2:&nbsp;&nbsp;</td>
397 8e13ca40 Seth Mos
                        <td> <input name="key2" type="text" class="formfld unknown" id="key2" size="30" value="<?=htmlspecialchars($pconfig['key2']);?>"></td>
398 ac3f8318 Espen Johansen
                        <td align="center"> <input name="txkey" type="radio" value="2" <? if ($pconfig['txkey'] == 2) echo "checked";?>></td>
399 8f71faba Espen Johansen
		</tr>
400 bf9ca82a Scott Ullrich
		<tr>
401 8600af6f Scott Ullrich
                        <td>Key 3:&nbsp;&nbsp;</td>
402 8e13ca40 Seth Mos
                        <td> <input name="key3" type="text" class="formfld unknown" id="key3" size="30" value="<?=htmlspecialchars($pconfig['key3']);?>"></td>
403 ac3f8318 Espen Johansen
                        <td align="center"> <input name="txkey" type="radio" value="3" <? if ($pconfig['txkey'] == 3) echo "checked";?>></td>
404 8f71faba Espen Johansen
		</tr>
405 bf9ca82a Scott Ullrich
		<tr>
406 8600af6f Scott Ullrich
                        <td>Key 4:&nbsp;&nbsp;</td>
407 8e13ca40 Seth Mos
                        <td> <input name="key4" type="text" class="formfld unknown" id="key4" size="30" value="<?=htmlspecialchars($pconfig['key4']);?>"></td>
408 ac3f8318 Espen Johansen
                        <td align="center"> <input name="txkey" type="radio" value="4" <? if ($pconfig['txkey'] == 4) echo "checked";?>></td>
409 8f71faba Espen Johansen
		</tr>
410
			</table>
411
			<br/>
412
			40 (64) bit keys may be entered as 5 ASCII characters or 10 hex digits preceded by '0x'.<br/>
413
			104 (128) bit keys may be entered as 13 ASCII characters or 26 hex digits preceded by '0x'.
414
		   	</td>
415 8600af6f Scott Ullrich
                </tr>
416 bf9ca82a Scott Ullrich
                <tr>
417 8f71faba Espen Johansen
			<td valign="top" class="vncell"><strong>WPA</strong></td>
418 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"; ?>>
419 8f71faba Espen Johansen
			<strong>Enable WPA</strong>
420
			<br/><br/>
421
			<table border="0" cellspacing="0" cellpadding="0">
422 bf9ca82a Scott Ullrich
			<tr>
423 8f71faba Espen Johansen
                        <td>&nbsp;</td>
424
                        <td>&nbsp;WPA Pre Shared Key&nbsp;</td>
425 f438eed4 Scott Ullrich
			</tr>
426
			<tr>
427 8f71faba Espen Johansen
			<td>PSK:&nbsp;&nbsp;</td>
428 8e13ca40 Seth Mos
			<td><input name="passphrase" type="text" class="formfld unknown" id="passphrase" size="66" value="<?=htmlspecialchars($pconfig['passphrase']);?>"></td>
429 f438eed4 Scott Ullrich
			</tr>
430
			</table>
431
			<br/>Passphrase must be from 8 to 63 chars.
432 8f71faba Espen Johansen
			</td>
433
	        </tr>
434
		<tr>
435
			<td valign="top" class="vncell">WPA Mode</td>
436 8e13ca40 Seth Mos
			<td class="vtable"><select name="wpa_mode" class="formselect" id="wpa_mode">
437 ac3f8318 Espen Johansen
			<option <? if ($pconfig['wpa_mode'] == '1') echo "selected";?> value="1">WPA</option>
438
			<option <? if ($pconfig['wpa_mode'] == '2') echo "selected";?> value="2">WPA2</option>
439
			<option <? if ($pconfig['wpa_mode'] == '3') echo "selected";?> value="3">Both</option>
440 8f71faba Espen Johansen
			</select>
441
			</td>
442
		</tr>
443
		<tr>
444
			<td valign="top" class="vncell">WPA Key Management Mode</td>
445 8e13ca40 Seth Mos
			<td class="vtable"><select name="wpa_key_mgmt" class="formselect" id="wpa_key_mgmt">
446 ac3f8318 Espen Johansen
			<option <? if ($pconfig['wpa_key_mgmt'] == 'WPA-PSK') echo "selected";?> value="WPA-PSK">Pre Shared Key</option>
447
			<option <? if ($pconfig['wpa_key_mgmt'] == 'WPA-EAP') echo "selected";?> value="WPA-EAP">Extensible Authentication Protocol</option>
448
			<option <? if ($pconfig['wpa_key_mgmt'] == 'WPA-PSK WPA-EAP') echo "selected";?> value="WPA-PSK WPA-EAP">Both</option>
449 8f71faba Espen Johansen
 			</select>
450
			</td>
451
		</tr>
452 ef773bd6 Scott Ullrich
		<? /*
453 d8c67d69 Scott Ullrich
		<tr>
454
			<td valign="top" class="vncell">Enable MAC Filtering</td>
455 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"; ?>>
456 d8c67d69 Scott Ullrich
			Setting this option will enable the use of a mac filterlist to allow/deny association based on mac address
457
			<br/><br/>
458 8e13ca40 Seth Mos
			<select name="macaddr_acl" class="formselect" id="macaddr_acl">
459 d8c67d69 Scott Ullrich
                        <option <? if ($pconfig['macaddr_acl'] == '0') echo "selected";?> value="0">Allow</option>
460
			<option <? if ($pconfig['macaddr_acl'] == '1') echo "selected";?> value="1">Deny</option>
461
			<option <? if ($pconfig['macaddr_acl'] == '2') echo "selected";?> value="2">Radius</option>
462
			</select>
463
			<br/><br/>
464
			Setting this to "Allow" will allow all clients in not in deny list, while "Deny" will deny all clients not in allow list.
465
			Radius will cause allow and deny list to be searched and then query radius.</br>
466
			</td>
467
		</tr>
468 ef773bd6 Scott Ullrich
		*/ ?>
469 8f71faba Espen Johansen
		<tr>
470
			<td valign="top" class="vncell">Authentication</td>
471 8e13ca40 Seth Mos
			<td class="vtable"><select name="auth_algs" class="formselect" id="auth_algs">
472 ac3f8318 Espen Johansen
			<option <? if ($pconfig['auth_algs'] == '1') echo "selected";?> value="1">Open System Authentication</option>
473
			<option <? if ($pconfig['auth_algs'] == '2') echo "selected";?> value="2">Shared Key Authentication</option>
474 ddc01b4d Scott Ullrich
			<option <? if ($pconfig['auth_algs'] == '3') echo "selected";?> value="3">Both</option>
475 8f71faba Espen Johansen
			</select>
476
			<br/>Note: Shared Key Authentication requires WEP.</br>
477
			</td>
478
		</tr>
479
		<tr>
480
			<td valign="top" class="vncell">WPA Pairwise</td>
481 8e13ca40 Seth Mos
			<td class="vtable"><select name="wpa_pairwise" class="formselect" id="wpa_pairwise">
482 ac3f8318 Espen Johansen
			<option <? if ($pconfig['wpa_pairwise'] == 'CCMP TKIP') echo "selected";?> value="CCMP TKIP">Both</option>
483
			<option <? if ($pconfig['wpa_pairwise'] == 'CCMP') echo "selected";?> value="CCMP">AES</option>
484
			<option <? if ($pconfig['wpa_pairwise'] == 'TKIP') echo "selected";?> value="TKIP">TKIP</option>
485 8f71faba Espen Johansen
			</select>
486
			</td>
487
		</tr>
488
		<tr>
489
			<td valign="top" class="vncell">Key Rotation</td>
490 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";?>">
491 8f71faba Espen Johansen
			<br/>Allowed values are 1-9999 but should not be longer than Master Key Regeneration time.
492
			</td>
493
		</tr>
494
		<tr>
495
			<td valign="top" class="vncell">Master Key Regeneration</td>
496 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";?>">
497 8f71faba Espen Johansen
			<br/>Allowed values are 1-9999 but should not be shorter than Key Rotation time.
498
			</td>
499
		</tr>
500
		<tr>
501
			<td valign="top" class="vncell">Strict Key Regeneration</td>
502 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"; ?>>
503 d213185e Espen Johansen
			<br/>Setting this option will force the AP to rekey whenever a client disassociates.
504 8f71faba Espen Johansen
			</td>
505
		</tr>
506
		<tr>
507
			<td valign="top" class="vncell">Enable IEEE802.1X</td>
508 20172515 Scott Ullrich
			<td class="vtable"><input name="ieee8021x" type="checkbox" value="yes"  class="formfld" id="ieee8021x" <? if ($pconfig['ieee8021x']) echo "checked";?>>
509 d213185e Espen Johansen
			<br/>Setting this option will enable 802.1x authentication.
510 8f71faba Espen Johansen
			</td>
511
		</tr>
512 ac3f8318 Espen Johansen
<? } ?>