$entry) { $vlan_num = $entry['hwL2IfPVID']; $ifIndex = $entry['hwL2IfPortIfIndex']; //$port_type = (isset($entry['hwL2IfActivePortType'])) ? $entry['hwL2IfActivePortType'] : $entry['hwL2IfPortType']; $port_type = $entry['hwL2IfPortType']; switch ($port_type) { case 'trunk': $trunk = 'dot1Q'; break; case 'qinq': $trunk = 'QinQ'; break; case 'hybrid': case 'fabric': $trunk = $port_type; break; case 'invalid': // Skip invalid Vlan 0 continue 2; default: $trunk = ''; } $vlan_rows[] = array($ifIndex, $vlan_num, $trunk); // Set Vlan and Trunk if (isset($port_stats[$ifIndex])) { $port_stats[$ifIndex]['ifVlan'] = $vlan_num; $port_stats[$ifIndex]['ifTrunk'] = $trunk; } } } $headers = array('%WifIndex%n', '%WVlan%n', '%WTrunk%n'); print_cli_table($vlan_rows, $headers); //$process_port_functions[$port_module] = $GLOBALS['snmp_status']; // Additional db fields for update //$process_port_db[$port_module][] = 'ifVlan'; //$process_port_db[$port_module][] = 'ifTrunk'; // EOF