#!/usr/local/bin/php . 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. */ $pgtitle = array("Status", "Wireless"); require("guiconfig.inc"); function get_wireless_info($wlan, $i) { global $config, $g; $ifinfo = array(); if ($wlan['mode'] != "hostap") { /* get scan list */ exec("/sbin/ifconfig -v wlan$i list scan", $scanlist); $ifinfo['scanlist'] = array(); $title = array_shift($scanlist); /* determine width of SSID field */ $ssid_fldwidth = strpos($title, "BSSID"); foreach ($scanlist as $sl) { if ($sl) { $slent = array(); $slent['ssid'] = trim(substr($sl, 0, $ssid_fldwidth)); $remflds = preg_split("/\s+/", substr($sl, $ssid_fldwidth), 6); $slent['bssid'] = $remflds[0]; $slent['channel'] = $remflds[1]; $slent['rate'] = $remflds[2]; list($slent['sig'],$slent['noise']) = explode(":", $remflds[3]); $slent['int'] = $remflds[4]; $slent['caps'] = preg_split("/\s+/", $remflds[5]); $ifinfo['scanlist'][] = $slent; } } } else { /* if in hostap mode: get associated stations */ exec("/sbin/ifconfig -v wlan$i list sta", $aslist); $ifinfo['aslist'] = array(); array_shift($aslist); foreach ($aslist as $as) { if ($as) { $asa = preg_split("/\s+/", $as); $aslent = array(); $aslent['mac'] = $asa[0]; $aslent['rate'] = str_replace("M", " Mbps", $asa[3]); $aslent['rssi'] = $asa[4]; $aslent['caps'] = $asa[8]; $aslent['flags'] = $asa[9]; $ifinfo['aslist'][] = $aslent; } } } return $ifinfo; } ?> 0): ?> 0): ?>
(SSID "")
Last scan results
SSID BSSID Channel Rate Signal Noise
(hidden)"; else echo htmlspecialchars($ss['ssid']);?>
Associated stations 0): ?>
MAC address Rate RSSI Flags Capabilities

Flags: A = authorized, E = Extended Rate (802.11g), H = HT (802.11n), P = Power save mode, Q = QoS
Capabilities: E = ESS (infrastructure mode), I = IBSS (ad-hoc mode), P = privacy (WEP/TKIP/AES), S = Short preamble, s = Short slot time No stations are associated at this time.
No supported wireless interfaces were found for status display.