From 897ffbfbd828fe17a2d3e3d3049f4c002a6cd7da Mon Sep 17 00:00:00 2001 From: "prz@zeta2.ch" Date: Thu, 12 Oct 2023 19:12:33 +0200 Subject: [PATCH 01/10] newest schemas --- rift/common/__init__.py | 18 +++-- rift/common/constants.py | 13 +++- rift/common/ttypes.py | 30 +++++--- rift/encoding/__init__.py | 16 ++--- rift/encoding/constants.py | 13 +++- rift/encoding/ttypes.py | 115 +++++++++++++++++++++++++++---- topology/yaml_topology_schema.md | 77 ++++++++++++++++----- 7 files changed, 220 insertions(+), 62 deletions(-) diff --git a/rift/common/__init__.py b/rift/common/__init__.py index aba2c7f4..a3e90108 100644 --- a/rift/common/__init__.py +++ b/rift/common/__init__.py @@ -1,11 +1,9 @@ -#very, very magic code to cleanup the immutable schema to allow old code to modify rift packets - +# +# +# $Id +# +# Copyright (c) 2021, Juniper Networks, Inc. +# All rights reserved. +# +# __all__ = ['ttypes', 'constants'] - -from . import ttypes - -for _klass in dir(ttypes): - try: - delattr(getattr(ttypes, _klass),"__setattr__") - except (KeyError, AttributeError): - pass diff --git a/rift/common/constants.py b/rift/common/constants.py index 564a28ca..a5d0ce7d 100644 --- a/rift/common/constants.py +++ b/rift/common/constants.py @@ -1,4 +1,11 @@ - +# +# +# $Id +# +# Copyright (c) 2021, Juniper Networks, Inc. +# All rights reserved. +# +# # # Autogenerated by Thrift Compiler (1.0.0-dev) # @@ -41,6 +48,8 @@ default_tie_udp_flood_port = 915 default_mtu_size = 1400 bfd_default = True +keyvaluetarget_default = 0 +keyvaluetarget_all_south_leaves = -1 undefined_nonce = 0 undefined_securitykey_id = 0 maximum_valid_nonce_delta = 5 @@ -49,7 +58,9 @@ default_fabric_id = 1 default_acting_auto_evpn_dci_when_tof = False default_autoevpn_model = 0 +AUTO_EVPN_SUPPORT_DEFAULT = False default_autofr_model = 0 IllegalClusterID = 0 DefaultClusterID = 1 MinFloodReflectionPreference = 0 +AUTO_FLOOD_REFLECTION_SUPPORT = False diff --git a/rift/common/ttypes.py b/rift/common/ttypes.py index 164e725c..b32959f8 100644 --- a/rift/common/ttypes.py +++ b/rift/common/ttypes.py @@ -1,4 +1,11 @@ - +# +# +# $Id +# +# Copyright (c) 2021, Juniper Networks, Inc. +# All rights reserved. +# +# # # Autogenerated by Thrift Compiler (1.0.0-dev) # @@ -183,17 +190,20 @@ class RouteType(object): class KVTypes(object): - OUI = 1 + Experimental = 1 WellKnown = 2 + OUI = 3 _VALUES_TO_NAMES = { - 1: "OUI", + 1: "Experimental", 2: "WellKnown", + 3: "OUI", } _NAMES_TO_VALUES = { - "OUI": 1, + "Experimental": 1, "WellKnown": 2, + "OUI": 3, } @@ -213,17 +223,17 @@ class AutoFRModel(object): """ """ - TunnelMode = 0 - NoTunnelMode = 1 + NoTunnelMode = 0 + TunnelMode = 1 _VALUES_TO_NAMES = { - 0: "TunnelMode", - 1: "NoTunnelMode", + 0: "NoTunnelMode", + 1: "TunnelMode", } _NAMES_TO_VALUES = { - "TunnelMode": 0, - "NoTunnelMode": 1, + "NoTunnelMode": 0, + "TunnelMode": 1, } diff --git a/rift/encoding/__init__.py b/rift/encoding/__init__.py index 197bf787..a3e90108 100644 --- a/rift/encoding/__init__.py +++ b/rift/encoding/__init__.py @@ -1,9 +1,9 @@ +# +# +# $Id +# +# Copyright (c) 2021, Juniper Networks, Inc. +# All rights reserved. +# +# __all__ = ['ttypes', 'constants'] - -from . import ttypes - -for _klass in dir(ttypes): - try: - delattr(getattr(ttypes, _klass),"__setattr__") - except (KeyError, AttributeError): - pass diff --git a/rift/encoding/constants.py b/rift/encoding/constants.py index e6ec875d..d932ad72 100644 --- a/rift/encoding/constants.py +++ b/rift/encoding/constants.py @@ -1,4 +1,11 @@ - +# +# +# $Id +# +# Copyright (c) 2021, Juniper Networks, Inc. +# All rights reserved. +# +# # # Autogenerated by Thrift Compiler (1.0.0-dev) # @@ -11,5 +18,5 @@ from thrift.protocol.TProtocol import TProtocolException import sys from .ttypes import * -protocol_major_version = 6 -protocol_minor_version = 1 +protocol_major_version = 7 +protocol_minor_version = 0 diff --git a/rift/encoding/ttypes.py b/rift/encoding/ttypes.py index fc8c4403..b6d97b57 100644 --- a/rift/encoding/ttypes.py +++ b/rift/encoding/ttypes.py @@ -1,4 +1,11 @@ - +# +# +# $Id +# +# Copyright (c) 2021, Juniper Networks, Inc. +# All rights reserved. +# +# # # Autogenerated by Thrift Compiler (1.0.0-dev) # @@ -31,18 +38,18 @@ class PacketHeader(object): thrift_spec = ( None, # 0 - (1, TType.BYTE, 'major_version', None, 6, ), # 1 - (2, TType.I16, 'minor_version', None, 1, ), # 2 + (1, TType.BYTE, 'major_version', None, 7, ), # 1 + (2, TType.I16, 'minor_version', None, 0, ), # 2 (3, TType.I64, 'sender', None, None, ), # 3 (4, TType.BYTE, 'level', None, None, ), # 4 ) def __init__(self, major_version=thrift_spec[1][4], minor_version=thrift_spec[2][4], sender=None, level=None,): if major_version is self.thrift_spec[1][4]: - major_version = 6 + major_version = 7 self.major_version = major_version if minor_version is self.thrift_spec[2][4]: - minor_version = 1 + minor_version = 0 self.minor_version = minor_version self.sender = sender self.level = level @@ -334,7 +341,7 @@ class NodeCapabilities(object): thrift_spec = ( None, # 0 - (1, TType.I16, 'protocol_minor_version', None, 1, ), # 1 + (1, TType.I16, 'protocol_minor_version', None, 0, ), # 1 (2, TType.BOOL, 'flood_reduction', None, True, ), # 2 (3, TType.I32, 'hierarchy_indications', None, None, ), # 3 None, # 4 @@ -358,7 +365,7 @@ class NodeCapabilities(object): def __init__(self, protocol_minor_version=thrift_spec[1][4], flood_reduction=thrift_spec[2][4], hierarchy_indications=None, auto_evpn_support=thrift_spec[10][4], auto_flood_reflection_support=thrift_spec[20][4],): if protocol_minor_version is self.thrift_spec[1][4]: - protocol_minor_version = 1 + protocol_minor_version = 0 super(NodeCapabilities, self).__setattr__('protocol_minor_version', protocol_minor_version) super(NodeCapabilities, self).__setattr__('flood_reduction', flood_reduction) super(NodeCapabilities, self).__setattr__('hierarchy_indications', hierarchy_indications) @@ -1835,8 +1842,8 @@ class NodeTIEElement(object): - pod: PoD to which the node belongs. - startup_time: optional startup time of the node - miscabled_links: If any local links are miscabled, this indication is flooded. - - same_plane_tofs: ToFs in the same plane. Only carried by ToF. Multiple node TIEs can carry disjoint sets of ToFs - which can be joined to form a single set. Used in complex multi-plane elections. + - same_plane_tofs: ToFs in the same plane. Only carried by ToF. Multiple Node TIEs can carry disjoint sets of ToFs + which MUST be joined to form a single set. - auto_evpn_version: It provides optional version of EVPN ZTP as 256 * MAJOR + MINOR, if set auto EVPN is enabled. - fabric_id: It provides the optional ID of the Fabric configured - auto_evpn_model: provides optionally the EVPN model supported @@ -1858,7 +1865,7 @@ class NodeTIEElement(object): None, # 9 (10, TType.SET, 'miscabled_links', (TType.I32, None, True), None, ), # 10 None, # 11 - (12, TType.SET, 'same_plane_tofs', (TType.I64, None, False), None, ), # 12 + (12, TType.SET, 'same_plane_tofs', (TType.I64, None, True), None, ), # 12 None, # 13 None, # 14 None, # 15 @@ -1993,6 +2000,7 @@ def read(cls, iprot): _elem46 = iprot.readI64() __var_same_plane_tofs.add(_elem46) iprot.readSetEnd() + __var_same_plane_tofs = frozenset(__var_same_plane_tofs) else: iprot.skip(ftype) elif fid == 21: @@ -2413,6 +2421,84 @@ def __ne__(self, other): return not (self == other) +class KeyValueTIEElementContent(object): + """ + Defines the targeted nodes and the value carried. + + Attributes: + - targets + - value + """ + + thrift_spec = ( + None, # 0 + (1, TType.I64, 'targets', None, 0, ), # 1 + (2, TType.STRING, 'value', 'BINARY', None, ), # 2 + ) + + def __init__(self, targets=thrift_spec[1][4], value=None,): + if targets is self.thrift_spec[1][4]: + targets = 0 + self.targets = targets + self.value = value + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + return + self.targets = None + self.value = None + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I64: + self.targets = iprot.readI64() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.value = iprot.readBinary() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('KeyValueTIEElementContent') + if self.targets is not None: + oprot.writeFieldBegin('targets', TType.I64, 1) + oprot.writeI64(self.targets) + oprot.writeFieldEnd() + if self.value is not None: + oprot.writeFieldBegin('value', TType.STRING, 2) + oprot.writeBinary(self.value) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + + class KeyValueTIEElement(object): """ Generic key value pairs. @@ -2423,7 +2509,7 @@ class KeyValueTIEElement(object): thrift_spec = ( None, # 0 - (1, TType.MAP, 'keyvalues', (TType.I32, None, TType.STRING, 'BINARY', False), None, ), # 1 + (1, TType.MAP, 'keyvalues', (TType.I32, None, TType.STRUCT, (KeyValueTIEElementContent, KeyValueTIEElementContent.thrift_spec), False), None, ), # 1 ) def __init__(self, keyvalues=None,): @@ -2454,7 +2540,8 @@ def read(cls, iprot): (_ktype68, _vtype69, _size67) = iprot.readMapBegin() for _i71 in range(_size67): _key72 = iprot.readI32() - _val73 = iprot.readBinary() + _val73 = KeyValueTIEElementContent() + _val73.read(iprot) __var_keyvalues[_key72] = _val73 iprot.readMapEnd() else: @@ -2474,10 +2561,10 @@ def write(self, oprot): oprot.writeStructBegin('KeyValueTIEElement') if self.keyvalues is not None: oprot.writeFieldBegin('keyvalues', TType.MAP, 1) - oprot.writeMapBegin(TType.I32, TType.STRING, len(self.keyvalues)) + oprot.writeMapBegin(TType.I32, TType.STRUCT, len(self.keyvalues)) for kiter74, viter75 in self.keyvalues.items(): oprot.writeI32(kiter74) - oprot.writeBinary(viter75) + viter75.write(oprot) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() diff --git a/topology/yaml_topology_schema.md b/topology/yaml_topology_schema.md index 6fb6ed2d..a1fcf977 100644 --- a/topology/yaml_topology_schema.md +++ b/topology/yaml_topology_schema.md @@ -10,46 +10,59 @@ format below. We use an intuitive, loose format. The multiplicity is presented a # comments {1} const: - {?} keys: {8} + {?} authentication_keys: {8} {+} - id: <24-bit key number> {1} algorithm: [hmac-sha-256] {1} secret: - {?} private-secret: {7} + {?} private-secret: {7} {1} shards: {+} - id: <64-bit integer shard identifier> {1} nodes: - {*} - name: + {*} - name: {?} passive (1) - {1} level: [ | undefined | leaf | leaf-2-leaf | top-of-fabric ] (2) + {1} level: [ | undefined | leaf | leaf-2-leaf | top-of-fabric ] {2} {1} systemid: <64-bit integer> {?} rx_lie_mcast_address: (5) + in dotted notation, e.g. 224.0.0.2> {5} {?} rx_lie_v6_mcast_address: (5) - {1} rx_lie_port: (4) + {1} rx_lie_port: {4} {?}X state_thrift_services_port: {?}X config_thrift_services_port: {?} generate_defaults: - {?} active_key: <24-bit key number> - {?} tie_validation: [none|permissive|loose|strict] (6) + {?} authentication_keys: {9} + {?} tie_origination_authentication_key: <24-bit key number> + {?} tie_authentication_validation: [none|permissive|loose|strict] {6} {1} interfaces: {*} - name: {?} bandwidth: {?} metric: 0, if not given, schema default> {?} tx_lie_port: (3) + unique within the configuration> {3} {?} rx_lie_port: (3) + unique within the configuration> {3} {?} rx_tie_port: (3) + within the configuration> {3} {?} advertise_subnet: - {?} active_key: <8-bit key number> - {?} accept_keys: - {?} link_validation: [none|permissive|loose|strict] (6) + {?} active_authentication_key: <8-bit key number> + {?} accept_authentication_keys: + {?} link_authentication_validation: [none|permissive|loose|strict] {6} + {?} allow_horizontal: + {?} address_families: (11) + {?} bfd: string + {?} failure-probability-per-minute: + {?} maximum-allowed-failures: = 0> + {?} average-secs-remain-in-down: 0> + {?} southbound-key-values: + {?} system-id: {19} + {?} northbound-key-values: + {*} - key: <32 bit number> + {1} value: sequence of bytes {?} v4prefixes: {*} - address: {1} mask: @@ -58,6 +71,13 @@ format below. We use an intuitive, loose format. The multiplicity is presented a {*} - address: {1} mask: {1} metric: 0> + {?} auto-evpn: (13) + {?} fabric-id: (14) + {?} evis: (15) + {?} ignore-leaf-level-neighbors: + {?} act-as-dci-gateway: (16) + {?} auto-flood-reflection: (17) + {?} cluster-id: (18) (1) Passive nodes are not started but just used to match up correct ports and addresses. This is very useful in e.g. interoperability testing where such a node can be started as @@ -83,6 +103,31 @@ format below. We use an intuitive, loose format. The multiplicity is presented a - permissive: accept if key id unknown - loose: check if authentication present, otherwise accept -{7} only necessary if it's a private/public key pair +(7) only necessary if it's a private/public key pair + +(8) those are both TIE and link security keys. Only key ID < 256 can be used for link keys. + +(9) these numbers are IDs of the keys specified in the `authentication_keys` clause. If not defined, + all `authentication_keys` are used on the node. + +(10) the bfd clause enables BFD. Further clauses set failure probability per minute + (BFD will recover after failure within the specified average number of seconds) + and max. number of failures limits how many times the link can fail. + +(11) default for address families is both + +(13) clause starts AUTO EVPN calculations and analytics + +(14) if not present, default fabric ID is assumed + +(15) if not present, default # of EVIs is assumed + +(16) if not present, schema default (false) is assumed + +(17) clause starts AUTO FLOOD REFLECTION calculations and analytics + +(18) if not present, default cluster ID is assumed + +(19) if not present, default is false. Observe that if this overlaps the other + defined southbound key values the behavior is undefined. -{8} \ No newline at end of file From 619b50a633d8a1541c58c5a195b9e784ba81d648 Mon Sep 17 00:00:00 2001 From: "prz@zeta2.ch" Date: Thu, 12 Oct 2023 21:05:30 +0200 Subject: [PATCH 02/10] newest 3.10 support --- requirements-3-10.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/requirements-3-10.txt b/requirements-3-10.txt index 2c1ff75e..b2242e4b 100644 --- a/requirements-3-10.txt +++ b/requirements-3-10.txt @@ -3,14 +3,14 @@ appdirs==1.4.4 astroid==2.12.7 atomicwrites==1.4.1 attrs==22.1.0 -awscli==1.25.67 -botocore==1.27.66 +awscli==1.29.62 +botocore==1.31.62 CacheControl==0.12.11 Cerberus==1.3.4 certifi==2022.6.15 chardet==5.0.0 charset-normalizer==2.1.1 -codecov==2.1.12 +codecov==2.1.13 colorama==0.4.4 contextlib2==21.6.0 coverage==6.4.4 @@ -51,12 +51,12 @@ python-dateutil==2.8.2 pytoml==0.1.21 pytoolconfig==1.2.2 pytricia==1.0.2 -PyYAML==5.4.1 +PyYAML==6.0.1 requests==2.28.1 retrying==1.3.3 rope==1.3.0 rsa==4.7.2 -s3transfer==0.6.0 +s3transfer==0.7.0 six==1.16.0 sortedcontainers==2.4.0 thrift==0.16.0 From 63fe5d0d5febd74026364696055a9ef7a9402838 Mon Sep 17 00:00:00 2001 From: "prz@zeta2.ch" Date: Fri, 13 Oct 2023 19:14:24 +0200 Subject: [PATCH 03/10] newest 3.10 support --- rift/common/__init__.py | 9 +++++++++ rift/encoding/__init__.py | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/rift/common/__init__.py b/rift/common/__init__.py index a3e90108..663802d3 100644 --- a/rift/common/__init__.py +++ b/rift/common/__init__.py @@ -7,3 +7,12 @@ # # __all__ = ['ttypes', 'constants'] + +from . import ttypes + +for _klass in dir(ttypes): + try: + delattr(getattr(ttypes, _klass),"__setattr__") + except (KeyError, AttributeError): + pass + diff --git a/rift/encoding/__init__.py b/rift/encoding/__init__.py index a3e90108..9a373732 100644 --- a/rift/encoding/__init__.py +++ b/rift/encoding/__init__.py @@ -7,3 +7,11 @@ # # __all__ = ['ttypes', 'constants'] + +from . import ttypes + +for _klass in dir(ttypes): + try: + delattr(getattr(ttypes, _klass),"__setattr__") + except (KeyError, AttributeError): + pass From 287efdb6ae1bdaaf1bfad2924bdefe7bf2f9343c Mon Sep 17 00:00:00 2001 From: "prz@zeta2.ch" Date: Fri, 13 Oct 2023 21:54:57 +0200 Subject: [PATCH 04/10] schema update --- tests/test_packet_common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_packet_common.py b/tests/test_packet_common.py index 34e9c052..6b41a402 100644 --- a/tests/test_packet_common.py +++ b/tests/test_packet_common.py @@ -435,8 +435,8 @@ def test_fix_key_value_tie_packet(): external_prefixes=None, keyvalues=encoding.ttypes.KeyValueTIEElement( keyvalues={ - 1: b"een", - 2: b"twee" + 1: encoding.ttypes.KeyValueTIEElementContent(value=b"een"), + 2: encoding.ttypes.KeyValueTIEElementContent(value=b"twee"), } ) ) From 6355e39179b33fd20a02a8fb2996fe4b9aa597c9 Mon Sep 17 00:00:00 2001 From: "prz@zeta2.ch" Date: Mon, 1 Jan 2024 15:22:22 +0100 Subject: [PATCH 05/10] bruno's review and pullup to 8.x schema --- rift/common.thrift | 57 +++++-------------- rift/common/__init__.py | 10 +--- rift/common/constants.py | 9 +-- rift/common/ttypes.py | 9 +-- rift/encoding.thrift | 112 +++++++++++++------------------------ rift/encoding/__init__.py | 17 +----- rift/encoding/constants.py | 11 +--- rift/encoding/ttypes.py | 76 ++++++++++++------------- 8 files changed, 98 insertions(+), 203 deletions(-) diff --git a/rift/common.thrift b/rift/common.thrift index 460085ef..b368d5d5 100644 --- a/rift/common.thrift +++ b/rift/common.thrift @@ -4,7 +4,6 @@ namespace py common -namespace rs models /** @note MUST be interpreted in implementation as unsigned 64 bits. */ @@ -147,6 +146,14 @@ const MTUSizeType default_mtu_size = 1400 /** default link being BFD capable */ const bool bfd_default = true +/** type used to target nodes with key value */ +typedef i64 KeyValueTargetType + +/** default target for key value are all nodes. */ +const KeyValueTargetType keyvaluetarget_default = 0 +/** value for _all leaves_ addressing. Represented by all bits set. */ +const KeyValueTargetType keyvaluetarget_all_south_leaves = -1 + /** undefined nonce, equivalent to missing nonce */ const NonceType undefined_nonce = 0; /** outer security key id, MUST be interpreted as in implementation @@ -183,13 +190,13 @@ enum AddressFamilyType { struct IPv4PrefixType { 1: required IPv4Address address; 2: required PrefixLenType prefixlen; -} (python.immutable = "") +} /** IPv6 prefix type. */ struct IPv6PrefixType { 1: required IPv6Address address; 2: required PrefixLenType prefixlen; -} (python.immutable = "") +} /** IP address type. */ union IPAddressType { @@ -197,7 +204,7 @@ union IPAddressType { 1: optional IPv4Address ipv4address; /** Content is IPv6 */ 2: optional IPv6Address ipv6address; -} (python.immutable = "") +} /** Prefix advertisement. @@ -210,7 +217,7 @@ union IPAddressType { union IPPrefixType { 1: optional IPv4PrefixType ipv4prefix; 2: optional IPv6PrefixType ipv6prefix; -} (python.immutable = "") +} /** Sequence of a prefix in case of move. */ @@ -272,45 +279,11 @@ enum RouteType { } enum KVTypes { - OUI = 1, - WellKnown = 2, -} - -/** - EVPN Fabric ID */ -typedef i16 FabricIDType - -const FabricIDType undefined_fabric_id = 0 -const FabricIDType default_fabric_id = 1 - -const bool default_acting_auto_evpn_dci_when_tof = false - -enum AutoEVPNModel { - ERB_VLAN_BUNDLE = 0, + Experimental = 1, + WellKnown = 2, + OUI = 3, } -const AutoEVPNModel default_autoevpn_model = AutoEVPNModel.ERB_VLAN_BUNDLE - -/** */ - -/** */ - -enum AutoFRModel { - /** Full Mesh of L1 tunnel shortcuts, only model supported currently with auto FR */ - TunnelMode = 0, - NoTunnelMode = 1, -} - -const AutoFRModel default_autofr_model = AutoFRModel.TunnelMode - -typedef i32 FloodReflectionClusterIDType -/* maybe used in future for special purposes */ -const FloodReflectionClusterIDType IllegalClusterID = 0 -const FloodReflectionClusterIDType DefaultClusterID = 1 -/// preference to become FR, higher is better -typedef i32 FloodReflectionPreferenceType -const FloodReflectionPreferenceType MinFloodReflectionPreference = 0 -/** */ diff --git a/rift/common/__init__.py b/rift/common/__init__.py index 663802d3..806d6f91 100644 --- a/rift/common/__init__.py +++ b/rift/common/__init__.py @@ -1,11 +1,5 @@ -# -# -# $Id -# -# Copyright (c) 2021, Juniper Networks, Inc. -# All rights reserved. -# -# +#very, very magic code to cleanup the immutable schema to allow old code to modify rift packets + __all__ = ['ttypes', 'constants'] from . import ttypes diff --git a/rift/common/constants.py b/rift/common/constants.py index a5d0ce7d..9dd1586f 100644 --- a/rift/common/constants.py +++ b/rift/common/constants.py @@ -1,11 +1,4 @@ -# -# -# $Id -# -# Copyright (c) 2021, Juniper Networks, Inc. -# All rights reserved. -# -# + # # Autogenerated by Thrift Compiler (1.0.0-dev) # diff --git a/rift/common/ttypes.py b/rift/common/ttypes.py index b32959f8..27669a14 100644 --- a/rift/common/ttypes.py +++ b/rift/common/ttypes.py @@ -1,11 +1,4 @@ -# -# -# $Id -# -# Copyright (c) 2021, Juniper Networks, Inc. -# All rights reserved. -# -# + # # Autogenerated by Thrift Compiler (1.0.0-dev) # diff --git a/rift/encoding.thrift b/rift/encoding.thrift index 39979d2e..502d2413 100644 --- a/rift/encoding.thrift +++ b/rift/encoding.thrift @@ -1,19 +1,16 @@ /** Thrift file for packet encodings for RIFT - Copyright (c) Juniper Networks, Inc., 2016- - All rights reserved. */ include "common.thrift" -namespace rs models namespace py encoding /** Represents protocol encoding schema major version */ -const common.VersionType protocol_major_version = 6 +const common.VersionType protocol_major_version = 8 /** Represents protocol encoding schema minor version */ -const common.MinorVersionType protocol_minor_version = 1 +const common.MinorVersionType protocol_minor_version = 0 /** Common RIFT packet header. */ struct PacketHeader { @@ -39,7 +36,7 @@ struct Community { 1: required i32 top; /** Lower order bits */ 2: required i32 bottom; -} (python.immutable = "") +} /** Neighbor structure. */ struct Neighbor { @@ -47,7 +44,7 @@ struct Neighbor { 1: required common.SystemIDType originator; /** ID of remote side of the link. */ 2: required common.LinkIDType remote_id; -} (python.immutable = "") +} /** Capabilities the node supports. */ struct NodeCapabilities { @@ -62,16 +59,8 @@ struct NodeCapabilities { procedures. */ 3: optional common.HierarchyIndications hierarchy_indications; - /** - indicates whether auto-evpn feature is implemented on this node (but not necessarily enabled). */ - 10: optional bool auto_evpn_support = false; - /** */ - /** - indicates whether auto-flood-reflection feature is implemented on this node (but not necessarily enabled). */ - 20: optional bool auto_flood_reflection_support = false; - /** */ -} (python.immutable = "") +} /** Link capabilities. */ struct LinkCapabilities { @@ -81,7 +70,7 @@ struct LinkCapabilities { /** Indicates whether the interface will support IPv4 forwarding. */ 2: optional bool ipv4_forwarding_capable = true; -} (python.immutable = "") +} /** RIFT LIE Packet. @@ -134,19 +123,10 @@ struct LIEPacket { /** Instance name in case multiple RIFT instances running on same interface. */ 24: optional string instance_name; - /** - provides the optional ID of the configured auto-evpn fabric. */ - 35: optional common.FabricIDType fabric_id; - /** provides optional version of EVPN ZTP as 256 * MAJOR + MINOR */ - 36: optional i16 auto_evpn_version; - /** */ - - /** */ - /** It provides optional version of FR ZTP as 256 * MAJOR + MINOR, indicates support for auto FR */ - 40: optional i16 auto_flood_reflection_version; - - 41: optional common.FloodReflectionClusterIDType auto_flood_reflection_cluster_id; - /** */ + /** It provides the optional ID of the Fabric configured. This MUST match the information advertised + on the node element. */ + 35: optional common.FabricIDType fabric_id = common.default_fabric_id; + } /** LinkID pair describes one of parallel links between two nodes. */ @@ -171,8 +151,8 @@ struct LinkIDPair { /** Optional indication which address families are up on the interface */ 14: optional set - (python.immutable = "") address_families; -} (python.immutable = "") + address_families; +} /** Unique ID of a TIE. */ struct TIEID { @@ -184,7 +164,7 @@ struct TIEID { 3: required common.TIETypeType tietype; /** number of the tie */ 4: required common.TIENrType tie_nr; -} (python.immutable = "") +} /** Header of a TIE. */ struct TIEHeader { @@ -215,13 +195,13 @@ struct TIDEPacket { 2: required TIEID end_range; /** _Sorted_ list of headers. */ 3: required list - (python.immutable = "") headers; + headers; } /** TIRE packet */ struct TIREPacket { 1: required set - (python.immutable = "") headers; + headers; } /** neighbor of a node */ @@ -233,22 +213,18 @@ struct NodeNeighborsTIEElement { = common.default_distance; /** can carry description of multiple parallel links in a TIE */ 4: optional set - (python.immutable = "") link_ids; + link_ids; /** total bandwith to neighbor as sum of all parallel links */ 5: optional common.BandwithInMegaBitsType bandwidth = common.default_bandwidth; -} (python.immutable = "") +} /** Indication flags of the node. */ struct NodeFlags { /** Indicates that node is in overload, do not transit traffic through it. */ 1: optional bool overload = common.overload_default; - /** */ - /** acting as DCI for auto-evpn, necessary for proper RR election where DCIs are preferred */ - 10: optional bool acting_auto_evpn_dci_when_tof = common.default_acting_auto_evpn_dci_when_tof, - /** */ -} (python.immutable = "") +} /** Description of a node. */ struct NodeTIEElement { @@ -270,32 +246,18 @@ struct NodeTIEElement { /** If any local links are miscabled, this indication is flooded. */ 10: optional set - (python.immutable = "") miscabled_links; + miscabled_links; - /** ToFs in the same plane. Only carried by ToF. Multiple node TIEs can carry disjoint sets of ToFs - which can be joined to form a single set. Used in complex multi-plane elections. */ - 12: optional set same_plane_tofs; + /** ToFs in the same plane. Only carried by ToF. Multiple Node TIEs can carry disjoint sets of ToFs + which MUST be joined to form a single set. */ + 12: optional set + same_plane_tofs; - /** */ - /** All Auto EVPN elements MUST be present in at least one node TIE in each direction if auto evpn is running. */ - /** It provides optional version of EVPN ZTP as 256 * MAJOR + MINOR, if set auto EVPN is enabled. */ - 21: optional i16 auto_evpn_version; /** It provides the optional ID of the Fabric configured */ - 22: optional common.FabricIDType fabric_id = common.default_fabric_id; - /** provides optionally the EVPN model supported */ - 25: optional common.AutoEVPNModel auto_evpn_model = common.AutoEVPNModel.ERB_VLAN_BUNDLE, - /** */ - - /** */ - /** All Auto FR elements MUST be present in at least one TIE in each direction if auto FR is running. */ - /** It provides optional version of FR ZTP as 256 * MAJOR + MINOR, if set indicates auto FR is enabled. */ - 30: optional i16 auto_flood_reflection_version; - /** cluster ID of Auto FR */ - 31: optional common.FloodReflectionClusterIDType auto_flood_reflection_cluster_id; - /** preference to become FR, if not set it indicates that the node cannot perform flood reflection role */ - 32: optional common.FloodReflectionPreferenceType auto_flood_reflection_preference; - /** */ -} (python.immutable = "") + 20: optional common.FabricIDType fabric_id = common.default_fabric_id; + + +} /** Attributes of a prefix. */ struct PrefixAttributes { @@ -306,7 +268,7 @@ struct PrefixAttributes { to other protocols or use within the context of real time analytics. */ 3: optional set - (python.immutable = "") tags; + tags; /** Monotonic clock for mobile addresses. */ 4: optional common.PrefixSequenceType monotonic_clock; /** Indicates if the prefix is a node loopback. */ @@ -317,18 +279,24 @@ struct PrefixAttributes { 10: optional common.LinkIDType from_link; /** Optional, per prefix significant label. */ 12: optional common.LabelType label; -} (python.immutable = "") +} /** TIE carrying prefixes */ struct PrefixTIEElement { /** Prefixes with the associated attributes. */ 1: required map prefixes; -} (python.immutable = "") +} + +/** Defines the targeted nodes and the value carried. */ +struct KeyValueTIEElementContent { + 1: optional common.KeyValueTargetType targets = common.keyvaluetarget_default; + 2: optional binary value; +} /** Generic key value pairs. */ struct KeyValueTIEElement { - 1: required map keyvalues; -} (python.immutable = "") + 1: required map keyvalues; +} /** Single element in a TIE. */ union TIEElement { @@ -347,7 +315,7 @@ union TIEElement { positive_external_disaggregation_prefixes; /** Key-Value store elements. */ 9: optional KeyValueTIEElement keyvalues; -} (python.immutable = "") +} /** TIE packet */ struct TIEPacket { @@ -367,4 +335,4 @@ union PacketContent { struct ProtocolPacket { 1: required PacketHeader header; 2: required PacketContent content; -} \ No newline at end of file +} diff --git a/rift/encoding/__init__.py b/rift/encoding/__init__.py index 9a373732..110e7952 100644 --- a/rift/encoding/__init__.py +++ b/rift/encoding/__init__.py @@ -1,17 +1,2 @@ -# -# -# $Id -# -# Copyright (c) 2021, Juniper Networks, Inc. -# All rights reserved. -# -# -__all__ = ['ttypes', 'constants'] - -from . import ttypes -for _klass in dir(ttypes): - try: - delattr(getattr(ttypes, _klass),"__setattr__") - except (KeyError, AttributeError): - pass +__all__ = ['ttypes', 'constants'] diff --git a/rift/encoding/constants.py b/rift/encoding/constants.py index d932ad72..358c41c6 100644 --- a/rift/encoding/constants.py +++ b/rift/encoding/constants.py @@ -1,11 +1,4 @@ -# -# -# $Id -# -# Copyright (c) 2021, Juniper Networks, Inc. -# All rights reserved. -# -# + # # Autogenerated by Thrift Compiler (1.0.0-dev) # @@ -18,5 +11,5 @@ from thrift.protocol.TProtocol import TProtocolException import sys from .ttypes import * -protocol_major_version = 7 +protocol_major_version = 8 protocol_minor_version = 0 diff --git a/rift/encoding/ttypes.py b/rift/encoding/ttypes.py index b6d97b57..aa9b158c 100644 --- a/rift/encoding/ttypes.py +++ b/rift/encoding/ttypes.py @@ -1,11 +1,4 @@ -# -# -# $Id -# -# Copyright (c) 2021, Juniper Networks, Inc. -# All rights reserved. -# -# + # # Autogenerated by Thrift Compiler (1.0.0-dev) # @@ -38,7 +31,7 @@ class PacketHeader(object): thrift_spec = ( None, # 0 - (1, TType.BYTE, 'major_version', None, 7, ), # 1 + (1, TType.BYTE, 'major_version', None, 8, ), # 1 (2, TType.I16, 'minor_version', None, 0, ), # 2 (3, TType.I64, 'sender', None, None, ), # 3 (4, TType.BYTE, 'level', None, None, ), # 4 @@ -46,7 +39,7 @@ class PacketHeader(object): def __init__(self, major_version=thrift_spec[1][4], minor_version=thrift_spec[2][4], sender=None, level=None,): if major_version is self.thrift_spec[1][4]: - major_version = 7 + major_version = 8 self.major_version = major_version if minor_version is self.thrift_spec[2][4]: minor_version = 0 @@ -334,9 +327,8 @@ class NodeCapabilities(object): leaf only (in ZTP) or support for leaf-2-leaf procedures. - auto_evpn_support: - indicates whether auto-evpn feature is implemented on this node (but not necessarily enabled). - - auto_flood_reflection_support: - indicates whether auto-flood-reflection feature is implemented on this node (but not necessarily enabled). + /** indicates whether auto-evpn feature is implemented on this node (but not necessarily enabled). + - auto_flood_reflection_support: indicates whether auto-flood-reflection feature is implemented on this node (but not necessarily enabled). """ thrift_spec = ( @@ -596,11 +588,11 @@ class LIEPacket(object): all other TIEs. Ignored when received from southbound neighbor. - instance_name: Instance name in case multiple RIFT instances running on same interface. - - fabric_id: - provides the optional ID of the configured auto-evpn fabric. - - auto_evpn_version: provides optional version of EVPN ZTP as 256 * MAJOR + MINOR - - auto_flood_reflection_version: It provides optional version of FR ZTP as 256 * MAJOR + MINOR, indicates support for auto FR - - auto_flood_reflection_cluster_id + - fabric_id: It provides the optional ID of the Fabric configured. This MUST match the information advertised + on the node element. + - auto_evpn_version: It provides optional version of EVPN ZTP as 256 * MAJOR + MINOR + - auto_flood_reflection_version: It provides optional version of flood-reflection ZTP as 256 * MAJOR + MINOR, indicates support for auto FR. + - auto_flood_reflection_cluster_id: It provides the cluster ID of flood reflection cluster. """ thrift_spec = ( @@ -639,7 +631,7 @@ class LIEPacket(object): None, # 32 None, # 33 None, # 34 - (35, TType.I16, 'fabric_id', None, None, ), # 35 + (35, TType.I16, 'fabric_id', None, 1, ), # 35 (36, TType.I16, 'auto_evpn_version', None, None, ), # 36 None, # 37 None, # 38 @@ -648,7 +640,7 @@ class LIEPacket(object): (41, TType.I32, 'auto_flood_reflection_cluster_id', None, None, ), # 41 ) - def __init__(self, name=None, local_id=None, flood_port=thrift_spec[3][4], link_mtu_size=thrift_spec[4][4], link_bandwidth=thrift_spec[5][4], neighbor=None, pod=thrift_spec[7][4], node_capabilities=None, link_capabilities=None, holdtime=thrift_spec[12][4], label=None, not_a_ztp_offer=thrift_spec[21][4], you_are_flood_repeater=thrift_spec[22][4], you_are_sending_too_quickly=thrift_spec[23][4], instance_name=None, fabric_id=None, auto_evpn_version=None, auto_flood_reflection_version=None, auto_flood_reflection_cluster_id=None,): + def __init__(self, name=None, local_id=None, flood_port=thrift_spec[3][4], link_mtu_size=thrift_spec[4][4], link_bandwidth=thrift_spec[5][4], neighbor=None, pod=thrift_spec[7][4], node_capabilities=None, link_capabilities=None, holdtime=thrift_spec[12][4], label=None, not_a_ztp_offer=thrift_spec[21][4], you_are_flood_repeater=thrift_spec[22][4], you_are_sending_too_quickly=thrift_spec[23][4], instance_name=None, fabric_id=thrift_spec[35][4], auto_evpn_version=None, auto_flood_reflection_version=None, auto_flood_reflection_cluster_id=None,): self.name = name self.local_id = local_id if flood_port is self.thrift_spec[3][4]: @@ -674,6 +666,8 @@ def __init__(self, name=None, local_id=None, flood_port=thrift_spec[3][4], link_ self.you_are_flood_repeater = you_are_flood_repeater self.you_are_sending_too_quickly = you_are_sending_too_quickly self.instance_name = instance_name + if fabric_id is self.thrift_spec[35][4]: + fabric_id = 1 self.fabric_id = fabric_id self.auto_evpn_version = auto_evpn_version self.auto_flood_reflection_version = auto_flood_reflection_version @@ -1844,12 +1838,14 @@ class NodeTIEElement(object): - miscabled_links: If any local links are miscabled, this indication is flooded. - same_plane_tofs: ToFs in the same plane. Only carried by ToF. Multiple Node TIEs can carry disjoint sets of ToFs which MUST be joined to form a single set. - - auto_evpn_version: It provides optional version of EVPN ZTP as 256 * MAJOR + MINOR, if set auto EVPN is enabled. - fabric_id: It provides the optional ID of the Fabric configured - - auto_evpn_model: provides optionally the EVPN model supported + - auto_evpn_version: All Auto EVPN elements MUST be present in at least one node TIE in each direction if auto-evpn is running. + It provides optional version of EVPN ZTP as 256 * MAJOR + MINOR, if set auto EVPN is enabled. + - auto_evpn_model: provides optionally the auto-evpn EVPN model supported - auto_flood_reflection_version: It provides optional version of FR ZTP as 256 * MAJOR + MINOR, if set indicates auto FR is enabled. - - auto_flood_reflection_cluster_id: cluster ID of Auto FR - - auto_flood_reflection_preference: preference to become FR, if not set it indicates that the node cannot perform flood reflection role + - auto_flood_reflection_cluster_id: cluster ID of auto-flood-reflection + - auto_flood_reflection_preference: preference to become flood reflector in auto-flood-reflection, + if not set it indicates that the node cannot perform flood reflection role. """ thrift_spec = ( @@ -1873,9 +1869,9 @@ class NodeTIEElement(object): None, # 17 None, # 18 None, # 19 - None, # 20 + (20, TType.I16, 'fabric_id', None, 1, ), # 20 (21, TType.I16, 'auto_evpn_version', None, None, ), # 21 - (22, TType.I16, 'fabric_id', None, 1, ), # 22 + None, # 22 None, # 23 None, # 24 (25, TType.I32, 'auto_evpn_model', None, 0, ), # 25 @@ -1888,7 +1884,7 @@ class NodeTIEElement(object): (32, TType.I32, 'auto_flood_reflection_preference', None, None, ), # 32 ) - def __init__(self, level=None, neighbors=None, capabilities=None, flags=None, name=None, pod=None, startup_time=None, miscabled_links=None, same_plane_tofs=None, auto_evpn_version=None, fabric_id=thrift_spec[22][4], auto_evpn_model=thrift_spec[25][4], auto_flood_reflection_version=None, auto_flood_reflection_cluster_id=None, auto_flood_reflection_preference=None,): + def __init__(self, level=None, neighbors=None, capabilities=None, flags=None, name=None, pod=None, startup_time=None, miscabled_links=None, same_plane_tofs=None, fabric_id=thrift_spec[20][4], auto_evpn_version=None, auto_evpn_model=thrift_spec[25][4], auto_flood_reflection_version=None, auto_flood_reflection_cluster_id=None, auto_flood_reflection_preference=None,): super(NodeTIEElement, self).__setattr__('level', level) super(NodeTIEElement, self).__setattr__('neighbors', neighbors) super(NodeTIEElement, self).__setattr__('capabilities', capabilities) @@ -1898,10 +1894,10 @@ def __init__(self, level=None, neighbors=None, capabilities=None, flags=None, na super(NodeTIEElement, self).__setattr__('startup_time', startup_time) super(NodeTIEElement, self).__setattr__('miscabled_links', miscabled_links) super(NodeTIEElement, self).__setattr__('same_plane_tofs', same_plane_tofs) - super(NodeTIEElement, self).__setattr__('auto_evpn_version', auto_evpn_version) - if fabric_id is self.thrift_spec[22][4]: + if fabric_id is self.thrift_spec[20][4]: fabric_id = 1 super(NodeTIEElement, self).__setattr__('fabric_id', fabric_id) + super(NodeTIEElement, self).__setattr__('auto_evpn_version', auto_evpn_version) super(NodeTIEElement, self).__setattr__('auto_evpn_model', auto_evpn_model) super(NodeTIEElement, self).__setattr__('auto_flood_reflection_version', auto_flood_reflection_version) super(NodeTIEElement, self).__setattr__('auto_flood_reflection_cluster_id', auto_flood_reflection_cluster_id) @@ -1914,7 +1910,7 @@ def __delattr__(self, *args): raise TypeError("can't modify immutable instance") def __hash__(self): - return hash(self.__class__) ^ hash((self.level, self.neighbors, self.capabilities, self.flags, self.name, self.pod, self.startup_time, self.miscabled_links, self.same_plane_tofs, self.auto_evpn_version, self.fabric_id, self.auto_evpn_model, self.auto_flood_reflection_version, self.auto_flood_reflection_cluster_id, self.auto_flood_reflection_preference, )) + return hash(self.__class__) ^ hash((self.level, self.neighbors, self.capabilities, self.flags, self.name, self.pod, self.startup_time, self.miscabled_links, self.same_plane_tofs, self.fabric_id, self.auto_evpn_version, self.auto_evpn_model, self.auto_flood_reflection_version, self.auto_flood_reflection_cluster_id, self.auto_flood_reflection_preference, )) @classmethod def read(cls, iprot): @@ -1929,8 +1925,8 @@ def read(cls, iprot): __var_startup_time= None __var_miscabled_links= None __var_same_plane_tofs= None - __var_auto_evpn_version= None __var_fabric_id= None + __var_auto_evpn_version= None __var_auto_evpn_model= None __var_auto_flood_reflection_version= None __var_auto_flood_reflection_cluster_id= None @@ -2003,14 +1999,14 @@ def read(cls, iprot): __var_same_plane_tofs = frozenset(__var_same_plane_tofs) else: iprot.skip(ftype) - elif fid == 21: + elif fid == 20: if ftype == TType.I16: - __var_auto_evpn_version = iprot.readI16() + __var_fabric_id = iprot.readI16() else: iprot.skip(ftype) - elif fid == 22: + elif fid == 21: if ftype == TType.I16: - __var_fabric_id = iprot.readI16() + __var_auto_evpn_version = iprot.readI16() else: iprot.skip(ftype) elif fid == 25: @@ -2047,8 +2043,8 @@ def read(cls, iprot): startup_time=__var_startup_time, miscabled_links=__var_miscabled_links, same_plane_tofs=__var_same_plane_tofs, - auto_evpn_version=__var_auto_evpn_version, fabric_id=__var_fabric_id, + auto_evpn_version=__var_auto_evpn_version, auto_evpn_model=__var_auto_evpn_model, auto_flood_reflection_version=__var_auto_flood_reflection_version, auto_flood_reflection_cluster_id=__var_auto_flood_reflection_cluster_id, @@ -2106,14 +2102,14 @@ def write(self, oprot): oprot.writeI64(iter50) oprot.writeSetEnd() oprot.writeFieldEnd() + if self.fabric_id is not None: + oprot.writeFieldBegin('fabric_id', TType.I16, 20) + oprot.writeI16(self.fabric_id) + oprot.writeFieldEnd() if self.auto_evpn_version is not None: oprot.writeFieldBegin('auto_evpn_version', TType.I16, 21) oprot.writeI16(self.auto_evpn_version) oprot.writeFieldEnd() - if self.fabric_id is not None: - oprot.writeFieldBegin('fabric_id', TType.I16, 22) - oprot.writeI16(self.fabric_id) - oprot.writeFieldEnd() if self.auto_evpn_model is not None: oprot.writeFieldBegin('auto_evpn_model', TType.I32, 25) oprot.writeI32(self.auto_evpn_model) From 5ebb1ba1d47a9fb724d76106f9ae4947d289a610 Mon Sep 17 00:00:00 2001 From: "prz@zeta2.ch" Date: Mon, 1 Jan 2024 15:55:34 +0100 Subject: [PATCH 06/10] usual tomfoolery with the ever incompatible python versions --- rift/encoding/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rift/encoding/__init__.py b/rift/encoding/__init__.py index 110e7952..806d6f91 100644 --- a/rift/encoding/__init__.py +++ b/rift/encoding/__init__.py @@ -1,2 +1,12 @@ +#very, very magic code to cleanup the immutable schema to allow old code to modify rift packets __all__ = ['ttypes', 'constants'] + +from . import ttypes + +for _klass in dir(ttypes): + try: + delattr(getattr(ttypes, _klass),"__setattr__") + except (KeyError, AttributeError): + pass + From 4795c046559e8bcbce47b04b8d4c532f55e86ab4 Mon Sep 17 00:00:00 2001 From: prz Date: Fri, 9 May 2025 08:55:48 +0200 Subject: [PATCH 07/10] pulling up to newest RFC schema version and python things. --- README.md | 3 +- doc/features.md | 4 +- doc/notes.txt | 5 + rift/common.thrift | 54 +- rift/common/__init__.py | 2 - rift/common/constants.py | 5 +- rift/common/ttypes.py | 162 ++--- rift/encoding.thrift | 140 +++-- rift/encoding/__init__.py | 2 - rift/encoding/constants.py | 5 +- rift/encoding/ttypes.py | 1161 ++++++++++++++++++------------------ 11 files changed, 830 insertions(+), 713 deletions(-) diff --git a/README.md b/README.md index 17f97489..6b904cc0 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,7 @@ # Routing In Fat Trees (RIFT) -This repository contains a Python implementation of the Routing In Fat Trees (RIFT) protocol specified in Internet Draft (ID) -[draft-draft-rift-15](https://www.ietf.org/archive/id/draft-ietf-rift-rift-15.pdf) +This repository contains a Python implementation of the Routing In Fat Trees (RIFT) protocol specified in [RFC 9692](https://www.rfc-editor.org/rfc/rfc9692.pdf) The code is currently still a work in progress (see Feature List below for the status). diff --git a/doc/features.md b/doc/features.md index da315da1..2f830fe0 100644 --- a/doc/features.md +++ b/doc/features.md @@ -2,9 +2,9 @@ ## Supported version -RIFT draft version: [draft-ietf-rift-rift-12](https://tools.ietf.org/pdf/draft-ietf-rift-rift-12.pdf) +RIFT [RFC 9692](https://www.rfc-editor.org/rfc/rfc9692.pdf) -Thrift data model version: 4.1 +Thrift data model version: 6.1 (w/o auto-evpn or auto-fabric support) ## Adjacencies diff --git a/doc/notes.txt b/doc/notes.txt index 9531f1ab..08d21b02 100644 --- a/doc/notes.txt +++ b/doc/notes.txt @@ -29,6 +29,11 @@ Generate Python code: thrift --gen py -out . common.thrift thrift --gen py -out . encoding.thrift +Observe that after generating the code due to python 3.10 having +changed lots of previous types to immutables the code diffs +to __init__.py have to be restored to allow mutations to +ttypes classes again. + *** Helpful commands for debugging Detailed listing of UDP sockets: diff --git a/rift/common.thrift b/rift/common.thrift index b368d5d5..e53d1f3e 100644 --- a/rift/common.thrift +++ b/rift/common.thrift @@ -4,6 +4,7 @@ namespace py common +namespace rs models /** @note MUST be interpreted in implementation as unsigned 64 bits. */ @@ -190,13 +191,13 @@ enum AddressFamilyType { struct IPv4PrefixType { 1: required IPv4Address address; 2: required PrefixLenType prefixlen; -} +} (python.immutable = "") /** IPv6 prefix type. */ struct IPv6PrefixType { 1: required IPv6Address address; 2: required PrefixLenType prefixlen; -} +} (python.immutable = "") /** IP address type. */ union IPAddressType { @@ -204,7 +205,7 @@ union IPAddressType { 1: optional IPv4Address ipv4address; /** Content is IPv6 */ 2: optional IPv6Address ipv6address; -} +} (python.immutable = "") /** Prefix advertisement. @@ -217,7 +218,7 @@ union IPAddressType { union IPPrefixType { 1: optional IPv4PrefixType ipv4prefix; 2: optional IPv6PrefixType ipv6prefix; -} +} (python.immutable = "") /** Sequence of a prefix in case of move. */ @@ -284,6 +285,51 @@ enum KVTypes { OUI = 3, } +typedef i16 FabricIDType +const FabricIDType undefined_fabric_id = 0 +const FabricIDType default_fabric_id = 1 +/** */ +/** EVPN Fabric ID */ + +const bool default_acting_auto_evpn_dci_when_tof = false + +enum AutoEVPNModel { + ERB_VLAN_BUNDLE = 0, +} + +const AutoEVPNModel default_autoevpn_model = AutoEVPNModel.ERB_VLAN_BUNDLE + +const bool AUTO_EVPN_SUPPORT_DEFAULT = false + +/** */ + +/** */ + +enum AutoFRModel { + /** Full Mesh of L1 tunnel shortcuts, only model supported currently with auto FR */ + NoTunnelMode = 0, + TunnelMode = 1, +} + +const AutoFRModel default_autofr_model = AutoFRModel.NoTunnelMode + +typedef i32 FloodReflectionClusterIDType + +/* maybe used in future for special purposes */ +const FloodReflectionClusterIDType IllegalClusterID = 0 +const FloodReflectionClusterIDType DefaultClusterID = 1 + +/** preference to become FR, higher is better */ +typedef i32 FloodReflectionPreferenceType + +const FloodReflectionPreferenceType MinFloodReflectionPreference = 0 + +const bool AUTO_FLOOD_REFLECTION_SUPPORT = false +/** */ + +/** */ + +/** */ diff --git a/rift/common/__init__.py b/rift/common/__init__.py index 806d6f91..e8ebf949 100644 --- a/rift/common/__init__.py +++ b/rift/common/__init__.py @@ -1,5 +1,3 @@ -#very, very magic code to cleanup the immutable schema to allow old code to modify rift packets - __all__ = ['ttypes', 'constants'] from . import ttypes diff --git a/rift/common/constants.py b/rift/common/constants.py index 9dd1586f..37441ed6 100644 --- a/rift/common/constants.py +++ b/rift/common/constants.py @@ -1,6 +1,5 @@ - # -# Autogenerated by Thrift Compiler (1.0.0-dev) +# Autogenerated by Thrift Compiler (0.15.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # @@ -9,6 +8,8 @@ from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException +from thrift.TRecursive import fix_spec + import sys from .ttypes import * undefined_packet_number = 0 diff --git a/rift/common/ttypes.py b/rift/common/ttypes.py index 27669a14..7af2f3bc 100644 --- a/rift/common/ttypes.py +++ b/rift/common/ttypes.py @@ -1,6 +1,5 @@ - # -# Autogenerated by Thrift Compiler (1.0.0-dev) +# Autogenerated by Thrift Compiler (0.15.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # @@ -9,14 +8,18 @@ from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException +from thrift.TRecursive import fix_spec + import sys from thrift.transport import TTransport +all_structs = [] class HierarchyIndications(object): """ Flags indicating node configuration in case of ZTP. + """ leaf_only = 0 leaf_only_and_leaf_2_leaf_procedures = 1 @@ -38,6 +41,7 @@ class HierarchyIndications(object): class TieDirectionType(object): """ Direction of TIEs. + """ Illegal = 0 South = 1 @@ -62,6 +66,7 @@ class TieDirectionType(object): class AddressFamilyType(object): """ Address family type. + """ Illegal = 0 AddressFamilyMinValue = 1 @@ -89,6 +94,7 @@ class AddressFamilyType(object): class TIETypeType(object): """ Type of TIE. + """ Illegal = 0 TIETypeMinValue = 1 @@ -137,6 +143,7 @@ class RouteType(object): @note: The only purpose of those values is to introduce an ordering whereas an implementation can choose internally any other values as long the ordering is preserved + """ Illegal = 0 RouteTypeMinValue = 1 @@ -215,6 +222,7 @@ class AutoEVPNModel(object): class AutoFRModel(object): """ + """ NoTunnelMode = 0 TunnelMode = 1 @@ -238,13 +246,9 @@ class IEEE802_1ASTimeStampType(object): Attributes: - AS_sec - AS_nsec + """ - thrift_spec = ( - None, # 0 - (1, TType.I64, 'AS_sec', None, None, ), # 1 - (2, TType.I32, 'AS_nsec', None, None, ), # 2 - ) def __init__(self, AS_sec=None, AS_nsec=None,): self.AS_sec = AS_sec @@ -252,10 +256,8 @@ def __init__(self, AS_sec=None, AS_nsec=None,): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return - self.AS_sec = None - self.AS_nsec = None iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() @@ -278,7 +280,7 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('IEEE802_1ASTimeStampType') if self.AS_sec is not None: @@ -316,13 +318,9 @@ class IPv4PrefixType(object): Attributes: - address - prefixlen + """ - thrift_spec = ( - None, # 0 - (1, TType.I32, 'address', None, None, ), # 1 - (2, TType.BYTE, 'prefixlen', None, None, ), # 2 - ) def __init__(self, address=None, prefixlen=None,): super(IPv4PrefixType, self).__setattr__('address', address) @@ -340,22 +338,22 @@ def __hash__(self): @classmethod def read(cls, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and cls.thrift_spec is not None: - return iprot._fast_decode(None, iprot, (cls, cls.thrift_spec)) - __var_address= None - __var_prefixlen= None + return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec]) iprot.readStructBegin() + address = None + prefixlen = None while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: - __var_address = iprot.readI32() + address = iprot.readI32() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.BYTE: - __var_prefixlen = iprot.readByte() + prefixlen = iprot.readByte() else: iprot.skip(ftype) else: @@ -363,13 +361,13 @@ def read(cls, iprot): iprot.readFieldEnd() iprot.readStructEnd() return cls( - address=__var_address, - prefixlen=__var_prefixlen, + address=address, + prefixlen=prefixlen, ) def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('IPv4PrefixType') if self.address is not None: @@ -409,13 +407,9 @@ class IPv6PrefixType(object): Attributes: - address - prefixlen + """ - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'address', 'BINARY', None, ), # 1 - (2, TType.BYTE, 'prefixlen', None, None, ), # 2 - ) def __init__(self, address=None, prefixlen=None,): super(IPv6PrefixType, self).__setattr__('address', address) @@ -433,22 +427,22 @@ def __hash__(self): @classmethod def read(cls, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and cls.thrift_spec is not None: - return iprot._fast_decode(None, iprot, (cls, cls.thrift_spec)) - __var_address= None - __var_prefixlen= None + return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec]) iprot.readStructBegin() + address = None + prefixlen = None while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRING: - __var_address = iprot.readBinary() + address = iprot.readBinary() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.BYTE: - __var_prefixlen = iprot.readByte() + prefixlen = iprot.readByte() else: iprot.skip(ftype) else: @@ -456,13 +450,13 @@ def read(cls, iprot): iprot.readFieldEnd() iprot.readStructEnd() return cls( - address=__var_address, - prefixlen=__var_prefixlen, + address=address, + prefixlen=prefixlen, ) def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('IPv6PrefixType') if self.address is not None: @@ -502,13 +496,9 @@ class IPAddressType(object): Attributes: - ipv4address: Content is IPv4 - ipv6address: Content is IPv6 + """ - thrift_spec = ( - None, # 0 - (1, TType.I32, 'ipv4address', None, None, ), # 1 - (2, TType.STRING, 'ipv6address', 'BINARY', None, ), # 2 - ) def __init__(self, ipv4address=None, ipv6address=None,): super(IPAddressType, self).__setattr__('ipv4address', ipv4address) @@ -526,22 +516,22 @@ def __hash__(self): @classmethod def read(cls, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and cls.thrift_spec is not None: - return iprot._fast_decode(None, iprot, (cls, cls.thrift_spec)) - __var_ipv4address= None - __var_ipv6address= None + return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec]) iprot.readStructBegin() + ipv4address = None + ipv6address = None while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: - __var_ipv4address = iprot.readI32() + ipv4address = iprot.readI32() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: - __var_ipv6address = iprot.readBinary() + ipv6address = iprot.readBinary() else: iprot.skip(ftype) else: @@ -549,13 +539,13 @@ def read(cls, iprot): iprot.readFieldEnd() iprot.readStructEnd() return cls( - ipv4address=__var_ipv4address, - ipv6address=__var_ipv6address, + ipv4address=ipv4address, + ipv6address=ipv6address, ) def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('IPAddressType') if self.ipv4address is not None: @@ -597,13 +587,9 @@ class IPPrefixType(object): Attributes: - ipv4prefix - ipv6prefix + """ - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'ipv4prefix', (IPv4PrefixType, IPv4PrefixType.thrift_spec), None, ), # 1 - (2, TType.STRUCT, 'ipv6prefix', (IPv6PrefixType, IPv6PrefixType.thrift_spec), None, ), # 2 - ) def __init__(self, ipv4prefix=None, ipv6prefix=None,): super(IPPrefixType, self).__setattr__('ipv4prefix', ipv4prefix) @@ -621,22 +607,22 @@ def __hash__(self): @classmethod def read(cls, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and cls.thrift_spec is not None: - return iprot._fast_decode(None, iprot, (cls, cls.thrift_spec)) - __var_ipv4prefix= None - __var_ipv6prefix= None + return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec]) iprot.readStructBegin() + ipv4prefix = None + ipv6prefix = None while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: - __var_ipv4prefix = IPv4PrefixType.read(iprot) + ipv4prefix = IPv4PrefixType.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: - __var_ipv6prefix = IPv6PrefixType.read(iprot) + ipv6prefix = IPv6PrefixType.read(iprot) else: iprot.skip(ftype) else: @@ -644,13 +630,13 @@ def read(cls, iprot): iprot.readFieldEnd() iprot.readStructEnd() return cls( - ipv4prefix=__var_ipv4prefix, - ipv6prefix=__var_ipv6prefix, + ipv4prefix=ipv4prefix, + ipv6prefix=ipv6prefix, ) def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('IPPrefixType') if self.ipv4prefix is not None: @@ -686,13 +672,9 @@ class PrefixSequenceType(object): Attributes: - timestamp - transactionid: Transaction ID set by client in e.g. in 6LoWPAN. + """ - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'timestamp', (IEEE802_1ASTimeStampType, IEEE802_1ASTimeStampType.thrift_spec), None, ), # 1 - (2, TType.BYTE, 'transactionid', None, None, ), # 2 - ) def __init__(self, timestamp=None, transactionid=None,): self.timestamp = timestamp @@ -700,10 +682,8 @@ def __init__(self, timestamp=None, transactionid=None,): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return - self.timestamp = None - self.transactionid = None iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() @@ -727,7 +707,7 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('PrefixSequenceType') if self.timestamp is not None: @@ -756,3 +736,41 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(IEEE802_1ASTimeStampType) +IEEE802_1ASTimeStampType.thrift_spec = ( + None, # 0 + (1, TType.I64, 'AS_sec', None, None, ), # 1 + (2, TType.I32, 'AS_nsec', None, None, ), # 2 +) +all_structs.append(IPv4PrefixType) +IPv4PrefixType.thrift_spec = ( + None, # 0 + (1, TType.I32, 'address', None, None, ), # 1 + (2, TType.BYTE, 'prefixlen', None, None, ), # 2 +) +all_structs.append(IPv6PrefixType) +IPv6PrefixType.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'address', 'BINARY', None, ), # 1 + (2, TType.BYTE, 'prefixlen', None, None, ), # 2 +) +all_structs.append(IPAddressType) +IPAddressType.thrift_spec = ( + None, # 0 + (1, TType.I32, 'ipv4address', None, None, ), # 1 + (2, TType.STRING, 'ipv6address', 'BINARY', None, ), # 2 +) +all_structs.append(IPPrefixType) +IPPrefixType.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'ipv4prefix', [IPv4PrefixType, None], None, ), # 1 + (2, TType.STRUCT, 'ipv6prefix', [IPv6PrefixType, None], None, ), # 2 +) +all_structs.append(PrefixSequenceType) +PrefixSequenceType.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'timestamp', [IEEE802_1ASTimeStampType, None], None, ), # 1 + (2, TType.BYTE, 'transactionid', None, None, ), # 2 +) +fix_spec(all_structs) +del all_structs diff --git a/rift/encoding.thrift b/rift/encoding.thrift index 502d2413..4f45ab67 100644 --- a/rift/encoding.thrift +++ b/rift/encoding.thrift @@ -1,10 +1,13 @@ /** Thrift file for packet encodings for RIFT + Copyright (c) Juniper Networks, Inc., 2016- + All rights reserved. */ include "common.thrift" +namespace rs models namespace py encoding /** Represents protocol encoding schema major version */ @@ -36,7 +39,7 @@ struct Community { 1: required i32 top; /** Lower order bits */ 2: required i32 bottom; -} +} (python.immutable = "") /** Neighbor structure. */ struct Neighbor { @@ -44,23 +47,31 @@ struct Neighbor { 1: required common.SystemIDType originator; /** ID of remote side of the link. */ 2: required common.LinkIDType remote_id; -} +} (python.immutable = "") /** Capabilities the node supports. */ struct NodeCapabilities { /** Must advertise supported minor version dialect that way. */ 1: required common.MinorVersionType protocol_minor_version = protocol_minor_version; - /** indicates that node supports flood reduction. */ + /** Indicates that node supports flood reduction. */ 2: optional bool flood_reduction = common.flood_reduction_default; - /** indicates place in hierarchy, i.e. top-of-fabric or + /** Indicates place in hierarchy, i.e. top-of-fabric or leaf only (in ZTP) or support for leaf-2-leaf procedures. */ 3: optional common.HierarchyIndications hierarchy_indications; + /** + /** Indicates whether auto-evpn feature is implemented on this node (but not necessarily enabled). */ + 10: optional bool auto_evpn_support = common.AUTO_EVPN_SUPPORT_DEFAULT; + /** */ -} + /** */ + /** Indicates whether auto-flood-reflection feature is implemented on this node (but not necessarily enabled). */ + 20: optional bool auto_flood_reflection_support = common.AUTO_FLOOD_REFLECTION_SUPPORT; + /** */ +} (python.immutable = "") /** Link capabilities. */ struct LinkCapabilities { @@ -70,7 +81,7 @@ struct LinkCapabilities { /** Indicates whether the interface will support IPv4 forwarding. */ 2: optional bool ipv4_forwarding_capable = true; -} +} (python.immutable = "") /** RIFT LIE Packet. @@ -84,7 +95,7 @@ struct LIEPacket { /** UDP port to which we can receive flooded TIEs. */ 3: required common.UDPPortType flood_port = common.default_tie_udp_flood_port; - /** Layer 3 MTU, used to discover mismatch. */ + /** Layer 2 MTU, used to discover mismatch. */ 4: optional common.MTUSizeType link_mtu_size = common.default_mtu_size; /** Local link bandwidth on the interface. */ @@ -126,7 +137,17 @@ struct LIEPacket { /** It provides the optional ID of the Fabric configured. This MUST match the information advertised on the node element. */ 35: optional common.FabricIDType fabric_id = common.default_fabric_id; - + /** */ + /** It provides optional version of EVPN ZTP as 256 * MAJOR + MINOR */ + 36: optional i16 auto_evpn_version; + /** */ + + /** */ + /** It provides optional version of flood-reflection ZTP as 256 * MAJOR + MINOR, indicates support for auto FR. */ + 40: optional i16 auto_flood_reflection_version; + /** It provides the cluster ID of flood reflection cluster. */ + 41: optional common.FloodReflectionClusterIDType auto_flood_reflection_cluster_id; + /** */ } /** LinkID pair describes one of parallel links between two nodes. */ @@ -149,35 +170,35 @@ struct LinkIDPair { BFD session. */ 13: optional bool bfd_up; /** Optional indication which address families are up on the - interface */ - 14: optional set - address_families; -} + interface. */ + 14: optional set + (python.immutable = "") address_families; +} (python.immutable = "") /** Unique ID of a TIE. */ struct TIEID { - /** direction of TIE */ + /** Direction of TIE. */ 1: required common.TieDirectionType direction; - /** indicates originator of the TIE */ + /** Indicates originator of TIE. */ 2: required common.SystemIDType originator; - /** type of the tie */ + /** Type of TIE. */ 3: required common.TIETypeType tietype; - /** number of the tie */ + /** Number of TIE. */ 4: required common.TIENrType tie_nr; -} +} (python.immutable = "") /** Header of a TIE. */ struct TIEHeader { - /** ID of the tie. */ + /** ID of TIE. */ 2: required TIEID tieid; - /** Sequence number of the tie. */ + /** Sequence number of TIE. */ 3: required common.SeqNrType seq_nr; - /** Absolute timestamp when the TIE was generated. */ + /** Absolute timestamp when TIE was generated. */ 10: optional common.IEEE802_1ASTimeStampType origination_time; - /** Original lifetime when the TIE was generated. */ + /** Original lifetime when TIE was generated. */ 12: optional common.LifeTimeInSecType origination_lifetime; -} +} /** Header of a TIE as described in TIRE/TIDE. */ @@ -185,7 +206,7 @@ struct TIEHeaderWithLifeTime { 1: required TIEHeader header; /** Remaining lifetime. */ 2: required common.LifeTimeInSecType remaining_lifetime; -} +} /** TIDE with *sorted* TIE headers. */ struct TIDEPacket { @@ -194,37 +215,41 @@ struct TIDEPacket { /** Last TIE header in the tide packet. */ 2: required TIEID end_range; /** _Sorted_ list of headers. */ - 3: required list - headers; + 3: required list + (python.immutable = "") headers; } /** TIRE packet */ struct TIREPacket { - 1: required set - headers; + 1: required set + (python.immutable = "") headers; } /** neighbor of a node */ struct NodeNeighborsTIEElement { - /** level of neighbor */ + /** Level of neighbor. */ 1: required common.LevelType level; - /** Cost to neighbor. Ignore anything larger than `infinite_distance` and `invalid_distance` */ + /** Cost to neighbor. Ignore anything equal or larger than `infinite_distance` and equal to `invalid_distance`. */ 3: optional common.MetricType cost = common.default_distance; - /** can carry description of multiple parallel links in a TIE */ - 4: optional set - link_ids; - /** total bandwith to neighbor as sum of all parallel links */ + /** Carries description of multiple parallel links in a TIE. */ + 4: optional set + (python.immutable = "") link_ids; + /** Total bandwith to neighbor as sum of all parallel links. */ 5: optional common.BandwithInMegaBitsType bandwidth = common.default_bandwidth; -} +} (python.immutable = "") /** Indication flags of the node. */ struct NodeFlags { /** Indicates that node is in overload, do not transit traffic through it. */ 1: optional bool overload = common.overload_default; -} + /** */ + /** Acting as DCI for auto-evpn, necessary for proper RR election where DCIs are preferred. */ + 10: optional bool acting_auto_evpn_dci_when_tof = common.default_acting_auto_evpn_dci_when_tof, + /** */ +} (python.immutable = "") /** Description of a node. */ struct NodeTIEElement { @@ -241,23 +266,42 @@ struct NodeTIEElement { 5: optional string name; /** PoD to which the node belongs. */ 6: optional common.PodType pod; - /** optional startup time of the node */ + /** Optional startup time of the node */ 7: optional common.TimestampInSecsType startup_time; /** If any local links are miscabled, this indication is flooded. */ - 10: optional set - miscabled_links; + 10: optional set + (python.immutable = "") miscabled_links; /** ToFs in the same plane. Only carried by ToF. Multiple Node TIEs can carry disjoint sets of ToFs which MUST be joined to form a single set. */ 12: optional set - same_plane_tofs; + (python.immutable = "") same_plane_tofs; /** It provides the optional ID of the Fabric configured */ 20: optional common.FabricIDType fabric_id = common.default_fabric_id; - -} + /** */ + /** All Auto EVPN elements MUST be present in at least one node TIE in each direction if auto-evpn is running. + It provides optional version of EVPN ZTP as 256 * MAJOR + MINOR, if set auto EVPN is enabled. */ + 21: optional i16 auto_evpn_version; + + /** provides optionally the auto-evpn EVPN model supported */ + 25: optional common.AutoEVPNModel auto_evpn_model = common.AutoEVPNModel.ERB_VLAN_BUNDLE, + /** */ + + /** */ + /** All auto-flood-reflection elements MUST be present in at least one TIE in each direction if + auto-flood-reflection is running. */ + /** It provides optional version of FR ZTP as 256 * MAJOR + MINOR, if set indicates auto FR is enabled. */ + 30: optional i16 auto_flood_reflection_version; + /** Cluster ID of auto-flood-reflection */ + 31: optional common.FloodReflectionClusterIDType auto_flood_reflection_cluster_id; + /** Preference to become flood reflector in auto-flood-reflection, + if not set it indicates that the node cannot perform flood reflection role. */ + 32: optional common.FloodReflectionPreferenceType auto_flood_reflection_preference; + /** */ +} (python.immutable = "") /** Attributes of a prefix. */ struct PrefixAttributes { @@ -267,25 +311,25 @@ struct PrefixAttributes { /** Generic unordered set of route tags, can be redistributed to other protocols or use within the context of real time analytics. */ - 3: optional set - tags; + 3: optional set + (python.immutable = "") tags; /** Monotonic clock for mobile addresses. */ 4: optional common.PrefixSequenceType monotonic_clock; /** Indicates if the prefix is a node loopback. */ 6: optional bool loopback = false; /** Indicates that the prefix is directly attached. */ 7: optional bool directly_attached = true; - /** link to which the address belongs to. */ + /** Link to which the address belongs to. */ 10: optional common.LinkIDType from_link; /** Optional, per prefix significant label. */ 12: optional common.LabelType label; -} +} (python.immutable = "") /** TIE carrying prefixes */ struct PrefixTIEElement { /** Prefixes with the associated attributes. */ 1: required map prefixes; -} +} (python.immutable = "") /** Defines the targeted nodes and the value carried. */ struct KeyValueTIEElementContent { @@ -296,7 +340,7 @@ struct KeyValueTIEElementContent { /** Generic key value pairs. */ struct KeyValueTIEElement { 1: required map keyvalues; -} +} (python.immutable = "") /** Single element in a TIE. */ union TIEElement { @@ -315,7 +359,7 @@ union TIEElement { positive_external_disaggregation_prefixes; /** Key-Value store elements. */ 9: optional KeyValueTIEElement keyvalues; -} +} (python.immutable = "") /** TIE packet */ struct TIEPacket { diff --git a/rift/encoding/__init__.py b/rift/encoding/__init__.py index 806d6f91..e8ebf949 100644 --- a/rift/encoding/__init__.py +++ b/rift/encoding/__init__.py @@ -1,5 +1,3 @@ -#very, very magic code to cleanup the immutable schema to allow old code to modify rift packets - __all__ = ['ttypes', 'constants'] from . import ttypes diff --git a/rift/encoding/constants.py b/rift/encoding/constants.py index 358c41c6..fd51c4f2 100644 --- a/rift/encoding/constants.py +++ b/rift/encoding/constants.py @@ -1,6 +1,5 @@ - # -# Autogenerated by Thrift Compiler (1.0.0-dev) +# Autogenerated by Thrift Compiler (0.15.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # @@ -9,6 +8,8 @@ from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException +from thrift.TRecursive import fix_spec + import sys from .ttypes import * protocol_major_version = 8 diff --git a/rift/encoding/ttypes.py b/rift/encoding/ttypes.py index aa9b158c..9c53ed80 100644 --- a/rift/encoding/ttypes.py +++ b/rift/encoding/ttypes.py @@ -1,6 +1,5 @@ - # -# Autogenerated by Thrift Compiler (1.0.0-dev) +# Autogenerated by Thrift Compiler (0.15.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # @@ -9,10 +8,13 @@ from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException from thrift.protocol.TProtocol import TProtocolException +from thrift.TRecursive import fix_spec + import sys import common.ttypes from thrift.transport import TTransport +all_structs = [] class PacketHeader(object): @@ -27,17 +29,11 @@ class PacketHeader(object): - level: Level of the node sending the packet, required on everything except LIEs. Lack of presence on LIEs indicates UNDEFINED_LEVEL and is used in ZTP procedures. + """ - thrift_spec = ( - None, # 0 - (1, TType.BYTE, 'major_version', None, 8, ), # 1 - (2, TType.I16, 'minor_version', None, 0, ), # 2 - (3, TType.I64, 'sender', None, None, ), # 3 - (4, TType.BYTE, 'level', None, None, ), # 4 - ) - def __init__(self, major_version=thrift_spec[1][4], minor_version=thrift_spec[2][4], sender=None, level=None,): + def __init__(self, major_version=8, minor_version=0, sender=None, level=None,): if major_version is self.thrift_spec[1][4]: major_version = 8 self.major_version = major_version @@ -49,12 +45,8 @@ def __init__(self, major_version=thrift_spec[1][4], minor_version=thrift_spec[2] def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return - self.major_version = None - self.minor_version = None - self.sender = None - self.level = None iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() @@ -87,7 +79,7 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('PacketHeader') if self.major_version is not None: @@ -137,13 +129,9 @@ class Community(object): Attributes: - top: Higher order bits - bottom: Lower order bits + """ - thrift_spec = ( - None, # 0 - (1, TType.I32, 'top', None, None, ), # 1 - (2, TType.I32, 'bottom', None, None, ), # 2 - ) def __init__(self, top=None, bottom=None,): super(Community, self).__setattr__('top', top) @@ -161,22 +149,22 @@ def __hash__(self): @classmethod def read(cls, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and cls.thrift_spec is not None: - return iprot._fast_decode(None, iprot, (cls, cls.thrift_spec)) - __var_top= None - __var_bottom= None + return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec]) iprot.readStructBegin() + top = None + bottom = None while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: - __var_top = iprot.readI32() + top = iprot.readI32() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: - __var_bottom = iprot.readI32() + bottom = iprot.readI32() else: iprot.skip(ftype) else: @@ -184,13 +172,13 @@ def read(cls, iprot): iprot.readFieldEnd() iprot.readStructEnd() return cls( - top=__var_top, - bottom=__var_bottom, + top=top, + bottom=bottom, ) def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('Community') if self.top is not None: @@ -230,13 +218,9 @@ class Neighbor(object): Attributes: - originator: System ID of the originator. - remote_id: ID of remote side of the link. + """ - thrift_spec = ( - None, # 0 - (1, TType.I64, 'originator', None, None, ), # 1 - (2, TType.I32, 'remote_id', None, None, ), # 2 - ) def __init__(self, originator=None, remote_id=None,): super(Neighbor, self).__setattr__('originator', originator) @@ -254,22 +238,22 @@ def __hash__(self): @classmethod def read(cls, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and cls.thrift_spec is not None: - return iprot._fast_decode(None, iprot, (cls, cls.thrift_spec)) - __var_originator= None - __var_remote_id= None + return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec]) iprot.readStructBegin() + originator = None + remote_id = None while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I64: - __var_originator = iprot.readI64() + originator = iprot.readI64() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: - __var_remote_id = iprot.readI32() + remote_id = iprot.readI32() else: iprot.skip(ftype) else: @@ -277,13 +261,13 @@ def read(cls, iprot): iprot.readFieldEnd() iprot.readStructEnd() return cls( - originator=__var_originator, - remote_id=__var_remote_id, + originator=originator, + remote_id=remote_id, ) def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('Neighbor') if self.originator is not None: @@ -322,40 +306,18 @@ class NodeCapabilities(object): Attributes: - protocol_minor_version: Must advertise supported minor version dialect that way. - - flood_reduction: indicates that node supports flood reduction. - - hierarchy_indications: indicates place in hierarchy, i.e. top-of-fabric or + - flood_reduction: Indicates that node supports flood reduction. + - hierarchy_indications: Indicates place in hierarchy, i.e. top-of-fabric or leaf only (in ZTP) or support for leaf-2-leaf procedures. - auto_evpn_support: - /** indicates whether auto-evpn feature is implemented on this node (but not necessarily enabled). - - auto_flood_reflection_support: indicates whether auto-flood-reflection feature is implemented on this node (but not necessarily enabled). + /** Indicates whether auto-evpn feature is implemented on this node (but not necessarily enabled). + - auto_flood_reflection_support: Indicates whether auto-flood-reflection feature is implemented on this node (but not necessarily enabled). + """ - thrift_spec = ( - None, # 0 - (1, TType.I16, 'protocol_minor_version', None, 0, ), # 1 - (2, TType.BOOL, 'flood_reduction', None, True, ), # 2 - (3, TType.I32, 'hierarchy_indications', None, None, ), # 3 - None, # 4 - None, # 5 - None, # 6 - None, # 7 - None, # 8 - None, # 9 - (10, TType.BOOL, 'auto_evpn_support', None, False, ), # 10 - None, # 11 - None, # 12 - None, # 13 - None, # 14 - None, # 15 - None, # 16 - None, # 17 - None, # 18 - None, # 19 - (20, TType.BOOL, 'auto_flood_reflection_support', None, False, ), # 20 - ) - - def __init__(self, protocol_minor_version=thrift_spec[1][4], flood_reduction=thrift_spec[2][4], hierarchy_indications=None, auto_evpn_support=thrift_spec[10][4], auto_flood_reflection_support=thrift_spec[20][4],): + + def __init__(self, protocol_minor_version=0, flood_reduction=True, hierarchy_indications=None, auto_evpn_support=False, auto_flood_reflection_support=False,): if protocol_minor_version is self.thrift_spec[1][4]: protocol_minor_version = 0 super(NodeCapabilities, self).__setattr__('protocol_minor_version', protocol_minor_version) @@ -376,40 +338,40 @@ def __hash__(self): @classmethod def read(cls, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and cls.thrift_spec is not None: - return iprot._fast_decode(None, iprot, (cls, cls.thrift_spec)) - __var_protocol_minor_version= None - __var_flood_reduction= None - __var_hierarchy_indications= None - __var_auto_evpn_support= None - __var_auto_flood_reflection_support= None + return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec]) iprot.readStructBegin() + protocol_minor_version = 0 + flood_reduction = True + hierarchy_indications = None + auto_evpn_support = False + auto_flood_reflection_support = False while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I16: - __var_protocol_minor_version = iprot.readI16() + protocol_minor_version = iprot.readI16() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.BOOL: - __var_flood_reduction = iprot.readBool() + flood_reduction = iprot.readBool() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: - __var_hierarchy_indications = iprot.readI32() + hierarchy_indications = iprot.readI32() else: iprot.skip(ftype) elif fid == 10: if ftype == TType.BOOL: - __var_auto_evpn_support = iprot.readBool() + auto_evpn_support = iprot.readBool() else: iprot.skip(ftype) elif fid == 20: if ftype == TType.BOOL: - __var_auto_flood_reflection_support = iprot.readBool() + auto_flood_reflection_support = iprot.readBool() else: iprot.skip(ftype) else: @@ -417,16 +379,16 @@ def read(cls, iprot): iprot.readFieldEnd() iprot.readStructEnd() return cls( - protocol_minor_version=__var_protocol_minor_version, - flood_reduction=__var_flood_reduction, - hierarchy_indications=__var_hierarchy_indications, - auto_evpn_support=__var_auto_evpn_support, - auto_flood_reflection_support=__var_auto_flood_reflection_support, + protocol_minor_version=protocol_minor_version, + flood_reduction=flood_reduction, + hierarchy_indications=hierarchy_indications, + auto_evpn_support=auto_evpn_support, + auto_flood_reflection_support=auto_flood_reflection_support, ) def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('NodeCapabilities') if self.protocol_minor_version is not None: @@ -476,15 +438,11 @@ class LinkCapabilities(object): Attributes: - bfd: Indicates that the link is supporting BFD. - ipv4_forwarding_capable: Indicates whether the interface will support IPv4 forwarding. + """ - thrift_spec = ( - None, # 0 - (1, TType.BOOL, 'bfd', None, True, ), # 1 - (2, TType.BOOL, 'ipv4_forwarding_capable', None, True, ), # 2 - ) - def __init__(self, bfd=thrift_spec[1][4], ipv4_forwarding_capable=thrift_spec[2][4],): + def __init__(self, bfd=True, ipv4_forwarding_capable=True,): super(LinkCapabilities, self).__setattr__('bfd', bfd) super(LinkCapabilities, self).__setattr__('ipv4_forwarding_capable', ipv4_forwarding_capable) @@ -500,22 +458,22 @@ def __hash__(self): @classmethod def read(cls, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and cls.thrift_spec is not None: - return iprot._fast_decode(None, iprot, (cls, cls.thrift_spec)) - __var_bfd= None - __var_ipv4_forwarding_capable= None + return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec]) iprot.readStructBegin() + bfd = True + ipv4_forwarding_capable = True while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.BOOL: - __var_bfd = iprot.readBool() + bfd = iprot.readBool() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.BOOL: - __var_ipv4_forwarding_capable = iprot.readBool() + ipv4_forwarding_capable = iprot.readBool() else: iprot.skip(ftype) else: @@ -523,13 +481,13 @@ def read(cls, iprot): iprot.readFieldEnd() iprot.readStructEnd() return cls( - bfd=__var_bfd, - ipv4_forwarding_capable=__var_ipv4_forwarding_capable, + bfd=bfd, + ipv4_forwarding_capable=ipv4_forwarding_capable, ) def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('LinkCapabilities') if self.bfd is not None: @@ -568,7 +526,7 @@ class LIEPacket(object): - name: Node or adjacency name. - local_id: Local link ID. - flood_port: UDP port to which we can receive flooded TIEs. - - link_mtu_size: Layer 3 MTU, used to discover mismatch. + - link_mtu_size: Layer 2 MTU, used to discover mismatch. - link_bandwidth: Local link bandwidth on the interface. - neighbor: Reflects the neighbor once received to provide 3-way connectivity. @@ -593,54 +551,11 @@ class LIEPacket(object): - auto_evpn_version: It provides optional version of EVPN ZTP as 256 * MAJOR + MINOR - auto_flood_reflection_version: It provides optional version of flood-reflection ZTP as 256 * MAJOR + MINOR, indicates support for auto FR. - auto_flood_reflection_cluster_id: It provides the cluster ID of flood reflection cluster. + """ - thrift_spec = ( - None, # 0 - (1, TType.STRING, 'name', 'UTF8', None, ), # 1 - (2, TType.I32, 'local_id', None, None, ), # 2 - (3, TType.I16, 'flood_port', None, 915, ), # 3 - (4, TType.I32, 'link_mtu_size', None, 1400, ), # 4 - (5, TType.I32, 'link_bandwidth', None, 100, ), # 5 - (6, TType.STRUCT, 'neighbor', (Neighbor, Neighbor.thrift_spec), None, ), # 6 - (7, TType.I32, 'pod', None, 0, ), # 7 - None, # 8 - None, # 9 - (10, TType.STRUCT, 'node_capabilities', (NodeCapabilities, NodeCapabilities.thrift_spec), None, ), # 10 - (11, TType.STRUCT, 'link_capabilities', (LinkCapabilities, LinkCapabilities.thrift_spec), None, ), # 11 - (12, TType.I16, 'holdtime', None, 3, ), # 12 - (13, TType.I32, 'label', None, None, ), # 13 - None, # 14 - None, # 15 - None, # 16 - None, # 17 - None, # 18 - None, # 19 - None, # 20 - (21, TType.BOOL, 'not_a_ztp_offer', None, False, ), # 21 - (22, TType.BOOL, 'you_are_flood_repeater', None, True, ), # 22 - (23, TType.BOOL, 'you_are_sending_too_quickly', None, False, ), # 23 - (24, TType.STRING, 'instance_name', 'UTF8', None, ), # 24 - None, # 25 - None, # 26 - None, # 27 - None, # 28 - None, # 29 - None, # 30 - None, # 31 - None, # 32 - None, # 33 - None, # 34 - (35, TType.I16, 'fabric_id', None, 1, ), # 35 - (36, TType.I16, 'auto_evpn_version', None, None, ), # 36 - None, # 37 - None, # 38 - None, # 39 - (40, TType.I16, 'auto_flood_reflection_version', None, None, ), # 40 - (41, TType.I32, 'auto_flood_reflection_cluster_id', None, None, ), # 41 - ) - - def __init__(self, name=None, local_id=None, flood_port=thrift_spec[3][4], link_mtu_size=thrift_spec[4][4], link_bandwidth=thrift_spec[5][4], neighbor=None, pod=thrift_spec[7][4], node_capabilities=None, link_capabilities=None, holdtime=thrift_spec[12][4], label=None, not_a_ztp_offer=thrift_spec[21][4], you_are_flood_repeater=thrift_spec[22][4], you_are_sending_too_quickly=thrift_spec[23][4], instance_name=None, fabric_id=thrift_spec[35][4], auto_evpn_version=None, auto_flood_reflection_version=None, auto_flood_reflection_cluster_id=None,): + + def __init__(self, name=None, local_id=None, flood_port=915, link_mtu_size=1400, link_bandwidth=100, neighbor=None, pod=0, node_capabilities=None, link_capabilities=None, holdtime=3, label=None, not_a_ztp_offer=False, you_are_flood_repeater=True, you_are_sending_too_quickly=False, instance_name=None, fabric_id=1, auto_evpn_version=None, auto_flood_reflection_version=None, auto_flood_reflection_cluster_id=None,): self.name = name self.local_id = local_id if flood_port is self.thrift_spec[3][4]: @@ -675,27 +590,8 @@ def __init__(self, name=None, local_id=None, flood_port=thrift_spec[3][4], link_ def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return - self.name = None - self.local_id = None - self.flood_port = None - self.link_mtu_size = None - self.link_bandwidth = None - self.neighbor = None - self.pod = None - self.node_capabilities = None - self.link_capabilities = None - self.holdtime = None - self.label = None - self.not_a_ztp_offer = None - self.you_are_flood_repeater = None - self.you_are_sending_too_quickly = None - self.instance_name = None - self.fabric_id = None - self.auto_evpn_version = None - self.auto_flood_reflection_version = None - self.auto_flood_reflection_cluster_id = None iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() @@ -703,7 +599,7 @@ def read(self, iprot): break if fid == 1: if ftype == TType.STRING: - self.name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.name = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 2: @@ -773,7 +669,7 @@ def read(self, iprot): iprot.skip(ftype) elif fid == 24: if ftype == TType.STRING: - self.instance_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.instance_name = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 35: @@ -803,7 +699,7 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('LIEPacket') if self.name is not None: @@ -923,26 +819,10 @@ class LinkIDPair(object): - bfd_up: Indicates whether the link is protected by established BFD session. - address_families: Optional indication which address families are up on the - interface + interface. + """ - thrift_spec = ( - None, # 0 - (1, TType.I32, 'local_id', None, None, ), # 1 - (2, TType.I32, 'remote_id', None, None, ), # 2 - None, # 3 - None, # 4 - None, # 5 - None, # 6 - None, # 7 - None, # 8 - None, # 9 - (10, TType.I32, 'platform_interface_index', None, None, ), # 10 - (11, TType.STRING, 'platform_interface_name', 'UTF8', None, ), # 11 - (12, TType.BYTE, 'trusted_outer_security_key', None, None, ), # 12 - (13, TType.BOOL, 'bfd_up', None, None, ), # 13 - (14, TType.SET, 'address_families', (TType.I32, None, True), None, ), # 14 - ) def __init__(self, local_id=None, remote_id=None, platform_interface_index=None, platform_interface_name=None, trusted_outer_security_key=None, bfd_up=None, address_families=None,): super(LinkIDPair, self).__setattr__('local_id', local_id) @@ -965,58 +845,58 @@ def __hash__(self): @classmethod def read(cls, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and cls.thrift_spec is not None: - return iprot._fast_decode(None, iprot, (cls, cls.thrift_spec)) - __var_local_id= None - __var_remote_id= None - __var_platform_interface_index= None - __var_platform_interface_name= None - __var_trusted_outer_security_key= None - __var_bfd_up= None - __var_address_families= None + return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec]) iprot.readStructBegin() + local_id = None + remote_id = None + platform_interface_index = None + platform_interface_name = None + trusted_outer_security_key = None + bfd_up = None + address_families = None while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: - __var_local_id = iprot.readI32() + local_id = iprot.readI32() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: - __var_remote_id = iprot.readI32() + remote_id = iprot.readI32() else: iprot.skip(ftype) elif fid == 10: if ftype == TType.I32: - __var_platform_interface_index = iprot.readI32() + platform_interface_index = iprot.readI32() else: iprot.skip(ftype) elif fid == 11: if ftype == TType.STRING: - __var_platform_interface_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + platform_interface_name = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 12: if ftype == TType.BYTE: - __var_trusted_outer_security_key = iprot.readByte() + trusted_outer_security_key = iprot.readByte() else: iprot.skip(ftype) elif fid == 13: if ftype == TType.BOOL: - __var_bfd_up = iprot.readBool() + bfd_up = iprot.readBool() else: iprot.skip(ftype) elif fid == 14: if ftype == TType.SET: - __var_address_families = set() + address_families = set() (_etype3, _size0) = iprot.readSetBegin() for _i4 in range(_size0): _elem5 = iprot.readI32() - __var_address_families.add(_elem5) + address_families.add(_elem5) iprot.readSetEnd() - __var_address_families = frozenset(__var_address_families) + address_families = frozenset(address_families) else: iprot.skip(ftype) else: @@ -1024,18 +904,18 @@ def read(cls, iprot): iprot.readFieldEnd() iprot.readStructEnd() return cls( - local_id=__var_local_id, - remote_id=__var_remote_id, - platform_interface_index=__var_platform_interface_index, - platform_interface_name=__var_platform_interface_name, - trusted_outer_security_key=__var_trusted_outer_security_key, - bfd_up=__var_bfd_up, - address_families=__var_address_families, + local_id=local_id, + remote_id=remote_id, + platform_interface_index=platform_interface_index, + platform_interface_name=platform_interface_name, + trusted_outer_security_key=trusted_outer_security_key, + bfd_up=bfd_up, + address_families=address_families, ) def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('LinkIDPair') if self.local_id is not None: @@ -1096,19 +976,13 @@ class TIEID(object): Unique ID of a TIE. Attributes: - - direction: direction of TIE - - originator: indicates originator of the TIE - - tietype: type of the tie - - tie_nr: number of the tie + - direction: Direction of TIE. + - originator: Indicates originator of TIE. + - tietype: Type of TIE. + - tie_nr: Number of TIE. + """ - thrift_spec = ( - None, # 0 - (1, TType.I32, 'direction', None, None, ), # 1 - (2, TType.I64, 'originator', None, None, ), # 2 - (3, TType.I32, 'tietype', None, None, ), # 3 - (4, TType.I32, 'tie_nr', None, None, ), # 4 - ) def __init__(self, direction=None, originator=None, tietype=None, tie_nr=None,): super(TIEID, self).__setattr__('direction', direction) @@ -1128,34 +1002,34 @@ def __hash__(self): @classmethod def read(cls, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and cls.thrift_spec is not None: - return iprot._fast_decode(None, iprot, (cls, cls.thrift_spec)) - __var_direction= None - __var_originator= None - __var_tietype= None - __var_tie_nr= None + return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec]) iprot.readStructBegin() + direction = None + originator = None + tietype = None + tie_nr = None while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.I32: - __var_direction = iprot.readI32() + direction = iprot.readI32() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I64: - __var_originator = iprot.readI64() + originator = iprot.readI64() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: - __var_tietype = iprot.readI32() + tietype = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.I32: - __var_tie_nr = iprot.readI32() + tie_nr = iprot.readI32() else: iprot.skip(ftype) else: @@ -1163,15 +1037,15 @@ def read(cls, iprot): iprot.readFieldEnd() iprot.readStructEnd() return cls( - direction=__var_direction, - originator=__var_originator, - tietype=__var_tietype, - tie_nr=__var_tie_nr, + direction=direction, + originator=originator, + tietype=tietype, + tie_nr=tie_nr, ) def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('TIEID') if self.direction is not None: @@ -1221,27 +1095,13 @@ class TIEHeader(object): Header of a TIE. Attributes: - - tieid: ID of the tie. - - seq_nr: Sequence number of the tie. - - origination_time: Absolute timestamp when the TIE was generated. - - origination_lifetime: Original lifetime when the TIE was generated. + - tieid: ID of TIE. + - seq_nr: Sequence number of TIE. + - origination_time: Absolute timestamp when TIE was generated. + - origination_lifetime: Original lifetime when TIE was generated. + """ - thrift_spec = ( - None, # 0 - None, # 1 - (2, TType.STRUCT, 'tieid', (TIEID, TIEID.thrift_spec), None, ), # 2 - (3, TType.I64, 'seq_nr', None, None, ), # 3 - None, # 4 - None, # 5 - None, # 6 - None, # 7 - None, # 8 - None, # 9 - (10, TType.STRUCT, 'origination_time', (common.ttypes.IEEE802_1ASTimeStampType, common.ttypes.IEEE802_1ASTimeStampType.thrift_spec), None, ), # 10 - None, # 11 - (12, TType.I32, 'origination_lifetime', None, None, ), # 12 - ) def __init__(self, tieid=None, seq_nr=None, origination_time=None, origination_lifetime=None,): self.tieid = tieid @@ -1251,12 +1111,8 @@ def __init__(self, tieid=None, seq_nr=None, origination_time=None, origination_l def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return - self.tieid = None - self.seq_nr = None - self.origination_time = None - self.origination_lifetime = None iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() @@ -1290,7 +1146,7 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('TIEHeader') if self.tieid is not None: @@ -1338,13 +1194,9 @@ class TIEHeaderWithLifeTime(object): Attributes: - header - remaining_lifetime: Remaining lifetime. + """ - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'header', (TIEHeader, TIEHeader.thrift_spec), None, ), # 1 - (2, TType.I32, 'remaining_lifetime', None, None, ), # 2 - ) def __init__(self, header=None, remaining_lifetime=None,): self.header = header @@ -1352,10 +1204,8 @@ def __init__(self, header=None, remaining_lifetime=None,): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return - self.header = None - self.remaining_lifetime = None iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() @@ -1379,7 +1229,7 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('TIEHeaderWithLifeTime') if self.header is not None: @@ -1420,14 +1270,9 @@ class TIDEPacket(object): - start_range: First TIE header in the tide packet. - end_range: Last TIE header in the tide packet. - headers: _Sorted_ list of headers. + """ - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'start_range', (TIEID, TIEID.thrift_spec), None, ), # 1 - (2, TType.STRUCT, 'end_range', (TIEID, TIEID.thrift_spec), None, ), # 2 - (3, TType.LIST, 'headers', (TType.STRUCT, (TIEHeaderWithLifeTime, TIEHeaderWithLifeTime.thrift_spec), True), None, ), # 3 - ) def __init__(self, start_range=None, end_range=None, headers=None,): self.start_range = start_range @@ -1436,11 +1281,8 @@ def __init__(self, start_range=None, end_range=None, headers=None,): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return - self.start_range = None - self.end_range = None - self.headers = None iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() @@ -1475,7 +1317,7 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('TIDEPacket') if self.start_range is not None: @@ -1523,21 +1365,17 @@ class TIREPacket(object): Attributes: - headers + """ - thrift_spec = ( - None, # 0 - (1, TType.SET, 'headers', (TType.STRUCT, (TIEHeaderWithLifeTime, TIEHeaderWithLifeTime.thrift_spec), True), None, ), # 1 - ) def __init__(self, headers=None,): self.headers = headers def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return - self.headers = None iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() @@ -1562,7 +1400,7 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('TIREPacket') if self.headers is not None: @@ -1597,22 +1435,15 @@ class NodeNeighborsTIEElement(object): neighbor of a node Attributes: - - level: level of neighbor - - cost: Cost to neighbor. Ignore anything larger than `infinite_distance` and `invalid_distance` - - link_ids: can carry description of multiple parallel links in a TIE - - bandwidth: total bandwith to neighbor as sum of all parallel links + - level: Level of neighbor. + - cost: Cost to neighbor. Ignore anything equal or larger than `infinite_distance` and equal to `invalid_distance`. + - link_ids: Carries description of multiple parallel links in a TIE. + - bandwidth: Total bandwith to neighbor as sum of all parallel links. + """ - thrift_spec = ( - None, # 0 - (1, TType.BYTE, 'level', None, None, ), # 1 - None, # 2 - (3, TType.I32, 'cost', None, 1, ), # 3 - (4, TType.SET, 'link_ids', (TType.STRUCT, (LinkIDPair, LinkIDPair.thrift_spec), True), None, ), # 4 - (5, TType.I32, 'bandwidth', None, 100, ), # 5 - ) - def __init__(self, level=None, cost=thrift_spec[3][4], link_ids=None, bandwidth=thrift_spec[5][4],): + def __init__(self, level=None, cost=1, link_ids=None, bandwidth=100,): super(NodeNeighborsTIEElement, self).__setattr__('level', level) if cost is self.thrift_spec[3][4]: cost = 1 @@ -1634,40 +1465,40 @@ def __hash__(self): @classmethod def read(cls, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and cls.thrift_spec is not None: - return iprot._fast_decode(None, iprot, (cls, cls.thrift_spec)) - __var_level= None - __var_cost= None - __var_link_ids= None - __var_bandwidth= None + return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec]) iprot.readStructBegin() + level = None + cost = 1 + link_ids = None + bandwidth = 100 while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.BYTE: - __var_level = iprot.readByte() + level = iprot.readByte() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I32: - __var_cost = iprot.readI32() + cost = iprot.readI32() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.SET: - __var_link_ids = set() + link_ids = set() (_etype24, _size21) = iprot.readSetBegin() for _i25 in range(_size21): _elem26 = LinkIDPair.read(iprot) - __var_link_ids.add(_elem26) + link_ids.add(_elem26) iprot.readSetEnd() - __var_link_ids = frozenset(__var_link_ids) + link_ids = frozenset(link_ids) else: iprot.skip(ftype) elif fid == 5: if ftype == TType.I32: - __var_bandwidth = iprot.readI32() + bandwidth = iprot.readI32() else: iprot.skip(ftype) else: @@ -1675,15 +1506,15 @@ def read(cls, iprot): iprot.readFieldEnd() iprot.readStructEnd() return cls( - level=__var_level, - cost=__var_cost, - link_ids=__var_link_ids, - bandwidth=__var_bandwidth, + level=level, + cost=cost, + link_ids=link_ids, + bandwidth=bandwidth, ) def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('NodeNeighborsTIEElement') if self.level is not None: @@ -1732,24 +1563,12 @@ class NodeFlags(object): Attributes: - overload: Indicates that node is in overload, do not transit traffic through it. - - acting_auto_evpn_dci_when_tof: acting as DCI for auto-evpn, necessary for proper RR election where DCIs are preferred + - acting_auto_evpn_dci_when_tof: Acting as DCI for auto-evpn, necessary for proper RR election where DCIs are preferred. + """ - thrift_spec = ( - None, # 0 - (1, TType.BOOL, 'overload', None, False, ), # 1 - None, # 2 - None, # 3 - None, # 4 - None, # 5 - None, # 6 - None, # 7 - None, # 8 - None, # 9 - (10, TType.BOOL, 'acting_auto_evpn_dci_when_tof', None, False, ), # 10 - ) - - def __init__(self, overload=thrift_spec[1][4], acting_auto_evpn_dci_when_tof=thrift_spec[10][4],): + + def __init__(self, overload=False, acting_auto_evpn_dci_when_tof=False,): super(NodeFlags, self).__setattr__('overload', overload) super(NodeFlags, self).__setattr__('acting_auto_evpn_dci_when_tof', acting_auto_evpn_dci_when_tof) @@ -1765,22 +1584,22 @@ def __hash__(self): @classmethod def read(cls, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and cls.thrift_spec is not None: - return iprot._fast_decode(None, iprot, (cls, cls.thrift_spec)) - __var_overload= None - __var_acting_auto_evpn_dci_when_tof= None + return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec]) iprot.readStructBegin() + overload = False + acting_auto_evpn_dci_when_tof = False while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.BOOL: - __var_overload = iprot.readBool() + overload = iprot.readBool() else: iprot.skip(ftype) elif fid == 10: if ftype == TType.BOOL: - __var_acting_auto_evpn_dci_when_tof = iprot.readBool() + acting_auto_evpn_dci_when_tof = iprot.readBool() else: iprot.skip(ftype) else: @@ -1788,13 +1607,13 @@ def read(cls, iprot): iprot.readFieldEnd() iprot.readStructEnd() return cls( - overload=__var_overload, - acting_auto_evpn_dci_when_tof=__var_acting_auto_evpn_dci_when_tof, + overload=overload, + acting_auto_evpn_dci_when_tof=acting_auto_evpn_dci_when_tof, ) def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('NodeFlags') if self.overload is not None: @@ -1834,7 +1653,7 @@ class NodeTIEElement(object): - flags: Flags of the node. - name: Optional node name for easier operations. - pod: PoD to which the node belongs. - - startup_time: optional startup time of the node + - startup_time: Optional startup time of the node - miscabled_links: If any local links are miscabled, this indication is flooded. - same_plane_tofs: ToFs in the same plane. Only carried by ToF. Multiple Node TIEs can carry disjoint sets of ToFs which MUST be joined to form a single set. @@ -1843,48 +1662,14 @@ class NodeTIEElement(object): It provides optional version of EVPN ZTP as 256 * MAJOR + MINOR, if set auto EVPN is enabled. - auto_evpn_model: provides optionally the auto-evpn EVPN model supported - auto_flood_reflection_version: It provides optional version of FR ZTP as 256 * MAJOR + MINOR, if set indicates auto FR is enabled. - - auto_flood_reflection_cluster_id: cluster ID of auto-flood-reflection - - auto_flood_reflection_preference: preference to become flood reflector in auto-flood-reflection, + - auto_flood_reflection_cluster_id: Cluster ID of auto-flood-reflection + - auto_flood_reflection_preference: Preference to become flood reflector in auto-flood-reflection, if not set it indicates that the node cannot perform flood reflection role. + """ - thrift_spec = ( - None, # 0 - (1, TType.BYTE, 'level', None, None, ), # 1 - (2, TType.MAP, 'neighbors', (TType.I64, None, TType.STRUCT, (NodeNeighborsTIEElement, NodeNeighborsTIEElement.thrift_spec), False), None, ), # 2 - (3, TType.STRUCT, 'capabilities', (NodeCapabilities, NodeCapabilities.thrift_spec), None, ), # 3 - (4, TType.STRUCT, 'flags', (NodeFlags, NodeFlags.thrift_spec), None, ), # 4 - (5, TType.STRING, 'name', 'UTF8', None, ), # 5 - (6, TType.I32, 'pod', None, None, ), # 6 - (7, TType.I64, 'startup_time', None, None, ), # 7 - None, # 8 - None, # 9 - (10, TType.SET, 'miscabled_links', (TType.I32, None, True), None, ), # 10 - None, # 11 - (12, TType.SET, 'same_plane_tofs', (TType.I64, None, True), None, ), # 12 - None, # 13 - None, # 14 - None, # 15 - None, # 16 - None, # 17 - None, # 18 - None, # 19 - (20, TType.I16, 'fabric_id', None, 1, ), # 20 - (21, TType.I16, 'auto_evpn_version', None, None, ), # 21 - None, # 22 - None, # 23 - None, # 24 - (25, TType.I32, 'auto_evpn_model', None, 0, ), # 25 - None, # 26 - None, # 27 - None, # 28 - None, # 29 - (30, TType.I16, 'auto_flood_reflection_version', None, None, ), # 30 - (31, TType.I32, 'auto_flood_reflection_cluster_id', None, None, ), # 31 - (32, TType.I32, 'auto_flood_reflection_preference', None, None, ), # 32 - ) - - def __init__(self, level=None, neighbors=None, capabilities=None, flags=None, name=None, pod=None, startup_time=None, miscabled_links=None, same_plane_tofs=None, fabric_id=thrift_spec[20][4], auto_evpn_version=None, auto_evpn_model=thrift_spec[25][4], auto_flood_reflection_version=None, auto_flood_reflection_cluster_id=None, auto_flood_reflection_preference=None,): + + def __init__(self, level=None, neighbors=None, capabilities=None, flags=None, name=None, pod=None, startup_time=None, miscabled_links=None, same_plane_tofs=None, fabric_id=1, auto_evpn_version=None, auto_evpn_model=0, auto_flood_reflection_version=None, auto_flood_reflection_cluster_id=None, auto_flood_reflection_preference=None,): super(NodeTIEElement, self).__setattr__('level', level) super(NodeTIEElement, self).__setattr__('neighbors', neighbors) super(NodeTIEElement, self).__setattr__('capabilities', capabilities) @@ -1915,118 +1700,118 @@ def __hash__(self): @classmethod def read(cls, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and cls.thrift_spec is not None: - return iprot._fast_decode(None, iprot, (cls, cls.thrift_spec)) - __var_level= None - __var_neighbors= None - __var_capabilities= None - __var_flags= None - __var_name= None - __var_pod= None - __var_startup_time= None - __var_miscabled_links= None - __var_same_plane_tofs= None - __var_fabric_id= None - __var_auto_evpn_version= None - __var_auto_evpn_model= None - __var_auto_flood_reflection_version= None - __var_auto_flood_reflection_cluster_id= None - __var_auto_flood_reflection_preference= None + return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec]) iprot.readStructBegin() + level = None + neighbors = None + capabilities = None + flags = None + name = None + pod = None + startup_time = None + miscabled_links = None + same_plane_tofs = None + fabric_id = 1 + auto_evpn_version = None + auto_evpn_model = 0 + auto_flood_reflection_version = None + auto_flood_reflection_cluster_id = None + auto_flood_reflection_preference = None while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.BYTE: - __var_level = iprot.readByte() + level = iprot.readByte() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.MAP: - __var_neighbors = {} + neighbors = {} (_ktype29, _vtype30, _size28) = iprot.readMapBegin() for _i32 in range(_size28): _key33 = iprot.readI64() _val34 = NodeNeighborsTIEElement.read(iprot) - __var_neighbors[_key33] = _val34 + neighbors[_key33] = _val34 iprot.readMapEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRUCT: - __var_capabilities = NodeCapabilities.read(iprot) + capabilities = NodeCapabilities.read(iprot) else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRUCT: - __var_flags = NodeFlags.read(iprot) + flags = NodeFlags.read(iprot) else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: - __var_name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + name = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.I32: - __var_pod = iprot.readI32() + pod = iprot.readI32() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.I64: - __var_startup_time = iprot.readI64() + startup_time = iprot.readI64() else: iprot.skip(ftype) elif fid == 10: if ftype == TType.SET: - __var_miscabled_links = set() + miscabled_links = set() (_etype38, _size35) = iprot.readSetBegin() for _i39 in range(_size35): _elem40 = iprot.readI32() - __var_miscabled_links.add(_elem40) + miscabled_links.add(_elem40) iprot.readSetEnd() - __var_miscabled_links = frozenset(__var_miscabled_links) + miscabled_links = frozenset(miscabled_links) else: iprot.skip(ftype) elif fid == 12: if ftype == TType.SET: - __var_same_plane_tofs = set() + same_plane_tofs = set() (_etype44, _size41) = iprot.readSetBegin() for _i45 in range(_size41): _elem46 = iprot.readI64() - __var_same_plane_tofs.add(_elem46) + same_plane_tofs.add(_elem46) iprot.readSetEnd() - __var_same_plane_tofs = frozenset(__var_same_plane_tofs) + same_plane_tofs = frozenset(same_plane_tofs) else: iprot.skip(ftype) elif fid == 20: if ftype == TType.I16: - __var_fabric_id = iprot.readI16() + fabric_id = iprot.readI16() else: iprot.skip(ftype) elif fid == 21: if ftype == TType.I16: - __var_auto_evpn_version = iprot.readI16() + auto_evpn_version = iprot.readI16() else: iprot.skip(ftype) elif fid == 25: if ftype == TType.I32: - __var_auto_evpn_model = iprot.readI32() + auto_evpn_model = iprot.readI32() else: iprot.skip(ftype) elif fid == 30: if ftype == TType.I16: - __var_auto_flood_reflection_version = iprot.readI16() + auto_flood_reflection_version = iprot.readI16() else: iprot.skip(ftype) elif fid == 31: if ftype == TType.I32: - __var_auto_flood_reflection_cluster_id = iprot.readI32() + auto_flood_reflection_cluster_id = iprot.readI32() else: iprot.skip(ftype) elif fid == 32: if ftype == TType.I32: - __var_auto_flood_reflection_preference = iprot.readI32() + auto_flood_reflection_preference = iprot.readI32() else: iprot.skip(ftype) else: @@ -2034,26 +1819,26 @@ def read(cls, iprot): iprot.readFieldEnd() iprot.readStructEnd() return cls( - level=__var_level, - neighbors=__var_neighbors, - capabilities=__var_capabilities, - flags=__var_flags, - name=__var_name, - pod=__var_pod, - startup_time=__var_startup_time, - miscabled_links=__var_miscabled_links, - same_plane_tofs=__var_same_plane_tofs, - fabric_id=__var_fabric_id, - auto_evpn_version=__var_auto_evpn_version, - auto_evpn_model=__var_auto_evpn_model, - auto_flood_reflection_version=__var_auto_flood_reflection_version, - auto_flood_reflection_cluster_id=__var_auto_flood_reflection_cluster_id, - auto_flood_reflection_preference=__var_auto_flood_reflection_preference, + level=level, + neighbors=neighbors, + capabilities=capabilities, + flags=flags, + name=name, + pod=pod, + startup_time=startup_time, + miscabled_links=miscabled_links, + same_plane_tofs=same_plane_tofs, + fabric_id=fabric_id, + auto_evpn_version=auto_evpn_version, + auto_evpn_model=auto_evpn_model, + auto_flood_reflection_version=auto_flood_reflection_version, + auto_flood_reflection_cluster_id=auto_flood_reflection_cluster_id, + auto_flood_reflection_preference=auto_flood_reflection_preference, ) def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('NodeTIEElement') if self.level is not None: @@ -2162,27 +1947,13 @@ class PrefixAttributes(object): - monotonic_clock: Monotonic clock for mobile addresses. - loopback: Indicates if the prefix is a node loopback. - directly_attached: Indicates that the prefix is directly attached. - - from_link: link to which the address belongs to. + - from_link: Link to which the address belongs to. - label: Optional, per prefix significant label. + """ - thrift_spec = ( - None, # 0 - None, # 1 - (2, TType.I32, 'metric', None, 1, ), # 2 - (3, TType.SET, 'tags', (TType.I64, None, True), None, ), # 3 - (4, TType.STRUCT, 'monotonic_clock', (common.ttypes.PrefixSequenceType, common.ttypes.PrefixSequenceType.thrift_spec), None, ), # 4 - None, # 5 - (6, TType.BOOL, 'loopback', None, False, ), # 6 - (7, TType.BOOL, 'directly_attached', None, True, ), # 7 - None, # 8 - None, # 9 - (10, TType.I32, 'from_link', None, None, ), # 10 - None, # 11 - (12, TType.I32, 'label', None, None, ), # 12 - ) - - def __init__(self, metric=thrift_spec[2][4], tags=None, monotonic_clock=None, loopback=thrift_spec[6][4], directly_attached=thrift_spec[7][4], from_link=None, label=None,): + + def __init__(self, metric=1, tags=None, monotonic_clock=None, loopback=False, directly_attached=True, from_link=None, label=None,): if metric is self.thrift_spec[2][4]: metric = 1 super(PrefixAttributes, self).__setattr__('metric', metric) @@ -2205,59 +1976,59 @@ def __hash__(self): @classmethod def read(cls, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and cls.thrift_spec is not None: - return iprot._fast_decode(None, iprot, (cls, cls.thrift_spec)) - __var_metric= None - __var_tags= None - __var_monotonic_clock= None - __var_loopback= None - __var_directly_attached= None - __var_from_link= None - __var_label= None + return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec]) iprot.readStructBegin() + metric = 1 + tags = None + monotonic_clock = None + loopback = False + directly_attached = True + from_link = None + label = None while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 2: if ftype == TType.I32: - __var_metric = iprot.readI32() + metric = iprot.readI32() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.SET: - __var_tags = set() + tags = set() (_etype54, _size51) = iprot.readSetBegin() for _i55 in range(_size51): _elem56 = iprot.readI64() - __var_tags.add(_elem56) + tags.add(_elem56) iprot.readSetEnd() - __var_tags = frozenset(__var_tags) + tags = frozenset(tags) else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRUCT: - __var_monotonic_clock = common.ttypes.PrefixSequenceType() - __var_monotonic_clock.read(iprot) + monotonic_clock = common.ttypes.PrefixSequenceType() + monotonic_clock.read(iprot) else: iprot.skip(ftype) elif fid == 6: if ftype == TType.BOOL: - __var_loopback = iprot.readBool() + loopback = iprot.readBool() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.BOOL: - __var_directly_attached = iprot.readBool() + directly_attached = iprot.readBool() else: iprot.skip(ftype) elif fid == 10: if ftype == TType.I32: - __var_from_link = iprot.readI32() + from_link = iprot.readI32() else: iprot.skip(ftype) elif fid == 12: if ftype == TType.I32: - __var_label = iprot.readI32() + label = iprot.readI32() else: iprot.skip(ftype) else: @@ -2265,18 +2036,18 @@ def read(cls, iprot): iprot.readFieldEnd() iprot.readStructEnd() return cls( - metric=__var_metric, - tags=__var_tags, - monotonic_clock=__var_monotonic_clock, - loopback=__var_loopback, - directly_attached=__var_directly_attached, - from_link=__var_from_link, - label=__var_label, + metric=metric, + tags=tags, + monotonic_clock=monotonic_clock, + loopback=loopback, + directly_attached=directly_attached, + from_link=from_link, + label=label, ) def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('PrefixAttributes') if self.metric is not None: @@ -2336,12 +2107,9 @@ class PrefixTIEElement(object): Attributes: - prefixes: Prefixes with the associated attributes. + """ - thrift_spec = ( - None, # 0 - (1, TType.MAP, 'prefixes', (TType.STRUCT, (common.ttypes.IPPrefixType, common.ttypes.IPPrefixType.thrift_spec), TType.STRUCT, (PrefixAttributes, PrefixAttributes.thrift_spec), False), None, ), # 1 - ) def __init__(self, prefixes=None,): super(PrefixTIEElement, self).__setattr__('prefixes', prefixes) @@ -2358,21 +2126,21 @@ def __hash__(self): @classmethod def read(cls, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and cls.thrift_spec is not None: - return iprot._fast_decode(None, iprot, (cls, cls.thrift_spec)) - __var_prefixes= None + return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec]) iprot.readStructBegin() + prefixes = None while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.MAP: - __var_prefixes = {} + prefixes = {} (_ktype59, _vtype60, _size58) = iprot.readMapBegin() for _i62 in range(_size58): _key63 = common.ttypes.IPPrefixType.read(iprot) _val64 = PrefixAttributes.read(iprot) - __var_prefixes[_key63] = _val64 + prefixes[_key63] = _val64 iprot.readMapEnd() else: iprot.skip(ftype) @@ -2381,12 +2149,12 @@ def read(cls, iprot): iprot.readFieldEnd() iprot.readStructEnd() return cls( - prefixes=__var_prefixes, + prefixes=prefixes, ) def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('PrefixTIEElement') if self.prefixes is not None: @@ -2424,15 +2192,11 @@ class KeyValueTIEElementContent(object): Attributes: - targets - value + """ - thrift_spec = ( - None, # 0 - (1, TType.I64, 'targets', None, 0, ), # 1 - (2, TType.STRING, 'value', 'BINARY', None, ), # 2 - ) - def __init__(self, targets=thrift_spec[1][4], value=None,): + def __init__(self, targets=0, value=None,): if targets is self.thrift_spec[1][4]: targets = 0 self.targets = targets @@ -2440,10 +2204,8 @@ def __init__(self, targets=thrift_spec[1][4], value=None,): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return - self.targets = None - self.value = None iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() @@ -2466,7 +2228,7 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('KeyValueTIEElementContent') if self.targets is not None: @@ -2501,12 +2263,9 @@ class KeyValueTIEElement(object): Attributes: - keyvalues + """ - thrift_spec = ( - None, # 0 - (1, TType.MAP, 'keyvalues', (TType.I32, None, TType.STRUCT, (KeyValueTIEElementContent, KeyValueTIEElementContent.thrift_spec), False), None, ), # 1 - ) def __init__(self, keyvalues=None,): super(KeyValueTIEElement, self).__setattr__('keyvalues', keyvalues) @@ -2523,22 +2282,22 @@ def __hash__(self): @classmethod def read(cls, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and cls.thrift_spec is not None: - return iprot._fast_decode(None, iprot, (cls, cls.thrift_spec)) - __var_keyvalues= None + return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec]) iprot.readStructBegin() + keyvalues = None while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.MAP: - __var_keyvalues = {} + keyvalues = {} (_ktype68, _vtype69, _size67) = iprot.readMapBegin() for _i71 in range(_size67): _key72 = iprot.readI32() _val73 = KeyValueTIEElementContent() _val73.read(iprot) - __var_keyvalues[_key72] = _val73 + keyvalues[_key72] = _val73 iprot.readMapEnd() else: iprot.skip(ftype) @@ -2547,12 +2306,12 @@ def read(cls, iprot): iprot.readFieldEnd() iprot.readStructEnd() return cls( - keyvalues=__var_keyvalues, + keyvalues=keyvalues, ) def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('KeyValueTIEElement') if self.keyvalues is not None: @@ -2595,20 +2354,9 @@ class TIEElement(object): - external_prefixes: Externally reimported prefixes. - positive_external_disaggregation_prefixes: Positive external disaggregated prefixes (always southbound). - keyvalues: Key-Value store elements. + """ - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'node', (NodeTIEElement, NodeTIEElement.thrift_spec), None, ), # 1 - (2, TType.STRUCT, 'prefixes', (PrefixTIEElement, PrefixTIEElement.thrift_spec), None, ), # 2 - (3, TType.STRUCT, 'positive_disaggregation_prefixes', (PrefixTIEElement, PrefixTIEElement.thrift_spec), None, ), # 3 - None, # 4 - (5, TType.STRUCT, 'negative_disaggregation_prefixes', (PrefixTIEElement, PrefixTIEElement.thrift_spec), None, ), # 5 - (6, TType.STRUCT, 'external_prefixes', (PrefixTIEElement, PrefixTIEElement.thrift_spec), None, ), # 6 - (7, TType.STRUCT, 'positive_external_disaggregation_prefixes', (PrefixTIEElement, PrefixTIEElement.thrift_spec), None, ), # 7 - None, # 8 - (9, TType.STRUCT, 'keyvalues', (KeyValueTIEElement, KeyValueTIEElement.thrift_spec), None, ), # 9 - ) def __init__(self, node=None, prefixes=None, positive_disaggregation_prefixes=None, negative_disaggregation_prefixes=None, external_prefixes=None, positive_external_disaggregation_prefixes=None, keyvalues=None,): super(TIEElement, self).__setattr__('node', node) @@ -2631,52 +2379,52 @@ def __hash__(self): @classmethod def read(cls, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and cls.thrift_spec is not None: - return iprot._fast_decode(None, iprot, (cls, cls.thrift_spec)) - __var_node= None - __var_prefixes= None - __var_positive_disaggregation_prefixes= None - __var_negative_disaggregation_prefixes= None - __var_external_prefixes= None - __var_positive_external_disaggregation_prefixes= None - __var_keyvalues= None + return iprot._fast_decode(None, iprot, [cls, cls.thrift_spec]) iprot.readStructBegin() + node = None + prefixes = None + positive_disaggregation_prefixes = None + negative_disaggregation_prefixes = None + external_prefixes = None + positive_external_disaggregation_prefixes = None + keyvalues = None while True: (fname, ftype, fid) = iprot.readFieldBegin() if ftype == TType.STOP: break if fid == 1: if ftype == TType.STRUCT: - __var_node = NodeTIEElement.read(iprot) + node = NodeTIEElement.read(iprot) else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: - __var_prefixes = PrefixTIEElement.read(iprot) + prefixes = PrefixTIEElement.read(iprot) else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRUCT: - __var_positive_disaggregation_prefixes = PrefixTIEElement.read(iprot) + positive_disaggregation_prefixes = PrefixTIEElement.read(iprot) else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRUCT: - __var_negative_disaggregation_prefixes = PrefixTIEElement.read(iprot) + negative_disaggregation_prefixes = PrefixTIEElement.read(iprot) else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRUCT: - __var_external_prefixes = PrefixTIEElement.read(iprot) + external_prefixes = PrefixTIEElement.read(iprot) else: iprot.skip(ftype) elif fid == 7: if ftype == TType.STRUCT: - __var_positive_external_disaggregation_prefixes = PrefixTIEElement.read(iprot) + positive_external_disaggregation_prefixes = PrefixTIEElement.read(iprot) else: iprot.skip(ftype) elif fid == 9: if ftype == TType.STRUCT: - __var_keyvalues = KeyValueTIEElement.read(iprot) + keyvalues = KeyValueTIEElement.read(iprot) else: iprot.skip(ftype) else: @@ -2684,18 +2432,18 @@ def read(cls, iprot): iprot.readFieldEnd() iprot.readStructEnd() return cls( - node=__var_node, - prefixes=__var_prefixes, - positive_disaggregation_prefixes=__var_positive_disaggregation_prefixes, - negative_disaggregation_prefixes=__var_negative_disaggregation_prefixes, - external_prefixes=__var_external_prefixes, - positive_external_disaggregation_prefixes=__var_positive_external_disaggregation_prefixes, - keyvalues=__var_keyvalues, + node=node, + prefixes=prefixes, + positive_disaggregation_prefixes=positive_disaggregation_prefixes, + negative_disaggregation_prefixes=negative_disaggregation_prefixes, + external_prefixes=external_prefixes, + positive_external_disaggregation_prefixes=positive_external_disaggregation_prefixes, + keyvalues=keyvalues, ) def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('TIEElement') if self.node is not None: @@ -2751,13 +2499,9 @@ class TIEPacket(object): Attributes: - header - element + """ - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'header', (TIEHeader, TIEHeader.thrift_spec), None, ), # 1 - (2, TType.STRUCT, 'element', (TIEElement, TIEElement.thrift_spec), None, ), # 2 - ) def __init__(self, header=None, element=None,): self.header = header @@ -2765,10 +2509,8 @@ def __init__(self, header=None, element=None,): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return - self.header = None - self.element = None iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() @@ -2792,7 +2534,7 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('TIEPacket') if self.header is not None: @@ -2834,15 +2576,9 @@ class PacketContent(object): - tide - tire - tie + """ - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'lie', (LIEPacket, LIEPacket.thrift_spec), None, ), # 1 - (2, TType.STRUCT, 'tide', (TIDEPacket, TIDEPacket.thrift_spec), None, ), # 2 - (3, TType.STRUCT, 'tire', (TIREPacket, TIREPacket.thrift_spec), None, ), # 3 - (4, TType.STRUCT, 'tie', (TIEPacket, TIEPacket.thrift_spec), None, ), # 4 - ) def __init__(self, lie=None, tide=None, tire=None, tie=None,): self.lie = lie @@ -2852,12 +2588,8 @@ def __init__(self, lie=None, tide=None, tire=None, tie=None,): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return - self.lie = None - self.tide = None - self.tire = None - self.tie = None iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() @@ -2894,7 +2626,7 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('PacketContent') if self.lie is not None: @@ -2938,13 +2670,9 @@ class ProtocolPacket(object): Attributes: - header - content + """ - thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'header', (PacketHeader, PacketHeader.thrift_spec), None, ), # 1 - (2, TType.STRUCT, 'content', (PacketContent, PacketContent.thrift_spec), None, ), # 2 - ) def __init__(self, header=None, content=None,): self.header = header @@ -2952,10 +2680,8 @@ def __init__(self, header=None, content=None,): def read(self, iprot): if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, (self.__class__, self.thrift_spec)) + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) return - self.header = None - self.content = None iprot.readStructBegin() while True: (fname, ftype, fid) = iprot.readFieldBegin() @@ -2980,7 +2706,7 @@ def read(self, iprot): def write(self, oprot): if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, (self.__class__, self.thrift_spec))) + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) return oprot.writeStructBegin('ProtocolPacket') if self.header is not None: @@ -3011,3 +2737,284 @@ def __eq__(self, other): def __ne__(self, other): return not (self == other) +all_structs.append(PacketHeader) +PacketHeader.thrift_spec = ( + None, # 0 + (1, TType.BYTE, 'major_version', None, 8, ), # 1 + (2, TType.I16, 'minor_version', None, 0, ), # 2 + (3, TType.I64, 'sender', None, None, ), # 3 + (4, TType.BYTE, 'level', None, None, ), # 4 +) +all_structs.append(Community) +Community.thrift_spec = ( + None, # 0 + (1, TType.I32, 'top', None, None, ), # 1 + (2, TType.I32, 'bottom', None, None, ), # 2 +) +all_structs.append(Neighbor) +Neighbor.thrift_spec = ( + None, # 0 + (1, TType.I64, 'originator', None, None, ), # 1 + (2, TType.I32, 'remote_id', None, None, ), # 2 +) +all_structs.append(NodeCapabilities) +NodeCapabilities.thrift_spec = ( + None, # 0 + (1, TType.I16, 'protocol_minor_version', None, 0, ), # 1 + (2, TType.BOOL, 'flood_reduction', None, True, ), # 2 + (3, TType.I32, 'hierarchy_indications', None, None, ), # 3 + None, # 4 + None, # 5 + None, # 6 + None, # 7 + None, # 8 + None, # 9 + (10, TType.BOOL, 'auto_evpn_support', None, False, ), # 10 + None, # 11 + None, # 12 + None, # 13 + None, # 14 + None, # 15 + None, # 16 + None, # 17 + None, # 18 + None, # 19 + (20, TType.BOOL, 'auto_flood_reflection_support', None, False, ), # 20 +) +all_structs.append(LinkCapabilities) +LinkCapabilities.thrift_spec = ( + None, # 0 + (1, TType.BOOL, 'bfd', None, True, ), # 1 + (2, TType.BOOL, 'ipv4_forwarding_capable', None, True, ), # 2 +) +all_structs.append(LIEPacket) +LIEPacket.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'name', 'UTF8', None, ), # 1 + (2, TType.I32, 'local_id', None, None, ), # 2 + (3, TType.I16, 'flood_port', None, 915, ), # 3 + (4, TType.I32, 'link_mtu_size', None, 1400, ), # 4 + (5, TType.I32, 'link_bandwidth', None, 100, ), # 5 + (6, TType.STRUCT, 'neighbor', [Neighbor, None], None, ), # 6 + (7, TType.I32, 'pod', None, 0, ), # 7 + None, # 8 + None, # 9 + (10, TType.STRUCT, 'node_capabilities', [NodeCapabilities, None], None, ), # 10 + (11, TType.STRUCT, 'link_capabilities', [LinkCapabilities, None], None, ), # 11 + (12, TType.I16, 'holdtime', None, 3, ), # 12 + (13, TType.I32, 'label', None, None, ), # 13 + None, # 14 + None, # 15 + None, # 16 + None, # 17 + None, # 18 + None, # 19 + None, # 20 + (21, TType.BOOL, 'not_a_ztp_offer', None, False, ), # 21 + (22, TType.BOOL, 'you_are_flood_repeater', None, True, ), # 22 + (23, TType.BOOL, 'you_are_sending_too_quickly', None, False, ), # 23 + (24, TType.STRING, 'instance_name', 'UTF8', None, ), # 24 + None, # 25 + None, # 26 + None, # 27 + None, # 28 + None, # 29 + None, # 30 + None, # 31 + None, # 32 + None, # 33 + None, # 34 + (35, TType.I16, 'fabric_id', None, 1, ), # 35 + (36, TType.I16, 'auto_evpn_version', None, None, ), # 36 + None, # 37 + None, # 38 + None, # 39 + (40, TType.I16, 'auto_flood_reflection_version', None, None, ), # 40 + (41, TType.I32, 'auto_flood_reflection_cluster_id', None, None, ), # 41 +) +all_structs.append(LinkIDPair) +LinkIDPair.thrift_spec = ( + None, # 0 + (1, TType.I32, 'local_id', None, None, ), # 1 + (2, TType.I32, 'remote_id', None, None, ), # 2 + None, # 3 + None, # 4 + None, # 5 + None, # 6 + None, # 7 + None, # 8 + None, # 9 + (10, TType.I32, 'platform_interface_index', None, None, ), # 10 + (11, TType.STRING, 'platform_interface_name', 'UTF8', None, ), # 11 + (12, TType.BYTE, 'trusted_outer_security_key', None, None, ), # 12 + (13, TType.BOOL, 'bfd_up', None, None, ), # 13 + (14, TType.SET, 'address_families', (TType.I32, None, True), None, ), # 14 +) +all_structs.append(TIEID) +TIEID.thrift_spec = ( + None, # 0 + (1, TType.I32, 'direction', None, None, ), # 1 + (2, TType.I64, 'originator', None, None, ), # 2 + (3, TType.I32, 'tietype', None, None, ), # 3 + (4, TType.I32, 'tie_nr', None, None, ), # 4 +) +all_structs.append(TIEHeader) +TIEHeader.thrift_spec = ( + None, # 0 + None, # 1 + (2, TType.STRUCT, 'tieid', [TIEID, None], None, ), # 2 + (3, TType.I64, 'seq_nr', None, None, ), # 3 + None, # 4 + None, # 5 + None, # 6 + None, # 7 + None, # 8 + None, # 9 + (10, TType.STRUCT, 'origination_time', [common.ttypes.IEEE802_1ASTimeStampType, None], None, ), # 10 + None, # 11 + (12, TType.I32, 'origination_lifetime', None, None, ), # 12 +) +all_structs.append(TIEHeaderWithLifeTime) +TIEHeaderWithLifeTime.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'header', [TIEHeader, None], None, ), # 1 + (2, TType.I32, 'remaining_lifetime', None, None, ), # 2 +) +all_structs.append(TIDEPacket) +TIDEPacket.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'start_range', [TIEID, None], None, ), # 1 + (2, TType.STRUCT, 'end_range', [TIEID, None], None, ), # 2 + (3, TType.LIST, 'headers', (TType.STRUCT, [TIEHeaderWithLifeTime, None], True), None, ), # 3 +) +all_structs.append(TIREPacket) +TIREPacket.thrift_spec = ( + None, # 0 + (1, TType.SET, 'headers', (TType.STRUCT, [TIEHeaderWithLifeTime, None], True), None, ), # 1 +) +all_structs.append(NodeNeighborsTIEElement) +NodeNeighborsTIEElement.thrift_spec = ( + None, # 0 + (1, TType.BYTE, 'level', None, None, ), # 1 + None, # 2 + (3, TType.I32, 'cost', None, 1, ), # 3 + (4, TType.SET, 'link_ids', (TType.STRUCT, [LinkIDPair, None], True), None, ), # 4 + (5, TType.I32, 'bandwidth', None, 100, ), # 5 +) +all_structs.append(NodeFlags) +NodeFlags.thrift_spec = ( + None, # 0 + (1, TType.BOOL, 'overload', None, False, ), # 1 + None, # 2 + None, # 3 + None, # 4 + None, # 5 + None, # 6 + None, # 7 + None, # 8 + None, # 9 + (10, TType.BOOL, 'acting_auto_evpn_dci_when_tof', None, False, ), # 10 +) +all_structs.append(NodeTIEElement) +NodeTIEElement.thrift_spec = ( + None, # 0 + (1, TType.BYTE, 'level', None, None, ), # 1 + (2, TType.MAP, 'neighbors', (TType.I64, None, TType.STRUCT, [NodeNeighborsTIEElement, None], False), None, ), # 2 + (3, TType.STRUCT, 'capabilities', [NodeCapabilities, None], None, ), # 3 + (4, TType.STRUCT, 'flags', [NodeFlags, None], None, ), # 4 + (5, TType.STRING, 'name', 'UTF8', None, ), # 5 + (6, TType.I32, 'pod', None, None, ), # 6 + (7, TType.I64, 'startup_time', None, None, ), # 7 + None, # 8 + None, # 9 + (10, TType.SET, 'miscabled_links', (TType.I32, None, True), None, ), # 10 + None, # 11 + (12, TType.SET, 'same_plane_tofs', (TType.I64, None, True), None, ), # 12 + None, # 13 + None, # 14 + None, # 15 + None, # 16 + None, # 17 + None, # 18 + None, # 19 + (20, TType.I16, 'fabric_id', None, 1, ), # 20 + (21, TType.I16, 'auto_evpn_version', None, None, ), # 21 + None, # 22 + None, # 23 + None, # 24 + (25, TType.I32, 'auto_evpn_model', None, 0, ), # 25 + None, # 26 + None, # 27 + None, # 28 + None, # 29 + (30, TType.I16, 'auto_flood_reflection_version', None, None, ), # 30 + (31, TType.I32, 'auto_flood_reflection_cluster_id', None, None, ), # 31 + (32, TType.I32, 'auto_flood_reflection_preference', None, None, ), # 32 +) +all_structs.append(PrefixAttributes) +PrefixAttributes.thrift_spec = ( + None, # 0 + None, # 1 + (2, TType.I32, 'metric', None, 1, ), # 2 + (3, TType.SET, 'tags', (TType.I64, None, True), None, ), # 3 + (4, TType.STRUCT, 'monotonic_clock', [common.ttypes.PrefixSequenceType, None], None, ), # 4 + None, # 5 + (6, TType.BOOL, 'loopback', None, False, ), # 6 + (7, TType.BOOL, 'directly_attached', None, True, ), # 7 + None, # 8 + None, # 9 + (10, TType.I32, 'from_link', None, None, ), # 10 + None, # 11 + (12, TType.I32, 'label', None, None, ), # 12 +) +all_structs.append(PrefixTIEElement) +PrefixTIEElement.thrift_spec = ( + None, # 0 + (1, TType.MAP, 'prefixes', (TType.STRUCT, [common.ttypes.IPPrefixType, None], TType.STRUCT, [PrefixAttributes, None], False), None, ), # 1 +) +all_structs.append(KeyValueTIEElementContent) +KeyValueTIEElementContent.thrift_spec = ( + None, # 0 + (1, TType.I64, 'targets', None, 0, ), # 1 + (2, TType.STRING, 'value', 'BINARY', None, ), # 2 +) +all_structs.append(KeyValueTIEElement) +KeyValueTIEElement.thrift_spec = ( + None, # 0 + (1, TType.MAP, 'keyvalues', (TType.I32, None, TType.STRUCT, [KeyValueTIEElementContent, None], False), None, ), # 1 +) +all_structs.append(TIEElement) +TIEElement.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'node', [NodeTIEElement, None], None, ), # 1 + (2, TType.STRUCT, 'prefixes', [PrefixTIEElement, None], None, ), # 2 + (3, TType.STRUCT, 'positive_disaggregation_prefixes', [PrefixTIEElement, None], None, ), # 3 + None, # 4 + (5, TType.STRUCT, 'negative_disaggregation_prefixes', [PrefixTIEElement, None], None, ), # 5 + (6, TType.STRUCT, 'external_prefixes', [PrefixTIEElement, None], None, ), # 6 + (7, TType.STRUCT, 'positive_external_disaggregation_prefixes', [PrefixTIEElement, None], None, ), # 7 + None, # 8 + (9, TType.STRUCT, 'keyvalues', [KeyValueTIEElement, None], None, ), # 9 +) +all_structs.append(TIEPacket) +TIEPacket.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'header', [TIEHeader, None], None, ), # 1 + (2, TType.STRUCT, 'element', [TIEElement, None], None, ), # 2 +) +all_structs.append(PacketContent) +PacketContent.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'lie', [LIEPacket, None], None, ), # 1 + (2, TType.STRUCT, 'tide', [TIDEPacket, None], None, ), # 2 + (3, TType.STRUCT, 'tire', [TIREPacket, None], None, ), # 3 + (4, TType.STRUCT, 'tie', [TIEPacket, None], None, ), # 4 +) +all_structs.append(ProtocolPacket) +ProtocolPacket.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'header', [PacketHeader, None], None, ), # 1 + (2, TType.STRUCT, 'content', [PacketContent, None], None, ), # 2 +) +fix_spec(all_structs) +del all_structs From 4e70a16ab384fa9ca7b922f3fdbb3b4c0a9af3da Mon Sep 17 00:00:00 2001 From: prz Date: Fri, 9 May 2025 09:24:57 +0200 Subject: [PATCH 08/10] update certificates --- requirements-3-10.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-3-10.txt b/requirements-3-10.txt index b2242e4b..d92e630e 100644 --- a/requirements-3-10.txt +++ b/requirements-3-10.txt @@ -7,7 +7,7 @@ awscli==1.29.62 botocore==1.31.62 CacheControl==0.12.11 Cerberus==1.3.4 -certifi==2022.6.15 +certifi==2022.12.7 chardet==5.0.0 charset-normalizer==2.1.1 codecov==2.1.13 From 893365361806e27cc58699ba4f73d52c94d47507 Mon Sep 17 00:00:00 2001 From: Bruno Rijsman Date: Mon, 29 Sep 2025 11:10:42 +0200 Subject: [PATCH 09/10] Update _config.yml with project metadata Added title, description, author, and plugins to config. --- _config.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/_config.yml b/_config.yml index c7418817..4c88b164 100644 --- a/_config.yml +++ b/_config.yml @@ -1 +1,7 @@ -theme: jekyll-theme-slate \ No newline at end of file +theme: jekyll-theme-slate +title: Routing In Fat Trees (RIFT) +description: An open source implementation of the RIFT protocol in Python. +author: Bruno Rijsman +plugins: + - jekyll-seo-tag +google_analytics: UA-31532124-6 From 58727d153e1b5e8b04a34f3eead2b4307bc9041a Mon Sep 17 00:00:00 2001 From: Bruno Rijsman Date: Mon, 29 Sep 2025 11:17:38 +0200 Subject: [PATCH 10/10] Remove title, description, and author from config Oops, wrong repo --- _config.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/_config.yml b/_config.yml index 4c88b164..f4e7a318 100644 --- a/_config.yml +++ b/_config.yml @@ -1,7 +1,2 @@ theme: jekyll-theme-slate -title: Routing In Fat Trees (RIFT) -description: An open source implementation of the RIFT protocol in Python. -author: Bruno Rijsman -plugins: - - jekyll-seo-tag -google_analytics: UA-31532124-6 +