2018-07-16 08:55:58 -06:00
|
|
|
#! /usr/bin/python3
|
2018-07-09 17:14:19 -06:00
|
|
|
|
|
|
|
import sys
|
|
|
|
from netarch import ip
|
|
|
|
from netarch import *
|
|
|
|
|
2019-01-28 10:15:42 -07:00
|
|
|
class DumbPacket(ip.Packet):
|
|
|
|
def parse(self, data):
|
|
|
|
self.payload = data
|
|
|
|
|
|
|
|
class DumbSession(ip.Session):
|
|
|
|
Packet = DumbPacket
|
|
|
|
|
2018-07-09 17:14:19 -06:00
|
|
|
s = None
|
|
|
|
reseq = ip.Dispatch(*sys.argv[1:])
|
|
|
|
for h, d in reseq:
|
|
|
|
srv, first, chunk = d
|
|
|
|
if not s:
|
2019-01-28 10:15:42 -07:00
|
|
|
s = DumbSession(first)
|
2018-07-09 17:14:19 -06:00
|
|
|
s.handle(srv, first, chunk, reseq.last)
|