diff options
author | Seth Mos <seth.mos@xs4all.nl> | 2007-08-30 19:25:23 +0000 |
---|---|---|
committer | Seth Mos <seth.mos@xs4all.nl> | 2007-08-30 19:25:23 +0000 |
commit | c1abd446e2a96ad48a3d477d0f24ff5bbd8ae097 (patch) | |
tree | ea6baba83f16823b4401e626939988ecb352beb3 /usr/local/www | |
parent | 6ec0830d2be0592fdc35a4a9356e03c55d492afd (diff) | |
download | pfsense-c1abd446e2a96ad48a3d477d0f24ff5bbd8ae097.zip pfsense-c1abd446e2a96ad48a3d477d0f24ff5bbd8ae097.tar.gz |
Show the ipsec interface
Diffstat (limited to 'usr/local/www')
-rw-r--r-- | usr/local/www/ifstats.php | 15 | ||||
-rwxr-xr-x | usr/local/www/status_graph.php | 9 |
2 files changed, 15 insertions, 9 deletions
diff --git a/usr/local/www/ifstats.php b/usr/local/www/ifstats.php index 96e7acd..ce03832 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,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"; -?>
\ 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: |