summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@xs4all.nl>2007-09-17 18:54:43 +0000
committerSeth Mos <seth.mos@xs4all.nl>2007-09-17 18:54:43 +0000
commitd9fc93d10881ee77dda477482eed78882cc0a533 (patch)
tree0c46afe9e5037bb3dc519f3e2cd03872df2b08d5
parentc565529f747c45212aac86a3fbf15587b1a27bcb (diff)
downloadpfsense-d9fc93d10881ee77dda477482eed78882cc0a533.zip
pfsense-d9fc93d10881ee77dda477482eed78882cc0a533.tar.gz
MFC RELENG_1. Show the IPSEC interface as a option for the traffic graph.
-rw-r--r--usr/local/www/ifstats.php14
-rwxr-xr-xusr/local/www/status_graph.php9
2 files changed, 15 insertions, 8 deletions
diff --git a/usr/local/www/ifstats.php b/usr/local/www/ifstats.php
index 96e7acd..dec8e8c 100644
--- a/usr/local/www/ifstats.php
+++ b/usr/local/www/ifstats.php
@@ -53,7 +53,12 @@
$ifinfo['status'] = "up";
}
- if (!strstr($ifinfo['if'],'tun')) {
+ if(preg_match("/^enc|^tun/i", $ifinfo['if'])) {
+ $ifinfo['inpkts'] = $linkinfo[3];
+ $ifinfo['inbytes'] = $linkinfo[5];
+ $ifinfo['outpkts'] = $linkinfo[6];
+ $ifinfo['outbytes'] = $linkinfo[8];
+ } else {
$ifinfo['macaddr'] = $linkinfo[3];
$ifinfo['inpkts'] = $linkinfo[4];
$ifinfo['inerrs'] = $linkinfo[5];
@@ -62,11 +67,6 @@
$ifinfo['outerrs'] = $linkinfo[8];
$ifinfo['outbytes'] = $linkinfo[9];
$ifinfo['collisions'] = $linkinfo[10];
- } else {
- $ifinfo['inpkts'] = $linkinfo[3];
- $ifinfo['inbytes'] = $linkinfo[5];
- $ifinfo['outpkts'] = $linkinfo[6];
- $ifinfo['outbytes'] = $linkinfo[8];
}
$temp = gettimeofday();
@@ -74,4 +74,4 @@
echo "$timing|" . $ifinfo['inbytes'] . "|" . $ifinfo['outbytes'] . "\n";
-?> \ No newline at end of file
+?>
diff --git a/usr/local/www/status_graph.php b/usr/local/www/status_graph.php
index 1ae4153..4c87ba4 100755
--- a/usr/local/www/status_graph.php
+++ b/usr/local/www/status_graph.php
@@ -44,6 +44,9 @@ if ($_POST['height'])
else
$height = "275";
+/* link the ipsec interface magically */
+$config['interfaces']['ipsec']['if'] = "enc0";
+
if ($_GET['if']) {
$curif = $_GET['if'];
$ifnum = $config['interfaces'][$curif]['if'];
@@ -63,9 +66,13 @@ include("head.inc");
<?php
$ifdescrs = array('wan' => 'WAN', 'lan' => 'LAN');
-for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) {
+for ($j = 1; isset($config['interfaces']['opt' . $j]['enable']); $j++) {
$ifdescrs['opt' . $j] = $config['interfaces']['opt' . $j]['descr'];
}
+if((isset($config['ipsec']['enable'])) || (isset($config['ipsec']['mobileclients']['enable']))) {
+ $ifdescrs['ipsec'] = "IPSEC";
+}
+
?>
<form name="form1" action="status_graph.php" method="get" style="padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1px solid #999999">
Interface:
OpenPOWER on IntegriCloud