');
echo('
Device | Router Id | Status | ABR | ASBR | Areas | Ports | Neighbours |
');
#### Loop Instances
while ($instance = mysql_fetch_assoc($query))
{
if (!is_integer($i_i/2)) { $instance_bg = $list_colour_a; } else { $instance_bg = $list_colour_b; }
$device = device_by_id_cache($instance['device_id']);
$area_count = dbFetchCell("SELECT COUNT(*) FROM `ospf_areas` WHERE `device_id` = '".$device['device_id']."'");
$port_count = dbFetchCell("SELECT COUNT(*) FROM `ospf_ports` WHERE `device_id` = '".$device['device_id']."'");
$port_count_enabled = dbFetchCell("SELECT COUNT(*) FROM `ospf_ports` WHERE `ospfIfAdminStat` = 'enabled' AND `device_id` = '".$device['device_id']."'");
$neighbour_count = dbFetchCell("SELECT COUNT(*) FROM `ospf_nbrs` WHERE `device_id` = '".$device['device_id']."'");
$ip_query = "SELECT * FROM ipv4_addresses AS A, ports AS I WHERE ";
$ip_query .= "(A.ipv4_address = ? AND I.interface_id = A.interface_id)";
$ip_query .= " AND I.device_id = ?";
$ipv4_host = dbFetchArray($ip_query, array($peer['bgpPeerIdentifier'], $device['device_id']));
if ($instance['ospfAdminStat'] == "enabled") { $enabled = 'enabled'; } else { $enabled = 'disabled'; }
if ($instance['ospfAreaBdrRtrStatus'] == "true") { $abr = 'yes'; } else { $abr = 'no'; }
if ($instance['ospfASBdrRtrStatus'] == "true") { $asbr = 'yes'; } else { $asbr = 'no'; }
echo('');
echo(' '.generate_device_link($device, 0, "routing/ospf/"). ' | ');
echo(' '.$instance['ospfRouterId'] . ' | ');
echo(' ' . $enabled . ' | ');
echo(' ' . $abr . ' | ');
echo(' ' . $asbr . ' | ');
echo(' ' . $area_count . ' | ');
echo(' ' . $port_count . '('.$port_count_enabled.') | ');
echo(' ' . $neighbour_count . ' | ');
echo('
');
$i_i++;
} ### End loop instances
echo('');
?>