• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python core_manager.CORE_MANAGER类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中ryu.services.protocols.bgp.core_manager.CORE_MANAGER的典型用法代码示例。如果您正苦于以下问题:Python CORE_MANAGER类的具体用法?Python CORE_MANAGER怎么用?Python CORE_MANAGER使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了CORE_MANAGER类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: _init_signal_listeners

 def _init_signal_listeners(self):
     CORE_MANAGER.get_core_service()._signal_bus.register_listener(
         BgpSignalBus.BGP_BEST_PATH_CHANGED,
         lambda _, info:
             self._notify_best_path_changed(info['path'],
                                            info['is_withdraw'])
     )
开发者ID:javarange,项目名称:ryu,代码行数:7,代码来源:bgpspeaker.py


示例2: stop

def stop(**kwargs):
    """Stops current context is one is active.

    Raises RuntimeConfigError if runtime is not active or initialized yet.
    """
    if not CORE_MANAGER.started:
        raise RuntimeConfigError('No runtime is active. Call start to create '
                                 'a runtime')
    CORE_MANAGER.stop()
    return True
开发者ID:5g-empower,项目名称:empower-ryu,代码行数:10,代码来源:core.py


示例3: add_evpn_local

def add_evpn_local(route_type, route_dist, next_hop, **kwargs):
    """Adds EVPN route from VRF identified by *route_dist*.
    """

    if(route_type in [EVPN_ETH_AUTO_DISCOVERY, EVPN_ETH_SEGMENT]
       and kwargs['esi'] == 0):
        raise ConfigValueError(conf_name=EVPN_ESI,
                               conf_value=kwargs['esi'])

    try:
        # Create new path and insert into appropriate VRF table.
        tm = CORE_MANAGER.get_core_service().table_manager
        label = tm.update_vrf_table(route_dist, next_hop=next_hop,
                                    route_family=VRF_RF_L2_EVPN,
                                    route_type=route_type, **kwargs)
        # Currently we only allocate one label per local route,
        # so we share first label from the list.
        if label:
            label = label[0]

        # Send success response with new label.
        return [{EVPN_ROUTE_TYPE: route_type,
                 ROUTE_DISTINGUISHER: route_dist,
                 VRF_RF: VRF_RF_L2_EVPN,
                 VPN_LABEL: label}.update(kwargs)]
    except BgpCoreError as e:
        raise PrefixError(desc=e)
开发者ID:vinaykothiyal,项目名称:ryu,代码行数:27,代码来源:prefix.py


示例4: delete_evpn_local

def delete_evpn_local(route_type, route_dist, **kwargs):
    """Deletes/withdraws EVPN route from VRF identified by *route_dist*.
    """
    try:
        tm = CORE_MANAGER.get_core_service().table_manager
        tm.update_vrf_table(route_dist, route_family=VRF_RF_L2_EVPN, route_type=route_type, is_withdraw=True, **kwargs)
        # Send success response.
        return [{EVPN_ROUTE_TYPE: route_type, ROUTE_DISTINGUISHER: route_dist, VRF_RF: VRF_RF_L2_EVPN}.update(kwargs)]
    except BgpCoreError as e:
        raise PrefixError(desc=e)
开发者ID:fkakuma,项目名称:ryu,代码行数:10,代码来源:prefix.py


示例5: _create_rt_match_importmap

def _create_rt_match_importmap(name, value):
    core_service = CORE_MANAGER.get_core_service()
    importmap_manager = core_service.importmap_manager
    try:
        importmap_manager.create_rt_import_map(name, value)
    except ImportMapAlreadyExistsError:
        raise RuntimeConfigError(
            'Map with this name already exists'
        )

    return True
开发者ID:5g-empower,项目名称:empower-ryu,代码行数:11,代码来源:import_map.py


示例6: delete_local

def delete_local(route_dist, prefix, route_family=VRF_RF_IPV4):
    """Deletes/withdraws *prefix* from VRF identified by *route_dist* and
    source as network controller.
    """
    try:
        tm = CORE_MANAGER.get_core_service().table_manager
        tm.update_vrf_table(route_dist, prefix, route_family=route_family, is_withdraw=True)
        # Send success response.
        return [{ROUTE_DISTINGUISHER: route_dist, PREFIX: prefix, VRF_RF: route_family}]
    except BgpCoreError as e:
        raise PrefixError(desc=e)
