diff options
author | Isaku Yamahata <yamahata@valinux.co.jp> | 2012-01-27 17:47:07 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2012-01-29 03:30:39 +0900 |
commit | 18cbaad5ad490fbb3a4e9b188dd419d789f45ccb (patch) | |
tree | 296b90b6fc054fdefd4fda3178098fbc816a2731 | |
parent | 326eb1d8395727aaeadcfbc55852d90837cfb2cc (diff) |
lib/mac: add helper function/values
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/lib/mac.py | 8 |
1 files changed, 8 insertions, 0 deletions
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 <http://www.gnu.org/licenses/>. +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] |