# Path: ovizart/modules/traffic/detector/base/handler.py
# class Handler(object):
#     def __init__(self):
#         super(Handler, self).__init__()
#         self.log = Logger("Base Protocol Handler", "DEBUG")
#         self.log.message("base protocol handler called")
# 
#     def create_reassemble_information(self, **params):
#         pass
# 
#     def detect_proto(self,**params):
#         pass
# 
#     def detect_appproto(self,**params):
#         pass


from ovizart.modules.traffic.detector.base.handler import Handler as BaseHandler
from django.conf import settings
import subprocess
import os
#!/usr/bin/env python
#-*- coding: UTF-8 -*-



BRO_CMD = settings.BRO_CMD
BRO_CUT_CMD = settings.BRO_CUT_CMD

class Handler(BaseHandler):
    def __init__(self):
        super(Handler, self).__init__()
        self.bro_cmd = BRO_CMD
        self.bro_cut_cmd = BRO_CUT_CMD

    def create_reassemble_information(self, file_path, file_dir):
        # i had used -C to skip the checksum issue but with this command i got some errors on some pcaps
        cmd = " ".join([self.bro_cmd, "-r", file_path])

# Path: ovizart/modules/traffic/detector/base/handler.py
# class Handler(object):
#     def __init__(self):
#         super(Handler, self).__init__()
#         self.log = Logger("Base Protocol Handler", "DEBUG")
#         self.log.message("base protocol handler called")
# 
#     def create_reassemble_information(self, **params):
#         pass
# 
#     def detect_proto(self,**params):
#         pass
# 
#     def detect_appproto(self,**params):
#         pass


# Path: ovizart/modules/traffic/detector/bro/handler.py
from ovizart.modules.traffic.detector.base.handler import Handler as BaseHandler
from django.conf import settings
import subprocess
import os

#!/usr/bin/env python
#-*- coding: UTF-8 -*-



BRO_CMD = settings.BRO_CMD
BRO_CUT_CMD = settings.BRO_CUT_CMD

class Handler(BaseHandler):
    def __init__(self):
        super(Handler, self).__init__()
        self.bro_cmd = BRO_CMD
        self.bro_cut_cmd = BRO_CUT_CMD

    def create_reassemble_information(self, file_path, file_dir):
        # i had used -C to skip the checksum issue but with this command i got some errors on some pcaps
        cmd = " ".join([self.bro_cmd, "-r", file_path])

        self.log.message("Bro command: %s" % cmd)