summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>2014-08-08 16:07:46 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-08-08 16:51:14 +0900
commit0ee150ec52836ba371129040dcefdd8b6107c270 (patch)
treeae365366140d9c2e27df7704cde9a17251819022
parent4c98b346e2dbd55e606cb6851e1a5df130e7cdc8 (diff)
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>
-rw-r--r--ryu/services/protocols/bgp/bgpspeaker.py10
-rw-r--r--ryu/services/protocols/bgp/core_managers/table_manager.py2
2 files changed, 10 insertions, 2 deletions
diff --git a/ryu/services/protocols/bgp/bgpspeaker.py b/ryu/services/protocols/bgp/bgpspeaker.py
index 2dfbd3a5..fdd38dd8 100644
--- a/ryu/services/protocols/bgp/bgpspeaker.py
+++ b/ryu/services/protocols/bgp/bgpspeaker.py
@@ -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):
diff --git a/ryu/services/protocols/bgp/core_managers/table_manager.py b/ryu/services/protocols/bgp/core_managers/table_manager.py
index dcf95670..213afecf 100644
--- a/ryu/services/protocols/bgp/core_managers/table_manager.py
+++ b/ryu/services/protocols/bgp/core_managers/table_manager.py
@@ -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: