summaryrefslogtreecommitdiff
path: root/cesar
diff options
context:
space:
mode:
authorNicolas Schodet2012-03-14 16:16:13 +0100
committerNicolas Schodet2012-03-15 10:25:20 +0100
commit67b0bd1d44ce0a3ae342dee59907431942c7af9a (patch)
treeea6e570e7de70612658af63e4a315b52f1e97d1a /cesar
parent7d17b10059093fe6a9b3b46740cb6016a0bd1aa3 (diff)
cesar/maximus/python: describe MAC address format used in utils.macaddr
Diffstat (limited to 'cesar')
-rw-r--r--cesar/maximus/python/maximus/utils/macaddr.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/cesar/maximus/python/maximus/utils/macaddr.py b/cesar/maximus/python/maximus/utils/macaddr.py
index ac47614996..cd69635b30 100644
--- a/cesar/maximus/python/maximus/utils/macaddr.py
+++ b/cesar/maximus/python/maximus/utils/macaddr.py
@@ -1,6 +1,14 @@
+"""Various MAC address manipulation functions.
+
+Canonical MAC address used by this module is defined as:
+
+ xx:xx:xx:xx:xx:xx
+
+Where x is a lowercase hexadecimal digit.
+"""
def hex_to_mac_addr (data):
- """Convert a hexadecimal Mac Address to a string Mac address like xx:xx:xx:xx:xx:xx."""
+ """Unpack MAC address from a 6 byte data."""
from struct import unpack
address = unpack (6 * 'B', data)
return ':'.join ('%02x' % a for a in address)