diff options
| author | Andrew Lamoureux <andrew@vector35.com> | 2019-03-20 15:35:00 -0400 |
|---|---|---|
| committer | Andrew Lamoureux <andrew@vector35.com> | 2019-03-20 15:35:00 -0400 |
| commit | a2d0b2cd66639e983b5a4fb191d8afe5cac77855 (patch) | |
| tree | 8561a4193d6cb394839cf6aaef2642b095a4ea30 /python/examples/kaitai/ipv4_packet.py | |
| parent | b5e86006a35910ff115d35998e84938e7d92a8ea (diff) | |
kaitai: more format compatibility, testing
Diffstat (limited to 'python/examples/kaitai/ipv4_packet.py')
| -rw-r--r-- | python/examples/kaitai/ipv4_packet.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/python/examples/kaitai/ipv4_packet.py b/python/examples/kaitai/ipv4_packet.py index ffc83f92..4ed02a64 100644 --- a/python/examples/kaitai/ipv4_packet.py +++ b/python/examples/kaitai/ipv4_packet.py @@ -8,7 +8,7 @@ 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 protocol_body import ProtocolBody +from . import protocol_body class Ipv4Packet(KaitaiStruct): SEQ_FIELDS = ["b1", "b2", "total_length", "identification", "b67", "ttl", "protocol", "header_checksum", "src_ip_addr", "dst_ip_addr", "options", "body"] def __init__(self, _io, _parent=None, _root=None): @@ -57,7 +57,7 @@ class Ipv4Packet(KaitaiStruct): self._debug['body']['start'] = self._io.pos() self._raw_body = self._io.read_bytes((self.total_length - self.ihl_bytes)) io = KaitaiStream(BytesIO(self._raw_body)) - self.body = ProtocolBody(self.protocol, io) + self.body = protocol_body.ProtocolBody(self.protocol, io) self.body._read() self._debug['body']['end'] = self._io.pos() |
