summaryrefslogtreecommitdiffstats
path: root/usr/local/www/load_balancer_pool_edit.php
diff options
context:
space:
mode:
Diffstat (limited to 'usr/local/www/load_balancer_pool_edit.php')
-rwxr-xr-xusr/local/www/load_balancer_pool_edit.php110
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 c4d2dc9..0b946ed 100755
--- a/usr/local/www/load_balancer_pool_edit.php
+++ b/usr/local/www/load_balancer_pool_edit.php
@@ -176,116 +176,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");
OpenPOWER on IntegriCloud