packet lib: add unparsed data to Packet.protocols
Easy to access to the data that the library can't parse. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
ef8284dfd1
commit
f5d21573a5
@ -35,6 +35,9 @@ class Packet(object):
|
||||
self.parsed_bytes += proto.length
|
||||
self.protocols.append(proto)
|
||||
|
||||
if len(self.data) > self.parsed_bytes:
|
||||
self.protocols.append(self.data[self.parsed_bytes:])
|
||||
|
||||
def serialize(self):
|
||||
self.data = bytearray()
|
||||
r = self.protocols[::-1]
|
||||
|
Loading…
Reference in New Issue
Block a user