# Path: phasortoolbox/parser/pcap/ethernet_frame.py
# class EthernetFrame(KaitaiStruct):
# 
#     class EtherTypeEnum(Enum):
#         ipv4 = 2048
#         x_75_internet = 2049
#         nbs_internet = 2050
#         ecma_internet = 2051
#         chaosnet = 2052
#         x_25_level_3 = 2053
#         arp = 2054
#         ipv6 = 34525
#     def __init__(self, _io, _parent=None, _root=None):
#         self._io = _io
#         self._parent = _parent
#         self._root = _root if _root else self
#         self._read()
# 
#     def _read(self):
#         self.dst_mac = self._io.read_bytes(6)
#         self.src_mac = self._io.read_bytes(6)
#         self.raw_ether_type = self._io.read_u2be()
#         try:
#             self.ether_type = self._root.EtherTypeEnum(self.raw_ether_type)
#         except:
#             self.ether_type = self.raw_ether_type 
#         _on = self.ether_type
#         if _on == self._root.EtherTypeEnum.ipv4:
#             self._raw_body = self._io.read_bytes_full()
#             io = KaitaiStream(BytesIO(self._raw_body))
#             self.body = Ipv4Packet(io)
#         elif _on == self._root.EtherTypeEnum.ipv6:
#             self._raw_body = self._io.read_bytes_full()
#             io = KaitaiStream(BytesIO(self._raw_body))
#             self.body = Ipv6Packet(io)
#         else:
#             self.body = self._io.read_bytes_full()


from pkg_resources import parse_version
from kaitaistruct import __version__ as ks_version, KaitaiStruct, KaitaiStream, BytesIO
from enum import Enum
from .ethernet_frame import EthernetFrame
        bluetooth_linux_monitor = 254
        bluetooth_bredr_bb = 255
        bluetooth_le_ll_with_phdr = 256
        profibus_dl = 257
        pktap = 258
        epon = 259
        ipmi_hpm_2 = 260
        zwave_r1_r2 = 261
        zwave_r3 = 262
        wattstopper_dlm = 263
        iso_14443 = 264
    def __init__(self, _io, _parent=None, _root=None):
        self._io = _io
        self._parent = _parent
        self._root = _root if _root else self
        self._read()

    def _read(self):
        self.header = self._root.PacketPpiHeader(self._io, self, self._root)
        self._raw_fields = self._io.read_bytes((self.header.pph_len - 8))
        io = KaitaiStream(BytesIO(self._raw_fields))
        self.fields = self._root.PacketPpiFields(io, self, self._root)
        _on = self.header.pph_dlt
        if _on == self._root.Linktype.ppi:
            self._raw_body = self._io.read_bytes_full()
            io = KaitaiStream(BytesIO(self._raw_body))
            self.body = PacketPpi(io)
        elif _on == self._root.Linktype.ethernet:
            self._raw_body = self._io.read_bytes_full()
            io = KaitaiStream(BytesIO(self._raw_body))

# Path: phasortoolbox/parser/pcap/ethernet_frame.py
# class EthernetFrame(KaitaiStruct):
# 
#     class EtherTypeEnum(Enum):
#         ipv4 = 2048
#         x_75_internet = 2049
#         nbs_internet = 2050
#         ecma_internet = 2051
#         chaosnet = 2052
#         x_25_level_3 = 2053
#         arp = 2054
#         ipv6 = 34525
#     def __init__(self, _io, _parent=None, _root=None):
#         self._io = _io
#         self._parent = _parent
#         self._root = _root if _root else self
#         self._read()
# 
#     def _read(self):
#         self.dst_mac = self._io.read_bytes(6)
#         self.src_mac = self._io.read_bytes(6)
#         self.raw_ether_type = self._io.read_u2be()
#         try:
#             self.ether_type = self._root.EtherTypeEnum(self.raw_ether_type)
#         except:
#             self.ether_type = self.raw_ether_type 
#         _on = self.ether_type
#         if _on == self._root.EtherTypeEnum.ipv4:
#             self._raw_body = self._io.read_bytes_full()
#             io = KaitaiStream(BytesIO(self._raw_body))
#             self.body = Ipv4Packet(io)
#         elif _on == self._root.EtherTypeEnum.ipv6:
#             self._raw_body = self._io.read_bytes_full()
#             io = KaitaiStream(BytesIO(self._raw_body))
#             self.body = Ipv6Packet(io)
#         else:
#             self.body = self._io.read_bytes_full()


# Path: phasortoolbox/parser/pcap/packet_ppi.py
from pkg_resources import parse_version
from kaitaistruct import __version__ as ks_version, KaitaiStruct, KaitaiStream, BytesIO
from enum import Enum
from .ethernet_frame import EthernetFrame

        bluetooth_linux_monitor = 254
        bluetooth_bredr_bb = 255
        bluetooth_le_ll_with_phdr = 256
        profibus_dl = 257
        pktap = 258
        epon = 259
        ipmi_hpm_2 = 260
        zwave_r1_r2 = 261
        zwave_r3 = 262
        wattstopper_dlm = 263
        iso_14443 = 264
    def __init__(self, _io, _parent=None, _root=None):
        self._io = _io
        self._parent = _parent
        self._root = _root if _root else self
        self._read()

    def _read(self):
        self.header = self._root.PacketPpiHeader(self._io, self, self._root)
        self._raw_fields = self._io.read_bytes((self.header.pph_len - 8))
        io = KaitaiStream(BytesIO(self._raw_fields))
        self.fields = self._root.PacketPpiFields(io, self, self._root)
        _on = self.header.pph_dlt
        if _on == self._root.Linktype.ppi:
            self._raw_body = self._io.read_bytes_full()
            io = KaitaiStream(BytesIO(self._raw_body))
            self.body = PacketPpi(io)
        elif _on == self._root.Linktype.ethernet:
            self._raw_body = self._io.read_bytes_full()
            io = KaitaiStream(BytesIO(self._raw_body))

            self.body = EthernetFrame(io)