diff options
author | Colin Smith <colin@pfsense.org> | 2005-07-14 04:23:55 +0000 |
---|---|---|
committer | Colin Smith <colin@pfsense.org> | 2005-07-14 04:23:55 +0000 |
commit | 730768f7a5711b753cf93c6b52f22c5cf07cc2e2 (patch) | |
tree | c4521e8256f0a441cc5528bd80f0c989e38c6a60 /etc | |
parent | 2dfb79a48b628845df6047a26bfab1fc66b1ccc5 (diff) | |
download | pfsense-730768f7a5711b753cf93c6b52f22c5cf07cc2e2.zip pfsense-730768f7a5711b753cf93c6b52f22c5cf07cc2e2.tar.gz |
Add generate_random_mac().
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/pfsense-utils.inc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index b92602e..eece269 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -958,5 +958,11 @@ function display_topbar($text = "", $bg_color="#990000", $replace_color="#FFFFFF echo "Rounded(\"div#topbar\",\"top\",\"{$replace_color}\",\"{$bg_color}\",\"{$rounding_style}\");\n"; echo "</script>"; } - -?>
\ No newline at end of file + +function generate_random_mac() { + for($i = 0; $i < 6; $i++) { + $mac .= dechex(rand(16, 255)) . ':'; + } + return $mac; +} +?> |