From d0440f75a1db35bbd45ab34bb368c03645c4956a Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 20 Mar 2005 22:32:10 +0000 Subject: Import m0n0wall's 1.2b7 latest wireless changes. --- usr/local/www/interfaces_wlan.inc | 44 +++++++++++++++------ usr/local/www/status_wireless.php | 83 +++++++++++++++++++++------------------ 2 files changed, 76 insertions(+), 51 deletions(-) (limited to 'usr') diff --git a/usr/local/www/interfaces_wlan.inc b/usr/local/www/interfaces_wlan.inc index 9b3c41c..0faf3da 100755 --- a/usr/local/www/interfaces_wlan.inc +++ b/usr/local/www/interfaces_wlan.inc @@ -3,7 +3,7 @@ interfaces_wlan.inc part of m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2004 Manuel Kasper . + Copyright (C) 2003-2005 Manuel Kasper . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -28,9 +28,12 @@ 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']; @@ -70,6 +73,7 @@ function wireless_config_post() { if (!$input_errors) { + $optcfg['wireless']['standard'] = $_POST['standard']; $optcfg['wireless']['mode'] = $_POST['mode']; $optcfg['wireless']['ssid'] = $_POST['ssid']; $optcfg['wireless']['stationname'] = $_POST['stationname']; @@ -92,7 +96,7 @@ function wireless_config_post() { } function wireless_config_print() { - global $optcfg, $pconfig; + global $optcfg, $pconfig, $wlchannels; ?> @@ -100,12 +104,26 @@ function wireless_config_print() { Wireless configuration + + + Standard + + + Mode - SSID - + Channel + +
+ Note: Not all channels may be supported by your card Station name @@ -144,8 +164,8 @@ function wireless_config_print() { WEP > - Enable WEP
-   + Enable WEP +
diff --git a/usr/local/www/status_wireless.php b/usr/local/www/status_wireless.php index c87c8d6..2584067 100755 --- a/usr/local/www/status_wireless.php +++ b/usr/local/www/status_wireless.php @@ -4,7 +4,7 @@ status_wireless.php part of m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2004 Manuel Kasper . + Copyright (C) 2003-2005 Manuel Kasper . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -29,6 +29,7 @@ POSSIBILITY OF SUCH DAMAGE. */ +$pgtitle = array("Status", "Wireless"); require("guiconfig.inc"); function get_wireless_info($ifdescr) { @@ -63,15 +64,20 @@ function get_wireless_info($ifdescr) { array_shift($aslist); foreach ($aslist as $as) { if ($as) { - $asa = preg_split("/\s+/", $as); - $aslent = array(); - $aslent['mac'] = $asa[0]; - $aslent['rates'] = substr($asa[4], strpos($asa[4], "<")+1, - strpos($asa[4], ">")-strpos($asa[4], "<")-1); - $aslent['sig'] = substr($asa[5], strpos($asa[5], "=")+1); - $ifinfo['aslist'][] = $aslent; + if (preg_match("/^ap/", $as)) { + if (is_array($aslent) && count($aslent)) + $ifinfo['aslist'][] = $aslent; + $aslent = array(); + } else if (preg_match("/BSSID:\s*\[ (.*) \]/", $as, $matches)) { + $aslent['bssid'] = $matches[1]; + } else if (preg_match("/\[dBm\]:\s*\[ .* \/ (.*) \/ (.*) \]/", $as, $matches)) { + $aslent['sig'] = $matches[1]; + $aslent['noise'] = $matches[2]; + } } } + if (is_array($aslent) && count($aslent)) + $ifinfo['aslist'][] = $aslent; } return $ifinfo; @@ -81,32 +87,33 @@ function get_wireless_info($ifdescr) { -<?=gentitle("Status: Wireless");?> +<?=gentitle("pfSense webGUI");?> +
+ -

Status: Wireless

- 0): ?> + 0): ?>
   
$ifname): @@ -122,7 +129,7 @@ function get_wireless_info($ifdescr) { interface (SSID "") - -
Signal strength + Signal strength cache @@ -155,25 +162,25 @@ function get_wireless_info($ifdescr) {
Associated stations + Associated stations - - - + + + @@ -182,8 +189,6 @@ function get_wireless_info($ifdescr) {
MAC addressTX ratesSignalBSSIDSignalNoise
- + - + dBm - + dBm
-

No supported wireless interfaces were found for status display.

+No supported wireless interfaces were found for status display (only cards that use the wi[n] or ath[n] driver are supported). - - -- cgit v1.1