show timestamps from snoop logs

This commit is contained in:
Gilles Boccon-Gibod
2024-02-27 16:40:37 -08:00
parent de8f3d9c1e
commit f2d601f411
3 changed files with 83 additions and 21 deletions

View File

@@ -168,11 +168,13 @@ class PacketReader:
def __init__(self, source: io.BufferedReader) -> None:
self.source = source
self.at_end = False
def next_packet(self) -> Optional[bytes]:
# Get the packet type
packet_type = self.source.read(1)
if len(packet_type) != 1:
self.at_end = True
return None
# Get the packet info based on its type