I am trying to extract the Destination & Source MACs from an ethernet frame using python and Linux. I used the code below to print the bytes of a frame.
s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_TCP)
packet = s.recvfrom(65565)
data = packet[0]
for byte in range(0, len(data)):
print(data[byte])
How can I convert the byes corresponding to the Destination Mac (or the ones corresponding to the Source Mac) to an actual adress?