def get_mac(self):
ifreq = struct.pack('<STR_LIT>', self.name, AF_UNIX, b'<STR_LIT:\x00>'*<NUM_LIT>)<EOL>res = fcntl.ioctl(sockfd, SIOCGIFHWADDR, ifreq)<EOL>address = struct.unpack('<STR_LIT>', res)[<NUM_LIT:2>]<EOL>mac = struct.unpack('<STR_LIT>', address)<EOL>return "<STR_LIT::>".join(['<STR_LIT>' % i for i in mac])<EOL>
Obtain the device's mac address.