Skip to content

Commit

Permalink
debugging: print annotations for kbandla#671
Browse files Browse the repository at this point in the history
Signed-off-by: Philip Axer <[email protected]>
  • Loading branch information
philipaxer committed Dec 10, 2024
1 parent 4f8958e commit d662a1b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dpkt/ethernet.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,13 @@ def __init__(self, *args, **kwargs):
dpkt.Packet.__init__(self, *args, **kwargs)
# if data was given in kwargs, try to unpack it
if self.data:
print("__init__")
if isstr(self.data) or isinstance(self.data, bytes):
print(" -> isstr or is bytes")
self._unpack_data(self.data)

def _unpack_data(self, buf):
print("_unpack_data")
# unpack vlan tag and mpls label stacks
if self._next_type in _ETH_TYPES_QINQ:
self.vlan_tags = []
Expand Down Expand Up @@ -137,8 +140,10 @@ def _unpack_data(self, buf):
self.data = buf

def unpack(self, buf):
print("unpack")
dpkt.Packet.unpack(self, buf)
if self.type > 1500:
print(" -> unpack and type > 1500")
# Ethernet II
self._next_type = self.type
self._unpack_data(self.data)
Expand Down

0 comments on commit d662a1b

Please sign in to comment.