summaryrefslogtreecommitdiff
path: root/python/examples/kaitai/ethernet_frame.py
diff options
context:
space:
mode:
authorAndrew Lamoureux <andrew@vector35.com>2019-03-20 15:35:00 -0400
committerAndrew Lamoureux <andrew@vector35.com>2019-03-20 15:35:00 -0400
commita2d0b2cd66639e983b5a4fb191d8afe5cac77855 (patch)
tree8561a4193d6cb394839cf6aaef2642b095a4ea30 /python/examples/kaitai/ethernet_frame.py
parentb5e86006a35910ff115d35998e84938e7d92a8ea (diff)
kaitai: more format compatibility, testing
Diffstat (limited to 'python/examples/kaitai/ethernet_frame.py')
-rw-r--r--python/examples/kaitai/ethernet_frame.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/python/examples/kaitai/ethernet_frame.py b/python/examples/kaitai/ethernet_frame.py
index e90c43c7..adbe60de 100644
--- a/python/examples/kaitai/ethernet_frame.py
+++ b/python/examples/kaitai/ethernet_frame.py
@@ -9,8 +9,8 @@ import collections
if parse_version(ks_version) < parse_version('0.7'):
raise Exception("Incompatible Kaitai Struct Python API: 0.7 or later is required, but you have %s" % (ks_version))
-from ipv4_packet import Ipv4Packet
-from ipv6_packet import Ipv6Packet
+from . import ipv4_packet
+from . import ipv6_packet
class EthernetFrame(KaitaiStruct):
"""Ethernet frame is a OSI data link layer (layer 2) protocol data unit
for Ethernet networks. In practice, many other networks and/or
@@ -51,12 +51,12 @@ class EthernetFrame(KaitaiStruct):
if _on == self._root.EtherTypeEnum.ipv4:
self._raw_body = self._io.read_bytes_full()
io = KaitaiStream(BytesIO(self._raw_body))
- self.body = Ipv4Packet(io)
+ self.body = ipv4_packet.Ipv4Packet(io)
self.body._read()
elif _on == self._root.EtherTypeEnum.ipv6:
self._raw_body = self._io.read_bytes_full()
io = KaitaiStream(BytesIO(self._raw_body))
- self.body = Ipv6Packet(io)
+ self.body = ipv6_packet.Ipv6Packet(io)
self.body._read()
else:
self.body = self._io.read_bytes_full()