开发者ID:fkakuma,项目名称:ryu,代码行数:11,代码来源:prefix.py


示例7: get_neighbor_attribute_map

def get_neighbor_attribute_map(neigh_ip_address, route_dist=None,
                               route_family=VRF_RF_IPV4):
    """Returns a neighbor attribute_map for given ip address if exists."""
    core = CORE_MANAGER.get_core_service()
    peer = core.peer_manager.get_by_addr(neigh_ip_address)
    at_maps_key = const.ATTR_MAPS_LABEL_DEFAULT

    if route_dist is not None:
        at_maps_key = ':'.join([route_dist, route_family])
    at_maps = peer.attribute_maps.get(at_maps_key)
    if at_maps:
        return at_maps.get(const.ATTR_MAPS_ORG_KEY)
    else:
        return []
开发者ID:BennyE,项目名称:ryu,代码行数:14,代码来源:rtconf.py


示例8: add_flowspec_local

def add_flowspec_local(flowspec_family, route_dist, rules, **kwargs):
    """Adds Flow Specification route from VRF identified by *route_dist*.
    """
    try:
        # Create new path and insert into appropriate VRF table.
        tm = CORE_MANAGER.get_core_service().table_manager
        tm.update_flowspec_vrf_table(
            flowspec_family=flowspec_family, route_dist=route_dist,
            rules=rules, **kwargs)

        # Send success response.
        return [{FLOWSPEC_FAMILY: flowspec_family,
                 ROUTE_DISTINGUISHER: route_dist,
                 FLOWSPEC_RULES: rules}.update(kwargs)]

    except BgpCoreError as e:
        raise PrefixError(desc=e)
开发者ID:5g-empower,项目名称:empower-ryu,代码行数:17,代码来源:prefix.py


示例9: del_flowspec_local

def del_flowspec_local(flowspec_family, route_dist, rules):
    """Deletes/withdraws Flow Specification route from VRF identified
    by *route_dist*.
    """
    try:
        tm = CORE_MANAGER.get_core_service().table_manager
        tm.update_flowspec_vrf_table(
            flowspec_family=flowspec_family, route_dist=route_dist,
            rules=rules, is_withdraw=True)

        # Send success response.
        return [{FLOWSPEC_FAMILY: flowspec_family,
                 ROUTE_DISTINGUISHER: route_dist,
                 FLOWSPEC_RULES: rules}]

    except BgpCoreError as e:
        raise PrefixError(desc=e)
开发者ID:5g-empower,项目名称:empower-ryu,代码行数:17,代码来源:prefix.py


示例10: add_local

def add_local(route_dist, prefix, next_hop, route_family=VRF_RF_IPV4):
    """Adds *prefix* from VRF identified by *route_dist* and sets the source as
    network controller.
    """
    try:
        # Create new path and insert into appropriate VRF table.
        tm = CORE_MANAGER.get_core_service().table_manager
        label = tm.update_vrf_table(route_dist, prefix, next_hop, route_family)
        # Currently we only allocate one label per local_prefix,
        # so we share first label from the list.
        if label:
            label = label[0]

        # Send success response with new label.
        return [{ROUTE_DISTINGUISHER: route_dist, PREFIX: prefix, VRF_RF: route_family, VPN_LABEL: label}]
    except BgpCoreError as e:
        raise PrefixError(desc=e)
开发者ID:fkakuma,项目名称:ryu,代码行数:17,代码来源:prefix.py


示例11: _create_prefix_match_importmap

def _create_prefix_match_importmap(name, value, route_family):
    core_service = CORE_MANAGER.get_core_service()
    importmap_manager = core_service.importmap_manager
    try:
        if route_family == 'ipv4':
            importmap_manager.create_vpnv4_nlri_import_map(name, value)
        elif route_family == 'ipv6':
            importmap_manager.create_vpnv6_nlri_import_map(name, value)
        else:
            raise RuntimeConfigError(
                'Unknown address family %s. it should be ipv4 or ipv6'
                % route_family
            )
    except ImportMapAlreadyExistsError:
        raise RuntimeConfigError(
            'Map with this name already exists'
        )

    return True
开发者ID:5g-empower,项目名称:empower-ryu,代码行数:19,代码来源:import_map.py


