# Path: neutron_taas/common/constants.py
# TAAS = 'TAAS'
# VLAN_RANGE = '0-4095'
# 
# Path: neutron_taas/common/utils.py
# def get_list_from_ranges_str(ranges_str):
# def get_ranges_str_from_list(ranges):
# 
# Path: neutron_taas/services/taas/agents/extensions/taas.py
# LOG = logging.getLogger(__name__)
# OPTS = [
#     cfg.IntOpt(
#         'taas_agent_periodic_interval',
#         default=5,
#         help=_('Seconds between periodic task runs')
#     )
# ]
# class TaasAgentDriver(object):
# class TaasAgentExtension(l2_extension.L2AgentExtension):
#     def initialize(self):
#     def consume_api(self, agent_api):
#     def create_tap_service(self, tap_service):
#     def create_tap_flow(self, tap_flow):
#     def delete_tap_service(self, tap_service):
#     def delete_tap_flow(self, tap_flow):
#     def initialize(self, connection, driver_type):
#     def consume_api(self, agent_api):
#     def handle_port(self, context, port):
#     def delete_port(self, context, port):
# 
# Path: neutron_taas/services/taas/drivers/linux/sriov_nic_exceptions.py
# class SriovNicSwitchDriverInvocationError(qexception.Invalid):
# class PciDeviceNotFoundById(qexception.NotFound):
# class PciSlotNotFound(qexception.NotFound):
# 
# Path: neutron_taas/services/taas/drivers/linux/sriov_nic_utils.py
# LOG = logging.getLogger(__name__)
#         VIRTFN_RE = re.compile(r"virtfn(\d+)")
# class SriovNicUtils(object):
#     def __init__(self):
#     def execute_sysfs_command(self, command, ts_port_params,
#                               src_port_params,
#                               common_vlans_ranges_str,
#                               vf_to_vf_all_vlans, direction):
#     def _get_sysfs_netdev_path(self, pci_addr, pf_interface):
#     def get_ifname_by_pci_address(self, pci_addr, pf_interface=False):
#     def get_mac_by_pci_address(self, pci_addr, pf_interface=False):
#     def get_vf_num_by_pci_address(self, pci_addr):
#     def get_net_name_by_vf_pci_address(self, vfaddress, pf_interface=False):
#     def get_sriov_port_params(self, sriov_port):


from neutron.conf.agent import common
from neutron_taas.common import constants as taas_consts
from neutron_taas.common import utils as common_utils
from neutron_taas.services.taas.agents.extensions import taas as taas_base
from neutron_taas.services.taas.drivers.linux import sriov_nic_exceptions \
    as taas_exc
from neutron_taas.services.taas.drivers.linux import sriov_nic_utils \
    as sriov_utils
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils
import threading

        # If no VLAN filter configured on source port, then include all vlans
        if not src_port_params['src_vlans']:
            src_port_params['src_vlans'] = taas_consts.VLAN_RANGE
            LOG.debug("TaaS no src_vlans in src_port")

        # If no VLAN filter configured on probe port, then include all vlans
        if not vlan_filter:
            vf_to_vf_all_vlans = True
            LOG.debug("VF to VF mirroring for all VLANs. "
                      "Direction %(direction)s",
                      {'direction': direction})

        if not src_port_params['pci_slot']:
            LOG.error("No PCI Slot for source_port %(id)s with MAC %(mac)s; ",
                      {'id': source_port['id'],
                       'mac': src_port_params['mac'],
                       'source_vlans': src_port_params['src_vlans']})
            raise taas_exc.PciSlotNotFound(port_id=source_port['id'],
                                           mac=src_port_params['mac'])

        if not ts_port_params['pci_slot']:
            LOG.error("No PCI Slot for ts_port %(id)s with MAC %(mac)s; ",
                      {'id': ts_port['id'], 'mac': ts_port_params['mac']})
            raise taas_exc.PciSlotNotFound(port_id=ts_port['id'],
                                           mac=ts_port_params['mac'])

        # Fetch common VLAN tags
        src_vlans_list = []
        for src_vlans_str in tap_flow['source_vlans_list']:

