From 6ef2721e159789b26f5aff1bc6dc70c545d6bb14 Mon Sep 17 00:00:00 2001 From: Kiran Poola Date: Tue, 18 Aug 2020 16:54:17 -0700 Subject: [PATCH] Updated TLVs --- src/python/loxi/of13/bsn_tlv.py | 414 ++++++++++++++++++++++++++++++++ src/python/loxi/of13/const.py | 9 + src/python/loxi/of14/bsn_tlv.py | 414 ++++++++++++++++++++++++++++++++ src/python/loxi/of14/const.py | 9 + src/python/loxi/of15/bsn_tlv.py | 414 ++++++++++++++++++++++++++++++++ src/python/loxi/of15/const.py | 9 + 6 files changed, 1269 insertions(+) diff --git a/src/python/loxi/of13/bsn_tlv.py b/src/python/loxi/of13/bsn_tlv.py index 86ff3b838..2752cfc1e 100644 --- a/src/python/loxi/of13/bsn_tlv.py +++ b/src/python/loxi/of13/bsn_tlv.py @@ -381,6 +381,53 @@ def pretty_print(self, q): bsn_tlv.subtypes[40] = actor_system_priority +class admin_state(bsn_tlv): + type = 216 + + def __init__(self, value=None): + if value != None: + self.value = value + else: + self.value = 0 + return + + def pack(self): + packed = [] + packed.append(struct.pack("!H", self.type)) + packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 + packed.append(struct.pack("!B", self.value)) + length = sum([len(x) for x in packed]) + packed[1] = struct.pack("!H", length) + return ''.join(packed) + + @staticmethod + def unpack(reader): + obj = admin_state() + _type = reader.read("!H")[0] + assert(_type == 216) + _length = reader.read("!H")[0] + orig_reader = reader + reader = orig_reader.slice(_length, 4) + obj.value = reader.read("!B")[0] + return obj + + def __eq__(self, other): + if type(self) != type(other): return False + if self.value != other.value: return False + return True + + def pretty_print(self, q): + q.text("admin_state {") + with q.group(): + with q.indent(2): + q.breakable() + q.text("value = "); + q.text("%#x" % self.value) + q.breakable() + q.text('}') + +bsn_tlv.subtypes[216] = admin_state + class analytics(bsn_tlv): type = 206 @@ -2491,6 +2538,53 @@ def pretty_print(self, q): bsn_tlv.subtypes[149] = forward_error_correction +class free_count(bsn_tlv): + type = 215 + + def __init__(self, value=None): + if value != None: + self.value = value + else: + self.value = 0 + return + + def pack(self): + packed = [] + packed.append(struct.pack("!H", self.type)) + packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 + packed.append(struct.pack("!L", self.value)) + length = sum([len(x) for x in packed]) + packed[1] = struct.pack("!H", length) + return ''.join(packed) + + @staticmethod + def unpack(reader): + obj = free_count() + _type = reader.read("!H")[0] + assert(_type == 215) + _length = reader.read("!H")[0] + orig_reader = reader + reader = orig_reader.slice(_length, 4) + obj.value = reader.read("!L")[0] + return obj + + def __eq__(self, other): + if type(self) != type(other): return False + if self.value != other.value: return False + return True + + def pretty_print(self, q): + q.text("free_count {") + with q.group(): + with q.indent(2): + q.breakable() + q.text("value = "); + q.text("%#x" % self.value) + q.breakable() + q.text('}') + +bsn_tlv.subtypes[215] = free_count + class generation_id(bsn_tlv): type = 80 @@ -4602,6 +4696,53 @@ def pretty_print(self, q): bsn_tlv.subtypes[160] = lag_options +class lcore(bsn_tlv): + type = 209 + + def __init__(self, value=None): + if value != None: + self.value = value + else: + self.value = 0 + return + + def pack(self): + packed = [] + packed.append(struct.pack("!H", self.type)) + packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 + packed.append(struct.pack("!L", self.value)) + length = sum([len(x) for x in packed]) + packed[1] = struct.pack("!H", length) + return ''.join(packed) + + @staticmethod + def unpack(reader): + obj = lcore() + _type = reader.read("!H")[0] + assert(_type == 209) + _length = reader.read("!H")[0] + orig_reader = reader + reader = orig_reader.slice(_length, 4) + obj.value = reader.read("!L")[0] + return obj + + def __eq__(self, other): + if type(self) != type(other): return False + if self.value != other.value: return False + return True + + def pretty_print(self, q): + q.text("lcore {") + with q.group(): + with q.indent(2): + q.breakable() + q.text("value = "); + q.text("%#x" % self.value) + q.breakable() + q.text('}') + +bsn_tlv.subtypes[209] = lcore + class link_up(bsn_tlv): type = 193 @@ -4640,6 +4781,53 @@ def pretty_print(self, q): bsn_tlv.subtypes[193] = link_up +class load(bsn_tlv): + type = 213 + + def __init__(self, value=None): + if value != None: + self.value = value + else: + self.value = 0 + return + + def pack(self): + packed = [] + packed.append(struct.pack("!H", self.type)) + packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 + packed.append(struct.pack("!L", self.value)) + length = sum([len(x) for x in packed]) + packed[1] = struct.pack("!H", length) + return ''.join(packed) + + @staticmethod + def unpack(reader): + obj = load() + _type = reader.read("!H")[0] + assert(_type == 213) + _length = reader.read("!H")[0] + orig_reader = reader + reader = orig_reader.slice(_length, 4) + obj.value = reader.read("!L")[0] + return obj + + def __eq__(self, other): + if type(self) != type(other): return False + if self.value != other.value: return False + return True + + def pretty_print(self, q): + q.text("load {") + with q.group(): + with q.indent(2): + q.breakable() + q.text("value = "); + q.text("%#x" % self.value) + q.breakable() + q.text('}') + +bsn_tlv.subtypes[213] = load + class loopback_mode(bsn_tlv): type = 146 @@ -4904,6 +5092,53 @@ def pretty_print(self, q): bsn_tlv.subtypes[56] = mac_mask +class max_count(bsn_tlv): + type = 214 + + def __init__(self, value=None): + if value != None: + self.value = value + else: + self.value = 0 + return + + def pack(self): + packed = [] + packed.append(struct.pack("!H", self.type)) + packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 + packed.append(struct.pack("!L", self.value)) + length = sum([len(x) for x in packed]) + packed[1] = struct.pack("!H", length) + return ''.join(packed) + + @staticmethod + def unpack(reader): + obj = max_count() + _type = reader.read("!H")[0] + assert(_type == 214) + _length = reader.read("!H")[0] + orig_reader = reader + reader = orig_reader.slice(_length, 4) + obj.value = reader.read("!L")[0] + return obj + + def __eq__(self, other): + if type(self) != type(other): return False + if self.value != other.value: return False + return True + + def pretty_print(self, q): + q.text("max_count {") + with q.group(): + with q.indent(2): + q.breakable() + q.text("value = "); + q.text("%#x" % self.value) + q.breakable() + q.text('}') + +bsn_tlv.subtypes[214] = max_count + class mcg_type_vxlan(bsn_tlv): type = 87 @@ -4942,6 +5177,91 @@ def pretty_print(self, q): bsn_tlv.subtypes[87] = mcg_type_vxlan +class mgmt(bsn_tlv): + type = 211 + + def __init__(self, value=None): + if value != None: + self.value = value + else: + self.value = 0 + return + + def pack(self): + packed = [] + packed.append(struct.pack("!H", self.type)) + packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 + packed.append(struct.pack("!L", self.value)) + length = sum([len(x) for x in packed]) + packed[1] = struct.pack("!H", length) + return ''.join(packed) + + @staticmethod + def unpack(reader): + obj = mgmt() + _type = reader.read("!H")[0] + assert(_type == 211) + _length = reader.read("!H")[0] + orig_reader = reader + reader = orig_reader.slice(_length, 4) + obj.value = reader.read("!L")[0] + return obj + + def __eq__(self, other): + if type(self) != type(other): return False + if self.value != other.value: return False + return True + + def pretty_print(self, q): + q.text("mgmt {") + with q.group(): + with q.indent(2): + q.breakable() + q.text("value = "); + q.text("%#x" % self.value) + q.breakable() + q.text('}') + +bsn_tlv.subtypes[211] = mgmt + +class mgmt_reselect_on_failure(bsn_tlv): + type = 208 + + def __init__(self): + return + + def pack(self): + packed = [] + packed.append(struct.pack("!H", self.type)) + packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 + length = sum([len(x) for x in packed]) + packed[1] = struct.pack("!H", length) + return ''.join(packed) + + @staticmethod + def unpack(reader): + obj = mgmt_reselect_on_failure() + _type = reader.read("!H")[0] + assert(_type == 208) + _length = reader.read("!H")[0] + orig_reader = reader + reader = orig_reader.slice(_length, 4) + return obj + + def __eq__(self, other): + if type(self) != type(other): return False + return True + + def pretty_print(self, q): + q.text("mgmt_reselect_on_failure {") + with q.group(): + with q.indent(2): + q.breakable() + q.breakable() + q.text('}') + +bsn_tlv.subtypes[208] = mgmt_reselect_on_failure + class miss_packets(bsn_tlv): type = 13 @@ -7496,6 +7816,53 @@ def pretty_print(self, q): bsn_tlv.subtypes[74] = set_loopback_mode +class socket(bsn_tlv): + type = 212 + + def __init__(self, value=None): + if value != None: + self.value = value + else: + self.value = 0 + return + + def pack(self): + packed = [] + packed.append(struct.pack("!H", self.type)) + packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 + packed.append(struct.pack("!L", self.value)) + length = sum([len(x) for x in packed]) + packed[1] = struct.pack("!H", length) + return ''.join(packed) + + @staticmethod + def unpack(reader): + obj = socket() + _type = reader.read("!H")[0] + assert(_type == 212) + _length = reader.read("!H")[0] + orig_reader = reader + reader = orig_reader.slice(_length, 4) + obj.value = reader.read("!L")[0] + return obj + + def __eq__(self, other): + if type(self) != type(other): return False + if self.value != other.value: return False + return True + + def pretty_print(self, q): + q.text("socket {") + with q.group(): + with q.indent(2): + q.breakable() + q.text("value = "); + q.text("%#x" % self.value) + q.breakable() + q.text('}') + +bsn_tlv.subtypes[212] = socket + class src_mac_cml(bsn_tlv): type = 191 @@ -7901,6 +8268,53 @@ def pretty_print(self, q): bsn_tlv.subtypes[65] = tcp_src +class thread(bsn_tlv): + type = 210 + + def __init__(self, value=None): + if value != None: + self.value = value + else: + self.value = 0 + return + + def pack(self): + packed = [] + packed.append(struct.pack("!H", self.type)) + packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 + packed.append(struct.pack("!L", self.value)) + length = sum([len(x) for x in packed]) + packed[1] = struct.pack("!H", length) + return ''.join(packed) + + @staticmethod + def unpack(reader): + obj = thread() + _type = reader.read("!H")[0] + assert(_type == 210) + _length = reader.read("!H")[0] + orig_reader = reader + reader = orig_reader.slice(_length, 4) + obj.value = reader.read("!L")[0] + return obj + + def __eq__(self, other): + if type(self) != type(other): return False + if self.value != other.value: return False + return True + + def pretty_print(self, q): + q.text("thread {") + with q.group(): + with q.indent(2): + q.breakable() + q.text("value = "); + q.text("%#x" % self.value) + q.breakable() + q.text('}') + +bsn_tlv.subtypes[210] = thread + class timestamp(bsn_tlv): type = 154 diff --git a/src/python/loxi/of13/const.py b/src/python/loxi/of13/const.py index 3684e0dea..a86e0c8da 100644 --- a/src/python/loxi/of13/const.py +++ b/src/python/loxi/of13/const.py @@ -319,6 +319,15 @@ 13: 'OFPBRC_MULTIPART_BUFFER_OVERFLOW', } +# Identifiers from group ofp_bsn_admin_state +OFP_BSN_ADMIN_STATE_DISABLED = 0 +OFP_BSN_ADMIN_STATE_ENABLED = 1 + +ofp_bsn_admin_state_map = { + 0: 'OFP_BSN_ADMIN_STATE_DISABLED', + 1: 'OFP_BSN_ADMIN_STATE_ENABLED', +} + # Identifiers from group ofp_bsn_anchor OFP_BSN_ANCHOR_PACKET_START = 0 OFP_BSN_ANCHOR_L3_HEADER_START = 1 diff --git a/src/python/loxi/of14/bsn_tlv.py b/src/python/loxi/of14/bsn_tlv.py index 1ca961ee1..f7b1251f1 100644 --- a/src/python/loxi/of14/bsn_tlv.py +++ b/src/python/loxi/of14/bsn_tlv.py @@ -381,6 +381,53 @@ def pretty_print(self, q): bsn_tlv.subtypes[40] = actor_system_priority +class admin_state(bsn_tlv): + type = 216 + + def __init__(self, value=None): + if value != None: + self.value = value + else: + self.value = 0 + return + + def pack(self): + packed = [] + packed.append(struct.pack("!H", self.type)) + packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 + packed.append(struct.pack("!B", self.value)) + length = sum([len(x) for x in packed]) + packed[1] = struct.pack("!H", length) + return ''.join(packed) + + @staticmethod + def unpack(reader): + obj = admin_state() + _type = reader.read("!H")[0] + assert(_type == 216) + _length = reader.read("!H")[0] + orig_reader = reader + reader = orig_reader.slice(_length, 4) + obj.value = reader.read("!B")[0] + return obj + + def __eq__(self, other): + if type(self) != type(other): return False + if self.value != other.value: return False + return True + + def pretty_print(self, q): + q.text("admin_state {") + with q.group(): + with q.indent(2): + q.breakable() + q.text("value = "); + q.text("%#x" % self.value) + q.breakable() + q.text('}') + +bsn_tlv.subtypes[216] = admin_state + class analytics(bsn_tlv): type = 206 @@ -2491,6 +2538,53 @@ def pretty_print(self, q): bsn_tlv.subtypes[149] = forward_error_correction +class free_count(bsn_tlv): + type = 215 + + def __init__(self, value=None): + if value != None: + self.value = value + else: + self.value = 0 + return + + def pack(self): + packed = [] + packed.append(struct.pack("!H", self.type)) + packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 + packed.append(struct.pack("!L", self.value)) + length = sum([len(x) for x in packed]) + packed[1] = struct.pack("!H", length) + return ''.join(packed) + + @staticmethod + def unpack(reader): + obj = free_count() + _type = reader.read("!H")[0] + assert(_type == 215) + _length = reader.read("!H")[0] + orig_reader = reader + reader = orig_reader.slice(_length, 4) + obj.value = reader.read("!L")[0] + return obj + + def __eq__(self, other): + if type(self) != type(other): return False + if self.value != other.value: return False + return True + + def pretty_print(self, q): + q.text("free_count {") + with q.group(): + with q.indent(2): + q.breakable() + q.text("value = "); + q.text("%#x" % self.value) + q.breakable() + q.text('}') + +bsn_tlv.subtypes[215] = free_count + class generation_id(bsn_tlv): type = 80 @@ -4602,6 +4696,53 @@ def pretty_print(self, q): bsn_tlv.subtypes[160] = lag_options +class lcore(bsn_tlv): + type = 209 + + def __init__(self, value=None): + if value != None: + self.value = value + else: + self.value = 0 + return + + def pack(self): + packed = [] + packed.append(struct.pack("!H", self.type)) + packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 + packed.append(struct.pack("!L", self.value)) + length = sum([len(x) for x in packed]) + packed[1] = struct.pack("!H", length) + return ''.join(packed) + + @staticmethod + def unpack(reader): + obj = lcore() + _type = reader.read("!H")[0] + assert(_type == 209) + _length = reader.read("!H")[0] + orig_reader = reader + reader = orig_reader.slice(_length, 4) + obj.value = reader.read("!L")[0] + return obj + + def __eq__(self, other): + if type(self) != type(other): return False + if self.value != other.value: return False + return True + + def pretty_print(self, q): + q.text("lcore {") + with q.group(): + with q.indent(2): + q.breakable() + q.text("value = "); + q.text("%#x" % self.value) + q.breakable() + q.text('}') + +bsn_tlv.subtypes[209] = lcore + class link_up(bsn_tlv): type = 193 @@ -4640,6 +4781,53 @@ def pretty_print(self, q): bsn_tlv.subtypes[193] = link_up +class load(bsn_tlv): + type = 213 + + def __init__(self, value=None): + if value != None: + self.value = value + else: + self.value = 0 + return + + def pack(self): + packed = [] + packed.append(struct.pack("!H", self.type)) + packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 + packed.append(struct.pack("!L", self.value)) + length = sum([len(x) for x in packed]) + packed[1] = struct.pack("!H", length) + return ''.join(packed) + + @staticmethod + def unpack(reader): + obj = load() + _type = reader.read("!H")[0] + assert(_type == 213) + _length = reader.read("!H")[0] + orig_reader = reader + reader = orig_reader.slice(_length, 4) + obj.value = reader.read("!L")[0] + return obj + + def __eq__(self, other): + if type(self) != type(other): return False + if self.value != other.value: return False + return True + + def pretty_print(self, q): + q.text("load {") + with q.group(): + with q.indent(2): + q.breakable() + q.text("value = "); + q.text("%#x" % self.value) + q.breakable() + q.text('}') + +bsn_tlv.subtypes[213] = load + class loopback_mode(bsn_tlv): type = 146 @@ -4904,6 +5092,53 @@ def pretty_print(self, q): bsn_tlv.subtypes[56] = mac_mask +class max_count(bsn_tlv): + type = 214 + + def __init__(self, value=None): + if value != None: + self.value = value + else: + self.value = 0 + return + + def pack(self): + packed = [] + packed.append(struct.pack("!H", self.type)) + packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 + packed.append(struct.pack("!L", self.value)) + length = sum([len(x) for x in packed]) + packed[1] = struct.pack("!H", length) + return ''.join(packed) + + @staticmethod + def unpack(reader): + obj = max_count() + _type = reader.read("!H")[0] + assert(_type == 214) + _length = reader.read("!H")[0] + orig_reader = reader + reader = orig_reader.slice(_length, 4) + obj.value = reader.read("!L")[0] + return obj + + def __eq__(self, other): + if type(self) != type(other): return False + if self.value != other.value: return False + return True + + def pretty_print(self, q): + q.text("max_count {") + with q.group(): + with q.indent(2): + q.breakable() + q.text("value = "); + q.text("%#x" % self.value) + q.breakable() + q.text('}') + +bsn_tlv.subtypes[214] = max_count + class mcg_type_vxlan(bsn_tlv): type = 87 @@ -4942,6 +5177,91 @@ def pretty_print(self, q): bsn_tlv.subtypes[87] = mcg_type_vxlan +class mgmt(bsn_tlv): + type = 211 + + def __init__(self, value=None): + if value != None: + self.value = value + else: + self.value = 0 + return + + def pack(self): + packed = [] + packed.append(struct.pack("!H", self.type)) + packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 + packed.append(struct.pack("!L", self.value)) + length = sum([len(x) for x in packed]) + packed[1] = struct.pack("!H", length) + return ''.join(packed) + + @staticmethod + def unpack(reader): + obj = mgmt() + _type = reader.read("!H")[0] + assert(_type == 211) + _length = reader.read("!H")[0] + orig_reader = reader + reader = orig_reader.slice(_length, 4) + obj.value = reader.read("!L")[0] + return obj + + def __eq__(self, other): + if type(self) != type(other): return False + if self.value != other.value: return False + return True + + def pretty_print(self, q): + q.text("mgmt {") + with q.group(): + with q.indent(2): + q.breakable() + q.text("value = "); + q.text("%#x" % self.value) + q.breakable() + q.text('}') + +bsn_tlv.subtypes[211] = mgmt + +class mgmt_reselect_on_failure(bsn_tlv): + type = 208 + + def __init__(self): + return + + def pack(self): + packed = [] + packed.append(struct.pack("!H", self.type)) + packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 + length = sum([len(x) for x in packed]) + packed[1] = struct.pack("!H", length) + return ''.join(packed) + + @staticmethod + def unpack(reader): + obj = mgmt_reselect_on_failure() + _type = reader.read("!H")[0] + assert(_type == 208) + _length = reader.read("!H")[0] + orig_reader = reader + reader = orig_reader.slice(_length, 4) + return obj + + def __eq__(self, other): + if type(self) != type(other): return False + return True + + def pretty_print(self, q): + q.text("mgmt_reselect_on_failure {") + with q.group(): + with q.indent(2): + q.breakable() + q.breakable() + q.text('}') + +bsn_tlv.subtypes[208] = mgmt_reselect_on_failure + class miss_packets(bsn_tlv): type = 13 @@ -7496,6 +7816,53 @@ def pretty_print(self, q): bsn_tlv.subtypes[74] = set_loopback_mode +class socket(bsn_tlv): + type = 212 + + def __init__(self, value=None): + if value != None: + self.value = value + else: + self.value = 0 + return + + def pack(self): + packed = [] + packed.append(struct.pack("!H", self.type)) + packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 + packed.append(struct.pack("!L", self.value)) + length = sum([len(x) for x in packed]) + packed[1] = struct.pack("!H", length) + return ''.join(packed) + + @staticmethod + def unpack(reader): + obj = socket() + _type = reader.read("!H")[0] + assert(_type == 212) + _length = reader.read("!H")[0] + orig_reader = reader + reader = orig_reader.slice(_length, 4) + obj.value = reader.read("!L")[0] + return obj + + def __eq__(self, other): + if type(self) != type(other): return False + if self.value != other.value: return False + return True + + def pretty_print(self, q): + q.text("socket {") + with q.group(): + with q.indent(2): + q.breakable() + q.text("value = "); + q.text("%#x" % self.value) + q.breakable() + q.text('}') + +bsn_tlv.subtypes[212] = socket + class src_mac_cml(bsn_tlv): type = 191 @@ -7901,6 +8268,53 @@ def pretty_print(self, q): bsn_tlv.subtypes[65] = tcp_src +class thread(bsn_tlv): + type = 210 + + def __init__(self, value=None): + if value != None: + self.value = value + else: + self.value = 0 + return + + def pack(self): + packed = [] + packed.append(struct.pack("!H", self.type)) + packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 + packed.append(struct.pack("!L", self.value)) + length = sum([len(x) for x in packed]) + packed[1] = struct.pack("!H", length) + return ''.join(packed) + + @staticmethod + def unpack(reader): + obj = thread() + _type = reader.read("!H")[0] + assert(_type == 210) + _length = reader.read("!H")[0] + orig_reader = reader + reader = orig_reader.slice(_length, 4) + obj.value = reader.read("!L")[0] + return obj + + def __eq__(self, other): + if type(self) != type(other): return False + if self.value != other.value: return False + return True + + def pretty_print(self, q): + q.text("thread {") + with q.group(): + with q.indent(2): + q.breakable() + q.text("value = "); + q.text("%#x" % self.value) + q.breakable() + q.text('}') + +bsn_tlv.subtypes[210] = thread + class timestamp(bsn_tlv): type = 154 diff --git a/src/python/loxi/of14/const.py b/src/python/loxi/of14/const.py index a44b94b8b..1aab52d92 100644 --- a/src/python/loxi/of14/const.py +++ b/src/python/loxi/of14/const.py @@ -359,6 +359,15 @@ 15: 'OFPBRC_MULTIPART_REPLY_TIMEOUT', } +# Identifiers from group ofp_bsn_admin_state +OFP_BSN_ADMIN_STATE_DISABLED = 0 +OFP_BSN_ADMIN_STATE_ENABLED = 1 + +ofp_bsn_admin_state_map = { + 0: 'OFP_BSN_ADMIN_STATE_DISABLED', + 1: 'OFP_BSN_ADMIN_STATE_ENABLED', +} + # Identifiers from group ofp_bsn_anchor OFP_BSN_ANCHOR_PACKET_START = 0 OFP_BSN_ANCHOR_L3_HEADER_START = 1 diff --git a/src/python/loxi/of15/bsn_tlv.py b/src/python/loxi/of15/bsn_tlv.py index d475bb850..c1755b7c5 100644 --- a/src/python/loxi/of15/bsn_tlv.py +++ b/src/python/loxi/of15/bsn_tlv.py @@ -381,6 +381,53 @@ def pretty_print(self, q): bsn_tlv.subtypes[40] = actor_system_priority +class admin_state(bsn_tlv): + type = 216 + + def __init__(self, value=None): + if value != None: + self.value = value + else: + self.value = 0 + return + + def pack(self): + packed = [] + packed.append(struct.pack("!H", self.type)) + packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 + packed.append(struct.pack("!B", self.value)) + length = sum([len(x) for x in packed]) + packed[1] = struct.pack("!H", length) + return ''.join(packed) + + @staticmethod + def unpack(reader): + obj = admin_state() + _type = reader.read("!H")[0] + assert(_type == 216) + _length = reader.read("!H")[0] + orig_reader = reader + reader = orig_reader.slice(_length, 4) + obj.value = reader.read("!B")[0] + return obj + + def __eq__(self, other): + if type(self) != type(other): return False + if self.value != other.value: return False + return True + + def pretty_print(self, q): + q.text("admin_state {") + with q.group(): + with q.indent(2): + q.breakable() + q.text("value = "); + q.text("%#x" % self.value) + q.breakable() + q.text('}') + +bsn_tlv.subtypes[216] = admin_state + class analytics(bsn_tlv): type = 206 @@ -2491,6 +2538,53 @@ def pretty_print(self, q): bsn_tlv.subtypes[149] = forward_error_correction +class free_count(bsn_tlv): + type = 215 + + def __init__(self, value=None): + if value != None: + self.value = value + else: + self.value = 0 + return + + def pack(self): + packed = [] + packed.append(struct.pack("!H", self.type)) + packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 + packed.append(struct.pack("!L", self.value)) + length = sum([len(x) for x in packed]) + packed[1] = struct.pack("!H", length) + return ''.join(packed) + + @staticmethod + def unpack(reader): + obj = free_count() + _type = reader.read("!H")[0] + assert(_type == 215) + _length = reader.read("!H")[0] + orig_reader = reader + reader = orig_reader.slice(_length, 4) + obj.value = reader.read("!L")[0] + return obj + + def __eq__(self, other): + if type(self) != type(other): return False + if self.value != other.value: return False + return True + + def pretty_print(self, q): + q.text("free_count {") + with q.group(): + with q.indent(2): + q.breakable() + q.text("value = "); + q.text("%#x" % self.value) + q.breakable() + q.text('}') + +bsn_tlv.subtypes[215] = free_count + class generation_id(bsn_tlv): type = 80 @@ -4602,6 +4696,53 @@ def pretty_print(self, q): bsn_tlv.subtypes[160] = lag_options +class lcore(bsn_tlv): + type = 209 + + def __init__(self, value=None): + if value != None: + self.value = value + else: + self.value = 0 + return + + def pack(self): + packed = [] + packed.append(struct.pack("!H", self.type)) + packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 + packed.append(struct.pack("!L", self.value)) + length = sum([len(x) for x in packed]) + packed[1] = struct.pack("!H", length) + return ''.join(packed) + + @staticmethod + def unpack(reader): + obj = lcore() + _type = reader.read("!H")[0] + assert(_type == 209) + _length = reader.read("!H")[0] + orig_reader = reader + reader = orig_reader.slice(_length, 4) + obj.value = reader.read("!L")[0] + return obj + + def __eq__(self, other): + if type(self) != type(other): return False + if self.value != other.value: return False + return True + + def pretty_print(self, q): + q.text("lcore {") + with q.group(): + with q.indent(2): + q.breakable() + q.text("value = "); + q.text("%#x" % self.value) + q.breakable() + q.text('}') + +bsn_tlv.subtypes[209] = lcore + class link_up(bsn_tlv): type = 193 @@ -4640,6 +4781,53 @@ def pretty_print(self, q): bsn_tlv.subtypes[193] = link_up +class load(bsn_tlv): + type = 213 + + def __init__(self, value=None): + if value != None: + self.value = value + else: + self.value = 0 + return + + def pack(self): + packed = [] + packed.append(struct.pack("!H", self.type)) + packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 + packed.append(struct.pack("!L", self.value)) + length = sum([len(x) for x in packed]) + packed[1] = struct.pack("!H", length) + return ''.join(packed) + + @staticmethod + def unpack(reader): + obj = load() + _type = reader.read("!H")[0] + assert(_type == 213) + _length = reader.read("!H")[0] + orig_reader = reader + reader = orig_reader.slice(_length, 4) + obj.value = reader.read("!L")[0] + return obj + + def __eq__(self, other): + if type(self) != type(other): return False + if self.value != other.value: return False + return True + + def pretty_print(self, q): + q.text("load {") + with q.group(): + with q.indent(2): + q.breakable() + q.text("value = "); + q.text("%#x" % self.value) + q.breakable() + q.text('}') + +bsn_tlv.subtypes[213] = load + class loopback_mode(bsn_tlv): type = 146 @@ -4904,6 +5092,53 @@ def pretty_print(self, q): bsn_tlv.subtypes[56] = mac_mask +class max_count(bsn_tlv): + type = 214 + + def __init__(self, value=None): + if value != None: + self.value = value + else: + self.value = 0 + return + + def pack(self): + packed = [] + packed.append(struct.pack("!H", self.type)) + packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 + packed.append(struct.pack("!L", self.value)) + length = sum([len(x) for x in packed]) + packed[1] = struct.pack("!H", length) + return ''.join(packed) + + @staticmethod + def unpack(reader): + obj = max_count() + _type = reader.read("!H")[0] + assert(_type == 214) + _length = reader.read("!H")[0] + orig_reader = reader + reader = orig_reader.slice(_length, 4) + obj.value = reader.read("!L")[0] + return obj + + def __eq__(self, other): + if type(self) != type(other): return False + if self.value != other.value: return False + return True + + def pretty_print(self, q): + q.text("max_count {") + with q.group(): + with q.indent(2): + q.breakable() + q.text("value = "); + q.text("%#x" % self.value) + q.breakable() + q.text('}') + +bsn_tlv.subtypes[214] = max_count + class mcg_type_vxlan(bsn_tlv): type = 87 @@ -4942,6 +5177,91 @@ def pretty_print(self, q): bsn_tlv.subtypes[87] = mcg_type_vxlan +class mgmt(bsn_tlv): + type = 211 + + def __init__(self, value=None): + if value != None: + self.value = value + else: + self.value = 0 + return + + def pack(self): + packed = [] + packed.append(struct.pack("!H", self.type)) + packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 + packed.append(struct.pack("!L", self.value)) + length = sum([len(x) for x in packed]) + packed[1] = struct.pack("!H", length) + return ''.join(packed) + + @staticmethod + def unpack(reader): + obj = mgmt() + _type = reader.read("!H")[0] + assert(_type == 211) + _length = reader.read("!H")[0] + orig_reader = reader + reader = orig_reader.slice(_length, 4) + obj.value = reader.read("!L")[0] + return obj + + def __eq__(self, other): + if type(self) != type(other): return False + if self.value != other.value: return False + return True + + def pretty_print(self, q): + q.text("mgmt {") + with q.group(): + with q.indent(2): + q.breakable() + q.text("value = "); + q.text("%#x" % self.value) + q.breakable() + q.text('}') + +bsn_tlv.subtypes[211] = mgmt + +class mgmt_reselect_on_failure(bsn_tlv): + type = 208 + + def __init__(self): + return + + def pack(self): + packed = [] + packed.append(struct.pack("!H", self.type)) + packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 + length = sum([len(x) for x in packed]) + packed[1] = struct.pack("!H", length) + return ''.join(packed) + + @staticmethod + def unpack(reader): + obj = mgmt_reselect_on_failure() + _type = reader.read("!H")[0] + assert(_type == 208) + _length = reader.read("!H")[0] + orig_reader = reader + reader = orig_reader.slice(_length, 4) + return obj + + def __eq__(self, other): + if type(self) != type(other): return False + return True + + def pretty_print(self, q): + q.text("mgmt_reselect_on_failure {") + with q.group(): + with q.indent(2): + q.breakable() + q.breakable() + q.text('}') + +bsn_tlv.subtypes[208] = mgmt_reselect_on_failure + class miss_packets(bsn_tlv): type = 13 @@ -7496,6 +7816,53 @@ def pretty_print(self, q): bsn_tlv.subtypes[74] = set_loopback_mode +class socket(bsn_tlv): + type = 212 + + def __init__(self, value=None): + if value != None: + self.value = value + else: + self.value = 0 + return + + def pack(self): + packed = [] + packed.append(struct.pack("!H", self.type)) + packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 + packed.append(struct.pack("!L", self.value)) + length = sum([len(x) for x in packed]) + packed[1] = struct.pack("!H", length) + return ''.join(packed) + + @staticmethod + def unpack(reader): + obj = socket() + _type = reader.read("!H")[0] + assert(_type == 212) + _length = reader.read("!H")[0] + orig_reader = reader + reader = orig_reader.slice(_length, 4) + obj.value = reader.read("!L")[0] + return obj + + def __eq__(self, other): + if type(self) != type(other): return False + if self.value != other.value: return False + return True + + def pretty_print(self, q): + q.text("socket {") + with q.group(): + with q.indent(2): + q.breakable() + q.text("value = "); + q.text("%#x" % self.value) + q.breakable() + q.text('}') + +bsn_tlv.subtypes[212] = socket + class src_mac_cml(bsn_tlv): type = 191 @@ -7901,6 +8268,53 @@ def pretty_print(self, q): bsn_tlv.subtypes[65] = tcp_src +class thread(bsn_tlv): + type = 210 + + def __init__(self, value=None): + if value != None: + self.value = value + else: + self.value = 0 + return + + def pack(self): + packed = [] + packed.append(struct.pack("!H", self.type)) + packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 + packed.append(struct.pack("!L", self.value)) + length = sum([len(x) for x in packed]) + packed[1] = struct.pack("!H", length) + return ''.join(packed) + + @staticmethod + def unpack(reader): + obj = thread() + _type = reader.read("!H")[0] + assert(_type == 210) + _length = reader.read("!H")[0] + orig_reader = reader + reader = orig_reader.slice(_length, 4) + obj.value = reader.read("!L")[0] + return obj + + def __eq__(self, other): + if type(self) != type(other): return False + if self.value != other.value: return False + return True + + def pretty_print(self, q): + q.text("thread {") + with q.group(): + with q.indent(2): + q.breakable() + q.text("value = "); + q.text("%#x" % self.value) + q.breakable() + q.text('}') + +bsn_tlv.subtypes[210] = thread + class timestamp(bsn_tlv): type = 154 diff --git a/src/python/loxi/of15/const.py b/src/python/loxi/of15/const.py index 0e97978cf..61026ba3e 100644 --- a/src/python/loxi/of15/const.py +++ b/src/python/loxi/of15/const.py @@ -414,6 +414,15 @@ 18: 'OFPBRC_UNKNOWN', } +# Identifiers from group ofp_bsn_admin_state +OFP_BSN_ADMIN_STATE_DISABLED = 0 +OFP_BSN_ADMIN_STATE_ENABLED = 1 + +ofp_bsn_admin_state_map = { + 0: 'OFP_BSN_ADMIN_STATE_DISABLED', + 1: 'OFP_BSN_ADMIN_STATE_ENABLED', +} + # Identifiers from group ofp_bsn_anchor OFP_BSN_ANCHOR_PACKET_START = 0 OFP_BSN_ANCHOR_L3_HEADER_START = 1