summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)