Proto/analyze/reverse.py
Richard 9f6a251ceb reverse up until test 4
Finally fixed ignoring bad packets. Next is long lines
2023-11-16 18:49:14 +01:00

24 lines
476 B
Python

import sys
ses = {}
fil = open(sys.argv[1])
for l in fil:
l = l.strip()
p = l.split("]")
tst = p[1][2:]
txt = p[2].strip()
tp = txt.split(" ")
print(txt)
if txt.startswith("NOTE:successfully connected with session"):
sid = int(tp[-1])
ses[sid] = [sid, tst, False]
if txt.startswith("NOTE:closed session"):
sid = int(tp[2])
ses[sid][2] = True
print("unclosed sessions:")
for v in ses.values():
if v[2] == False:
print(v[1], v[0])