'); echo('Device AFI Prefixes Paths Drop Punt Punt2Host '); // Loop Instances $cef_query = 'SELECT `cef_switching`.`device_id`, `cef_switching`.`afi`, `cef_switching`.`entPhysicalIndex`, COUNT(`cef_index`) AS `paths`, SUM(`drop`) AS `drops`, SUM(`punt`) AS `punts`, SUM(`punt2host`) AS `punt2host`, `cef_pfx` FROM `cef_switching` LEFT JOIN `cef_prefix` ON `cef_switching`.`device_id` = `cef_switching`.`device_id` AND `cef_switching`.`entPhysicalIndex` = `cef_prefix`.`entPhysicalIndex` AND `cef_switching`.`afi` = `cef_prefix`.`afi` WHERE 1' . generate_query_permitted(['device'], ['device_table' => 'cef_switching']) . ' GROUP BY `cef_switching`.`device_id`, `cef_switching`.`afi`'; foreach (dbFetchRows($cef_query) as $instance) { $device = device_by_id_cache($instance['device_id']); echo(''); echo(' ' . generate_device_link($device, NULL, ['tab' => 'routing', 'proto' => 'cef']) . ''); echo ' '; if ($instance['afi'] === "ipv4") { echo 'IPv4'; } elseif ($instance['afi'] === "ipv6") { echo 'IPv6'; } else { echo $instance['afi']; } echo ''; echo(' ' . $instance['cef_pfx'] . ''); echo(' ' . $instance['paths'] . ''); echo(' ' . $instance['drops'] . ''); echo(' ' . $instance['punts'] . ''); echo(' ' . $instance['punt2host'] . ''); echo(''); } // End loop instances echo(''); echo generate_box_close(); // EOF