summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@xs4all.nl>2010-01-11 21:44:55 +0100
committerSeth Mos <seth.mos@xs4all.nl>2010-01-11 21:44:55 +0100
commit4563d12f70a4f5d03fabeaffe4c64c409c5acb0e (patch)
tree388fce4d29ebaccc7291dd8a054fd5a31d836445
parent981a2fbeb429264e3bf6031ee5a1f4f184850b7f (diff)
downloadpfsense-4563d12f70a4f5d03fabeaffe4c64c409c5acb0e.zip
pfsense-4563d12f70a4f5d03fabeaffe4c64c409c5acb0e.tar.gz
Make get_real_interface return real interface enc0 for "ipsec". Refactor enable_rrd_graphing() to
use get_configured_interface_with_descr()
-rw-r--r--etc/inc/interfaces.inc1
-rw-r--r--etc/inc/rrd.inc26
2 files changed, 5 insertions, 22 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index dbfbe3e..64d7ca7 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -2323,6 +2323,7 @@ function get_real_interface($interface = "wan") {
case "openvpn":
$wanif = "openvpn";
break;
+ case "ipsec":
case "enc0":
$wanif = "enc0";
break;
diff --git a/etc/inc/rrd.inc b/etc/inc/rrd.inc
index 76aac89..fa0500f 100644
--- a/etc/inc/rrd.inc
+++ b/etc/inc/rrd.inc
@@ -249,33 +249,15 @@ function enable_rrd_graphing() {
$rrdupdatesh .= "";
$i = 0;
- $vfaces = array (
- "vlan.?*",
- "enc.?*"
- );
- $ifdescrs = get_interface_list(true, true, $vfaces);
- $ifdescrs['enc0']['friendly'] = "ipsec";
- $ifdescrs['enc0']['descr'] = "IPsec";
- $ifdescrs['enc0']['up'] = true;
-
- foreach ($ifdescrs as $realif => $ifdescr) {
- $ifname = $ifdescr['friendly'];
- $state = $ifdescr['up'];
+ $ifdescrs = get_configured_interface_with_descr();
+ $ifdescrs['ipsec'] = "IPsec";
+
+ foreach ($ifdescrs as $ifname => $ifdescr) {
$temp = get_real_interface($ifname);
if($temp <> "") {
$realif = $temp;
}
- /* skip interfaces that do not have a friendly name */
- if ("$ifname" == "") {
- continue;
- }
-
- /* or are down */
- if (!$state) {
- continue;
- }
-
/* TRAFFIC, set up the rrd file */
if (!file_exists("$rrddbpath$ifname$traffic")) {
$rrdcreate = "$rrdtool create $rrddbpath$ifname$traffic --step $rrdtrafficinterval ";
OpenPOWER on IntegriCloud