示例12: route_refresh

    def route_refresh(self, peer_ip=None, afi=None, safi=None):
        if not peer_ip:
            peer_ip = 'all'

        try:
            route_families = []
            if afi is None and safi is None:
                route_families.extend(SUPPORTED_GLOBAL_RF)
            else:
                route_family = nlri.get_rf(afi, safi)
                if (route_family not in SUPPORTED_GLOBAL_RF):
                    raise WrongParamError('Not supported address-family'
                                          ' %s, %s' % (afi, safi))
                route_families.append(route_family)

            pm = CORE_MANAGER.get_core_service().peer_manager
            pm.make_route_refresh_request(peer_ip, *route_families)
        except Exception as e:
            LOG.error(traceback.format_exc())
            raise WrongParamError(str(e))
        return None
开发者ID:alextwl,项目名称:ryu,代码行数:21,代码来源:internal_api.py


示例13: set_neighbor_attribute_map

def set_neighbor_attribute_map(neigh_ip_address, at_maps,
                               route_dist=None, route_family=VRF_RF_IPV4):
    """set attribute_maps to the neighbor."""
    core = CORE_MANAGER.get_core_service()
    peer = core.peer_manager.get_by_addr(neigh_ip_address)

    at_maps_key = const.ATTR_MAPS_LABEL_DEFAULT
    at_maps_dict = {}

    if route_dist is not None:
        vrf_conf =\
            CORE_MANAGER.vrfs_conf.get_vrf_conf(route_dist, route_family)
        if vrf_conf:
            at_maps_key = ':'.join([route_dist, route_family])
        else:
            raise RuntimeConfigError(desc='No VrfConf with rd %s' %
                                          route_dist)

    at_maps_dict[const.ATTR_MAPS_LABEL_KEY] = at_maps_key
    at_maps_dict[const.ATTR_MAPS_VALUE] = at_maps
    peer.attribute_maps = at_maps_dict

    return True
开发者ID:BennyE,项目名称:ryu,代码行数:23,代码来源:rtconf.py


示例14: _get_vrf_tables

 def _get_vrf_tables(self):
     return CORE_MANAGER.get_core_service().table_manager.get_vrf_tables()
开发者ID:alextwl,项目名称:ryu,代码行数:2,代码来源:internal_api.py


示例15: set_neighbor_out_filter

def set_neighbor_out_filter(neigh_ip_address, filters):
    """Sets the out_filter of a neighbor."""
    core = CORE_MANAGER.get_core_service()
    peer = core.peer_manager.get_by_addr(neigh_ip_address)
    peer.out_filters = filters
    return True
开发者ID:Aries-Sushi,项目名称:ryu,代码行数:6,代码来源:rtconf.py


示例16: bmp_stop

def bmp_stop(host, port):
    core = CORE_MANAGER.get_core_service()
    return core.stop_bmp(host, port)
开发者ID:ddepaoli3,项目名称:ryu,代码行数:3,代码来源:rtconf.py


示例17: del_network

def del_network(prefix):
    tm = CORE_MANAGER.get_core_service().table_manager
    tm.add_to_global_table(prefix, is_withdraw=True)
    return True
开发者ID:ddepaoli3,项目名称:ryu,代码行数:4,代码来源:rtconf.py


示例18: add_network

def add_network(prefix, next_hop=None):
    tm = CORE_MANAGER.get_core_service().table_manager
    tm.add_to_global_table(prefix, next_hop)
    return True
开发者ID:ddepaoli3,项目名称:ryu,代码行数:4,代码来源:rtconf.py


示例19: get_neighbor_attribute_map

def get_neighbor_attribute_map(neigh_ip_address):
    """Returns a neighbor attribute_map for given ip address if exists."""
    core = CORE_MANAGER.get_core_service()
    ret = core.peer_manager.get_by_addr(neigh_ip_address).attribute_maps
    return ret
开发者ID:ddepaoli3,项目名称:ryu,代码行数:5,代码来源:rtconf.py


示例20: set_neighbor_in_filter

def set_neighbor_in_filter(neigh_ip_address, filters):
    """Returns a neighbor in_filter for given ip address if exists."""
    core = CORE_MANAGER.get_core_service()
    peer = core.peer_manager.get_by_addr(neigh_ip_address)
    peer.out_filters = filters
    return True
开发者ID:ddepaoli3,项目名称:ryu,代码行数:6,代码来源:rtconf.py



注:本文中的ryu.services.protocols.bgp.core_manager.CORE_MANAGER类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python validation.is_valid_ipv4函数代码示例发布时间:2022-05-27
下一篇:
Python base.Activity类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap