1 # Copyright (C) 2014 Nippon Telegraph and Telephone Corporation.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
17 Defines data types and models required specifically for VPNv6 support.
22 from ryu.lib.packet.bgp import IP6AddrPrefix
23 from ryu.lib.packet.bgp import RF_IPv6_VPN
25 from ryu.services.protocols.bgp.info_base.vpn import VpnDest
26 from ryu.services.protocols.bgp.info_base.vpn import VpnPath
27 from ryu.services.protocols.bgp.info_base.vpn import VpnTable
29 LOG = logging.getLogger('bgpspeaker.info_base.vpnv6')
32 class Vpnv6Dest(VpnDest):
37 ROUTE_FAMILY = RF_IPv6_VPN
40 class Vpnv6Table(VpnTable):
41 """Global table to store VPNv6 routing information
43 Uses `Vpnv6Dest` to store destination information for each known vpnv6
46 ROUTE_FAMILY = RF_IPv6_VPN
47 VPN_DEST_CLASS = Vpnv6Dest
50 class Vpnv6Path(VpnPath):
51 """Represents a way of reaching an VPNv4 destination."""
52 ROUTE_FAMILY = RF_IPv6_VPN
53 VRF_PATH_CLASS = None # defined in init - anti cyclic import hack
54 NLRI_CLASS = IP6AddrPrefix
56 def __init__(self, *args, **kwargs):
57 super(Vpnv6Path, self).__init__(*args, **kwargs)
58 from ryu.services.protocols.bgp.info_base.vrf6 import Vrf6Path
59 self.VRF_PATH_CLASS = Vrf6Path