2009-05-11 13:58:05 +00:00
< ? php
2009-08-12 15:01:01 +00:00
if ( $_SESSION [ 'userlevel' ] >= '5' ) {
2010-02-06 00:51:49 +00:00
print_optionbar_start ();
2009-08-05 16:05:14 +00:00
echo ( "
< a href = '".$config[' base_url ']. "/vrfs/' > Basic </ a > | Graphs :
< a href = '".$config[' base_url ']. "/vrfs/bits/' > Bits </ a > |
2010-04-08 18:26:24 +00:00
< a href = '".$config[' base_url ']. "/vrfs/upkts/' > Packets </ a > |
2009-08-05 16:05:14 +00:00
< a href = '".$config[' base_url ']. "/vrfs/nupkts/' > NU Packets </ a > |
< a href = '".$config[' base_url ']. "/vrfs/errors/' > Errors </ a >
2009-08-12 15:01:01 +00:00
" );
2010-02-06 00:51:49 +00:00
print_optionbar_end ();
2009-08-05 16:05:14 +00:00
2009-05-11 13:58:05 +00:00
echo ( " <div style='margin: 5px;'><table border=0 cellspacing=0 cellpadding=5 width=100%> " );
$i = " 1 " ;
$vrf_query = mysql_query ( " SELECT * FROM `vrfs` GROUP BY `mplsVpnVrfRouteDistinguisher` " );
while ( $vrf = mysql_fetch_array ( $vrf_query )) {
if ( ! is_integer ( $i / 2 )) { $bg_colour = $list_colour_a ; } else { $bg_colour = $list_colour_b ; }
echo ( " <tr valign=top bgcolor=' $bg_colour '> " );
2009-07-31 10:53:54 +00:00
echo ( " <td width=240><a class=list-large href='vrf/ " . $vrf [ 'mplsVpnVrfRouteDistinguisher' ] . " /'> " . $vrf [ 'vrf_name' ] . " </a><br /><span class=box-desc> " . $vrf [ 'mplsVpnVrfDescription' ] . " </span></td> " );
2009-05-11 13:58:05 +00:00
echo ( " <td width=100 class=box-desc> " . $vrf [ 'mplsVpnVrfRouteDistinguisher' ] . " </td> " );
2009-08-12 15:01:01 +00:00
#echo("<td width=200 class=box-desc>" . $vrf['mplsVpnVrfDescription'] . "</td>");
2009-05-11 13:58:05 +00:00
echo ( " <td><table border=0 cellspacing=0 cellpadding=5 width=100%> " );
$devices = mysql_query ( " SELECT * FROM `vrfs` AS V, `devices` AS D WHERE `mplsVpnVrfRouteDistinguisher` = ' " . $vrf [ 'mplsVpnVrfRouteDistinguisher' ] . " ' AND D.device_id = V.device_id " );
$x = 1 ;
while ( $device = mysql_fetch_array ( $devices )) {
2009-08-12 15:01:01 +00:00
2009-05-11 13:58:05 +00:00
if ( ! is_integer ( $i / 2 )) {
if ( ! is_integer ( $x / 2 )) { $dev_colour = $list_colour_a_a ; } else { $dev_colour = $list_colour_a_b ; }
} else {
if ( ! is_integer ( $x / 2 )) { $dev_colour = $list_colour_b_b ; } else { $dev_colour = $list_colour_b_a ; }
}
2010-08-02 22:09:52 +00:00
echo ( " <tr bgcolor=' $dev_colour '><td width=150> " . generate_device_link ( $device , shorthost ( $device [ 'hostname' ])));
2009-07-31 10:53:54 +00:00
if ( $device [ 'vrf_name' ] != $vrf [ 'vrf_name' ]) { echo ( " <a href='#' onmouseover= \" return overlib('Expected Name : " . $vrf [ 'vrf_name' ] . " <br />Configured : " . $device [ 'vrf_name' ] . " ', CAPTION, '<span class=list-large>VRF Inconsistency</span>' ,FGCOLOR,'#e5e5e5', BGCOLOR, '#c0c0c0', BORDER, 5, CELLPAD, 4, CAPCOLOR, '#050505'); \" onmouseout= \" return nd(); \" > <img align=absmiddle src=images/16/exclamation.png></a> " ); }
echo ( " </td><td> " );
2010-02-20 17:22:22 +00:00
$ports = mysql_query ( " SELECT * FROM `ports` WHERE `ifVrf` = ' " . $device [ 'vrf_id' ] . " ' and device_id = ' " . $device [ 'device_id' ] . " ' " );
2009-05-11 13:58:05 +00:00
unset ( $seperator );
2009-10-12 09:48:40 +00:00
2010-02-20 17:22:22 +00:00
while ( $port = mysql_fetch_array ( $ports )) {
2009-10-12 09:48:40 +00:00
$port = array_merge ( $device , $port );
2009-08-12 15:01:01 +00:00
if ( $_GET [ 'opta' ]) {
2009-10-12 09:48:40 +00:00
$port [ 'width' ] = " 130 " ;
$port [ 'height' ] = " 30 " ;
$port [ 'from' ] = $day ;
$port [ 'to' ] = $now ;
$port [ 'bg' ] = " # " . $bg ;
2010-04-08 18:26:24 +00:00
$port [ 'graph_type' ] = " port_ " . $_GET [ 'opta' ];
2009-10-12 09:48:40 +00:00
echo ( " <div style='display: block; padding: 3px; margin: 3px; min-width: 135px; max-width:135px; min-height:75px; max-height:75px;
text - align : center ; float : left ; background - color : " . $list_colour_b_b . " ; ' >
< div style = 'font-weight: bold;' > " .makeshortif( $port['ifDescr'] ). " </ div > " );
generate_port_thumbnail ( $port );
echo ( " <div style='font-size: 9px;'> " . truncate ( short_port_descr ( $port [ 'ifAlias' ]), 22 , '' ) . " </div>
</ div > " );
2009-08-12 15:01:01 +00:00
} else {
2010-08-02 22:09:52 +00:00
echo ( $seperator . generate_port_link ( $port , makeshortif ( $port [ 'ifDescr' ])));
2009-08-12 15:01:01 +00:00
$seperator = " , " ;
}
2009-05-11 13:58:05 +00:00
}
echo ( " </td></tr> " );
$x ++ ;
2009-08-12 15:01:01 +00:00
} // End While
2009-05-11 13:58:05 +00:00
echo ( " < /table></td> " );
$i ++ ;
}
echo ( " </table></div> " );
2009-08-12 15:01:01 +00:00
} else {
include ( " includes/error-no-perm.inc.php " );
} ## End Permission if
2009-05-11 13:58:05 +00:00
?>