Commit 21803172 authored by Franco Fichtner's avatar Franco Fichtner

interface: new home for old mac table load

This needs to be ported to the python backend table, because
this code requires nmap to be installed...
parent 33853a10
......@@ -5298,3 +5298,30 @@ function get_ppp_uptime($port)
return $total_time;
}
}
/****f* legacy/load_mac_manufacturer_table
* NAME
* load_mac_manufacturer_table
* INPUTS
* none
* RESULT
* returns associative array with MAC-Manufacturer pairs
******/
function load_mac_manufacturer_table() {
/* load MAC-Manufacture data from the file */
$macs = false;
if (file_exists("/usr/local/share/nmap/nmap-mac-prefixes")) {
$macs=file("/usr/local/share/nmap/nmap-mac-prefixes");
}
if ($macs){
foreach ($macs as $line){
if (preg_match('/([0-9A-Fa-f]{6}) (.*)$/', $line, $matches)){
/* store values like this $mac_man['000C29']='VMware' */
$mac_man["$matches[1]"]=$matches[2];
}
}
return $mac_man;
} else {
return -1;
}
}
......@@ -577,34 +577,6 @@ function xml2array($contents, $get_attributes = 1, $priority = 'tag')
return ($xml_array);
}
/****f* legacy/load_mac_manufacturer_table
* NAME
* load_mac_manufacturer_table
* INPUTS
* none
* RESULT
* returns associative array with MAC-Manufacturer pairs
******/
function load_mac_manufacturer_table() {
/* load MAC-Manufacture data from the file */
$macs = false;
if (file_exists("/usr/local/share/nmap/nmap-mac-prefixes")) {
$macs=file("/usr/local/share/nmap/nmap-mac-prefixes");
}
if ($macs){
foreach ($macs as $line){
if (preg_match('/([0-9A-Fa-f]{6}) (.*)$/', $line, $matches)){
/* store values like this $mac_man['000C29']='VMware' */
$mac_man["$matches[1]"]=$matches[2];
}
}
return $mac_man;
} else {
return -1;
}
}
/****f* legacy/is_ipaddr_configured
* NAME
* is_ipaddr_configured
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment