"") $if = $_GET['if']; $ciflist = get_configured_interface_with_descr(); if(empty($if)) { /* Find the first interface that is wireless */ foreach($ciflist as $interface => $ifdescr) { if(is_interface_wireless(get_real_interface($interface))) { $if = $interface; break; } } } ?>
$ifdescr) { if (is_interface_wireless(get_real_interface($interface))) { $enabled = false; if($if == $interface) $enabled = true; $tab_array[] = array(gettext("Status") . " ({$ifdescr})", $enabled, "status_wireless.php?if={$interface}"); } } $rwlif = get_real_interface($if); if($_POST['rescanwifi'] <> "") { mwexec_bg("/sbin/ifconfig {$rwlif} scan 2>&1"); $savemsg = gettext("Rescan has been initiated in the background. Refresh this page in 10 seconds to see the results."); } if ($savemsg) print_info_box($savemsg); display_top_tabs($tab_array); ?>
\n"; print "\n"; print "\n"; print "\n"; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print "\n\n"; exec("/sbin/ifconfig {$rwlif} list scan 2>&1", $states, $ret); /* Skip Header */ array_shift($states); $counter=0; foreach($states as $state) { /* Split by Mac address for the SSID Field */ $split = preg_split("/([0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f])/i", $state); preg_match("/([0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f])/i", $state, $bssid); $ssid = $split[0]; $bssid = $bssid[0]; /* Split the rest by using spaces for this line using the 2nd part */ $split = preg_split("/[ ]+/i", $split[1]); $channel = $split[1]; $rate = $split[2]; $rssi = $split[3]; $int = $split[4]; $caps = "$split[5] $split[6] $split[7] $split[8] $split[9] $split[10] $split[11] "; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print "\n"; } print "

" . gettext("Nearby access points or ad-hoc peers") . ".
SSIDBSSIDCHANRATERSSIINTCAPS
{$ssid}{$bssid}{$channel}{$rate}{$rssi}{$int}{$caps}
"; /* table header */ print "\n"; print "\n"; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print "\n\n"; $states = array(); exec("/sbin/ifconfig {$rwlif} list sta 2>&1", $states, $ret); array_shift($states); $counter=0; foreach($states as $state) { $split = preg_split("/[ ]+/i", $state); /* Split the rest by using spaces for this line using the 2nd part */ print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print "\n"; } /* XXX: what stats to we get for adhoc mode? */ ?>
" . gettext("Associated or ad-hoc peers") . "
ADDRAIDCHANRATERSSIIDLETXSEQRXSEQCAPSERP
{$split[0]}{$split[1]}{$split[2]}{$split[3]}{$split[4]}{$split[5]}{$split[6]}{$split[7]}{$split[8]}{$split[9]}

Flags: A = authorized, E = Extended Rate (802.11g), P = Power save mode
Capabilities: E = ESS (infrastructure mode), I = IBSS (ad-hoc mode), P = privacy (WEP/TKIP/AES), S = Short preamble, s = Short slot time