Ejemplo n.º 1
0
    def __init__(self, disk_img, host=VM_HOST, port=VM_PORT):
        """ Initialize our class """

        # Set our variables
        self.VM_HOST = host
        self.VM_PORT = port
        self.DISK_IMG = disk_img
        self.SOCK = None

        self.name = os.path.basename(disk_img) + "-DiskSensor"

        if disk_img is None:
            logger.error("No disk image filename provided.")

        DiskSensor.__init__(self)
Ejemplo n.º 2
0
    def __init__(self, disk_img, host=VM_HOST, port=VM_PORT):
        """ Initialize our class """

        # Set our variables
        self.VM_HOST = host
        self.VM_PORT = port
        self.DISK_IMG = disk_img
        self.SOCK = None
        
        self.name = os.path.basename(disk_img)+"-DiskSensor"

        if disk_img is None:
            logger.error("No disk image filename provided.")
            
        DiskSensor.__init__(self)
Ejemplo n.º 3
0
    def __init__(self,
                 sensor_ip,
                 sensor_port=G.SENSOR_DISK.DEFAULT_PORT,
                 bind_ip="0.0.0.0",
                 bind_port=G.SENSOR_DISK.DEFAULT_PORT,
                 sector_size=G.SENSOR_DISK.DEFAULT_SECTOR_SIZE,
                 name=None,
                 use_threading=True):
        """ Initialize our sensor """

        # Set our variables
        self.sensor_ip = sensor_ip
        self.sensor_port = sensor_port

        self.bind_ip = bind_ip
        self.bind_port = bind_port

        self.sector_size = sector_size

        # Keep our connected state
        self.connected = False
        self.sata_enabled = False

        # Initialize a heap to re-order SATA frames that arrive out of order
        self.sata_heap = []
        self.last_lophi_seqn = None
        self.last_lophi_packet = None

        if name is not None:
            self.name = name

        # Are we reading a separate process?
        self.use_threading = use_threading
        self.read_queue = None
        self.packet_reader = None

        self.SOCK = None

        self.DROPPED_PACKETS = 0

        # Connect to the socket
        #         self._connect()

        DiskSensor.__init__(self)

        logger.debug("Initialized Disk Sensor. (%s)" % self.name)
Ejemplo n.º 4
0
    def __init__(self, sensor_ip, 
                 sensor_port=G.SENSOR_DISK.DEFAULT_PORT,
                 bind_ip="0.0.0.0",
                 bind_port = G.SENSOR_DISK.DEFAULT_PORT,
                 sector_size=G.SENSOR_DISK.DEFAULT_SECTOR_SIZE,
                 name=None,
                 use_threading=True):
        """ Initialize our sensor """

        # Set our variables
        self.sensor_ip = sensor_ip
        self.sensor_port = sensor_port
       
        self.bind_ip = bind_ip
        self.bind_port = bind_port
        
        self.sector_size = sector_size
        
        # Keep our connected state
        self.connected = False
        self.sata_enabled = False
        
        # Initialize a heap to re-order SATA frames that arrive out of order
        self.sata_heap = []
        self.last_lophi_seqn = None
        self.last_lophi_packet = None
                
        if name is not None:
            self.name = name
        
        # Are we reading a separate process?
        self.use_threading = use_threading
        self.read_queue = None
        self.packet_reader = None
        
        self.SOCK = None
        
        self.DROPPED_PACKETS = 0
        
        # Connect to the socket
#         self._connect()
        
        DiskSensor.__init__(self)
        
        logger.debug("Initialized Disk Sensor. (%s)"%self.name)