def parse_ethernet_header(self, packet):
dst_mac = self.bytes_to_mac(packet[0:6])
src_mac = self.bytes_to_mac(packet[6:12])
eth_protocol = socket.ntohs((packet[13] << 8) + packet[12])
return dst_mac, src_mac, eth_protocol
评论列表
文章目录