Allocate MAC addresses using Xensource Inc's new OUI.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
emellor@leeni.uk.xensource.com committed 2005-11-14 11:06:25 +01:00
1 parent deb1c115f9
commit f15f365867
1 file changed
+4 -4
+4 -4
View File
@@ -35,16 +35,16 @@ xroot = XendRoot.instance()
def randomMAC():
"""Generate a random MAC address.
Uses OUI (Organizationally Unique Identifier) AA:00:00, an
unassigned one that used to belong to DEC. The OUI list is
available at 'standards.ieee.org'.
Uses OUI (Organizationally Unique Identifier) 00-16-3E, allocated to
Xensource, Inc. The OUI list is available at
http://standards.ieee.org/regauth/oui/oui.txt.
The remaining 3 fields are random, with the first bit of the first
random field set 0.
@return: MAC address string
"""
mac = [ 0xaa, 0x00, 0x00,
mac = [ 0x00, 0x16, 0x3e,
random.randint(0x00, 0x7f),
random.randint(0x00, 0xff),
random.randint(0x00, 0xff) ]
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.