. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ $wlchannels = array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,36,40,42,44,48,50,52,56,58,60,64,149,152,153,157,160,161,165); function wireless_config_init() { global $optcfg, $pconfig; $pconfig['standard'] = $optcfg['wireless']['standard']; $pconfig['mode'] = $optcfg['wireless']['mode']; $pconfig['ssid'] = $optcfg['wireless']['ssid']; $pconfig['stationname'] = $optcfg['wireless']['stationname']; $pconfig['channel'] = $optcfg['wireless']['channel']; $pconfig['wep_enable'] = isset($optcfg['wireless']['wep']['enable']); if (is_array($optcfg['wireless']['wep']['key'])) { $i = 1; foreach ($optcfg['wireless']['wep']['key'] as $wepkey) { $pconfig['key' . $i] = $wepkey['value']; if (isset($wepkey['txkey'])) $pconfig['txkey'] = $i; $i++; } if (!isset($wepkey['txkey'])) $pconfig['txkey'] = 1; } } function wireless_config_post() { global $optcfg, $pconfig; unset($input_errors); /* input validation */ if ($_POST['enable']) { $reqdfields = explode(" ", "mode ssid channel"); $reqdfieldsn = explode(",", "Mode,SSID,Channel"); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); if (!$input_errors) { /* bridge check (hostap only!) */ if ($pconfig['bridge'] && ($pconfig['mode'] != "hostap")) $input_errors[] = "Bridging a wireless interface is only possible in hostap mode."; } } if (!$input_errors) { $optcfg['wireless']['standard'] = $_POST['standard']; $optcfg['wireless']['mode'] = $_POST['mode']; $optcfg['wireless']['ssid'] = $_POST['ssid']; $optcfg['wireless']['stationname'] = $_POST['stationname']; $optcfg['wireless']['channel'] = $_POST['channel']; $optcfg['wireless']['wep']['enable'] = $_POST['wep_enable'] ? true : false; $optcfg['wireless']['wep']['key'] = array(); for ($i = 1; $i <= 4; $i++) { if ($_POST['key' . $i]) { $newkey = array(); $newkey['value'] = $_POST['key' . $i]; if ($_POST['txkey'] == $i) $newkey['txkey'] = true; $optcfg['wireless']['wep']['key'][] = $newkey; } } } return $input_errors; } function wireless_config_print() { global $optcfg, $pconfig, $wlchannels; ?> Wireless configuration Standard Mode
Note: IBSS mode is sometimes also called "ad-hoc" mode;
BSS mode is also known as "infrastructure" mode SSID Channel
Note: Not all channels may be supported by your card Station name
Hint: this field can usually be left blank WEP > Enable WEP
     TX key 
Key 1:   >
Key 2:   >
Key 3:   >
Key 4:   >

40 (64) bit keys may be entered as 5 ASCII characters or 10 hex digits preceded by '0x'.
104 (128) bit keys may be entered as 13 ASCII characters or 26 hex digits preceded by '0x'.