" . mac_clean_to_readable($clean_mac), $device, "interface", $interface['port_id']); } mysql_query($sql); echo("."); } else { echo("+"); #echo("Add MAC $mac\n"); mysql_query("INSERT INTO `ipv4_mac` (port_id, mac_address, ipv4_address) VALUES ('".$interface['port_id']."','$clean_mac','$ip')"); } } } $sql = "SELECT * from ipv4_mac AS M, ports as I WHERE M.port_id = I.port_id and I.device_id = '".$device['device_id']."'"; $query = mysql_query($sql); while ($entry = mysql_fetch_assoc($query)) { $entry_mac = $entry['mac_address']; $entry_if = $entry['port_id']; if (!$mac_table[$entry_if][$entry_mac]) { mysql_query("DELETE FROM ipv4_mac WHERE port_id = '".$entry_if."' AND mac_address = '".$entry_mac."'"); if ($debug) { echo("Removing MAC $entry_mac from interface ".$interface['ifName']); } echo("-"); } } echo("\n"); unset($mac); ?>