Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1 | # Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University |
| 2 | # Copyright (c) 2011, 2012 Open Networking Foundation |
| 3 | # Copyright (c) 2012, 2013 Big Switch Networks, Inc. |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4 | # See the file LICENSE.pyloxi which should have been included in the source distribution |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 5 | |
| 6 | # Automatically generated by LOXI from template module.py |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 7 | # Do not modify |
| 8 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 9 | import struct |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 10 | import loxi |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 11 | import const |
Harshmeet Singh | 1db4633 | 2014-10-14 16:29:13 -0700 | [diff] [blame] | 12 | import bsn_tlv |
| 13 | import meter_band |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 14 | import instruction |
| 15 | import oxm |
Harshmeet Singh | 1db4633 | 2014-10-14 16:29:13 -0700 | [diff] [blame] | 16 | import common |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 17 | import instruction_id |
Harshmeet Singh | 1db4633 | 2014-10-14 16:29:13 -0700 | [diff] [blame] | 18 | import action |
| 19 | import message |
| 20 | import action_id |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 21 | import util |
| 22 | import loxi.generic_util |
| 23 | |
Rich Lane | 5454b68 | 2014-01-14 17:07:36 -0800 | [diff] [blame] | 24 | class bsn_controller_connection(loxi.OFObject): |
| 25 | |
| 26 | def __init__(self, state=None, auxiliary_id=None, role=None, uri=None): |
| 27 | if state != None: |
| 28 | self.state = state |
| 29 | else: |
| 30 | self.state = 0 |
| 31 | if auxiliary_id != None: |
| 32 | self.auxiliary_id = auxiliary_id |
| 33 | else: |
| 34 | self.auxiliary_id = 0 |
| 35 | if role != None: |
| 36 | self.role = role |
| 37 | else: |
| 38 | self.role = 0 |
| 39 | if uri != None: |
| 40 | self.uri = uri |
| 41 | else: |
| 42 | self.uri = "" |
| 43 | return |
| 44 | |
| 45 | def pack(self): |
| 46 | packed = [] |
| 47 | packed.append(struct.pack("!B", self.state)) |
| 48 | packed.append(struct.pack("!B", self.auxiliary_id)) |
| 49 | packed.append('\x00' * 2) |
| 50 | packed.append(struct.pack("!L", self.role)) |
| 51 | packed.append(struct.pack("!256s", self.uri)) |
| 52 | return ''.join(packed) |
| 53 | |
| 54 | @staticmethod |
| 55 | def unpack(reader): |
| 56 | obj = bsn_controller_connection() |
| 57 | obj.state = reader.read("!B")[0] |
| 58 | obj.auxiliary_id = reader.read("!B")[0] |
| 59 | reader.skip(2) |
| 60 | obj.role = reader.read("!L")[0] |
| 61 | obj.uri = reader.read("!256s")[0].rstrip("\x00") |
| 62 | return obj |
| 63 | |
| 64 | def __eq__(self, other): |
| 65 | if type(self) != type(other): return False |
| 66 | if self.state != other.state: return False |
| 67 | if self.auxiliary_id != other.auxiliary_id: return False |
| 68 | if self.role != other.role: return False |
| 69 | if self.uri != other.uri: return False |
| 70 | return True |
| 71 | |
| 72 | def pretty_print(self, q): |
| 73 | q.text("bsn_controller_connection {") |
| 74 | with q.group(): |
| 75 | with q.indent(2): |
| 76 | q.breakable() |
| 77 | q.text("state = "); |
| 78 | q.text("%#x" % self.state) |
| 79 | q.text(","); q.breakable() |
| 80 | q.text("auxiliary_id = "); |
| 81 | q.text("%#x" % self.auxiliary_id) |
| 82 | q.text(","); q.breakable() |
| 83 | q.text("role = "); |
| 84 | q.text("%#x" % self.role) |
| 85 | q.text(","); q.breakable() |
| 86 | q.text("uri = "); |
| 87 | q.pp(self.uri) |
| 88 | q.breakable() |
| 89 | q.text('}') |
| 90 | |
| 91 | |
Rich Lane | 93b3313 | 2014-04-21 12:20:58 -0700 | [diff] [blame] | 92 | class bsn_debug_counter_desc_stats_entry(loxi.OFObject): |
| 93 | |
| 94 | def __init__(self, counter_id=None, name=None, description=None): |
| 95 | if counter_id != None: |
| 96 | self.counter_id = counter_id |
| 97 | else: |
| 98 | self.counter_id = 0 |
| 99 | if name != None: |
| 100 | self.name = name |
| 101 | else: |
| 102 | self.name = "" |
| 103 | if description != None: |
| 104 | self.description = description |
| 105 | else: |
| 106 | self.description = "" |
| 107 | return |
| 108 | |
| 109 | def pack(self): |
| 110 | packed = [] |
| 111 | packed.append(struct.pack("!Q", self.counter_id)) |
| 112 | packed.append(struct.pack("!64s", self.name)) |
| 113 | packed.append(struct.pack("!256s", self.description)) |
| 114 | return ''.join(packed) |
| 115 | |
| 116 | @staticmethod |
| 117 | def unpack(reader): |
| 118 | obj = bsn_debug_counter_desc_stats_entry() |
| 119 | obj.counter_id = reader.read("!Q")[0] |
| 120 | obj.name = reader.read("!64s")[0].rstrip("\x00") |
| 121 | obj.description = reader.read("!256s")[0].rstrip("\x00") |
| 122 | return obj |
| 123 | |
| 124 | def __eq__(self, other): |
| 125 | if type(self) != type(other): return False |
| 126 | if self.counter_id != other.counter_id: return False |
| 127 | if self.name != other.name: return False |
| 128 | if self.description != other.description: return False |
| 129 | return True |
| 130 | |
| 131 | def pretty_print(self, q): |
| 132 | q.text("bsn_debug_counter_desc_stats_entry {") |
| 133 | with q.group(): |
| 134 | with q.indent(2): |
| 135 | q.breakable() |
| 136 | q.text("counter_id = "); |
| 137 | q.text("%#x" % self.counter_id) |
| 138 | q.text(","); q.breakable() |
| 139 | q.text("name = "); |
| 140 | q.pp(self.name) |
| 141 | q.text(","); q.breakable() |
| 142 | q.text("description = "); |
| 143 | q.pp(self.description) |
| 144 | q.breakable() |
| 145 | q.text('}') |
| 146 | |
| 147 | |
| 148 | class bsn_debug_counter_stats_entry(loxi.OFObject): |
| 149 | |
| 150 | def __init__(self, counter_id=None, value=None): |
| 151 | if counter_id != None: |
| 152 | self.counter_id = counter_id |
| 153 | else: |
| 154 | self.counter_id = 0 |
| 155 | if value != None: |
| 156 | self.value = value |
| 157 | else: |
| 158 | self.value = 0 |
| 159 | return |
| 160 | |
| 161 | def pack(self): |
| 162 | packed = [] |
| 163 | packed.append(struct.pack("!Q", self.counter_id)) |
| 164 | packed.append(struct.pack("!Q", self.value)) |
| 165 | return ''.join(packed) |
| 166 | |
| 167 | @staticmethod |
| 168 | def unpack(reader): |
| 169 | obj = bsn_debug_counter_stats_entry() |
| 170 | obj.counter_id = reader.read("!Q")[0] |
| 171 | obj.value = reader.read("!Q")[0] |
| 172 | return obj |
| 173 | |
| 174 | def __eq__(self, other): |
| 175 | if type(self) != type(other): return False |
| 176 | if self.counter_id != other.counter_id: return False |
| 177 | if self.value != other.value: return False |
| 178 | return True |
| 179 | |
| 180 | def pretty_print(self, q): |
| 181 | q.text("bsn_debug_counter_stats_entry {") |
| 182 | with q.group(): |
| 183 | with q.indent(2): |
| 184 | q.breakable() |
| 185 | q.text("counter_id = "); |
| 186 | q.text("%#x" % self.counter_id) |
| 187 | q.text(","); q.breakable() |
| 188 | q.text("value = "); |
| 189 | q.text("%#x" % self.value) |
| 190 | q.breakable() |
| 191 | q.text('}') |
| 192 | |
| 193 | |
Rich Lane | 9ec3fca | 2014-02-26 16:22:56 -0800 | [diff] [blame] | 194 | class bsn_flow_checksum_bucket_stats_entry(loxi.OFObject): |
| 195 | |
| 196 | def __init__(self, checksum=None): |
| 197 | if checksum != None: |
| 198 | self.checksum = checksum |
| 199 | else: |
| 200 | self.checksum = 0 |
| 201 | return |
| 202 | |
| 203 | def pack(self): |
| 204 | packed = [] |
| 205 | packed.append(struct.pack("!Q", self.checksum)) |
| 206 | return ''.join(packed) |
| 207 | |
| 208 | @staticmethod |
| 209 | def unpack(reader): |
| 210 | obj = bsn_flow_checksum_bucket_stats_entry() |
| 211 | obj.checksum = reader.read("!Q")[0] |
| 212 | return obj |
| 213 | |
| 214 | def __eq__(self, other): |
| 215 | if type(self) != type(other): return False |
| 216 | if self.checksum != other.checksum: return False |
| 217 | return True |
| 218 | |
| 219 | def pretty_print(self, q): |
| 220 | q.text("bsn_flow_checksum_bucket_stats_entry {") |
| 221 | with q.group(): |
| 222 | with q.indent(2): |
| 223 | q.breakable() |
| 224 | q.text("checksum = "); |
| 225 | q.text("%#x" % self.checksum) |
| 226 | q.breakable() |
| 227 | q.text('}') |
| 228 | |
| 229 | |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 230 | class bsn_generic_stats_entry(loxi.OFObject): |
| 231 | |
| 232 | def __init__(self, tlvs=None): |
| 233 | if tlvs != None: |
| 234 | self.tlvs = tlvs |
| 235 | else: |
| 236 | self.tlvs = [] |
| 237 | return |
| 238 | |
| 239 | def pack(self): |
| 240 | packed = [] |
| 241 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 0 |
| 242 | packed.append(loxi.generic_util.pack_list(self.tlvs)) |
| 243 | length = sum([len(x) for x in packed]) |
| 244 | packed[0] = struct.pack("!H", length) |
| 245 | return ''.join(packed) |
| 246 | |
| 247 | @staticmethod |
| 248 | def unpack(reader): |
| 249 | obj = bsn_generic_stats_entry() |
| 250 | _length = reader.read("!H")[0] |
| 251 | orig_reader = reader |
| 252 | reader = orig_reader.slice(_length, 2) |
| 253 | obj.tlvs = loxi.generic_util.unpack_list(reader, bsn_tlv.bsn_tlv.unpack) |
| 254 | return obj |
| 255 | |
| 256 | def __eq__(self, other): |
| 257 | if type(self) != type(other): return False |
| 258 | if self.tlvs != other.tlvs: return False |
| 259 | return True |
| 260 | |
| 261 | def pretty_print(self, q): |
| 262 | q.text("bsn_generic_stats_entry {") |
| 263 | with q.group(): |
| 264 | with q.indent(2): |
| 265 | q.breakable() |
| 266 | q.text("tlvs = "); |
| 267 | q.pp(self.tlvs) |
| 268 | q.breakable() |
| 269 | q.text('}') |
| 270 | |
| 271 | |
Rich Lane | 5454b68 | 2014-01-14 17:07:36 -0800 | [diff] [blame] | 272 | class bsn_gentable_bucket_stats_entry(loxi.OFObject): |
| 273 | |
| 274 | def __init__(self, checksum=None): |
| 275 | if checksum != None: |
| 276 | self.checksum = checksum |
| 277 | else: |
| 278 | self.checksum = 0 |
| 279 | return |
| 280 | |
| 281 | def pack(self): |
| 282 | packed = [] |
| 283 | packed.append(util.pack_checksum_128(self.checksum)) |
| 284 | return ''.join(packed) |
| 285 | |
| 286 | @staticmethod |
| 287 | def unpack(reader): |
| 288 | obj = bsn_gentable_bucket_stats_entry() |
| 289 | obj.checksum = util.unpack_checksum_128(reader) |
| 290 | return obj |
| 291 | |
| 292 | def __eq__(self, other): |
| 293 | if type(self) != type(other): return False |
| 294 | if self.checksum != other.checksum: return False |
| 295 | return True |
| 296 | |
| 297 | def pretty_print(self, q): |
| 298 | q.text("bsn_gentable_bucket_stats_entry {") |
| 299 | with q.group(): |
| 300 | with q.indent(2): |
| 301 | q.breakable() |
| 302 | q.text("checksum = "); |
| 303 | q.pp(self.checksum) |
| 304 | q.breakable() |
| 305 | q.text('}') |
| 306 | |
| 307 | |
| 308 | class bsn_gentable_desc_stats_entry(loxi.OFObject): |
| 309 | |
| 310 | def __init__(self, table_id=None, name=None, buckets_size=None, max_entries=None): |
| 311 | if table_id != None: |
| 312 | self.table_id = table_id |
| 313 | else: |
| 314 | self.table_id = 0 |
| 315 | if name != None: |
| 316 | self.name = name |
| 317 | else: |
| 318 | self.name = "" |
| 319 | if buckets_size != None: |
| 320 | self.buckets_size = buckets_size |
| 321 | else: |
| 322 | self.buckets_size = 0 |
| 323 | if max_entries != None: |
| 324 | self.max_entries = max_entries |
| 325 | else: |
| 326 | self.max_entries = 0 |
| 327 | return |
| 328 | |
| 329 | def pack(self): |
| 330 | packed = [] |
| 331 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 0 |
| 332 | packed.append(struct.pack("!H", self.table_id)) |
| 333 | packed.append(struct.pack("!32s", self.name)) |
| 334 | packed.append(struct.pack("!L", self.buckets_size)) |
| 335 | packed.append(struct.pack("!L", self.max_entries)) |
| 336 | packed.append('\x00' * 4) |
| 337 | length = sum([len(x) for x in packed]) |
| 338 | packed[0] = struct.pack("!H", length) |
| 339 | return ''.join(packed) |
| 340 | |
| 341 | @staticmethod |
| 342 | def unpack(reader): |
| 343 | obj = bsn_gentable_desc_stats_entry() |
| 344 | _length = reader.read("!H")[0] |
| 345 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 346 | reader = orig_reader.slice(_length, 2) |
Rich Lane | 5454b68 | 2014-01-14 17:07:36 -0800 | [diff] [blame] | 347 | obj.table_id = reader.read("!H")[0] |
| 348 | obj.name = reader.read("!32s")[0].rstrip("\x00") |
| 349 | obj.buckets_size = reader.read("!L")[0] |
| 350 | obj.max_entries = reader.read("!L")[0] |
| 351 | reader.skip(4) |
| 352 | return obj |
| 353 | |
| 354 | def __eq__(self, other): |
| 355 | if type(self) != type(other): return False |
| 356 | if self.table_id != other.table_id: return False |
| 357 | if self.name != other.name: return False |
| 358 | if self.buckets_size != other.buckets_size: return False |
| 359 | if self.max_entries != other.max_entries: return False |
| 360 | return True |
| 361 | |
| 362 | def pretty_print(self, q): |
| 363 | q.text("bsn_gentable_desc_stats_entry {") |
| 364 | with q.group(): |
| 365 | with q.indent(2): |
| 366 | q.breakable() |
| 367 | q.text("table_id = "); |
| 368 | q.text("%#x" % self.table_id) |
| 369 | q.text(","); q.breakable() |
| 370 | q.text("name = "); |
| 371 | q.pp(self.name) |
| 372 | q.text(","); q.breakable() |
| 373 | q.text("buckets_size = "); |
| 374 | q.text("%#x" % self.buckets_size) |
| 375 | q.text(","); q.breakable() |
| 376 | q.text("max_entries = "); |
| 377 | q.text("%#x" % self.max_entries) |
| 378 | q.breakable() |
| 379 | q.text('}') |
| 380 | |
| 381 | |
| 382 | class bsn_gentable_entry_desc_stats_entry(loxi.OFObject): |
| 383 | |
| 384 | def __init__(self, checksum=None, key=None, value=None): |
| 385 | if checksum != None: |
| 386 | self.checksum = checksum |
| 387 | else: |
| 388 | self.checksum = 0 |
| 389 | if key != None: |
| 390 | self.key = key |
| 391 | else: |
| 392 | self.key = [] |
| 393 | if value != None: |
| 394 | self.value = value |
| 395 | else: |
| 396 | self.value = [] |
| 397 | return |
| 398 | |
| 399 | def pack(self): |
| 400 | packed = [] |
| 401 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 0 |
| 402 | packed.append(struct.pack("!H", 0)) # placeholder for key_length at index 1 |
| 403 | packed.append(util.pack_checksum_128(self.checksum)) |
| 404 | packed.append(loxi.generic_util.pack_list(self.key)) |
| 405 | packed[1] = struct.pack("!H", len(packed[-1])) |
| 406 | packed.append(loxi.generic_util.pack_list(self.value)) |
| 407 | length = sum([len(x) for x in packed]) |
| 408 | packed[0] = struct.pack("!H", length) |
| 409 | return ''.join(packed) |
| 410 | |
| 411 | @staticmethod |
| 412 | def unpack(reader): |
| 413 | obj = bsn_gentable_entry_desc_stats_entry() |
| 414 | _length = reader.read("!H")[0] |
| 415 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 416 | reader = orig_reader.slice(_length, 2) |
Rich Lane | 5454b68 | 2014-01-14 17:07:36 -0800 | [diff] [blame] | 417 | _key_length = reader.read("!H")[0] |
| 418 | obj.checksum = util.unpack_checksum_128(reader) |
| 419 | obj.key = loxi.generic_util.unpack_list(reader.slice(_key_length), bsn_tlv.bsn_tlv.unpack) |
| 420 | obj.value = loxi.generic_util.unpack_list(reader, bsn_tlv.bsn_tlv.unpack) |
| 421 | return obj |
| 422 | |
| 423 | def __eq__(self, other): |
| 424 | if type(self) != type(other): return False |
| 425 | if self.checksum != other.checksum: return False |
| 426 | if self.key != other.key: return False |
| 427 | if self.value != other.value: return False |
| 428 | return True |
| 429 | |
| 430 | def pretty_print(self, q): |
| 431 | q.text("bsn_gentable_entry_desc_stats_entry {") |
| 432 | with q.group(): |
| 433 | with q.indent(2): |
| 434 | q.breakable() |
| 435 | q.text("checksum = "); |
| 436 | q.pp(self.checksum) |
| 437 | q.text(","); q.breakable() |
| 438 | q.text("key = "); |
| 439 | q.pp(self.key) |
| 440 | q.text(","); q.breakable() |
| 441 | q.text("value = "); |
| 442 | q.pp(self.value) |
| 443 | q.breakable() |
| 444 | q.text('}') |
| 445 | |
| 446 | |
| 447 | class bsn_gentable_entry_stats_entry(loxi.OFObject): |
| 448 | |
| 449 | def __init__(self, key=None, stats=None): |
| 450 | if key != None: |
| 451 | self.key = key |
| 452 | else: |
| 453 | self.key = [] |
| 454 | if stats != None: |
| 455 | self.stats = stats |
| 456 | else: |
| 457 | self.stats = [] |
| 458 | return |
| 459 | |
| 460 | def pack(self): |
| 461 | packed = [] |
| 462 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 0 |
| 463 | packed.append(struct.pack("!H", 0)) # placeholder for key_length at index 1 |
| 464 | packed.append(loxi.generic_util.pack_list(self.key)) |
| 465 | packed[1] = struct.pack("!H", len(packed[-1])) |
| 466 | packed.append(loxi.generic_util.pack_list(self.stats)) |
| 467 | length = sum([len(x) for x in packed]) |
| 468 | packed[0] = struct.pack("!H", length) |
| 469 | return ''.join(packed) |
| 470 | |
| 471 | @staticmethod |
| 472 | def unpack(reader): |
| 473 | obj = bsn_gentable_entry_stats_entry() |
| 474 | _length = reader.read("!H")[0] |
| 475 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 476 | reader = orig_reader.slice(_length, 2) |
Rich Lane | 5454b68 | 2014-01-14 17:07:36 -0800 | [diff] [blame] | 477 | _key_length = reader.read("!H")[0] |
| 478 | obj.key = loxi.generic_util.unpack_list(reader.slice(_key_length), bsn_tlv.bsn_tlv.unpack) |
| 479 | obj.stats = loxi.generic_util.unpack_list(reader, bsn_tlv.bsn_tlv.unpack) |
| 480 | return obj |
| 481 | |
| 482 | def __eq__(self, other): |
| 483 | if type(self) != type(other): return False |
| 484 | if self.key != other.key: return False |
| 485 | if self.stats != other.stats: return False |
| 486 | return True |
| 487 | |
| 488 | def pretty_print(self, q): |
| 489 | q.text("bsn_gentable_entry_stats_entry {") |
| 490 | with q.group(): |
| 491 | with q.indent(2): |
| 492 | q.breakable() |
| 493 | q.text("key = "); |
| 494 | q.pp(self.key) |
| 495 | q.text(","); q.breakable() |
| 496 | q.text("stats = "); |
| 497 | q.pp(self.stats) |
| 498 | q.breakable() |
| 499 | q.text('}') |
| 500 | |
| 501 | |
| 502 | class bsn_gentable_stats_entry(loxi.OFObject): |
| 503 | |
| 504 | def __init__(self, table_id=None, entry_count=None, checksum=None): |
| 505 | if table_id != None: |
| 506 | self.table_id = table_id |
| 507 | else: |
| 508 | self.table_id = 0 |
| 509 | if entry_count != None: |
| 510 | self.entry_count = entry_count |
| 511 | else: |
| 512 | self.entry_count = 0 |
| 513 | if checksum != None: |
| 514 | self.checksum = checksum |
| 515 | else: |
| 516 | self.checksum = 0 |
| 517 | return |
| 518 | |
| 519 | def pack(self): |
| 520 | packed = [] |
| 521 | packed.append(struct.pack("!H", self.table_id)) |
| 522 | packed.append('\x00' * 2) |
| 523 | packed.append(struct.pack("!L", self.entry_count)) |
| 524 | packed.append(util.pack_checksum_128(self.checksum)) |
| 525 | return ''.join(packed) |
| 526 | |
| 527 | @staticmethod |
| 528 | def unpack(reader): |
| 529 | obj = bsn_gentable_stats_entry() |
| 530 | obj.table_id = reader.read("!H")[0] |
| 531 | reader.skip(2) |
| 532 | obj.entry_count = reader.read("!L")[0] |
| 533 | obj.checksum = util.unpack_checksum_128(reader) |
| 534 | return obj |
| 535 | |
| 536 | def __eq__(self, other): |
| 537 | if type(self) != type(other): return False |
| 538 | if self.table_id != other.table_id: return False |
| 539 | if self.entry_count != other.entry_count: return False |
| 540 | if self.checksum != other.checksum: return False |
| 541 | return True |
| 542 | |
| 543 | def pretty_print(self, q): |
| 544 | q.text("bsn_gentable_stats_entry {") |
| 545 | with q.group(): |
| 546 | with q.indent(2): |
| 547 | q.breakable() |
| 548 | q.text("table_id = "); |
| 549 | q.text("%#x" % self.table_id) |
| 550 | q.text(","); q.breakable() |
| 551 | q.text("entry_count = "); |
| 552 | q.text("%#x" % self.entry_count) |
| 553 | q.text(","); q.breakable() |
| 554 | q.text("checksum = "); |
| 555 | q.pp(self.checksum) |
| 556 | q.breakable() |
| 557 | q.text('}') |
| 558 | |
| 559 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 560 | class bsn_interface(loxi.OFObject): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 561 | |
| 562 | def __init__(self, hw_addr=None, name=None, ipv4_addr=None, ipv4_netmask=None): |
| 563 | if hw_addr != None: |
| 564 | self.hw_addr = hw_addr |
| 565 | else: |
| 566 | self.hw_addr = [0,0,0,0,0,0] |
| 567 | if name != None: |
| 568 | self.name = name |
| 569 | else: |
| 570 | self.name = "" |
| 571 | if ipv4_addr != None: |
| 572 | self.ipv4_addr = ipv4_addr |
| 573 | else: |
| 574 | self.ipv4_addr = 0 |
| 575 | if ipv4_netmask != None: |
| 576 | self.ipv4_netmask = ipv4_netmask |
| 577 | else: |
| 578 | self.ipv4_netmask = 0 |
| 579 | return |
| 580 | |
| 581 | def pack(self): |
| 582 | packed = [] |
| 583 | packed.append(struct.pack("!6B", *self.hw_addr)) |
| 584 | packed.append('\x00' * 2) |
| 585 | packed.append(struct.pack("!16s", self.name)) |
| 586 | packed.append(struct.pack("!L", self.ipv4_addr)) |
| 587 | packed.append(struct.pack("!L", self.ipv4_netmask)) |
| 588 | return ''.join(packed) |
| 589 | |
| 590 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 591 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 592 | obj = bsn_interface() |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 593 | obj.hw_addr = list(reader.read('!6B')) |
| 594 | reader.skip(2) |
| 595 | obj.name = reader.read("!16s")[0].rstrip("\x00") |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 596 | obj.ipv4_addr = reader.read("!L")[0] |
| 597 | obj.ipv4_netmask = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 598 | return obj |
| 599 | |
| 600 | def __eq__(self, other): |
| 601 | if type(self) != type(other): return False |
| 602 | if self.hw_addr != other.hw_addr: return False |
| 603 | if self.name != other.name: return False |
| 604 | if self.ipv4_addr != other.ipv4_addr: return False |
| 605 | if self.ipv4_netmask != other.ipv4_netmask: return False |
| 606 | return True |
| 607 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 608 | def pretty_print(self, q): |
| 609 | q.text("bsn_interface {") |
| 610 | with q.group(): |
| 611 | with q.indent(2): |
| 612 | q.breakable() |
| 613 | q.text("hw_addr = "); |
| 614 | q.text(util.pretty_mac(self.hw_addr)) |
| 615 | q.text(","); q.breakable() |
| 616 | q.text("name = "); |
| 617 | q.pp(self.name) |
| 618 | q.text(","); q.breakable() |
| 619 | q.text("ipv4_addr = "); |
| 620 | q.text(util.pretty_ipv4(self.ipv4_addr)) |
| 621 | q.text(","); q.breakable() |
| 622 | q.text("ipv4_netmask = "); |
| 623 | q.text(util.pretty_ipv4(self.ipv4_netmask)) |
| 624 | q.breakable() |
| 625 | q.text('}') |
| 626 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 627 | |
| 628 | class bsn_lacp_stats_entry(loxi.OFObject): |
Rich Lane | 7b0f201 | 2013-11-22 14:15:26 -0800 | [diff] [blame] | 629 | |
| 630 | def __init__(self, port_no=None, actor_sys_priority=None, actor_sys_mac=None, actor_port_priority=None, actor_port_num=None, actor_key=None, convergence_status=None, partner_sys_priority=None, partner_sys_mac=None, partner_port_priority=None, partner_port_num=None, partner_key=None): |
| 631 | if port_no != None: |
| 632 | self.port_no = port_no |
| 633 | else: |
| 634 | self.port_no = 0 |
| 635 | if actor_sys_priority != None: |
| 636 | self.actor_sys_priority = actor_sys_priority |
| 637 | else: |
| 638 | self.actor_sys_priority = 0 |
| 639 | if actor_sys_mac != None: |
| 640 | self.actor_sys_mac = actor_sys_mac |
| 641 | else: |
| 642 | self.actor_sys_mac = [0,0,0,0,0,0] |
| 643 | if actor_port_priority != None: |
| 644 | self.actor_port_priority = actor_port_priority |
| 645 | else: |
| 646 | self.actor_port_priority = 0 |
| 647 | if actor_port_num != None: |
| 648 | self.actor_port_num = actor_port_num |
| 649 | else: |
| 650 | self.actor_port_num = 0 |
| 651 | if actor_key != None: |
| 652 | self.actor_key = actor_key |
| 653 | else: |
| 654 | self.actor_key = 0 |
| 655 | if convergence_status != None: |
| 656 | self.convergence_status = convergence_status |
| 657 | else: |
| 658 | self.convergence_status = 0 |
| 659 | if partner_sys_priority != None: |
| 660 | self.partner_sys_priority = partner_sys_priority |
| 661 | else: |
| 662 | self.partner_sys_priority = 0 |
| 663 | if partner_sys_mac != None: |
| 664 | self.partner_sys_mac = partner_sys_mac |
| 665 | else: |
| 666 | self.partner_sys_mac = [0,0,0,0,0,0] |
| 667 | if partner_port_priority != None: |
| 668 | self.partner_port_priority = partner_port_priority |
| 669 | else: |
| 670 | self.partner_port_priority = 0 |
| 671 | if partner_port_num != None: |
| 672 | self.partner_port_num = partner_port_num |
| 673 | else: |
| 674 | self.partner_port_num = 0 |
| 675 | if partner_key != None: |
| 676 | self.partner_key = partner_key |
| 677 | else: |
| 678 | self.partner_key = 0 |
| 679 | return |
| 680 | |
| 681 | def pack(self): |
| 682 | packed = [] |
| 683 | packed.append(util.pack_port_no(self.port_no)) |
| 684 | packed.append(struct.pack("!H", self.actor_sys_priority)) |
| 685 | packed.append(struct.pack("!6B", *self.actor_sys_mac)) |
| 686 | packed.append(struct.pack("!H", self.actor_port_priority)) |
| 687 | packed.append(struct.pack("!H", self.actor_port_num)) |
| 688 | packed.append(struct.pack("!H", self.actor_key)) |
| 689 | packed.append(struct.pack("!B", self.convergence_status)) |
| 690 | packed.append('\x00' * 1) |
| 691 | packed.append(struct.pack("!H", self.partner_sys_priority)) |
| 692 | packed.append(struct.pack("!6B", *self.partner_sys_mac)) |
| 693 | packed.append(struct.pack("!H", self.partner_port_priority)) |
| 694 | packed.append(struct.pack("!H", self.partner_port_num)) |
| 695 | packed.append(struct.pack("!H", self.partner_key)) |
| 696 | packed.append('\x00' * 2) |
| 697 | return ''.join(packed) |
| 698 | |
| 699 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 700 | def unpack(reader): |
Rich Lane | 7b0f201 | 2013-11-22 14:15:26 -0800 | [diff] [blame] | 701 | obj = bsn_lacp_stats_entry() |
Rich Lane | 7b0f201 | 2013-11-22 14:15:26 -0800 | [diff] [blame] | 702 | obj.port_no = util.unpack_port_no(reader) |
| 703 | obj.actor_sys_priority = reader.read("!H")[0] |
| 704 | obj.actor_sys_mac = list(reader.read('!6B')) |
| 705 | obj.actor_port_priority = reader.read("!H")[0] |
| 706 | obj.actor_port_num = reader.read("!H")[0] |
| 707 | obj.actor_key = reader.read("!H")[0] |
| 708 | obj.convergence_status = reader.read("!B")[0] |
| 709 | reader.skip(1) |
| 710 | obj.partner_sys_priority = reader.read("!H")[0] |
| 711 | obj.partner_sys_mac = list(reader.read('!6B')) |
| 712 | obj.partner_port_priority = reader.read("!H")[0] |
| 713 | obj.partner_port_num = reader.read("!H")[0] |
| 714 | obj.partner_key = reader.read("!H")[0] |
| 715 | reader.skip(2) |
| 716 | return obj |
| 717 | |
| 718 | def __eq__(self, other): |
| 719 | if type(self) != type(other): return False |
| 720 | if self.port_no != other.port_no: return False |
| 721 | if self.actor_sys_priority != other.actor_sys_priority: return False |
| 722 | if self.actor_sys_mac != other.actor_sys_mac: return False |
| 723 | if self.actor_port_priority != other.actor_port_priority: return False |
| 724 | if self.actor_port_num != other.actor_port_num: return False |
| 725 | if self.actor_key != other.actor_key: return False |
| 726 | if self.convergence_status != other.convergence_status: return False |
| 727 | if self.partner_sys_priority != other.partner_sys_priority: return False |
| 728 | if self.partner_sys_mac != other.partner_sys_mac: return False |
| 729 | if self.partner_port_priority != other.partner_port_priority: return False |
| 730 | if self.partner_port_num != other.partner_port_num: return False |
| 731 | if self.partner_key != other.partner_key: return False |
| 732 | return True |
| 733 | |
Rich Lane | 7b0f201 | 2013-11-22 14:15:26 -0800 | [diff] [blame] | 734 | def pretty_print(self, q): |
| 735 | q.text("bsn_lacp_stats_entry {") |
| 736 | with q.group(): |
| 737 | with q.indent(2): |
| 738 | q.breakable() |
| 739 | q.text("port_no = "); |
| 740 | q.text(util.pretty_port(self.port_no)) |
| 741 | q.text(","); q.breakable() |
| 742 | q.text("actor_sys_priority = "); |
| 743 | q.text("%#x" % self.actor_sys_priority) |
| 744 | q.text(","); q.breakable() |
| 745 | q.text("actor_sys_mac = "); |
| 746 | q.text(util.pretty_mac(self.actor_sys_mac)) |
| 747 | q.text(","); q.breakable() |
| 748 | q.text("actor_port_priority = "); |
| 749 | q.text("%#x" % self.actor_port_priority) |
| 750 | q.text(","); q.breakable() |
| 751 | q.text("actor_port_num = "); |
| 752 | q.text("%#x" % self.actor_port_num) |
| 753 | q.text(","); q.breakable() |
| 754 | q.text("actor_key = "); |
| 755 | q.text("%#x" % self.actor_key) |
| 756 | q.text(","); q.breakable() |
| 757 | q.text("convergence_status = "); |
| 758 | q.text("%#x" % self.convergence_status) |
| 759 | q.text(","); q.breakable() |
| 760 | q.text("partner_sys_priority = "); |
| 761 | q.text("%#x" % self.partner_sys_priority) |
| 762 | q.text(","); q.breakable() |
| 763 | q.text("partner_sys_mac = "); |
| 764 | q.text(util.pretty_mac(self.partner_sys_mac)) |
| 765 | q.text(","); q.breakable() |
| 766 | q.text("partner_port_priority = "); |
| 767 | q.text("%#x" % self.partner_port_priority) |
| 768 | q.text(","); q.breakable() |
| 769 | q.text("partner_port_num = "); |
| 770 | q.text("%#x" % self.partner_port_num) |
| 771 | q.text(","); q.breakable() |
| 772 | q.text("partner_key = "); |
| 773 | q.text("%#x" % self.partner_key) |
| 774 | q.breakable() |
| 775 | q.text('}') |
| 776 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 777 | |
| 778 | class bsn_port_counter_stats_entry(loxi.OFObject): |
| 779 | |
| 780 | def __init__(self, port_no=None, values=None): |
| 781 | if port_no != None: |
| 782 | self.port_no = port_no |
| 783 | else: |
| 784 | self.port_no = 0 |
| 785 | if values != None: |
| 786 | self.values = values |
| 787 | else: |
| 788 | self.values = [] |
| 789 | return |
| 790 | |
| 791 | def pack(self): |
| 792 | packed = [] |
| 793 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 0 |
| 794 | packed.append('\x00' * 2) |
| 795 | packed.append(util.pack_port_no(self.port_no)) |
| 796 | packed.append(loxi.generic_util.pack_list(self.values)) |
| 797 | length = sum([len(x) for x in packed]) |
| 798 | packed[0] = struct.pack("!H", length) |
| 799 | return ''.join(packed) |
| 800 | |
| 801 | @staticmethod |
| 802 | def unpack(reader): |
| 803 | obj = bsn_port_counter_stats_entry() |
| 804 | _length = reader.read("!H")[0] |
| 805 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 806 | reader = orig_reader.slice(_length, 2) |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 807 | reader.skip(2) |
| 808 | obj.port_no = util.unpack_port_no(reader) |
| 809 | obj.values = loxi.generic_util.unpack_list(reader, common.uint64.unpack) |
| 810 | return obj |
| 811 | |
| 812 | def __eq__(self, other): |
| 813 | if type(self) != type(other): return False |
| 814 | if self.port_no != other.port_no: return False |
| 815 | if self.values != other.values: return False |
| 816 | return True |
| 817 | |
| 818 | def pretty_print(self, q): |
| 819 | q.text("bsn_port_counter_stats_entry {") |
| 820 | with q.group(): |
| 821 | with q.indent(2): |
| 822 | q.breakable() |
| 823 | q.text("port_no = "); |
| 824 | q.text(util.pretty_port(self.port_no)) |
| 825 | q.text(","); q.breakable() |
| 826 | q.text("values = "); |
| 827 | q.pp(self.values) |
| 828 | q.breakable() |
| 829 | q.text('}') |
| 830 | |
| 831 | |
| 832 | class bsn_switch_pipeline_stats_entry(loxi.OFObject): |
| 833 | |
| 834 | def __init__(self, pipeline=None): |
| 835 | if pipeline != None: |
| 836 | self.pipeline = pipeline |
| 837 | else: |
| 838 | self.pipeline = "" |
| 839 | return |
| 840 | |
| 841 | def pack(self): |
| 842 | packed = [] |
| 843 | packed.append(struct.pack("!256s", self.pipeline)) |
| 844 | return ''.join(packed) |
| 845 | |
| 846 | @staticmethod |
| 847 | def unpack(reader): |
| 848 | obj = bsn_switch_pipeline_stats_entry() |
| 849 | obj.pipeline = reader.read("!256s")[0].rstrip("\x00") |
| 850 | return obj |
| 851 | |
| 852 | def __eq__(self, other): |
| 853 | if type(self) != type(other): return False |
| 854 | if self.pipeline != other.pipeline: return False |
| 855 | return True |
| 856 | |
| 857 | def pretty_print(self, q): |
| 858 | q.text("bsn_switch_pipeline_stats_entry {") |
| 859 | with q.group(): |
| 860 | with q.indent(2): |
| 861 | q.breakable() |
| 862 | q.text("pipeline = "); |
| 863 | q.pp(self.pipeline) |
| 864 | q.breakable() |
| 865 | q.text('}') |
| 866 | |
| 867 | |
Rich Lane | 9ec3fca | 2014-02-26 16:22:56 -0800 | [diff] [blame] | 868 | class bsn_table_checksum_stats_entry(loxi.OFObject): |
| 869 | |
| 870 | def __init__(self, table_id=None, checksum=None): |
| 871 | if table_id != None: |
| 872 | self.table_id = table_id |
| 873 | else: |
| 874 | self.table_id = 0 |
| 875 | if checksum != None: |
| 876 | self.checksum = checksum |
| 877 | else: |
| 878 | self.checksum = 0 |
| 879 | return |
| 880 | |
| 881 | def pack(self): |
| 882 | packed = [] |
| 883 | packed.append(struct.pack("!B", self.table_id)) |
| 884 | packed.append(struct.pack("!Q", self.checksum)) |
| 885 | return ''.join(packed) |
| 886 | |
| 887 | @staticmethod |
| 888 | def unpack(reader): |
| 889 | obj = bsn_table_checksum_stats_entry() |
| 890 | obj.table_id = reader.read("!B")[0] |
| 891 | obj.checksum = reader.read("!Q")[0] |
| 892 | return obj |
| 893 | |
| 894 | def __eq__(self, other): |
| 895 | if type(self) != type(other): return False |
| 896 | if self.table_id != other.table_id: return False |
| 897 | if self.checksum != other.checksum: return False |
| 898 | return True |
| 899 | |
| 900 | def pretty_print(self, q): |
| 901 | q.text("bsn_table_checksum_stats_entry {") |
| 902 | with q.group(): |
| 903 | with q.indent(2): |
| 904 | q.breakable() |
| 905 | q.text("table_id = "); |
| 906 | q.text("%#x" % self.table_id) |
| 907 | q.text(","); q.breakable() |
| 908 | q.text("checksum = "); |
| 909 | q.text("%#x" % self.checksum) |
| 910 | q.breakable() |
| 911 | q.text('}') |
| 912 | |
| 913 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 914 | class bsn_vport(loxi.OFObject): |
| 915 | subtypes = {} |
| 916 | |
Rich Lane | 95f7fc9 | 2014-01-27 17:08:16 -0800 | [diff] [blame] | 917 | |
| 918 | def __init__(self, type=None): |
| 919 | if type != None: |
| 920 | self.type = type |
| 921 | else: |
| 922 | self.type = 0 |
| 923 | return |
| 924 | |
| 925 | def pack(self): |
| 926 | packed = [] |
| 927 | packed.append(struct.pack("!H", self.type)) |
| 928 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 |
| 929 | length = sum([len(x) for x in packed]) |
| 930 | packed[1] = struct.pack("!H", length) |
| 931 | return ''.join(packed) |
| 932 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 933 | @staticmethod |
| 934 | def unpack(reader): |
| 935 | subtype, = reader.peek('!H', 0) |
Rich Lane | 95f7fc9 | 2014-01-27 17:08:16 -0800 | [diff] [blame] | 936 | subclass = bsn_vport.subtypes.get(subtype) |
| 937 | if subclass: |
| 938 | return subclass.unpack(reader) |
| 939 | |
| 940 | obj = bsn_vport() |
| 941 | obj.type = reader.read("!H")[0] |
| 942 | _length = reader.read("!H")[0] |
| 943 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 944 | reader = orig_reader.slice(_length, 4) |
Rich Lane | 95f7fc9 | 2014-01-27 17:08:16 -0800 | [diff] [blame] | 945 | return obj |
| 946 | |
| 947 | def __eq__(self, other): |
| 948 | if type(self) != type(other): return False |
| 949 | if self.type != other.type: return False |
| 950 | return True |
| 951 | |
| 952 | def pretty_print(self, q): |
| 953 | q.text("bsn_vport {") |
| 954 | with q.group(): |
| 955 | with q.indent(2): |
| 956 | q.breakable() |
| 957 | q.breakable() |
| 958 | q.text('}') |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 959 | |
| 960 | |
Rich Lane | 93b3313 | 2014-04-21 12:20:58 -0700 | [diff] [blame] | 961 | class bsn_vlan_counter_stats_entry(loxi.OFObject): |
| 962 | |
| 963 | def __init__(self, vlan_vid=None, values=None): |
| 964 | if vlan_vid != None: |
| 965 | self.vlan_vid = vlan_vid |
| 966 | else: |
| 967 | self.vlan_vid = 0 |
| 968 | if values != None: |
| 969 | self.values = values |
| 970 | else: |
| 971 | self.values = [] |
| 972 | return |
| 973 | |
| 974 | def pack(self): |
| 975 | packed = [] |
| 976 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 0 |
| 977 | packed.append(struct.pack("!H", self.vlan_vid)) |
| 978 | packed.append('\x00' * 4) |
| 979 | packed.append(loxi.generic_util.pack_list(self.values)) |
| 980 | length = sum([len(x) for x in packed]) |
| 981 | packed[0] = struct.pack("!H", length) |
| 982 | return ''.join(packed) |
| 983 | |
| 984 | @staticmethod |
| 985 | def unpack(reader): |
| 986 | obj = bsn_vlan_counter_stats_entry() |
| 987 | _length = reader.read("!H")[0] |
| 988 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 989 | reader = orig_reader.slice(_length, 2) |
Rich Lane | 93b3313 | 2014-04-21 12:20:58 -0700 | [diff] [blame] | 990 | obj.vlan_vid = reader.read("!H")[0] |
| 991 | reader.skip(4) |
| 992 | obj.values = loxi.generic_util.unpack_list(reader, common.uint64.unpack) |
| 993 | return obj |
| 994 | |
| 995 | def __eq__(self, other): |
| 996 | if type(self) != type(other): return False |
| 997 | if self.vlan_vid != other.vlan_vid: return False |
| 998 | if self.values != other.values: return False |
| 999 | return True |
| 1000 | |
| 1001 | def pretty_print(self, q): |
| 1002 | q.text("bsn_vlan_counter_stats_entry {") |
| 1003 | with q.group(): |
| 1004 | with q.indent(2): |
| 1005 | q.breakable() |
| 1006 | q.text("vlan_vid = "); |
| 1007 | q.text("%#x" % self.vlan_vid) |
| 1008 | q.text(","); q.breakable() |
| 1009 | q.text("values = "); |
| 1010 | q.pp(self.values) |
| 1011 | q.breakable() |
| 1012 | q.text('}') |
| 1013 | |
| 1014 | |
| 1015 | class bsn_vport_l2gre(bsn_vport): |
| 1016 | type = 1 |
| 1017 | |
Rich Lane | f9530c4 | 2014-09-15 09:59:43 -0700 | [diff] [blame] | 1018 | def __init__(self, flags=None, port_no=None, loopback_port_no=None, local_mac=None, nh_mac=None, src_ip=None, dst_ip=None, dscp=None, ttl=None, vpn=None, rate_limit=None, if_name=None): |
Rich Lane | 93b3313 | 2014-04-21 12:20:58 -0700 | [diff] [blame] | 1019 | if flags != None: |
| 1020 | self.flags = flags |
| 1021 | else: |
| 1022 | self.flags = 0 |
| 1023 | if port_no != None: |
| 1024 | self.port_no = port_no |
| 1025 | else: |
| 1026 | self.port_no = 0 |
Rich Lane | 5587ab1 | 2014-06-30 11:19:09 -0700 | [diff] [blame] | 1027 | if loopback_port_no != None: |
| 1028 | self.loopback_port_no = loopback_port_no |
| 1029 | else: |
| 1030 | self.loopback_port_no = 0 |
Rich Lane | 93b3313 | 2014-04-21 12:20:58 -0700 | [diff] [blame] | 1031 | if local_mac != None: |
| 1032 | self.local_mac = local_mac |
| 1033 | else: |
| 1034 | self.local_mac = [0,0,0,0,0,0] |
| 1035 | if nh_mac != None: |
| 1036 | self.nh_mac = nh_mac |
| 1037 | else: |
| 1038 | self.nh_mac = [0,0,0,0,0,0] |
| 1039 | if src_ip != None: |
| 1040 | self.src_ip = src_ip |
| 1041 | else: |
| 1042 | self.src_ip = 0 |
| 1043 | if dst_ip != None: |
| 1044 | self.dst_ip = dst_ip |
| 1045 | else: |
| 1046 | self.dst_ip = 0 |
| 1047 | if dscp != None: |
| 1048 | self.dscp = dscp |
| 1049 | else: |
| 1050 | self.dscp = 0 |
| 1051 | if ttl != None: |
| 1052 | self.ttl = ttl |
| 1053 | else: |
| 1054 | self.ttl = 0 |
| 1055 | if vpn != None: |
| 1056 | self.vpn = vpn |
| 1057 | else: |
| 1058 | self.vpn = 0 |
Rich Lane | f9530c4 | 2014-09-15 09:59:43 -0700 | [diff] [blame] | 1059 | if rate_limit != None: |
| 1060 | self.rate_limit = rate_limit |
| 1061 | else: |
| 1062 | self.rate_limit = 0 |
Rich Lane | 93b3313 | 2014-04-21 12:20:58 -0700 | [diff] [blame] | 1063 | if if_name != None: |
| 1064 | self.if_name = if_name |
| 1065 | else: |
| 1066 | self.if_name = "" |
| 1067 | return |
| 1068 | |
| 1069 | def pack(self): |
| 1070 | packed = [] |
| 1071 | packed.append(struct.pack("!H", self.type)) |
| 1072 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 |
| 1073 | packed.append(struct.pack("!L", self.flags)) |
| 1074 | packed.append(util.pack_port_no(self.port_no)) |
Rich Lane | 5587ab1 | 2014-06-30 11:19:09 -0700 | [diff] [blame] | 1075 | packed.append(util.pack_port_no(self.loopback_port_no)) |
Rich Lane | 93b3313 | 2014-04-21 12:20:58 -0700 | [diff] [blame] | 1076 | packed.append(struct.pack("!6B", *self.local_mac)) |
| 1077 | packed.append(struct.pack("!6B", *self.nh_mac)) |
| 1078 | packed.append(struct.pack("!L", self.src_ip)) |
| 1079 | packed.append(struct.pack("!L", self.dst_ip)) |
| 1080 | packed.append(struct.pack("!B", self.dscp)) |
| 1081 | packed.append(struct.pack("!B", self.ttl)) |
| 1082 | packed.append('\x00' * 2) |
| 1083 | packed.append(struct.pack("!L", self.vpn)) |
Rich Lane | f9530c4 | 2014-09-15 09:59:43 -0700 | [diff] [blame] | 1084 | packed.append(struct.pack("!L", self.rate_limit)) |
Rich Lane | 93b3313 | 2014-04-21 12:20:58 -0700 | [diff] [blame] | 1085 | packed.append(struct.pack("!16s", self.if_name)) |
| 1086 | length = sum([len(x) for x in packed]) |
| 1087 | packed[1] = struct.pack("!H", length) |
| 1088 | return ''.join(packed) |
| 1089 | |
| 1090 | @staticmethod |
| 1091 | def unpack(reader): |
| 1092 | obj = bsn_vport_l2gre() |
| 1093 | _type = reader.read("!H")[0] |
| 1094 | assert(_type == 1) |
| 1095 | _length = reader.read("!H")[0] |
| 1096 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 1097 | reader = orig_reader.slice(_length, 4) |
Rich Lane | 93b3313 | 2014-04-21 12:20:58 -0700 | [diff] [blame] | 1098 | obj.flags = reader.read("!L")[0] |
| 1099 | obj.port_no = util.unpack_port_no(reader) |
Rich Lane | 5587ab1 | 2014-06-30 11:19:09 -0700 | [diff] [blame] | 1100 | obj.loopback_port_no = util.unpack_port_no(reader) |
Rich Lane | 93b3313 | 2014-04-21 12:20:58 -0700 | [diff] [blame] | 1101 | obj.local_mac = list(reader.read('!6B')) |
| 1102 | obj.nh_mac = list(reader.read('!6B')) |
| 1103 | obj.src_ip = reader.read("!L")[0] |
| 1104 | obj.dst_ip = reader.read("!L")[0] |
| 1105 | obj.dscp = reader.read("!B")[0] |
| 1106 | obj.ttl = reader.read("!B")[0] |
| 1107 | reader.skip(2) |
| 1108 | obj.vpn = reader.read("!L")[0] |
Rich Lane | f9530c4 | 2014-09-15 09:59:43 -0700 | [diff] [blame] | 1109 | obj.rate_limit = reader.read("!L")[0] |
Rich Lane | 93b3313 | 2014-04-21 12:20:58 -0700 | [diff] [blame] | 1110 | obj.if_name = reader.read("!16s")[0].rstrip("\x00") |
| 1111 | return obj |
| 1112 | |
| 1113 | def __eq__(self, other): |
| 1114 | if type(self) != type(other): return False |
| 1115 | if self.flags != other.flags: return False |
| 1116 | if self.port_no != other.port_no: return False |
Rich Lane | 5587ab1 | 2014-06-30 11:19:09 -0700 | [diff] [blame] | 1117 | if self.loopback_port_no != other.loopback_port_no: return False |
Rich Lane | 93b3313 | 2014-04-21 12:20:58 -0700 | [diff] [blame] | 1118 | if self.local_mac != other.local_mac: return False |
| 1119 | if self.nh_mac != other.nh_mac: return False |
| 1120 | if self.src_ip != other.src_ip: return False |
| 1121 | if self.dst_ip != other.dst_ip: return False |
| 1122 | if self.dscp != other.dscp: return False |
| 1123 | if self.ttl != other.ttl: return False |
| 1124 | if self.vpn != other.vpn: return False |
Rich Lane | f9530c4 | 2014-09-15 09:59:43 -0700 | [diff] [blame] | 1125 | if self.rate_limit != other.rate_limit: return False |
Rich Lane | 93b3313 | 2014-04-21 12:20:58 -0700 | [diff] [blame] | 1126 | if self.if_name != other.if_name: return False |
| 1127 | return True |
| 1128 | |
| 1129 | def pretty_print(self, q): |
| 1130 | q.text("bsn_vport_l2gre {") |
| 1131 | with q.group(): |
| 1132 | with q.indent(2): |
| 1133 | q.breakable() |
| 1134 | q.text("flags = "); |
| 1135 | q.text("%#x" % self.flags) |
| 1136 | q.text(","); q.breakable() |
| 1137 | q.text("port_no = "); |
| 1138 | q.text(util.pretty_port(self.port_no)) |
| 1139 | q.text(","); q.breakable() |
Rich Lane | 5587ab1 | 2014-06-30 11:19:09 -0700 | [diff] [blame] | 1140 | q.text("loopback_port_no = "); |
| 1141 | q.text(util.pretty_port(self.loopback_port_no)) |
| 1142 | q.text(","); q.breakable() |
Rich Lane | 93b3313 | 2014-04-21 12:20:58 -0700 | [diff] [blame] | 1143 | q.text("local_mac = "); |
| 1144 | q.text(util.pretty_mac(self.local_mac)) |
| 1145 | q.text(","); q.breakable() |
| 1146 | q.text("nh_mac = "); |
| 1147 | q.text(util.pretty_mac(self.nh_mac)) |
| 1148 | q.text(","); q.breakable() |
| 1149 | q.text("src_ip = "); |
| 1150 | q.text(util.pretty_ipv4(self.src_ip)) |
| 1151 | q.text(","); q.breakable() |
| 1152 | q.text("dst_ip = "); |
| 1153 | q.text(util.pretty_ipv4(self.dst_ip)) |
| 1154 | q.text(","); q.breakable() |
| 1155 | q.text("dscp = "); |
| 1156 | q.text("%#x" % self.dscp) |
| 1157 | q.text(","); q.breakable() |
| 1158 | q.text("ttl = "); |
| 1159 | q.text("%#x" % self.ttl) |
| 1160 | q.text(","); q.breakable() |
| 1161 | q.text("vpn = "); |
| 1162 | q.text("%#x" % self.vpn) |
| 1163 | q.text(","); q.breakable() |
Rich Lane | f9530c4 | 2014-09-15 09:59:43 -0700 | [diff] [blame] | 1164 | q.text("rate_limit = "); |
| 1165 | q.text("%#x" % self.rate_limit) |
| 1166 | q.text(","); q.breakable() |
Rich Lane | 93b3313 | 2014-04-21 12:20:58 -0700 | [diff] [blame] | 1167 | q.text("if_name = "); |
| 1168 | q.pp(self.if_name) |
| 1169 | q.breakable() |
| 1170 | q.text('}') |
| 1171 | |
| 1172 | bsn_vport.subtypes[1] = bsn_vport_l2gre |
| 1173 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1174 | class bsn_vport_q_in_q(bsn_vport): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1175 | type = 0 |
| 1176 | |
Kiran Poola | 150d8b0 | 2013-09-20 13:30:39 -0700 | [diff] [blame] | 1177 | def __init__(self, port_no=None, ingress_tpid=None, ingress_vlan_id=None, egress_tpid=None, egress_vlan_id=None, if_name=None): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1178 | if port_no != None: |
| 1179 | self.port_no = port_no |
| 1180 | else: |
| 1181 | self.port_no = 0 |
| 1182 | if ingress_tpid != None: |
| 1183 | self.ingress_tpid = ingress_tpid |
| 1184 | else: |
| 1185 | self.ingress_tpid = 0 |
| 1186 | if ingress_vlan_id != None: |
| 1187 | self.ingress_vlan_id = ingress_vlan_id |
| 1188 | else: |
| 1189 | self.ingress_vlan_id = 0 |
| 1190 | if egress_tpid != None: |
| 1191 | self.egress_tpid = egress_tpid |
| 1192 | else: |
| 1193 | self.egress_tpid = 0 |
| 1194 | if egress_vlan_id != None: |
| 1195 | self.egress_vlan_id = egress_vlan_id |
| 1196 | else: |
| 1197 | self.egress_vlan_id = 0 |
Kiran Poola | 150d8b0 | 2013-09-20 13:30:39 -0700 | [diff] [blame] | 1198 | if if_name != None: |
| 1199 | self.if_name = if_name |
| 1200 | else: |
| 1201 | self.if_name = "" |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1202 | return |
| 1203 | |
| 1204 | def pack(self): |
| 1205 | packed = [] |
| 1206 | packed.append(struct.pack("!H", self.type)) |
Kiran Poola | 150d8b0 | 2013-09-20 13:30:39 -0700 | [diff] [blame] | 1207 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1208 | packed.append(struct.pack("!L", self.port_no)) |
| 1209 | packed.append(struct.pack("!H", self.ingress_tpid)) |
| 1210 | packed.append(struct.pack("!H", self.ingress_vlan_id)) |
| 1211 | packed.append(struct.pack("!H", self.egress_tpid)) |
| 1212 | packed.append(struct.pack("!H", self.egress_vlan_id)) |
Kiran Poola | 150d8b0 | 2013-09-20 13:30:39 -0700 | [diff] [blame] | 1213 | packed.append(struct.pack("!16s", self.if_name)) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1214 | length = sum([len(x) for x in packed]) |
Kiran Poola | 150d8b0 | 2013-09-20 13:30:39 -0700 | [diff] [blame] | 1215 | packed[1] = struct.pack("!H", length) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1216 | return ''.join(packed) |
| 1217 | |
| 1218 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1219 | def unpack(reader): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1220 | obj = bsn_vport_q_in_q() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1221 | _type = reader.read("!H")[0] |
| 1222 | assert(_type == 0) |
| 1223 | _length = reader.read("!H")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1224 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 1225 | reader = orig_reader.slice(_length, 4) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1226 | obj.port_no = reader.read("!L")[0] |
| 1227 | obj.ingress_tpid = reader.read("!H")[0] |
| 1228 | obj.ingress_vlan_id = reader.read("!H")[0] |
| 1229 | obj.egress_tpid = reader.read("!H")[0] |
| 1230 | obj.egress_vlan_id = reader.read("!H")[0] |
Kiran Poola | 150d8b0 | 2013-09-20 13:30:39 -0700 | [diff] [blame] | 1231 | obj.if_name = reader.read("!16s")[0].rstrip("\x00") |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1232 | return obj |
| 1233 | |
| 1234 | def __eq__(self, other): |
| 1235 | if type(self) != type(other): return False |
| 1236 | if self.port_no != other.port_no: return False |
| 1237 | if self.ingress_tpid != other.ingress_tpid: return False |
| 1238 | if self.ingress_vlan_id != other.ingress_vlan_id: return False |
| 1239 | if self.egress_tpid != other.egress_tpid: return False |
| 1240 | if self.egress_vlan_id != other.egress_vlan_id: return False |
Kiran Poola | 150d8b0 | 2013-09-20 13:30:39 -0700 | [diff] [blame] | 1241 | if self.if_name != other.if_name: return False |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1242 | return True |
| 1243 | |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1244 | def pretty_print(self, q): |
| 1245 | q.text("bsn_vport_q_in_q {") |
| 1246 | with q.group(): |
| 1247 | with q.indent(2): |
| 1248 | q.breakable() |
| 1249 | q.text("port_no = "); |
| 1250 | q.text("%#x" % self.port_no) |
| 1251 | q.text(","); q.breakable() |
| 1252 | q.text("ingress_tpid = "); |
| 1253 | q.text("%#x" % self.ingress_tpid) |
| 1254 | q.text(","); q.breakable() |
| 1255 | q.text("ingress_vlan_id = "); |
| 1256 | q.text("%#x" % self.ingress_vlan_id) |
| 1257 | q.text(","); q.breakable() |
| 1258 | q.text("egress_tpid = "); |
| 1259 | q.text("%#x" % self.egress_tpid) |
| 1260 | q.text(","); q.breakable() |
| 1261 | q.text("egress_vlan_id = "); |
| 1262 | q.text("%#x" % self.egress_vlan_id) |
Kiran Poola | 150d8b0 | 2013-09-20 13:30:39 -0700 | [diff] [blame] | 1263 | q.text(","); q.breakable() |
| 1264 | q.text("if_name = "); |
| 1265 | q.pp(self.if_name) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1266 | q.breakable() |
| 1267 | q.text('}') |
| 1268 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1269 | bsn_vport.subtypes[0] = bsn_vport_q_in_q |
| 1270 | |
Rich Lane | 5587ab1 | 2014-06-30 11:19:09 -0700 | [diff] [blame] | 1271 | class bsn_vrf_counter_stats_entry(loxi.OFObject): |
| 1272 | |
| 1273 | def __init__(self, vrf=None, values=None): |
| 1274 | if vrf != None: |
| 1275 | self.vrf = vrf |
| 1276 | else: |
| 1277 | self.vrf = 0 |
| 1278 | if values != None: |
| 1279 | self.values = values |
| 1280 | else: |
| 1281 | self.values = [] |
| 1282 | return |
| 1283 | |
| 1284 | def pack(self): |
| 1285 | packed = [] |
| 1286 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 0 |
| 1287 | packed.append('\x00' * 2) |
| 1288 | packed.append(struct.pack("!L", self.vrf)) |
| 1289 | packed.append(loxi.generic_util.pack_list(self.values)) |
| 1290 | length = sum([len(x) for x in packed]) |
| 1291 | packed[0] = struct.pack("!H", length) |
| 1292 | return ''.join(packed) |
| 1293 | |
| 1294 | @staticmethod |
| 1295 | def unpack(reader): |
| 1296 | obj = bsn_vrf_counter_stats_entry() |
| 1297 | _length = reader.read("!H")[0] |
| 1298 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 1299 | reader = orig_reader.slice(_length, 2) |
Rich Lane | 5587ab1 | 2014-06-30 11:19:09 -0700 | [diff] [blame] | 1300 | reader.skip(2) |
| 1301 | obj.vrf = reader.read("!L")[0] |
| 1302 | obj.values = loxi.generic_util.unpack_list(reader, common.uint64.unpack) |
| 1303 | return obj |
| 1304 | |
| 1305 | def __eq__(self, other): |
| 1306 | if type(self) != type(other): return False |
| 1307 | if self.vrf != other.vrf: return False |
| 1308 | if self.values != other.values: return False |
| 1309 | return True |
| 1310 | |
| 1311 | def pretty_print(self, q): |
| 1312 | q.text("bsn_vrf_counter_stats_entry {") |
| 1313 | with q.group(): |
| 1314 | with q.indent(2): |
| 1315 | q.breakable() |
| 1316 | q.text("vrf = "); |
| 1317 | q.text("%#x" % self.vrf) |
| 1318 | q.text(","); q.breakable() |
| 1319 | q.text("values = "); |
| 1320 | q.pp(self.values) |
| 1321 | q.breakable() |
| 1322 | q.text('}') |
| 1323 | |
| 1324 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1325 | class bucket(loxi.OFObject): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1326 | |
| 1327 | def __init__(self, weight=None, watch_port=None, watch_group=None, actions=None): |
| 1328 | if weight != None: |
| 1329 | self.weight = weight |
| 1330 | else: |
| 1331 | self.weight = 0 |
| 1332 | if watch_port != None: |
| 1333 | self.watch_port = watch_port |
| 1334 | else: |
| 1335 | self.watch_port = 0 |
| 1336 | if watch_group != None: |
| 1337 | self.watch_group = watch_group |
| 1338 | else: |
| 1339 | self.watch_group = 0 |
| 1340 | if actions != None: |
| 1341 | self.actions = actions |
| 1342 | else: |
| 1343 | self.actions = [] |
| 1344 | return |
| 1345 | |
| 1346 | def pack(self): |
| 1347 | packed = [] |
| 1348 | packed.append(struct.pack("!H", 0)) # placeholder for len at index 0 |
| 1349 | packed.append(struct.pack("!H", self.weight)) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1350 | packed.append(util.pack_port_no(self.watch_port)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1351 | packed.append(struct.pack("!L", self.watch_group)) |
| 1352 | packed.append('\x00' * 4) |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1353 | packed.append(loxi.generic_util.pack_list(self.actions)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1354 | length = sum([len(x) for x in packed]) |
| 1355 | packed[0] = struct.pack("!H", length) |
| 1356 | return ''.join(packed) |
| 1357 | |
| 1358 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1359 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1360 | obj = bucket() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1361 | _len = reader.read("!H")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1362 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 1363 | reader = orig_reader.slice(_len, 2) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1364 | obj.weight = reader.read("!H")[0] |
| 1365 | obj.watch_port = util.unpack_port_no(reader) |
| 1366 | obj.watch_group = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1367 | reader.skip(4) |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1368 | obj.actions = loxi.generic_util.unpack_list(reader, action.action.unpack) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1369 | return obj |
| 1370 | |
| 1371 | def __eq__(self, other): |
| 1372 | if type(self) != type(other): return False |
| 1373 | if self.weight != other.weight: return False |
| 1374 | if self.watch_port != other.watch_port: return False |
| 1375 | if self.watch_group != other.watch_group: return False |
| 1376 | if self.actions != other.actions: return False |
| 1377 | return True |
| 1378 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1379 | def pretty_print(self, q): |
| 1380 | q.text("bucket {") |
| 1381 | with q.group(): |
| 1382 | with q.indent(2): |
| 1383 | q.breakable() |
| 1384 | q.text("weight = "); |
| 1385 | q.text("%#x" % self.weight) |
| 1386 | q.text(","); q.breakable() |
| 1387 | q.text("watch_port = "); |
| 1388 | q.text(util.pretty_port(self.watch_port)) |
| 1389 | q.text(","); q.breakable() |
| 1390 | q.text("watch_group = "); |
| 1391 | q.text("%#x" % self.watch_group) |
| 1392 | q.text(","); q.breakable() |
| 1393 | q.text("actions = "); |
| 1394 | q.pp(self.actions) |
| 1395 | q.breakable() |
| 1396 | q.text('}') |
| 1397 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1398 | |
| 1399 | class bucket_counter(loxi.OFObject): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1400 | |
| 1401 | def __init__(self, packet_count=None, byte_count=None): |
| 1402 | if packet_count != None: |
| 1403 | self.packet_count = packet_count |
| 1404 | else: |
| 1405 | self.packet_count = 0 |
| 1406 | if byte_count != None: |
| 1407 | self.byte_count = byte_count |
| 1408 | else: |
| 1409 | self.byte_count = 0 |
| 1410 | return |
| 1411 | |
| 1412 | def pack(self): |
| 1413 | packed = [] |
| 1414 | packed.append(struct.pack("!Q", self.packet_count)) |
| 1415 | packed.append(struct.pack("!Q", self.byte_count)) |
| 1416 | return ''.join(packed) |
| 1417 | |
| 1418 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1419 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1420 | obj = bucket_counter() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1421 | obj.packet_count = reader.read("!Q")[0] |
| 1422 | obj.byte_count = reader.read("!Q")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1423 | return obj |
| 1424 | |
| 1425 | def __eq__(self, other): |
| 1426 | if type(self) != type(other): return False |
| 1427 | if self.packet_count != other.packet_count: return False |
| 1428 | if self.byte_count != other.byte_count: return False |
| 1429 | return True |
| 1430 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1431 | def pretty_print(self, q): |
| 1432 | q.text("bucket_counter {") |
| 1433 | with q.group(): |
| 1434 | with q.indent(2): |
| 1435 | q.breakable() |
| 1436 | q.text("packet_count = "); |
| 1437 | q.text("%#x" % self.packet_count) |
| 1438 | q.text(","); q.breakable() |
| 1439 | q.text("byte_count = "); |
| 1440 | q.text("%#x" % self.byte_count) |
| 1441 | q.breakable() |
| 1442 | q.text('}') |
| 1443 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1444 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1445 | class flow_stats_entry(loxi.OFObject): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1446 | |
Kiran Poola | ae8fbf1 | 2013-09-19 16:32:32 -0700 | [diff] [blame] | 1447 | def __init__(self, table_id=None, duration_sec=None, duration_nsec=None, priority=None, idle_timeout=None, hard_timeout=None, flags=None, cookie=None, packet_count=None, byte_count=None, match=None, instructions=None): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1448 | if table_id != None: |
| 1449 | self.table_id = table_id |
| 1450 | else: |
| 1451 | self.table_id = 0 |
| 1452 | if duration_sec != None: |
| 1453 | self.duration_sec = duration_sec |
| 1454 | else: |
| 1455 | self.duration_sec = 0 |
| 1456 | if duration_nsec != None: |
| 1457 | self.duration_nsec = duration_nsec |
| 1458 | else: |
| 1459 | self.duration_nsec = 0 |
| 1460 | if priority != None: |
| 1461 | self.priority = priority |
| 1462 | else: |
| 1463 | self.priority = 0 |
| 1464 | if idle_timeout != None: |
| 1465 | self.idle_timeout = idle_timeout |
| 1466 | else: |
| 1467 | self.idle_timeout = 0 |
| 1468 | if hard_timeout != None: |
| 1469 | self.hard_timeout = hard_timeout |
| 1470 | else: |
| 1471 | self.hard_timeout = 0 |
Kiran Poola | ae8fbf1 | 2013-09-19 16:32:32 -0700 | [diff] [blame] | 1472 | if flags != None: |
| 1473 | self.flags = flags |
| 1474 | else: |
| 1475 | self.flags = 0 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1476 | if cookie != None: |
| 1477 | self.cookie = cookie |
| 1478 | else: |
| 1479 | self.cookie = 0 |
| 1480 | if packet_count != None: |
| 1481 | self.packet_count = packet_count |
| 1482 | else: |
| 1483 | self.packet_count = 0 |
| 1484 | if byte_count != None: |
| 1485 | self.byte_count = byte_count |
| 1486 | else: |
| 1487 | self.byte_count = 0 |
| 1488 | if match != None: |
| 1489 | self.match = match |
| 1490 | else: |
| 1491 | self.match = common.match() |
| 1492 | if instructions != None: |
| 1493 | self.instructions = instructions |
| 1494 | else: |
| 1495 | self.instructions = [] |
| 1496 | return |
| 1497 | |
| 1498 | def pack(self): |
| 1499 | packed = [] |
| 1500 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 0 |
| 1501 | packed.append(struct.pack("!B", self.table_id)) |
| 1502 | packed.append('\x00' * 1) |
| 1503 | packed.append(struct.pack("!L", self.duration_sec)) |
| 1504 | packed.append(struct.pack("!L", self.duration_nsec)) |
| 1505 | packed.append(struct.pack("!H", self.priority)) |
| 1506 | packed.append(struct.pack("!H", self.idle_timeout)) |
| 1507 | packed.append(struct.pack("!H", self.hard_timeout)) |
Kiran Poola | ae8fbf1 | 2013-09-19 16:32:32 -0700 | [diff] [blame] | 1508 | packed.append(struct.pack("!H", self.flags)) |
| 1509 | packed.append('\x00' * 4) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1510 | packed.append(struct.pack("!Q", self.cookie)) |
| 1511 | packed.append(struct.pack("!Q", self.packet_count)) |
| 1512 | packed.append(struct.pack("!Q", self.byte_count)) |
| 1513 | packed.append(self.match.pack()) |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1514 | packed.append(loxi.generic_util.pack_list(self.instructions)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1515 | length = sum([len(x) for x in packed]) |
| 1516 | packed[0] = struct.pack("!H", length) |
| 1517 | return ''.join(packed) |
| 1518 | |
| 1519 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1520 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1521 | obj = flow_stats_entry() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1522 | _length = reader.read("!H")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1523 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 1524 | reader = orig_reader.slice(_length, 2) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1525 | obj.table_id = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1526 | reader.skip(1) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1527 | obj.duration_sec = reader.read("!L")[0] |
| 1528 | obj.duration_nsec = reader.read("!L")[0] |
| 1529 | obj.priority = reader.read("!H")[0] |
| 1530 | obj.idle_timeout = reader.read("!H")[0] |
| 1531 | obj.hard_timeout = reader.read("!H")[0] |
Kiran Poola | ae8fbf1 | 2013-09-19 16:32:32 -0700 | [diff] [blame] | 1532 | obj.flags = reader.read("!H")[0] |
| 1533 | reader.skip(4) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1534 | obj.cookie = reader.read("!Q")[0] |
| 1535 | obj.packet_count = reader.read("!Q")[0] |
| 1536 | obj.byte_count = reader.read("!Q")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1537 | obj.match = common.match.unpack(reader) |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1538 | obj.instructions = loxi.generic_util.unpack_list(reader, instruction.instruction.unpack) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1539 | return obj |
| 1540 | |
| 1541 | def __eq__(self, other): |
| 1542 | if type(self) != type(other): return False |
| 1543 | if self.table_id != other.table_id: return False |
| 1544 | if self.duration_sec != other.duration_sec: return False |
| 1545 | if self.duration_nsec != other.duration_nsec: return False |
| 1546 | if self.priority != other.priority: return False |
| 1547 | if self.idle_timeout != other.idle_timeout: return False |
| 1548 | if self.hard_timeout != other.hard_timeout: return False |
Kiran Poola | ae8fbf1 | 2013-09-19 16:32:32 -0700 | [diff] [blame] | 1549 | if self.flags != other.flags: return False |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1550 | if self.cookie != other.cookie: return False |
| 1551 | if self.packet_count != other.packet_count: return False |
| 1552 | if self.byte_count != other.byte_count: return False |
| 1553 | if self.match != other.match: return False |
| 1554 | if self.instructions != other.instructions: return False |
| 1555 | return True |
| 1556 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1557 | def pretty_print(self, q): |
| 1558 | q.text("flow_stats_entry {") |
| 1559 | with q.group(): |
| 1560 | with q.indent(2): |
| 1561 | q.breakable() |
| 1562 | q.text("table_id = "); |
| 1563 | q.text("%#x" % self.table_id) |
| 1564 | q.text(","); q.breakable() |
| 1565 | q.text("duration_sec = "); |
| 1566 | q.text("%#x" % self.duration_sec) |
| 1567 | q.text(","); q.breakable() |
| 1568 | q.text("duration_nsec = "); |
| 1569 | q.text("%#x" % self.duration_nsec) |
| 1570 | q.text(","); q.breakable() |
| 1571 | q.text("priority = "); |
| 1572 | q.text("%#x" % self.priority) |
| 1573 | q.text(","); q.breakable() |
| 1574 | q.text("idle_timeout = "); |
| 1575 | q.text("%#x" % self.idle_timeout) |
| 1576 | q.text(","); q.breakable() |
| 1577 | q.text("hard_timeout = "); |
| 1578 | q.text("%#x" % self.hard_timeout) |
| 1579 | q.text(","); q.breakable() |
Kiran Poola | ae8fbf1 | 2013-09-19 16:32:32 -0700 | [diff] [blame] | 1580 | q.text("flags = "); |
| 1581 | q.text("%#x" % self.flags) |
| 1582 | q.text(","); q.breakable() |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1583 | q.text("cookie = "); |
| 1584 | q.text("%#x" % self.cookie) |
| 1585 | q.text(","); q.breakable() |
| 1586 | q.text("packet_count = "); |
| 1587 | q.text("%#x" % self.packet_count) |
| 1588 | q.text(","); q.breakable() |
| 1589 | q.text("byte_count = "); |
| 1590 | q.text("%#x" % self.byte_count) |
| 1591 | q.text(","); q.breakable() |
| 1592 | q.text("match = "); |
| 1593 | q.pp(self.match) |
| 1594 | q.text(","); q.breakable() |
| 1595 | q.text("instructions = "); |
| 1596 | q.pp(self.instructions) |
| 1597 | q.breakable() |
| 1598 | q.text('}') |
| 1599 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1600 | |
| 1601 | class group_desc_stats_entry(loxi.OFObject): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1602 | |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 1603 | def __init__(self, group_type=None, group_id=None, buckets=None): |
| 1604 | if group_type != None: |
| 1605 | self.group_type = group_type |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1606 | else: |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 1607 | self.group_type = 0 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1608 | if group_id != None: |
| 1609 | self.group_id = group_id |
| 1610 | else: |
| 1611 | self.group_id = 0 |
| 1612 | if buckets != None: |
| 1613 | self.buckets = buckets |
| 1614 | else: |
| 1615 | self.buckets = [] |
| 1616 | return |
| 1617 | |
| 1618 | def pack(self): |
| 1619 | packed = [] |
| 1620 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 0 |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 1621 | packed.append(struct.pack("!B", self.group_type)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1622 | packed.append('\x00' * 1) |
| 1623 | packed.append(struct.pack("!L", self.group_id)) |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1624 | packed.append(loxi.generic_util.pack_list(self.buckets)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1625 | length = sum([len(x) for x in packed]) |
| 1626 | packed[0] = struct.pack("!H", length) |
| 1627 | return ''.join(packed) |
| 1628 | |
| 1629 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1630 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1631 | obj = group_desc_stats_entry() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1632 | _length = reader.read("!H")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1633 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 1634 | reader = orig_reader.slice(_length, 2) |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 1635 | obj.group_type = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1636 | reader.skip(1) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1637 | obj.group_id = reader.read("!L")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1638 | obj.buckets = loxi.generic_util.unpack_list(reader, common.bucket.unpack) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1639 | return obj |
| 1640 | |
| 1641 | def __eq__(self, other): |
| 1642 | if type(self) != type(other): return False |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 1643 | if self.group_type != other.group_type: return False |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1644 | if self.group_id != other.group_id: return False |
| 1645 | if self.buckets != other.buckets: return False |
| 1646 | return True |
| 1647 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1648 | def pretty_print(self, q): |
| 1649 | q.text("group_desc_stats_entry {") |
| 1650 | with q.group(): |
| 1651 | with q.indent(2): |
| 1652 | q.breakable() |
Rich Lane | 6f4978c | 2013-10-20 21:33:52 -0700 | [diff] [blame] | 1653 | q.text("group_type = "); |
| 1654 | q.text("%#x" % self.group_type) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1655 | q.text(","); q.breakable() |
| 1656 | q.text("group_id = "); |
| 1657 | q.text("%#x" % self.group_id) |
| 1658 | q.text(","); q.breakable() |
| 1659 | q.text("buckets = "); |
| 1660 | q.pp(self.buckets) |
| 1661 | q.breakable() |
| 1662 | q.text('}') |
| 1663 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1664 | |
| 1665 | class group_stats_entry(loxi.OFObject): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1666 | |
| 1667 | def __init__(self, group_id=None, ref_count=None, packet_count=None, byte_count=None, duration_sec=None, duration_nsec=None, bucket_stats=None): |
| 1668 | if group_id != None: |
| 1669 | self.group_id = group_id |
| 1670 | else: |
| 1671 | self.group_id = 0 |
| 1672 | if ref_count != None: |
| 1673 | self.ref_count = ref_count |
| 1674 | else: |
| 1675 | self.ref_count = 0 |
| 1676 | if packet_count != None: |
| 1677 | self.packet_count = packet_count |
| 1678 | else: |
| 1679 | self.packet_count = 0 |
| 1680 | if byte_count != None: |
| 1681 | self.byte_count = byte_count |
| 1682 | else: |
| 1683 | self.byte_count = 0 |
| 1684 | if duration_sec != None: |
| 1685 | self.duration_sec = duration_sec |
| 1686 | else: |
| 1687 | self.duration_sec = 0 |
| 1688 | if duration_nsec != None: |
| 1689 | self.duration_nsec = duration_nsec |
| 1690 | else: |
| 1691 | self.duration_nsec = 0 |
| 1692 | if bucket_stats != None: |
| 1693 | self.bucket_stats = bucket_stats |
| 1694 | else: |
| 1695 | self.bucket_stats = [] |
| 1696 | return |
| 1697 | |
| 1698 | def pack(self): |
| 1699 | packed = [] |
| 1700 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 0 |
| 1701 | packed.append('\x00' * 2) |
| 1702 | packed.append(struct.pack("!L", self.group_id)) |
| 1703 | packed.append(struct.pack("!L", self.ref_count)) |
| 1704 | packed.append('\x00' * 4) |
| 1705 | packed.append(struct.pack("!Q", self.packet_count)) |
| 1706 | packed.append(struct.pack("!Q", self.byte_count)) |
| 1707 | packed.append(struct.pack("!L", self.duration_sec)) |
| 1708 | packed.append(struct.pack("!L", self.duration_nsec)) |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1709 | packed.append(loxi.generic_util.pack_list(self.bucket_stats)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1710 | length = sum([len(x) for x in packed]) |
| 1711 | packed[0] = struct.pack("!H", length) |
| 1712 | return ''.join(packed) |
| 1713 | |
| 1714 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1715 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1716 | obj = group_stats_entry() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1717 | _length = reader.read("!H")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1718 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 1719 | reader = orig_reader.slice(_length, 2) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1720 | reader.skip(2) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1721 | obj.group_id = reader.read("!L")[0] |
| 1722 | obj.ref_count = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1723 | reader.skip(4) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1724 | obj.packet_count = reader.read("!Q")[0] |
| 1725 | obj.byte_count = reader.read("!Q")[0] |
| 1726 | obj.duration_sec = reader.read("!L")[0] |
| 1727 | obj.duration_nsec = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1728 | obj.bucket_stats = loxi.generic_util.unpack_list(reader, common.bucket_counter.unpack) |
| 1729 | return obj |
| 1730 | |
| 1731 | def __eq__(self, other): |
| 1732 | if type(self) != type(other): return False |
| 1733 | if self.group_id != other.group_id: return False |
| 1734 | if self.ref_count != other.ref_count: return False |
| 1735 | if self.packet_count != other.packet_count: return False |
| 1736 | if self.byte_count != other.byte_count: return False |
| 1737 | if self.duration_sec != other.duration_sec: return False |
| 1738 | if self.duration_nsec != other.duration_nsec: return False |
| 1739 | if self.bucket_stats != other.bucket_stats: return False |
| 1740 | return True |
| 1741 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1742 | def pretty_print(self, q): |
| 1743 | q.text("group_stats_entry {") |
| 1744 | with q.group(): |
| 1745 | with q.indent(2): |
| 1746 | q.breakable() |
| 1747 | q.text("group_id = "); |
| 1748 | q.text("%#x" % self.group_id) |
| 1749 | q.text(","); q.breakable() |
| 1750 | q.text("ref_count = "); |
| 1751 | q.text("%#x" % self.ref_count) |
| 1752 | q.text(","); q.breakable() |
| 1753 | q.text("packet_count = "); |
| 1754 | q.text("%#x" % self.packet_count) |
| 1755 | q.text(","); q.breakable() |
| 1756 | q.text("byte_count = "); |
| 1757 | q.text("%#x" % self.byte_count) |
| 1758 | q.text(","); q.breakable() |
| 1759 | q.text("duration_sec = "); |
| 1760 | q.text("%#x" % self.duration_sec) |
| 1761 | q.text(","); q.breakable() |
| 1762 | q.text("duration_nsec = "); |
| 1763 | q.text("%#x" % self.duration_nsec) |
| 1764 | q.text(","); q.breakable() |
| 1765 | q.text("bucket_stats = "); |
| 1766 | q.pp(self.bucket_stats) |
| 1767 | q.breakable() |
| 1768 | q.text('}') |
| 1769 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1770 | |
| 1771 | class hello_elem(loxi.OFObject): |
| 1772 | subtypes = {} |
| 1773 | |
Rich Lane | 95f7fc9 | 2014-01-27 17:08:16 -0800 | [diff] [blame] | 1774 | |
| 1775 | def __init__(self, type=None): |
| 1776 | if type != None: |
| 1777 | self.type = type |
| 1778 | else: |
| 1779 | self.type = 0 |
| 1780 | return |
| 1781 | |
| 1782 | def pack(self): |
| 1783 | packed = [] |
| 1784 | packed.append(struct.pack("!H", self.type)) |
| 1785 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 |
| 1786 | length = sum([len(x) for x in packed]) |
| 1787 | packed[1] = struct.pack("!H", length) |
| 1788 | return ''.join(packed) |
| 1789 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1790 | @staticmethod |
| 1791 | def unpack(reader): |
| 1792 | subtype, = reader.peek('!H', 0) |
Rich Lane | 95f7fc9 | 2014-01-27 17:08:16 -0800 | [diff] [blame] | 1793 | subclass = hello_elem.subtypes.get(subtype) |
| 1794 | if subclass: |
| 1795 | return subclass.unpack(reader) |
| 1796 | |
| 1797 | obj = hello_elem() |
| 1798 | obj.type = reader.read("!H")[0] |
| 1799 | _length = reader.read("!H")[0] |
| 1800 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 1801 | reader = orig_reader.slice(_length, 4) |
Rich Lane | 95f7fc9 | 2014-01-27 17:08:16 -0800 | [diff] [blame] | 1802 | return obj |
| 1803 | |
| 1804 | def __eq__(self, other): |
| 1805 | if type(self) != type(other): return False |
| 1806 | if self.type != other.type: return False |
| 1807 | return True |
| 1808 | |
| 1809 | def pretty_print(self, q): |
| 1810 | q.text("hello_elem {") |
| 1811 | with q.group(): |
| 1812 | with q.indent(2): |
| 1813 | q.breakable() |
| 1814 | q.breakable() |
| 1815 | q.text('}') |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1816 | |
| 1817 | |
| 1818 | class hello_elem_versionbitmap(hello_elem): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1819 | type = 1 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1820 | |
| 1821 | def __init__(self, bitmaps=None): |
| 1822 | if bitmaps != None: |
| 1823 | self.bitmaps = bitmaps |
| 1824 | else: |
| 1825 | self.bitmaps = [] |
| 1826 | return |
| 1827 | |
| 1828 | def pack(self): |
| 1829 | packed = [] |
| 1830 | packed.append(struct.pack("!H", self.type)) |
| 1831 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1832 | packed.append(loxi.generic_util.pack_list(self.bitmaps)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1833 | length = sum([len(x) for x in packed]) |
| 1834 | packed[1] = struct.pack("!H", length) |
| 1835 | return ''.join(packed) |
| 1836 | |
| 1837 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1838 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1839 | obj = hello_elem_versionbitmap() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1840 | _type = reader.read("!H")[0] |
| 1841 | assert(_type == 1) |
| 1842 | _length = reader.read("!H")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1843 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 1844 | reader = orig_reader.slice(_length, 4) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1845 | obj.bitmaps = loxi.generic_util.unpack_list(reader, common.uint32.unpack) |
| 1846 | return obj |
| 1847 | |
| 1848 | def __eq__(self, other): |
| 1849 | if type(self) != type(other): return False |
| 1850 | if self.bitmaps != other.bitmaps: return False |
| 1851 | return True |
| 1852 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1853 | def pretty_print(self, q): |
| 1854 | q.text("hello_elem_versionbitmap {") |
| 1855 | with q.group(): |
| 1856 | with q.indent(2): |
| 1857 | q.breakable() |
| 1858 | q.text("bitmaps = "); |
| 1859 | q.pp(self.bitmaps) |
| 1860 | q.breakable() |
| 1861 | q.text('}') |
| 1862 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1863 | hello_elem.subtypes[1] = hello_elem_versionbitmap |
| 1864 | |
| 1865 | class match_v3(loxi.OFObject): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1866 | type = 1 |
| 1867 | |
| 1868 | def __init__(self, oxm_list=None): |
| 1869 | if oxm_list != None: |
| 1870 | self.oxm_list = oxm_list |
| 1871 | else: |
| 1872 | self.oxm_list = [] |
| 1873 | return |
| 1874 | |
| 1875 | def pack(self): |
| 1876 | packed = [] |
| 1877 | packed.append(struct.pack("!H", self.type)) |
| 1878 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1879 | packed.append(loxi.generic_util.pack_list(self.oxm_list)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1880 | length = sum([len(x) for x in packed]) |
| 1881 | packed[1] = struct.pack("!H", length) |
Rich Lane | d53156a | 2013-08-05 17:17:33 -0700 | [diff] [blame] | 1882 | packed.append(loxi.generic_util.pad_to(8, length)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1883 | return ''.join(packed) |
| 1884 | |
| 1885 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1886 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1887 | obj = match_v3() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1888 | _type = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1889 | assert(_type == 1) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1890 | _length = reader.read("!H")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1891 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 1892 | reader = orig_reader.slice(_length, 4) |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1893 | obj.oxm_list = loxi.generic_util.unpack_list(reader, oxm.oxm.unpack) |
| 1894 | orig_reader.skip_align() |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1895 | return obj |
| 1896 | |
| 1897 | def __eq__(self, other): |
| 1898 | if type(self) != type(other): return False |
| 1899 | if self.oxm_list != other.oxm_list: return False |
| 1900 | return True |
| 1901 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1902 | def pretty_print(self, q): |
| 1903 | q.text("match_v3 {") |
| 1904 | with q.group(): |
| 1905 | with q.indent(2): |
| 1906 | q.breakable() |
| 1907 | q.text("oxm_list = "); |
| 1908 | q.pp(self.oxm_list) |
| 1909 | q.breakable() |
| 1910 | q.text('}') |
| 1911 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1912 | |
| 1913 | class meter_band_stats(loxi.OFObject): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1914 | |
| 1915 | def __init__(self, packet_band_count=None, byte_band_count=None): |
| 1916 | if packet_band_count != None: |
| 1917 | self.packet_band_count = packet_band_count |
| 1918 | else: |
| 1919 | self.packet_band_count = 0 |
| 1920 | if byte_band_count != None: |
| 1921 | self.byte_band_count = byte_band_count |
| 1922 | else: |
| 1923 | self.byte_band_count = 0 |
| 1924 | return |
| 1925 | |
| 1926 | def pack(self): |
| 1927 | packed = [] |
| 1928 | packed.append(struct.pack("!Q", self.packet_band_count)) |
| 1929 | packed.append(struct.pack("!Q", self.byte_band_count)) |
| 1930 | return ''.join(packed) |
| 1931 | |
| 1932 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1933 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1934 | obj = meter_band_stats() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1935 | obj.packet_band_count = reader.read("!Q")[0] |
| 1936 | obj.byte_band_count = reader.read("!Q")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1937 | return obj |
| 1938 | |
| 1939 | def __eq__(self, other): |
| 1940 | if type(self) != type(other): return False |
| 1941 | if self.packet_band_count != other.packet_band_count: return False |
| 1942 | if self.byte_band_count != other.byte_band_count: return False |
| 1943 | return True |
| 1944 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1945 | def pretty_print(self, q): |
| 1946 | q.text("meter_band_stats {") |
| 1947 | with q.group(): |
| 1948 | with q.indent(2): |
| 1949 | q.breakable() |
| 1950 | q.text("packet_band_count = "); |
| 1951 | q.text("%#x" % self.packet_band_count) |
| 1952 | q.text(","); q.breakable() |
| 1953 | q.text("byte_band_count = "); |
| 1954 | q.text("%#x" % self.byte_band_count) |
| 1955 | q.breakable() |
| 1956 | q.text('}') |
| 1957 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1958 | |
| 1959 | class meter_config(loxi.OFObject): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1960 | |
| 1961 | def __init__(self, flags=None, meter_id=None, entries=None): |
| 1962 | if flags != None: |
| 1963 | self.flags = flags |
| 1964 | else: |
| 1965 | self.flags = 0 |
| 1966 | if meter_id != None: |
| 1967 | self.meter_id = meter_id |
| 1968 | else: |
| 1969 | self.meter_id = 0 |
| 1970 | if entries != None: |
| 1971 | self.entries = entries |
| 1972 | else: |
| 1973 | self.entries = [] |
| 1974 | return |
| 1975 | |
| 1976 | def pack(self): |
| 1977 | packed = [] |
| 1978 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 0 |
| 1979 | packed.append(struct.pack("!H", self.flags)) |
| 1980 | packed.append(struct.pack("!L", self.meter_id)) |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1981 | packed.append(loxi.generic_util.pack_list(self.entries)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1982 | length = sum([len(x) for x in packed]) |
| 1983 | packed[0] = struct.pack("!H", length) |
| 1984 | return ''.join(packed) |
| 1985 | |
| 1986 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1987 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1988 | obj = meter_config() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1989 | _length = reader.read("!H")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1990 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 1991 | reader = orig_reader.slice(_length, 2) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 1992 | obj.flags = reader.read("!H")[0] |
| 1993 | obj.meter_id = reader.read("!L")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 1994 | obj.entries = loxi.generic_util.unpack_list(reader, meter_band.meter_band.unpack) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 1995 | return obj |
| 1996 | |
| 1997 | def __eq__(self, other): |
| 1998 | if type(self) != type(other): return False |
| 1999 | if self.flags != other.flags: return False |
| 2000 | if self.meter_id != other.meter_id: return False |
| 2001 | if self.entries != other.entries: return False |
| 2002 | return True |
| 2003 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2004 | def pretty_print(self, q): |
| 2005 | q.text("meter_config {") |
| 2006 | with q.group(): |
| 2007 | with q.indent(2): |
| 2008 | q.breakable() |
| 2009 | q.text("flags = "); |
| 2010 | q.text("%#x" % self.flags) |
| 2011 | q.text(","); q.breakable() |
| 2012 | q.text("meter_id = "); |
| 2013 | q.text("%#x" % self.meter_id) |
| 2014 | q.text(","); q.breakable() |
| 2015 | q.text("entries = "); |
| 2016 | q.pp(self.entries) |
| 2017 | q.breakable() |
| 2018 | q.text('}') |
| 2019 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2020 | |
| 2021 | class meter_features(loxi.OFObject): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2022 | |
| 2023 | def __init__(self, max_meter=None, band_types=None, capabilities=None, max_bands=None, max_color=None): |
| 2024 | if max_meter != None: |
| 2025 | self.max_meter = max_meter |
| 2026 | else: |
| 2027 | self.max_meter = 0 |
| 2028 | if band_types != None: |
| 2029 | self.band_types = band_types |
| 2030 | else: |
| 2031 | self.band_types = 0 |
| 2032 | if capabilities != None: |
| 2033 | self.capabilities = capabilities |
| 2034 | else: |
| 2035 | self.capabilities = 0 |
| 2036 | if max_bands != None: |
| 2037 | self.max_bands = max_bands |
| 2038 | else: |
| 2039 | self.max_bands = 0 |
| 2040 | if max_color != None: |
| 2041 | self.max_color = max_color |
| 2042 | else: |
| 2043 | self.max_color = 0 |
| 2044 | return |
| 2045 | |
| 2046 | def pack(self): |
| 2047 | packed = [] |
| 2048 | packed.append(struct.pack("!L", self.max_meter)) |
| 2049 | packed.append(struct.pack("!L", self.band_types)) |
| 2050 | packed.append(struct.pack("!L", self.capabilities)) |
| 2051 | packed.append(struct.pack("!B", self.max_bands)) |
| 2052 | packed.append(struct.pack("!B", self.max_color)) |
| 2053 | packed.append('\x00' * 2) |
| 2054 | return ''.join(packed) |
| 2055 | |
| 2056 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2057 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2058 | obj = meter_features() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2059 | obj.max_meter = reader.read("!L")[0] |
| 2060 | obj.band_types = reader.read("!L")[0] |
| 2061 | obj.capabilities = reader.read("!L")[0] |
| 2062 | obj.max_bands = reader.read("!B")[0] |
| 2063 | obj.max_color = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2064 | reader.skip(2) |
| 2065 | return obj |
| 2066 | |
| 2067 | def __eq__(self, other): |
| 2068 | if type(self) != type(other): return False |
| 2069 | if self.max_meter != other.max_meter: return False |
| 2070 | if self.band_types != other.band_types: return False |
| 2071 | if self.capabilities != other.capabilities: return False |
| 2072 | if self.max_bands != other.max_bands: return False |
| 2073 | if self.max_color != other.max_color: return False |
| 2074 | return True |
| 2075 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2076 | def pretty_print(self, q): |
| 2077 | q.text("meter_features {") |
| 2078 | with q.group(): |
| 2079 | with q.indent(2): |
| 2080 | q.breakable() |
| 2081 | q.text("max_meter = "); |
| 2082 | q.text("%#x" % self.max_meter) |
| 2083 | q.text(","); q.breakable() |
| 2084 | q.text("band_types = "); |
| 2085 | q.text("%#x" % self.band_types) |
| 2086 | q.text(","); q.breakable() |
| 2087 | q.text("capabilities = "); |
| 2088 | q.text("%#x" % self.capabilities) |
| 2089 | q.text(","); q.breakable() |
| 2090 | q.text("max_bands = "); |
| 2091 | q.text("%#x" % self.max_bands) |
| 2092 | q.text(","); q.breakable() |
| 2093 | q.text("max_color = "); |
| 2094 | q.text("%#x" % self.max_color) |
| 2095 | q.breakable() |
| 2096 | q.text('}') |
| 2097 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2098 | |
| 2099 | class meter_stats(loxi.OFObject): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2100 | |
| 2101 | def __init__(self, meter_id=None, flow_count=None, packet_in_count=None, byte_in_count=None, duration_sec=None, duration_nsec=None, band_stats=None): |
| 2102 | if meter_id != None: |
| 2103 | self.meter_id = meter_id |
| 2104 | else: |
| 2105 | self.meter_id = 0 |
| 2106 | if flow_count != None: |
| 2107 | self.flow_count = flow_count |
| 2108 | else: |
| 2109 | self.flow_count = 0 |
| 2110 | if packet_in_count != None: |
| 2111 | self.packet_in_count = packet_in_count |
| 2112 | else: |
| 2113 | self.packet_in_count = 0 |
| 2114 | if byte_in_count != None: |
| 2115 | self.byte_in_count = byte_in_count |
| 2116 | else: |
| 2117 | self.byte_in_count = 0 |
| 2118 | if duration_sec != None: |
| 2119 | self.duration_sec = duration_sec |
| 2120 | else: |
| 2121 | self.duration_sec = 0 |
| 2122 | if duration_nsec != None: |
| 2123 | self.duration_nsec = duration_nsec |
| 2124 | else: |
| 2125 | self.duration_nsec = 0 |
| 2126 | if band_stats != None: |
| 2127 | self.band_stats = band_stats |
| 2128 | else: |
| 2129 | self.band_stats = [] |
| 2130 | return |
| 2131 | |
| 2132 | def pack(self): |
| 2133 | packed = [] |
| 2134 | packed.append(struct.pack("!L", self.meter_id)) |
| 2135 | packed.append(struct.pack("!H", 0)) # placeholder for len at index 1 |
| 2136 | packed.append('\x00' * 6) |
| 2137 | packed.append(struct.pack("!L", self.flow_count)) |
| 2138 | packed.append(struct.pack("!Q", self.packet_in_count)) |
| 2139 | packed.append(struct.pack("!Q", self.byte_in_count)) |
| 2140 | packed.append(struct.pack("!L", self.duration_sec)) |
| 2141 | packed.append(struct.pack("!L", self.duration_nsec)) |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2142 | packed.append(loxi.generic_util.pack_list(self.band_stats)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2143 | length = sum([len(x) for x in packed]) |
| 2144 | packed[1] = struct.pack("!H", length) |
| 2145 | return ''.join(packed) |
| 2146 | |
| 2147 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2148 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2149 | obj = meter_stats() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2150 | obj.meter_id = reader.read("!L")[0] |
| 2151 | _len = reader.read("!H")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2152 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 2153 | reader = orig_reader.slice(_len, 6) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2154 | reader.skip(6) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2155 | obj.flow_count = reader.read("!L")[0] |
| 2156 | obj.packet_in_count = reader.read("!Q")[0] |
| 2157 | obj.byte_in_count = reader.read("!Q")[0] |
| 2158 | obj.duration_sec = reader.read("!L")[0] |
| 2159 | obj.duration_nsec = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2160 | obj.band_stats = loxi.generic_util.unpack_list(reader, common.meter_band_stats.unpack) |
| 2161 | return obj |
| 2162 | |
| 2163 | def __eq__(self, other): |
| 2164 | if type(self) != type(other): return False |
| 2165 | if self.meter_id != other.meter_id: return False |
| 2166 | if self.flow_count != other.flow_count: return False |
| 2167 | if self.packet_in_count != other.packet_in_count: return False |
| 2168 | if self.byte_in_count != other.byte_in_count: return False |
| 2169 | if self.duration_sec != other.duration_sec: return False |
| 2170 | if self.duration_nsec != other.duration_nsec: return False |
| 2171 | if self.band_stats != other.band_stats: return False |
| 2172 | return True |
| 2173 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2174 | def pretty_print(self, q): |
| 2175 | q.text("meter_stats {") |
| 2176 | with q.group(): |
| 2177 | with q.indent(2): |
| 2178 | q.breakable() |
| 2179 | q.text("meter_id = "); |
| 2180 | q.text("%#x" % self.meter_id) |
| 2181 | q.text(","); q.breakable() |
| 2182 | q.text("flow_count = "); |
| 2183 | q.text("%#x" % self.flow_count) |
| 2184 | q.text(","); q.breakable() |
| 2185 | q.text("packet_in_count = "); |
| 2186 | q.text("%#x" % self.packet_in_count) |
| 2187 | q.text(","); q.breakable() |
| 2188 | q.text("byte_in_count = "); |
| 2189 | q.text("%#x" % self.byte_in_count) |
| 2190 | q.text(","); q.breakable() |
| 2191 | q.text("duration_sec = "); |
| 2192 | q.text("%#x" % self.duration_sec) |
| 2193 | q.text(","); q.breakable() |
| 2194 | q.text("duration_nsec = "); |
| 2195 | q.text("%#x" % self.duration_nsec) |
| 2196 | q.text(","); q.breakable() |
| 2197 | q.text("band_stats = "); |
| 2198 | q.pp(self.band_stats) |
| 2199 | q.breakable() |
| 2200 | q.text('}') |
| 2201 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2202 | |
| 2203 | class packet_queue(loxi.OFObject): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2204 | |
| 2205 | def __init__(self, queue_id=None, port=None, properties=None): |
| 2206 | if queue_id != None: |
| 2207 | self.queue_id = queue_id |
| 2208 | else: |
| 2209 | self.queue_id = 0 |
| 2210 | if port != None: |
| 2211 | self.port = port |
| 2212 | else: |
| 2213 | self.port = 0 |
| 2214 | if properties != None: |
| 2215 | self.properties = properties |
| 2216 | else: |
| 2217 | self.properties = [] |
| 2218 | return |
| 2219 | |
| 2220 | def pack(self): |
| 2221 | packed = [] |
| 2222 | packed.append(struct.pack("!L", self.queue_id)) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2223 | packed.append(util.pack_port_no(self.port)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2224 | packed.append(struct.pack("!H", 0)) # placeholder for len at index 2 |
| 2225 | packed.append('\x00' * 6) |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2226 | packed.append(loxi.generic_util.pack_list(self.properties)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2227 | length = sum([len(x) for x in packed]) |
| 2228 | packed[2] = struct.pack("!H", length) |
| 2229 | return ''.join(packed) |
| 2230 | |
| 2231 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2232 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2233 | obj = packet_queue() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2234 | obj.queue_id = reader.read("!L")[0] |
| 2235 | obj.port = util.unpack_port_no(reader) |
| 2236 | _len = reader.read("!H")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2237 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 2238 | reader = orig_reader.slice(_len, 10) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2239 | reader.skip(6) |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2240 | obj.properties = loxi.generic_util.unpack_list(reader, common.queue_prop.unpack) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2241 | return obj |
| 2242 | |
| 2243 | def __eq__(self, other): |
| 2244 | if type(self) != type(other): return False |
| 2245 | if self.queue_id != other.queue_id: return False |
| 2246 | if self.port != other.port: return False |
| 2247 | if self.properties != other.properties: return False |
| 2248 | return True |
| 2249 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2250 | def pretty_print(self, q): |
| 2251 | q.text("packet_queue {") |
| 2252 | with q.group(): |
| 2253 | with q.indent(2): |
| 2254 | q.breakable() |
| 2255 | q.text("queue_id = "); |
| 2256 | q.text("%#x" % self.queue_id) |
| 2257 | q.text(","); q.breakable() |
| 2258 | q.text("port = "); |
| 2259 | q.text(util.pretty_port(self.port)) |
| 2260 | q.text(","); q.breakable() |
| 2261 | q.text("properties = "); |
| 2262 | q.pp(self.properties) |
| 2263 | q.breakable() |
| 2264 | q.text('}') |
| 2265 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2266 | |
| 2267 | class port_desc(loxi.OFObject): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2268 | |
| 2269 | def __init__(self, port_no=None, hw_addr=None, name=None, config=None, state=None, curr=None, advertised=None, supported=None, peer=None, curr_speed=None, max_speed=None): |
| 2270 | if port_no != None: |
| 2271 | self.port_no = port_no |
| 2272 | else: |
| 2273 | self.port_no = 0 |
| 2274 | if hw_addr != None: |
| 2275 | self.hw_addr = hw_addr |
| 2276 | else: |
| 2277 | self.hw_addr = [0,0,0,0,0,0] |
| 2278 | if name != None: |
| 2279 | self.name = name |
| 2280 | else: |
| 2281 | self.name = "" |
| 2282 | if config != None: |
| 2283 | self.config = config |
| 2284 | else: |
| 2285 | self.config = 0 |
| 2286 | if state != None: |
| 2287 | self.state = state |
| 2288 | else: |
| 2289 | self.state = 0 |
| 2290 | if curr != None: |
| 2291 | self.curr = curr |
| 2292 | else: |
| 2293 | self.curr = 0 |
| 2294 | if advertised != None: |
| 2295 | self.advertised = advertised |
| 2296 | else: |
| 2297 | self.advertised = 0 |
| 2298 | if supported != None: |
| 2299 | self.supported = supported |
| 2300 | else: |
| 2301 | self.supported = 0 |
| 2302 | if peer != None: |
| 2303 | self.peer = peer |
| 2304 | else: |
| 2305 | self.peer = 0 |
| 2306 | if curr_speed != None: |
| 2307 | self.curr_speed = curr_speed |
| 2308 | else: |
| 2309 | self.curr_speed = 0 |
| 2310 | if max_speed != None: |
| 2311 | self.max_speed = max_speed |
| 2312 | else: |
| 2313 | self.max_speed = 0 |
| 2314 | return |
| 2315 | |
| 2316 | def pack(self): |
| 2317 | packed = [] |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2318 | packed.append(util.pack_port_no(self.port_no)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2319 | packed.append('\x00' * 4) |
| 2320 | packed.append(struct.pack("!6B", *self.hw_addr)) |
| 2321 | packed.append('\x00' * 2) |
| 2322 | packed.append(struct.pack("!16s", self.name)) |
| 2323 | packed.append(struct.pack("!L", self.config)) |
| 2324 | packed.append(struct.pack("!L", self.state)) |
| 2325 | packed.append(struct.pack("!L", self.curr)) |
| 2326 | packed.append(struct.pack("!L", self.advertised)) |
| 2327 | packed.append(struct.pack("!L", self.supported)) |
| 2328 | packed.append(struct.pack("!L", self.peer)) |
| 2329 | packed.append(struct.pack("!L", self.curr_speed)) |
| 2330 | packed.append(struct.pack("!L", self.max_speed)) |
| 2331 | return ''.join(packed) |
| 2332 | |
| 2333 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2334 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2335 | obj = port_desc() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2336 | obj.port_no = util.unpack_port_no(reader) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2337 | reader.skip(4) |
| 2338 | obj.hw_addr = list(reader.read('!6B')) |
| 2339 | reader.skip(2) |
| 2340 | obj.name = reader.read("!16s")[0].rstrip("\x00") |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2341 | obj.config = reader.read("!L")[0] |
| 2342 | obj.state = reader.read("!L")[0] |
| 2343 | obj.curr = reader.read("!L")[0] |
| 2344 | obj.advertised = reader.read("!L")[0] |
| 2345 | obj.supported = reader.read("!L")[0] |
| 2346 | obj.peer = reader.read("!L")[0] |
| 2347 | obj.curr_speed = reader.read("!L")[0] |
| 2348 | obj.max_speed = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2349 | return obj |
| 2350 | |
| 2351 | def __eq__(self, other): |
| 2352 | if type(self) != type(other): return False |
| 2353 | if self.port_no != other.port_no: return False |
| 2354 | if self.hw_addr != other.hw_addr: return False |
| 2355 | if self.name != other.name: return False |
| 2356 | if self.config != other.config: return False |
| 2357 | if self.state != other.state: return False |
| 2358 | if self.curr != other.curr: return False |
| 2359 | if self.advertised != other.advertised: return False |
| 2360 | if self.supported != other.supported: return False |
| 2361 | if self.peer != other.peer: return False |
| 2362 | if self.curr_speed != other.curr_speed: return False |
| 2363 | if self.max_speed != other.max_speed: return False |
| 2364 | return True |
| 2365 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2366 | def pretty_print(self, q): |
| 2367 | q.text("port_desc {") |
| 2368 | with q.group(): |
| 2369 | with q.indent(2): |
| 2370 | q.breakable() |
| 2371 | q.text("port_no = "); |
| 2372 | q.text(util.pretty_port(self.port_no)) |
| 2373 | q.text(","); q.breakable() |
| 2374 | q.text("hw_addr = "); |
| 2375 | q.text(util.pretty_mac(self.hw_addr)) |
| 2376 | q.text(","); q.breakable() |
| 2377 | q.text("name = "); |
| 2378 | q.pp(self.name) |
| 2379 | q.text(","); q.breakable() |
| 2380 | q.text("config = "); |
| 2381 | q.text("%#x" % self.config) |
| 2382 | q.text(","); q.breakable() |
| 2383 | q.text("state = "); |
| 2384 | q.text("%#x" % self.state) |
| 2385 | q.text(","); q.breakable() |
| 2386 | q.text("curr = "); |
| 2387 | q.text("%#x" % self.curr) |
| 2388 | q.text(","); q.breakable() |
| 2389 | q.text("advertised = "); |
| 2390 | q.text("%#x" % self.advertised) |
| 2391 | q.text(","); q.breakable() |
| 2392 | q.text("supported = "); |
| 2393 | q.text("%#x" % self.supported) |
| 2394 | q.text(","); q.breakable() |
| 2395 | q.text("peer = "); |
| 2396 | q.text("%#x" % self.peer) |
| 2397 | q.text(","); q.breakable() |
| 2398 | q.text("curr_speed = "); |
| 2399 | q.text("%#x" % self.curr_speed) |
| 2400 | q.text(","); q.breakable() |
| 2401 | q.text("max_speed = "); |
| 2402 | q.text("%#x" % self.max_speed) |
| 2403 | q.breakable() |
| 2404 | q.text('}') |
| 2405 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2406 | |
| 2407 | class port_stats_entry(loxi.OFObject): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2408 | |
| 2409 | def __init__(self, port_no=None, rx_packets=None, tx_packets=None, rx_bytes=None, tx_bytes=None, rx_dropped=None, tx_dropped=None, rx_errors=None, tx_errors=None, rx_frame_err=None, rx_over_err=None, rx_crc_err=None, collisions=None, duration_sec=None, duration_nsec=None): |
| 2410 | if port_no != None: |
| 2411 | self.port_no = port_no |
| 2412 | else: |
| 2413 | self.port_no = 0 |
| 2414 | if rx_packets != None: |
| 2415 | self.rx_packets = rx_packets |
| 2416 | else: |
| 2417 | self.rx_packets = 0 |
| 2418 | if tx_packets != None: |
| 2419 | self.tx_packets = tx_packets |
| 2420 | else: |
| 2421 | self.tx_packets = 0 |
| 2422 | if rx_bytes != None: |
| 2423 | self.rx_bytes = rx_bytes |
| 2424 | else: |
| 2425 | self.rx_bytes = 0 |
| 2426 | if tx_bytes != None: |
| 2427 | self.tx_bytes = tx_bytes |
| 2428 | else: |
| 2429 | self.tx_bytes = 0 |
| 2430 | if rx_dropped != None: |
| 2431 | self.rx_dropped = rx_dropped |
| 2432 | else: |
| 2433 | self.rx_dropped = 0 |
| 2434 | if tx_dropped != None: |
| 2435 | self.tx_dropped = tx_dropped |
| 2436 | else: |
| 2437 | self.tx_dropped = 0 |
| 2438 | if rx_errors != None: |
| 2439 | self.rx_errors = rx_errors |
| 2440 | else: |
| 2441 | self.rx_errors = 0 |
| 2442 | if tx_errors != None: |
| 2443 | self.tx_errors = tx_errors |
| 2444 | else: |
| 2445 | self.tx_errors = 0 |
| 2446 | if rx_frame_err != None: |
| 2447 | self.rx_frame_err = rx_frame_err |
| 2448 | else: |
| 2449 | self.rx_frame_err = 0 |
| 2450 | if rx_over_err != None: |
| 2451 | self.rx_over_err = rx_over_err |
| 2452 | else: |
| 2453 | self.rx_over_err = 0 |
| 2454 | if rx_crc_err != None: |
| 2455 | self.rx_crc_err = rx_crc_err |
| 2456 | else: |
| 2457 | self.rx_crc_err = 0 |
| 2458 | if collisions != None: |
| 2459 | self.collisions = collisions |
| 2460 | else: |
| 2461 | self.collisions = 0 |
| 2462 | if duration_sec != None: |
| 2463 | self.duration_sec = duration_sec |
| 2464 | else: |
| 2465 | self.duration_sec = 0 |
| 2466 | if duration_nsec != None: |
| 2467 | self.duration_nsec = duration_nsec |
| 2468 | else: |
| 2469 | self.duration_nsec = 0 |
| 2470 | return |
| 2471 | |
| 2472 | def pack(self): |
| 2473 | packed = [] |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2474 | packed.append(util.pack_port_no(self.port_no)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2475 | packed.append('\x00' * 4) |
| 2476 | packed.append(struct.pack("!Q", self.rx_packets)) |
| 2477 | packed.append(struct.pack("!Q", self.tx_packets)) |
| 2478 | packed.append(struct.pack("!Q", self.rx_bytes)) |
| 2479 | packed.append(struct.pack("!Q", self.tx_bytes)) |
| 2480 | packed.append(struct.pack("!Q", self.rx_dropped)) |
| 2481 | packed.append(struct.pack("!Q", self.tx_dropped)) |
| 2482 | packed.append(struct.pack("!Q", self.rx_errors)) |
| 2483 | packed.append(struct.pack("!Q", self.tx_errors)) |
| 2484 | packed.append(struct.pack("!Q", self.rx_frame_err)) |
| 2485 | packed.append(struct.pack("!Q", self.rx_over_err)) |
| 2486 | packed.append(struct.pack("!Q", self.rx_crc_err)) |
| 2487 | packed.append(struct.pack("!Q", self.collisions)) |
| 2488 | packed.append(struct.pack("!L", self.duration_sec)) |
| 2489 | packed.append(struct.pack("!L", self.duration_nsec)) |
| 2490 | return ''.join(packed) |
| 2491 | |
| 2492 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2493 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2494 | obj = port_stats_entry() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2495 | obj.port_no = util.unpack_port_no(reader) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2496 | reader.skip(4) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2497 | obj.rx_packets = reader.read("!Q")[0] |
| 2498 | obj.tx_packets = reader.read("!Q")[0] |
| 2499 | obj.rx_bytes = reader.read("!Q")[0] |
| 2500 | obj.tx_bytes = reader.read("!Q")[0] |
| 2501 | obj.rx_dropped = reader.read("!Q")[0] |
| 2502 | obj.tx_dropped = reader.read("!Q")[0] |
| 2503 | obj.rx_errors = reader.read("!Q")[0] |
| 2504 | obj.tx_errors = reader.read("!Q")[0] |
| 2505 | obj.rx_frame_err = reader.read("!Q")[0] |
| 2506 | obj.rx_over_err = reader.read("!Q")[0] |
| 2507 | obj.rx_crc_err = reader.read("!Q")[0] |
| 2508 | obj.collisions = reader.read("!Q")[0] |
| 2509 | obj.duration_sec = reader.read("!L")[0] |
| 2510 | obj.duration_nsec = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2511 | return obj |
| 2512 | |
| 2513 | def __eq__(self, other): |
| 2514 | if type(self) != type(other): return False |
| 2515 | if self.port_no != other.port_no: return False |
| 2516 | if self.rx_packets != other.rx_packets: return False |
| 2517 | if self.tx_packets != other.tx_packets: return False |
| 2518 | if self.rx_bytes != other.rx_bytes: return False |
| 2519 | if self.tx_bytes != other.tx_bytes: return False |
| 2520 | if self.rx_dropped != other.rx_dropped: return False |
| 2521 | if self.tx_dropped != other.tx_dropped: return False |
| 2522 | if self.rx_errors != other.rx_errors: return False |
| 2523 | if self.tx_errors != other.tx_errors: return False |
| 2524 | if self.rx_frame_err != other.rx_frame_err: return False |
| 2525 | if self.rx_over_err != other.rx_over_err: return False |
| 2526 | if self.rx_crc_err != other.rx_crc_err: return False |
| 2527 | if self.collisions != other.collisions: return False |
| 2528 | if self.duration_sec != other.duration_sec: return False |
| 2529 | if self.duration_nsec != other.duration_nsec: return False |
| 2530 | return True |
| 2531 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2532 | def pretty_print(self, q): |
| 2533 | q.text("port_stats_entry {") |
| 2534 | with q.group(): |
| 2535 | with q.indent(2): |
| 2536 | q.breakable() |
| 2537 | q.text("port_no = "); |
| 2538 | q.text(util.pretty_port(self.port_no)) |
| 2539 | q.text(","); q.breakable() |
| 2540 | q.text("rx_packets = "); |
| 2541 | q.text("%#x" % self.rx_packets) |
| 2542 | q.text(","); q.breakable() |
| 2543 | q.text("tx_packets = "); |
| 2544 | q.text("%#x" % self.tx_packets) |
| 2545 | q.text(","); q.breakable() |
| 2546 | q.text("rx_bytes = "); |
| 2547 | q.text("%#x" % self.rx_bytes) |
| 2548 | q.text(","); q.breakable() |
| 2549 | q.text("tx_bytes = "); |
| 2550 | q.text("%#x" % self.tx_bytes) |
| 2551 | q.text(","); q.breakable() |
| 2552 | q.text("rx_dropped = "); |
| 2553 | q.text("%#x" % self.rx_dropped) |
| 2554 | q.text(","); q.breakable() |
| 2555 | q.text("tx_dropped = "); |
| 2556 | q.text("%#x" % self.tx_dropped) |
| 2557 | q.text(","); q.breakable() |
| 2558 | q.text("rx_errors = "); |
| 2559 | q.text("%#x" % self.rx_errors) |
| 2560 | q.text(","); q.breakable() |
| 2561 | q.text("tx_errors = "); |
| 2562 | q.text("%#x" % self.tx_errors) |
| 2563 | q.text(","); q.breakable() |
| 2564 | q.text("rx_frame_err = "); |
| 2565 | q.text("%#x" % self.rx_frame_err) |
| 2566 | q.text(","); q.breakable() |
| 2567 | q.text("rx_over_err = "); |
| 2568 | q.text("%#x" % self.rx_over_err) |
| 2569 | q.text(","); q.breakable() |
| 2570 | q.text("rx_crc_err = "); |
| 2571 | q.text("%#x" % self.rx_crc_err) |
| 2572 | q.text(","); q.breakable() |
| 2573 | q.text("collisions = "); |
| 2574 | q.text("%#x" % self.collisions) |
| 2575 | q.text(","); q.breakable() |
| 2576 | q.text("duration_sec = "); |
| 2577 | q.text("%#x" % self.duration_sec) |
| 2578 | q.text(","); q.breakable() |
| 2579 | q.text("duration_nsec = "); |
| 2580 | q.text("%#x" % self.duration_nsec) |
| 2581 | q.breakable() |
| 2582 | q.text('}') |
| 2583 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2584 | |
| 2585 | class queue_prop(loxi.OFObject): |
| 2586 | subtypes = {} |
| 2587 | |
Rich Lane | 95f7fc9 | 2014-01-27 17:08:16 -0800 | [diff] [blame] | 2588 | |
| 2589 | def __init__(self, type=None): |
| 2590 | if type != None: |
| 2591 | self.type = type |
| 2592 | else: |
| 2593 | self.type = 0 |
| 2594 | return |
| 2595 | |
| 2596 | def pack(self): |
| 2597 | packed = [] |
| 2598 | packed.append(struct.pack("!H", self.type)) |
| 2599 | packed.append(struct.pack("!H", 0)) # placeholder for len at index 1 |
| 2600 | packed.append('\x00' * 4) |
| 2601 | length = sum([len(x) for x in packed]) |
| 2602 | packed[1] = struct.pack("!H", length) |
| 2603 | return ''.join(packed) |
| 2604 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2605 | @staticmethod |
| 2606 | def unpack(reader): |
| 2607 | subtype, = reader.peek('!H', 0) |
Rich Lane | 95f7fc9 | 2014-01-27 17:08:16 -0800 | [diff] [blame] | 2608 | subclass = queue_prop.subtypes.get(subtype) |
| 2609 | if subclass: |
| 2610 | return subclass.unpack(reader) |
| 2611 | |
| 2612 | obj = queue_prop() |
| 2613 | obj.type = reader.read("!H")[0] |
| 2614 | _len = reader.read("!H")[0] |
| 2615 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 2616 | reader = orig_reader.slice(_len, 4) |
Rich Lane | 95f7fc9 | 2014-01-27 17:08:16 -0800 | [diff] [blame] | 2617 | reader.skip(4) |
| 2618 | return obj |
| 2619 | |
| 2620 | def __eq__(self, other): |
| 2621 | if type(self) != type(other): return False |
| 2622 | if self.type != other.type: return False |
| 2623 | return True |
| 2624 | |
| 2625 | def pretty_print(self, q): |
| 2626 | q.text("queue_prop {") |
| 2627 | with q.group(): |
| 2628 | with q.indent(2): |
| 2629 | q.breakable() |
| 2630 | q.breakable() |
| 2631 | q.text('}') |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2632 | |
| 2633 | |
| 2634 | class queue_prop_experimenter(queue_prop): |
| 2635 | subtypes = {} |
| 2636 | |
Rich Lane | 95f7fc9 | 2014-01-27 17:08:16 -0800 | [diff] [blame] | 2637 | type = 65535 |
| 2638 | |
| 2639 | def __init__(self, experimenter=None, data=None): |
| 2640 | if experimenter != None: |
| 2641 | self.experimenter = experimenter |
| 2642 | else: |
| 2643 | self.experimenter = 0 |
| 2644 | if data != None: |
| 2645 | self.data = data |
| 2646 | else: |
| 2647 | self.data = '' |
| 2648 | return |
| 2649 | |
| 2650 | def pack(self): |
| 2651 | packed = [] |
| 2652 | packed.append(struct.pack("!H", self.type)) |
| 2653 | packed.append(struct.pack("!H", 0)) # placeholder for len at index 1 |
| 2654 | packed.append('\x00' * 4) |
| 2655 | packed.append(struct.pack("!L", self.experimenter)) |
| 2656 | packed.append('\x00' * 4) |
| 2657 | packed.append(self.data) |
| 2658 | length = sum([len(x) for x in packed]) |
| 2659 | packed[1] = struct.pack("!H", length) |
| 2660 | return ''.join(packed) |
| 2661 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2662 | @staticmethod |
| 2663 | def unpack(reader): |
| 2664 | subtype, = reader.peek('!L', 8) |
Rich Lane | 95f7fc9 | 2014-01-27 17:08:16 -0800 | [diff] [blame] | 2665 | subclass = queue_prop_experimenter.subtypes.get(subtype) |
| 2666 | if subclass: |
| 2667 | return subclass.unpack(reader) |
| 2668 | |
| 2669 | obj = queue_prop_experimenter() |
| 2670 | _type = reader.read("!H")[0] |
| 2671 | assert(_type == 65535) |
| 2672 | _len = reader.read("!H")[0] |
| 2673 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 2674 | reader = orig_reader.slice(_len, 4) |
Rich Lane | 95f7fc9 | 2014-01-27 17:08:16 -0800 | [diff] [blame] | 2675 | reader.skip(4) |
| 2676 | obj.experimenter = reader.read("!L")[0] |
| 2677 | reader.skip(4) |
| 2678 | obj.data = str(reader.read_all()) |
| 2679 | return obj |
| 2680 | |
| 2681 | def __eq__(self, other): |
| 2682 | if type(self) != type(other): return False |
| 2683 | if self.experimenter != other.experimenter: return False |
| 2684 | if self.data != other.data: return False |
| 2685 | return True |
| 2686 | |
| 2687 | def pretty_print(self, q): |
| 2688 | q.text("queue_prop_experimenter {") |
| 2689 | with q.group(): |
| 2690 | with q.indent(2): |
| 2691 | q.breakable() |
| 2692 | q.text("data = "); |
| 2693 | q.pp(self.data) |
| 2694 | q.breakable() |
| 2695 | q.text('}') |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2696 | |
| 2697 | queue_prop.subtypes[65535] = queue_prop_experimenter |
| 2698 | |
| 2699 | class queue_prop_max_rate(queue_prop): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2700 | type = 2 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2701 | |
| 2702 | def __init__(self, rate=None): |
| 2703 | if rate != None: |
| 2704 | self.rate = rate |
| 2705 | else: |
| 2706 | self.rate = 0 |
| 2707 | return |
| 2708 | |
| 2709 | def pack(self): |
| 2710 | packed = [] |
| 2711 | packed.append(struct.pack("!H", self.type)) |
| 2712 | packed.append(struct.pack("!H", 0)) # placeholder for len at index 1 |
| 2713 | packed.append('\x00' * 4) |
| 2714 | packed.append(struct.pack("!H", self.rate)) |
| 2715 | packed.append('\x00' * 6) |
| 2716 | length = sum([len(x) for x in packed]) |
| 2717 | packed[1] = struct.pack("!H", length) |
| 2718 | return ''.join(packed) |
| 2719 | |
| 2720 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2721 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2722 | obj = queue_prop_max_rate() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2723 | _type = reader.read("!H")[0] |
| 2724 | assert(_type == 2) |
| 2725 | _len = reader.read("!H")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2726 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 2727 | reader = orig_reader.slice(_len, 4) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2728 | reader.skip(4) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2729 | obj.rate = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2730 | reader.skip(6) |
| 2731 | return obj |
| 2732 | |
| 2733 | def __eq__(self, other): |
| 2734 | if type(self) != type(other): return False |
| 2735 | if self.rate != other.rate: return False |
| 2736 | return True |
| 2737 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2738 | def pretty_print(self, q): |
| 2739 | q.text("queue_prop_max_rate {") |
| 2740 | with q.group(): |
| 2741 | with q.indent(2): |
| 2742 | q.breakable() |
| 2743 | q.text("rate = "); |
| 2744 | q.text("%#x" % self.rate) |
| 2745 | q.breakable() |
| 2746 | q.text('}') |
| 2747 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2748 | queue_prop.subtypes[2] = queue_prop_max_rate |
| 2749 | |
| 2750 | class queue_prop_min_rate(queue_prop): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2751 | type = 1 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2752 | |
| 2753 | def __init__(self, rate=None): |
| 2754 | if rate != None: |
| 2755 | self.rate = rate |
| 2756 | else: |
| 2757 | self.rate = 0 |
| 2758 | return |
| 2759 | |
| 2760 | def pack(self): |
| 2761 | packed = [] |
| 2762 | packed.append(struct.pack("!H", self.type)) |
| 2763 | packed.append(struct.pack("!H", 0)) # placeholder for len at index 1 |
| 2764 | packed.append('\x00' * 4) |
| 2765 | packed.append(struct.pack("!H", self.rate)) |
| 2766 | packed.append('\x00' * 6) |
| 2767 | length = sum([len(x) for x in packed]) |
| 2768 | packed[1] = struct.pack("!H", length) |
| 2769 | return ''.join(packed) |
| 2770 | |
| 2771 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2772 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2773 | obj = queue_prop_min_rate() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2774 | _type = reader.read("!H")[0] |
| 2775 | assert(_type == 1) |
| 2776 | _len = reader.read("!H")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2777 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 2778 | reader = orig_reader.slice(_len, 4) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2779 | reader.skip(4) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2780 | obj.rate = reader.read("!H")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2781 | reader.skip(6) |
| 2782 | return obj |
| 2783 | |
| 2784 | def __eq__(self, other): |
| 2785 | if type(self) != type(other): return False |
| 2786 | if self.rate != other.rate: return False |
| 2787 | return True |
| 2788 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2789 | def pretty_print(self, q): |
| 2790 | q.text("queue_prop_min_rate {") |
| 2791 | with q.group(): |
| 2792 | with q.indent(2): |
| 2793 | q.breakable() |
| 2794 | q.text("rate = "); |
| 2795 | q.text("%#x" % self.rate) |
| 2796 | q.breakable() |
| 2797 | q.text('}') |
| 2798 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2799 | queue_prop.subtypes[1] = queue_prop_min_rate |
| 2800 | |
| 2801 | class queue_stats_entry(loxi.OFObject): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2802 | |
| 2803 | def __init__(self, port_no=None, queue_id=None, tx_bytes=None, tx_packets=None, tx_errors=None, duration_sec=None, duration_nsec=None): |
| 2804 | if port_no != None: |
| 2805 | self.port_no = port_no |
| 2806 | else: |
| 2807 | self.port_no = 0 |
| 2808 | if queue_id != None: |
| 2809 | self.queue_id = queue_id |
| 2810 | else: |
| 2811 | self.queue_id = 0 |
| 2812 | if tx_bytes != None: |
| 2813 | self.tx_bytes = tx_bytes |
| 2814 | else: |
| 2815 | self.tx_bytes = 0 |
| 2816 | if tx_packets != None: |
| 2817 | self.tx_packets = tx_packets |
| 2818 | else: |
| 2819 | self.tx_packets = 0 |
| 2820 | if tx_errors != None: |
| 2821 | self.tx_errors = tx_errors |
| 2822 | else: |
| 2823 | self.tx_errors = 0 |
| 2824 | if duration_sec != None: |
| 2825 | self.duration_sec = duration_sec |
| 2826 | else: |
| 2827 | self.duration_sec = 0 |
| 2828 | if duration_nsec != None: |
| 2829 | self.duration_nsec = duration_nsec |
| 2830 | else: |
| 2831 | self.duration_nsec = 0 |
| 2832 | return |
| 2833 | |
| 2834 | def pack(self): |
| 2835 | packed = [] |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2836 | packed.append(util.pack_port_no(self.port_no)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2837 | packed.append(struct.pack("!L", self.queue_id)) |
| 2838 | packed.append(struct.pack("!Q", self.tx_bytes)) |
| 2839 | packed.append(struct.pack("!Q", self.tx_packets)) |
| 2840 | packed.append(struct.pack("!Q", self.tx_errors)) |
| 2841 | packed.append(struct.pack("!L", self.duration_sec)) |
| 2842 | packed.append(struct.pack("!L", self.duration_nsec)) |
| 2843 | return ''.join(packed) |
| 2844 | |
| 2845 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2846 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2847 | obj = queue_stats_entry() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2848 | obj.port_no = util.unpack_port_no(reader) |
| 2849 | obj.queue_id = reader.read("!L")[0] |
| 2850 | obj.tx_bytes = reader.read("!Q")[0] |
| 2851 | obj.tx_packets = reader.read("!Q")[0] |
| 2852 | obj.tx_errors = reader.read("!Q")[0] |
| 2853 | obj.duration_sec = reader.read("!L")[0] |
| 2854 | obj.duration_nsec = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2855 | return obj |
| 2856 | |
| 2857 | def __eq__(self, other): |
| 2858 | if type(self) != type(other): return False |
| 2859 | if self.port_no != other.port_no: return False |
| 2860 | if self.queue_id != other.queue_id: return False |
| 2861 | if self.tx_bytes != other.tx_bytes: return False |
| 2862 | if self.tx_packets != other.tx_packets: return False |
| 2863 | if self.tx_errors != other.tx_errors: return False |
| 2864 | if self.duration_sec != other.duration_sec: return False |
| 2865 | if self.duration_nsec != other.duration_nsec: return False |
| 2866 | return True |
| 2867 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2868 | def pretty_print(self, q): |
| 2869 | q.text("queue_stats_entry {") |
| 2870 | with q.group(): |
| 2871 | with q.indent(2): |
| 2872 | q.breakable() |
| 2873 | q.text("port_no = "); |
| 2874 | q.text(util.pretty_port(self.port_no)) |
| 2875 | q.text(","); q.breakable() |
| 2876 | q.text("queue_id = "); |
| 2877 | q.text("%#x" % self.queue_id) |
| 2878 | q.text(","); q.breakable() |
| 2879 | q.text("tx_bytes = "); |
| 2880 | q.text("%#x" % self.tx_bytes) |
| 2881 | q.text(","); q.breakable() |
| 2882 | q.text("tx_packets = "); |
| 2883 | q.text("%#x" % self.tx_packets) |
| 2884 | q.text(","); q.breakable() |
| 2885 | q.text("tx_errors = "); |
| 2886 | q.text("%#x" % self.tx_errors) |
| 2887 | q.text(","); q.breakable() |
| 2888 | q.text("duration_sec = "); |
| 2889 | q.text("%#x" % self.duration_sec) |
| 2890 | q.text(","); q.breakable() |
| 2891 | q.text("duration_nsec = "); |
| 2892 | q.text("%#x" % self.duration_nsec) |
| 2893 | q.breakable() |
| 2894 | q.text('}') |
| 2895 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2896 | |
| 2897 | class table_feature_prop(loxi.OFObject): |
| 2898 | subtypes = {} |
| 2899 | |
Rich Lane | 95f7fc9 | 2014-01-27 17:08:16 -0800 | [diff] [blame] | 2900 | |
| 2901 | def __init__(self, type=None): |
| 2902 | if type != None: |
| 2903 | self.type = type |
| 2904 | else: |
| 2905 | self.type = 0 |
| 2906 | return |
| 2907 | |
| 2908 | def pack(self): |
| 2909 | packed = [] |
| 2910 | packed.append(struct.pack("!H", self.type)) |
| 2911 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 |
| 2912 | length = sum([len(x) for x in packed]) |
| 2913 | packed[1] = struct.pack("!H", length) |
| 2914 | return ''.join(packed) |
| 2915 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2916 | @staticmethod |
| 2917 | def unpack(reader): |
| 2918 | subtype, = reader.peek('!H', 0) |
Rich Lane | 95f7fc9 | 2014-01-27 17:08:16 -0800 | [diff] [blame] | 2919 | subclass = table_feature_prop.subtypes.get(subtype) |
| 2920 | if subclass: |
| 2921 | return subclass.unpack(reader) |
| 2922 | |
| 2923 | obj = table_feature_prop() |
| 2924 | obj.type = reader.read("!H")[0] |
| 2925 | _length = reader.read("!H")[0] |
| 2926 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 2927 | reader = orig_reader.slice(_length, 4) |
Rich Lane | 95f7fc9 | 2014-01-27 17:08:16 -0800 | [diff] [blame] | 2928 | return obj |
| 2929 | |
| 2930 | def __eq__(self, other): |
| 2931 | if type(self) != type(other): return False |
| 2932 | if self.type != other.type: return False |
| 2933 | return True |
| 2934 | |
| 2935 | def pretty_print(self, q): |
| 2936 | q.text("table_feature_prop {") |
| 2937 | with q.group(): |
| 2938 | with q.indent(2): |
| 2939 | q.breakable() |
| 2940 | q.breakable() |
| 2941 | q.text('}') |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2942 | |
| 2943 | |
| 2944 | class table_feature_prop_apply_actions(table_feature_prop): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2945 | type = 6 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2946 | |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2947 | def __init__(self, action_ids=None): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2948 | if action_ids != None: |
| 2949 | self.action_ids = action_ids |
| 2950 | else: |
| 2951 | self.action_ids = [] |
| 2952 | return |
| 2953 | |
| 2954 | def pack(self): |
| 2955 | packed = [] |
| 2956 | packed.append(struct.pack("!H", self.type)) |
| 2957 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2958 | packed.append(loxi.generic_util.pack_list(self.action_ids)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2959 | length = sum([len(x) for x in packed]) |
| 2960 | packed[1] = struct.pack("!H", length) |
| 2961 | return ''.join(packed) |
| 2962 | |
| 2963 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2964 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2965 | obj = table_feature_prop_apply_actions() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2966 | _type = reader.read("!H")[0] |
| 2967 | assert(_type == 6) |
| 2968 | _length = reader.read("!H")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2969 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 2970 | reader = orig_reader.slice(_length, 4) |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2971 | obj.action_ids = loxi.generic_util.unpack_list(reader, action_id.action_id.unpack) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2972 | return obj |
| 2973 | |
| 2974 | def __eq__(self, other): |
| 2975 | if type(self) != type(other): return False |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2976 | if self.action_ids != other.action_ids: return False |
| 2977 | return True |
| 2978 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2979 | def pretty_print(self, q): |
| 2980 | q.text("table_feature_prop_apply_actions {") |
| 2981 | with q.group(): |
| 2982 | with q.indent(2): |
| 2983 | q.breakable() |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2984 | q.text("action_ids = "); |
| 2985 | q.pp(self.action_ids) |
| 2986 | q.breakable() |
| 2987 | q.text('}') |
| 2988 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 2989 | table_feature_prop.subtypes[6] = table_feature_prop_apply_actions |
| 2990 | |
| 2991 | class table_feature_prop_apply_actions_miss(table_feature_prop): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2992 | type = 7 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2993 | |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 2994 | def __init__(self, action_ids=None): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 2995 | if action_ids != None: |
| 2996 | self.action_ids = action_ids |
| 2997 | else: |
| 2998 | self.action_ids = [] |
| 2999 | return |
| 3000 | |
| 3001 | def pack(self): |
| 3002 | packed = [] |
| 3003 | packed.append(struct.pack("!H", self.type)) |
| 3004 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3005 | packed.append(loxi.generic_util.pack_list(self.action_ids)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3006 | length = sum([len(x) for x in packed]) |
| 3007 | packed[1] = struct.pack("!H", length) |
| 3008 | return ''.join(packed) |
| 3009 | |
| 3010 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3011 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3012 | obj = table_feature_prop_apply_actions_miss() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3013 | _type = reader.read("!H")[0] |
| 3014 | assert(_type == 7) |
| 3015 | _length = reader.read("!H")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3016 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 3017 | reader = orig_reader.slice(_length, 4) |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3018 | obj.action_ids = loxi.generic_util.unpack_list(reader, action_id.action_id.unpack) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3019 | return obj |
| 3020 | |
| 3021 | def __eq__(self, other): |
| 3022 | if type(self) != type(other): return False |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3023 | if self.action_ids != other.action_ids: return False |
| 3024 | return True |
| 3025 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3026 | def pretty_print(self, q): |
| 3027 | q.text("table_feature_prop_apply_actions_miss {") |
| 3028 | with q.group(): |
| 3029 | with q.indent(2): |
| 3030 | q.breakable() |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3031 | q.text("action_ids = "); |
| 3032 | q.pp(self.action_ids) |
| 3033 | q.breakable() |
| 3034 | q.text('}') |
| 3035 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3036 | table_feature_prop.subtypes[7] = table_feature_prop_apply_actions_miss |
| 3037 | |
| 3038 | class table_feature_prop_apply_setfield(table_feature_prop): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3039 | type = 14 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3040 | |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3041 | def __init__(self, oxm_ids=None): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3042 | if oxm_ids != None: |
| 3043 | self.oxm_ids = oxm_ids |
| 3044 | else: |
| 3045 | self.oxm_ids = [] |
| 3046 | return |
| 3047 | |
| 3048 | def pack(self): |
| 3049 | packed = [] |
| 3050 | packed.append(struct.pack("!H", self.type)) |
| 3051 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3052 | packed.append(loxi.generic_util.pack_list(self.oxm_ids)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3053 | length = sum([len(x) for x in packed]) |
| 3054 | packed[1] = struct.pack("!H", length) |
| 3055 | return ''.join(packed) |
| 3056 | |
| 3057 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3058 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3059 | obj = table_feature_prop_apply_setfield() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3060 | _type = reader.read("!H")[0] |
| 3061 | assert(_type == 14) |
| 3062 | _length = reader.read("!H")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3063 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 3064 | reader = orig_reader.slice(_length, 4) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3065 | obj.oxm_ids = loxi.generic_util.unpack_list(reader, common.uint32.unpack) |
| 3066 | return obj |
| 3067 | |
| 3068 | def __eq__(self, other): |
| 3069 | if type(self) != type(other): return False |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3070 | if self.oxm_ids != other.oxm_ids: return False |
| 3071 | return True |
| 3072 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3073 | def pretty_print(self, q): |
| 3074 | q.text("table_feature_prop_apply_setfield {") |
| 3075 | with q.group(): |
| 3076 | with q.indent(2): |
| 3077 | q.breakable() |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3078 | q.text("oxm_ids = "); |
| 3079 | q.pp(self.oxm_ids) |
| 3080 | q.breakable() |
| 3081 | q.text('}') |
| 3082 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3083 | table_feature_prop.subtypes[14] = table_feature_prop_apply_setfield |
| 3084 | |
| 3085 | class table_feature_prop_apply_setfield_miss(table_feature_prop): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3086 | type = 15 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3087 | |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3088 | def __init__(self, oxm_ids=None): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3089 | if oxm_ids != None: |
| 3090 | self.oxm_ids = oxm_ids |
| 3091 | else: |
| 3092 | self.oxm_ids = [] |
| 3093 | return |
| 3094 | |
| 3095 | def pack(self): |
| 3096 | packed = [] |
| 3097 | packed.append(struct.pack("!H", self.type)) |
| 3098 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3099 | packed.append(loxi.generic_util.pack_list(self.oxm_ids)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3100 | length = sum([len(x) for x in packed]) |
| 3101 | packed[1] = struct.pack("!H", length) |
| 3102 | return ''.join(packed) |
| 3103 | |
| 3104 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3105 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3106 | obj = table_feature_prop_apply_setfield_miss() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3107 | _type = reader.read("!H")[0] |
| 3108 | assert(_type == 15) |
| 3109 | _length = reader.read("!H")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3110 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 3111 | reader = orig_reader.slice(_length, 4) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3112 | obj.oxm_ids = loxi.generic_util.unpack_list(reader, common.uint32.unpack) |
| 3113 | return obj |
| 3114 | |
| 3115 | def __eq__(self, other): |
| 3116 | if type(self) != type(other): return False |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3117 | if self.oxm_ids != other.oxm_ids: return False |
| 3118 | return True |
| 3119 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3120 | def pretty_print(self, q): |
| 3121 | q.text("table_feature_prop_apply_setfield_miss {") |
| 3122 | with q.group(): |
| 3123 | with q.indent(2): |
| 3124 | q.breakable() |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3125 | q.text("oxm_ids = "); |
| 3126 | q.pp(self.oxm_ids) |
| 3127 | q.breakable() |
| 3128 | q.text('}') |
| 3129 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3130 | table_feature_prop.subtypes[15] = table_feature_prop_apply_setfield_miss |
| 3131 | |
| 3132 | class table_feature_prop_experimenter(table_feature_prop): |
Rich Lane | 2e079da | 2014-10-29 15:30:24 -0700 | [diff] [blame] | 3133 | subtypes = {} |
| 3134 | |
Rich Lane | 9ec3fca | 2014-02-26 16:22:56 -0800 | [diff] [blame] | 3135 | type = 65534 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3136 | |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3137 | def __init__(self, experimenter=None, subtype=None, experimenter_data=None): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3138 | if experimenter != None: |
| 3139 | self.experimenter = experimenter |
| 3140 | else: |
| 3141 | self.experimenter = 0 |
| 3142 | if subtype != None: |
| 3143 | self.subtype = subtype |
| 3144 | else: |
| 3145 | self.subtype = 0 |
| 3146 | if experimenter_data != None: |
| 3147 | self.experimenter_data = experimenter_data |
| 3148 | else: |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3149 | self.experimenter_data = '' |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3150 | return |
| 3151 | |
| 3152 | def pack(self): |
| 3153 | packed = [] |
| 3154 | packed.append(struct.pack("!H", self.type)) |
| 3155 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 |
| 3156 | packed.append(struct.pack("!L", self.experimenter)) |
| 3157 | packed.append(struct.pack("!L", self.subtype)) |
| 3158 | packed.append(self.experimenter_data) |
| 3159 | length = sum([len(x) for x in packed]) |
| 3160 | packed[1] = struct.pack("!H", length) |
| 3161 | return ''.join(packed) |
| 3162 | |
| 3163 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3164 | def unpack(reader): |
Rich Lane | 2e079da | 2014-10-29 15:30:24 -0700 | [diff] [blame] | 3165 | subtype, = reader.peek('!L', 4) |
| 3166 | subclass = table_feature_prop_experimenter.subtypes.get(subtype) |
| 3167 | if subclass: |
| 3168 | return subclass.unpack(reader) |
| 3169 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3170 | obj = table_feature_prop_experimenter() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3171 | _type = reader.read("!H")[0] |
Rich Lane | 9ec3fca | 2014-02-26 16:22:56 -0800 | [diff] [blame] | 3172 | assert(_type == 65534) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3173 | _length = reader.read("!H")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3174 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 3175 | reader = orig_reader.slice(_length, 4) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3176 | obj.experimenter = reader.read("!L")[0] |
| 3177 | obj.subtype = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3178 | obj.experimenter_data = str(reader.read_all()) |
| 3179 | return obj |
| 3180 | |
| 3181 | def __eq__(self, other): |
| 3182 | if type(self) != type(other): return False |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3183 | if self.experimenter != other.experimenter: return False |
| 3184 | if self.subtype != other.subtype: return False |
| 3185 | if self.experimenter_data != other.experimenter_data: return False |
| 3186 | return True |
| 3187 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3188 | def pretty_print(self, q): |
| 3189 | q.text("table_feature_prop_experimenter {") |
| 3190 | with q.group(): |
| 3191 | with q.indent(2): |
| 3192 | q.breakable() |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3193 | q.text("subtype = "); |
| 3194 | q.text("%#x" % self.subtype) |
| 3195 | q.text(","); q.breakable() |
| 3196 | q.text("experimenter_data = "); |
| 3197 | q.pp(self.experimenter_data) |
| 3198 | q.breakable() |
| 3199 | q.text('}') |
| 3200 | |
Rich Lane | 9ec3fca | 2014-02-26 16:22:56 -0800 | [diff] [blame] | 3201 | table_feature_prop.subtypes[65534] = table_feature_prop_experimenter |
| 3202 | |
| 3203 | class table_feature_prop_experimenter_miss(table_feature_prop): |
Rich Lane | 2e079da | 2014-10-29 15:30:24 -0700 | [diff] [blame] | 3204 | subtypes = {} |
| 3205 | |
Rich Lane | 9ec3fca | 2014-02-26 16:22:56 -0800 | [diff] [blame] | 3206 | type = 65535 |
| 3207 | |
| 3208 | def __init__(self, experimenter=None, subtype=None, experimenter_data=None): |
| 3209 | if experimenter != None: |
| 3210 | self.experimenter = experimenter |
| 3211 | else: |
| 3212 | self.experimenter = 0 |
| 3213 | if subtype != None: |
| 3214 | self.subtype = subtype |
| 3215 | else: |
| 3216 | self.subtype = 0 |
| 3217 | if experimenter_data != None: |
| 3218 | self.experimenter_data = experimenter_data |
| 3219 | else: |
| 3220 | self.experimenter_data = '' |
| 3221 | return |
| 3222 | |
| 3223 | def pack(self): |
| 3224 | packed = [] |
| 3225 | packed.append(struct.pack("!H", self.type)) |
| 3226 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 |
| 3227 | packed.append(struct.pack("!L", self.experimenter)) |
| 3228 | packed.append(struct.pack("!L", self.subtype)) |
| 3229 | packed.append(self.experimenter_data) |
| 3230 | length = sum([len(x) for x in packed]) |
| 3231 | packed[1] = struct.pack("!H", length) |
| 3232 | return ''.join(packed) |
| 3233 | |
| 3234 | @staticmethod |
| 3235 | def unpack(reader): |
Rich Lane | 2e079da | 2014-10-29 15:30:24 -0700 | [diff] [blame] | 3236 | subtype, = reader.peek('!L', 4) |
| 3237 | subclass = table_feature_prop_experimenter_miss.subtypes.get(subtype) |
| 3238 | if subclass: |
| 3239 | return subclass.unpack(reader) |
| 3240 | |
Rich Lane | 9ec3fca | 2014-02-26 16:22:56 -0800 | [diff] [blame] | 3241 | obj = table_feature_prop_experimenter_miss() |
| 3242 | _type = reader.read("!H")[0] |
| 3243 | assert(_type == 65535) |
| 3244 | _length = reader.read("!H")[0] |
| 3245 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 3246 | reader = orig_reader.slice(_length, 4) |
Rich Lane | 9ec3fca | 2014-02-26 16:22:56 -0800 | [diff] [blame] | 3247 | obj.experimenter = reader.read("!L")[0] |
| 3248 | obj.subtype = reader.read("!L")[0] |
| 3249 | obj.experimenter_data = str(reader.read_all()) |
| 3250 | return obj |
| 3251 | |
| 3252 | def __eq__(self, other): |
| 3253 | if type(self) != type(other): return False |
| 3254 | if self.experimenter != other.experimenter: return False |
| 3255 | if self.subtype != other.subtype: return False |
| 3256 | if self.experimenter_data != other.experimenter_data: return False |
| 3257 | return True |
| 3258 | |
| 3259 | def pretty_print(self, q): |
| 3260 | q.text("table_feature_prop_experimenter_miss {") |
| 3261 | with q.group(): |
| 3262 | with q.indent(2): |
| 3263 | q.breakable() |
Rich Lane | 9ec3fca | 2014-02-26 16:22:56 -0800 | [diff] [blame] | 3264 | q.text("subtype = "); |
| 3265 | q.text("%#x" % self.subtype) |
| 3266 | q.text(","); q.breakable() |
| 3267 | q.text("experimenter_data = "); |
| 3268 | q.pp(self.experimenter_data) |
| 3269 | q.breakable() |
| 3270 | q.text('}') |
| 3271 | |
| 3272 | table_feature_prop.subtypes[65535] = table_feature_prop_experimenter_miss |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3273 | |
| 3274 | class table_feature_prop_instructions(table_feature_prop): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3275 | type = 0 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3276 | |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3277 | def __init__(self, instruction_ids=None): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3278 | if instruction_ids != None: |
| 3279 | self.instruction_ids = instruction_ids |
| 3280 | else: |
| 3281 | self.instruction_ids = [] |
| 3282 | return |
| 3283 | |
| 3284 | def pack(self): |
| 3285 | packed = [] |
| 3286 | packed.append(struct.pack("!H", self.type)) |
| 3287 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3288 | packed.append(loxi.generic_util.pack_list(self.instruction_ids)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3289 | length = sum([len(x) for x in packed]) |
| 3290 | packed[1] = struct.pack("!H", length) |
| 3291 | return ''.join(packed) |
| 3292 | |
| 3293 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3294 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3295 | obj = table_feature_prop_instructions() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3296 | _type = reader.read("!H")[0] |
| 3297 | assert(_type == 0) |
| 3298 | _length = reader.read("!H")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3299 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 3300 | reader = orig_reader.slice(_length, 4) |
Rich Lane | c0d05d1 | 2014-03-11 18:02:24 -0700 | [diff] [blame] | 3301 | obj.instruction_ids = loxi.generic_util.unpack_list(reader, instruction_id.instruction_id.unpack) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3302 | return obj |
| 3303 | |
| 3304 | def __eq__(self, other): |
| 3305 | if type(self) != type(other): return False |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3306 | if self.instruction_ids != other.instruction_ids: return False |
| 3307 | return True |
| 3308 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3309 | def pretty_print(self, q): |
| 3310 | q.text("table_feature_prop_instructions {") |
| 3311 | with q.group(): |
| 3312 | with q.indent(2): |
| 3313 | q.breakable() |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3314 | q.text("instruction_ids = "); |
| 3315 | q.pp(self.instruction_ids) |
| 3316 | q.breakable() |
| 3317 | q.text('}') |
| 3318 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3319 | table_feature_prop.subtypes[0] = table_feature_prop_instructions |
| 3320 | |
| 3321 | class table_feature_prop_instructions_miss(table_feature_prop): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3322 | type = 1 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3323 | |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3324 | def __init__(self, instruction_ids=None): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3325 | if instruction_ids != None: |
| 3326 | self.instruction_ids = instruction_ids |
| 3327 | else: |
| 3328 | self.instruction_ids = [] |
| 3329 | return |
| 3330 | |
| 3331 | def pack(self): |
| 3332 | packed = [] |
| 3333 | packed.append(struct.pack("!H", self.type)) |
| 3334 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3335 | packed.append(loxi.generic_util.pack_list(self.instruction_ids)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3336 | length = sum([len(x) for x in packed]) |
| 3337 | packed[1] = struct.pack("!H", length) |
| 3338 | return ''.join(packed) |
| 3339 | |
| 3340 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3341 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3342 | obj = table_feature_prop_instructions_miss() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3343 | _type = reader.read("!H")[0] |
| 3344 | assert(_type == 1) |
| 3345 | _length = reader.read("!H")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3346 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 3347 | reader = orig_reader.slice(_length, 4) |
Rich Lane | c0d05d1 | 2014-03-11 18:02:24 -0700 | [diff] [blame] | 3348 | obj.instruction_ids = loxi.generic_util.unpack_list(reader, instruction_id.instruction_id.unpack) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3349 | return obj |
| 3350 | |
| 3351 | def __eq__(self, other): |
| 3352 | if type(self) != type(other): return False |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3353 | if self.instruction_ids != other.instruction_ids: return False |
| 3354 | return True |
| 3355 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3356 | def pretty_print(self, q): |
| 3357 | q.text("table_feature_prop_instructions_miss {") |
| 3358 | with q.group(): |
| 3359 | with q.indent(2): |
| 3360 | q.breakable() |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3361 | q.text("instruction_ids = "); |
| 3362 | q.pp(self.instruction_ids) |
| 3363 | q.breakable() |
| 3364 | q.text('}') |
| 3365 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3366 | table_feature_prop.subtypes[1] = table_feature_prop_instructions_miss |
| 3367 | |
| 3368 | class table_feature_prop_match(table_feature_prop): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3369 | type = 8 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3370 | |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3371 | def __init__(self, oxm_ids=None): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3372 | if oxm_ids != None: |
| 3373 | self.oxm_ids = oxm_ids |
| 3374 | else: |
| 3375 | self.oxm_ids = [] |
| 3376 | return |
| 3377 | |
| 3378 | def pack(self): |
| 3379 | packed = [] |
| 3380 | packed.append(struct.pack("!H", self.type)) |
| 3381 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3382 | packed.append(loxi.generic_util.pack_list(self.oxm_ids)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3383 | length = sum([len(x) for x in packed]) |
| 3384 | packed[1] = struct.pack("!H", length) |
| 3385 | return ''.join(packed) |
| 3386 | |
| 3387 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3388 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3389 | obj = table_feature_prop_match() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3390 | _type = reader.read("!H")[0] |
| 3391 | assert(_type == 8) |
| 3392 | _length = reader.read("!H")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3393 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 3394 | reader = orig_reader.slice(_length, 4) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3395 | obj.oxm_ids = loxi.generic_util.unpack_list(reader, common.uint32.unpack) |
| 3396 | return obj |
| 3397 | |
| 3398 | def __eq__(self, other): |
| 3399 | if type(self) != type(other): return False |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3400 | if self.oxm_ids != other.oxm_ids: return False |
| 3401 | return True |
| 3402 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3403 | def pretty_print(self, q): |
| 3404 | q.text("table_feature_prop_match {") |
| 3405 | with q.group(): |
| 3406 | with q.indent(2): |
| 3407 | q.breakable() |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3408 | q.text("oxm_ids = "); |
| 3409 | q.pp(self.oxm_ids) |
| 3410 | q.breakable() |
| 3411 | q.text('}') |
| 3412 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3413 | table_feature_prop.subtypes[8] = table_feature_prop_match |
| 3414 | |
| 3415 | class table_feature_prop_next_tables(table_feature_prop): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3416 | type = 2 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3417 | |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3418 | def __init__(self, next_table_ids=None): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3419 | if next_table_ids != None: |
| 3420 | self.next_table_ids = next_table_ids |
| 3421 | else: |
| 3422 | self.next_table_ids = [] |
| 3423 | return |
| 3424 | |
| 3425 | def pack(self): |
| 3426 | packed = [] |
| 3427 | packed.append(struct.pack("!H", self.type)) |
| 3428 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3429 | packed.append(loxi.generic_util.pack_list(self.next_table_ids)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3430 | length = sum([len(x) for x in packed]) |
| 3431 | packed[1] = struct.pack("!H", length) |
| 3432 | return ''.join(packed) |
| 3433 | |
| 3434 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3435 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3436 | obj = table_feature_prop_next_tables() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3437 | _type = reader.read("!H")[0] |
| 3438 | assert(_type == 2) |
| 3439 | _length = reader.read("!H")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3440 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 3441 | reader = orig_reader.slice(_length, 4) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3442 | obj.next_table_ids = loxi.generic_util.unpack_list(reader, common.uint8.unpack) |
| 3443 | return obj |
| 3444 | |
| 3445 | def __eq__(self, other): |
| 3446 | if type(self) != type(other): return False |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3447 | if self.next_table_ids != other.next_table_ids: return False |
| 3448 | return True |
| 3449 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3450 | def pretty_print(self, q): |
| 3451 | q.text("table_feature_prop_next_tables {") |
| 3452 | with q.group(): |
| 3453 | with q.indent(2): |
| 3454 | q.breakable() |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3455 | q.text("next_table_ids = "); |
| 3456 | q.pp(self.next_table_ids) |
| 3457 | q.breakable() |
| 3458 | q.text('}') |
| 3459 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3460 | table_feature_prop.subtypes[2] = table_feature_prop_next_tables |
| 3461 | |
| 3462 | class table_feature_prop_next_tables_miss(table_feature_prop): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3463 | type = 3 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3464 | |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3465 | def __init__(self, next_table_ids=None): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3466 | if next_table_ids != None: |
| 3467 | self.next_table_ids = next_table_ids |
| 3468 | else: |
| 3469 | self.next_table_ids = [] |
| 3470 | return |
| 3471 | |
| 3472 | def pack(self): |
| 3473 | packed = [] |
| 3474 | packed.append(struct.pack("!H", self.type)) |
| 3475 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3476 | packed.append(loxi.generic_util.pack_list(self.next_table_ids)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3477 | length = sum([len(x) for x in packed]) |
| 3478 | packed[1] = struct.pack("!H", length) |
| 3479 | return ''.join(packed) |
| 3480 | |
| 3481 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3482 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3483 | obj = table_feature_prop_next_tables_miss() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3484 | _type = reader.read("!H")[0] |
| 3485 | assert(_type == 3) |
| 3486 | _length = reader.read("!H")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3487 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 3488 | reader = orig_reader.slice(_length, 4) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3489 | obj.next_table_ids = loxi.generic_util.unpack_list(reader, common.uint8.unpack) |
| 3490 | return obj |
| 3491 | |
| 3492 | def __eq__(self, other): |
| 3493 | if type(self) != type(other): return False |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3494 | if self.next_table_ids != other.next_table_ids: return False |
| 3495 | return True |
| 3496 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3497 | def pretty_print(self, q): |
| 3498 | q.text("table_feature_prop_next_tables_miss {") |
| 3499 | with q.group(): |
| 3500 | with q.indent(2): |
| 3501 | q.breakable() |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3502 | q.text("next_table_ids = "); |
| 3503 | q.pp(self.next_table_ids) |
| 3504 | q.breakable() |
| 3505 | q.text('}') |
| 3506 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3507 | table_feature_prop.subtypes[3] = table_feature_prop_next_tables_miss |
| 3508 | |
| 3509 | class table_feature_prop_wildcards(table_feature_prop): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3510 | type = 10 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3511 | |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3512 | def __init__(self, oxm_ids=None): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3513 | if oxm_ids != None: |
| 3514 | self.oxm_ids = oxm_ids |
| 3515 | else: |
| 3516 | self.oxm_ids = [] |
| 3517 | return |
| 3518 | |
| 3519 | def pack(self): |
| 3520 | packed = [] |
| 3521 | packed.append(struct.pack("!H", self.type)) |
| 3522 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3523 | packed.append(loxi.generic_util.pack_list(self.oxm_ids)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3524 | length = sum([len(x) for x in packed]) |
| 3525 | packed[1] = struct.pack("!H", length) |
| 3526 | return ''.join(packed) |
| 3527 | |
| 3528 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3529 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3530 | obj = table_feature_prop_wildcards() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3531 | _type = reader.read("!H")[0] |
| 3532 | assert(_type == 10) |
| 3533 | _length = reader.read("!H")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3534 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 3535 | reader = orig_reader.slice(_length, 4) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3536 | obj.oxm_ids = loxi.generic_util.unpack_list(reader, common.uint32.unpack) |
| 3537 | return obj |
| 3538 | |
| 3539 | def __eq__(self, other): |
| 3540 | if type(self) != type(other): return False |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3541 | if self.oxm_ids != other.oxm_ids: return False |
| 3542 | return True |
| 3543 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3544 | def pretty_print(self, q): |
| 3545 | q.text("table_feature_prop_wildcards {") |
| 3546 | with q.group(): |
| 3547 | with q.indent(2): |
| 3548 | q.breakable() |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3549 | q.text("oxm_ids = "); |
| 3550 | q.pp(self.oxm_ids) |
| 3551 | q.breakable() |
| 3552 | q.text('}') |
| 3553 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3554 | table_feature_prop.subtypes[10] = table_feature_prop_wildcards |
| 3555 | |
| 3556 | class table_feature_prop_write_actions(table_feature_prop): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3557 | type = 4 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3558 | |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3559 | def __init__(self, action_ids=None): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3560 | if action_ids != None: |
| 3561 | self.action_ids = action_ids |
| 3562 | else: |
| 3563 | self.action_ids = [] |
| 3564 | return |
| 3565 | |
| 3566 | def pack(self): |
| 3567 | packed = [] |
| 3568 | packed.append(struct.pack("!H", self.type)) |
| 3569 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3570 | packed.append(loxi.generic_util.pack_list(self.action_ids)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3571 | length = sum([len(x) for x in packed]) |
| 3572 | packed[1] = struct.pack("!H", length) |
| 3573 | return ''.join(packed) |
| 3574 | |
| 3575 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3576 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3577 | obj = table_feature_prop_write_actions() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3578 | _type = reader.read("!H")[0] |
| 3579 | assert(_type == 4) |
| 3580 | _length = reader.read("!H")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3581 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 3582 | reader = orig_reader.slice(_length, 4) |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3583 | obj.action_ids = loxi.generic_util.unpack_list(reader, action_id.action_id.unpack) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3584 | return obj |
| 3585 | |
| 3586 | def __eq__(self, other): |
| 3587 | if type(self) != type(other): return False |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3588 | if self.action_ids != other.action_ids: return False |
| 3589 | return True |
| 3590 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3591 | def pretty_print(self, q): |
| 3592 | q.text("table_feature_prop_write_actions {") |
| 3593 | with q.group(): |
| 3594 | with q.indent(2): |
| 3595 | q.breakable() |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3596 | q.text("action_ids = "); |
| 3597 | q.pp(self.action_ids) |
| 3598 | q.breakable() |
| 3599 | q.text('}') |
| 3600 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3601 | table_feature_prop.subtypes[4] = table_feature_prop_write_actions |
| 3602 | |
| 3603 | class table_feature_prop_write_actions_miss(table_feature_prop): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3604 | type = 5 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3605 | |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3606 | def __init__(self, action_ids=None): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3607 | if action_ids != None: |
| 3608 | self.action_ids = action_ids |
| 3609 | else: |
| 3610 | self.action_ids = [] |
| 3611 | return |
| 3612 | |
| 3613 | def pack(self): |
| 3614 | packed = [] |
| 3615 | packed.append(struct.pack("!H", self.type)) |
| 3616 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3617 | packed.append(loxi.generic_util.pack_list(self.action_ids)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3618 | length = sum([len(x) for x in packed]) |
| 3619 | packed[1] = struct.pack("!H", length) |
| 3620 | return ''.join(packed) |
| 3621 | |
| 3622 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3623 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3624 | obj = table_feature_prop_write_actions_miss() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3625 | _type = reader.read("!H")[0] |
| 3626 | assert(_type == 5) |
| 3627 | _length = reader.read("!H")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3628 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 3629 | reader = orig_reader.slice(_length, 4) |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3630 | obj.action_ids = loxi.generic_util.unpack_list(reader, action_id.action_id.unpack) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3631 | return obj |
| 3632 | |
| 3633 | def __eq__(self, other): |
| 3634 | if type(self) != type(other): return False |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3635 | if self.action_ids != other.action_ids: return False |
| 3636 | return True |
| 3637 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3638 | def pretty_print(self, q): |
| 3639 | q.text("table_feature_prop_write_actions_miss {") |
| 3640 | with q.group(): |
| 3641 | with q.indent(2): |
| 3642 | q.breakable() |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3643 | q.text("action_ids = "); |
| 3644 | q.pp(self.action_ids) |
| 3645 | q.breakable() |
| 3646 | q.text('}') |
| 3647 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3648 | table_feature_prop.subtypes[5] = table_feature_prop_write_actions_miss |
| 3649 | |
| 3650 | class table_feature_prop_write_setfield(table_feature_prop): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3651 | type = 12 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3652 | |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3653 | def __init__(self, oxm_ids=None): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3654 | if oxm_ids != None: |
| 3655 | self.oxm_ids = oxm_ids |
| 3656 | else: |
| 3657 | self.oxm_ids = [] |
| 3658 | return |
| 3659 | |
| 3660 | def pack(self): |
| 3661 | packed = [] |
| 3662 | packed.append(struct.pack("!H", self.type)) |
| 3663 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3664 | packed.append(loxi.generic_util.pack_list(self.oxm_ids)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3665 | length = sum([len(x) for x in packed]) |
| 3666 | packed[1] = struct.pack("!H", length) |
| 3667 | return ''.join(packed) |
| 3668 | |
| 3669 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3670 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3671 | obj = table_feature_prop_write_setfield() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3672 | _type = reader.read("!H")[0] |
| 3673 | assert(_type == 12) |
| 3674 | _length = reader.read("!H")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3675 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 3676 | reader = orig_reader.slice(_length, 4) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3677 | obj.oxm_ids = loxi.generic_util.unpack_list(reader, common.uint32.unpack) |
| 3678 | return obj |
| 3679 | |
| 3680 | def __eq__(self, other): |
| 3681 | if type(self) != type(other): return False |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3682 | if self.oxm_ids != other.oxm_ids: return False |
| 3683 | return True |
| 3684 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3685 | def pretty_print(self, q): |
| 3686 | q.text("table_feature_prop_write_setfield {") |
| 3687 | with q.group(): |
| 3688 | with q.indent(2): |
| 3689 | q.breakable() |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3690 | q.text("oxm_ids = "); |
| 3691 | q.pp(self.oxm_ids) |
| 3692 | q.breakable() |
| 3693 | q.text('}') |
| 3694 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3695 | table_feature_prop.subtypes[12] = table_feature_prop_write_setfield |
| 3696 | |
| 3697 | class table_feature_prop_write_setfield_miss(table_feature_prop): |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3698 | type = 13 |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3699 | |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3700 | def __init__(self, oxm_ids=None): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3701 | if oxm_ids != None: |
| 3702 | self.oxm_ids = oxm_ids |
| 3703 | else: |
| 3704 | self.oxm_ids = [] |
| 3705 | return |
| 3706 | |
| 3707 | def pack(self): |
| 3708 | packed = [] |
| 3709 | packed.append(struct.pack("!H", self.type)) |
| 3710 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 1 |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3711 | packed.append(loxi.generic_util.pack_list(self.oxm_ids)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3712 | length = sum([len(x) for x in packed]) |
| 3713 | packed[1] = struct.pack("!H", length) |
| 3714 | return ''.join(packed) |
| 3715 | |
| 3716 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3717 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3718 | obj = table_feature_prop_write_setfield_miss() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3719 | _type = reader.read("!H")[0] |
| 3720 | assert(_type == 13) |
| 3721 | _length = reader.read("!H")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3722 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 3723 | reader = orig_reader.slice(_length, 4) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3724 | obj.oxm_ids = loxi.generic_util.unpack_list(reader, common.uint32.unpack) |
| 3725 | return obj |
| 3726 | |
| 3727 | def __eq__(self, other): |
| 3728 | if type(self) != type(other): return False |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3729 | if self.oxm_ids != other.oxm_ids: return False |
| 3730 | return True |
| 3731 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3732 | def pretty_print(self, q): |
| 3733 | q.text("table_feature_prop_write_setfield_miss {") |
| 3734 | with q.group(): |
| 3735 | with q.indent(2): |
| 3736 | q.breakable() |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3737 | q.text("oxm_ids = "); |
| 3738 | q.pp(self.oxm_ids) |
| 3739 | q.breakable() |
| 3740 | q.text('}') |
| 3741 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3742 | table_feature_prop.subtypes[13] = table_feature_prop_write_setfield_miss |
| 3743 | |
| 3744 | class table_features(loxi.OFObject): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3745 | |
| 3746 | def __init__(self, table_id=None, name=None, metadata_match=None, metadata_write=None, config=None, max_entries=None, properties=None): |
| 3747 | if table_id != None: |
| 3748 | self.table_id = table_id |
| 3749 | else: |
| 3750 | self.table_id = 0 |
| 3751 | if name != None: |
| 3752 | self.name = name |
| 3753 | else: |
| 3754 | self.name = "" |
| 3755 | if metadata_match != None: |
| 3756 | self.metadata_match = metadata_match |
| 3757 | else: |
| 3758 | self.metadata_match = 0 |
| 3759 | if metadata_write != None: |
| 3760 | self.metadata_write = metadata_write |
| 3761 | else: |
| 3762 | self.metadata_write = 0 |
| 3763 | if config != None: |
| 3764 | self.config = config |
| 3765 | else: |
| 3766 | self.config = 0 |
| 3767 | if max_entries != None: |
| 3768 | self.max_entries = max_entries |
| 3769 | else: |
| 3770 | self.max_entries = 0 |
| 3771 | if properties != None: |
| 3772 | self.properties = properties |
| 3773 | else: |
| 3774 | self.properties = [] |
| 3775 | return |
| 3776 | |
| 3777 | def pack(self): |
| 3778 | packed = [] |
| 3779 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 0 |
| 3780 | packed.append(struct.pack("!B", self.table_id)) |
| 3781 | packed.append('\x00' * 5) |
| 3782 | packed.append(struct.pack("!32s", self.name)) |
| 3783 | packed.append(struct.pack("!Q", self.metadata_match)) |
| 3784 | packed.append(struct.pack("!Q", self.metadata_write)) |
| 3785 | packed.append(struct.pack("!L", self.config)) |
| 3786 | packed.append(struct.pack("!L", self.max_entries)) |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3787 | packed.append(loxi.generic_util.pack_list(self.properties)) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3788 | length = sum([len(x) for x in packed]) |
| 3789 | packed[0] = struct.pack("!H", length) |
| 3790 | return ''.join(packed) |
| 3791 | |
| 3792 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3793 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3794 | obj = table_features() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3795 | _length = reader.read("!H")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3796 | orig_reader = reader |
Rich Lane | cb18dbd | 2014-12-18 10:02:29 -0800 | [diff] [blame] | 3797 | reader = orig_reader.slice(_length, 2) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3798 | obj.table_id = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3799 | reader.skip(5) |
| 3800 | obj.name = reader.read("!32s")[0].rstrip("\x00") |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3801 | obj.metadata_match = reader.read("!Q")[0] |
| 3802 | obj.metadata_write = reader.read("!Q")[0] |
| 3803 | obj.config = reader.read("!L")[0] |
| 3804 | obj.max_entries = reader.read("!L")[0] |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3805 | obj.properties = loxi.generic_util.unpack_list(reader, common.table_feature_prop.unpack) |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3806 | return obj |
| 3807 | |
| 3808 | def __eq__(self, other): |
| 3809 | if type(self) != type(other): return False |
| 3810 | if self.table_id != other.table_id: return False |
| 3811 | if self.name != other.name: return False |
| 3812 | if self.metadata_match != other.metadata_match: return False |
| 3813 | if self.metadata_write != other.metadata_write: return False |
| 3814 | if self.config != other.config: return False |
| 3815 | if self.max_entries != other.max_entries: return False |
| 3816 | if self.properties != other.properties: return False |
| 3817 | return True |
| 3818 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3819 | def pretty_print(self, q): |
| 3820 | q.text("table_features {") |
| 3821 | with q.group(): |
| 3822 | with q.indent(2): |
| 3823 | q.breakable() |
| 3824 | q.text("table_id = "); |
| 3825 | q.text("%#x" % self.table_id) |
| 3826 | q.text(","); q.breakable() |
| 3827 | q.text("name = "); |
| 3828 | q.pp(self.name) |
| 3829 | q.text(","); q.breakable() |
| 3830 | q.text("metadata_match = "); |
| 3831 | q.text("%#x" % self.metadata_match) |
| 3832 | q.text(","); q.breakable() |
| 3833 | q.text("metadata_write = "); |
| 3834 | q.text("%#x" % self.metadata_write) |
| 3835 | q.text(","); q.breakable() |
| 3836 | q.text("config = "); |
| 3837 | q.text("%#x" % self.config) |
| 3838 | q.text(","); q.breakable() |
| 3839 | q.text("max_entries = "); |
| 3840 | q.text("%#x" % self.max_entries) |
| 3841 | q.text(","); q.breakable() |
| 3842 | q.text("properties = "); |
| 3843 | q.pp(self.properties) |
| 3844 | q.breakable() |
| 3845 | q.text('}') |
| 3846 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3847 | |
| 3848 | class table_stats_entry(loxi.OFObject): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3849 | |
| 3850 | def __init__(self, table_id=None, active_count=None, lookup_count=None, matched_count=None): |
| 3851 | if table_id != None: |
| 3852 | self.table_id = table_id |
| 3853 | else: |
| 3854 | self.table_id = 0 |
| 3855 | if active_count != None: |
| 3856 | self.active_count = active_count |
| 3857 | else: |
| 3858 | self.active_count = 0 |
| 3859 | if lookup_count != None: |
| 3860 | self.lookup_count = lookup_count |
| 3861 | else: |
| 3862 | self.lookup_count = 0 |
| 3863 | if matched_count != None: |
| 3864 | self.matched_count = matched_count |
| 3865 | else: |
| 3866 | self.matched_count = 0 |
| 3867 | return |
| 3868 | |
| 3869 | def pack(self): |
| 3870 | packed = [] |
| 3871 | packed.append(struct.pack("!B", self.table_id)) |
| 3872 | packed.append('\x00' * 3) |
| 3873 | packed.append(struct.pack("!L", self.active_count)) |
| 3874 | packed.append(struct.pack("!Q", self.lookup_count)) |
| 3875 | packed.append(struct.pack("!Q", self.matched_count)) |
| 3876 | return ''.join(packed) |
| 3877 | |
| 3878 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3879 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3880 | obj = table_stats_entry() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3881 | obj.table_id = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3882 | reader.skip(3) |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3883 | obj.active_count = reader.read("!L")[0] |
| 3884 | obj.lookup_count = reader.read("!Q")[0] |
| 3885 | obj.matched_count = reader.read("!Q")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3886 | return obj |
| 3887 | |
| 3888 | def __eq__(self, other): |
| 3889 | if type(self) != type(other): return False |
| 3890 | if self.table_id != other.table_id: return False |
| 3891 | if self.active_count != other.active_count: return False |
| 3892 | if self.lookup_count != other.lookup_count: return False |
| 3893 | if self.matched_count != other.matched_count: return False |
| 3894 | return True |
| 3895 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3896 | def pretty_print(self, q): |
| 3897 | q.text("table_stats_entry {") |
| 3898 | with q.group(): |
| 3899 | with q.indent(2): |
| 3900 | q.breakable() |
| 3901 | q.text("table_id = "); |
| 3902 | q.text("%#x" % self.table_id) |
| 3903 | q.text(","); q.breakable() |
| 3904 | q.text("active_count = "); |
| 3905 | q.text("%#x" % self.active_count) |
| 3906 | q.text(","); q.breakable() |
| 3907 | q.text("lookup_count = "); |
| 3908 | q.text("%#x" % self.lookup_count) |
| 3909 | q.text(","); q.breakable() |
| 3910 | q.text("matched_count = "); |
| 3911 | q.text("%#x" % self.matched_count) |
| 3912 | q.breakable() |
| 3913 | q.text('}') |
| 3914 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3915 | |
| 3916 | class uint32(loxi.OFObject): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3917 | |
| 3918 | def __init__(self, value=None): |
| 3919 | if value != None: |
| 3920 | self.value = value |
| 3921 | else: |
| 3922 | self.value = 0 |
| 3923 | return |
| 3924 | |
| 3925 | def pack(self): |
| 3926 | packed = [] |
| 3927 | packed.append(struct.pack("!L", self.value)) |
| 3928 | return ''.join(packed) |
| 3929 | |
| 3930 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3931 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3932 | obj = uint32() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 3933 | obj.value = reader.read("!L")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3934 | return obj |
| 3935 | |
| 3936 | def __eq__(self, other): |
| 3937 | if type(self) != type(other): return False |
| 3938 | if self.value != other.value: return False |
| 3939 | return True |
| 3940 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3941 | def pretty_print(self, q): |
| 3942 | q.text("uint32 {") |
| 3943 | with q.group(): |
| 3944 | with q.indent(2): |
| 3945 | q.breakable() |
| 3946 | q.text("value = "); |
| 3947 | q.text("%#x" % self.value) |
| 3948 | q.breakable() |
| 3949 | q.text('}') |
| 3950 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 3951 | |
| 3952 | class uint64(loxi.OFObject): |
| 3953 | |
| 3954 | def __init__(self, value=None): |
| 3955 | if value != None: |
| 3956 | self.value = value |
| 3957 | else: |
| 3958 | self.value = 0 |
| 3959 | return |
| 3960 | |
| 3961 | def pack(self): |
| 3962 | packed = [] |
| 3963 | packed.append(struct.pack("!Q", self.value)) |
| 3964 | return ''.join(packed) |
| 3965 | |
| 3966 | @staticmethod |
| 3967 | def unpack(reader): |
| 3968 | obj = uint64() |
| 3969 | obj.value = reader.read("!Q")[0] |
| 3970 | return obj |
| 3971 | |
| 3972 | def __eq__(self, other): |
| 3973 | if type(self) != type(other): return False |
| 3974 | if self.value != other.value: return False |
| 3975 | return True |
| 3976 | |
| 3977 | def pretty_print(self, q): |
| 3978 | q.text("uint64 {") |
| 3979 | with q.group(): |
| 3980 | with q.indent(2): |
| 3981 | q.breakable() |
| 3982 | q.text("value = "); |
| 3983 | q.text("%#x" % self.value) |
| 3984 | q.breakable() |
| 3985 | q.text('}') |
| 3986 | |
| 3987 | |
| 3988 | class uint8(loxi.OFObject): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 3989 | |
| 3990 | def __init__(self, value=None): |
| 3991 | if value != None: |
| 3992 | self.value = value |
| 3993 | else: |
| 3994 | self.value = 0 |
| 3995 | return |
| 3996 | |
| 3997 | def pack(self): |
| 3998 | packed = [] |
| 3999 | packed.append(struct.pack("!B", self.value)) |
| 4000 | return ''.join(packed) |
| 4001 | |
| 4002 | @staticmethod |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4003 | def unpack(reader): |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4004 | obj = uint8() |
Dan Talayco | f620225 | 2013-07-02 01:00:29 -0700 | [diff] [blame] | 4005 | obj.value = reader.read("!B")[0] |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4006 | return obj |
| 4007 | |
| 4008 | def __eq__(self, other): |
| 4009 | if type(self) != type(other): return False |
| 4010 | if self.value != other.value: return False |
| 4011 | return True |
| 4012 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4013 | def pretty_print(self, q): |
| 4014 | q.text("uint8 {") |
| 4015 | with q.group(): |
| 4016 | with q.indent(2): |
| 4017 | q.breakable() |
| 4018 | q.text("value = "); |
| 4019 | q.text("%#x" % self.value) |
| 4020 | q.breakable() |
| 4021 | q.text('}') |
| 4022 | |
| 4023 | |
Rich Lane | 7dcdf02 | 2013-12-11 14:45:27 -0800 | [diff] [blame] | 4024 | |
Rich Lane | c2ee4b8 | 2013-04-24 17:12:38 -0700 | [diff] [blame] | 4025 | match = match_v3 |