[Zrouter-src] ZRouter.org: push to ZRouter profiles/lua_web_ui/files/etc/www/l...

zrouter-src at zrouter.org zrouter-src at zrouter.org
Mon Sep 24 11:23:53 UTC 2012


details:   http://zrouter.org/hg/zrouter//rev/5da49dd0da64
changeset: 470:5da49dd0da64
user:      Aleksandr Rybalko <ray at ddteam.net>
date:      Mon Sep 24 14:22:05 2012 +0300
description:
MAC address calculation helper.

diffstat:

 profiles/lua_web_ui/files/etc/www/lib/macaddr.lua |  13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diffs (17 lines):

diff -r e895670bc057 -r 5da49dd0da64 profiles/lua_web_ui/files/etc/www/lib/macaddr.lua
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/profiles/lua_web_ui/files/etc/www/lib/macaddr.lua	Mon Sep 24 14:22:05 2012 +0300
@@ -0,0 +1,13 @@
+function tohex(pref, ar, f, t)
+        x = 0;
+        for i=f,t do
+    		x = x * 0x100; x = x + ar:byte(i);
+    	end
+    	io.write(string.format(pref .. '=0x%06x\n', x));
+end
+
+ar = io.read("*all");
+tohex('VENDOR', ar, 1, 3);
+tohex('DEVICE', ar, 4, 6);
+
+


More information about the Zrouter-src mailing list