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)