summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorShinpei Muraoka <shinpei.muraoka@gmail.com>2017-03-21 09:50:48 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-03-28 09:55:58 +0900
commitf12485e6de514f8a9af9317347150f6018accc0e (patch)
tree8b07dbd3f80c8c937859448e5fc642bd0af578df
parentfd16c43a31aa91a2b1432e4ddf1be875d272cb5f (diff)
packet/bgp: Fix subtype for Traffic Filtering Actions of Flow Specification
This patch sets the constant value so that you can omit argument "subtype" for Traffic Filtering Action of Flow Specification. Signed-off-by: Shinpei Muraoka <shinpei.muraoka@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/lib/packet/bgp.py44
1 files changed, 40 insertions, 4 deletions
diff --git a/ryu/lib/packet/bgp.py b/ryu/lib/packet/bgp.py
index 5314890e..1a5bd65e 100644
--- a/ryu/lib/packet/bgp.py
+++ b/ryu/lib/packet/bgp.py
@@ -3853,7 +3853,14 @@ class BGPEvpnEsImportRTExtendedCommunity(_ExtendedCommunity):
@_ExtendedCommunity.register_type(_ExtendedCommunity.FLOWSPEC_TRAFFIC_RATE)
class BGPFlowSpecTrafficRateCommunity(_ExtendedCommunity):
"""
- Flow Specification Traffic Filtering Actions for Traffic Rate
+ Flow Specification Traffic Filtering Actions for Traffic Rate.
+
+ ========================== ===============================================
+ Attribute Description
+ ========================== ===============================================
+ as_number Autonomous System number.
+ rate_info rate information.
+ ========================== ===============================================
"""
# 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -3866,6 +3873,7 @@ class BGPFlowSpecTrafficRateCommunity(_ExtendedCommunity):
def __init__(self, **kwargs):
super(BGPFlowSpecTrafficRateCommunity, self).__init__()
+ kwargs['subtype'] = self.SUBTYPE_FLOWSPEC_TRAFFIC_RATE
self.do_init(BGPFlowSpecTrafficRateCommunity, self, kwargs)
@classmethod
@@ -3886,7 +3894,15 @@ class BGPFlowSpecTrafficRateCommunity(_ExtendedCommunity):
@_ExtendedCommunity.register_type(_ExtendedCommunity.FLOWSPEC_TRAFFIC_ACTION)
class BGPFlowSpecTrafficActionCommunity(_ExtendedCommunity):
"""
- Flow Specification Traffic Filtering Actions for Traffic Action
+ Flow Specification Traffic Filtering Actions for Traffic Action.
+
+ ========================== ===============================================
+ Attribute Description
+ ========================== ===============================================
+ action Apply action.
+ The supported action are
+ ``SAMPLE`` and ``TERMINAL``.
+ ========================== ===============================================
"""
# 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -3908,21 +3924,40 @@ class BGPFlowSpecTrafficActionCommunity(_ExtendedCommunity):
def __init__(self, **kwargs):
super(BGPFlowSpecTrafficActionCommunity, self).__init__()
+ kwargs['subtype'] = self.SUBTYPE_FLOWSPEC_TRAFFIC_ACTION
self.do_init(BGPFlowSpecTrafficActionCommunity, self, kwargs)
@_ExtendedCommunity.register_type(_ExtendedCommunity.FLOWSPEC_REDIRECT)
class BGPFlowSpecRedirectCommunity(BGPTwoOctetAsSpecificExtendedCommunity):
"""
- Flow Specification Traffic Filtering Actions for Redirect
+ Flow Specification Traffic Filtering Actions for Redirect.
+
+ ========================== ===============================================
+ Attribute Description
+ ========================== ===============================================
+ as_number Autonomous System number.
+ local_administrator Local Administrator.
+ ========================== ===============================================
"""
+ def __init__(self, **kwargs):
+ super(BGPTwoOctetAsSpecificExtendedCommunity, self).__init__()
+ kwargs['subtype'] = self.SUBTYPE_FLOWSPEC_REDIRECT
+ self.do_init(BGPTwoOctetAsSpecificExtendedCommunity, self, kwargs)
+
@_ExtendedCommunity.register_type(
_ExtendedCommunity.FLOWSPEC_TRAFFIC_REMARKING)
class BGPFlowSpecTrafficMarkingCommunity(_ExtendedCommunity):
"""
- Flow Specification Traffic Filtering Actions for Traffic Marking
+ Flow Specification Traffic Filtering Actions for Traffic Marking.
+
+ ========================== ===============================================
+ Attribute Description
+ ========================== ===============================================
+ dscp Differentiated Services Code Point.
+ ========================== ===============================================
"""
# 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -3935,6 +3970,7 @@ class BGPFlowSpecTrafficMarkingCommunity(_ExtendedCommunity):
def __init__(self, **kwargs):
super(BGPFlowSpecTrafficMarkingCommunity, self).__init__()
+ kwargs['subtype'] = self.SUBTYPE_FLOWSPEC_TRAFFIC_REMARKING
self.do_init(BGPFlowSpecTrafficMarkingCommunity, self, kwargs)
@classmethod