位运算生成ip地址和mac地址
位运算原理参考:
http://www.361way.com/bitwise-operators/5778.html
def IntToMac(macnum):
return '{:02X}:{:02X}:{:02X}:{:02X}:{:02X}:{:02X}'.format(
(macnum & 0xFF0000000000) >> 40,
(macnum & 0xFF00000000) >> 32,
(macnum & 0xFF000000) >> 24,
(macnum & 0xFF0000) >> 16,
(macnum & 0xFF00) >> 8,
(macnum & 0xFF</