From fa9516f0509e3d1b238af04c91fbdde07109b4f0 Mon Sep 17 00:00:00 2001 From: rbeverly Date: Fri, 4 Nov 2016 09:23:45 -0700 Subject: [PATCH] Support CYCLESTART type --- sc_warts.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sc_warts.py b/sc_warts.py index bf26e2b..9453a6d 100755 --- a/sc_warts.py +++ b/sc_warts.py @@ -34,7 +34,7 @@ import socket import gzip, bz2 import sys -obj_type = {'NONE' : 0x00, 'LIST' : 0x01, 'CYCLE' : 0x03, +obj_type = {'NONE' : 0x00, 'LIST' : 0x01, 'CYCLESTART' : 0x02, 'CYCLE' : 0x03, 'TRACE' : 0x06, 'PING' : 0x07, 'MAGIC' : 0x1205} def unpack_uint8_t(b): @@ -463,6 +463,8 @@ class WartsReader(object): data = self.fd.read(length) if typ == obj_type['LIST']: return WartsList(data, verbose=self.verbose) + elif typ == obj_type['CYCLESTART']: + return WartsCycle(data, verbose=self.verbose) elif typ == obj_type['CYCLE']: return WartsCycle(data, verbose=self.verbose) elif typ == obj_type['TRACE']: @@ -471,8 +473,7 @@ class WartsReader(object): return WartsPing(data, verbose=self.verbose) else: print "Unsupported object: %02x Len: %d" % (typ, length) - assert False - + sys.exit(-1) if __name__ == "__main__":