diff options
author | Seth Mos <seth.mos@xs4all.nl> | 2009-11-26 21:49:11 +0100 |
---|---|---|
committer | Seth Mos <seth.mos@xs4all.nl> | 2009-11-26 22:02:32 +0100 |
commit | 818a6b7d78f1e796e06d30f43f312b99d640c2ea (patch) | |
tree | 2b198d461e12b4d3cac0466e8f3c2c7f8ff0f833 /etc | |
parent | f9fc88cc889997eb66884ccd50ad789be21764b5 (diff) | |
download | pfsense-818a6b7d78f1e796e06d30f43f312b99d640c2ea.zip pfsense-818a6b7d78f1e796e06d30f43f312b99d640c2ea.tar.gz |
Make sure to get the wireless status from the correct interface.
Add support for the rssi, rate and base station mac.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/pfsense-utils.inc | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 35cefab..b8fd5d4 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -1268,7 +1268,12 @@ function get_interface_info($ifdescr) { if ($ifinfo['status'] == "up") { /* try to determine media with ifconfig */ unset($ifconfiginfo); - exec("/sbin/ifconfig " . $ifinfo['hwif'], $ifconfiginfo); + exec("/sbin/ifconfig " . $ifinfo['if'], $ifconfiginfo); + $wifconfiginfo = array(); + if(is_interface_wireless($ifdescr)) { + exec("/sbin/ifconfig {$ifinfo['if']} list sta", $wifconfiginfo); + array_shift($wifconfiginfo); + } $matches = ""; foreach ($ifconfiginfo as $ici) { @@ -1298,6 +1303,19 @@ function get_interface_info($ifdescr) { $ifinfo['ssid'] = $matches[1]; } } + foreach($wifconfiginfo as $ici) { + $elements = preg_split("/[ ]+/i", $ici); + if ($elements[0] != "") { + $ifinfo['bssid'] = $elements[0]; + } + if ($elements[3] != "") { + $ifinfo['rate'] = $elements[3]; + } + if ($elements[4] != "") { + $ifinfo['rssi'] = $elements[4]; + } + + } /* lookup the gateway */ if (interface_has_gateway($if)) $ifinfo['gateway'] = get_interface_gateway($if); |