Пример #1
0
    def __init__(self, dp, CONF):
        super(QoS, self).__init__()
        self.vlan_list = {}
        self.vlan_list[VLANID_NONE] = 0  # for VLAN=None
        self.dp = dp
        self.version = dp.ofproto.OFP_VERSION
        # Dictionary of port name to Queue config.
        # e.g.)
        # self.queue_list = {
        #     "s1-eth1": {
        #         "0": {
        #             "config": {
        #                 "max-rate": "600000"
        #             }
        #         },
        #         "1": {
        #             "config": {
        #                 "min-rate": "900000"
        #             }
        #         }
        #     }
        # }
        self.queue_list = {}
        self.CONF = CONF
        self.ovsdb_addr = None
        self.ovs_bridge = None

        if self.version not in self._OFCTL:
            raise OFPUnknownVersion(version=self.version)

        self.ofctl = self._OFCTL[self.version]
Пример #2
0
 def factory(dp, logger):
     of_version = dp.ofproto.OFP_VERSION
     if of_version in OfCtl._OF_VERSIONS:
         ofctl = OfCtl._OF_VERSIONS[of_version](dp, logger)
         return ofctl
     else:
         raise OFPUnknownVersion(version=of_version)
Пример #3
0
    def __init__(self, dp):
        super(FirewallOfctl, self).__init__()
        self.dp = dp
        version = dp.ofproto.OFP_VERSION

        if version not in self._OFCTL:
            raise OFPUnknownVersion(version=version)

        self.ofctl = self._OFCTL[version]
Пример #4
0
    def __init__(self, dp):
        super(Firewall, self).__init__()
        self.vlan_list = {}
        self.vlan_list[VLANID_NONE] = 0  # for VLAN=None
        self.dp = dp
        version = dp.ofproto.OFP_VERSION

        if version not in self._OFCTL:
            raise OFPUnknownVersion(version=version)

        self.ofctl = self._OFCTL[version]
Пример #5
0
    def __init__(self, dp, CONF):
        super(QoS, self).__init__()
        self.vlan_list = {}
        self.vlan_list[VLANID_NONE] = 0  # for VLAN=None
        self.dp = dp
        self.version = dp.ofproto.OFP_VERSION
        # Dictionary of port name to Queue config.
        # e.g.)
        # self.queue_list = {
        #     "s1-eth1": {
        #         "0": {
        #             "config": {
        #                 "max-rate": "600000"
        #             }
        #         },
        #         "1": {
        #             "config": {
        #                 "min-rate": "900000"
        #             }
        #         }
        #     }
        # }
        #        self.queue_list = {}
        self.CONF = CONF
        #        selfovsdb_addr = None
        #        selfovs_bridge = None
        global selfqueue_list
        global selfovsdb_addr
        global selfovs_bridge
        global selfqueues_single
        #	global last_selfqueue_list
        global last_queues
        self.restQueue_muster = {
            REST_PORT_NAME: "",
            REST_QUEUE_TYPE: "linux-htb",
            REST_QUEUE_MAX_RATE: "1000000",
            REST_QUEUES: []
        }
        self.rest_match = {
            REST_DST_IP: "",
            REST_NW_PROTO: "UDP",
            REST_TP_DST: ""
        }
        self.rest_action = {REST_ACTION_QUEUE: ""}
        self.restQos_muster = {
            REST_MATCH: self.rest_match,
            REST_ACTION: self.rest_action
        }

        if self.version not in self._OFCTL:
            raise OFPUnknownVersion(version=self.version)

        self.ofctl = self._OFCTL[self.version]
Пример #6
0
    def factory(dp, logger):
        """
        Create an OfCtl object
        Arguments:
        dp       -- Switch datapath object
        logger   -- RyuApp logger instance
        """
        of_version = dp.ofproto.OFP_VERSION
        if of_version in OfCtl._OF_VERSIONS:
            ofctl = OfCtl._OF_VERSIONS[of_version](dp, logger)
        else:
            raise OFPUnknownVersion(version=of_version)

        return ofctl
Пример #7
0
    def __init__(self, dp, CONF):
        super(QoS, self).__init__()
        self.vlan_list = {}
        self.vlan_list[VLANID_NONE] = 0  # for VLAN=None
        self.dp = dp
        self.version = dp.ofproto.OFP_VERSION
        self.queue_list = {}
        self.CONF = CONF
        self.ovsdb_addr = None
        self.ovs_bridge = None

        if self.version not in self._OFCTL:
            raise OFPUnknownVersion(version=self.version)

        self.ofctl = self._OFCTL[self.version]
Пример #8
0
    def __init__(self, dp, CONF):
        super(QueueQos, self).__init__()
        # self.vlan_list = {}
        self.dp = dp
        self.version = dp.ofproto.OFP_VERSION
        # self.queue_list = {}

        self.queueInfo = {}   ##  portNo < --- > QueuePort
        self.CONF = CONF
        self.ovsdb_addr = None
        self.ovs_bridge = None

        if self.version not in self._OFCTL:
            raise OFPUnknownVersion(version=self.version)

        self.ofctl = self._OFCTL[self.version]
Пример #9
0
    def __init__(self, dp, CONF):
        super(QoS, self).__init__()
        self.vlan_list = {}
        self.vlan_list[VLANID_NONE] = 0  # for VLAN=None
        self.dp = dp
        self.version = dp.ofproto.OFP_VERSION

        self.CONF = CONF

        self.unix_socket = None

        if self.version not in self._OFCTL:
            raise OFPUnknownVersion(version=self.version)

        self.ofctl = self._OFCTL[self.version]

        #quick solution to get max-rate
        self.queues_max_rate = {}