diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2007-05-30 16:32:50 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2007-05-30 16:32:50 +0000 |
commit | 9d9bac0aa57d1ec67bef2225423d89d97bb1300b (patch) | |
tree | 7528c157dca973fc345cb8dcda573315831cee1f /usr | |
parent | 490bb7f3f13d529a2a8641efb58c9698c02377e7 (diff) | |
download | pfsense-9d9bac0aa57d1ec67bef2225423d89d97bb1300b.zip pfsense-9d9bac0aa57d1ec67bef2225423d89d97bb1300b.tar.gz |
get_interface_info is now in pfsense-utils.inc. Who moved this function without testing the rest of the pages!?
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/load_balancer_pool_edit.php | 110 |
1 files changed, 0 insertions, 110 deletions
diff --git a/usr/local/www/load_balancer_pool_edit.php b/usr/local/www/load_balancer_pool_edit.php index 5af6fa0..c30b486 100755 --- a/usr/local/www/load_balancer_pool_edit.php +++ b/usr/local/www/load_balancer_pool_edit.php @@ -163,116 +163,6 @@ if ($_POST) { } } -function get_interface_info($ifdescr) { - - global $config, $linkinfo, $netstatrninfo; - - $ifinfo = array(); - - /* find out interface name */ - $ifinfo['hwif'] = $config['interfaces'][$ifdescr]['if']; - if ($ifdescr == "wan") - $ifinfo['if'] = get_real_wan_interface(); - else - $ifinfo['if'] = $ifinfo['hwif']; - - /* run netstat to determine link info */ - - unset($linkinfo); - exec("/usr/bin/netstat -I " . $ifinfo['hwif'] . " -nWb -f link", $linkinfo); - $linkinfo = preg_split("/\s+/", $linkinfo[1]); - if (preg_match("/\*$/", $linkinfo[0])) { - $ifinfo['status'] = "down"; - } else { - $ifinfo['status'] = "up"; - } - - /* PPPoE interface? -> get status from virtual interface */ - if (($ifdescr == "wan") && ($config['interfaces']['wan']['ipaddr'] == "pppoe")) { - unset($linkinfo); - exec("/usr/bin/netstat -I " . $ifinfo['if'] . " -nWb -f link", $linkinfo); - $linkinfo = preg_split("/\s+/", $linkinfo[1]); - if (preg_match("/\*$/", $linkinfo[0])) { - $ifinfo['pppoelink'] = "down"; - } else { - /* get PPPoE link status for dial on demand */ - $ifconfiginfo = ""; - unset($ifconfiginfo); - exec("/sbin/ifconfig " . $ifinfo['if'], $ifconfiginfo); - - $ifinfo['pppoelink'] = "up"; - - foreach ($ifconfiginfo as $ici) { - if (strpos($ici, 'LINK0') !== false) - $ifinfo['pppoelink'] = "down"; - } - } - } - - /* PPTP interface? -> get status from virtual interface */ - if (($ifdescr == "wan") && ($config['interfaces']['wan']['ipaddr'] == "pptp")) { - unset($linkinfo); - exec("/usr/bin/netstat -I " . $ifinfo['if'] . " -nWb -f link", $linkinfo); - $linkinfo = preg_split("/\s+/", $linkinfo[1]); - if (preg_match("/\*$/", $linkinfo[0])) { - $ifinfo['pptplink'] = "down"; - } else { - /* get PPTP link status for dial on demand */ - unset($ifconfiginfo); - exec("/sbin/ifconfig " . $ifinfo['if'], $ifconfiginfo); - - $ifinfo['pptplink'] = "up"; - - foreach ($ifconfiginfo as $ici) { - if (strpos($ici, 'LINK0') !== false) - $ifinfo['pptplink'] = "down"; - } - } - } - - if ($ifinfo['status'] == "up") { - /* try to determine media with ifconfig */ - $matches = ""; - - if ($ifinfo['pppoelink'] != "down" && $ifinfo['pptplink'] != "down") { - /* try to determine IP address and netmask with ifconfig */ - unset($ifconfiginfo); - exec("/sbin/ifconfig " . $ifinfo['if'], $ifconfiginfo); - - foreach ($ifconfiginfo as $ici) { - if (preg_match("/inet (\S+)/", $ici, $matches)) { - $ifinfo['ipaddr'] = $matches[1]; - } - if (preg_match("/netmask (\S+)/", $ici, $matches)) { - if (preg_match("/^0x/", $matches[1])) - $ifinfo['subnet'] = long2ip(hexdec($matches[1])); - } - } - - if ($ifdescr == "wan") { - /* run netstat to determine the default gateway */ - unset($netstatrninfo); - exec("/usr/bin/netstat -rnf inet", $netstatrninfo); - - foreach ($netstatrninfo as $nsr) { - if (preg_match("/^default\s*(\S+)/", $nsr, $matches)) { - $ifinfo['gateway'] = $matches[1]; - } - } - } else { - /* deterimine interface gateway */ - $int = convert_friendly_interface_to_real_interface_name($ifdescr); - $gw = get_interface_gateway($int); - if($gw) - $ifinfo['gateway'] = $gw; - } - } - } - - return $ifinfo; -} - - $pgtitle = "Load Balancer: Pool: Edit"; include("head.inc"); |