Exemple #1
0
 def unmirror_endpoint(self):
     ''' tell the controller to unmirror traffic '''
     status = False
     if self.sdnc:
         endpoint_data = self.endpoint.endpoint_data
         if self.sdnc.unmirror_mac(endpoint_data['mac'], endpoint_data['segment'], endpoint_data['port']):
             collector = Collector(self.endpoint, endpoint_data['segment'])
             if collector.nic:
                 status = collector.stop_collector()
     else:
         status = True
     return status
Exemple #2
0
 def mirror_endpoint(self):
     '''
     tell network_tap to start a collector and the controller to begin
     mirroring traffic
     '''
     status = False
     if self.sdnc:
         endpoint_data = self.endpoint.endpoint_data
         if self.sdnc.mirror_mac(endpoint_data['mac'], endpoint_data['segment'], endpoint_data['port']):
             collector = Collector(self.endpoint, endpoint_data['segment'])
             if collector.nic:
                 status = collector.start_collector()
     else:
         status = True
     return status
Exemple #3
0
 def unmirror_endpoint(self):
     ''' tell the controller to unmirror traffic '''
     status = False
     if self.sdnc.unmirror_mac(self.endpoint.endpoint_data['mac'],
                               self.endpoint.endpoint_data['segment'],
                               self.endpoint.endpoint_data['port']):
         status = Collector(self.endpoint).stop_vent_collector()
     return status
Exemple #4
0
 def mirror_endpoint(self):
     '''
     tell vent to start a collector and the controller to begin
     mirroring traffic
     '''
     status = False
     if self.sdnc.mirror_mac(self.endpoint.endpoint_data['mac']):
         status = Collector(self.endpoint).start_vent_collector()
     return status
Exemple #5
0
def test_Collector():
    """
    Tests Collector
    """
    endpoint = Endpoint('foo')
    endpoint.endpoint_data = {'mac': '00:00:00:00:00:00'}
    a = Collector(endpoint)
    a.start_vent_collector()
    a.stop_vent_collector()
    a.get_vent_collectors()
    a.host_has_active_collectors('foo')
    endpoint = Endpoint('foo')
    endpoint.endpoint_data = {
        'mac': '00:00:00:00:00:00',
        'container_id': 'foo'
    }
    a = Collector(endpoint)
    a.stop_vent_collector()