diff options
author | Ermal Luçi <eri@pfsense.org> | 2009-03-22 23:19:40 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2009-03-22 23:19:40 +0000 |
commit | f2ba47f8daf76bcbdf62f77ab7e89776eb6314cf (patch) | |
tree | d1fa8b1145a845d5dba091b00eaab61327dfebf0 /etc/inc/pfsense-utils.inc | |
parent | 82ef398ab3b2250ae80f01cf267eebe2ba64aaf0 (diff) | |
download | pfsense-f2ba47f8daf76bcbdf62f77ab7e89776eb6314cf.zip pfsense-f2ba47f8daf76bcbdf62f77ab7e89776eb6314cf.tar.gz |
* Keep only one function to return the mac address
* Bring the mac address function to interfaces.inc its the only consumer of those.
Diffstat (limited to 'etc/inc/pfsense-utils.inc')
-rw-r--r-- | etc/inc/pfsense-utils.inc | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 188df75..9d6403d 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -826,23 +826,6 @@ function log_error($error) { return; } -/****f* pfsense-utils/get_interface_mac_address - * NAME - * get_interface_mac_address - Return a interfaces mac address - * INPUTS - * $interface - interface to obtain mac address from - * RESULT - * $mac - the mac address of the interface - ******/ -function get_interface_mac_address($interface) { - $mac = exec("ifconfig {$interface} | awk '/ether/ {print $2}'"); - if(is_macaddr($mac)) { - return trim($mac); - } else { - return ""; - } -} - /****f* pfsense-utils/return_dir_as_array * NAME * return_dir_as_array - Return a directory's contents as an array. @@ -2468,21 +2451,6 @@ function display_topbar($text = "", $bg_color="#990000", $replace_color="#FFFFFF echo "</script>"; } -/****f* pfsense-utils/generate_random_mac_address - * NAME - * generate_random_mac - generates a random mac address - * INPUTS - * none - * RESULT - * $mac - a random mac address - ******/ -function generate_random_mac_address() { - $mac = "02"; - for($x=0; $x<5; $x++) - $mac .= ":" . dechex(rand(16, 255)); - return $mac; -} - /****f* pfsense-utils/strncpy * NAME * strncpy - copy strings |