update ipsectunnels to work again

git-svn-id: http://www.observium.org/svn/observer/trunk@3236 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2012-05-24 21:22:41 +00:00
parent 2015755950
commit 9dc57f7dae
2 changed files with 34 additions and 24 deletions

View File

@@ -1,5 +1,10 @@
<?php <?php
$link_array = array('page' => 'device',
'device' => $device['device_id'],
'tab' => 'routing',
'proto' => 'ipsec_tunnels');
print_optionbar_start(); print_optionbar_start();
echo("<span style='font-weight: bold;'>IPSEC Tunnels</span> &#187; "); echo("<span style='font-weight: bold;'>IPSEC Tunnels</span> &#187; ");
@@ -7,36 +12,41 @@ echo("<span style='font-weight: bold;'>IPSEC Tunnels</span> &#187; ");
$menu_options = array('basic' => 'Basic', $menu_options = array('basic' => 'Basic',
); );
if(!isset($vars['view'])) { $vars['view'] = "basic"; }
echo("<span style='font-weight: bold;'>VRFs</span> &#187; ");
$menu_options = array('basic' => 'Basic',
# 'detail' => 'Detail',
);
if (!$_GET['opta']) { $_GET['opta'] = "basic"; } if (!$_GET['opta']) { $_GET['opta'] = "basic"; }
$sep = ""; $sep = "";
foreach ($menu_options as $option => $text) foreach ($menu_options as $option => $text)
{ {
if ($_GET['optd'] == $option) { echo("<span class='pagemenu-selected'>"); } if ($vars['view'] == $option) { echo("<span class='pagemenu-selected'>"); }
echo('<a href="device/device=' . $device['device_id'] . '/tab=routing/proto=ipsec_tunnels/' . $option . '/">' . $text echo(generate_link($text, $link_array,array('view'=>$option)));
. '</a>'); if ($vars['view'] == $option) { echo("</span>"); }
if ($_GET['optd'] == $option) { echo("</span>"); }
echo(" | "); echo(" | ");
} }
unset($sep);
echo(' Graphs: '); echo(' Graphs: ');
$graph_types = array("bits" => "Bits", $graph_types = array("bits" => "Bits",
"pkts" => "Packets", "pkts" => "Packets");
"errors" => "Errors");
foreach ($graph_types as $type => $descr) foreach ($graph_types as $type => $descr)
{ {
echo("$type_sep"); echo("$type_sep");
if ($_GET['opte'] == $type) { echo("<span class='pagemenu-selected'>"); } if ($vars['graph'] == $type) { echo("<span class='pagemenu-selected'>"); }
echo('<a href="device/device=' . $device['device_id'] . '/tab=routing/proto=ipsec_tunnels/graphs/'.$type.'/">'.$descr.'</a>'); echo(generate_link($descr, $link_array,array('view'=>'graphs','graph'=>$type)));
if ($_GET['opte'] == $type) { echo("</span>"); } if ($vars['graph'] == $type) { echo("</span>"); }
$type_sep = " | "; $type_sep = " | ";
} }
print_optionbar_end(); print_optionbar_end();
echo("<div style='margin: 5px;'><table border=0 cellspacing=0 cellpadding=0 width=100%>"); echo("<div style='margin: 5px;'><table border=0 cellspacing=0 cellpadding=0 width=100%>");
@@ -53,19 +63,19 @@ echo("<td width=320 class=list-large>" . $tunnel['local_addr'] . " &#187; " .
echo("<td width=150 class=box-desc>" . $tunnel['tunnel_name'] . "</td>"); echo("<td width=150 class=box-desc>" . $tunnel['tunnel_name'] . "</td>");
echo("<td width=100 class=list-large><span class='".$tunnel_class."'>" . $tunnel['tunnel_status'] . "</span></td>"); echo("<td width=100 class=list-large><span class='".$tunnel_class."'>" . $tunnel['tunnel_status'] . "</span></td>");
echo("</tr>"); echo("</tr>");
if ($_GET['optd'] == "graphs") if (isset($vars['graph']))
{ {
echo('<tr class="list-bold">'); echo('<tr class="list-bold">');
echo("<td colspan = 3>"); echo("<td colspan = 3>");
$graph_type = "ipsectunnel_" . $_GET['opte']; $graph_type = "ipsectunnel_" . $vars['graph'];
$graph_array['height'] = "100"; $graph_array['height'] = "100";
$graph_array['width'] = "215"; $graph_array['width'] = "215";
$graph_array['to'] = $config['time']['now']; $graph_array['to'] = $config['time']['now'];
$graph_array['id'] = $tunnel['tunnel_id']; $graph_array['id'] = $tunnel['tunnel_id'];
$graph_array['type'] = $graph_type; $graph_array['type'] = $graph_type;
include("includes/print-graphrow.inc.php"); include("includes/print-graphrow.inc.php");
echo(" echo("
</td> </td>

View File

@@ -242,7 +242,7 @@ foreach ($ports as $port)
{ {
$this_port['ifVlan'] = $this_port['dot1qPvid']; $this_port['ifVlan'] = $this_port['dot1qPvid'];
} }
# FIXME use $q_bridge_mib[$this_port['ifIndex'] to see if it is a trunk (>1 array count) # FIXME use $q_bridge_mib[$this_port['ifIndex']] to see if it is a trunk (>1 array count)
echo("VLAN == ".$this_port['ifVlan']); echo("VLAN == ".$this_port['ifVlan']);