From 6cf9614b9700852a9a81cf40644d5c1922b85ff0 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Mon, 28 Jan 2019 17:15:42 +0000 Subject: [PATCH] make dumbdecode a little less dumb and a little more helpful --- dumbdecode.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dumbdecode.py b/dumbdecode.py index 8f965e7..22caae5 100755 --- a/dumbdecode.py +++ b/dumbdecode.py @@ -4,10 +4,17 @@ import sys from netarch import ip from netarch import * +class DumbPacket(ip.Packet): + def parse(self, data): + self.payload = data + +class DumbSession(ip.Session): + Packet = DumbPacket + s = None reseq = ip.Dispatch(*sys.argv[1:]) for h, d in reseq: srv, first, chunk = d if not s: - s = ip.Session(first) + s = DumbSession(first) s.handle(srv, first, chunk, reseq.last)