summaryrefslogtreecommitdiffstats
path: root/etc/inc/pfsense-utils.inc
diff options
context:
space:
mode:
authorVinicius Coque <vinicius.coque@bluepex.com>2011-05-23 15:57:23 -0300
committerVinicius Coque <vinicius.coque@bluepex.com>2011-05-23 15:57:23 -0300
commit45d4b71e070a52bec9e14a82d2656f0e7af07ba1 (patch)
treed238e7d6506d339c6da27c3a9e56e407c1b869c1 /etc/inc/pfsense-utils.inc
parentd21d6e2090c6701041b8555cdaca9ad2c949d4f1 (diff)
parent7a18dfa4ed218ad7b114d9cd52c008a76c811614 (diff)
downloadpfsense-45d4b71e070a52bec9e14a82d2656f0e7af07ba1.zip
pfsense-45d4b71e070a52bec9e14a82d2656f0e7af07ba1.tar.gz
Merge remote-tracking branch 'mainline/master' into inc
Diffstat (limited to 'etc/inc/pfsense-utils.inc')
-rw-r--r--etc/inc/pfsense-utils.inc44
1 files changed, 35 insertions, 9 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index a6a9c58..b2897dd 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -708,14 +708,14 @@ function call_pfsense_method($method, $params, $timeout = 0) {
$proxyport = 0;
$proxyuser = "";
$proxypass = "";
- if (!empty($config['system']['httpproxy']))
- $proxyurl = $config['system']['httpproxy'];
- if (!empty($config['system']['httpproxyport']) && is_numeric($config['system']['httpproxyport']))
- $proxyport = $config['system']['httpproxyport'];
- if (!empty($config['system']['httpproxyuser']))
- $proxyuser = $config['system']['httpproxyuser'];
- if (!empty($config['system']['httpproxypass']))
- $proxypass = $config['system']['httpproxypass'];
+ if (!empty($config['system']['proxyurl']))
+ $proxyurl = $config['system']['proxyurl'];
+ if (!empty($config['system']['proxyport']) && is_numeric($config['system']['proxyport']))
+ $proxyport = $config['system']['proxyport'];
+ if (!empty($config['system']['proxyuser']))
+ $proxyuser = $config['system']['proxyuser'];
+ if (!empty($config['system']['proxypass']))
+ $proxypass = $config['system']['proxypass'];
$cli = new XML_RPC_Client($xmlrpc_path, $xmlrpc_base_url, $port, $proxyurl, $proxyport, $proxyuser, $proxypass);
// If the ALT PKG Repo has a username/password set, use it.
if($config['system']['altpkgrepo']['username'] &&
@@ -1471,7 +1471,7 @@ function download_file_with_progress_bar($url_file, $destination_file, $readbody
curl_setopt($ch, CURLOPT_PROXYPORT, $config['system']['proxyport']);
if (!empty($config['system']['proxyuser']) && !empty($config['system']['proxypass'])) {
@curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_ANY | CURLAUTH_ANYSAFE);
- curl_setopt($ch, CURLOPT_PROXYUSERPASS, "{$config['system']['proxyuser']}:{$config['system']['proxypass']}");
+ curl_setopt($ch, CURLOPT_PROXYUSERPWD, "{$config['system']['proxyuser']}:{$config['system']['proxypass']}");
}
}
@@ -2181,4 +2181,30 @@ 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 = 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;
+
+}
+
?>
OpenPOWER on IntegriCloud