chewie.ethernet_packet module
This module is used to allow parsing and packing of Ethernet Packets
- class chewie.ethernet_packet.EthernetPacket(dst_mac, src_mac, ethertype, data)
Bases:
object
Packet/parsers for an IEEE 802.3 Ethernet frame
- pack()
Pack up the ethernet packet to bytes. Returns:
bytes
- classmethod parse(packed_message)
construct an EthernetPacket from a packed_message Args:
packed_message (bytes):
- Returns:
EthernetPacket
- Raises:
MessageParseError: if packed_message cannot be successfully parsed.