diff options
author | Xiao Peng <penxiao@cisco.com> | 2014-08-09 22:24:39 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-08-09 22:24:39 +0900 |
commit | 712460fa932b56f5a762cbe68845e3835eb1b9ac (patch) | |
tree | 15df8f411b6030832d771b89e22de7ffe8e4f14a | |
parent | 7f3af19754ee90d77d9e77e36dbcbf2ab8e8bbde (diff) |
packet/bgp: add open capability code of 128
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/lib/packet/bgp.py | 8 | ||||
-rw-r--r-- | ryu/tests/unit/packet/test_bgp.py | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/ryu/lib/packet/bgp.py b/ryu/lib/packet/bgp.py index 5526ab60..3cace687 100644 --- a/ryu/lib/packet/bgp.py +++ b/ryu/lib/packet/bgp.py @@ -53,6 +53,9 @@ BGP_CAP_CARRYING_LABEL_INFO = 4 # RFC 3107 BGP_CAP_FOUR_OCTET_AS_NUMBER = 65 # RFC 4893 BGP_CAP_ENHANCED_ROUTE_REFRESH = 70 # https://tools.ietf.org/html/\ # draft-ietf-idr-bgp-enhanced-route-refresh-05 +BGP_CAP_ROUTE_REFRESH_CISCO = 128 # in cisco routers, there are two\ +# route refresh code: one using the capability code of 128 (old), +# another using the capability code of 2 (new). BGP_ATTR_FLAG_OPTIONAL = 1 << 7 BGP_ATTR_FLAG_TRANSITIVE = 1 << 6 @@ -1181,6 +1184,11 @@ class BGPOptParamCapabilityRouteRefresh(_OptParamEmptyCapability): pass +@_OptParamCapability.register_type(BGP_CAP_ROUTE_REFRESH_CISCO) +class BGPOptParamCapabilityCiscoRouteRefresh(_OptParamEmptyCapability): + pass + + @_OptParamCapability.register_type(BGP_CAP_ENHANCED_ROUTE_REFRESH) class BGPOptParamCapabilityEnhancedRouteRefresh(_OptParamEmptyCapability): pass diff --git a/ryu/tests/unit/packet/test_bgp.py b/ryu/tests/unit/packet/test_bgp.py index 0b563536..057443f3 100644 --- a/ryu/tests/unit/packet/test_bgp.py +++ b/ryu/tests/unit/packet/test_bgp.py @@ -45,6 +45,7 @@ class Test_bgp(unittest.TestCase): opt_param = [bgp.BGPOptParamCapabilityUnknown(cap_code=200, cap_value='hoge'), bgp.BGPOptParamCapabilityRouteRefresh(), + bgp.BGPOptParamCapabilityCiscoRouteRefresh(), bgp.BGPOptParamCapabilityMultiprotocol( afi=afi.IP, safi=safi.MPLS_VPN), bgp.BGPOptParamCapabilityCarryingLabelInfo(), |