bgp: support add/delete VPNv6 VRF

added VPNv6 route family VRF support.
This patch enables addition and deletion of VPNv6 VRF.

Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
Hiroshi Yokoi 2014-08-08 16:07:46 +09:00 committed by FUJITA Tomonori
parent 4c98b346e2
commit 0ee150ec52
2 changed files with 10 additions and 2 deletions

View File

@ -60,6 +60,8 @@ from ryu.services.protocols.bgp.info_base.base import Filter
NEIGHBOR_CONF_MED = 'multi_exit_disc'
RF_VPN_V4 = vrfs.VRF_RF_IPV4
RF_VPN_V6 = vrfs.VRF_RF_IPV6
class EventPrefix(object):
@ -330,7 +332,7 @@ class BGPSpeaker(object):
call(func_name, **networks)
def vrf_add(self, route_dist, import_rts, export_rts, site_of_origins=None,
multi_exit_disc=None):
route_family=RF_VPN_V4, multi_exit_disc=None):
""" This method adds a new vrf used for VPN.
``route_dist`` specifies a route distinguisher value.
@ -342,13 +344,19 @@ class BGPSpeaker(object):
``site_of_origins`` specifies site_of_origin values.
This parameter must be a list of string.
``route_family`` specifies route family of the VRF.
This parameter must be RF_VPN_V4 or RF_VPN_V6.
"""
assert route_family in (RF_VPN_V4, RF_VPN_V6),\
'route_family must be RF_VPN_V4 or RF_VPN_V6'
vrf = {}
vrf[vrfs.ROUTE_DISTINGUISHER] = route_dist
vrf[vrfs.IMPORT_RTS] = import_rts
vrf[vrfs.EXPORT_RTS] = export_rts
vrf[vrfs.SITE_OF_ORIGINS] = site_of_origins
vrf[vrfs.VRF_RF] = route_family
call('vrf.create', **vrf)
def vrf_del(self, route_dist):

View File

@ -400,7 +400,7 @@ class TableCoreManager(object):
interested_rts = self._rt_mgr.global_interested_rts
LOG.debug('Cleaning uninteresting paths. Global interested RTs %s' %
interested_rts)
for route_family in SUPPORTED_GLOBAL_RF:
for route_family in [RF_IPv4_VPN, RF_IPv6_VPN, RF_RTC_UC]:
# TODO(PH): We currently do not install RT_NLRI paths based on
# extended path attributes (RT)
if route_family == RF_RTC_UC: