Lines Matching refs:ethernet
552 packet = self._socket.recv(ethernet.ETH_PACKET_MAX_SIZE)
553 if len(packet) >= (ethernet.ETH_PACKET_MIN_SIZE-4):
588 packet = ethernet.pack(dst_mac, src_mac, protocol, payload)
621 frame = ethernet.unpack(packet)
640 class ethernet(object): class
734 if packet_len < ethernet.HDR_LEN:
737 payload_len = packet_len - ethernet.HDR_LEN
739 frame[ethernet.FRAME_KEY_DST_MAC], \
740 frame[ethernet.FRAME_KEY_SRC_MAC], \
741 frame[ethernet.FRAME_KEY_PROTO] = \
742 struct.unpack("!6s6sH", raw_frame[:ethernet.HDR_LEN])
743 frame[ethernet.FRAME_KEY_PAYLOAD] = \
744 raw_frame[ethernet.HDR_LEN:ethernet.HDR_LEN+payload_len]
751 return site_net_utils.ethernet()
753 return ethernet()