# Path: neutron_taas/common/constants.py
# TAAS = 'TAAS'
# VLAN_RANGE = '0-4095'
# 
# Path: neutron_taas/common/utils.py
# def get_list_from_ranges_str(ranges_str):
# def get_ranges_str_from_list(ranges):
# 
# Path: neutron_taas/services/taas/agents/extensions/taas.py
# LOG = logging.getLogger(__name__)
# OPTS = [
#     cfg.IntOpt(
#         'taas_agent_periodic_interval',
#         default=5,
#         help=_('Seconds between periodic task runs')
#     )
# ]
# class TaasAgentDriver(object):
# class TaasAgentExtension(l2_extension.L2AgentExtension):
#     def initialize(self):
#     def consume_api(self, agent_api):
#     def create_tap_service(self, tap_service):
#     def create_tap_flow(self, tap_flow):
#     def delete_tap_service(self, tap_service):
#     def delete_tap_flow(self, tap_flow):
#     def initialize(self, connection, driver_type):
#     def consume_api(self, agent_api):
#     def handle_port(self, context, port):
#     def delete_port(self, context, port):
# 
# Path: neutron_taas/services/taas/drivers/linux/sriov_nic_exceptions.py
# class SriovNicSwitchDriverInvocationError(qexception.Invalid):
# class PciDeviceNotFoundById(qexception.NotFound):
# class PciSlotNotFound(qexception.NotFound):
# 
# Path: neutron_taas/services/taas/drivers/linux/sriov_nic_utils.py
# LOG = logging.getLogger(__name__)
#         VIRTFN_RE = re.compile(r"virtfn(\d+)")
# class SriovNicUtils(object):
#     def __init__(self):
#     def execute_sysfs_command(self, command, ts_port_params,
#                               src_port_params,
#                               common_vlans_ranges_str,
#                               vf_to_vf_all_vlans, direction):
#     def _get_sysfs_netdev_path(self, pci_addr, pf_interface):
#     def get_ifname_by_pci_address(self, pci_addr, pf_interface=False):
#     def get_mac_by_pci_address(self, pci_addr, pf_interface=False):
#     def get_vf_num_by_pci_address(self, pci_addr):
#     def get_net_name_by_vf_pci_address(self, vfaddress, pf_interface=False):
#     def get_sriov_port_params(self, sriov_port):


# Path: neutron_taas/services/taas/drivers/linux/sriov_nic_taas.py
from neutron.conf.agent import common
from neutron_taas.common import constants as taas_consts
from neutron_taas.common import utils as common_utils
from neutron_taas.services.taas.agents.extensions import taas as taas_base
from neutron_taas.services.taas.drivers.linux import sriov_nic_exceptions \
    as taas_exc
from neutron_taas.services.taas.drivers.linux import sriov_nic_utils \
    as sriov_utils
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils
import threading


        # If no VLAN filter configured on source port, then include all vlans
        if not src_port_params['src_vlans']:
            src_port_params['src_vlans'] = taas_consts.VLAN_RANGE
            LOG.debug("TaaS no src_vlans in src_port")

        # If no VLAN filter configured on probe port, then include all vlans
        if not vlan_filter:
            vf_to_vf_all_vlans = True
            LOG.debug("VF to VF mirroring for all VLANs. "
                      "Direction %(direction)s",
                      {'direction': direction})

        if not src_port_params['pci_slot']:
            LOG.error("No PCI Slot for source_port %(id)s with MAC %(mac)s; ",
                      {'id': source_port['id'],
                       'mac': src_port_params['mac'],
                       'source_vlans': src_port_params['src_vlans']})
            raise taas_exc.PciSlotNotFound(port_id=source_port['id'],
                                           mac=src_port_params['mac'])

        if not ts_port_params['pci_slot']:
            LOG.error("No PCI Slot for ts_port %(id)s with MAC %(mac)s; ",
                      {'id': ts_port['id'], 'mac': ts_port_params['mac']})
            raise taas_exc.PciSlotNotFound(port_id=ts_port['id'],
                                           mac=ts_port_params['mac'])

        # Fetch common VLAN tags
        src_vlans_list = []
        for src_vlans_str in tap_flow['source_vlans_list']:

            src_vlans_list.extend(common_utils.get_list_from_ranges_str(