backing up
[vsorcdistro/.git] / ryu / build / lib.linux-armv7l-2.7 / ryu / services / protocols / bgp / info_base / vrf4fs.py
1 # Copyright (C) 2017 Nippon Telegraph and Telephone Corporation.
2 #
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
6 #
7 #    http://www.apache.org/licenses/LICENSE-2.0
8 #
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
12 # implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 """
17  Defines data types and models required specifically
18  for VRF (for IPv4 Flow Specification) support.
19  Represents data structures for VRF not VPN/global.
20  (Inside VRF you have IPv4 Flow Specification prefixes
21  and inside VPN you have VPNv4 Flow Specification prefixes)
22 """
23
24 import logging
25
26 from ryu.lib.packet.bgp import RF_IPv4_FLOWSPEC
27 from ryu.lib.packet.bgp import RF_VPNv4_FLOWSPEC
28 from ryu.lib.packet.bgp import FlowSpecIPv4NLRI
29 from ryu.lib.packet.bgp import FlowSpecVPNv4NLRI
30
31 from ryu.services.protocols.bgp.info_base.vpnv4fs import VPNv4FlowSpecPath
32 from ryu.services.protocols.bgp.info_base.vrffs import VRFFlowSpecDest
33 from ryu.services.protocols.bgp.info_base.vrffs import VRFFlowSpecPath
34 from ryu.services.protocols.bgp.info_base.vrffs import VRFFlowSpecTable
35
36 LOG = logging.getLogger('bgpspeaker.info_base.vrf4fs')
37
38
39 class Vrf4FlowSpecPath(VRFFlowSpecPath):
40     """Represents a way of reaching an IP destination with
41     a VPN Flow Specification.
42     """
43     ROUTE_FAMILY = RF_IPv4_FLOWSPEC
44     VPN_PATH_CLASS = VPNv4FlowSpecPath
45     VPN_NLRI_CLASS = FlowSpecVPNv4NLRI
46
47
48 class Vrf4FlowSpecDest(VRFFlowSpecDest):
49     ROUTE_FAMILY = RF_IPv4_FLOWSPEC
50
51
52 class Vrf4FlowSpecTable(VRFFlowSpecTable):
53     """Virtual Routing and Forwarding information base
54     for IPv4 Flow Specification.
55     """
56     ROUTE_FAMILY = RF_IPv4_FLOWSPEC
57     VPN_ROUTE_FAMILY = RF_VPNv4_FLOWSPEC
58     NLRI_CLASS = FlowSpecIPv4NLRI
59     VRF_PATH_CLASS = Vrf4FlowSpecPath
60     VRF_DEST_CLASS = Vrf4FlowSpecDest