mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-05-09 22:36:10 +02:00
bgp: use _class_suffixes to support various AddrPrefix
the AddrPrefix which variable 'nlri' has is not limited to _BinAddrPrefix. this patch enables to encode to/decode from json dict with various AddrPrefix in 'nlri'. Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
fc2b0b0f9c
commit
f01af327c8
@ -1958,7 +1958,7 @@ class BGPUnknownExtendedCommunity(_ExtendedCommunity):
|
||||
class BGPPathAttributeMpReachNLRI(_PathAttribute):
|
||||
_VALUE_PACK_STR = '!HBB' # afi, safi, next hop len
|
||||
_ATTR_FLAGS = BGP_ATTR_FLAG_OPTIONAL
|
||||
_class_prefixes = ['_BinAddrPrefix']
|
||||
_class_suffixes = ['AddrPrefix']
|
||||
_rd_length = 8
|
||||
|
||||
def __init__(self, afi, safi, next_hop, nlri,
|
||||
@ -2056,7 +2056,7 @@ class BGPPathAttributeMpReachNLRI(_PathAttribute):
|
||||
class BGPPathAttributeMpUnreachNLRI(_PathAttribute):
|
||||
_VALUE_PACK_STR = '!HB' # afi, safi
|
||||
_ATTR_FLAGS = BGP_ATTR_FLAG_OPTIONAL
|
||||
_class_prefixes = ['_BinAddrPrefix']
|
||||
_class_suffixes = ['AddrPrefix']
|
||||
|
||||
def __init__(self, afi, safi, withdrawn_routes,
|
||||
flags=0, type_=None, length=None):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user