summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2008-10-19 13:20:32 +0000
committerErmal Luçi <eri@pfsense.org>2008-10-19 13:20:32 +0000
commit80bf3f4aace8a21a1ba307afd6db2c702b2ffc7a (patch)
treee1800e84b40bcbc3256a85291121a3d0845731bc /usr
parentf620d00d373e3d397c5f4d0904f8df654633cdea (diff)
downloadpfsense-80bf3f4aace8a21a1ba307afd6db2c702b2ffc7a.zip
pfsense-80bf3f4aace8a21a1ba307afd6db2c702b2ffc7a.tar.gz
Refactor some code so frontend does not need to know about details that might change
during development.
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/status_interfaces.php22
1 files changed, 5 insertions, 17 deletions
diff --git a/usr/local/www/status_interfaces.php b/usr/local/www/status_interfaces.php
index 2aa5482..20d01f9 100755
--- a/usr/local/www/status_interfaces.php
+++ b/usr/local/www/status_interfaces.php
@@ -42,25 +42,12 @@
require_once("guiconfig.inc");
-$wancfg = &$config['interfaces']['wan'];
-
if ($_POST) {
$interface = $_POST['interface'];
- $ifcfg = &$config['interfaces'][$interface];
if ($_POST['submit'] == "Disconnect" || $_POST['submit'] == "Release") {
- if ($ifcfg['ipaddr'] == "dhcp")
- interface_dhcp_down($interface);
- else if ($ifcfg['ipaddr'] == "pppoe")
- interface_pppoe_down($interface);
- else if ($ifcfg['ipaddr'] == "pptp")
- interface_pptp_down($interface);
+ interface_bring_down($interface);
} else if ($_POST['submit'] == "Connect" || $_POST['submit'] == "Renew") {
- if ($ifcfg['ipaddr'] == "dhcp")
- interface_dhcp_up($interface);
- else if ($ifcfg['ipaddr'] == "pppoe")
- interface_pppoe_up($interface);
- else if ($ifcfg['ipaddr'] == "pptp")
- interface_pptp_up($interface);
+ interface_configure($interface);
} else {
header("Location: index.php");
exit;
@@ -75,7 +62,7 @@ include("head.inc");
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
- <?php $ifdescrs = get_configured_interface_with_descr(false, true);
+ <?php $i = 0; $ifdescrs = get_configured_interface_with_descr(false, true);
foreach ($ifdescrs as $ifdescr => $ifname):
$ifinfo = get_interface_info($ifdescr);
?>
@@ -85,7 +72,7 @@ include("head.inc");
<tr>
<td colspan="8" class="list" height="12"></td>
</tr>
- <?php endif; ?>
+ <?php endif; ?>
<tr>
<td colspan="2" class="listtopic">
<?=htmlspecialchars($ifname);?>
@@ -226,6 +213,7 @@ include("head.inc");
$interrupt_total = "";
$interrupt_sec = "";
$real_interface = $ifinfo['hwif'];
+ /* XXX for virtual interfaces this are not the most accurate stats! */
$interrupt_total = `vmstat -i | grep $real_interface | awk '{ print $3 }'`;
$interrupt_sec = `vmstat -i | grep $real_interface | awk '{ print $4 }'`;
if(strstr($interrupt_total, "hci")) {
OpenPOWER on IntegriCloud