Show the ipsec interface

This commit is contained in:
Seth Mos 2007-08-30 19:25:23 +00:00
parent 6ec0830d2b
commit c1abd446e2
2 changed files with 15 additions and 9 deletions

View File

@ -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,16 +67,10 @@
$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();
$timing = (double)$temp["sec"] + (double)$temp["usec"] / 1000000.0;
echo "$timing|" . $ifinfo['inbytes'] . "|" . $ifinfo['outbytes'] . "\n";
?>
?>

View File

@ -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: