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

Signed-off-by: Hiroshi Yokoi <[email protected]>
---
 ryu/services/protocols/bgp/bgpspeaker.py                  | 10 +++++++++-
 ryu/services/protocols/bgp/core_managers/table_manager.py |  2 +-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/ryu/services/protocols/bgp/bgpspeaker.py 
b/ryu/services/protocols/bgp/bgpspeaker.py
index 2dfbd3a..fdd38dd 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 dcf9567..213afec 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:
-- 
1.8.5.2 (Apple Git-48)



------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to