@ -177,15 +177,21 @@ class SuricataSC:
if command . split ( ' ' , 2 ) [ 0 ] in self . cmd_list :
if command . split ( ' ' , 2 ) [ 0 ] in self . cmd_list :
if " pcap-file " in command :
if " pcap-file " in command :
try :
try :
[ cmd , filename , output ] = command . split ( ' ' , 2 )
parts = command . split ( ' ' );
except :
except :
raise SuricataCommandException ( " Arguments to command ' %s ' is missing " % ( command ) )
raise SuricataCommandException ( " Arguments to command ' %s ' is missing " % ( command ) )
cmd , filename , output = parts [ 0 ] , parts [ 1 ] , parts [ 2 ]
tenant = None
if len ( parts ) > 3 :
tenant = parts [ 3 ]
if cmd != " pcap-file " :
if cmd != " pcap-file " :
raise SuricataCommandException ( " Invalid command ' %s ' " % ( command ) )
raise SuricataCommandException ( " Invalid command ' %s ' " % ( command ) )
else :
else :
arguments = { }
arguments = { }
arguments [ " filename " ] = filename
arguments [ " filename " ] = filename
arguments [ " output-dir " ] = output
arguments [ " output-dir " ] = output
if tenant != None :
arguments [ " tenant " ] = int ( tenant )
elif " iface-stat " in command :
elif " iface-stat " in command :
try :
try :
[ cmd , iface ] = command . split ( ' ' , 1 )
[ cmd , iface ] = command . split ( ' ' , 1 )