Skip to content

Commit 8fed00c

Browse files
authored
Raw packet bytes in Packet info and comment updates
Added the raw packet bytes to the Packet.info() output in the new 'rawpkt' key. This allows pcapout to function as intended. Also minor updates to some doc strings.
1 parent b11ac38 commit 8fed00c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

dshell/core.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,7 @@ def __init__(self, plugin, pktlen, pkt, ts):
802802
Attributes:
803803
ts: timestamp of packet
804804
dt: datetime of packet
805+
frame: sequential packet number as read from data stream
805806
pkt: pypacker object for the packet
806807
rawpkt: raw bytestring of the packet
807808
pktlen: length of packet
@@ -1052,6 +1053,7 @@ def info(self):
10521053
"""
10531054
d = {k: v for k, v in self.__dict__.items() if not k.startswith('_')}
10541055
d['byte_count'] = self.byte_count
1056+
d['rawpkt'] = self.pkt.bin()
10551057
del d['pkt']
10561058
return d
10571059

@@ -1783,7 +1785,7 @@ def reassemble(self, allow_padding=True, allow_overlap=True, padding=b'\x00'):
17831785
def info(self):
17841786
"""
17851787
Provides a dictionary with information about a blob. Useful for
1786-
calls to a plugin's write() function, e.g. self.write(\\*\\*conn.info())
1788+
calls to a plugin's write() function, e.g. self.write(\\*\\*blob.info())
17871789
17881790
Returns:
17891791
Dictionary with information

0 commit comments

Comments
 (0)