From 57f2840e1faacf50b1a93d7954bb576eca77475b Mon Sep 17 00:00:00 2001 From: Evgeny Date: Wed, 24 Nov 2010 01:06:06 -0500 Subject: MAC prefix to vendor resolution at Status->Interfaces, Status->DHCP leases, Diagnostics->ARP table --- etc/inc/pfsense-utils.inc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'etc/inc/pfsense-utils.inc') diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index be174af..5e676db 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -2181,4 +2181,28 @@ function filter_rules_compare($a, $b) { return compare_interface_friendly_names($a['interface'], $b['interface']); } +/****f* pfsense-utils/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=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']='VMW=ware' */ + $mac_man["$matches[1]"]=$matches[2]; + } + } + return $mac_man; + } else + return -1; + +} + ?> -- cgit v1.1 From 4450527f90d05a6d267ed376e968935ed99382e8 Mon Sep 17 00:00:00 2001 From: Evgeny Date: Wed, 24 Nov 2010 01:11:03 -0500 Subject: Fix small typo --- etc/inc/pfsense-utils.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'etc/inc/pfsense-utils.inc') diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 5e676db..255691a 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -2195,7 +2195,7 @@ function load_mac_manufacturer_table() { if ($macs){ foreach ($macs as $line){ if (preg_match('/([0-9A-Fa-f]{6}) (.*)$/', $line, $matches)){ - /* store values like this $mac_man['000C29']='VMW=ware' */ + /* store values like this $mac_man['000C29']='VMware' */ $mac_man["$matches[1]"]=$matches[2]; } } -- cgit v1.1