From 18cbaad5ad490fbb3a4e9b188dd419d789f45ccb Mon Sep 17 00:00:00 2001 From: Isaku Yamahata Date: Fri, 27 Jan 2012 17:47:07 +0900 Subject: lib/mac: add helper function/values Signed-off-by: Isaku Yamahata Signed-off-by: FUJITA Tomonori --- ryu/lib/mac.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ryu/lib/mac.py b/ryu/lib/mac.py index 2dbf6e80..be4d7d60 100644 --- a/ryu/lib/mac.py +++ b/ryu/lib/mac.py @@ -14,6 +14,14 @@ # along with this program. If not, see . +DONTCARE = '\x00' * 6 +BROADCAST = '\xff' * 6 + + +def is_multicast(addr): + return bool(ord(addr[0]) & 0x01) + + def haddr_to_str(addr): return ''.join(['%02x:' % ord(char) for char in addr[0:6]])[:-1] -- cgit v1.2.3