Vitali Kari 00b148dbd3 Add MPLS Support (#10263)
* WIP - Add MPLS Support
This introduce the generic MPLS support
- New database tables for MPLS LSPs
- actually discovery and polling on NOKIA SR OS (Timetra) devices
- new routing->MPLS HTML pages

- ToDo MPLS LSP paths table and views
Suggestions and improvements are welcome

* add db schema

* some fixes

* add path table, discovery and polling

* add path views

* add test data

* Convert MPLS module to new style
Implement a SyncsModels trait to simplify code a lot

* abs() for negative value from snmp (bug?), test data

* fix db schema

* Fix up test data, remove uneeded data in json

* fix whitespace
2019-06-06 16:12:13 -05:00

75 lines
1.7 KiB
PHP

<?php
use App\Models\BgpPeer;
use App\Models\CefSwitching;
use App\Models\Component;
use App\Models\OspfInstance;
use App\Models\Vrf;
$pagetitle[] = 'Routing';
if ($_GET['optb'] == 'graphs' || $_GET['optc'] == 'graphs') {
$graphs = 'graphs';
} else {
$graphs = 'nographs';
}
$user = Auth::user();
$routing_count = \LibreNMS\Util\ObjectCache::routing();
// $datas[] = 'overview';
// $routing_count is populated by print-menubar.inc.php
// $type_text['overview'] = "Overview";
$type_text['bgp'] = 'BGP';
$type_text['cef'] = 'CEF';
$type_text['mpls'] = 'MPLS';
$type_text['ospf'] = 'OSPF';
$type_text['vrf'] = 'VRFs';
$type_text['cisco-otv'] = 'OTV';
print_optionbar_start();
// if (!$vars['protocol']) { $vars['protocol'] = "overview"; }
echo "<span style='font-weight: bold;'>Routing</span> &#187; ";
$vars['protocol'] = basename($vars['protocol']);
$sep = '';
foreach ($routing_count as $type => $value) {
if (!$vars['protocol']) {
$vars['protocol'] = $type;
}
echo $sep;
unset($sep);
if ($vars['protocol'] == $type) {
echo '<span class="pagemenu-selected">';
}
if ($routing_count[$type]) {
echo generate_link($type_text[$type].' ('.$routing_count[$type].')', array('page' => 'routing', 'protocol' => $type));
$sep = ' | ';
}
if ($vars['protocol'] == $type) {
echo '</span>';
}
}//end foreach
print_optionbar_end();
switch ($vars['protocol']) {
case 'overview':
case 'bgp':
case 'vrf':
case 'cef':
case 'mpls':
case 'ospf':
case 'cisco-otv':
include 'includes/html/pages/routing/'.$vars['protocol'].'.inc.php';
break;
default:
echo report_this('Unknown protocol '.$vars['protocol']);
break;
}