1) { $instance_id .= ' V2'; } } else { // V3 $instance_id = long2ip($instance['ospfRouterId']); if ($device_routing_count['ospfv3'] > 1) { $instance_id .= ' V3'; } } $port_count = 0; $port_count_enabled = 0; $sql = 'SELECT `ospfIfAdminStat`, COUNT(*) AS `count` FROM `ospf_ports`' . ' WHERE `device_id` = ? AND `ospfVersionNumber` = ? GROUP BY `ospfIfAdminStat`'; foreach (dbFetchRows($sql, $ospf_params) as $entry) { if ($entry['ospfIfAdminStat'] === 'enabled') { $port_count_enabled = (int)$entry['count']; } $port_count += (int)$entry['count']; } $nbr_count = dbFetchCell("SELECT COUNT(*) FROM `ospf_nbrs` WHERE `device_id` = ? AND `ospfVersionNumber` = ?", $ospf_params); if ($instance['ospfAdminStat'] === "enabled") { $enabled = 'enabled'; $row_class = 'up'; } else { $enabled = 'disabled'; $row_class = "disabled"; } if ($instance['ospfAreaBdrRtrStatus'] === "true") { $abr = 'ABR'; } else { $abr = 'no'; } if ($instance['ospfASBdrRtrStatus'] === "true") { $asbr = 'ASBR'; } else { $asbr = 'no'; } echo generate_box_open(); ?>
Router ID |
Status
">
ABR
yes
';
}
if ($instance['ospfASBdrRtrStatus'] === "true") {
echo '
ASBR
yes
Areas
Ports
Neighbours
|
Area Id | Status | Auth Type | AS External | Area LSAs | Area Summary | Ports | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
'); echo(' | ' . $area_id . ' | '); echo('' . $enabled . ' | '); echo '' . get_type_class_label($area['ospfAuthType'], 'ospfAuthType') . ' | '; echo '' . get_type_class_label($area['ospfImportAsExtern'], 'ospfImportAsExtern') . ' | '; echo '' . $area['ospfAreaLsaCount'] . ' | '; echo '' . get_type_class_label($area['ospfAreaSummary'], 'ospfAreaSummary') . ' | '; echo('' . $area_port_count . '(' . $area_port_count_enabled . ') | '); echo('||||||||||
');
/// Per-Area Ports Table
/// FIXME -- humanize_ospf_port()
echo generate_box_open();
echo('
|
Router Id | Device | IP Address | Status | |
---|---|---|---|---|
'); echo(' | ' . $nbr_router_id . ' | '); echo('' . $rtr_id . ' | '); echo('' . ip_compress($nbr['ospfNbrIpAddr']) . ' | '); echo('' . get_type_class_label($nbr['ospfNbrState'], 'ospfNbrState') . ' | '); echo('