Generalise arp discovery cache; move to common

This commit is contained in:
Paul Gear
2015-07-20 14:02:16 +10:00
parent ceeb362e40
commit 40a1cef050
3 changed files with 24 additions and 27 deletions

View File

@@ -704,25 +704,3 @@ function discover_process_ipv6(&$valid, $ifIndex, $ipv6_address, $ipv6_prefixlen
}//end if
}//end discover_process_ipv6()
// maintain a simple cache of seen IPs during ARP discovery
function arp_discovery_add_cache($ip) {
global $arp_discovery;
$arp_discovery[$ip] = true;
}//end arp_discovery_add_cache()
function arp_discovery_is_cached($ip) {
global $arp_discovery;
if (array_key_exists($ip, $arp_discovery)) {
return $arp_discovery[$ip];
}
else {
return false;
}
}//end arp_discovery_is_cached()