コード例 #1
0
ファイル: common.py プロジェクト: bramwelt/magma
 def debug(cls, _, __, ___):
     config = load_service_config('pipelined')
     qos_impl_type = QosImplType(config["qos"]["impl"])
     qos_store = QosStore(cls.__name__)
     for k, v in qos_store.items():
         _, imsi, ip_addr, rule_num, d = get_key(k)
         _, qid, ambr, leaf = get_data(v)
         print('imsi :', imsi)
         print('ip_addr :', ip_addr)
         print('rule_num :', rule_num)
         print('direction :', d)
         print('qos_handle:', qid)
         print('qos_handle_ambr:', ambr)
         print('qos_handle_ambr_leaf:', leaf)
         if qos_impl_type == QosImplType.OVS_METER:
             MeterManager.dump_meter_state(v)
         else:
             intf = 'nat_iface' if d == FlowMatch.UPLINK else 'enodeb_iface'
             print("Dev: ", config[intf])
             TrafficClass.dump_class_state(config[intf], qid)
             if leaf and leaf != qid:
                 print("Leaf:")
                 TrafficClass.dump_class_state(config[intf], leaf)
             if ambr:
                 print("AMBR (parent):")
                 TrafficClass.dump_class_state(config[intf], ambr)
コード例 #2
0
    def debug(cls, _, __, ___):
        config = load_service_config('pipelined')
        qos_impl_type = QosImplType(config["qos"]["impl"])
        qos_store = QosStore(cls.__name__, client=get_default_client())
        for k, v in qos_store.items():
            _, imsi, ip_addr, rule_num, d = get_key(k)
            _, qid, ambr, leaf = get_data(v)
            print('imsi :', imsi)
            print('ip_addr :', ip_addr)
            print('rule_num :', rule_num)
            print('direction :', d)
            print('qos_handle:', qid)
            print('qos_handle_ambr:', ambr)
            print('qos_handle_ambr_leaf:', leaf)
            if qos_impl_type == QosImplType.OVS_METER:
                MeterManager.dump_meter_state(v)
            else:
                dev = config[
                    'nat_iface'] if d == FlowMatch.UPLINK else 'gtpu_sys_2152'
                print("Dev: ", dev)
                TrafficClass.dump_class_state(dev, qid)
                if leaf and leaf != qid:
                    print("Leaf:")
                    TrafficClass.dump_class_state(dev, leaf)
                if ambr:
                    print("AMBR (parent):")
                    TrafficClass.dump_class_state(dev, ambr)

        if qos_impl_type == QosImplType.LINUX_TC:
            dev = config['nat_iface']
            print("Root stats for: ", dev)
            TrafficClass.dump_root_class_stats(dev)
            dev = 'gtpu_sys_2152'
            print("Root stats for: ", dev)
            TrafficClass.dump_root_class_stats(dev)
コード例 #3
0
ファイル: common.py プロジェクト: sandeepkmall/magma
    def __init__(self, datapath, loop, config):
        self._qos_enabled = config["qos"]["enable"]
        if not self._qos_enabled:
            return

        self._clean_restart = config["clean_restart"]
        self._subscriber_state = {}
        self._loop = loop
        self.impl = QosManager.get_impl(datapath, loop, config)
        self._qos_store = QosStore(self.__class__.__name__)
        self._initialized = False
コード例 #4
0
 def __init__(self, datapath, loop, config):
     # pylint: disable=unnecessary-lambda
     self._enable_qos = config["qos"]["enable"]
     if not self._enable_qos:
         return
     self.qos_impl = QosManager.getqos_impl(datapath, loop, config)
     self._loop = loop
     self._subscriber_map = defaultdict(lambda: defaultdict())
     self._clean_restart = config["clean_restart"]
     self._qos_store = QosStore(self.__class__.__name__)
     self._initialized = False
     self._redis_conn_retry_secs = 1
コード例 #5
0
ファイル: common.py プロジェクト: bramwelt/magma
 def __init__(self, datapath, loop, config):
     self._qos_enabled = config["qos"]["enable"]
     if not self._qos_enabled:
         return
     self._apn_ambr_enabled = config["qos"].get("apn_ambr_enabled", True)
     LOG.info("QoS: apn_ambr_enabled: %s", self._apn_ambr_enabled)
     self._clean_restart = config["clean_restart"]
     self._subscriber_state = {}
     self._loop = loop
     self.impl = QosManager.get_impl(datapath, loop, config)
     self._redis_store = QosStore(self.__class__.__name__)
     self._initialized = False
     self._redis_conn_retry_secs = 1
コード例 #6
0
 def debug(cls, _):
     config = load_service_config('pipelined')
     qos_impl_type = QosImplType(config["qos"]["impl"])
     qos_store = QosStore(cls.__name__)
     for k, v in qos_store.items():
         _, imsi, rule_num, d = get_key(k)
         print('imsi :', imsi)
         print('rule_num :', rule_num)
         print('direction :', d)
         print('qos_handle:', v)
         if qos_impl_type == QosImplType.OVS_METER:
             MeterManager.dump_meter_state(v)
         else:
             intf = 'nat_iface' if d == FlowMatch.UPLINK else 'enodeb_iface'
             TrafficClass.dump_class_state(config[intf], v)
コード例 #7
0
ファイル: common.py プロジェクト: talkhasib/magma
 def __init__(self, loop, config, client=get_default_client()):
     self._initialized = False
     self._clean_restart = config["clean_restart"]
     self._subscriber_state = {}
     self._loop = loop
     self._redis_conn_retry_secs = 1
     self._config = config
     # protect QoS object create and delete across a QoSManager Object.
     self._lock = threading.Lock()
     if 'qos' not in config.keys():
         LOG.error("qos field not provided in config")
         return
     self._qos_enabled = config["qos"]["enable"]
     if not self._qos_enabled:
         return
     self._apn_ambr_enabled = config["qos"].get("apn_ambr_enabled", True)
     LOG.info("QoS: apn_ambr_enabled: %s", self._apn_ambr_enabled)
     self._redis_store = QosStore(self.__class__.__name__, client)
     self.impl = None