'.mac_clean_to_readable($clean_mac), $device, 'interface', $interface['port_id']); } dbUpdate(array('mac_address' => $clean_mac), 'ipv4_mac', 'port_id=? AND ipv4_address=?', array($interface['port_id'], $ip)); echo '.'; } else if (isset($interface['port_id'])) { echo '+'; // echo("Add MAC $mac\n"); $insert_data = array( 'port_id' => $interface['port_id'], 'mac_address' => $clean_mac, 'ipv4_address' => $ip, ); dbInsert($insert_data, 'ipv4_mac'); }//end if }//end if }//end foreach $sql = "SELECT * from ipv4_mac AS M, ports as I WHERE M.port_id = I.port_id and I.device_id = '".$device['device_id']."'"; foreach (dbFetchRows($sql) as $entry) { $entry_mac = $entry['mac_address']; $entry_if = $entry['port_id']; if (!$mac_table[$entry_if][$entry_mac]) { dbDelete('ipv4_mac', '`port_id` = ? AND `mac_address` = ?', array($entry_if, $entry_mac)); if ($debug) { echo "Removing MAC $entry_mac from interface ".$interface['ifName']; } echo '-'; } } echo "\n"; unset($mac);