reverse up until test 4

Finally fixed ignoring bad packets. Next is long lines
This commit is contained in:
Richard
2023-11-16 18:49:14 +01:00
parent 7d1069cf2c
commit 9f6a251ceb
5 changed files with 532 additions and 1 deletions

24
analyze/reverse.py Normal file
View File

@@ -0,0 +1,24 @@
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])