backing up
[vsorcdistro/.git] / ryu / build / lib.linux-armv7l-2.7 / ryu / services / protocols / bgp / info_base / vrfl2vpnfs.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 L2VPN support.
19  Represents data structures for VRF not VPN/global.
20  (Inside VRF you have L2VPN Flow Specification prefixes
21  and inside VPN you have L2VPN Flow Specification prefixes)
22 """
23
24 import logging
25
26 from ryu.lib.packet.bgp import RF_L2VPN_FLOWSPEC
27 from ryu.lib.packet.bgp import FlowSpecL2VPNNLRI
28
29 from ryu.services.protocols.bgp.info_base.l2vpnfs import L2VPNFlowSpecPath
30 from ryu.services.protocols.bgp.info_base.vrffs import VRFFlowSpecDest
31 from ryu.services.protocols.bgp.info_base.vrffs import VRFFlowSpecPath
32 from ryu.services.protocols.bgp.info_base.vrffs import VRFFlowSpecTable
33
34 LOG = logging.getLogger('bgpspeaker.info_base.vrfl2vpnfs')
35
36
37 class L2vpnFlowSpecPath(VRFFlowSpecPath):
38     """Represents a way of reaching an IP destination with
39     a L2VPN Flow Specification.
40     """
41     ROUTE_FAMILY = RF_L2VPN_FLOWSPEC
42     VPN_PATH_CLASS = L2VPNFlowSpecPath
43     VPN_NLRI_CLASS = FlowSpecL2VPNNLRI
44
45
46 class L2vpnFlowSpecDest(VRFFlowSpecDest):
47     ROUTE_FAMILY = RF_L2VPN_FLOWSPEC
48
49
50 class L2vpnFlowSpecTable(VRFFlowSpecTable):
51     """Virtual Routing and Forwarding information base
52     for L2VPN Flow Specification.
53     """
54     ROUTE_FAMILY = RF_L2VPN_FLOWSPEC
55     VPN_ROUTE_FAMILY = RF_L2VPN_FLOWSPEC
56     NLRI_CLASS = FlowSpecL2VPNNLRI
57     VRF_PATH_CLASS = L2vpnFlowSpecPath
58     VRF_DEST_CLASS = L2vpnFlowSpecDest