Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 1 | # Copyright 2017-present Open Networking Foundation |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | # Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University |
| 15 | # Copyright (c) 2011, 2012 Open Networking Foundation |
| 16 | # Copyright (c) 2012, 2013 Big Switch Networks, Inc. |
| 17 | # See the file LICENSE.pyloxi which should have been included in the source distribution |
| 18 | |
| 19 | # Automatically generated by LOXI from template module.py |
| 20 | # Do not modify |
| 21 | |
| 22 | import struct |
| 23 | import loxi |
| 24 | import util |
| 25 | import loxi.generic_util |
| 26 | |
| 27 | import sys |
| 28 | ofp = sys.modules['loxi.of13'] |
| 29 | |
| 30 | class message(loxi.OFObject): |
| 31 | subtypes = {} |
| 32 | |
| 33 | version = 4 |
| 34 | |
| 35 | def __init__(self, type=None, xid=None): |
| 36 | if type != None: |
| 37 | self.type = type |
| 38 | else: |
| 39 | self.type = 0 |
| 40 | if xid != None: |
| 41 | self.xid = xid |
| 42 | else: |
| 43 | self.xid = None |
| 44 | return |
| 45 | |
| 46 | def pack(self): |
| 47 | packed = [] |
| 48 | packed.append(struct.pack("!B", self.version)) |
| 49 | packed.append(struct.pack("!B", self.type)) |
| 50 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 51 | packed.append(struct.pack("!L", self.xid)) |
| 52 | length = sum([len(x) for x in packed]) |
| 53 | packed[2] = struct.pack("!H", length) |
| 54 | return ''.join(packed) |
| 55 | |
| 56 | @staticmethod |
| 57 | def unpack(reader): |
| 58 | subtype, = reader.peek('B', 1) |
| 59 | subclass = message.subtypes.get(subtype) |
| 60 | if subclass: |
| 61 | return subclass.unpack(reader) |
| 62 | |
| 63 | obj = message() |
| 64 | _version = reader.read("!B")[0] |
| 65 | assert(_version == 4) |
| 66 | obj.type = reader.read("!B")[0] |
| 67 | _length = reader.read("!H")[0] |
| 68 | orig_reader = reader |
| 69 | reader = orig_reader.slice(_length, 4) |
| 70 | obj.xid = reader.read("!L")[0] |
| 71 | return obj |
| 72 | |
| 73 | def __eq__(self, other): |
| 74 | if type(self) != type(other): return False |
| 75 | if self.type != other.type: return False |
| 76 | if self.xid != other.xid: return False |
| 77 | return True |
| 78 | |
| 79 | def pretty_print(self, q): |
| 80 | q.text("message {") |
| 81 | with q.group(): |
| 82 | with q.indent(2): |
| 83 | q.breakable() |
| 84 | q.text("xid = "); |
| 85 | if self.xid != None: |
| 86 | q.text("%#x" % self.xid) |
| 87 | else: |
| 88 | q.text('None') |
| 89 | q.breakable() |
| 90 | q.text('}') |
| 91 | |
| 92 | |
| 93 | class stats_reply(message): |
| 94 | subtypes = {} |
| 95 | |
| 96 | version = 4 |
| 97 | type = 19 |
| 98 | |
| 99 | def __init__(self, xid=None, stats_type=None, flags=None): |
| 100 | if xid != None: |
| 101 | self.xid = xid |
| 102 | else: |
| 103 | self.xid = None |
| 104 | if stats_type != None: |
| 105 | self.stats_type = stats_type |
| 106 | else: |
| 107 | self.stats_type = 0 |
| 108 | if flags != None: |
| 109 | self.flags = flags |
| 110 | else: |
| 111 | self.flags = 0 |
| 112 | return |
| 113 | |
| 114 | def pack(self): |
| 115 | packed = [] |
| 116 | packed.append(struct.pack("!B", self.version)) |
| 117 | packed.append(struct.pack("!B", self.type)) |
| 118 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 119 | packed.append(struct.pack("!L", self.xid)) |
| 120 | packed.append(struct.pack("!H", self.stats_type)) |
| 121 | packed.append(struct.pack("!H", self.flags)) |
| 122 | packed.append('\x00' * 4) |
| 123 | length = sum([len(x) for x in packed]) |
| 124 | packed[2] = struct.pack("!H", length) |
| 125 | return ''.join(packed) |
| 126 | |
| 127 | @staticmethod |
| 128 | def unpack(reader): |
| 129 | subtype, = reader.peek('!H', 8) |
| 130 | subclass = stats_reply.subtypes.get(subtype) |
| 131 | if subclass: |
| 132 | return subclass.unpack(reader) |
| 133 | |
| 134 | obj = stats_reply() |
| 135 | _version = reader.read("!B")[0] |
| 136 | assert(_version == 4) |
| 137 | _type = reader.read("!B")[0] |
| 138 | assert(_type == 19) |
| 139 | _length = reader.read("!H")[0] |
| 140 | orig_reader = reader |
| 141 | reader = orig_reader.slice(_length, 4) |
| 142 | obj.xid = reader.read("!L")[0] |
| 143 | obj.stats_type = reader.read("!H")[0] |
| 144 | obj.flags = reader.read("!H")[0] |
| 145 | reader.skip(4) |
| 146 | return obj |
| 147 | |
| 148 | def __eq__(self, other): |
| 149 | if type(self) != type(other): return False |
| 150 | if self.xid != other.xid: return False |
| 151 | if self.stats_type != other.stats_type: return False |
| 152 | if self.flags != other.flags: return False |
| 153 | return True |
| 154 | |
| 155 | def pretty_print(self, q): |
| 156 | q.text("stats_reply {") |
| 157 | with q.group(): |
| 158 | with q.indent(2): |
| 159 | q.breakable() |
| 160 | q.text("xid = "); |
| 161 | if self.xid != None: |
| 162 | q.text("%#x" % self.xid) |
| 163 | else: |
| 164 | q.text('None') |
| 165 | q.text(","); q.breakable() |
| 166 | q.text("flags = "); |
| 167 | q.text("%#x" % self.flags) |
| 168 | q.breakable() |
| 169 | q.text('}') |
| 170 | |
| 171 | message.subtypes[19] = stats_reply |
| 172 | |
| 173 | class aggregate_stats_reply(stats_reply): |
| 174 | version = 4 |
| 175 | type = 19 |
| 176 | stats_type = 2 |
| 177 | |
| 178 | def __init__(self, xid=None, flags=None, packet_count=None, byte_count=None, flow_count=None): |
| 179 | if xid != None: |
| 180 | self.xid = xid |
| 181 | else: |
| 182 | self.xid = None |
| 183 | if flags != None: |
| 184 | self.flags = flags |
| 185 | else: |
| 186 | self.flags = 0 |
| 187 | if packet_count != None: |
| 188 | self.packet_count = packet_count |
| 189 | else: |
| 190 | self.packet_count = 0 |
| 191 | if byte_count != None: |
| 192 | self.byte_count = byte_count |
| 193 | else: |
| 194 | self.byte_count = 0 |
| 195 | if flow_count != None: |
| 196 | self.flow_count = flow_count |
| 197 | else: |
| 198 | self.flow_count = 0 |
| 199 | return |
| 200 | |
| 201 | def pack(self): |
| 202 | packed = [] |
| 203 | packed.append(struct.pack("!B", self.version)) |
| 204 | packed.append(struct.pack("!B", self.type)) |
| 205 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 206 | packed.append(struct.pack("!L", self.xid)) |
| 207 | packed.append(struct.pack("!H", self.stats_type)) |
| 208 | packed.append(struct.pack("!H", self.flags)) |
| 209 | packed.append('\x00' * 4) |
| 210 | packed.append(struct.pack("!Q", self.packet_count)) |
| 211 | packed.append(struct.pack("!Q", self.byte_count)) |
| 212 | packed.append(struct.pack("!L", self.flow_count)) |
| 213 | packed.append('\x00' * 4) |
| 214 | length = sum([len(x) for x in packed]) |
| 215 | packed[2] = struct.pack("!H", length) |
| 216 | return ''.join(packed) |
| 217 | |
| 218 | @staticmethod |
| 219 | def unpack(reader): |
| 220 | obj = aggregate_stats_reply() |
| 221 | _version = reader.read("!B")[0] |
| 222 | assert(_version == 4) |
| 223 | _type = reader.read("!B")[0] |
| 224 | assert(_type == 19) |
| 225 | _length = reader.read("!H")[0] |
| 226 | orig_reader = reader |
| 227 | reader = orig_reader.slice(_length, 4) |
| 228 | obj.xid = reader.read("!L")[0] |
| 229 | _stats_type = reader.read("!H")[0] |
| 230 | assert(_stats_type == 2) |
| 231 | obj.flags = reader.read("!H")[0] |
| 232 | reader.skip(4) |
| 233 | obj.packet_count = reader.read("!Q")[0] |
| 234 | obj.byte_count = reader.read("!Q")[0] |
| 235 | obj.flow_count = reader.read("!L")[0] |
| 236 | reader.skip(4) |
| 237 | return obj |
| 238 | |
| 239 | def __eq__(self, other): |
| 240 | if type(self) != type(other): return False |
| 241 | if self.xid != other.xid: return False |
| 242 | if self.flags != other.flags: return False |
| 243 | if self.packet_count != other.packet_count: return False |
| 244 | if self.byte_count != other.byte_count: return False |
| 245 | if self.flow_count != other.flow_count: return False |
| 246 | return True |
| 247 | |
| 248 | def pretty_print(self, q): |
| 249 | q.text("aggregate_stats_reply {") |
| 250 | with q.group(): |
| 251 | with q.indent(2): |
| 252 | q.breakable() |
| 253 | q.text("xid = "); |
| 254 | if self.xid != None: |
| 255 | q.text("%#x" % self.xid) |
| 256 | else: |
| 257 | q.text('None') |
| 258 | q.text(","); q.breakable() |
| 259 | q.text("flags = "); |
| 260 | q.text("%#x" % self.flags) |
| 261 | q.text(","); q.breakable() |
| 262 | q.text("packet_count = "); |
| 263 | q.text("%#x" % self.packet_count) |
| 264 | q.text(","); q.breakable() |
| 265 | q.text("byte_count = "); |
| 266 | q.text("%#x" % self.byte_count) |
| 267 | q.text(","); q.breakable() |
| 268 | q.text("flow_count = "); |
| 269 | q.text("%#x" % self.flow_count) |
| 270 | q.breakable() |
| 271 | q.text('}') |
| 272 | |
| 273 | stats_reply.subtypes[2] = aggregate_stats_reply |
| 274 | |
| 275 | class stats_request(message): |
| 276 | subtypes = {} |
| 277 | |
| 278 | version = 4 |
| 279 | type = 18 |
| 280 | |
| 281 | def __init__(self, xid=None, stats_type=None, flags=None): |
| 282 | if xid != None: |
| 283 | self.xid = xid |
| 284 | else: |
| 285 | self.xid = None |
| 286 | if stats_type != None: |
| 287 | self.stats_type = stats_type |
| 288 | else: |
| 289 | self.stats_type = 0 |
| 290 | if flags != None: |
| 291 | self.flags = flags |
| 292 | else: |
| 293 | self.flags = 0 |
| 294 | return |
| 295 | |
| 296 | def pack(self): |
| 297 | packed = [] |
| 298 | packed.append(struct.pack("!B", self.version)) |
| 299 | packed.append(struct.pack("!B", self.type)) |
| 300 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 301 | packed.append(struct.pack("!L", self.xid)) |
| 302 | packed.append(struct.pack("!H", self.stats_type)) |
| 303 | packed.append(struct.pack("!H", self.flags)) |
| 304 | packed.append('\x00' * 4) |
| 305 | length = sum([len(x) for x in packed]) |
| 306 | packed[2] = struct.pack("!H", length) |
| 307 | return ''.join(packed) |
| 308 | |
| 309 | @staticmethod |
| 310 | def unpack(reader): |
| 311 | subtype, = reader.peek('!H', 8) |
| 312 | subclass = stats_request.subtypes.get(subtype) |
| 313 | if subclass: |
| 314 | return subclass.unpack(reader) |
| 315 | |
| 316 | obj = stats_request() |
| 317 | _version = reader.read("!B")[0] |
| 318 | assert(_version == 4) |
| 319 | _type = reader.read("!B")[0] |
| 320 | assert(_type == 18) |
| 321 | _length = reader.read("!H")[0] |
| 322 | orig_reader = reader |
| 323 | reader = orig_reader.slice(_length, 4) |
| 324 | obj.xid = reader.read("!L")[0] |
| 325 | obj.stats_type = reader.read("!H")[0] |
| 326 | obj.flags = reader.read("!H")[0] |
| 327 | reader.skip(4) |
| 328 | return obj |
| 329 | |
| 330 | def __eq__(self, other): |
| 331 | if type(self) != type(other): return False |
| 332 | if self.xid != other.xid: return False |
| 333 | if self.stats_type != other.stats_type: return False |
| 334 | if self.flags != other.flags: return False |
| 335 | return True |
| 336 | |
| 337 | def pretty_print(self, q): |
| 338 | q.text("stats_request {") |
| 339 | with q.group(): |
| 340 | with q.indent(2): |
| 341 | q.breakable() |
| 342 | q.text("xid = "); |
| 343 | if self.xid != None: |
| 344 | q.text("%#x" % self.xid) |
| 345 | else: |
| 346 | q.text('None') |
| 347 | q.text(","); q.breakable() |
| 348 | q.text("flags = "); |
| 349 | q.text("%#x" % self.flags) |
| 350 | q.breakable() |
| 351 | q.text('}') |
| 352 | |
| 353 | message.subtypes[18] = stats_request |
| 354 | |
| 355 | class aggregate_stats_request(stats_request): |
| 356 | version = 4 |
| 357 | type = 18 |
| 358 | stats_type = 2 |
| 359 | |
| 360 | def __init__(self, xid=None, flags=None, table_id=None, out_port=None, out_group=None, cookie=None, cookie_mask=None, match=None): |
| 361 | if xid != None: |
| 362 | self.xid = xid |
| 363 | else: |
| 364 | self.xid = None |
| 365 | if flags != None: |
| 366 | self.flags = flags |
| 367 | else: |
| 368 | self.flags = 0 |
| 369 | if table_id != None: |
| 370 | self.table_id = table_id |
| 371 | else: |
| 372 | self.table_id = 0 |
| 373 | if out_port != None: |
| 374 | self.out_port = out_port |
| 375 | else: |
| 376 | self.out_port = 0 |
| 377 | if out_group != None: |
| 378 | self.out_group = out_group |
| 379 | else: |
| 380 | self.out_group = 0 |
| 381 | if cookie != None: |
| 382 | self.cookie = cookie |
| 383 | else: |
| 384 | self.cookie = 0 |
| 385 | if cookie_mask != None: |
| 386 | self.cookie_mask = cookie_mask |
| 387 | else: |
| 388 | self.cookie_mask = 0 |
| 389 | if match != None: |
| 390 | self.match = match |
| 391 | else: |
| 392 | self.match = ofp.match() |
| 393 | return |
| 394 | |
| 395 | def pack(self): |
| 396 | packed = [] |
| 397 | packed.append(struct.pack("!B", self.version)) |
| 398 | packed.append(struct.pack("!B", self.type)) |
| 399 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 400 | packed.append(struct.pack("!L", self.xid)) |
| 401 | packed.append(struct.pack("!H", self.stats_type)) |
| 402 | packed.append(struct.pack("!H", self.flags)) |
| 403 | packed.append('\x00' * 4) |
| 404 | packed.append(struct.pack("!B", self.table_id)) |
| 405 | packed.append('\x00' * 3) |
| 406 | packed.append(util.pack_port_no(self.out_port)) |
| 407 | packed.append(struct.pack("!L", self.out_group)) |
| 408 | packed.append('\x00' * 4) |
| 409 | packed.append(struct.pack("!Q", self.cookie)) |
| 410 | packed.append(struct.pack("!Q", self.cookie_mask)) |
| 411 | packed.append(self.match.pack()) |
| 412 | length = sum([len(x) for x in packed]) |
| 413 | packed[2] = struct.pack("!H", length) |
| 414 | return ''.join(packed) |
| 415 | |
| 416 | @staticmethod |
| 417 | def unpack(reader): |
| 418 | obj = aggregate_stats_request() |
| 419 | _version = reader.read("!B")[0] |
| 420 | assert(_version == 4) |
| 421 | _type = reader.read("!B")[0] |
| 422 | assert(_type == 18) |
| 423 | _length = reader.read("!H")[0] |
| 424 | orig_reader = reader |
| 425 | reader = orig_reader.slice(_length, 4) |
| 426 | obj.xid = reader.read("!L")[0] |
| 427 | _stats_type = reader.read("!H")[0] |
| 428 | assert(_stats_type == 2) |
| 429 | obj.flags = reader.read("!H")[0] |
| 430 | reader.skip(4) |
| 431 | obj.table_id = reader.read("!B")[0] |
| 432 | reader.skip(3) |
| 433 | obj.out_port = util.unpack_port_no(reader) |
| 434 | obj.out_group = reader.read("!L")[0] |
| 435 | reader.skip(4) |
| 436 | obj.cookie = reader.read("!Q")[0] |
| 437 | obj.cookie_mask = reader.read("!Q")[0] |
| 438 | obj.match = ofp.match.unpack(reader) |
| 439 | return obj |
| 440 | |
| 441 | def __eq__(self, other): |
| 442 | if type(self) != type(other): return False |
| 443 | if self.xid != other.xid: return False |
| 444 | if self.flags != other.flags: return False |
| 445 | if self.table_id != other.table_id: return False |
| 446 | if self.out_port != other.out_port: return False |
| 447 | if self.out_group != other.out_group: return False |
| 448 | if self.cookie != other.cookie: return False |
| 449 | if self.cookie_mask != other.cookie_mask: return False |
| 450 | if self.match != other.match: return False |
| 451 | return True |
| 452 | |
| 453 | def pretty_print(self, q): |
| 454 | q.text("aggregate_stats_request {") |
| 455 | with q.group(): |
| 456 | with q.indent(2): |
| 457 | q.breakable() |
| 458 | q.text("xid = "); |
| 459 | if self.xid != None: |
| 460 | q.text("%#x" % self.xid) |
| 461 | else: |
| 462 | q.text('None') |
| 463 | q.text(","); q.breakable() |
| 464 | q.text("flags = "); |
| 465 | q.text("%#x" % self.flags) |
| 466 | q.text(","); q.breakable() |
| 467 | q.text("table_id = "); |
| 468 | q.text("%#x" % self.table_id) |
| 469 | q.text(","); q.breakable() |
| 470 | q.text("out_port = "); |
| 471 | q.text(util.pretty_port(self.out_port)) |
| 472 | q.text(","); q.breakable() |
| 473 | q.text("out_group = "); |
| 474 | q.text("%#x" % self.out_group) |
| 475 | q.text(","); q.breakable() |
| 476 | q.text("cookie = "); |
| 477 | q.text("%#x" % self.cookie) |
| 478 | q.text(","); q.breakable() |
| 479 | q.text("cookie_mask = "); |
| 480 | q.text("%#x" % self.cookie_mask) |
| 481 | q.text(","); q.breakable() |
| 482 | q.text("match = "); |
| 483 | q.pp(self.match) |
| 484 | q.breakable() |
| 485 | q.text('}') |
| 486 | |
| 487 | stats_request.subtypes[2] = aggregate_stats_request |
| 488 | |
| 489 | class async_get_reply(message): |
| 490 | version = 4 |
| 491 | type = 27 |
| 492 | |
| 493 | def __init__(self, xid=None, packet_in_mask_equal_master=None, packet_in_mask_slave=None, port_status_mask_equal_master=None, port_status_mask_slave=None, flow_removed_mask_equal_master=None, flow_removed_mask_slave=None): |
| 494 | if xid != None: |
| 495 | self.xid = xid |
| 496 | else: |
| 497 | self.xid = None |
| 498 | if packet_in_mask_equal_master != None: |
| 499 | self.packet_in_mask_equal_master = packet_in_mask_equal_master |
| 500 | else: |
| 501 | self.packet_in_mask_equal_master = 0 |
| 502 | if packet_in_mask_slave != None: |
| 503 | self.packet_in_mask_slave = packet_in_mask_slave |
| 504 | else: |
| 505 | self.packet_in_mask_slave = 0 |
| 506 | if port_status_mask_equal_master != None: |
| 507 | self.port_status_mask_equal_master = port_status_mask_equal_master |
| 508 | else: |
| 509 | self.port_status_mask_equal_master = 0 |
| 510 | if port_status_mask_slave != None: |
| 511 | self.port_status_mask_slave = port_status_mask_slave |
| 512 | else: |
| 513 | self.port_status_mask_slave = 0 |
| 514 | if flow_removed_mask_equal_master != None: |
| 515 | self.flow_removed_mask_equal_master = flow_removed_mask_equal_master |
| 516 | else: |
| 517 | self.flow_removed_mask_equal_master = 0 |
| 518 | if flow_removed_mask_slave != None: |
| 519 | self.flow_removed_mask_slave = flow_removed_mask_slave |
| 520 | else: |
| 521 | self.flow_removed_mask_slave = 0 |
| 522 | return |
| 523 | |
| 524 | def pack(self): |
| 525 | packed = [] |
| 526 | packed.append(struct.pack("!B", self.version)) |
| 527 | packed.append(struct.pack("!B", self.type)) |
| 528 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 529 | packed.append(struct.pack("!L", self.xid)) |
| 530 | packed.append(struct.pack("!L", self.packet_in_mask_equal_master)) |
| 531 | packed.append(struct.pack("!L", self.packet_in_mask_slave)) |
| 532 | packed.append(struct.pack("!L", self.port_status_mask_equal_master)) |
| 533 | packed.append(struct.pack("!L", self.port_status_mask_slave)) |
| 534 | packed.append(struct.pack("!L", self.flow_removed_mask_equal_master)) |
| 535 | packed.append(struct.pack("!L", self.flow_removed_mask_slave)) |
| 536 | length = sum([len(x) for x in packed]) |
| 537 | packed[2] = struct.pack("!H", length) |
| 538 | return ''.join(packed) |
| 539 | |
| 540 | @staticmethod |
| 541 | def unpack(reader): |
| 542 | obj = async_get_reply() |
| 543 | _version = reader.read("!B")[0] |
| 544 | assert(_version == 4) |
| 545 | _type = reader.read("!B")[0] |
| 546 | assert(_type == 27) |
| 547 | _length = reader.read("!H")[0] |
| 548 | orig_reader = reader |
| 549 | reader = orig_reader.slice(_length, 4) |
| 550 | obj.xid = reader.read("!L")[0] |
| 551 | obj.packet_in_mask_equal_master = reader.read("!L")[0] |
| 552 | obj.packet_in_mask_slave = reader.read("!L")[0] |
| 553 | obj.port_status_mask_equal_master = reader.read("!L")[0] |
| 554 | obj.port_status_mask_slave = reader.read("!L")[0] |
| 555 | obj.flow_removed_mask_equal_master = reader.read("!L")[0] |
| 556 | obj.flow_removed_mask_slave = reader.read("!L")[0] |
| 557 | return obj |
| 558 | |
| 559 | def __eq__(self, other): |
| 560 | if type(self) != type(other): return False |
| 561 | if self.xid != other.xid: return False |
| 562 | if self.packet_in_mask_equal_master != other.packet_in_mask_equal_master: return False |
| 563 | if self.packet_in_mask_slave != other.packet_in_mask_slave: return False |
| 564 | if self.port_status_mask_equal_master != other.port_status_mask_equal_master: return False |
| 565 | if self.port_status_mask_slave != other.port_status_mask_slave: return False |
| 566 | if self.flow_removed_mask_equal_master != other.flow_removed_mask_equal_master: return False |
| 567 | if self.flow_removed_mask_slave != other.flow_removed_mask_slave: return False |
| 568 | return True |
| 569 | |
| 570 | def pretty_print(self, q): |
| 571 | q.text("async_get_reply {") |
| 572 | with q.group(): |
| 573 | with q.indent(2): |
| 574 | q.breakable() |
| 575 | q.text("xid = "); |
| 576 | if self.xid != None: |
| 577 | q.text("%#x" % self.xid) |
| 578 | else: |
| 579 | q.text('None') |
| 580 | q.text(","); q.breakable() |
| 581 | q.text("packet_in_mask_equal_master = "); |
| 582 | q.text("%#x" % self.packet_in_mask_equal_master) |
| 583 | q.text(","); q.breakable() |
| 584 | q.text("packet_in_mask_slave = "); |
| 585 | q.text("%#x" % self.packet_in_mask_slave) |
| 586 | q.text(","); q.breakable() |
| 587 | q.text("port_status_mask_equal_master = "); |
| 588 | q.text("%#x" % self.port_status_mask_equal_master) |
| 589 | q.text(","); q.breakable() |
| 590 | q.text("port_status_mask_slave = "); |
| 591 | q.text("%#x" % self.port_status_mask_slave) |
| 592 | q.text(","); q.breakable() |
| 593 | q.text("flow_removed_mask_equal_master = "); |
| 594 | q.text("%#x" % self.flow_removed_mask_equal_master) |
| 595 | q.text(","); q.breakable() |
| 596 | q.text("flow_removed_mask_slave = "); |
| 597 | q.text("%#x" % self.flow_removed_mask_slave) |
| 598 | q.breakable() |
| 599 | q.text('}') |
| 600 | |
| 601 | message.subtypes[27] = async_get_reply |
| 602 | |
| 603 | class async_get_request(message): |
| 604 | version = 4 |
| 605 | type = 26 |
| 606 | |
| 607 | def __init__(self, xid=None): |
| 608 | if xid != None: |
| 609 | self.xid = xid |
| 610 | else: |
| 611 | self.xid = None |
| 612 | return |
| 613 | |
| 614 | def pack(self): |
| 615 | packed = [] |
| 616 | packed.append(struct.pack("!B", self.version)) |
| 617 | packed.append(struct.pack("!B", self.type)) |
| 618 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 619 | packed.append(struct.pack("!L", self.xid)) |
| 620 | length = sum([len(x) for x in packed]) |
| 621 | packed[2] = struct.pack("!H", length) |
| 622 | return ''.join(packed) |
| 623 | |
| 624 | @staticmethod |
| 625 | def unpack(reader): |
| 626 | obj = async_get_request() |
| 627 | _version = reader.read("!B")[0] |
| 628 | assert(_version == 4) |
| 629 | _type = reader.read("!B")[0] |
| 630 | assert(_type == 26) |
| 631 | _length = reader.read("!H")[0] |
| 632 | orig_reader = reader |
| 633 | reader = orig_reader.slice(_length, 4) |
| 634 | obj.xid = reader.read("!L")[0] |
| 635 | return obj |
| 636 | |
| 637 | def __eq__(self, other): |
| 638 | if type(self) != type(other): return False |
| 639 | if self.xid != other.xid: return False |
| 640 | return True |
| 641 | |
| 642 | def pretty_print(self, q): |
| 643 | q.text("async_get_request {") |
| 644 | with q.group(): |
| 645 | with q.indent(2): |
| 646 | q.breakable() |
| 647 | q.text("xid = "); |
| 648 | if self.xid != None: |
| 649 | q.text("%#x" % self.xid) |
| 650 | else: |
| 651 | q.text('None') |
| 652 | q.breakable() |
| 653 | q.text('}') |
| 654 | |
| 655 | message.subtypes[26] = async_get_request |
| 656 | |
| 657 | class async_set(message): |
| 658 | version = 4 |
| 659 | type = 28 |
| 660 | |
| 661 | def __init__(self, xid=None, packet_in_mask_equal_master=None, packet_in_mask_slave=None, port_status_mask_equal_master=None, port_status_mask_slave=None, flow_removed_mask_equal_master=None, flow_removed_mask_slave=None): |
| 662 | if xid != None: |
| 663 | self.xid = xid |
| 664 | else: |
| 665 | self.xid = None |
| 666 | if packet_in_mask_equal_master != None: |
| 667 | self.packet_in_mask_equal_master = packet_in_mask_equal_master |
| 668 | else: |
| 669 | self.packet_in_mask_equal_master = 0 |
| 670 | if packet_in_mask_slave != None: |
| 671 | self.packet_in_mask_slave = packet_in_mask_slave |
| 672 | else: |
| 673 | self.packet_in_mask_slave = 0 |
| 674 | if port_status_mask_equal_master != None: |
| 675 | self.port_status_mask_equal_master = port_status_mask_equal_master |
| 676 | else: |
| 677 | self.port_status_mask_equal_master = 0 |
| 678 | if port_status_mask_slave != None: |
| 679 | self.port_status_mask_slave = port_status_mask_slave |
| 680 | else: |
| 681 | self.port_status_mask_slave = 0 |
| 682 | if flow_removed_mask_equal_master != None: |
| 683 | self.flow_removed_mask_equal_master = flow_removed_mask_equal_master |
| 684 | else: |
| 685 | self.flow_removed_mask_equal_master = 0 |
| 686 | if flow_removed_mask_slave != None: |
| 687 | self.flow_removed_mask_slave = flow_removed_mask_slave |
| 688 | else: |
| 689 | self.flow_removed_mask_slave = 0 |
| 690 | return |
| 691 | |
| 692 | def pack(self): |
| 693 | packed = [] |
| 694 | packed.append(struct.pack("!B", self.version)) |
| 695 | packed.append(struct.pack("!B", self.type)) |
| 696 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 697 | packed.append(struct.pack("!L", self.xid)) |
| 698 | packed.append(struct.pack("!L", self.packet_in_mask_equal_master)) |
| 699 | packed.append(struct.pack("!L", self.packet_in_mask_slave)) |
| 700 | packed.append(struct.pack("!L", self.port_status_mask_equal_master)) |
| 701 | packed.append(struct.pack("!L", self.port_status_mask_slave)) |
| 702 | packed.append(struct.pack("!L", self.flow_removed_mask_equal_master)) |
| 703 | packed.append(struct.pack("!L", self.flow_removed_mask_slave)) |
| 704 | length = sum([len(x) for x in packed]) |
| 705 | packed[2] = struct.pack("!H", length) |
| 706 | return ''.join(packed) |
| 707 | |
| 708 | @staticmethod |
| 709 | def unpack(reader): |
| 710 | obj = async_set() |
| 711 | _version = reader.read("!B")[0] |
| 712 | assert(_version == 4) |
| 713 | _type = reader.read("!B")[0] |
| 714 | assert(_type == 28) |
| 715 | _length = reader.read("!H")[0] |
| 716 | orig_reader = reader |
| 717 | reader = orig_reader.slice(_length, 4) |
| 718 | obj.xid = reader.read("!L")[0] |
| 719 | obj.packet_in_mask_equal_master = reader.read("!L")[0] |
| 720 | obj.packet_in_mask_slave = reader.read("!L")[0] |
| 721 | obj.port_status_mask_equal_master = reader.read("!L")[0] |
| 722 | obj.port_status_mask_slave = reader.read("!L")[0] |
| 723 | obj.flow_removed_mask_equal_master = reader.read("!L")[0] |
| 724 | obj.flow_removed_mask_slave = reader.read("!L")[0] |
| 725 | return obj |
| 726 | |
| 727 | def __eq__(self, other): |
| 728 | if type(self) != type(other): return False |
| 729 | if self.xid != other.xid: return False |
| 730 | if self.packet_in_mask_equal_master != other.packet_in_mask_equal_master: return False |
| 731 | if self.packet_in_mask_slave != other.packet_in_mask_slave: return False |
| 732 | if self.port_status_mask_equal_master != other.port_status_mask_equal_master: return False |
| 733 | if self.port_status_mask_slave != other.port_status_mask_slave: return False |
| 734 | if self.flow_removed_mask_equal_master != other.flow_removed_mask_equal_master: return False |
| 735 | if self.flow_removed_mask_slave != other.flow_removed_mask_slave: return False |
| 736 | return True |
| 737 | |
| 738 | def pretty_print(self, q): |
| 739 | q.text("async_set {") |
| 740 | with q.group(): |
| 741 | with q.indent(2): |
| 742 | q.breakable() |
| 743 | q.text("xid = "); |
| 744 | if self.xid != None: |
| 745 | q.text("%#x" % self.xid) |
| 746 | else: |
| 747 | q.text('None') |
| 748 | q.text(","); q.breakable() |
| 749 | q.text("packet_in_mask_equal_master = "); |
| 750 | q.text("%#x" % self.packet_in_mask_equal_master) |
| 751 | q.text(","); q.breakable() |
| 752 | q.text("packet_in_mask_slave = "); |
| 753 | q.text("%#x" % self.packet_in_mask_slave) |
| 754 | q.text(","); q.breakable() |
| 755 | q.text("port_status_mask_equal_master = "); |
| 756 | q.text("%#x" % self.port_status_mask_equal_master) |
| 757 | q.text(","); q.breakable() |
| 758 | q.text("port_status_mask_slave = "); |
| 759 | q.text("%#x" % self.port_status_mask_slave) |
| 760 | q.text(","); q.breakable() |
| 761 | q.text("flow_removed_mask_equal_master = "); |
| 762 | q.text("%#x" % self.flow_removed_mask_equal_master) |
| 763 | q.text(","); q.breakable() |
| 764 | q.text("flow_removed_mask_slave = "); |
| 765 | q.text("%#x" % self.flow_removed_mask_slave) |
| 766 | q.breakable() |
| 767 | q.text('}') |
| 768 | |
| 769 | message.subtypes[28] = async_set |
| 770 | |
| 771 | class error_msg(message): |
| 772 | subtypes = {} |
| 773 | |
| 774 | version = 4 |
| 775 | type = 1 |
| 776 | |
| 777 | def __init__(self, xid=None, err_type=None): |
| 778 | if xid != None: |
| 779 | self.xid = xid |
| 780 | else: |
| 781 | self.xid = None |
| 782 | if err_type != None: |
| 783 | self.err_type = err_type |
| 784 | else: |
| 785 | self.err_type = 0 |
| 786 | return |
| 787 | |
| 788 | def pack(self): |
| 789 | packed = [] |
| 790 | packed.append(struct.pack("!B", self.version)) |
| 791 | packed.append(struct.pack("!B", self.type)) |
| 792 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 793 | packed.append(struct.pack("!L", self.xid)) |
| 794 | packed.append(struct.pack("!H", self.err_type)) |
| 795 | length = sum([len(x) for x in packed]) |
| 796 | packed[2] = struct.pack("!H", length) |
| 797 | return ''.join(packed) |
| 798 | |
| 799 | @staticmethod |
| 800 | def unpack(reader): |
| 801 | subtype, = reader.peek('!H', 8) |
| 802 | subclass = error_msg.subtypes.get(subtype) |
| 803 | if subclass: |
| 804 | return subclass.unpack(reader) |
| 805 | |
| 806 | obj = error_msg() |
| 807 | _version = reader.read("!B")[0] |
| 808 | assert(_version == 4) |
| 809 | _type = reader.read("!B")[0] |
| 810 | assert(_type == 1) |
| 811 | _length = reader.read("!H")[0] |
| 812 | orig_reader = reader |
| 813 | reader = orig_reader.slice(_length, 4) |
| 814 | obj.xid = reader.read("!L")[0] |
| 815 | obj.err_type = reader.read("!H")[0] |
| 816 | return obj |
| 817 | |
| 818 | def __eq__(self, other): |
| 819 | if type(self) != type(other): return False |
| 820 | if self.xid != other.xid: return False |
| 821 | if self.err_type != other.err_type: return False |
| 822 | return True |
| 823 | |
| 824 | def pretty_print(self, q): |
| 825 | q.text("error_msg {") |
| 826 | with q.group(): |
| 827 | with q.indent(2): |
| 828 | q.breakable() |
| 829 | q.text("xid = "); |
| 830 | if self.xid != None: |
| 831 | q.text("%#x" % self.xid) |
| 832 | else: |
| 833 | q.text('None') |
| 834 | q.breakable() |
| 835 | q.text('}') |
| 836 | |
| 837 | message.subtypes[1] = error_msg |
| 838 | |
| 839 | class bad_action_error_msg(error_msg): |
| 840 | version = 4 |
| 841 | type = 1 |
| 842 | err_type = 2 |
| 843 | |
| 844 | def __init__(self, xid=None, code=None, data=None): |
| 845 | if xid != None: |
| 846 | self.xid = xid |
| 847 | else: |
| 848 | self.xid = None |
| 849 | if code != None: |
| 850 | self.code = code |
| 851 | else: |
| 852 | self.code = 0 |
| 853 | if data != None: |
| 854 | self.data = data |
| 855 | else: |
| 856 | self.data = '' |
| 857 | return |
| 858 | |
| 859 | def pack(self): |
| 860 | packed = [] |
| 861 | packed.append(struct.pack("!B", self.version)) |
| 862 | packed.append(struct.pack("!B", self.type)) |
| 863 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 864 | packed.append(struct.pack("!L", self.xid)) |
| 865 | packed.append(struct.pack("!H", self.err_type)) |
| 866 | packed.append(struct.pack("!H", self.code)) |
| 867 | packed.append(self.data) |
| 868 | length = sum([len(x) for x in packed]) |
| 869 | packed[2] = struct.pack("!H", length) |
| 870 | return ''.join(packed) |
| 871 | |
| 872 | @staticmethod |
| 873 | def unpack(reader): |
| 874 | obj = bad_action_error_msg() |
| 875 | _version = reader.read("!B")[0] |
| 876 | assert(_version == 4) |
| 877 | _type = reader.read("!B")[0] |
| 878 | assert(_type == 1) |
| 879 | _length = reader.read("!H")[0] |
| 880 | orig_reader = reader |
| 881 | reader = orig_reader.slice(_length, 4) |
| 882 | obj.xid = reader.read("!L")[0] |
| 883 | _err_type = reader.read("!H")[0] |
| 884 | assert(_err_type == 2) |
| 885 | obj.code = reader.read("!H")[0] |
| 886 | obj.data = str(reader.read_all()) |
| 887 | return obj |
| 888 | |
| 889 | def __eq__(self, other): |
| 890 | if type(self) != type(other): return False |
| 891 | if self.xid != other.xid: return False |
| 892 | if self.code != other.code: return False |
| 893 | if self.data != other.data: return False |
| 894 | return True |
| 895 | |
| 896 | def pretty_print(self, q): |
| 897 | q.text("bad_action_error_msg {") |
| 898 | with q.group(): |
| 899 | with q.indent(2): |
| 900 | q.breakable() |
| 901 | q.text("xid = "); |
| 902 | if self.xid != None: |
| 903 | q.text("%#x" % self.xid) |
| 904 | else: |
| 905 | q.text('None') |
| 906 | q.text(","); q.breakable() |
| 907 | q.text("code = "); |
| 908 | q.text("%#x" % self.code) |
| 909 | q.text(","); q.breakable() |
| 910 | q.text("data = "); |
| 911 | q.pp(self.data) |
| 912 | q.breakable() |
| 913 | q.text('}') |
| 914 | |
| 915 | error_msg.subtypes[2] = bad_action_error_msg |
| 916 | |
| 917 | class bad_instruction_error_msg(error_msg): |
| 918 | version = 4 |
| 919 | type = 1 |
| 920 | err_type = 3 |
| 921 | |
| 922 | def __init__(self, xid=None, code=None, data=None): |
| 923 | if xid != None: |
| 924 | self.xid = xid |
| 925 | else: |
| 926 | self.xid = None |
| 927 | if code != None: |
| 928 | self.code = code |
| 929 | else: |
| 930 | self.code = 0 |
| 931 | if data != None: |
| 932 | self.data = data |
| 933 | else: |
| 934 | self.data = '' |
| 935 | return |
| 936 | |
| 937 | def pack(self): |
| 938 | packed = [] |
| 939 | packed.append(struct.pack("!B", self.version)) |
| 940 | packed.append(struct.pack("!B", self.type)) |
| 941 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 942 | packed.append(struct.pack("!L", self.xid)) |
| 943 | packed.append(struct.pack("!H", self.err_type)) |
| 944 | packed.append(struct.pack("!H", self.code)) |
| 945 | packed.append(self.data) |
| 946 | length = sum([len(x) for x in packed]) |
| 947 | packed[2] = struct.pack("!H", length) |
| 948 | return ''.join(packed) |
| 949 | |
| 950 | @staticmethod |
| 951 | def unpack(reader): |
| 952 | obj = bad_instruction_error_msg() |
| 953 | _version = reader.read("!B")[0] |
| 954 | assert(_version == 4) |
| 955 | _type = reader.read("!B")[0] |
| 956 | assert(_type == 1) |
| 957 | _length = reader.read("!H")[0] |
| 958 | orig_reader = reader |
| 959 | reader = orig_reader.slice(_length, 4) |
| 960 | obj.xid = reader.read("!L")[0] |
| 961 | _err_type = reader.read("!H")[0] |
| 962 | assert(_err_type == 3) |
| 963 | obj.code = reader.read("!H")[0] |
| 964 | obj.data = str(reader.read_all()) |
| 965 | return obj |
| 966 | |
| 967 | def __eq__(self, other): |
| 968 | if type(self) != type(other): return False |
| 969 | if self.xid != other.xid: return False |
| 970 | if self.code != other.code: return False |
| 971 | if self.data != other.data: return False |
| 972 | return True |
| 973 | |
| 974 | def pretty_print(self, q): |
| 975 | q.text("bad_instruction_error_msg {") |
| 976 | with q.group(): |
| 977 | with q.indent(2): |
| 978 | q.breakable() |
| 979 | q.text("xid = "); |
| 980 | if self.xid != None: |
| 981 | q.text("%#x" % self.xid) |
| 982 | else: |
| 983 | q.text('None') |
| 984 | q.text(","); q.breakable() |
| 985 | q.text("code = "); |
| 986 | q.text("%#x" % self.code) |
| 987 | q.text(","); q.breakable() |
| 988 | q.text("data = "); |
| 989 | q.pp(self.data) |
| 990 | q.breakable() |
| 991 | q.text('}') |
| 992 | |
| 993 | error_msg.subtypes[3] = bad_instruction_error_msg |
| 994 | |
| 995 | class bad_match_error_msg(error_msg): |
| 996 | version = 4 |
| 997 | type = 1 |
| 998 | err_type = 4 |
| 999 | |
| 1000 | def __init__(self, xid=None, code=None, data=None): |
| 1001 | if xid != None: |
| 1002 | self.xid = xid |
| 1003 | else: |
| 1004 | self.xid = None |
| 1005 | if code != None: |
| 1006 | self.code = code |
| 1007 | else: |
| 1008 | self.code = 0 |
| 1009 | if data != None: |
| 1010 | self.data = data |
| 1011 | else: |
| 1012 | self.data = '' |
| 1013 | return |
| 1014 | |
| 1015 | def pack(self): |
| 1016 | packed = [] |
| 1017 | packed.append(struct.pack("!B", self.version)) |
| 1018 | packed.append(struct.pack("!B", self.type)) |
| 1019 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 1020 | packed.append(struct.pack("!L", self.xid)) |
| 1021 | packed.append(struct.pack("!H", self.err_type)) |
| 1022 | packed.append(struct.pack("!H", self.code)) |
| 1023 | packed.append(self.data) |
| 1024 | length = sum([len(x) for x in packed]) |
| 1025 | packed[2] = struct.pack("!H", length) |
| 1026 | return ''.join(packed) |
| 1027 | |
| 1028 | @staticmethod |
| 1029 | def unpack(reader): |
| 1030 | obj = bad_match_error_msg() |
| 1031 | _version = reader.read("!B")[0] |
| 1032 | assert(_version == 4) |
| 1033 | _type = reader.read("!B")[0] |
| 1034 | assert(_type == 1) |
| 1035 | _length = reader.read("!H")[0] |
| 1036 | orig_reader = reader |
| 1037 | reader = orig_reader.slice(_length, 4) |
| 1038 | obj.xid = reader.read("!L")[0] |
| 1039 | _err_type = reader.read("!H")[0] |
| 1040 | assert(_err_type == 4) |
| 1041 | obj.code = reader.read("!H")[0] |
| 1042 | obj.data = str(reader.read_all()) |
| 1043 | return obj |
| 1044 | |
| 1045 | def __eq__(self, other): |
| 1046 | if type(self) != type(other): return False |
| 1047 | if self.xid != other.xid: return False |
| 1048 | if self.code != other.code: return False |
| 1049 | if self.data != other.data: return False |
| 1050 | return True |
| 1051 | |
| 1052 | def pretty_print(self, q): |
| 1053 | q.text("bad_match_error_msg {") |
| 1054 | with q.group(): |
| 1055 | with q.indent(2): |
| 1056 | q.breakable() |
| 1057 | q.text("xid = "); |
| 1058 | if self.xid != None: |
| 1059 | q.text("%#x" % self.xid) |
| 1060 | else: |
| 1061 | q.text('None') |
| 1062 | q.text(","); q.breakable() |
| 1063 | q.text("code = "); |
| 1064 | q.text("%#x" % self.code) |
| 1065 | q.text(","); q.breakable() |
| 1066 | q.text("data = "); |
| 1067 | q.pp(self.data) |
| 1068 | q.breakable() |
| 1069 | q.text('}') |
| 1070 | |
| 1071 | error_msg.subtypes[4] = bad_match_error_msg |
| 1072 | |
| 1073 | class bad_request_error_msg(error_msg): |
| 1074 | version = 4 |
| 1075 | type = 1 |
| 1076 | err_type = 1 |
| 1077 | |
| 1078 | def __init__(self, xid=None, code=None, data=None): |
| 1079 | if xid != None: |
| 1080 | self.xid = xid |
| 1081 | else: |
| 1082 | self.xid = None |
| 1083 | if code != None: |
| 1084 | self.code = code |
| 1085 | else: |
| 1086 | self.code = 0 |
| 1087 | if data != None: |
| 1088 | self.data = data |
| 1089 | else: |
| 1090 | self.data = '' |
| 1091 | return |
| 1092 | |
| 1093 | def pack(self): |
| 1094 | packed = [] |
| 1095 | packed.append(struct.pack("!B", self.version)) |
| 1096 | packed.append(struct.pack("!B", self.type)) |
| 1097 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 1098 | packed.append(struct.pack("!L", self.xid)) |
| 1099 | packed.append(struct.pack("!H", self.err_type)) |
| 1100 | packed.append(struct.pack("!H", self.code)) |
| 1101 | packed.append(self.data) |
| 1102 | length = sum([len(x) for x in packed]) |
| 1103 | packed[2] = struct.pack("!H", length) |
| 1104 | return ''.join(packed) |
| 1105 | |
| 1106 | @staticmethod |
| 1107 | def unpack(reader): |
| 1108 | obj = bad_request_error_msg() |
| 1109 | _version = reader.read("!B")[0] |
| 1110 | assert(_version == 4) |
| 1111 | _type = reader.read("!B")[0] |
| 1112 | assert(_type == 1) |
| 1113 | _length = reader.read("!H")[0] |
| 1114 | orig_reader = reader |
| 1115 | reader = orig_reader.slice(_length, 4) |
| 1116 | obj.xid = reader.read("!L")[0] |
| 1117 | _err_type = reader.read("!H")[0] |
| 1118 | assert(_err_type == 1) |
| 1119 | obj.code = reader.read("!H")[0] |
| 1120 | obj.data = str(reader.read_all()) |
| 1121 | return obj |
| 1122 | |
| 1123 | def __eq__(self, other): |
| 1124 | if type(self) != type(other): return False |
| 1125 | if self.xid != other.xid: return False |
| 1126 | if self.code != other.code: return False |
| 1127 | if self.data != other.data: return False |
| 1128 | return True |
| 1129 | |
| 1130 | def pretty_print(self, q): |
| 1131 | q.text("bad_request_error_msg {") |
| 1132 | with q.group(): |
| 1133 | with q.indent(2): |
| 1134 | q.breakable() |
| 1135 | q.text("xid = "); |
| 1136 | if self.xid != None: |
| 1137 | q.text("%#x" % self.xid) |
| 1138 | else: |
| 1139 | q.text('None') |
| 1140 | q.text(","); q.breakable() |
| 1141 | q.text("code = "); |
| 1142 | q.text("%#x" % self.code) |
| 1143 | q.text(","); q.breakable() |
| 1144 | q.text("data = "); |
| 1145 | q.pp(self.data) |
| 1146 | q.breakable() |
| 1147 | q.text('}') |
| 1148 | |
| 1149 | error_msg.subtypes[1] = bad_request_error_msg |
| 1150 | |
| 1151 | class barrier_reply(message): |
| 1152 | version = 4 |
| 1153 | type = 21 |
| 1154 | |
| 1155 | def __init__(self, xid=None): |
| 1156 | if xid != None: |
| 1157 | self.xid = xid |
| 1158 | else: |
| 1159 | self.xid = None |
| 1160 | return |
| 1161 | |
| 1162 | def pack(self): |
| 1163 | packed = [] |
| 1164 | packed.append(struct.pack("!B", self.version)) |
| 1165 | packed.append(struct.pack("!B", self.type)) |
| 1166 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 1167 | packed.append(struct.pack("!L", self.xid)) |
| 1168 | length = sum([len(x) for x in packed]) |
| 1169 | packed[2] = struct.pack("!H", length) |
| 1170 | return ''.join(packed) |
| 1171 | |
| 1172 | @staticmethod |
| 1173 | def unpack(reader): |
| 1174 | obj = barrier_reply() |
| 1175 | _version = reader.read("!B")[0] |
| 1176 | assert(_version == 4) |
| 1177 | _type = reader.read("!B")[0] |
| 1178 | assert(_type == 21) |
| 1179 | _length = reader.read("!H")[0] |
| 1180 | orig_reader = reader |
| 1181 | reader = orig_reader.slice(_length, 4) |
| 1182 | obj.xid = reader.read("!L")[0] |
| 1183 | return obj |
| 1184 | |
| 1185 | def __eq__(self, other): |
| 1186 | if type(self) != type(other): return False |
| 1187 | if self.xid != other.xid: return False |
| 1188 | return True |
| 1189 | |
| 1190 | def pretty_print(self, q): |
| 1191 | q.text("barrier_reply {") |
| 1192 | with q.group(): |
| 1193 | with q.indent(2): |
| 1194 | q.breakable() |
| 1195 | q.text("xid = "); |
| 1196 | if self.xid != None: |
| 1197 | q.text("%#x" % self.xid) |
| 1198 | else: |
| 1199 | q.text('None') |
| 1200 | q.breakable() |
| 1201 | q.text('}') |
| 1202 | |
| 1203 | message.subtypes[21] = barrier_reply |
| 1204 | |
| 1205 | class barrier_request(message): |
| 1206 | version = 4 |
| 1207 | type = 20 |
| 1208 | |
| 1209 | def __init__(self, xid=None): |
| 1210 | if xid != None: |
| 1211 | self.xid = xid |
| 1212 | else: |
| 1213 | self.xid = None |
| 1214 | return |
| 1215 | |
| 1216 | def pack(self): |
| 1217 | packed = [] |
| 1218 | packed.append(struct.pack("!B", self.version)) |
| 1219 | packed.append(struct.pack("!B", self.type)) |
| 1220 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 1221 | packed.append(struct.pack("!L", self.xid)) |
| 1222 | length = sum([len(x) for x in packed]) |
| 1223 | packed[2] = struct.pack("!H", length) |
| 1224 | return ''.join(packed) |
| 1225 | |
| 1226 | @staticmethod |
| 1227 | def unpack(reader): |
| 1228 | obj = barrier_request() |
| 1229 | _version = reader.read("!B")[0] |
| 1230 | assert(_version == 4) |
| 1231 | _type = reader.read("!B")[0] |
| 1232 | assert(_type == 20) |
| 1233 | _length = reader.read("!H")[0] |
| 1234 | orig_reader = reader |
| 1235 | reader = orig_reader.slice(_length, 4) |
| 1236 | obj.xid = reader.read("!L")[0] |
| 1237 | return obj |
| 1238 | |
| 1239 | def __eq__(self, other): |
| 1240 | if type(self) != type(other): return False |
| 1241 | if self.xid != other.xid: return False |
| 1242 | return True |
| 1243 | |
| 1244 | def pretty_print(self, q): |
| 1245 | q.text("barrier_request {") |
| 1246 | with q.group(): |
| 1247 | with q.indent(2): |
| 1248 | q.breakable() |
| 1249 | q.text("xid = "); |
| 1250 | if self.xid != None: |
| 1251 | q.text("%#x" % self.xid) |
| 1252 | else: |
| 1253 | q.text('None') |
| 1254 | q.breakable() |
| 1255 | q.text('}') |
| 1256 | |
| 1257 | message.subtypes[20] = barrier_request |
| 1258 | |
| 1259 | class experimenter(message): |
| 1260 | subtypes = {} |
| 1261 | |
| 1262 | version = 4 |
| 1263 | type = 4 |
| 1264 | |
| 1265 | def __init__(self, xid=None, experimenter=None, subtype=None, data=None): |
| 1266 | if xid != None: |
| 1267 | self.xid = xid |
| 1268 | else: |
| 1269 | self.xid = None |
| 1270 | if experimenter != None: |
| 1271 | self.experimenter = experimenter |
| 1272 | else: |
| 1273 | self.experimenter = 0 |
| 1274 | if subtype != None: |
| 1275 | self.subtype = subtype |
| 1276 | else: |
| 1277 | self.subtype = 0 |
| 1278 | if data != None: |
| 1279 | self.data = data |
| 1280 | else: |
| 1281 | self.data = '' |
| 1282 | return |
| 1283 | |
| 1284 | def pack(self): |
| 1285 | packed = [] |
| 1286 | packed.append(struct.pack("!B", self.version)) |
| 1287 | packed.append(struct.pack("!B", self.type)) |
| 1288 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 1289 | packed.append(struct.pack("!L", self.xid)) |
| 1290 | packed.append(struct.pack("!L", self.experimenter)) |
| 1291 | packed.append(struct.pack("!L", self.subtype)) |
| 1292 | packed.append(self.data) |
| 1293 | length = sum([len(x) for x in packed]) |
| 1294 | packed[2] = struct.pack("!H", length) |
| 1295 | return ''.join(packed) |
| 1296 | |
| 1297 | @staticmethod |
| 1298 | def unpack(reader): |
| 1299 | subtype, = reader.peek('!L', 8) |
| 1300 | subclass = experimenter.subtypes.get(subtype) |
| 1301 | if subclass: |
| 1302 | return subclass.unpack(reader) |
| 1303 | |
| 1304 | obj = experimenter() |
| 1305 | _version = reader.read("!B")[0] |
| 1306 | assert(_version == 4) |
| 1307 | _type = reader.read("!B")[0] |
| 1308 | assert(_type == 4) |
| 1309 | _length = reader.read("!H")[0] |
| 1310 | orig_reader = reader |
| 1311 | reader = orig_reader.slice(_length, 4) |
| 1312 | obj.xid = reader.read("!L")[0] |
| 1313 | obj.experimenter = reader.read("!L")[0] |
| 1314 | obj.subtype = reader.read("!L")[0] |
| 1315 | obj.data = str(reader.read_all()) |
| 1316 | return obj |
| 1317 | |
| 1318 | def __eq__(self, other): |
| 1319 | if type(self) != type(other): return False |
| 1320 | if self.xid != other.xid: return False |
| 1321 | if self.experimenter != other.experimenter: return False |
| 1322 | if self.subtype != other.subtype: return False |
| 1323 | if self.data != other.data: return False |
| 1324 | return True |
| 1325 | |
| 1326 | def pretty_print(self, q): |
| 1327 | q.text("experimenter {") |
| 1328 | with q.group(): |
| 1329 | with q.indent(2): |
| 1330 | q.breakable() |
| 1331 | q.text("xid = "); |
| 1332 | if self.xid != None: |
| 1333 | q.text("%#x" % self.xid) |
| 1334 | else: |
| 1335 | q.text('None') |
| 1336 | q.text(","); q.breakable() |
| 1337 | q.text("subtype = "); |
| 1338 | q.text("%#x" % self.subtype) |
| 1339 | q.text(","); q.breakable() |
| 1340 | q.text("data = "); |
| 1341 | q.pp(self.data) |
| 1342 | q.breakable() |
| 1343 | q.text('}') |
| 1344 | |
| 1345 | message.subtypes[4] = experimenter |
| 1346 | |
| 1347 | class bsn_header(experimenter): |
| 1348 | subtypes = {} |
| 1349 | |
| 1350 | version = 4 |
| 1351 | type = 4 |
| 1352 | experimenter = 6035143 |
| 1353 | |
| 1354 | def __init__(self, xid=None, subtype=None): |
| 1355 | if xid != None: |
| 1356 | self.xid = xid |
| 1357 | else: |
| 1358 | self.xid = None |
| 1359 | if subtype != None: |
| 1360 | self.subtype = subtype |
| 1361 | else: |
| 1362 | self.subtype = 0 |
| 1363 | return |
| 1364 | |
| 1365 | def pack(self): |
| 1366 | packed = [] |
| 1367 | packed.append(struct.pack("!B", self.version)) |
| 1368 | packed.append(struct.pack("!B", self.type)) |
| 1369 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 1370 | packed.append(struct.pack("!L", self.xid)) |
| 1371 | packed.append(struct.pack("!L", self.experimenter)) |
| 1372 | packed.append(struct.pack("!L", self.subtype)) |
| 1373 | length = sum([len(x) for x in packed]) |
| 1374 | packed[2] = struct.pack("!H", length) |
| 1375 | return ''.join(packed) |
| 1376 | |
| 1377 | @staticmethod |
| 1378 | def unpack(reader): |
| 1379 | subtype, = reader.peek('!L', 12) |
| 1380 | subclass = bsn_header.subtypes.get(subtype) |
| 1381 | if subclass: |
| 1382 | return subclass.unpack(reader) |
| 1383 | |
| 1384 | obj = bsn_header() |
| 1385 | _version = reader.read("!B")[0] |
| 1386 | assert(_version == 4) |
| 1387 | _type = reader.read("!B")[0] |
| 1388 | assert(_type == 4) |
| 1389 | _length = reader.read("!H")[0] |
| 1390 | orig_reader = reader |
| 1391 | reader = orig_reader.slice(_length, 4) |
| 1392 | obj.xid = reader.read("!L")[0] |
| 1393 | _experimenter = reader.read("!L")[0] |
| 1394 | assert(_experimenter == 6035143) |
| 1395 | obj.subtype = reader.read("!L")[0] |
| 1396 | return obj |
| 1397 | |
| 1398 | def __eq__(self, other): |
| 1399 | if type(self) != type(other): return False |
| 1400 | if self.xid != other.xid: return False |
| 1401 | if self.subtype != other.subtype: return False |
| 1402 | return True |
| 1403 | |
| 1404 | def pretty_print(self, q): |
| 1405 | q.text("bsn_header {") |
| 1406 | with q.group(): |
| 1407 | with q.indent(2): |
| 1408 | q.breakable() |
| 1409 | q.text("xid = "); |
| 1410 | if self.xid != None: |
| 1411 | q.text("%#x" % self.xid) |
| 1412 | else: |
| 1413 | q.text('None') |
| 1414 | q.breakable() |
| 1415 | q.text('}') |
| 1416 | |
| 1417 | experimenter.subtypes[6035143] = bsn_header |
| 1418 | |
| 1419 | class bsn_arp_idle(bsn_header): |
| 1420 | version = 4 |
| 1421 | type = 4 |
| 1422 | experimenter = 6035143 |
| 1423 | subtype = 60 |
| 1424 | |
| 1425 | def __init__(self, xid=None, vlan_vid=None, ipv4_addr=None): |
| 1426 | if xid != None: |
| 1427 | self.xid = xid |
| 1428 | else: |
| 1429 | self.xid = None |
| 1430 | if vlan_vid != None: |
| 1431 | self.vlan_vid = vlan_vid |
| 1432 | else: |
| 1433 | self.vlan_vid = 0 |
| 1434 | if ipv4_addr != None: |
| 1435 | self.ipv4_addr = ipv4_addr |
| 1436 | else: |
| 1437 | self.ipv4_addr = 0 |
| 1438 | return |
| 1439 | |
| 1440 | def pack(self): |
| 1441 | packed = [] |
| 1442 | packed.append(struct.pack("!B", self.version)) |
| 1443 | packed.append(struct.pack("!B", self.type)) |
| 1444 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 1445 | packed.append(struct.pack("!L", self.xid)) |
| 1446 | packed.append(struct.pack("!L", self.experimenter)) |
| 1447 | packed.append(struct.pack("!L", self.subtype)) |
| 1448 | packed.append(struct.pack("!H", self.vlan_vid)) |
| 1449 | packed.append('\x00' * 2) |
| 1450 | packed.append(struct.pack("!L", self.ipv4_addr)) |
| 1451 | length = sum([len(x) for x in packed]) |
| 1452 | packed[2] = struct.pack("!H", length) |
| 1453 | return ''.join(packed) |
| 1454 | |
| 1455 | @staticmethod |
| 1456 | def unpack(reader): |
| 1457 | obj = bsn_arp_idle() |
| 1458 | _version = reader.read("!B")[0] |
| 1459 | assert(_version == 4) |
| 1460 | _type = reader.read("!B")[0] |
| 1461 | assert(_type == 4) |
| 1462 | _length = reader.read("!H")[0] |
| 1463 | orig_reader = reader |
| 1464 | reader = orig_reader.slice(_length, 4) |
| 1465 | obj.xid = reader.read("!L")[0] |
| 1466 | _experimenter = reader.read("!L")[0] |
| 1467 | assert(_experimenter == 6035143) |
| 1468 | _subtype = reader.read("!L")[0] |
| 1469 | assert(_subtype == 60) |
| 1470 | obj.vlan_vid = reader.read("!H")[0] |
| 1471 | reader.skip(2) |
| 1472 | obj.ipv4_addr = reader.read("!L")[0] |
| 1473 | return obj |
| 1474 | |
| 1475 | def __eq__(self, other): |
| 1476 | if type(self) != type(other): return False |
| 1477 | if self.xid != other.xid: return False |
| 1478 | if self.vlan_vid != other.vlan_vid: return False |
| 1479 | if self.ipv4_addr != other.ipv4_addr: return False |
| 1480 | return True |
| 1481 | |
| 1482 | def pretty_print(self, q): |
| 1483 | q.text("bsn_arp_idle {") |
| 1484 | with q.group(): |
| 1485 | with q.indent(2): |
| 1486 | q.breakable() |
| 1487 | q.text("xid = "); |
| 1488 | if self.xid != None: |
| 1489 | q.text("%#x" % self.xid) |
| 1490 | else: |
| 1491 | q.text('None') |
| 1492 | q.text(","); q.breakable() |
| 1493 | q.text("vlan_vid = "); |
| 1494 | q.text("%#x" % self.vlan_vid) |
| 1495 | q.text(","); q.breakable() |
| 1496 | q.text("ipv4_addr = "); |
| 1497 | q.text(util.pretty_ipv4(self.ipv4_addr)) |
| 1498 | q.breakable() |
| 1499 | q.text('}') |
| 1500 | |
| 1501 | bsn_header.subtypes[60] = bsn_arp_idle |
| 1502 | |
| 1503 | class experimenter_error_msg(error_msg): |
| 1504 | subtypes = {} |
| 1505 | |
| 1506 | version = 4 |
| 1507 | type = 1 |
| 1508 | err_type = 65535 |
| 1509 | |
| 1510 | def __init__(self, xid=None, subtype=None, experimenter=None, data=None): |
| 1511 | if xid != None: |
| 1512 | self.xid = xid |
| 1513 | else: |
| 1514 | self.xid = None |
| 1515 | if subtype != None: |
| 1516 | self.subtype = subtype |
| 1517 | else: |
| 1518 | self.subtype = 0 |
| 1519 | if experimenter != None: |
| 1520 | self.experimenter = experimenter |
| 1521 | else: |
| 1522 | self.experimenter = 0 |
| 1523 | if data != None: |
| 1524 | self.data = data |
| 1525 | else: |
| 1526 | self.data = '' |
| 1527 | return |
| 1528 | |
| 1529 | def pack(self): |
| 1530 | packed = [] |
| 1531 | packed.append(struct.pack("!B", self.version)) |
| 1532 | packed.append(struct.pack("!B", self.type)) |
| 1533 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 1534 | packed.append(struct.pack("!L", self.xid)) |
| 1535 | packed.append(struct.pack("!H", self.err_type)) |
| 1536 | packed.append(struct.pack("!H", self.subtype)) |
| 1537 | packed.append(struct.pack("!L", self.experimenter)) |
| 1538 | packed.append(self.data) |
| 1539 | length = sum([len(x) for x in packed]) |
| 1540 | packed[2] = struct.pack("!H", length) |
| 1541 | return ''.join(packed) |
| 1542 | |
| 1543 | @staticmethod |
| 1544 | def unpack(reader): |
| 1545 | subtype, = reader.peek('!L', 12) |
| 1546 | subclass = experimenter_error_msg.subtypes.get(subtype) |
| 1547 | if subclass: |
| 1548 | return subclass.unpack(reader) |
| 1549 | |
| 1550 | obj = experimenter_error_msg() |
| 1551 | _version = reader.read("!B")[0] |
| 1552 | assert(_version == 4) |
| 1553 | _type = reader.read("!B")[0] |
| 1554 | assert(_type == 1) |
| 1555 | _length = reader.read("!H")[0] |
| 1556 | orig_reader = reader |
| 1557 | reader = orig_reader.slice(_length, 4) |
| 1558 | obj.xid = reader.read("!L")[0] |
| 1559 | _err_type = reader.read("!H")[0] |
| 1560 | assert(_err_type == 65535) |
| 1561 | obj.subtype = reader.read("!H")[0] |
| 1562 | obj.experimenter = reader.read("!L")[0] |
| 1563 | obj.data = str(reader.read_all()) |
| 1564 | return obj |
| 1565 | |
| 1566 | def __eq__(self, other): |
| 1567 | if type(self) != type(other): return False |
| 1568 | if self.xid != other.xid: return False |
| 1569 | if self.subtype != other.subtype: return False |
| 1570 | if self.experimenter != other.experimenter: return False |
| 1571 | if self.data != other.data: return False |
| 1572 | return True |
| 1573 | |
| 1574 | def pretty_print(self, q): |
| 1575 | q.text("experimenter_error_msg {") |
| 1576 | with q.group(): |
| 1577 | with q.indent(2): |
| 1578 | q.breakable() |
| 1579 | q.text("xid = "); |
| 1580 | if self.xid != None: |
| 1581 | q.text("%#x" % self.xid) |
| 1582 | else: |
| 1583 | q.text('None') |
| 1584 | q.text(","); q.breakable() |
| 1585 | q.text("subtype = "); |
| 1586 | q.text("%#x" % self.subtype) |
| 1587 | q.text(","); q.breakable() |
| 1588 | q.text("data = "); |
| 1589 | q.pp(self.data) |
| 1590 | q.breakable() |
| 1591 | q.text('}') |
| 1592 | |
| 1593 | error_msg.subtypes[65535] = experimenter_error_msg |
| 1594 | |
| 1595 | class bsn_base_error(experimenter_error_msg): |
| 1596 | subtypes = {} |
| 1597 | |
| 1598 | version = 4 |
| 1599 | type = 1 |
| 1600 | err_type = 65535 |
| 1601 | experimenter = 6035143 |
| 1602 | |
| 1603 | def __init__(self, xid=None, subtype=None, err_msg=None, data=None): |
| 1604 | if xid != None: |
| 1605 | self.xid = xid |
| 1606 | else: |
| 1607 | self.xid = None |
| 1608 | if subtype != None: |
| 1609 | self.subtype = subtype |
| 1610 | else: |
| 1611 | self.subtype = 0 |
| 1612 | if err_msg != None: |
| 1613 | self.err_msg = err_msg |
| 1614 | else: |
| 1615 | self.err_msg = "" |
| 1616 | if data != None: |
| 1617 | self.data = data |
| 1618 | else: |
| 1619 | self.data = '' |
| 1620 | return |
| 1621 | |
| 1622 | def pack(self): |
| 1623 | packed = [] |
| 1624 | packed.append(struct.pack("!B", self.version)) |
| 1625 | packed.append(struct.pack("!B", self.type)) |
| 1626 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 1627 | packed.append(struct.pack("!L", self.xid)) |
| 1628 | packed.append(struct.pack("!H", self.err_type)) |
| 1629 | packed.append(struct.pack("!H", self.subtype)) |
| 1630 | packed.append(struct.pack("!L", self.experimenter)) |
| 1631 | packed.append(struct.pack("!256s", self.err_msg)) |
| 1632 | packed.append(self.data) |
| 1633 | length = sum([len(x) for x in packed]) |
| 1634 | packed[2] = struct.pack("!H", length) |
| 1635 | return ''.join(packed) |
| 1636 | |
| 1637 | @staticmethod |
| 1638 | def unpack(reader): |
| 1639 | subtype, = reader.peek('!H', 10) |
| 1640 | subclass = bsn_base_error.subtypes.get(subtype) |
| 1641 | if subclass: |
| 1642 | return subclass.unpack(reader) |
| 1643 | |
| 1644 | obj = bsn_base_error() |
| 1645 | _version = reader.read("!B")[0] |
| 1646 | assert(_version == 4) |
| 1647 | _type = reader.read("!B")[0] |
| 1648 | assert(_type == 1) |
| 1649 | _length = reader.read("!H")[0] |
| 1650 | orig_reader = reader |
| 1651 | reader = orig_reader.slice(_length, 4) |
| 1652 | obj.xid = reader.read("!L")[0] |
| 1653 | _err_type = reader.read("!H")[0] |
| 1654 | assert(_err_type == 65535) |
| 1655 | obj.subtype = reader.read("!H")[0] |
| 1656 | _experimenter = reader.read("!L")[0] |
| 1657 | assert(_experimenter == 6035143) |
| 1658 | obj.err_msg = reader.read("!256s")[0].rstrip("\x00") |
| 1659 | obj.data = str(reader.read_all()) |
| 1660 | return obj |
| 1661 | |
| 1662 | def __eq__(self, other): |
| 1663 | if type(self) != type(other): return False |
| 1664 | if self.xid != other.xid: return False |
| 1665 | if self.subtype != other.subtype: return False |
| 1666 | if self.err_msg != other.err_msg: return False |
| 1667 | if self.data != other.data: return False |
| 1668 | return True |
| 1669 | |
| 1670 | def pretty_print(self, q): |
| 1671 | q.text("bsn_base_error {") |
| 1672 | with q.group(): |
| 1673 | with q.indent(2): |
| 1674 | q.breakable() |
| 1675 | q.text("xid = "); |
| 1676 | if self.xid != None: |
| 1677 | q.text("%#x" % self.xid) |
| 1678 | else: |
| 1679 | q.text('None') |
| 1680 | q.text(","); q.breakable() |
| 1681 | q.text("err_msg = "); |
| 1682 | q.pp(self.err_msg) |
| 1683 | q.text(","); q.breakable() |
| 1684 | q.text("data = "); |
| 1685 | q.pp(self.data) |
| 1686 | q.breakable() |
| 1687 | q.text('}') |
| 1688 | |
| 1689 | experimenter_error_msg.subtypes[6035143] = bsn_base_error |
| 1690 | |
| 1691 | class bsn_bw_clear_data_reply(bsn_header): |
| 1692 | version = 4 |
| 1693 | type = 4 |
| 1694 | experimenter = 6035143 |
| 1695 | subtype = 22 |
| 1696 | |
| 1697 | def __init__(self, xid=None, status=None): |
| 1698 | if xid != None: |
| 1699 | self.xid = xid |
| 1700 | else: |
| 1701 | self.xid = None |
| 1702 | if status != None: |
| 1703 | self.status = status |
| 1704 | else: |
| 1705 | self.status = 0 |
| 1706 | return |
| 1707 | |
| 1708 | def pack(self): |
| 1709 | packed = [] |
| 1710 | packed.append(struct.pack("!B", self.version)) |
| 1711 | packed.append(struct.pack("!B", self.type)) |
| 1712 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 1713 | packed.append(struct.pack("!L", self.xid)) |
| 1714 | packed.append(struct.pack("!L", self.experimenter)) |
| 1715 | packed.append(struct.pack("!L", self.subtype)) |
| 1716 | packed.append(struct.pack("!L", self.status)) |
| 1717 | length = sum([len(x) for x in packed]) |
| 1718 | packed[2] = struct.pack("!H", length) |
| 1719 | return ''.join(packed) |
| 1720 | |
| 1721 | @staticmethod |
| 1722 | def unpack(reader): |
| 1723 | obj = bsn_bw_clear_data_reply() |
| 1724 | _version = reader.read("!B")[0] |
| 1725 | assert(_version == 4) |
| 1726 | _type = reader.read("!B")[0] |
| 1727 | assert(_type == 4) |
| 1728 | _length = reader.read("!H")[0] |
| 1729 | orig_reader = reader |
| 1730 | reader = orig_reader.slice(_length, 4) |
| 1731 | obj.xid = reader.read("!L")[0] |
| 1732 | _experimenter = reader.read("!L")[0] |
| 1733 | assert(_experimenter == 6035143) |
| 1734 | _subtype = reader.read("!L")[0] |
| 1735 | assert(_subtype == 22) |
| 1736 | obj.status = reader.read("!L")[0] |
| 1737 | return obj |
| 1738 | |
| 1739 | def __eq__(self, other): |
| 1740 | if type(self) != type(other): return False |
| 1741 | if self.xid != other.xid: return False |
| 1742 | if self.status != other.status: return False |
| 1743 | return True |
| 1744 | |
| 1745 | def pretty_print(self, q): |
| 1746 | q.text("bsn_bw_clear_data_reply {") |
| 1747 | with q.group(): |
| 1748 | with q.indent(2): |
| 1749 | q.breakable() |
| 1750 | q.text("xid = "); |
| 1751 | if self.xid != None: |
| 1752 | q.text("%#x" % self.xid) |
| 1753 | else: |
| 1754 | q.text('None') |
| 1755 | q.text(","); q.breakable() |
| 1756 | q.text("status = "); |
| 1757 | q.text("%#x" % self.status) |
| 1758 | q.breakable() |
| 1759 | q.text('}') |
| 1760 | |
| 1761 | bsn_header.subtypes[22] = bsn_bw_clear_data_reply |
| 1762 | |
| 1763 | class bsn_bw_clear_data_request(bsn_header): |
| 1764 | version = 4 |
| 1765 | type = 4 |
| 1766 | experimenter = 6035143 |
| 1767 | subtype = 21 |
| 1768 | |
| 1769 | def __init__(self, xid=None): |
| 1770 | if xid != None: |
| 1771 | self.xid = xid |
| 1772 | else: |
| 1773 | self.xid = None |
| 1774 | return |
| 1775 | |
| 1776 | def pack(self): |
| 1777 | packed = [] |
| 1778 | packed.append(struct.pack("!B", self.version)) |
| 1779 | packed.append(struct.pack("!B", self.type)) |
| 1780 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 1781 | packed.append(struct.pack("!L", self.xid)) |
| 1782 | packed.append(struct.pack("!L", self.experimenter)) |
| 1783 | packed.append(struct.pack("!L", self.subtype)) |
| 1784 | length = sum([len(x) for x in packed]) |
| 1785 | packed[2] = struct.pack("!H", length) |
| 1786 | return ''.join(packed) |
| 1787 | |
| 1788 | @staticmethod |
| 1789 | def unpack(reader): |
| 1790 | obj = bsn_bw_clear_data_request() |
| 1791 | _version = reader.read("!B")[0] |
| 1792 | assert(_version == 4) |
| 1793 | _type = reader.read("!B")[0] |
| 1794 | assert(_type == 4) |
| 1795 | _length = reader.read("!H")[0] |
| 1796 | orig_reader = reader |
| 1797 | reader = orig_reader.slice(_length, 4) |
| 1798 | obj.xid = reader.read("!L")[0] |
| 1799 | _experimenter = reader.read("!L")[0] |
| 1800 | assert(_experimenter == 6035143) |
| 1801 | _subtype = reader.read("!L")[0] |
| 1802 | assert(_subtype == 21) |
| 1803 | return obj |
| 1804 | |
| 1805 | def __eq__(self, other): |
| 1806 | if type(self) != type(other): return False |
| 1807 | if self.xid != other.xid: return False |
| 1808 | return True |
| 1809 | |
| 1810 | def pretty_print(self, q): |
| 1811 | q.text("bsn_bw_clear_data_request {") |
| 1812 | with q.group(): |
| 1813 | with q.indent(2): |
| 1814 | q.breakable() |
| 1815 | q.text("xid = "); |
| 1816 | if self.xid != None: |
| 1817 | q.text("%#x" % self.xid) |
| 1818 | else: |
| 1819 | q.text('None') |
| 1820 | q.breakable() |
| 1821 | q.text('}') |
| 1822 | |
| 1823 | bsn_header.subtypes[21] = bsn_bw_clear_data_request |
| 1824 | |
| 1825 | class bsn_bw_enable_get_reply(bsn_header): |
| 1826 | version = 4 |
| 1827 | type = 4 |
| 1828 | experimenter = 6035143 |
| 1829 | subtype = 20 |
| 1830 | |
| 1831 | def __init__(self, xid=None, enabled=None): |
| 1832 | if xid != None: |
| 1833 | self.xid = xid |
| 1834 | else: |
| 1835 | self.xid = None |
| 1836 | if enabled != None: |
| 1837 | self.enabled = enabled |
| 1838 | else: |
| 1839 | self.enabled = 0 |
| 1840 | return |
| 1841 | |
| 1842 | def pack(self): |
| 1843 | packed = [] |
| 1844 | packed.append(struct.pack("!B", self.version)) |
| 1845 | packed.append(struct.pack("!B", self.type)) |
| 1846 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 1847 | packed.append(struct.pack("!L", self.xid)) |
| 1848 | packed.append(struct.pack("!L", self.experimenter)) |
| 1849 | packed.append(struct.pack("!L", self.subtype)) |
| 1850 | packed.append(struct.pack("!L", self.enabled)) |
| 1851 | length = sum([len(x) for x in packed]) |
| 1852 | packed[2] = struct.pack("!H", length) |
| 1853 | return ''.join(packed) |
| 1854 | |
| 1855 | @staticmethod |
| 1856 | def unpack(reader): |
| 1857 | obj = bsn_bw_enable_get_reply() |
| 1858 | _version = reader.read("!B")[0] |
| 1859 | assert(_version == 4) |
| 1860 | _type = reader.read("!B")[0] |
| 1861 | assert(_type == 4) |
| 1862 | _length = reader.read("!H")[0] |
| 1863 | orig_reader = reader |
| 1864 | reader = orig_reader.slice(_length, 4) |
| 1865 | obj.xid = reader.read("!L")[0] |
| 1866 | _experimenter = reader.read("!L")[0] |
| 1867 | assert(_experimenter == 6035143) |
| 1868 | _subtype = reader.read("!L")[0] |
| 1869 | assert(_subtype == 20) |
| 1870 | obj.enabled = reader.read("!L")[0] |
| 1871 | return obj |
| 1872 | |
| 1873 | def __eq__(self, other): |
| 1874 | if type(self) != type(other): return False |
| 1875 | if self.xid != other.xid: return False |
| 1876 | if self.enabled != other.enabled: return False |
| 1877 | return True |
| 1878 | |
| 1879 | def pretty_print(self, q): |
| 1880 | q.text("bsn_bw_enable_get_reply {") |
| 1881 | with q.group(): |
| 1882 | with q.indent(2): |
| 1883 | q.breakable() |
| 1884 | q.text("xid = "); |
| 1885 | if self.xid != None: |
| 1886 | q.text("%#x" % self.xid) |
| 1887 | else: |
| 1888 | q.text('None') |
| 1889 | q.text(","); q.breakable() |
| 1890 | q.text("enabled = "); |
| 1891 | q.text("%#x" % self.enabled) |
| 1892 | q.breakable() |
| 1893 | q.text('}') |
| 1894 | |
| 1895 | bsn_header.subtypes[20] = bsn_bw_enable_get_reply |
| 1896 | |
| 1897 | class bsn_bw_enable_get_request(bsn_header): |
| 1898 | version = 4 |
| 1899 | type = 4 |
| 1900 | experimenter = 6035143 |
| 1901 | subtype = 19 |
| 1902 | |
| 1903 | def __init__(self, xid=None): |
| 1904 | if xid != None: |
| 1905 | self.xid = xid |
| 1906 | else: |
| 1907 | self.xid = None |
| 1908 | return |
| 1909 | |
| 1910 | def pack(self): |
| 1911 | packed = [] |
| 1912 | packed.append(struct.pack("!B", self.version)) |
| 1913 | packed.append(struct.pack("!B", self.type)) |
| 1914 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 1915 | packed.append(struct.pack("!L", self.xid)) |
| 1916 | packed.append(struct.pack("!L", self.experimenter)) |
| 1917 | packed.append(struct.pack("!L", self.subtype)) |
| 1918 | length = sum([len(x) for x in packed]) |
| 1919 | packed[2] = struct.pack("!H", length) |
| 1920 | return ''.join(packed) |
| 1921 | |
| 1922 | @staticmethod |
| 1923 | def unpack(reader): |
| 1924 | obj = bsn_bw_enable_get_request() |
| 1925 | _version = reader.read("!B")[0] |
| 1926 | assert(_version == 4) |
| 1927 | _type = reader.read("!B")[0] |
| 1928 | assert(_type == 4) |
| 1929 | _length = reader.read("!H")[0] |
| 1930 | orig_reader = reader |
| 1931 | reader = orig_reader.slice(_length, 4) |
| 1932 | obj.xid = reader.read("!L")[0] |
| 1933 | _experimenter = reader.read("!L")[0] |
| 1934 | assert(_experimenter == 6035143) |
| 1935 | _subtype = reader.read("!L")[0] |
| 1936 | assert(_subtype == 19) |
| 1937 | return obj |
| 1938 | |
| 1939 | def __eq__(self, other): |
| 1940 | if type(self) != type(other): return False |
| 1941 | if self.xid != other.xid: return False |
| 1942 | return True |
| 1943 | |
| 1944 | def pretty_print(self, q): |
| 1945 | q.text("bsn_bw_enable_get_request {") |
| 1946 | with q.group(): |
| 1947 | with q.indent(2): |
| 1948 | q.breakable() |
| 1949 | q.text("xid = "); |
| 1950 | if self.xid != None: |
| 1951 | q.text("%#x" % self.xid) |
| 1952 | else: |
| 1953 | q.text('None') |
| 1954 | q.breakable() |
| 1955 | q.text('}') |
| 1956 | |
| 1957 | bsn_header.subtypes[19] = bsn_bw_enable_get_request |
| 1958 | |
| 1959 | class bsn_bw_enable_set_reply(bsn_header): |
| 1960 | version = 4 |
| 1961 | type = 4 |
| 1962 | experimenter = 6035143 |
| 1963 | subtype = 23 |
| 1964 | |
| 1965 | def __init__(self, xid=None, enable=None, status=None): |
| 1966 | if xid != None: |
| 1967 | self.xid = xid |
| 1968 | else: |
| 1969 | self.xid = None |
| 1970 | if enable != None: |
| 1971 | self.enable = enable |
| 1972 | else: |
| 1973 | self.enable = 0 |
| 1974 | if status != None: |
| 1975 | self.status = status |
| 1976 | else: |
| 1977 | self.status = 0 |
| 1978 | return |
| 1979 | |
| 1980 | def pack(self): |
| 1981 | packed = [] |
| 1982 | packed.append(struct.pack("!B", self.version)) |
| 1983 | packed.append(struct.pack("!B", self.type)) |
| 1984 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 1985 | packed.append(struct.pack("!L", self.xid)) |
| 1986 | packed.append(struct.pack("!L", self.experimenter)) |
| 1987 | packed.append(struct.pack("!L", self.subtype)) |
| 1988 | packed.append(struct.pack("!L", self.enable)) |
| 1989 | packed.append(struct.pack("!L", self.status)) |
| 1990 | length = sum([len(x) for x in packed]) |
| 1991 | packed[2] = struct.pack("!H", length) |
| 1992 | return ''.join(packed) |
| 1993 | |
| 1994 | @staticmethod |
| 1995 | def unpack(reader): |
| 1996 | obj = bsn_bw_enable_set_reply() |
| 1997 | _version = reader.read("!B")[0] |
| 1998 | assert(_version == 4) |
| 1999 | _type = reader.read("!B")[0] |
| 2000 | assert(_type == 4) |
| 2001 | _length = reader.read("!H")[0] |
| 2002 | orig_reader = reader |
| 2003 | reader = orig_reader.slice(_length, 4) |
| 2004 | obj.xid = reader.read("!L")[0] |
| 2005 | _experimenter = reader.read("!L")[0] |
| 2006 | assert(_experimenter == 6035143) |
| 2007 | _subtype = reader.read("!L")[0] |
| 2008 | assert(_subtype == 23) |
| 2009 | obj.enable = reader.read("!L")[0] |
| 2010 | obj.status = reader.read("!L")[0] |
| 2011 | return obj |
| 2012 | |
| 2013 | def __eq__(self, other): |
| 2014 | if type(self) != type(other): return False |
| 2015 | if self.xid != other.xid: return False |
| 2016 | if self.enable != other.enable: return False |
| 2017 | if self.status != other.status: return False |
| 2018 | return True |
| 2019 | |
| 2020 | def pretty_print(self, q): |
| 2021 | q.text("bsn_bw_enable_set_reply {") |
| 2022 | with q.group(): |
| 2023 | with q.indent(2): |
| 2024 | q.breakable() |
| 2025 | q.text("xid = "); |
| 2026 | if self.xid != None: |
| 2027 | q.text("%#x" % self.xid) |
| 2028 | else: |
| 2029 | q.text('None') |
| 2030 | q.text(","); q.breakable() |
| 2031 | q.text("enable = "); |
| 2032 | q.text("%#x" % self.enable) |
| 2033 | q.text(","); q.breakable() |
| 2034 | q.text("status = "); |
| 2035 | q.text("%#x" % self.status) |
| 2036 | q.breakable() |
| 2037 | q.text('}') |
| 2038 | |
| 2039 | bsn_header.subtypes[23] = bsn_bw_enable_set_reply |
| 2040 | |
| 2041 | class bsn_bw_enable_set_request(bsn_header): |
| 2042 | version = 4 |
| 2043 | type = 4 |
| 2044 | experimenter = 6035143 |
| 2045 | subtype = 18 |
| 2046 | |
| 2047 | def __init__(self, xid=None, enable=None): |
| 2048 | if xid != None: |
| 2049 | self.xid = xid |
| 2050 | else: |
| 2051 | self.xid = None |
| 2052 | if enable != None: |
| 2053 | self.enable = enable |
| 2054 | else: |
| 2055 | self.enable = 0 |
| 2056 | return |
| 2057 | |
| 2058 | def pack(self): |
| 2059 | packed = [] |
| 2060 | packed.append(struct.pack("!B", self.version)) |
| 2061 | packed.append(struct.pack("!B", self.type)) |
| 2062 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 2063 | packed.append(struct.pack("!L", self.xid)) |
| 2064 | packed.append(struct.pack("!L", self.experimenter)) |
| 2065 | packed.append(struct.pack("!L", self.subtype)) |
| 2066 | packed.append(struct.pack("!L", self.enable)) |
| 2067 | length = sum([len(x) for x in packed]) |
| 2068 | packed[2] = struct.pack("!H", length) |
| 2069 | return ''.join(packed) |
| 2070 | |
| 2071 | @staticmethod |
| 2072 | def unpack(reader): |
| 2073 | obj = bsn_bw_enable_set_request() |
| 2074 | _version = reader.read("!B")[0] |
| 2075 | assert(_version == 4) |
| 2076 | _type = reader.read("!B")[0] |
| 2077 | assert(_type == 4) |
| 2078 | _length = reader.read("!H")[0] |
| 2079 | orig_reader = reader |
| 2080 | reader = orig_reader.slice(_length, 4) |
| 2081 | obj.xid = reader.read("!L")[0] |
| 2082 | _experimenter = reader.read("!L")[0] |
| 2083 | assert(_experimenter == 6035143) |
| 2084 | _subtype = reader.read("!L")[0] |
| 2085 | assert(_subtype == 18) |
| 2086 | obj.enable = reader.read("!L")[0] |
| 2087 | return obj |
| 2088 | |
| 2089 | def __eq__(self, other): |
| 2090 | if type(self) != type(other): return False |
| 2091 | if self.xid != other.xid: return False |
| 2092 | if self.enable != other.enable: return False |
| 2093 | return True |
| 2094 | |
| 2095 | def pretty_print(self, q): |
| 2096 | q.text("bsn_bw_enable_set_request {") |
| 2097 | with q.group(): |
| 2098 | with q.indent(2): |
| 2099 | q.breakable() |
| 2100 | q.text("xid = "); |
| 2101 | if self.xid != None: |
| 2102 | q.text("%#x" % self.xid) |
| 2103 | else: |
| 2104 | q.text('None') |
| 2105 | q.text(","); q.breakable() |
| 2106 | q.text("enable = "); |
| 2107 | q.text("%#x" % self.enable) |
| 2108 | q.breakable() |
| 2109 | q.text('}') |
| 2110 | |
| 2111 | bsn_header.subtypes[18] = bsn_bw_enable_set_request |
| 2112 | |
| 2113 | class bsn_controller_connections_reply(bsn_header): |
| 2114 | version = 4 |
| 2115 | type = 4 |
| 2116 | experimenter = 6035143 |
| 2117 | subtype = 57 |
| 2118 | |
| 2119 | def __init__(self, xid=None, connections=None): |
| 2120 | if xid != None: |
| 2121 | self.xid = xid |
| 2122 | else: |
| 2123 | self.xid = None |
| 2124 | if connections != None: |
| 2125 | self.connections = connections |
| 2126 | else: |
| 2127 | self.connections = [] |
| 2128 | return |
| 2129 | |
| 2130 | def pack(self): |
| 2131 | packed = [] |
| 2132 | packed.append(struct.pack("!B", self.version)) |
| 2133 | packed.append(struct.pack("!B", self.type)) |
| 2134 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 2135 | packed.append(struct.pack("!L", self.xid)) |
| 2136 | packed.append(struct.pack("!L", self.experimenter)) |
| 2137 | packed.append(struct.pack("!L", self.subtype)) |
| 2138 | packed.append(loxi.generic_util.pack_list(self.connections)) |
| 2139 | length = sum([len(x) for x in packed]) |
| 2140 | packed[2] = struct.pack("!H", length) |
| 2141 | return ''.join(packed) |
| 2142 | |
| 2143 | @staticmethod |
| 2144 | def unpack(reader): |
| 2145 | obj = bsn_controller_connections_reply() |
| 2146 | _version = reader.read("!B")[0] |
| 2147 | assert(_version == 4) |
| 2148 | _type = reader.read("!B")[0] |
| 2149 | assert(_type == 4) |
| 2150 | _length = reader.read("!H")[0] |
| 2151 | orig_reader = reader |
| 2152 | reader = orig_reader.slice(_length, 4) |
| 2153 | obj.xid = reader.read("!L")[0] |
| 2154 | _experimenter = reader.read("!L")[0] |
| 2155 | assert(_experimenter == 6035143) |
| 2156 | _subtype = reader.read("!L")[0] |
| 2157 | assert(_subtype == 57) |
| 2158 | obj.connections = loxi.generic_util.unpack_list(reader, ofp.common.bsn_controller_connection.unpack) |
| 2159 | return obj |
| 2160 | |
| 2161 | def __eq__(self, other): |
| 2162 | if type(self) != type(other): return False |
| 2163 | if self.xid != other.xid: return False |
| 2164 | if self.connections != other.connections: return False |
| 2165 | return True |
| 2166 | |
| 2167 | def pretty_print(self, q): |
| 2168 | q.text("bsn_controller_connections_reply {") |
| 2169 | with q.group(): |
| 2170 | with q.indent(2): |
| 2171 | q.breakable() |
| 2172 | q.text("xid = "); |
| 2173 | if self.xid != None: |
| 2174 | q.text("%#x" % self.xid) |
| 2175 | else: |
| 2176 | q.text('None') |
| 2177 | q.text(","); q.breakable() |
| 2178 | q.text("connections = "); |
| 2179 | q.pp(self.connections) |
| 2180 | q.breakable() |
| 2181 | q.text('}') |
| 2182 | |
| 2183 | bsn_header.subtypes[57] = bsn_controller_connections_reply |
| 2184 | |
| 2185 | class bsn_controller_connections_request(bsn_header): |
| 2186 | version = 4 |
| 2187 | type = 4 |
| 2188 | experimenter = 6035143 |
| 2189 | subtype = 56 |
| 2190 | |
| 2191 | def __init__(self, xid=None): |
| 2192 | if xid != None: |
| 2193 | self.xid = xid |
| 2194 | else: |
| 2195 | self.xid = None |
| 2196 | return |
| 2197 | |
| 2198 | def pack(self): |
| 2199 | packed = [] |
| 2200 | packed.append(struct.pack("!B", self.version)) |
| 2201 | packed.append(struct.pack("!B", self.type)) |
| 2202 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 2203 | packed.append(struct.pack("!L", self.xid)) |
| 2204 | packed.append(struct.pack("!L", self.experimenter)) |
| 2205 | packed.append(struct.pack("!L", self.subtype)) |
| 2206 | length = sum([len(x) for x in packed]) |
| 2207 | packed[2] = struct.pack("!H", length) |
| 2208 | return ''.join(packed) |
| 2209 | |
| 2210 | @staticmethod |
| 2211 | def unpack(reader): |
| 2212 | obj = bsn_controller_connections_request() |
| 2213 | _version = reader.read("!B")[0] |
| 2214 | assert(_version == 4) |
| 2215 | _type = reader.read("!B")[0] |
| 2216 | assert(_type == 4) |
| 2217 | _length = reader.read("!H")[0] |
| 2218 | orig_reader = reader |
| 2219 | reader = orig_reader.slice(_length, 4) |
| 2220 | obj.xid = reader.read("!L")[0] |
| 2221 | _experimenter = reader.read("!L")[0] |
| 2222 | assert(_experimenter == 6035143) |
| 2223 | _subtype = reader.read("!L")[0] |
| 2224 | assert(_subtype == 56) |
| 2225 | return obj |
| 2226 | |
| 2227 | def __eq__(self, other): |
| 2228 | if type(self) != type(other): return False |
| 2229 | if self.xid != other.xid: return False |
| 2230 | return True |
| 2231 | |
| 2232 | def pretty_print(self, q): |
| 2233 | q.text("bsn_controller_connections_request {") |
| 2234 | with q.group(): |
| 2235 | with q.indent(2): |
| 2236 | q.breakable() |
| 2237 | q.text("xid = "); |
| 2238 | if self.xid != None: |
| 2239 | q.text("%#x" % self.xid) |
| 2240 | else: |
| 2241 | q.text('None') |
| 2242 | q.breakable() |
| 2243 | q.text('}') |
| 2244 | |
| 2245 | bsn_header.subtypes[56] = bsn_controller_connections_request |
| 2246 | |
| 2247 | class experimenter_stats_reply(stats_reply): |
| 2248 | subtypes = {} |
| 2249 | |
| 2250 | version = 4 |
| 2251 | type = 19 |
| 2252 | stats_type = 65535 |
| 2253 | |
| 2254 | def __init__(self, xid=None, flags=None, experimenter=None, subtype=None): |
| 2255 | if xid != None: |
| 2256 | self.xid = xid |
| 2257 | else: |
| 2258 | self.xid = None |
| 2259 | if flags != None: |
| 2260 | self.flags = flags |
| 2261 | else: |
| 2262 | self.flags = 0 |
| 2263 | if experimenter != None: |
| 2264 | self.experimenter = experimenter |
| 2265 | else: |
| 2266 | self.experimenter = 0 |
| 2267 | if subtype != None: |
| 2268 | self.subtype = subtype |
| 2269 | else: |
| 2270 | self.subtype = 0 |
| 2271 | return |
| 2272 | |
| 2273 | def pack(self): |
| 2274 | packed = [] |
| 2275 | packed.append(struct.pack("!B", self.version)) |
| 2276 | packed.append(struct.pack("!B", self.type)) |
| 2277 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 2278 | packed.append(struct.pack("!L", self.xid)) |
| 2279 | packed.append(struct.pack("!H", self.stats_type)) |
| 2280 | packed.append(struct.pack("!H", self.flags)) |
| 2281 | packed.append('\x00' * 4) |
| 2282 | packed.append(struct.pack("!L", self.experimenter)) |
| 2283 | packed.append(struct.pack("!L", self.subtype)) |
| 2284 | length = sum([len(x) for x in packed]) |
| 2285 | packed[2] = struct.pack("!H", length) |
| 2286 | return ''.join(packed) |
| 2287 | |
| 2288 | @staticmethod |
| 2289 | def unpack(reader): |
| 2290 | subtype, = reader.peek('!L', 16) |
| 2291 | subclass = experimenter_stats_reply.subtypes.get(subtype) |
| 2292 | if subclass: |
| 2293 | return subclass.unpack(reader) |
| 2294 | |
| 2295 | obj = experimenter_stats_reply() |
| 2296 | _version = reader.read("!B")[0] |
| 2297 | assert(_version == 4) |
| 2298 | _type = reader.read("!B")[0] |
| 2299 | assert(_type == 19) |
| 2300 | _length = reader.read("!H")[0] |
| 2301 | orig_reader = reader |
| 2302 | reader = orig_reader.slice(_length, 4) |
| 2303 | obj.xid = reader.read("!L")[0] |
| 2304 | _stats_type = reader.read("!H")[0] |
| 2305 | assert(_stats_type == 65535) |
| 2306 | obj.flags = reader.read("!H")[0] |
| 2307 | reader.skip(4) |
| 2308 | obj.experimenter = reader.read("!L")[0] |
| 2309 | obj.subtype = reader.read("!L")[0] |
| 2310 | return obj |
| 2311 | |
| 2312 | def __eq__(self, other): |
| 2313 | if type(self) != type(other): return False |
| 2314 | if self.xid != other.xid: return False |
| 2315 | if self.flags != other.flags: return False |
| 2316 | if self.experimenter != other.experimenter: return False |
| 2317 | if self.subtype != other.subtype: return False |
| 2318 | return True |
| 2319 | |
| 2320 | def pretty_print(self, q): |
| 2321 | q.text("experimenter_stats_reply {") |
| 2322 | with q.group(): |
| 2323 | with q.indent(2): |
| 2324 | q.breakable() |
| 2325 | q.text("xid = "); |
| 2326 | if self.xid != None: |
| 2327 | q.text("%#x" % self.xid) |
| 2328 | else: |
| 2329 | q.text('None') |
| 2330 | q.text(","); q.breakable() |
| 2331 | q.text("flags = "); |
| 2332 | q.text("%#x" % self.flags) |
| 2333 | q.text(","); q.breakable() |
| 2334 | q.text("subtype = "); |
| 2335 | q.text("%#x" % self.subtype) |
| 2336 | q.breakable() |
| 2337 | q.text('}') |
| 2338 | |
| 2339 | stats_reply.subtypes[65535] = experimenter_stats_reply |
| 2340 | |
| 2341 | class bsn_stats_reply(experimenter_stats_reply): |
| 2342 | subtypes = {} |
| 2343 | |
| 2344 | version = 4 |
| 2345 | type = 19 |
| 2346 | stats_type = 65535 |
| 2347 | experimenter = 6035143 |
| 2348 | |
| 2349 | def __init__(self, xid=None, flags=None, subtype=None): |
| 2350 | if xid != None: |
| 2351 | self.xid = xid |
| 2352 | else: |
| 2353 | self.xid = None |
| 2354 | if flags != None: |
| 2355 | self.flags = flags |
| 2356 | else: |
| 2357 | self.flags = 0 |
| 2358 | if subtype != None: |
| 2359 | self.subtype = subtype |
| 2360 | else: |
| 2361 | self.subtype = 0 |
| 2362 | return |
| 2363 | |
| 2364 | def pack(self): |
| 2365 | packed = [] |
| 2366 | packed.append(struct.pack("!B", self.version)) |
| 2367 | packed.append(struct.pack("!B", self.type)) |
| 2368 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 2369 | packed.append(struct.pack("!L", self.xid)) |
| 2370 | packed.append(struct.pack("!H", self.stats_type)) |
| 2371 | packed.append(struct.pack("!H", self.flags)) |
| 2372 | packed.append('\x00' * 4) |
| 2373 | packed.append(struct.pack("!L", self.experimenter)) |
| 2374 | packed.append(struct.pack("!L", self.subtype)) |
| 2375 | length = sum([len(x) for x in packed]) |
| 2376 | packed[2] = struct.pack("!H", length) |
| 2377 | return ''.join(packed) |
| 2378 | |
| 2379 | @staticmethod |
| 2380 | def unpack(reader): |
| 2381 | subtype, = reader.peek('!L', 20) |
| 2382 | subclass = bsn_stats_reply.subtypes.get(subtype) |
| 2383 | if subclass: |
| 2384 | return subclass.unpack(reader) |
| 2385 | |
| 2386 | obj = bsn_stats_reply() |
| 2387 | _version = reader.read("!B")[0] |
| 2388 | assert(_version == 4) |
| 2389 | _type = reader.read("!B")[0] |
| 2390 | assert(_type == 19) |
| 2391 | _length = reader.read("!H")[0] |
| 2392 | orig_reader = reader |
| 2393 | reader = orig_reader.slice(_length, 4) |
| 2394 | obj.xid = reader.read("!L")[0] |
| 2395 | _stats_type = reader.read("!H")[0] |
| 2396 | assert(_stats_type == 65535) |
| 2397 | obj.flags = reader.read("!H")[0] |
| 2398 | reader.skip(4) |
| 2399 | _experimenter = reader.read("!L")[0] |
| 2400 | assert(_experimenter == 6035143) |
| 2401 | obj.subtype = reader.read("!L")[0] |
| 2402 | return obj |
| 2403 | |
| 2404 | def __eq__(self, other): |
| 2405 | if type(self) != type(other): return False |
| 2406 | if self.xid != other.xid: return False |
| 2407 | if self.flags != other.flags: return False |
| 2408 | if self.subtype != other.subtype: return False |
| 2409 | return True |
| 2410 | |
| 2411 | def pretty_print(self, q): |
| 2412 | q.text("bsn_stats_reply {") |
| 2413 | with q.group(): |
| 2414 | with q.indent(2): |
| 2415 | q.breakable() |
| 2416 | q.text("xid = "); |
| 2417 | if self.xid != None: |
| 2418 | q.text("%#x" % self.xid) |
| 2419 | else: |
| 2420 | q.text('None') |
| 2421 | q.text(","); q.breakable() |
| 2422 | q.text("flags = "); |
| 2423 | q.text("%#x" % self.flags) |
| 2424 | q.breakable() |
| 2425 | q.text('}') |
| 2426 | |
| 2427 | experimenter_stats_reply.subtypes[6035143] = bsn_stats_reply |
| 2428 | |
| 2429 | class bsn_debug_counter_desc_stats_reply(bsn_stats_reply): |
| 2430 | version = 4 |
| 2431 | type = 19 |
| 2432 | stats_type = 65535 |
| 2433 | experimenter = 6035143 |
| 2434 | subtype = 13 |
| 2435 | |
| 2436 | def __init__(self, xid=None, flags=None, entries=None): |
| 2437 | if xid != None: |
| 2438 | self.xid = xid |
| 2439 | else: |
| 2440 | self.xid = None |
| 2441 | if flags != None: |
| 2442 | self.flags = flags |
| 2443 | else: |
| 2444 | self.flags = 0 |
| 2445 | if entries != None: |
| 2446 | self.entries = entries |
| 2447 | else: |
| 2448 | self.entries = [] |
| 2449 | return |
| 2450 | |
| 2451 | def pack(self): |
| 2452 | packed = [] |
| 2453 | packed.append(struct.pack("!B", self.version)) |
| 2454 | packed.append(struct.pack("!B", self.type)) |
| 2455 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 2456 | packed.append(struct.pack("!L", self.xid)) |
| 2457 | packed.append(struct.pack("!H", self.stats_type)) |
| 2458 | packed.append(struct.pack("!H", self.flags)) |
| 2459 | packed.append('\x00' * 4) |
| 2460 | packed.append(struct.pack("!L", self.experimenter)) |
| 2461 | packed.append(struct.pack("!L", self.subtype)) |
| 2462 | packed.append(loxi.generic_util.pack_list(self.entries)) |
| 2463 | length = sum([len(x) for x in packed]) |
| 2464 | packed[2] = struct.pack("!H", length) |
| 2465 | return ''.join(packed) |
| 2466 | |
| 2467 | @staticmethod |
| 2468 | def unpack(reader): |
| 2469 | obj = bsn_debug_counter_desc_stats_reply() |
| 2470 | _version = reader.read("!B")[0] |
| 2471 | assert(_version == 4) |
| 2472 | _type = reader.read("!B")[0] |
| 2473 | assert(_type == 19) |
| 2474 | _length = reader.read("!H")[0] |
| 2475 | orig_reader = reader |
| 2476 | reader = orig_reader.slice(_length, 4) |
| 2477 | obj.xid = reader.read("!L")[0] |
| 2478 | _stats_type = reader.read("!H")[0] |
| 2479 | assert(_stats_type == 65535) |
| 2480 | obj.flags = reader.read("!H")[0] |
| 2481 | reader.skip(4) |
| 2482 | _experimenter = reader.read("!L")[0] |
| 2483 | assert(_experimenter == 6035143) |
| 2484 | _subtype = reader.read("!L")[0] |
| 2485 | assert(_subtype == 13) |
| 2486 | obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.bsn_debug_counter_desc_stats_entry.unpack) |
| 2487 | return obj |
| 2488 | |
| 2489 | def __eq__(self, other): |
| 2490 | if type(self) != type(other): return False |
| 2491 | if self.xid != other.xid: return False |
| 2492 | if self.flags != other.flags: return False |
| 2493 | if self.entries != other.entries: return False |
| 2494 | return True |
| 2495 | |
| 2496 | def pretty_print(self, q): |
| 2497 | q.text("bsn_debug_counter_desc_stats_reply {") |
| 2498 | with q.group(): |
| 2499 | with q.indent(2): |
| 2500 | q.breakable() |
| 2501 | q.text("xid = "); |
| 2502 | if self.xid != None: |
| 2503 | q.text("%#x" % self.xid) |
| 2504 | else: |
| 2505 | q.text('None') |
| 2506 | q.text(","); q.breakable() |
| 2507 | q.text("flags = "); |
| 2508 | q.text("%#x" % self.flags) |
| 2509 | q.text(","); q.breakable() |
| 2510 | q.text("entries = "); |
| 2511 | q.pp(self.entries) |
| 2512 | q.breakable() |
| 2513 | q.text('}') |
| 2514 | |
| 2515 | bsn_stats_reply.subtypes[13] = bsn_debug_counter_desc_stats_reply |
| 2516 | |
| 2517 | class experimenter_stats_request(stats_request): |
| 2518 | subtypes = {} |
| 2519 | |
| 2520 | version = 4 |
| 2521 | type = 18 |
| 2522 | stats_type = 65535 |
| 2523 | |
| 2524 | def __init__(self, xid=None, flags=None, experimenter=None, subtype=None): |
| 2525 | if xid != None: |
| 2526 | self.xid = xid |
| 2527 | else: |
| 2528 | self.xid = None |
| 2529 | if flags != None: |
| 2530 | self.flags = flags |
| 2531 | else: |
| 2532 | self.flags = 0 |
| 2533 | if experimenter != None: |
| 2534 | self.experimenter = experimenter |
| 2535 | else: |
| 2536 | self.experimenter = 0 |
| 2537 | if subtype != None: |
| 2538 | self.subtype = subtype |
| 2539 | else: |
| 2540 | self.subtype = 0 |
| 2541 | return |
| 2542 | |
| 2543 | def pack(self): |
| 2544 | packed = [] |
| 2545 | packed.append(struct.pack("!B", self.version)) |
| 2546 | packed.append(struct.pack("!B", self.type)) |
| 2547 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 2548 | packed.append(struct.pack("!L", self.xid)) |
| 2549 | packed.append(struct.pack("!H", self.stats_type)) |
| 2550 | packed.append(struct.pack("!H", self.flags)) |
| 2551 | packed.append('\x00' * 4) |
| 2552 | packed.append(struct.pack("!L", self.experimenter)) |
| 2553 | packed.append(struct.pack("!L", self.subtype)) |
| 2554 | length = sum([len(x) for x in packed]) |
| 2555 | packed[2] = struct.pack("!H", length) |
| 2556 | return ''.join(packed) |
| 2557 | |
| 2558 | @staticmethod |
| 2559 | def unpack(reader): |
| 2560 | subtype, = reader.peek('!L', 16) |
| 2561 | subclass = experimenter_stats_request.subtypes.get(subtype) |
| 2562 | if subclass: |
| 2563 | return subclass.unpack(reader) |
| 2564 | |
| 2565 | obj = experimenter_stats_request() |
| 2566 | _version = reader.read("!B")[0] |
| 2567 | assert(_version == 4) |
| 2568 | _type = reader.read("!B")[0] |
| 2569 | assert(_type == 18) |
| 2570 | _length = reader.read("!H")[0] |
| 2571 | orig_reader = reader |
| 2572 | reader = orig_reader.slice(_length, 4) |
| 2573 | obj.xid = reader.read("!L")[0] |
| 2574 | _stats_type = reader.read("!H")[0] |
| 2575 | assert(_stats_type == 65535) |
| 2576 | obj.flags = reader.read("!H")[0] |
| 2577 | reader.skip(4) |
| 2578 | obj.experimenter = reader.read("!L")[0] |
| 2579 | obj.subtype = reader.read("!L")[0] |
| 2580 | return obj |
| 2581 | |
| 2582 | def __eq__(self, other): |
| 2583 | if type(self) != type(other): return False |
| 2584 | if self.xid != other.xid: return False |
| 2585 | if self.flags != other.flags: return False |
| 2586 | if self.experimenter != other.experimenter: return False |
| 2587 | if self.subtype != other.subtype: return False |
| 2588 | return True |
| 2589 | |
| 2590 | def pretty_print(self, q): |
| 2591 | q.text("experimenter_stats_request {") |
| 2592 | with q.group(): |
| 2593 | with q.indent(2): |
| 2594 | q.breakable() |
| 2595 | q.text("xid = "); |
| 2596 | if self.xid != None: |
| 2597 | q.text("%#x" % self.xid) |
| 2598 | else: |
| 2599 | q.text('None') |
| 2600 | q.text(","); q.breakable() |
| 2601 | q.text("flags = "); |
| 2602 | q.text("%#x" % self.flags) |
| 2603 | q.text(","); q.breakable() |
| 2604 | q.text("subtype = "); |
| 2605 | q.text("%#x" % self.subtype) |
| 2606 | q.breakable() |
| 2607 | q.text('}') |
| 2608 | |
| 2609 | stats_request.subtypes[65535] = experimenter_stats_request |
| 2610 | |
| 2611 | class bsn_stats_request(experimenter_stats_request): |
| 2612 | subtypes = {} |
| 2613 | |
| 2614 | version = 4 |
| 2615 | type = 18 |
| 2616 | stats_type = 65535 |
| 2617 | experimenter = 6035143 |
| 2618 | |
| 2619 | def __init__(self, xid=None, flags=None, subtype=None): |
| 2620 | if xid != None: |
| 2621 | self.xid = xid |
| 2622 | else: |
| 2623 | self.xid = None |
| 2624 | if flags != None: |
| 2625 | self.flags = flags |
| 2626 | else: |
| 2627 | self.flags = 0 |
| 2628 | if subtype != None: |
| 2629 | self.subtype = subtype |
| 2630 | else: |
| 2631 | self.subtype = 0 |
| 2632 | return |
| 2633 | |
| 2634 | def pack(self): |
| 2635 | packed = [] |
| 2636 | packed.append(struct.pack("!B", self.version)) |
| 2637 | packed.append(struct.pack("!B", self.type)) |
| 2638 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 2639 | packed.append(struct.pack("!L", self.xid)) |
| 2640 | packed.append(struct.pack("!H", self.stats_type)) |
| 2641 | packed.append(struct.pack("!H", self.flags)) |
| 2642 | packed.append('\x00' * 4) |
| 2643 | packed.append(struct.pack("!L", self.experimenter)) |
| 2644 | packed.append(struct.pack("!L", self.subtype)) |
| 2645 | length = sum([len(x) for x in packed]) |
| 2646 | packed[2] = struct.pack("!H", length) |
| 2647 | return ''.join(packed) |
| 2648 | |
| 2649 | @staticmethod |
| 2650 | def unpack(reader): |
| 2651 | subtype, = reader.peek('!L', 20) |
| 2652 | subclass = bsn_stats_request.subtypes.get(subtype) |
| 2653 | if subclass: |
| 2654 | return subclass.unpack(reader) |
| 2655 | |
| 2656 | obj = bsn_stats_request() |
| 2657 | _version = reader.read("!B")[0] |
| 2658 | assert(_version == 4) |
| 2659 | _type = reader.read("!B")[0] |
| 2660 | assert(_type == 18) |
| 2661 | _length = reader.read("!H")[0] |
| 2662 | orig_reader = reader |
| 2663 | reader = orig_reader.slice(_length, 4) |
| 2664 | obj.xid = reader.read("!L")[0] |
| 2665 | _stats_type = reader.read("!H")[0] |
| 2666 | assert(_stats_type == 65535) |
| 2667 | obj.flags = reader.read("!H")[0] |
| 2668 | reader.skip(4) |
| 2669 | _experimenter = reader.read("!L")[0] |
| 2670 | assert(_experimenter == 6035143) |
| 2671 | obj.subtype = reader.read("!L")[0] |
| 2672 | return obj |
| 2673 | |
| 2674 | def __eq__(self, other): |
| 2675 | if type(self) != type(other): return False |
| 2676 | if self.xid != other.xid: return False |
| 2677 | if self.flags != other.flags: return False |
| 2678 | if self.subtype != other.subtype: return False |
| 2679 | return True |
| 2680 | |
| 2681 | def pretty_print(self, q): |
| 2682 | q.text("bsn_stats_request {") |
| 2683 | with q.group(): |
| 2684 | with q.indent(2): |
| 2685 | q.breakable() |
| 2686 | q.text("xid = "); |
| 2687 | if self.xid != None: |
| 2688 | q.text("%#x" % self.xid) |
| 2689 | else: |
| 2690 | q.text('None') |
| 2691 | q.text(","); q.breakable() |
| 2692 | q.text("flags = "); |
| 2693 | q.text("%#x" % self.flags) |
| 2694 | q.breakable() |
| 2695 | q.text('}') |
| 2696 | |
| 2697 | experimenter_stats_request.subtypes[6035143] = bsn_stats_request |
| 2698 | |
| 2699 | class bsn_debug_counter_desc_stats_request(bsn_stats_request): |
| 2700 | version = 4 |
| 2701 | type = 18 |
| 2702 | stats_type = 65535 |
| 2703 | experimenter = 6035143 |
| 2704 | subtype = 13 |
| 2705 | |
| 2706 | def __init__(self, xid=None, flags=None): |
| 2707 | if xid != None: |
| 2708 | self.xid = xid |
| 2709 | else: |
| 2710 | self.xid = None |
| 2711 | if flags != None: |
| 2712 | self.flags = flags |
| 2713 | else: |
| 2714 | self.flags = 0 |
| 2715 | return |
| 2716 | |
| 2717 | def pack(self): |
| 2718 | packed = [] |
| 2719 | packed.append(struct.pack("!B", self.version)) |
| 2720 | packed.append(struct.pack("!B", self.type)) |
| 2721 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 2722 | packed.append(struct.pack("!L", self.xid)) |
| 2723 | packed.append(struct.pack("!H", self.stats_type)) |
| 2724 | packed.append(struct.pack("!H", self.flags)) |
| 2725 | packed.append('\x00' * 4) |
| 2726 | packed.append(struct.pack("!L", self.experimenter)) |
| 2727 | packed.append(struct.pack("!L", self.subtype)) |
| 2728 | length = sum([len(x) for x in packed]) |
| 2729 | packed[2] = struct.pack("!H", length) |
| 2730 | return ''.join(packed) |
| 2731 | |
| 2732 | @staticmethod |
| 2733 | def unpack(reader): |
| 2734 | obj = bsn_debug_counter_desc_stats_request() |
| 2735 | _version = reader.read("!B")[0] |
| 2736 | assert(_version == 4) |
| 2737 | _type = reader.read("!B")[0] |
| 2738 | assert(_type == 18) |
| 2739 | _length = reader.read("!H")[0] |
| 2740 | orig_reader = reader |
| 2741 | reader = orig_reader.slice(_length, 4) |
| 2742 | obj.xid = reader.read("!L")[0] |
| 2743 | _stats_type = reader.read("!H")[0] |
| 2744 | assert(_stats_type == 65535) |
| 2745 | obj.flags = reader.read("!H")[0] |
| 2746 | reader.skip(4) |
| 2747 | _experimenter = reader.read("!L")[0] |
| 2748 | assert(_experimenter == 6035143) |
| 2749 | _subtype = reader.read("!L")[0] |
| 2750 | assert(_subtype == 13) |
| 2751 | return obj |
| 2752 | |
| 2753 | def __eq__(self, other): |
| 2754 | if type(self) != type(other): return False |
| 2755 | if self.xid != other.xid: return False |
| 2756 | if self.flags != other.flags: return False |
| 2757 | return True |
| 2758 | |
| 2759 | def pretty_print(self, q): |
| 2760 | q.text("bsn_debug_counter_desc_stats_request {") |
| 2761 | with q.group(): |
| 2762 | with q.indent(2): |
| 2763 | q.breakable() |
| 2764 | q.text("xid = "); |
| 2765 | if self.xid != None: |
| 2766 | q.text("%#x" % self.xid) |
| 2767 | else: |
| 2768 | q.text('None') |
| 2769 | q.text(","); q.breakable() |
| 2770 | q.text("flags = "); |
| 2771 | q.text("%#x" % self.flags) |
| 2772 | q.breakable() |
| 2773 | q.text('}') |
| 2774 | |
| 2775 | bsn_stats_request.subtypes[13] = bsn_debug_counter_desc_stats_request |
| 2776 | |
| 2777 | class bsn_debug_counter_stats_reply(bsn_stats_reply): |
| 2778 | version = 4 |
| 2779 | type = 19 |
| 2780 | stats_type = 65535 |
| 2781 | experimenter = 6035143 |
| 2782 | subtype = 12 |
| 2783 | |
| 2784 | def __init__(self, xid=None, flags=None, entries=None): |
| 2785 | if xid != None: |
| 2786 | self.xid = xid |
| 2787 | else: |
| 2788 | self.xid = None |
| 2789 | if flags != None: |
| 2790 | self.flags = flags |
| 2791 | else: |
| 2792 | self.flags = 0 |
| 2793 | if entries != None: |
| 2794 | self.entries = entries |
| 2795 | else: |
| 2796 | self.entries = [] |
| 2797 | return |
| 2798 | |
| 2799 | def pack(self): |
| 2800 | packed = [] |
| 2801 | packed.append(struct.pack("!B", self.version)) |
| 2802 | packed.append(struct.pack("!B", self.type)) |
| 2803 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 2804 | packed.append(struct.pack("!L", self.xid)) |
| 2805 | packed.append(struct.pack("!H", self.stats_type)) |
| 2806 | packed.append(struct.pack("!H", self.flags)) |
| 2807 | packed.append('\x00' * 4) |
| 2808 | packed.append(struct.pack("!L", self.experimenter)) |
| 2809 | packed.append(struct.pack("!L", self.subtype)) |
| 2810 | packed.append(loxi.generic_util.pack_list(self.entries)) |
| 2811 | length = sum([len(x) for x in packed]) |
| 2812 | packed[2] = struct.pack("!H", length) |
| 2813 | return ''.join(packed) |
| 2814 | |
| 2815 | @staticmethod |
| 2816 | def unpack(reader): |
| 2817 | obj = bsn_debug_counter_stats_reply() |
| 2818 | _version = reader.read("!B")[0] |
| 2819 | assert(_version == 4) |
| 2820 | _type = reader.read("!B")[0] |
| 2821 | assert(_type == 19) |
| 2822 | _length = reader.read("!H")[0] |
| 2823 | orig_reader = reader |
| 2824 | reader = orig_reader.slice(_length, 4) |
| 2825 | obj.xid = reader.read("!L")[0] |
| 2826 | _stats_type = reader.read("!H")[0] |
| 2827 | assert(_stats_type == 65535) |
| 2828 | obj.flags = reader.read("!H")[0] |
| 2829 | reader.skip(4) |
| 2830 | _experimenter = reader.read("!L")[0] |
| 2831 | assert(_experimenter == 6035143) |
| 2832 | _subtype = reader.read("!L")[0] |
| 2833 | assert(_subtype == 12) |
| 2834 | obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.bsn_debug_counter_stats_entry.unpack) |
| 2835 | return obj |
| 2836 | |
| 2837 | def __eq__(self, other): |
| 2838 | if type(self) != type(other): return False |
| 2839 | if self.xid != other.xid: return False |
| 2840 | if self.flags != other.flags: return False |
| 2841 | if self.entries != other.entries: return False |
| 2842 | return True |
| 2843 | |
| 2844 | def pretty_print(self, q): |
| 2845 | q.text("bsn_debug_counter_stats_reply {") |
| 2846 | with q.group(): |
| 2847 | with q.indent(2): |
| 2848 | q.breakable() |
| 2849 | q.text("xid = "); |
| 2850 | if self.xid != None: |
| 2851 | q.text("%#x" % self.xid) |
| 2852 | else: |
| 2853 | q.text('None') |
| 2854 | q.text(","); q.breakable() |
| 2855 | q.text("flags = "); |
| 2856 | q.text("%#x" % self.flags) |
| 2857 | q.text(","); q.breakable() |
| 2858 | q.text("entries = "); |
| 2859 | q.pp(self.entries) |
| 2860 | q.breakable() |
| 2861 | q.text('}') |
| 2862 | |
| 2863 | bsn_stats_reply.subtypes[12] = bsn_debug_counter_stats_reply |
| 2864 | |
| 2865 | class bsn_debug_counter_stats_request(bsn_stats_request): |
| 2866 | version = 4 |
| 2867 | type = 18 |
| 2868 | stats_type = 65535 |
| 2869 | experimenter = 6035143 |
| 2870 | subtype = 12 |
| 2871 | |
| 2872 | def __init__(self, xid=None, flags=None): |
| 2873 | if xid != None: |
| 2874 | self.xid = xid |
| 2875 | else: |
| 2876 | self.xid = None |
| 2877 | if flags != None: |
| 2878 | self.flags = flags |
| 2879 | else: |
| 2880 | self.flags = 0 |
| 2881 | return |
| 2882 | |
| 2883 | def pack(self): |
| 2884 | packed = [] |
| 2885 | packed.append(struct.pack("!B", self.version)) |
| 2886 | packed.append(struct.pack("!B", self.type)) |
| 2887 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 2888 | packed.append(struct.pack("!L", self.xid)) |
| 2889 | packed.append(struct.pack("!H", self.stats_type)) |
| 2890 | packed.append(struct.pack("!H", self.flags)) |
| 2891 | packed.append('\x00' * 4) |
| 2892 | packed.append(struct.pack("!L", self.experimenter)) |
| 2893 | packed.append(struct.pack("!L", self.subtype)) |
| 2894 | length = sum([len(x) for x in packed]) |
| 2895 | packed[2] = struct.pack("!H", length) |
| 2896 | return ''.join(packed) |
| 2897 | |
| 2898 | @staticmethod |
| 2899 | def unpack(reader): |
| 2900 | obj = bsn_debug_counter_stats_request() |
| 2901 | _version = reader.read("!B")[0] |
| 2902 | assert(_version == 4) |
| 2903 | _type = reader.read("!B")[0] |
| 2904 | assert(_type == 18) |
| 2905 | _length = reader.read("!H")[0] |
| 2906 | orig_reader = reader |
| 2907 | reader = orig_reader.slice(_length, 4) |
| 2908 | obj.xid = reader.read("!L")[0] |
| 2909 | _stats_type = reader.read("!H")[0] |
| 2910 | assert(_stats_type == 65535) |
| 2911 | obj.flags = reader.read("!H")[0] |
| 2912 | reader.skip(4) |
| 2913 | _experimenter = reader.read("!L")[0] |
| 2914 | assert(_experimenter == 6035143) |
| 2915 | _subtype = reader.read("!L")[0] |
| 2916 | assert(_subtype == 12) |
| 2917 | return obj |
| 2918 | |
| 2919 | def __eq__(self, other): |
| 2920 | if type(self) != type(other): return False |
| 2921 | if self.xid != other.xid: return False |
| 2922 | if self.flags != other.flags: return False |
| 2923 | return True |
| 2924 | |
| 2925 | def pretty_print(self, q): |
| 2926 | q.text("bsn_debug_counter_stats_request {") |
| 2927 | with q.group(): |
| 2928 | with q.indent(2): |
| 2929 | q.breakable() |
| 2930 | q.text("xid = "); |
| 2931 | if self.xid != None: |
| 2932 | q.text("%#x" % self.xid) |
| 2933 | else: |
| 2934 | q.text('None') |
| 2935 | q.text(","); q.breakable() |
| 2936 | q.text("flags = "); |
| 2937 | q.text("%#x" % self.flags) |
| 2938 | q.breakable() |
| 2939 | q.text('}') |
| 2940 | |
| 2941 | bsn_stats_request.subtypes[12] = bsn_debug_counter_stats_request |
| 2942 | |
| 2943 | class bsn_error(bsn_base_error): |
| 2944 | version = 4 |
| 2945 | type = 1 |
| 2946 | err_type = 65535 |
| 2947 | subtype = 1 |
| 2948 | experimenter = 6035143 |
| 2949 | |
| 2950 | def __init__(self, xid=None, err_msg=None, data=None): |
| 2951 | if xid != None: |
| 2952 | self.xid = xid |
| 2953 | else: |
| 2954 | self.xid = None |
| 2955 | if err_msg != None: |
| 2956 | self.err_msg = err_msg |
| 2957 | else: |
| 2958 | self.err_msg = "" |
| 2959 | if data != None: |
| 2960 | self.data = data |
| 2961 | else: |
| 2962 | self.data = '' |
| 2963 | return |
| 2964 | |
| 2965 | def pack(self): |
| 2966 | packed = [] |
| 2967 | packed.append(struct.pack("!B", self.version)) |
| 2968 | packed.append(struct.pack("!B", self.type)) |
| 2969 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 2970 | packed.append(struct.pack("!L", self.xid)) |
| 2971 | packed.append(struct.pack("!H", self.err_type)) |
| 2972 | packed.append(struct.pack("!H", self.subtype)) |
| 2973 | packed.append(struct.pack("!L", self.experimenter)) |
| 2974 | packed.append(struct.pack("!256s", self.err_msg)) |
| 2975 | packed.append(self.data) |
| 2976 | length = sum([len(x) for x in packed]) |
| 2977 | packed[2] = struct.pack("!H", length) |
| 2978 | return ''.join(packed) |
| 2979 | |
| 2980 | @staticmethod |
| 2981 | def unpack(reader): |
| 2982 | obj = bsn_error() |
| 2983 | _version = reader.read("!B")[0] |
| 2984 | assert(_version == 4) |
| 2985 | _type = reader.read("!B")[0] |
| 2986 | assert(_type == 1) |
| 2987 | _length = reader.read("!H")[0] |
| 2988 | orig_reader = reader |
| 2989 | reader = orig_reader.slice(_length, 4) |
| 2990 | obj.xid = reader.read("!L")[0] |
| 2991 | _err_type = reader.read("!H")[0] |
| 2992 | assert(_err_type == 65535) |
| 2993 | _subtype = reader.read("!H")[0] |
| 2994 | assert(_subtype == 1) |
| 2995 | _experimenter = reader.read("!L")[0] |
| 2996 | assert(_experimenter == 6035143) |
| 2997 | obj.err_msg = reader.read("!256s")[0].rstrip("\x00") |
| 2998 | obj.data = str(reader.read_all()) |
| 2999 | return obj |
| 3000 | |
| 3001 | def __eq__(self, other): |
| 3002 | if type(self) != type(other): return False |
| 3003 | if self.xid != other.xid: return False |
| 3004 | if self.err_msg != other.err_msg: return False |
| 3005 | if self.data != other.data: return False |
| 3006 | return True |
| 3007 | |
| 3008 | def pretty_print(self, q): |
| 3009 | q.text("bsn_error {") |
| 3010 | with q.group(): |
| 3011 | with q.indent(2): |
| 3012 | q.breakable() |
| 3013 | q.text("xid = "); |
| 3014 | if self.xid != None: |
| 3015 | q.text("%#x" % self.xid) |
| 3016 | else: |
| 3017 | q.text('None') |
| 3018 | q.text(","); q.breakable() |
| 3019 | q.text("err_msg = "); |
| 3020 | q.pp(self.err_msg) |
| 3021 | q.text(","); q.breakable() |
| 3022 | q.text("data = "); |
| 3023 | q.pp(self.data) |
| 3024 | q.breakable() |
| 3025 | q.text('}') |
| 3026 | |
| 3027 | bsn_base_error.subtypes[1] = bsn_error |
| 3028 | |
| 3029 | class bsn_flow_checksum_bucket_stats_reply(bsn_stats_reply): |
| 3030 | version = 4 |
| 3031 | type = 19 |
| 3032 | stats_type = 65535 |
| 3033 | experimenter = 6035143 |
| 3034 | subtype = 10 |
| 3035 | |
| 3036 | def __init__(self, xid=None, flags=None, entries=None): |
| 3037 | if xid != None: |
| 3038 | self.xid = xid |
| 3039 | else: |
| 3040 | self.xid = None |
| 3041 | if flags != None: |
| 3042 | self.flags = flags |
| 3043 | else: |
| 3044 | self.flags = 0 |
| 3045 | if entries != None: |
| 3046 | self.entries = entries |
| 3047 | else: |
| 3048 | self.entries = [] |
| 3049 | return |
| 3050 | |
| 3051 | def pack(self): |
| 3052 | packed = [] |
| 3053 | packed.append(struct.pack("!B", self.version)) |
| 3054 | packed.append(struct.pack("!B", self.type)) |
| 3055 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 3056 | packed.append(struct.pack("!L", self.xid)) |
| 3057 | packed.append(struct.pack("!H", self.stats_type)) |
| 3058 | packed.append(struct.pack("!H", self.flags)) |
| 3059 | packed.append('\x00' * 4) |
| 3060 | packed.append(struct.pack("!L", self.experimenter)) |
| 3061 | packed.append(struct.pack("!L", self.subtype)) |
| 3062 | packed.append(loxi.generic_util.pack_list(self.entries)) |
| 3063 | length = sum([len(x) for x in packed]) |
| 3064 | packed[2] = struct.pack("!H", length) |
| 3065 | return ''.join(packed) |
| 3066 | |
| 3067 | @staticmethod |
| 3068 | def unpack(reader): |
| 3069 | obj = bsn_flow_checksum_bucket_stats_reply() |
| 3070 | _version = reader.read("!B")[0] |
| 3071 | assert(_version == 4) |
| 3072 | _type = reader.read("!B")[0] |
| 3073 | assert(_type == 19) |
| 3074 | _length = reader.read("!H")[0] |
| 3075 | orig_reader = reader |
| 3076 | reader = orig_reader.slice(_length, 4) |
| 3077 | obj.xid = reader.read("!L")[0] |
| 3078 | _stats_type = reader.read("!H")[0] |
| 3079 | assert(_stats_type == 65535) |
| 3080 | obj.flags = reader.read("!H")[0] |
| 3081 | reader.skip(4) |
| 3082 | _experimenter = reader.read("!L")[0] |
| 3083 | assert(_experimenter == 6035143) |
| 3084 | _subtype = reader.read("!L")[0] |
| 3085 | assert(_subtype == 10) |
| 3086 | obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.bsn_flow_checksum_bucket_stats_entry.unpack) |
| 3087 | return obj |
| 3088 | |
| 3089 | def __eq__(self, other): |
| 3090 | if type(self) != type(other): return False |
| 3091 | if self.xid != other.xid: return False |
| 3092 | if self.flags != other.flags: return False |
| 3093 | if self.entries != other.entries: return False |
| 3094 | return True |
| 3095 | |
| 3096 | def pretty_print(self, q): |
| 3097 | q.text("bsn_flow_checksum_bucket_stats_reply {") |
| 3098 | with q.group(): |
| 3099 | with q.indent(2): |
| 3100 | q.breakable() |
| 3101 | q.text("xid = "); |
| 3102 | if self.xid != None: |
| 3103 | q.text("%#x" % self.xid) |
| 3104 | else: |
| 3105 | q.text('None') |
| 3106 | q.text(","); q.breakable() |
| 3107 | q.text("flags = "); |
| 3108 | q.text("%#x" % self.flags) |
| 3109 | q.text(","); q.breakable() |
| 3110 | q.text("entries = "); |
| 3111 | q.pp(self.entries) |
| 3112 | q.breakable() |
| 3113 | q.text('}') |
| 3114 | |
| 3115 | bsn_stats_reply.subtypes[10] = bsn_flow_checksum_bucket_stats_reply |
| 3116 | |
| 3117 | class bsn_flow_checksum_bucket_stats_request(bsn_stats_request): |
| 3118 | version = 4 |
| 3119 | type = 18 |
| 3120 | stats_type = 65535 |
| 3121 | experimenter = 6035143 |
| 3122 | subtype = 10 |
| 3123 | |
| 3124 | def __init__(self, xid=None, flags=None, table_id=None): |
| 3125 | if xid != None: |
| 3126 | self.xid = xid |
| 3127 | else: |
| 3128 | self.xid = None |
| 3129 | if flags != None: |
| 3130 | self.flags = flags |
| 3131 | else: |
| 3132 | self.flags = 0 |
| 3133 | if table_id != None: |
| 3134 | self.table_id = table_id |
| 3135 | else: |
| 3136 | self.table_id = 0 |
| 3137 | return |
| 3138 | |
| 3139 | def pack(self): |
| 3140 | packed = [] |
| 3141 | packed.append(struct.pack("!B", self.version)) |
| 3142 | packed.append(struct.pack("!B", self.type)) |
| 3143 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 3144 | packed.append(struct.pack("!L", self.xid)) |
| 3145 | packed.append(struct.pack("!H", self.stats_type)) |
| 3146 | packed.append(struct.pack("!H", self.flags)) |
| 3147 | packed.append('\x00' * 4) |
| 3148 | packed.append(struct.pack("!L", self.experimenter)) |
| 3149 | packed.append(struct.pack("!L", self.subtype)) |
| 3150 | packed.append(struct.pack("!B", self.table_id)) |
| 3151 | length = sum([len(x) for x in packed]) |
| 3152 | packed[2] = struct.pack("!H", length) |
| 3153 | return ''.join(packed) |
| 3154 | |
| 3155 | @staticmethod |
| 3156 | def unpack(reader): |
| 3157 | obj = bsn_flow_checksum_bucket_stats_request() |
| 3158 | _version = reader.read("!B")[0] |
| 3159 | assert(_version == 4) |
| 3160 | _type = reader.read("!B")[0] |
| 3161 | assert(_type == 18) |
| 3162 | _length = reader.read("!H")[0] |
| 3163 | orig_reader = reader |
| 3164 | reader = orig_reader.slice(_length, 4) |
| 3165 | obj.xid = reader.read("!L")[0] |
| 3166 | _stats_type = reader.read("!H")[0] |
| 3167 | assert(_stats_type == 65535) |
| 3168 | obj.flags = reader.read("!H")[0] |
| 3169 | reader.skip(4) |
| 3170 | _experimenter = reader.read("!L")[0] |
| 3171 | assert(_experimenter == 6035143) |
| 3172 | _subtype = reader.read("!L")[0] |
| 3173 | assert(_subtype == 10) |
| 3174 | obj.table_id = reader.read("!B")[0] |
| 3175 | return obj |
| 3176 | |
| 3177 | def __eq__(self, other): |
| 3178 | if type(self) != type(other): return False |
| 3179 | if self.xid != other.xid: return False |
| 3180 | if self.flags != other.flags: return False |
| 3181 | if self.table_id != other.table_id: return False |
| 3182 | return True |
| 3183 | |
| 3184 | def pretty_print(self, q): |
| 3185 | q.text("bsn_flow_checksum_bucket_stats_request {") |
| 3186 | with q.group(): |
| 3187 | with q.indent(2): |
| 3188 | q.breakable() |
| 3189 | q.text("xid = "); |
| 3190 | if self.xid != None: |
| 3191 | q.text("%#x" % self.xid) |
| 3192 | else: |
| 3193 | q.text('None') |
| 3194 | q.text(","); q.breakable() |
| 3195 | q.text("flags = "); |
| 3196 | q.text("%#x" % self.flags) |
| 3197 | q.text(","); q.breakable() |
| 3198 | q.text("table_id = "); |
| 3199 | q.text("%#x" % self.table_id) |
| 3200 | q.breakable() |
| 3201 | q.text('}') |
| 3202 | |
| 3203 | bsn_stats_request.subtypes[10] = bsn_flow_checksum_bucket_stats_request |
| 3204 | |
| 3205 | class bsn_flow_idle(bsn_header): |
| 3206 | version = 4 |
| 3207 | type = 4 |
| 3208 | experimenter = 6035143 |
| 3209 | subtype = 40 |
| 3210 | |
| 3211 | def __init__(self, xid=None, cookie=None, priority=None, table_id=None, match=None): |
| 3212 | if xid != None: |
| 3213 | self.xid = xid |
| 3214 | else: |
| 3215 | self.xid = None |
| 3216 | if cookie != None: |
| 3217 | self.cookie = cookie |
| 3218 | else: |
| 3219 | self.cookie = 0 |
| 3220 | if priority != None: |
| 3221 | self.priority = priority |
| 3222 | else: |
| 3223 | self.priority = 0 |
| 3224 | if table_id != None: |
| 3225 | self.table_id = table_id |
| 3226 | else: |
| 3227 | self.table_id = 0 |
| 3228 | if match != None: |
| 3229 | self.match = match |
| 3230 | else: |
| 3231 | self.match = ofp.match() |
| 3232 | return |
| 3233 | |
| 3234 | def pack(self): |
| 3235 | packed = [] |
| 3236 | packed.append(struct.pack("!B", self.version)) |
| 3237 | packed.append(struct.pack("!B", self.type)) |
| 3238 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 3239 | packed.append(struct.pack("!L", self.xid)) |
| 3240 | packed.append(struct.pack("!L", self.experimenter)) |
| 3241 | packed.append(struct.pack("!L", self.subtype)) |
| 3242 | packed.append(struct.pack("!Q", self.cookie)) |
| 3243 | packed.append(struct.pack("!H", self.priority)) |
| 3244 | packed.append(struct.pack("!B", self.table_id)) |
| 3245 | packed.append('\x00' * 5) |
| 3246 | packed.append(self.match.pack()) |
| 3247 | length = sum([len(x) for x in packed]) |
| 3248 | packed[2] = struct.pack("!H", length) |
| 3249 | return ''.join(packed) |
| 3250 | |
| 3251 | @staticmethod |
| 3252 | def unpack(reader): |
| 3253 | obj = bsn_flow_idle() |
| 3254 | _version = reader.read("!B")[0] |
| 3255 | assert(_version == 4) |
| 3256 | _type = reader.read("!B")[0] |
| 3257 | assert(_type == 4) |
| 3258 | _length = reader.read("!H")[0] |
| 3259 | orig_reader = reader |
| 3260 | reader = orig_reader.slice(_length, 4) |
| 3261 | obj.xid = reader.read("!L")[0] |
| 3262 | _experimenter = reader.read("!L")[0] |
| 3263 | assert(_experimenter == 6035143) |
| 3264 | _subtype = reader.read("!L")[0] |
| 3265 | assert(_subtype == 40) |
| 3266 | obj.cookie = reader.read("!Q")[0] |
| 3267 | obj.priority = reader.read("!H")[0] |
| 3268 | obj.table_id = reader.read("!B")[0] |
| 3269 | reader.skip(5) |
| 3270 | obj.match = ofp.match.unpack(reader) |
| 3271 | return obj |
| 3272 | |
| 3273 | def __eq__(self, other): |
| 3274 | if type(self) != type(other): return False |
| 3275 | if self.xid != other.xid: return False |
| 3276 | if self.cookie != other.cookie: return False |
| 3277 | if self.priority != other.priority: return False |
| 3278 | if self.table_id != other.table_id: return False |
| 3279 | if self.match != other.match: return False |
| 3280 | return True |
| 3281 | |
| 3282 | def pretty_print(self, q): |
| 3283 | q.text("bsn_flow_idle {") |
| 3284 | with q.group(): |
| 3285 | with q.indent(2): |
| 3286 | q.breakable() |
| 3287 | q.text("xid = "); |
| 3288 | if self.xid != None: |
| 3289 | q.text("%#x" % self.xid) |
| 3290 | else: |
| 3291 | q.text('None') |
| 3292 | q.text(","); q.breakable() |
| 3293 | q.text("cookie = "); |
| 3294 | q.text("%#x" % self.cookie) |
| 3295 | q.text(","); q.breakable() |
| 3296 | q.text("priority = "); |
| 3297 | q.text("%#x" % self.priority) |
| 3298 | q.text(","); q.breakable() |
| 3299 | q.text("table_id = "); |
| 3300 | q.text("%#x" % self.table_id) |
| 3301 | q.text(","); q.breakable() |
| 3302 | q.text("match = "); |
| 3303 | q.pp(self.match) |
| 3304 | q.breakable() |
| 3305 | q.text('}') |
| 3306 | |
| 3307 | bsn_header.subtypes[40] = bsn_flow_idle |
| 3308 | |
| 3309 | class bsn_flow_idle_enable_get_reply(bsn_header): |
| 3310 | version = 4 |
| 3311 | type = 4 |
| 3312 | experimenter = 6035143 |
| 3313 | subtype = 39 |
| 3314 | |
| 3315 | def __init__(self, xid=None, enabled=None): |
| 3316 | if xid != None: |
| 3317 | self.xid = xid |
| 3318 | else: |
| 3319 | self.xid = None |
| 3320 | if enabled != None: |
| 3321 | self.enabled = enabled |
| 3322 | else: |
| 3323 | self.enabled = 0 |
| 3324 | return |
| 3325 | |
| 3326 | def pack(self): |
| 3327 | packed = [] |
| 3328 | packed.append(struct.pack("!B", self.version)) |
| 3329 | packed.append(struct.pack("!B", self.type)) |
| 3330 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 3331 | packed.append(struct.pack("!L", self.xid)) |
| 3332 | packed.append(struct.pack("!L", self.experimenter)) |
| 3333 | packed.append(struct.pack("!L", self.subtype)) |
| 3334 | packed.append(struct.pack("!L", self.enabled)) |
| 3335 | length = sum([len(x) for x in packed]) |
| 3336 | packed[2] = struct.pack("!H", length) |
| 3337 | return ''.join(packed) |
| 3338 | |
| 3339 | @staticmethod |
| 3340 | def unpack(reader): |
| 3341 | obj = bsn_flow_idle_enable_get_reply() |
| 3342 | _version = reader.read("!B")[0] |
| 3343 | assert(_version == 4) |
| 3344 | _type = reader.read("!B")[0] |
| 3345 | assert(_type == 4) |
| 3346 | _length = reader.read("!H")[0] |
| 3347 | orig_reader = reader |
| 3348 | reader = orig_reader.slice(_length, 4) |
| 3349 | obj.xid = reader.read("!L")[0] |
| 3350 | _experimenter = reader.read("!L")[0] |
| 3351 | assert(_experimenter == 6035143) |
| 3352 | _subtype = reader.read("!L")[0] |
| 3353 | assert(_subtype == 39) |
| 3354 | obj.enabled = reader.read("!L")[0] |
| 3355 | return obj |
| 3356 | |
| 3357 | def __eq__(self, other): |
| 3358 | if type(self) != type(other): return False |
| 3359 | if self.xid != other.xid: return False |
| 3360 | if self.enabled != other.enabled: return False |
| 3361 | return True |
| 3362 | |
| 3363 | def pretty_print(self, q): |
| 3364 | q.text("bsn_flow_idle_enable_get_reply {") |
| 3365 | with q.group(): |
| 3366 | with q.indent(2): |
| 3367 | q.breakable() |
| 3368 | q.text("xid = "); |
| 3369 | if self.xid != None: |
| 3370 | q.text("%#x" % self.xid) |
| 3371 | else: |
| 3372 | q.text('None') |
| 3373 | q.text(","); q.breakable() |
| 3374 | q.text("enabled = "); |
| 3375 | q.text("%#x" % self.enabled) |
| 3376 | q.breakable() |
| 3377 | q.text('}') |
| 3378 | |
| 3379 | bsn_header.subtypes[39] = bsn_flow_idle_enable_get_reply |
| 3380 | |
| 3381 | class bsn_flow_idle_enable_get_request(bsn_header): |
| 3382 | version = 4 |
| 3383 | type = 4 |
| 3384 | experimenter = 6035143 |
| 3385 | subtype = 38 |
| 3386 | |
| 3387 | def __init__(self, xid=None): |
| 3388 | if xid != None: |
| 3389 | self.xid = xid |
| 3390 | else: |
| 3391 | self.xid = None |
| 3392 | return |
| 3393 | |
| 3394 | def pack(self): |
| 3395 | packed = [] |
| 3396 | packed.append(struct.pack("!B", self.version)) |
| 3397 | packed.append(struct.pack("!B", self.type)) |
| 3398 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 3399 | packed.append(struct.pack("!L", self.xid)) |
| 3400 | packed.append(struct.pack("!L", self.experimenter)) |
| 3401 | packed.append(struct.pack("!L", self.subtype)) |
| 3402 | length = sum([len(x) for x in packed]) |
| 3403 | packed[2] = struct.pack("!H", length) |
| 3404 | return ''.join(packed) |
| 3405 | |
| 3406 | @staticmethod |
| 3407 | def unpack(reader): |
| 3408 | obj = bsn_flow_idle_enable_get_request() |
| 3409 | _version = reader.read("!B")[0] |
| 3410 | assert(_version == 4) |
| 3411 | _type = reader.read("!B")[0] |
| 3412 | assert(_type == 4) |
| 3413 | _length = reader.read("!H")[0] |
| 3414 | orig_reader = reader |
| 3415 | reader = orig_reader.slice(_length, 4) |
| 3416 | obj.xid = reader.read("!L")[0] |
| 3417 | _experimenter = reader.read("!L")[0] |
| 3418 | assert(_experimenter == 6035143) |
| 3419 | _subtype = reader.read("!L")[0] |
| 3420 | assert(_subtype == 38) |
| 3421 | return obj |
| 3422 | |
| 3423 | def __eq__(self, other): |
| 3424 | if type(self) != type(other): return False |
| 3425 | if self.xid != other.xid: return False |
| 3426 | return True |
| 3427 | |
| 3428 | def pretty_print(self, q): |
| 3429 | q.text("bsn_flow_idle_enable_get_request {") |
| 3430 | with q.group(): |
| 3431 | with q.indent(2): |
| 3432 | q.breakable() |
| 3433 | q.text("xid = "); |
| 3434 | if self.xid != None: |
| 3435 | q.text("%#x" % self.xid) |
| 3436 | else: |
| 3437 | q.text('None') |
| 3438 | q.breakable() |
| 3439 | q.text('}') |
| 3440 | |
| 3441 | bsn_header.subtypes[38] = bsn_flow_idle_enable_get_request |
| 3442 | |
| 3443 | class bsn_flow_idle_enable_set_reply(bsn_header): |
| 3444 | version = 4 |
| 3445 | type = 4 |
| 3446 | experimenter = 6035143 |
| 3447 | subtype = 37 |
| 3448 | |
| 3449 | def __init__(self, xid=None, enable=None, status=None): |
| 3450 | if xid != None: |
| 3451 | self.xid = xid |
| 3452 | else: |
| 3453 | self.xid = None |
| 3454 | if enable != None: |
| 3455 | self.enable = enable |
| 3456 | else: |
| 3457 | self.enable = 0 |
| 3458 | if status != None: |
| 3459 | self.status = status |
| 3460 | else: |
| 3461 | self.status = 0 |
| 3462 | return |
| 3463 | |
| 3464 | def pack(self): |
| 3465 | packed = [] |
| 3466 | packed.append(struct.pack("!B", self.version)) |
| 3467 | packed.append(struct.pack("!B", self.type)) |
| 3468 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 3469 | packed.append(struct.pack("!L", self.xid)) |
| 3470 | packed.append(struct.pack("!L", self.experimenter)) |
| 3471 | packed.append(struct.pack("!L", self.subtype)) |
| 3472 | packed.append(struct.pack("!L", self.enable)) |
| 3473 | packed.append(struct.pack("!L", self.status)) |
| 3474 | length = sum([len(x) for x in packed]) |
| 3475 | packed[2] = struct.pack("!H", length) |
| 3476 | return ''.join(packed) |
| 3477 | |
| 3478 | @staticmethod |
| 3479 | def unpack(reader): |
| 3480 | obj = bsn_flow_idle_enable_set_reply() |
| 3481 | _version = reader.read("!B")[0] |
| 3482 | assert(_version == 4) |
| 3483 | _type = reader.read("!B")[0] |
| 3484 | assert(_type == 4) |
| 3485 | _length = reader.read("!H")[0] |
| 3486 | orig_reader = reader |
| 3487 | reader = orig_reader.slice(_length, 4) |
| 3488 | obj.xid = reader.read("!L")[0] |
| 3489 | _experimenter = reader.read("!L")[0] |
| 3490 | assert(_experimenter == 6035143) |
| 3491 | _subtype = reader.read("!L")[0] |
| 3492 | assert(_subtype == 37) |
| 3493 | obj.enable = reader.read("!L")[0] |
| 3494 | obj.status = reader.read("!L")[0] |
| 3495 | return obj |
| 3496 | |
| 3497 | def __eq__(self, other): |
| 3498 | if type(self) != type(other): return False |
| 3499 | if self.xid != other.xid: return False |
| 3500 | if self.enable != other.enable: return False |
| 3501 | if self.status != other.status: return False |
| 3502 | return True |
| 3503 | |
| 3504 | def pretty_print(self, q): |
| 3505 | q.text("bsn_flow_idle_enable_set_reply {") |
| 3506 | with q.group(): |
| 3507 | with q.indent(2): |
| 3508 | q.breakable() |
| 3509 | q.text("xid = "); |
| 3510 | if self.xid != None: |
| 3511 | q.text("%#x" % self.xid) |
| 3512 | else: |
| 3513 | q.text('None') |
| 3514 | q.text(","); q.breakable() |
| 3515 | q.text("enable = "); |
| 3516 | q.text("%#x" % self.enable) |
| 3517 | q.text(","); q.breakable() |
| 3518 | q.text("status = "); |
| 3519 | q.text("%#x" % self.status) |
| 3520 | q.breakable() |
| 3521 | q.text('}') |
| 3522 | |
| 3523 | bsn_header.subtypes[37] = bsn_flow_idle_enable_set_reply |
| 3524 | |
| 3525 | class bsn_flow_idle_enable_set_request(bsn_header): |
| 3526 | version = 4 |
| 3527 | type = 4 |
| 3528 | experimenter = 6035143 |
| 3529 | subtype = 36 |
| 3530 | |
| 3531 | def __init__(self, xid=None, enable=None): |
| 3532 | if xid != None: |
| 3533 | self.xid = xid |
| 3534 | else: |
| 3535 | self.xid = None |
| 3536 | if enable != None: |
| 3537 | self.enable = enable |
| 3538 | else: |
| 3539 | self.enable = 0 |
| 3540 | return |
| 3541 | |
| 3542 | def pack(self): |
| 3543 | packed = [] |
| 3544 | packed.append(struct.pack("!B", self.version)) |
| 3545 | packed.append(struct.pack("!B", self.type)) |
| 3546 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 3547 | packed.append(struct.pack("!L", self.xid)) |
| 3548 | packed.append(struct.pack("!L", self.experimenter)) |
| 3549 | packed.append(struct.pack("!L", self.subtype)) |
| 3550 | packed.append(struct.pack("!L", self.enable)) |
| 3551 | length = sum([len(x) for x in packed]) |
| 3552 | packed[2] = struct.pack("!H", length) |
| 3553 | return ''.join(packed) |
| 3554 | |
| 3555 | @staticmethod |
| 3556 | def unpack(reader): |
| 3557 | obj = bsn_flow_idle_enable_set_request() |
| 3558 | _version = reader.read("!B")[0] |
| 3559 | assert(_version == 4) |
| 3560 | _type = reader.read("!B")[0] |
| 3561 | assert(_type == 4) |
| 3562 | _length = reader.read("!H")[0] |
| 3563 | orig_reader = reader |
| 3564 | reader = orig_reader.slice(_length, 4) |
| 3565 | obj.xid = reader.read("!L")[0] |
| 3566 | _experimenter = reader.read("!L")[0] |
| 3567 | assert(_experimenter == 6035143) |
| 3568 | _subtype = reader.read("!L")[0] |
| 3569 | assert(_subtype == 36) |
| 3570 | obj.enable = reader.read("!L")[0] |
| 3571 | return obj |
| 3572 | |
| 3573 | def __eq__(self, other): |
| 3574 | if type(self) != type(other): return False |
| 3575 | if self.xid != other.xid: return False |
| 3576 | if self.enable != other.enable: return False |
| 3577 | return True |
| 3578 | |
| 3579 | def pretty_print(self, q): |
| 3580 | q.text("bsn_flow_idle_enable_set_request {") |
| 3581 | with q.group(): |
| 3582 | with q.indent(2): |
| 3583 | q.breakable() |
| 3584 | q.text("xid = "); |
| 3585 | if self.xid != None: |
| 3586 | q.text("%#x" % self.xid) |
| 3587 | else: |
| 3588 | q.text('None') |
| 3589 | q.text(","); q.breakable() |
| 3590 | q.text("enable = "); |
| 3591 | q.text("%#x" % self.enable) |
| 3592 | q.breakable() |
| 3593 | q.text('}') |
| 3594 | |
| 3595 | bsn_header.subtypes[36] = bsn_flow_idle_enable_set_request |
| 3596 | |
| 3597 | class bsn_generic_stats_reply(bsn_stats_reply): |
| 3598 | version = 4 |
| 3599 | type = 19 |
| 3600 | stats_type = 65535 |
| 3601 | experimenter = 6035143 |
| 3602 | subtype = 16 |
| 3603 | |
| 3604 | def __init__(self, xid=None, flags=None, entries=None): |
| 3605 | if xid != None: |
| 3606 | self.xid = xid |
| 3607 | else: |
| 3608 | self.xid = None |
| 3609 | if flags != None: |
| 3610 | self.flags = flags |
| 3611 | else: |
| 3612 | self.flags = 0 |
| 3613 | if entries != None: |
| 3614 | self.entries = entries |
| 3615 | else: |
| 3616 | self.entries = [] |
| 3617 | return |
| 3618 | |
| 3619 | def pack(self): |
| 3620 | packed = [] |
| 3621 | packed.append(struct.pack("!B", self.version)) |
| 3622 | packed.append(struct.pack("!B", self.type)) |
| 3623 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 3624 | packed.append(struct.pack("!L", self.xid)) |
| 3625 | packed.append(struct.pack("!H", self.stats_type)) |
| 3626 | packed.append(struct.pack("!H", self.flags)) |
| 3627 | packed.append('\x00' * 4) |
| 3628 | packed.append(struct.pack("!L", self.experimenter)) |
| 3629 | packed.append(struct.pack("!L", self.subtype)) |
| 3630 | packed.append(loxi.generic_util.pack_list(self.entries)) |
| 3631 | length = sum([len(x) for x in packed]) |
| 3632 | packed[2] = struct.pack("!H", length) |
| 3633 | return ''.join(packed) |
| 3634 | |
| 3635 | @staticmethod |
| 3636 | def unpack(reader): |
| 3637 | obj = bsn_generic_stats_reply() |
| 3638 | _version = reader.read("!B")[0] |
| 3639 | assert(_version == 4) |
| 3640 | _type = reader.read("!B")[0] |
| 3641 | assert(_type == 19) |
| 3642 | _length = reader.read("!H")[0] |
| 3643 | orig_reader = reader |
| 3644 | reader = orig_reader.slice(_length, 4) |
| 3645 | obj.xid = reader.read("!L")[0] |
| 3646 | _stats_type = reader.read("!H")[0] |
| 3647 | assert(_stats_type == 65535) |
| 3648 | obj.flags = reader.read("!H")[0] |
| 3649 | reader.skip(4) |
| 3650 | _experimenter = reader.read("!L")[0] |
| 3651 | assert(_experimenter == 6035143) |
| 3652 | _subtype = reader.read("!L")[0] |
| 3653 | assert(_subtype == 16) |
| 3654 | obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.bsn_generic_stats_entry.unpack) |
| 3655 | return obj |
| 3656 | |
| 3657 | def __eq__(self, other): |
| 3658 | if type(self) != type(other): return False |
| 3659 | if self.xid != other.xid: return False |
| 3660 | if self.flags != other.flags: return False |
| 3661 | if self.entries != other.entries: return False |
| 3662 | return True |
| 3663 | |
| 3664 | def pretty_print(self, q): |
| 3665 | q.text("bsn_generic_stats_reply {") |
| 3666 | with q.group(): |
| 3667 | with q.indent(2): |
| 3668 | q.breakable() |
| 3669 | q.text("xid = "); |
| 3670 | if self.xid != None: |
| 3671 | q.text("%#x" % self.xid) |
| 3672 | else: |
| 3673 | q.text('None') |
| 3674 | q.text(","); q.breakable() |
| 3675 | q.text("flags = "); |
| 3676 | q.text("%#x" % self.flags) |
| 3677 | q.text(","); q.breakable() |
| 3678 | q.text("entries = "); |
| 3679 | q.pp(self.entries) |
| 3680 | q.breakable() |
| 3681 | q.text('}') |
| 3682 | |
| 3683 | bsn_stats_reply.subtypes[16] = bsn_generic_stats_reply |
| 3684 | |
| 3685 | class bsn_generic_stats_request(bsn_stats_request): |
| 3686 | version = 4 |
| 3687 | type = 18 |
| 3688 | stats_type = 65535 |
| 3689 | experimenter = 6035143 |
| 3690 | subtype = 16 |
| 3691 | |
| 3692 | def __init__(self, xid=None, flags=None, name=None, tlvs=None): |
| 3693 | if xid != None: |
| 3694 | self.xid = xid |
| 3695 | else: |
| 3696 | self.xid = None |
| 3697 | if flags != None: |
| 3698 | self.flags = flags |
| 3699 | else: |
| 3700 | self.flags = 0 |
| 3701 | if name != None: |
| 3702 | self.name = name |
| 3703 | else: |
| 3704 | self.name = "" |
| 3705 | if tlvs != None: |
| 3706 | self.tlvs = tlvs |
| 3707 | else: |
| 3708 | self.tlvs = [] |
| 3709 | return |
| 3710 | |
| 3711 | def pack(self): |
| 3712 | packed = [] |
| 3713 | packed.append(struct.pack("!B", self.version)) |
| 3714 | packed.append(struct.pack("!B", self.type)) |
| 3715 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 3716 | packed.append(struct.pack("!L", self.xid)) |
| 3717 | packed.append(struct.pack("!H", self.stats_type)) |
| 3718 | packed.append(struct.pack("!H", self.flags)) |
| 3719 | packed.append('\x00' * 4) |
| 3720 | packed.append(struct.pack("!L", self.experimenter)) |
| 3721 | packed.append(struct.pack("!L", self.subtype)) |
| 3722 | packed.append(struct.pack("!64s", self.name)) |
| 3723 | packed.append(loxi.generic_util.pack_list(self.tlvs)) |
| 3724 | length = sum([len(x) for x in packed]) |
| 3725 | packed[2] = struct.pack("!H", length) |
| 3726 | return ''.join(packed) |
| 3727 | |
| 3728 | @staticmethod |
| 3729 | def unpack(reader): |
| 3730 | obj = bsn_generic_stats_request() |
| 3731 | _version = reader.read("!B")[0] |
| 3732 | assert(_version == 4) |
| 3733 | _type = reader.read("!B")[0] |
| 3734 | assert(_type == 18) |
| 3735 | _length = reader.read("!H")[0] |
| 3736 | orig_reader = reader |
| 3737 | reader = orig_reader.slice(_length, 4) |
| 3738 | obj.xid = reader.read("!L")[0] |
| 3739 | _stats_type = reader.read("!H")[0] |
| 3740 | assert(_stats_type == 65535) |
| 3741 | obj.flags = reader.read("!H")[0] |
| 3742 | reader.skip(4) |
| 3743 | _experimenter = reader.read("!L")[0] |
| 3744 | assert(_experimenter == 6035143) |
| 3745 | _subtype = reader.read("!L")[0] |
| 3746 | assert(_subtype == 16) |
| 3747 | obj.name = reader.read("!64s")[0].rstrip("\x00") |
| 3748 | obj.tlvs = loxi.generic_util.unpack_list(reader, ofp.bsn_tlv.bsn_tlv.unpack) |
| 3749 | return obj |
| 3750 | |
| 3751 | def __eq__(self, other): |
| 3752 | if type(self) != type(other): return False |
| 3753 | if self.xid != other.xid: return False |
| 3754 | if self.flags != other.flags: return False |
| 3755 | if self.name != other.name: return False |
| 3756 | if self.tlvs != other.tlvs: return False |
| 3757 | return True |
| 3758 | |
| 3759 | def pretty_print(self, q): |
| 3760 | q.text("bsn_generic_stats_request {") |
| 3761 | with q.group(): |
| 3762 | with q.indent(2): |
| 3763 | q.breakable() |
| 3764 | q.text("xid = "); |
| 3765 | if self.xid != None: |
| 3766 | q.text("%#x" % self.xid) |
| 3767 | else: |
| 3768 | q.text('None') |
| 3769 | q.text(","); q.breakable() |
| 3770 | q.text("flags = "); |
| 3771 | q.text("%#x" % self.flags) |
| 3772 | q.text(","); q.breakable() |
| 3773 | q.text("name = "); |
| 3774 | q.pp(self.name) |
| 3775 | q.text(","); q.breakable() |
| 3776 | q.text("tlvs = "); |
| 3777 | q.pp(self.tlvs) |
| 3778 | q.breakable() |
| 3779 | q.text('}') |
| 3780 | |
| 3781 | bsn_stats_request.subtypes[16] = bsn_generic_stats_request |
| 3782 | |
| 3783 | class bsn_gentable_bucket_stats_reply(bsn_stats_reply): |
| 3784 | version = 4 |
| 3785 | type = 19 |
| 3786 | stats_type = 65535 |
| 3787 | experimenter = 6035143 |
| 3788 | subtype = 5 |
| 3789 | |
| 3790 | def __init__(self, xid=None, flags=None, entries=None): |
| 3791 | if xid != None: |
| 3792 | self.xid = xid |
| 3793 | else: |
| 3794 | self.xid = None |
| 3795 | if flags != None: |
| 3796 | self.flags = flags |
| 3797 | else: |
| 3798 | self.flags = 0 |
| 3799 | if entries != None: |
| 3800 | self.entries = entries |
| 3801 | else: |
| 3802 | self.entries = [] |
| 3803 | return |
| 3804 | |
| 3805 | def pack(self): |
| 3806 | packed = [] |
| 3807 | packed.append(struct.pack("!B", self.version)) |
| 3808 | packed.append(struct.pack("!B", self.type)) |
| 3809 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 3810 | packed.append(struct.pack("!L", self.xid)) |
| 3811 | packed.append(struct.pack("!H", self.stats_type)) |
| 3812 | packed.append(struct.pack("!H", self.flags)) |
| 3813 | packed.append('\x00' * 4) |
| 3814 | packed.append(struct.pack("!L", self.experimenter)) |
| 3815 | packed.append(struct.pack("!L", self.subtype)) |
| 3816 | packed.append(loxi.generic_util.pack_list(self.entries)) |
| 3817 | length = sum([len(x) for x in packed]) |
| 3818 | packed[2] = struct.pack("!H", length) |
| 3819 | return ''.join(packed) |
| 3820 | |
| 3821 | @staticmethod |
| 3822 | def unpack(reader): |
| 3823 | obj = bsn_gentable_bucket_stats_reply() |
| 3824 | _version = reader.read("!B")[0] |
| 3825 | assert(_version == 4) |
| 3826 | _type = reader.read("!B")[0] |
| 3827 | assert(_type == 19) |
| 3828 | _length = reader.read("!H")[0] |
| 3829 | orig_reader = reader |
| 3830 | reader = orig_reader.slice(_length, 4) |
| 3831 | obj.xid = reader.read("!L")[0] |
| 3832 | _stats_type = reader.read("!H")[0] |
| 3833 | assert(_stats_type == 65535) |
| 3834 | obj.flags = reader.read("!H")[0] |
| 3835 | reader.skip(4) |
| 3836 | _experimenter = reader.read("!L")[0] |
| 3837 | assert(_experimenter == 6035143) |
| 3838 | _subtype = reader.read("!L")[0] |
| 3839 | assert(_subtype == 5) |
| 3840 | obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.bsn_gentable_bucket_stats_entry.unpack) |
| 3841 | return obj |
| 3842 | |
| 3843 | def __eq__(self, other): |
| 3844 | if type(self) != type(other): return False |
| 3845 | if self.xid != other.xid: return False |
| 3846 | if self.flags != other.flags: return False |
| 3847 | if self.entries != other.entries: return False |
| 3848 | return True |
| 3849 | |
| 3850 | def pretty_print(self, q): |
| 3851 | q.text("bsn_gentable_bucket_stats_reply {") |
| 3852 | with q.group(): |
| 3853 | with q.indent(2): |
| 3854 | q.breakable() |
| 3855 | q.text("xid = "); |
| 3856 | if self.xid != None: |
| 3857 | q.text("%#x" % self.xid) |
| 3858 | else: |
| 3859 | q.text('None') |
| 3860 | q.text(","); q.breakable() |
| 3861 | q.text("flags = "); |
| 3862 | q.text("%#x" % self.flags) |
| 3863 | q.text(","); q.breakable() |
| 3864 | q.text("entries = "); |
| 3865 | q.pp(self.entries) |
| 3866 | q.breakable() |
| 3867 | q.text('}') |
| 3868 | |
| 3869 | bsn_stats_reply.subtypes[5] = bsn_gentable_bucket_stats_reply |
| 3870 | |
| 3871 | class bsn_gentable_bucket_stats_request(bsn_stats_request): |
| 3872 | version = 4 |
| 3873 | type = 18 |
| 3874 | stats_type = 65535 |
| 3875 | experimenter = 6035143 |
| 3876 | subtype = 5 |
| 3877 | |
| 3878 | def __init__(self, xid=None, flags=None, table_id=None): |
| 3879 | if xid != None: |
| 3880 | self.xid = xid |
| 3881 | else: |
| 3882 | self.xid = None |
| 3883 | if flags != None: |
| 3884 | self.flags = flags |
| 3885 | else: |
| 3886 | self.flags = 0 |
| 3887 | if table_id != None: |
| 3888 | self.table_id = table_id |
| 3889 | else: |
| 3890 | self.table_id = 0 |
| 3891 | return |
| 3892 | |
| 3893 | def pack(self): |
| 3894 | packed = [] |
| 3895 | packed.append(struct.pack("!B", self.version)) |
| 3896 | packed.append(struct.pack("!B", self.type)) |
| 3897 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 3898 | packed.append(struct.pack("!L", self.xid)) |
| 3899 | packed.append(struct.pack("!H", self.stats_type)) |
| 3900 | packed.append(struct.pack("!H", self.flags)) |
| 3901 | packed.append('\x00' * 4) |
| 3902 | packed.append(struct.pack("!L", self.experimenter)) |
| 3903 | packed.append(struct.pack("!L", self.subtype)) |
| 3904 | packed.append(struct.pack("!H", self.table_id)) |
| 3905 | length = sum([len(x) for x in packed]) |
| 3906 | packed[2] = struct.pack("!H", length) |
| 3907 | return ''.join(packed) |
| 3908 | |
| 3909 | @staticmethod |
| 3910 | def unpack(reader): |
| 3911 | obj = bsn_gentable_bucket_stats_request() |
| 3912 | _version = reader.read("!B")[0] |
| 3913 | assert(_version == 4) |
| 3914 | _type = reader.read("!B")[0] |
| 3915 | assert(_type == 18) |
| 3916 | _length = reader.read("!H")[0] |
| 3917 | orig_reader = reader |
| 3918 | reader = orig_reader.slice(_length, 4) |
| 3919 | obj.xid = reader.read("!L")[0] |
| 3920 | _stats_type = reader.read("!H")[0] |
| 3921 | assert(_stats_type == 65535) |
| 3922 | obj.flags = reader.read("!H")[0] |
| 3923 | reader.skip(4) |
| 3924 | _experimenter = reader.read("!L")[0] |
| 3925 | assert(_experimenter == 6035143) |
| 3926 | _subtype = reader.read("!L")[0] |
| 3927 | assert(_subtype == 5) |
| 3928 | obj.table_id = reader.read("!H")[0] |
| 3929 | return obj |
| 3930 | |
| 3931 | def __eq__(self, other): |
| 3932 | if type(self) != type(other): return False |
| 3933 | if self.xid != other.xid: return False |
| 3934 | if self.flags != other.flags: return False |
| 3935 | if self.table_id != other.table_id: return False |
| 3936 | return True |
| 3937 | |
| 3938 | def pretty_print(self, q): |
| 3939 | q.text("bsn_gentable_bucket_stats_request {") |
| 3940 | with q.group(): |
| 3941 | with q.indent(2): |
| 3942 | q.breakable() |
| 3943 | q.text("xid = "); |
| 3944 | if self.xid != None: |
| 3945 | q.text("%#x" % self.xid) |
| 3946 | else: |
| 3947 | q.text('None') |
| 3948 | q.text(","); q.breakable() |
| 3949 | q.text("flags = "); |
| 3950 | q.text("%#x" % self.flags) |
| 3951 | q.text(","); q.breakable() |
| 3952 | q.text("table_id = "); |
| 3953 | q.text("%#x" % self.table_id) |
| 3954 | q.breakable() |
| 3955 | q.text('}') |
| 3956 | |
| 3957 | bsn_stats_request.subtypes[5] = bsn_gentable_bucket_stats_request |
| 3958 | |
| 3959 | class bsn_gentable_clear_reply(bsn_header): |
| 3960 | version = 4 |
| 3961 | type = 4 |
| 3962 | experimenter = 6035143 |
| 3963 | subtype = 49 |
| 3964 | |
| 3965 | def __init__(self, xid=None, table_id=None, deleted_count=None, error_count=None): |
| 3966 | if xid != None: |
| 3967 | self.xid = xid |
| 3968 | else: |
| 3969 | self.xid = None |
| 3970 | if table_id != None: |
| 3971 | self.table_id = table_id |
| 3972 | else: |
| 3973 | self.table_id = 0 |
| 3974 | if deleted_count != None: |
| 3975 | self.deleted_count = deleted_count |
| 3976 | else: |
| 3977 | self.deleted_count = 0 |
| 3978 | if error_count != None: |
| 3979 | self.error_count = error_count |
| 3980 | else: |
| 3981 | self.error_count = 0 |
| 3982 | return |
| 3983 | |
| 3984 | def pack(self): |
| 3985 | packed = [] |
| 3986 | packed.append(struct.pack("!B", self.version)) |
| 3987 | packed.append(struct.pack("!B", self.type)) |
| 3988 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 3989 | packed.append(struct.pack("!L", self.xid)) |
| 3990 | packed.append(struct.pack("!L", self.experimenter)) |
| 3991 | packed.append(struct.pack("!L", self.subtype)) |
| 3992 | packed.append(struct.pack("!H", self.table_id)) |
| 3993 | packed.append('\x00' * 2) |
| 3994 | packed.append(struct.pack("!L", self.deleted_count)) |
| 3995 | packed.append(struct.pack("!L", self.error_count)) |
| 3996 | length = sum([len(x) for x in packed]) |
| 3997 | packed[2] = struct.pack("!H", length) |
| 3998 | return ''.join(packed) |
| 3999 | |
| 4000 | @staticmethod |
| 4001 | def unpack(reader): |
| 4002 | obj = bsn_gentable_clear_reply() |
| 4003 | _version = reader.read("!B")[0] |
| 4004 | assert(_version == 4) |
| 4005 | _type = reader.read("!B")[0] |
| 4006 | assert(_type == 4) |
| 4007 | _length = reader.read("!H")[0] |
| 4008 | orig_reader = reader |
| 4009 | reader = orig_reader.slice(_length, 4) |
| 4010 | obj.xid = reader.read("!L")[0] |
| 4011 | _experimenter = reader.read("!L")[0] |
| 4012 | assert(_experimenter == 6035143) |
| 4013 | _subtype = reader.read("!L")[0] |
| 4014 | assert(_subtype == 49) |
| 4015 | obj.table_id = reader.read("!H")[0] |
| 4016 | reader.skip(2) |
| 4017 | obj.deleted_count = reader.read("!L")[0] |
| 4018 | obj.error_count = reader.read("!L")[0] |
| 4019 | return obj |
| 4020 | |
| 4021 | def __eq__(self, other): |
| 4022 | if type(self) != type(other): return False |
| 4023 | if self.xid != other.xid: return False |
| 4024 | if self.table_id != other.table_id: return False |
| 4025 | if self.deleted_count != other.deleted_count: return False |
| 4026 | if self.error_count != other.error_count: return False |
| 4027 | return True |
| 4028 | |
| 4029 | def pretty_print(self, q): |
| 4030 | q.text("bsn_gentable_clear_reply {") |
| 4031 | with q.group(): |
| 4032 | with q.indent(2): |
| 4033 | q.breakable() |
| 4034 | q.text("xid = "); |
| 4035 | if self.xid != None: |
| 4036 | q.text("%#x" % self.xid) |
| 4037 | else: |
| 4038 | q.text('None') |
| 4039 | q.text(","); q.breakable() |
| 4040 | q.text("table_id = "); |
| 4041 | q.text("%#x" % self.table_id) |
| 4042 | q.text(","); q.breakable() |
| 4043 | q.text("deleted_count = "); |
| 4044 | q.text("%#x" % self.deleted_count) |
| 4045 | q.text(","); q.breakable() |
| 4046 | q.text("error_count = "); |
| 4047 | q.text("%#x" % self.error_count) |
| 4048 | q.breakable() |
| 4049 | q.text('}') |
| 4050 | |
| 4051 | bsn_header.subtypes[49] = bsn_gentable_clear_reply |
| 4052 | |
| 4053 | class bsn_gentable_clear_request(bsn_header): |
| 4054 | version = 4 |
| 4055 | type = 4 |
| 4056 | experimenter = 6035143 |
| 4057 | subtype = 48 |
| 4058 | |
| 4059 | def __init__(self, xid=None, table_id=None, checksum=None, checksum_mask=None): |
| 4060 | if xid != None: |
| 4061 | self.xid = xid |
| 4062 | else: |
| 4063 | self.xid = None |
| 4064 | if table_id != None: |
| 4065 | self.table_id = table_id |
| 4066 | else: |
| 4067 | self.table_id = 0 |
| 4068 | if checksum != None: |
| 4069 | self.checksum = checksum |
| 4070 | else: |
| 4071 | self.checksum = 0 |
| 4072 | if checksum_mask != None: |
| 4073 | self.checksum_mask = checksum_mask |
| 4074 | else: |
| 4075 | self.checksum_mask = 0 |
| 4076 | return |
| 4077 | |
| 4078 | def pack(self): |
| 4079 | packed = [] |
| 4080 | packed.append(struct.pack("!B", self.version)) |
| 4081 | packed.append(struct.pack("!B", self.type)) |
| 4082 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 4083 | packed.append(struct.pack("!L", self.xid)) |
| 4084 | packed.append(struct.pack("!L", self.experimenter)) |
| 4085 | packed.append(struct.pack("!L", self.subtype)) |
| 4086 | packed.append(struct.pack("!H", self.table_id)) |
| 4087 | packed.append('\x00' * 2) |
| 4088 | packed.append(util.pack_checksum_128(self.checksum)) |
| 4089 | packed.append(util.pack_checksum_128(self.checksum_mask)) |
| 4090 | length = sum([len(x) for x in packed]) |
| 4091 | packed[2] = struct.pack("!H", length) |
| 4092 | return ''.join(packed) |
| 4093 | |
| 4094 | @staticmethod |
| 4095 | def unpack(reader): |
| 4096 | obj = bsn_gentable_clear_request() |
| 4097 | _version = reader.read("!B")[0] |
| 4098 | assert(_version == 4) |
| 4099 | _type = reader.read("!B")[0] |
| 4100 | assert(_type == 4) |
| 4101 | _length = reader.read("!H")[0] |
| 4102 | orig_reader = reader |
| 4103 | reader = orig_reader.slice(_length, 4) |
| 4104 | obj.xid = reader.read("!L")[0] |
| 4105 | _experimenter = reader.read("!L")[0] |
| 4106 | assert(_experimenter == 6035143) |
| 4107 | _subtype = reader.read("!L")[0] |
| 4108 | assert(_subtype == 48) |
| 4109 | obj.table_id = reader.read("!H")[0] |
| 4110 | reader.skip(2) |
| 4111 | obj.checksum = util.unpack_checksum_128(reader) |
| 4112 | obj.checksum_mask = util.unpack_checksum_128(reader) |
| 4113 | return obj |
| 4114 | |
| 4115 | def __eq__(self, other): |
| 4116 | if type(self) != type(other): return False |
| 4117 | if self.xid != other.xid: return False |
| 4118 | if self.table_id != other.table_id: return False |
| 4119 | if self.checksum != other.checksum: return False |
| 4120 | if self.checksum_mask != other.checksum_mask: return False |
| 4121 | return True |
| 4122 | |
| 4123 | def pretty_print(self, q): |
| 4124 | q.text("bsn_gentable_clear_request {") |
| 4125 | with q.group(): |
| 4126 | with q.indent(2): |
| 4127 | q.breakable() |
| 4128 | q.text("xid = "); |
| 4129 | if self.xid != None: |
| 4130 | q.text("%#x" % self.xid) |
| 4131 | else: |
| 4132 | q.text('None') |
| 4133 | q.text(","); q.breakable() |
| 4134 | q.text("table_id = "); |
| 4135 | q.text("%#x" % self.table_id) |
| 4136 | q.text(","); q.breakable() |
| 4137 | q.text("checksum = "); |
| 4138 | q.pp(self.checksum) |
| 4139 | q.text(","); q.breakable() |
| 4140 | q.text("checksum_mask = "); |
| 4141 | q.pp(self.checksum_mask) |
| 4142 | q.breakable() |
| 4143 | q.text('}') |
| 4144 | |
| 4145 | bsn_header.subtypes[48] = bsn_gentable_clear_request |
| 4146 | |
| 4147 | class bsn_gentable_desc_stats_reply(bsn_stats_reply): |
| 4148 | version = 4 |
| 4149 | type = 19 |
| 4150 | stats_type = 65535 |
| 4151 | experimenter = 6035143 |
| 4152 | subtype = 4 |
| 4153 | |
| 4154 | def __init__(self, xid=None, flags=None, entries=None): |
| 4155 | if xid != None: |
| 4156 | self.xid = xid |
| 4157 | else: |
| 4158 | self.xid = None |
| 4159 | if flags != None: |
| 4160 | self.flags = flags |
| 4161 | else: |
| 4162 | self.flags = 0 |
| 4163 | if entries != None: |
| 4164 | self.entries = entries |
| 4165 | else: |
| 4166 | self.entries = [] |
| 4167 | return |
| 4168 | |
| 4169 | def pack(self): |
| 4170 | packed = [] |
| 4171 | packed.append(struct.pack("!B", self.version)) |
| 4172 | packed.append(struct.pack("!B", self.type)) |
| 4173 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 4174 | packed.append(struct.pack("!L", self.xid)) |
| 4175 | packed.append(struct.pack("!H", self.stats_type)) |
| 4176 | packed.append(struct.pack("!H", self.flags)) |
| 4177 | packed.append('\x00' * 4) |
| 4178 | packed.append(struct.pack("!L", self.experimenter)) |
| 4179 | packed.append(struct.pack("!L", self.subtype)) |
| 4180 | packed.append(loxi.generic_util.pack_list(self.entries)) |
| 4181 | length = sum([len(x) for x in packed]) |
| 4182 | packed[2] = struct.pack("!H", length) |
| 4183 | return ''.join(packed) |
| 4184 | |
| 4185 | @staticmethod |
| 4186 | def unpack(reader): |
| 4187 | obj = bsn_gentable_desc_stats_reply() |
| 4188 | _version = reader.read("!B")[0] |
| 4189 | assert(_version == 4) |
| 4190 | _type = reader.read("!B")[0] |
| 4191 | assert(_type == 19) |
| 4192 | _length = reader.read("!H")[0] |
| 4193 | orig_reader = reader |
| 4194 | reader = orig_reader.slice(_length, 4) |
| 4195 | obj.xid = reader.read("!L")[0] |
| 4196 | _stats_type = reader.read("!H")[0] |
| 4197 | assert(_stats_type == 65535) |
| 4198 | obj.flags = reader.read("!H")[0] |
| 4199 | reader.skip(4) |
| 4200 | _experimenter = reader.read("!L")[0] |
| 4201 | assert(_experimenter == 6035143) |
| 4202 | _subtype = reader.read("!L")[0] |
| 4203 | assert(_subtype == 4) |
| 4204 | obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.bsn_gentable_desc_stats_entry.unpack) |
| 4205 | return obj |
| 4206 | |
| 4207 | def __eq__(self, other): |
| 4208 | if type(self) != type(other): return False |
| 4209 | if self.xid != other.xid: return False |
| 4210 | if self.flags != other.flags: return False |
| 4211 | if self.entries != other.entries: return False |
| 4212 | return True |
| 4213 | |
| 4214 | def pretty_print(self, q): |
| 4215 | q.text("bsn_gentable_desc_stats_reply {") |
| 4216 | with q.group(): |
| 4217 | with q.indent(2): |
| 4218 | q.breakable() |
| 4219 | q.text("xid = "); |
| 4220 | if self.xid != None: |
| 4221 | q.text("%#x" % self.xid) |
| 4222 | else: |
| 4223 | q.text('None') |
| 4224 | q.text(","); q.breakable() |
| 4225 | q.text("flags = "); |
| 4226 | q.text("%#x" % self.flags) |
| 4227 | q.text(","); q.breakable() |
| 4228 | q.text("entries = "); |
| 4229 | q.pp(self.entries) |
| 4230 | q.breakable() |
| 4231 | q.text('}') |
| 4232 | |
| 4233 | bsn_stats_reply.subtypes[4] = bsn_gentable_desc_stats_reply |
| 4234 | |
| 4235 | class bsn_gentable_desc_stats_request(bsn_stats_request): |
| 4236 | version = 4 |
| 4237 | type = 18 |
| 4238 | stats_type = 65535 |
| 4239 | experimenter = 6035143 |
| 4240 | subtype = 4 |
| 4241 | |
| 4242 | def __init__(self, xid=None, flags=None): |
| 4243 | if xid != None: |
| 4244 | self.xid = xid |
| 4245 | else: |
| 4246 | self.xid = None |
| 4247 | if flags != None: |
| 4248 | self.flags = flags |
| 4249 | else: |
| 4250 | self.flags = 0 |
| 4251 | return |
| 4252 | |
| 4253 | def pack(self): |
| 4254 | packed = [] |
| 4255 | packed.append(struct.pack("!B", self.version)) |
| 4256 | packed.append(struct.pack("!B", self.type)) |
| 4257 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 4258 | packed.append(struct.pack("!L", self.xid)) |
| 4259 | packed.append(struct.pack("!H", self.stats_type)) |
| 4260 | packed.append(struct.pack("!H", self.flags)) |
| 4261 | packed.append('\x00' * 4) |
| 4262 | packed.append(struct.pack("!L", self.experimenter)) |
| 4263 | packed.append(struct.pack("!L", self.subtype)) |
| 4264 | length = sum([len(x) for x in packed]) |
| 4265 | packed[2] = struct.pack("!H", length) |
| 4266 | return ''.join(packed) |
| 4267 | |
| 4268 | @staticmethod |
| 4269 | def unpack(reader): |
| 4270 | obj = bsn_gentable_desc_stats_request() |
| 4271 | _version = reader.read("!B")[0] |
| 4272 | assert(_version == 4) |
| 4273 | _type = reader.read("!B")[0] |
| 4274 | assert(_type == 18) |
| 4275 | _length = reader.read("!H")[0] |
| 4276 | orig_reader = reader |
| 4277 | reader = orig_reader.slice(_length, 4) |
| 4278 | obj.xid = reader.read("!L")[0] |
| 4279 | _stats_type = reader.read("!H")[0] |
| 4280 | assert(_stats_type == 65535) |
| 4281 | obj.flags = reader.read("!H")[0] |
| 4282 | reader.skip(4) |
| 4283 | _experimenter = reader.read("!L")[0] |
| 4284 | assert(_experimenter == 6035143) |
| 4285 | _subtype = reader.read("!L")[0] |
| 4286 | assert(_subtype == 4) |
| 4287 | return obj |
| 4288 | |
| 4289 | def __eq__(self, other): |
| 4290 | if type(self) != type(other): return False |
| 4291 | if self.xid != other.xid: return False |
| 4292 | if self.flags != other.flags: return False |
| 4293 | return True |
| 4294 | |
| 4295 | def pretty_print(self, q): |
| 4296 | q.text("bsn_gentable_desc_stats_request {") |
| 4297 | with q.group(): |
| 4298 | with q.indent(2): |
| 4299 | q.breakable() |
| 4300 | q.text("xid = "); |
| 4301 | if self.xid != None: |
| 4302 | q.text("%#x" % self.xid) |
| 4303 | else: |
| 4304 | q.text('None') |
| 4305 | q.text(","); q.breakable() |
| 4306 | q.text("flags = "); |
| 4307 | q.text("%#x" % self.flags) |
| 4308 | q.breakable() |
| 4309 | q.text('}') |
| 4310 | |
| 4311 | bsn_stats_request.subtypes[4] = bsn_gentable_desc_stats_request |
| 4312 | |
| 4313 | class bsn_gentable_entry_add(bsn_header): |
| 4314 | version = 4 |
| 4315 | type = 4 |
| 4316 | experimenter = 6035143 |
| 4317 | subtype = 46 |
| 4318 | |
| 4319 | def __init__(self, xid=None, table_id=None, checksum=None, key=None, value=None): |
| 4320 | if xid != None: |
| 4321 | self.xid = xid |
| 4322 | else: |
| 4323 | self.xid = None |
| 4324 | if table_id != None: |
| 4325 | self.table_id = table_id |
| 4326 | else: |
| 4327 | self.table_id = 0 |
| 4328 | if checksum != None: |
| 4329 | self.checksum = checksum |
| 4330 | else: |
| 4331 | self.checksum = 0 |
| 4332 | if key != None: |
| 4333 | self.key = key |
| 4334 | else: |
| 4335 | self.key = [] |
| 4336 | if value != None: |
| 4337 | self.value = value |
| 4338 | else: |
| 4339 | self.value = [] |
| 4340 | return |
| 4341 | |
| 4342 | def pack(self): |
| 4343 | packed = [] |
| 4344 | packed.append(struct.pack("!B", self.version)) |
| 4345 | packed.append(struct.pack("!B", self.type)) |
| 4346 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 4347 | packed.append(struct.pack("!L", self.xid)) |
| 4348 | packed.append(struct.pack("!L", self.experimenter)) |
| 4349 | packed.append(struct.pack("!L", self.subtype)) |
| 4350 | packed.append(struct.pack("!H", self.table_id)) |
| 4351 | packed.append(struct.pack("!H", 0)) # placeholder for key_length at index 7 |
| 4352 | packed.append(util.pack_checksum_128(self.checksum)) |
| 4353 | packed.append(loxi.generic_util.pack_list(self.key)) |
| 4354 | packed[7] = struct.pack("!H", len(packed[-1])) |
| 4355 | packed.append(loxi.generic_util.pack_list(self.value)) |
| 4356 | length = sum([len(x) for x in packed]) |
| 4357 | packed[2] = struct.pack("!H", length) |
| 4358 | return ''.join(packed) |
| 4359 | |
| 4360 | @staticmethod |
| 4361 | def unpack(reader): |
| 4362 | obj = bsn_gentable_entry_add() |
| 4363 | _version = reader.read("!B")[0] |
| 4364 | assert(_version == 4) |
| 4365 | _type = reader.read("!B")[0] |
| 4366 | assert(_type == 4) |
| 4367 | _length = reader.read("!H")[0] |
| 4368 | orig_reader = reader |
| 4369 | reader = orig_reader.slice(_length, 4) |
| 4370 | obj.xid = reader.read("!L")[0] |
| 4371 | _experimenter = reader.read("!L")[0] |
| 4372 | assert(_experimenter == 6035143) |
| 4373 | _subtype = reader.read("!L")[0] |
| 4374 | assert(_subtype == 46) |
| 4375 | obj.table_id = reader.read("!H")[0] |
| 4376 | _key_length = reader.read("!H")[0] |
| 4377 | obj.checksum = util.unpack_checksum_128(reader) |
| 4378 | obj.key = loxi.generic_util.unpack_list(reader.slice(_key_length), ofp.bsn_tlv.bsn_tlv.unpack) |
| 4379 | obj.value = loxi.generic_util.unpack_list(reader, ofp.bsn_tlv.bsn_tlv.unpack) |
| 4380 | return obj |
| 4381 | |
| 4382 | def __eq__(self, other): |
| 4383 | if type(self) != type(other): return False |
| 4384 | if self.xid != other.xid: return False |
| 4385 | if self.table_id != other.table_id: return False |
| 4386 | if self.checksum != other.checksum: return False |
| 4387 | if self.key != other.key: return False |
| 4388 | if self.value != other.value: return False |
| 4389 | return True |
| 4390 | |
| 4391 | def pretty_print(self, q): |
| 4392 | q.text("bsn_gentable_entry_add {") |
| 4393 | with q.group(): |
| 4394 | with q.indent(2): |
| 4395 | q.breakable() |
| 4396 | q.text("xid = "); |
| 4397 | if self.xid != None: |
| 4398 | q.text("%#x" % self.xid) |
| 4399 | else: |
| 4400 | q.text('None') |
| 4401 | q.text(","); q.breakable() |
| 4402 | q.text("table_id = "); |
| 4403 | q.text("%#x" % self.table_id) |
| 4404 | q.text(","); q.breakable() |
| 4405 | q.text("checksum = "); |
| 4406 | q.pp(self.checksum) |
| 4407 | q.text(","); q.breakable() |
| 4408 | q.text("key = "); |
| 4409 | q.pp(self.key) |
| 4410 | q.text(","); q.breakable() |
| 4411 | q.text("value = "); |
| 4412 | q.pp(self.value) |
| 4413 | q.breakable() |
| 4414 | q.text('}') |
| 4415 | |
| 4416 | bsn_header.subtypes[46] = bsn_gentable_entry_add |
| 4417 | |
| 4418 | class bsn_gentable_entry_delete(bsn_header): |
| 4419 | version = 4 |
| 4420 | type = 4 |
| 4421 | experimenter = 6035143 |
| 4422 | subtype = 47 |
| 4423 | |
| 4424 | def __init__(self, xid=None, table_id=None, key=None): |
| 4425 | if xid != None: |
| 4426 | self.xid = xid |
| 4427 | else: |
| 4428 | self.xid = None |
| 4429 | if table_id != None: |
| 4430 | self.table_id = table_id |
| 4431 | else: |
| 4432 | self.table_id = 0 |
| 4433 | if key != None: |
| 4434 | self.key = key |
| 4435 | else: |
| 4436 | self.key = [] |
| 4437 | return |
| 4438 | |
| 4439 | def pack(self): |
| 4440 | packed = [] |
| 4441 | packed.append(struct.pack("!B", self.version)) |
| 4442 | packed.append(struct.pack("!B", self.type)) |
| 4443 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 4444 | packed.append(struct.pack("!L", self.xid)) |
| 4445 | packed.append(struct.pack("!L", self.experimenter)) |
| 4446 | packed.append(struct.pack("!L", self.subtype)) |
| 4447 | packed.append(struct.pack("!H", self.table_id)) |
| 4448 | packed.append(loxi.generic_util.pack_list(self.key)) |
| 4449 | length = sum([len(x) for x in packed]) |
| 4450 | packed[2] = struct.pack("!H", length) |
| 4451 | return ''.join(packed) |
| 4452 | |
| 4453 | @staticmethod |
| 4454 | def unpack(reader): |
| 4455 | obj = bsn_gentable_entry_delete() |
| 4456 | _version = reader.read("!B")[0] |
| 4457 | assert(_version == 4) |
| 4458 | _type = reader.read("!B")[0] |
| 4459 | assert(_type == 4) |
| 4460 | _length = reader.read("!H")[0] |
| 4461 | orig_reader = reader |
| 4462 | reader = orig_reader.slice(_length, 4) |
| 4463 | obj.xid = reader.read("!L")[0] |
| 4464 | _experimenter = reader.read("!L")[0] |
| 4465 | assert(_experimenter == 6035143) |
| 4466 | _subtype = reader.read("!L")[0] |
| 4467 | assert(_subtype == 47) |
| 4468 | obj.table_id = reader.read("!H")[0] |
| 4469 | obj.key = loxi.generic_util.unpack_list(reader, ofp.bsn_tlv.bsn_tlv.unpack) |
| 4470 | return obj |
| 4471 | |
| 4472 | def __eq__(self, other): |
| 4473 | if type(self) != type(other): return False |
| 4474 | if self.xid != other.xid: return False |
| 4475 | if self.table_id != other.table_id: return False |
| 4476 | if self.key != other.key: return False |
| 4477 | return True |
| 4478 | |
| 4479 | def pretty_print(self, q): |
| 4480 | q.text("bsn_gentable_entry_delete {") |
| 4481 | with q.group(): |
| 4482 | with q.indent(2): |
| 4483 | q.breakable() |
| 4484 | q.text("xid = "); |
| 4485 | if self.xid != None: |
| 4486 | q.text("%#x" % self.xid) |
| 4487 | else: |
| 4488 | q.text('None') |
| 4489 | q.text(","); q.breakable() |
| 4490 | q.text("table_id = "); |
| 4491 | q.text("%#x" % self.table_id) |
| 4492 | q.text(","); q.breakable() |
| 4493 | q.text("key = "); |
| 4494 | q.pp(self.key) |
| 4495 | q.breakable() |
| 4496 | q.text('}') |
| 4497 | |
| 4498 | bsn_header.subtypes[47] = bsn_gentable_entry_delete |
| 4499 | |
| 4500 | class bsn_gentable_entry_desc_stats_reply(bsn_stats_reply): |
| 4501 | version = 4 |
| 4502 | type = 19 |
| 4503 | stats_type = 65535 |
| 4504 | experimenter = 6035143 |
| 4505 | subtype = 2 |
| 4506 | |
| 4507 | def __init__(self, xid=None, flags=None, entries=None): |
| 4508 | if xid != None: |
| 4509 | self.xid = xid |
| 4510 | else: |
| 4511 | self.xid = None |
| 4512 | if flags != None: |
| 4513 | self.flags = flags |
| 4514 | else: |
| 4515 | self.flags = 0 |
| 4516 | if entries != None: |
| 4517 | self.entries = entries |
| 4518 | else: |
| 4519 | self.entries = [] |
| 4520 | return |
| 4521 | |
| 4522 | def pack(self): |
| 4523 | packed = [] |
| 4524 | packed.append(struct.pack("!B", self.version)) |
| 4525 | packed.append(struct.pack("!B", self.type)) |
| 4526 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 4527 | packed.append(struct.pack("!L", self.xid)) |
| 4528 | packed.append(struct.pack("!H", self.stats_type)) |
| 4529 | packed.append(struct.pack("!H", self.flags)) |
| 4530 | packed.append('\x00' * 4) |
| 4531 | packed.append(struct.pack("!L", self.experimenter)) |
| 4532 | packed.append(struct.pack("!L", self.subtype)) |
| 4533 | packed.append(loxi.generic_util.pack_list(self.entries)) |
| 4534 | length = sum([len(x) for x in packed]) |
| 4535 | packed[2] = struct.pack("!H", length) |
| 4536 | return ''.join(packed) |
| 4537 | |
| 4538 | @staticmethod |
| 4539 | def unpack(reader): |
| 4540 | obj = bsn_gentable_entry_desc_stats_reply() |
| 4541 | _version = reader.read("!B")[0] |
| 4542 | assert(_version == 4) |
| 4543 | _type = reader.read("!B")[0] |
| 4544 | assert(_type == 19) |
| 4545 | _length = reader.read("!H")[0] |
| 4546 | orig_reader = reader |
| 4547 | reader = orig_reader.slice(_length, 4) |
| 4548 | obj.xid = reader.read("!L")[0] |
| 4549 | _stats_type = reader.read("!H")[0] |
| 4550 | assert(_stats_type == 65535) |
| 4551 | obj.flags = reader.read("!H")[0] |
| 4552 | reader.skip(4) |
| 4553 | _experimenter = reader.read("!L")[0] |
| 4554 | assert(_experimenter == 6035143) |
| 4555 | _subtype = reader.read("!L")[0] |
| 4556 | assert(_subtype == 2) |
| 4557 | obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.bsn_gentable_entry_desc_stats_entry.unpack) |
| 4558 | return obj |
| 4559 | |
| 4560 | def __eq__(self, other): |
| 4561 | if type(self) != type(other): return False |
| 4562 | if self.xid != other.xid: return False |
| 4563 | if self.flags != other.flags: return False |
| 4564 | if self.entries != other.entries: return False |
| 4565 | return True |
| 4566 | |
| 4567 | def pretty_print(self, q): |
| 4568 | q.text("bsn_gentable_entry_desc_stats_reply {") |
| 4569 | with q.group(): |
| 4570 | with q.indent(2): |
| 4571 | q.breakable() |
| 4572 | q.text("xid = "); |
| 4573 | if self.xid != None: |
| 4574 | q.text("%#x" % self.xid) |
| 4575 | else: |
| 4576 | q.text('None') |
| 4577 | q.text(","); q.breakable() |
| 4578 | q.text("flags = "); |
| 4579 | q.text("%#x" % self.flags) |
| 4580 | q.text(","); q.breakable() |
| 4581 | q.text("entries = "); |
| 4582 | q.pp(self.entries) |
| 4583 | q.breakable() |
| 4584 | q.text('}') |
| 4585 | |
| 4586 | bsn_stats_reply.subtypes[2] = bsn_gentable_entry_desc_stats_reply |
| 4587 | |
| 4588 | class bsn_gentable_entry_desc_stats_request(bsn_stats_request): |
| 4589 | version = 4 |
| 4590 | type = 18 |
| 4591 | stats_type = 65535 |
| 4592 | experimenter = 6035143 |
| 4593 | subtype = 2 |
| 4594 | |
| 4595 | def __init__(self, xid=None, flags=None, table_id=None, checksum=None, checksum_mask=None): |
| 4596 | if xid != None: |
| 4597 | self.xid = xid |
| 4598 | else: |
| 4599 | self.xid = None |
| 4600 | if flags != None: |
| 4601 | self.flags = flags |
| 4602 | else: |
| 4603 | self.flags = 0 |
| 4604 | if table_id != None: |
| 4605 | self.table_id = table_id |
| 4606 | else: |
| 4607 | self.table_id = 0 |
| 4608 | if checksum != None: |
| 4609 | self.checksum = checksum |
| 4610 | else: |
| 4611 | self.checksum = 0 |
| 4612 | if checksum_mask != None: |
| 4613 | self.checksum_mask = checksum_mask |
| 4614 | else: |
| 4615 | self.checksum_mask = 0 |
| 4616 | return |
| 4617 | |
| 4618 | def pack(self): |
| 4619 | packed = [] |
| 4620 | packed.append(struct.pack("!B", self.version)) |
| 4621 | packed.append(struct.pack("!B", self.type)) |
| 4622 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 4623 | packed.append(struct.pack("!L", self.xid)) |
| 4624 | packed.append(struct.pack("!H", self.stats_type)) |
| 4625 | packed.append(struct.pack("!H", self.flags)) |
| 4626 | packed.append('\x00' * 4) |
| 4627 | packed.append(struct.pack("!L", self.experimenter)) |
| 4628 | packed.append(struct.pack("!L", self.subtype)) |
| 4629 | packed.append(struct.pack("!H", self.table_id)) |
| 4630 | packed.append('\x00' * 2) |
| 4631 | packed.append(util.pack_checksum_128(self.checksum)) |
| 4632 | packed.append(util.pack_checksum_128(self.checksum_mask)) |
| 4633 | length = sum([len(x) for x in packed]) |
| 4634 | packed[2] = struct.pack("!H", length) |
| 4635 | return ''.join(packed) |
| 4636 | |
| 4637 | @staticmethod |
| 4638 | def unpack(reader): |
| 4639 | obj = bsn_gentable_entry_desc_stats_request() |
| 4640 | _version = reader.read("!B")[0] |
| 4641 | assert(_version == 4) |
| 4642 | _type = reader.read("!B")[0] |
| 4643 | assert(_type == 18) |
| 4644 | _length = reader.read("!H")[0] |
| 4645 | orig_reader = reader |
| 4646 | reader = orig_reader.slice(_length, 4) |
| 4647 | obj.xid = reader.read("!L")[0] |
| 4648 | _stats_type = reader.read("!H")[0] |
| 4649 | assert(_stats_type == 65535) |
| 4650 | obj.flags = reader.read("!H")[0] |
| 4651 | reader.skip(4) |
| 4652 | _experimenter = reader.read("!L")[0] |
| 4653 | assert(_experimenter == 6035143) |
| 4654 | _subtype = reader.read("!L")[0] |
| 4655 | assert(_subtype == 2) |
| 4656 | obj.table_id = reader.read("!H")[0] |
| 4657 | reader.skip(2) |
| 4658 | obj.checksum = util.unpack_checksum_128(reader) |
| 4659 | obj.checksum_mask = util.unpack_checksum_128(reader) |
| 4660 | return obj |
| 4661 | |
| 4662 | def __eq__(self, other): |
| 4663 | if type(self) != type(other): return False |
| 4664 | if self.xid != other.xid: return False |
| 4665 | if self.flags != other.flags: return False |
| 4666 | if self.table_id != other.table_id: return False |
| 4667 | if self.checksum != other.checksum: return False |
| 4668 | if self.checksum_mask != other.checksum_mask: return False |
| 4669 | return True |
| 4670 | |
| 4671 | def pretty_print(self, q): |
| 4672 | q.text("bsn_gentable_entry_desc_stats_request {") |
| 4673 | with q.group(): |
| 4674 | with q.indent(2): |
| 4675 | q.breakable() |
| 4676 | q.text("xid = "); |
| 4677 | if self.xid != None: |
| 4678 | q.text("%#x" % self.xid) |
| 4679 | else: |
| 4680 | q.text('None') |
| 4681 | q.text(","); q.breakable() |
| 4682 | q.text("flags = "); |
| 4683 | q.text("%#x" % self.flags) |
| 4684 | q.text(","); q.breakable() |
| 4685 | q.text("table_id = "); |
| 4686 | q.text("%#x" % self.table_id) |
| 4687 | q.text(","); q.breakable() |
| 4688 | q.text("checksum = "); |
| 4689 | q.pp(self.checksum) |
| 4690 | q.text(","); q.breakable() |
| 4691 | q.text("checksum_mask = "); |
| 4692 | q.pp(self.checksum_mask) |
| 4693 | q.breakable() |
| 4694 | q.text('}') |
| 4695 | |
| 4696 | bsn_stats_request.subtypes[2] = bsn_gentable_entry_desc_stats_request |
| 4697 | |
| 4698 | class bsn_gentable_entry_stats_reply(bsn_stats_reply): |
| 4699 | version = 4 |
| 4700 | type = 19 |
| 4701 | stats_type = 65535 |
| 4702 | experimenter = 6035143 |
| 4703 | subtype = 3 |
| 4704 | |
| 4705 | def __init__(self, xid=None, flags=None, entries=None): |
| 4706 | if xid != None: |
| 4707 | self.xid = xid |
| 4708 | else: |
| 4709 | self.xid = None |
| 4710 | if flags != None: |
| 4711 | self.flags = flags |
| 4712 | else: |
| 4713 | self.flags = 0 |
| 4714 | if entries != None: |
| 4715 | self.entries = entries |
| 4716 | else: |
| 4717 | self.entries = [] |
| 4718 | return |
| 4719 | |
| 4720 | def pack(self): |
| 4721 | packed = [] |
| 4722 | packed.append(struct.pack("!B", self.version)) |
| 4723 | packed.append(struct.pack("!B", self.type)) |
| 4724 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 4725 | packed.append(struct.pack("!L", self.xid)) |
| 4726 | packed.append(struct.pack("!H", self.stats_type)) |
| 4727 | packed.append(struct.pack("!H", self.flags)) |
| 4728 | packed.append('\x00' * 4) |
| 4729 | packed.append(struct.pack("!L", self.experimenter)) |
| 4730 | packed.append(struct.pack("!L", self.subtype)) |
| 4731 | packed.append(loxi.generic_util.pack_list(self.entries)) |
| 4732 | length = sum([len(x) for x in packed]) |
| 4733 | packed[2] = struct.pack("!H", length) |
| 4734 | return ''.join(packed) |
| 4735 | |
| 4736 | @staticmethod |
| 4737 | def unpack(reader): |
| 4738 | obj = bsn_gentable_entry_stats_reply() |
| 4739 | _version = reader.read("!B")[0] |
| 4740 | assert(_version == 4) |
| 4741 | _type = reader.read("!B")[0] |
| 4742 | assert(_type == 19) |
| 4743 | _length = reader.read("!H")[0] |
| 4744 | orig_reader = reader |
| 4745 | reader = orig_reader.slice(_length, 4) |
| 4746 | obj.xid = reader.read("!L")[0] |
| 4747 | _stats_type = reader.read("!H")[0] |
| 4748 | assert(_stats_type == 65535) |
| 4749 | obj.flags = reader.read("!H")[0] |
| 4750 | reader.skip(4) |
| 4751 | _experimenter = reader.read("!L")[0] |
| 4752 | assert(_experimenter == 6035143) |
| 4753 | _subtype = reader.read("!L")[0] |
| 4754 | assert(_subtype == 3) |
| 4755 | obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.bsn_gentable_entry_stats_entry.unpack) |
| 4756 | return obj |
| 4757 | |
| 4758 | def __eq__(self, other): |
| 4759 | if type(self) != type(other): return False |
| 4760 | if self.xid != other.xid: return False |
| 4761 | if self.flags != other.flags: return False |
| 4762 | if self.entries != other.entries: return False |
| 4763 | return True |
| 4764 | |
| 4765 | def pretty_print(self, q): |
| 4766 | q.text("bsn_gentable_entry_stats_reply {") |
| 4767 | with q.group(): |
| 4768 | with q.indent(2): |
| 4769 | q.breakable() |
| 4770 | q.text("xid = "); |
| 4771 | if self.xid != None: |
| 4772 | q.text("%#x" % self.xid) |
| 4773 | else: |
| 4774 | q.text('None') |
| 4775 | q.text(","); q.breakable() |
| 4776 | q.text("flags = "); |
| 4777 | q.text("%#x" % self.flags) |
| 4778 | q.text(","); q.breakable() |
| 4779 | q.text("entries = "); |
| 4780 | q.pp(self.entries) |
| 4781 | q.breakable() |
| 4782 | q.text('}') |
| 4783 | |
| 4784 | bsn_stats_reply.subtypes[3] = bsn_gentable_entry_stats_reply |
| 4785 | |
| 4786 | class bsn_gentable_entry_stats_request(bsn_stats_request): |
| 4787 | version = 4 |
| 4788 | type = 18 |
| 4789 | stats_type = 65535 |
| 4790 | experimenter = 6035143 |
| 4791 | subtype = 3 |
| 4792 | |
| 4793 | def __init__(self, xid=None, flags=None, table_id=None, checksum=None, checksum_mask=None): |
| 4794 | if xid != None: |
| 4795 | self.xid = xid |
| 4796 | else: |
| 4797 | self.xid = None |
| 4798 | if flags != None: |
| 4799 | self.flags = flags |
| 4800 | else: |
| 4801 | self.flags = 0 |
| 4802 | if table_id != None: |
| 4803 | self.table_id = table_id |
| 4804 | else: |
| 4805 | self.table_id = 0 |
| 4806 | if checksum != None: |
| 4807 | self.checksum = checksum |
| 4808 | else: |
| 4809 | self.checksum = 0 |
| 4810 | if checksum_mask != None: |
| 4811 | self.checksum_mask = checksum_mask |
| 4812 | else: |
| 4813 | self.checksum_mask = 0 |
| 4814 | return |
| 4815 | |
| 4816 | def pack(self): |
| 4817 | packed = [] |
| 4818 | packed.append(struct.pack("!B", self.version)) |
| 4819 | packed.append(struct.pack("!B", self.type)) |
| 4820 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 4821 | packed.append(struct.pack("!L", self.xid)) |
| 4822 | packed.append(struct.pack("!H", self.stats_type)) |
| 4823 | packed.append(struct.pack("!H", self.flags)) |
| 4824 | packed.append('\x00' * 4) |
| 4825 | packed.append(struct.pack("!L", self.experimenter)) |
| 4826 | packed.append(struct.pack("!L", self.subtype)) |
| 4827 | packed.append(struct.pack("!H", self.table_id)) |
| 4828 | packed.append('\x00' * 2) |
| 4829 | packed.append(util.pack_checksum_128(self.checksum)) |
| 4830 | packed.append(util.pack_checksum_128(self.checksum_mask)) |
| 4831 | length = sum([len(x) for x in packed]) |
| 4832 | packed[2] = struct.pack("!H", length) |
| 4833 | return ''.join(packed) |
| 4834 | |
| 4835 | @staticmethod |
| 4836 | def unpack(reader): |
| 4837 | obj = bsn_gentable_entry_stats_request() |
| 4838 | _version = reader.read("!B")[0] |
| 4839 | assert(_version == 4) |
| 4840 | _type = reader.read("!B")[0] |
| 4841 | assert(_type == 18) |
| 4842 | _length = reader.read("!H")[0] |
| 4843 | orig_reader = reader |
| 4844 | reader = orig_reader.slice(_length, 4) |
| 4845 | obj.xid = reader.read("!L")[0] |
| 4846 | _stats_type = reader.read("!H")[0] |
| 4847 | assert(_stats_type == 65535) |
| 4848 | obj.flags = reader.read("!H")[0] |
| 4849 | reader.skip(4) |
| 4850 | _experimenter = reader.read("!L")[0] |
| 4851 | assert(_experimenter == 6035143) |
| 4852 | _subtype = reader.read("!L")[0] |
| 4853 | assert(_subtype == 3) |
| 4854 | obj.table_id = reader.read("!H")[0] |
| 4855 | reader.skip(2) |
| 4856 | obj.checksum = util.unpack_checksum_128(reader) |
| 4857 | obj.checksum_mask = util.unpack_checksum_128(reader) |
| 4858 | return obj |
| 4859 | |
| 4860 | def __eq__(self, other): |
| 4861 | if type(self) != type(other): return False |
| 4862 | if self.xid != other.xid: return False |
| 4863 | if self.flags != other.flags: return False |
| 4864 | if self.table_id != other.table_id: return False |
| 4865 | if self.checksum != other.checksum: return False |
| 4866 | if self.checksum_mask != other.checksum_mask: return False |
| 4867 | return True |
| 4868 | |
| 4869 | def pretty_print(self, q): |
| 4870 | q.text("bsn_gentable_entry_stats_request {") |
| 4871 | with q.group(): |
| 4872 | with q.indent(2): |
| 4873 | q.breakable() |
| 4874 | q.text("xid = "); |
| 4875 | if self.xid != None: |
| 4876 | q.text("%#x" % self.xid) |
| 4877 | else: |
| 4878 | q.text('None') |
| 4879 | q.text(","); q.breakable() |
| 4880 | q.text("flags = "); |
| 4881 | q.text("%#x" % self.flags) |
| 4882 | q.text(","); q.breakable() |
| 4883 | q.text("table_id = "); |
| 4884 | q.text("%#x" % self.table_id) |
| 4885 | q.text(","); q.breakable() |
| 4886 | q.text("checksum = "); |
| 4887 | q.pp(self.checksum) |
| 4888 | q.text(","); q.breakable() |
| 4889 | q.text("checksum_mask = "); |
| 4890 | q.pp(self.checksum_mask) |
| 4891 | q.breakable() |
| 4892 | q.text('}') |
| 4893 | |
| 4894 | bsn_stats_request.subtypes[3] = bsn_gentable_entry_stats_request |
| 4895 | |
| 4896 | class bsn_gentable_set_buckets_size(bsn_header): |
| 4897 | version = 4 |
| 4898 | type = 4 |
| 4899 | experimenter = 6035143 |
| 4900 | subtype = 50 |
| 4901 | |
| 4902 | def __init__(self, xid=None, table_id=None, buckets_size=None): |
| 4903 | if xid != None: |
| 4904 | self.xid = xid |
| 4905 | else: |
| 4906 | self.xid = None |
| 4907 | if table_id != None: |
| 4908 | self.table_id = table_id |
| 4909 | else: |
| 4910 | self.table_id = 0 |
| 4911 | if buckets_size != None: |
| 4912 | self.buckets_size = buckets_size |
| 4913 | else: |
| 4914 | self.buckets_size = 0 |
| 4915 | return |
| 4916 | |
| 4917 | def pack(self): |
| 4918 | packed = [] |
| 4919 | packed.append(struct.pack("!B", self.version)) |
| 4920 | packed.append(struct.pack("!B", self.type)) |
| 4921 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 4922 | packed.append(struct.pack("!L", self.xid)) |
| 4923 | packed.append(struct.pack("!L", self.experimenter)) |
| 4924 | packed.append(struct.pack("!L", self.subtype)) |
| 4925 | packed.append(struct.pack("!H", self.table_id)) |
| 4926 | packed.append('\x00' * 2) |
| 4927 | packed.append(struct.pack("!L", self.buckets_size)) |
| 4928 | length = sum([len(x) for x in packed]) |
| 4929 | packed[2] = struct.pack("!H", length) |
| 4930 | return ''.join(packed) |
| 4931 | |
| 4932 | @staticmethod |
| 4933 | def unpack(reader): |
| 4934 | obj = bsn_gentable_set_buckets_size() |
| 4935 | _version = reader.read("!B")[0] |
| 4936 | assert(_version == 4) |
| 4937 | _type = reader.read("!B")[0] |
| 4938 | assert(_type == 4) |
| 4939 | _length = reader.read("!H")[0] |
| 4940 | orig_reader = reader |
| 4941 | reader = orig_reader.slice(_length, 4) |
| 4942 | obj.xid = reader.read("!L")[0] |
| 4943 | _experimenter = reader.read("!L")[0] |
| 4944 | assert(_experimenter == 6035143) |
| 4945 | _subtype = reader.read("!L")[0] |
| 4946 | assert(_subtype == 50) |
| 4947 | obj.table_id = reader.read("!H")[0] |
| 4948 | reader.skip(2) |
| 4949 | obj.buckets_size = reader.read("!L")[0] |
| 4950 | return obj |
| 4951 | |
| 4952 | def __eq__(self, other): |
| 4953 | if type(self) != type(other): return False |
| 4954 | if self.xid != other.xid: return False |
| 4955 | if self.table_id != other.table_id: return False |
| 4956 | if self.buckets_size != other.buckets_size: return False |
| 4957 | return True |
| 4958 | |
| 4959 | def pretty_print(self, q): |
| 4960 | q.text("bsn_gentable_set_buckets_size {") |
| 4961 | with q.group(): |
| 4962 | with q.indent(2): |
| 4963 | q.breakable() |
| 4964 | q.text("xid = "); |
| 4965 | if self.xid != None: |
| 4966 | q.text("%#x" % self.xid) |
| 4967 | else: |
| 4968 | q.text('None') |
| 4969 | q.text(","); q.breakable() |
| 4970 | q.text("table_id = "); |
| 4971 | q.text("%#x" % self.table_id) |
| 4972 | q.text(","); q.breakable() |
| 4973 | q.text("buckets_size = "); |
| 4974 | q.text("%#x" % self.buckets_size) |
| 4975 | q.breakable() |
| 4976 | q.text('}') |
| 4977 | |
| 4978 | bsn_header.subtypes[50] = bsn_gentable_set_buckets_size |
| 4979 | |
| 4980 | class bsn_gentable_stats_reply(bsn_stats_reply): |
| 4981 | version = 4 |
| 4982 | type = 19 |
| 4983 | stats_type = 65535 |
| 4984 | experimenter = 6035143 |
| 4985 | subtype = 7 |
| 4986 | |
| 4987 | def __init__(self, xid=None, flags=None, entries=None): |
| 4988 | if xid != None: |
| 4989 | self.xid = xid |
| 4990 | else: |
| 4991 | self.xid = None |
| 4992 | if flags != None: |
| 4993 | self.flags = flags |
| 4994 | else: |
| 4995 | self.flags = 0 |
| 4996 | if entries != None: |
| 4997 | self.entries = entries |
| 4998 | else: |
| 4999 | self.entries = [] |
| 5000 | return |
| 5001 | |
| 5002 | def pack(self): |
| 5003 | packed = [] |
| 5004 | packed.append(struct.pack("!B", self.version)) |
| 5005 | packed.append(struct.pack("!B", self.type)) |
| 5006 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 5007 | packed.append(struct.pack("!L", self.xid)) |
| 5008 | packed.append(struct.pack("!H", self.stats_type)) |
| 5009 | packed.append(struct.pack("!H", self.flags)) |
| 5010 | packed.append('\x00' * 4) |
| 5011 | packed.append(struct.pack("!L", self.experimenter)) |
| 5012 | packed.append(struct.pack("!L", self.subtype)) |
| 5013 | packed.append(loxi.generic_util.pack_list(self.entries)) |
| 5014 | length = sum([len(x) for x in packed]) |
| 5015 | packed[2] = struct.pack("!H", length) |
| 5016 | return ''.join(packed) |
| 5017 | |
| 5018 | @staticmethod |
| 5019 | def unpack(reader): |
| 5020 | obj = bsn_gentable_stats_reply() |
| 5021 | _version = reader.read("!B")[0] |
| 5022 | assert(_version == 4) |
| 5023 | _type = reader.read("!B")[0] |
| 5024 | assert(_type == 19) |
| 5025 | _length = reader.read("!H")[0] |
| 5026 | orig_reader = reader |
| 5027 | reader = orig_reader.slice(_length, 4) |
| 5028 | obj.xid = reader.read("!L")[0] |
| 5029 | _stats_type = reader.read("!H")[0] |
| 5030 | assert(_stats_type == 65535) |
| 5031 | obj.flags = reader.read("!H")[0] |
| 5032 | reader.skip(4) |
| 5033 | _experimenter = reader.read("!L")[0] |
| 5034 | assert(_experimenter == 6035143) |
| 5035 | _subtype = reader.read("!L")[0] |
| 5036 | assert(_subtype == 7) |
| 5037 | obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.bsn_gentable_stats_entry.unpack) |
| 5038 | return obj |
| 5039 | |
| 5040 | def __eq__(self, other): |
| 5041 | if type(self) != type(other): return False |
| 5042 | if self.xid != other.xid: return False |
| 5043 | if self.flags != other.flags: return False |
| 5044 | if self.entries != other.entries: return False |
| 5045 | return True |
| 5046 | |
| 5047 | def pretty_print(self, q): |
| 5048 | q.text("bsn_gentable_stats_reply {") |
| 5049 | with q.group(): |
| 5050 | with q.indent(2): |
| 5051 | q.breakable() |
| 5052 | q.text("xid = "); |
| 5053 | if self.xid != None: |
| 5054 | q.text("%#x" % self.xid) |
| 5055 | else: |
| 5056 | q.text('None') |
| 5057 | q.text(","); q.breakable() |
| 5058 | q.text("flags = "); |
| 5059 | q.text("%#x" % self.flags) |
| 5060 | q.text(","); q.breakable() |
| 5061 | q.text("entries = "); |
| 5062 | q.pp(self.entries) |
| 5063 | q.breakable() |
| 5064 | q.text('}') |
| 5065 | |
| 5066 | bsn_stats_reply.subtypes[7] = bsn_gentable_stats_reply |
| 5067 | |
| 5068 | class bsn_gentable_stats_request(bsn_stats_request): |
| 5069 | version = 4 |
| 5070 | type = 18 |
| 5071 | stats_type = 65535 |
| 5072 | experimenter = 6035143 |
| 5073 | subtype = 7 |
| 5074 | |
| 5075 | def __init__(self, xid=None, flags=None): |
| 5076 | if xid != None: |
| 5077 | self.xid = xid |
| 5078 | else: |
| 5079 | self.xid = None |
| 5080 | if flags != None: |
| 5081 | self.flags = flags |
| 5082 | else: |
| 5083 | self.flags = 0 |
| 5084 | return |
| 5085 | |
| 5086 | def pack(self): |
| 5087 | packed = [] |
| 5088 | packed.append(struct.pack("!B", self.version)) |
| 5089 | packed.append(struct.pack("!B", self.type)) |
| 5090 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 5091 | packed.append(struct.pack("!L", self.xid)) |
| 5092 | packed.append(struct.pack("!H", self.stats_type)) |
| 5093 | packed.append(struct.pack("!H", self.flags)) |
| 5094 | packed.append('\x00' * 4) |
| 5095 | packed.append(struct.pack("!L", self.experimenter)) |
| 5096 | packed.append(struct.pack("!L", self.subtype)) |
| 5097 | length = sum([len(x) for x in packed]) |
| 5098 | packed[2] = struct.pack("!H", length) |
| 5099 | return ''.join(packed) |
| 5100 | |
| 5101 | @staticmethod |
| 5102 | def unpack(reader): |
| 5103 | obj = bsn_gentable_stats_request() |
| 5104 | _version = reader.read("!B")[0] |
| 5105 | assert(_version == 4) |
| 5106 | _type = reader.read("!B")[0] |
| 5107 | assert(_type == 18) |
| 5108 | _length = reader.read("!H")[0] |
| 5109 | orig_reader = reader |
| 5110 | reader = orig_reader.slice(_length, 4) |
| 5111 | obj.xid = reader.read("!L")[0] |
| 5112 | _stats_type = reader.read("!H")[0] |
| 5113 | assert(_stats_type == 65535) |
| 5114 | obj.flags = reader.read("!H")[0] |
| 5115 | reader.skip(4) |
| 5116 | _experimenter = reader.read("!L")[0] |
| 5117 | assert(_experimenter == 6035143) |
| 5118 | _subtype = reader.read("!L")[0] |
| 5119 | assert(_subtype == 7) |
| 5120 | return obj |
| 5121 | |
| 5122 | def __eq__(self, other): |
| 5123 | if type(self) != type(other): return False |
| 5124 | if self.xid != other.xid: return False |
| 5125 | if self.flags != other.flags: return False |
| 5126 | return True |
| 5127 | |
| 5128 | def pretty_print(self, q): |
| 5129 | q.text("bsn_gentable_stats_request {") |
| 5130 | with q.group(): |
| 5131 | with q.indent(2): |
| 5132 | q.breakable() |
| 5133 | q.text("xid = "); |
| 5134 | if self.xid != None: |
| 5135 | q.text("%#x" % self.xid) |
| 5136 | else: |
| 5137 | q.text('None') |
| 5138 | q.text(","); q.breakable() |
| 5139 | q.text("flags = "); |
| 5140 | q.text("%#x" % self.flags) |
| 5141 | q.breakable() |
| 5142 | q.text('}') |
| 5143 | |
| 5144 | bsn_stats_request.subtypes[7] = bsn_gentable_stats_request |
| 5145 | |
| 5146 | class bsn_get_interfaces_reply(bsn_header): |
| 5147 | version = 4 |
| 5148 | type = 4 |
| 5149 | experimenter = 6035143 |
| 5150 | subtype = 10 |
| 5151 | |
| 5152 | def __init__(self, xid=None, interfaces=None): |
| 5153 | if xid != None: |
| 5154 | self.xid = xid |
| 5155 | else: |
| 5156 | self.xid = None |
| 5157 | if interfaces != None: |
| 5158 | self.interfaces = interfaces |
| 5159 | else: |
| 5160 | self.interfaces = [] |
| 5161 | return |
| 5162 | |
| 5163 | def pack(self): |
| 5164 | packed = [] |
| 5165 | packed.append(struct.pack("!B", self.version)) |
| 5166 | packed.append(struct.pack("!B", self.type)) |
| 5167 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 5168 | packed.append(struct.pack("!L", self.xid)) |
| 5169 | packed.append(struct.pack("!L", self.experimenter)) |
| 5170 | packed.append(struct.pack("!L", self.subtype)) |
| 5171 | packed.append(loxi.generic_util.pack_list(self.interfaces)) |
| 5172 | length = sum([len(x) for x in packed]) |
| 5173 | packed[2] = struct.pack("!H", length) |
| 5174 | return ''.join(packed) |
| 5175 | |
| 5176 | @staticmethod |
| 5177 | def unpack(reader): |
| 5178 | obj = bsn_get_interfaces_reply() |
| 5179 | _version = reader.read("!B")[0] |
| 5180 | assert(_version == 4) |
| 5181 | _type = reader.read("!B")[0] |
| 5182 | assert(_type == 4) |
| 5183 | _length = reader.read("!H")[0] |
| 5184 | orig_reader = reader |
| 5185 | reader = orig_reader.slice(_length, 4) |
| 5186 | obj.xid = reader.read("!L")[0] |
| 5187 | _experimenter = reader.read("!L")[0] |
| 5188 | assert(_experimenter == 6035143) |
| 5189 | _subtype = reader.read("!L")[0] |
| 5190 | assert(_subtype == 10) |
| 5191 | obj.interfaces = loxi.generic_util.unpack_list(reader, ofp.common.bsn_interface.unpack) |
| 5192 | return obj |
| 5193 | |
| 5194 | def __eq__(self, other): |
| 5195 | if type(self) != type(other): return False |
| 5196 | if self.xid != other.xid: return False |
| 5197 | if self.interfaces != other.interfaces: return False |
| 5198 | return True |
| 5199 | |
| 5200 | def pretty_print(self, q): |
| 5201 | q.text("bsn_get_interfaces_reply {") |
| 5202 | with q.group(): |
| 5203 | with q.indent(2): |
| 5204 | q.breakable() |
| 5205 | q.text("xid = "); |
| 5206 | if self.xid != None: |
| 5207 | q.text("%#x" % self.xid) |
| 5208 | else: |
| 5209 | q.text('None') |
| 5210 | q.text(","); q.breakable() |
| 5211 | q.text("interfaces = "); |
| 5212 | q.pp(self.interfaces) |
| 5213 | q.breakable() |
| 5214 | q.text('}') |
| 5215 | |
| 5216 | bsn_header.subtypes[10] = bsn_get_interfaces_reply |
| 5217 | |
| 5218 | class bsn_get_interfaces_request(bsn_header): |
| 5219 | version = 4 |
| 5220 | type = 4 |
| 5221 | experimenter = 6035143 |
| 5222 | subtype = 9 |
| 5223 | |
| 5224 | def __init__(self, xid=None): |
| 5225 | if xid != None: |
| 5226 | self.xid = xid |
| 5227 | else: |
| 5228 | self.xid = None |
| 5229 | return |
| 5230 | |
| 5231 | def pack(self): |
| 5232 | packed = [] |
| 5233 | packed.append(struct.pack("!B", self.version)) |
| 5234 | packed.append(struct.pack("!B", self.type)) |
| 5235 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 5236 | packed.append(struct.pack("!L", self.xid)) |
| 5237 | packed.append(struct.pack("!L", self.experimenter)) |
| 5238 | packed.append(struct.pack("!L", self.subtype)) |
| 5239 | length = sum([len(x) for x in packed]) |
| 5240 | packed[2] = struct.pack("!H", length) |
| 5241 | return ''.join(packed) |
| 5242 | |
| 5243 | @staticmethod |
| 5244 | def unpack(reader): |
| 5245 | obj = bsn_get_interfaces_request() |
| 5246 | _version = reader.read("!B")[0] |
| 5247 | assert(_version == 4) |
| 5248 | _type = reader.read("!B")[0] |
| 5249 | assert(_type == 4) |
| 5250 | _length = reader.read("!H")[0] |
| 5251 | orig_reader = reader |
| 5252 | reader = orig_reader.slice(_length, 4) |
| 5253 | obj.xid = reader.read("!L")[0] |
| 5254 | _experimenter = reader.read("!L")[0] |
| 5255 | assert(_experimenter == 6035143) |
| 5256 | _subtype = reader.read("!L")[0] |
| 5257 | assert(_subtype == 9) |
| 5258 | return obj |
| 5259 | |
| 5260 | def __eq__(self, other): |
| 5261 | if type(self) != type(other): return False |
| 5262 | if self.xid != other.xid: return False |
| 5263 | return True |
| 5264 | |
| 5265 | def pretty_print(self, q): |
| 5266 | q.text("bsn_get_interfaces_request {") |
| 5267 | with q.group(): |
| 5268 | with q.indent(2): |
| 5269 | q.breakable() |
| 5270 | q.text("xid = "); |
| 5271 | if self.xid != None: |
| 5272 | q.text("%#x" % self.xid) |
| 5273 | else: |
| 5274 | q.text('None') |
| 5275 | q.breakable() |
| 5276 | q.text('}') |
| 5277 | |
| 5278 | bsn_header.subtypes[9] = bsn_get_interfaces_request |
| 5279 | |
| 5280 | class bsn_get_mirroring_reply(bsn_header): |
| 5281 | version = 4 |
| 5282 | type = 4 |
| 5283 | experimenter = 6035143 |
| 5284 | subtype = 5 |
| 5285 | |
| 5286 | def __init__(self, xid=None, report_mirror_ports=None): |
| 5287 | if xid != None: |
| 5288 | self.xid = xid |
| 5289 | else: |
| 5290 | self.xid = None |
| 5291 | if report_mirror_ports != None: |
| 5292 | self.report_mirror_ports = report_mirror_ports |
| 5293 | else: |
| 5294 | self.report_mirror_ports = 0 |
| 5295 | return |
| 5296 | |
| 5297 | def pack(self): |
| 5298 | packed = [] |
| 5299 | packed.append(struct.pack("!B", self.version)) |
| 5300 | packed.append(struct.pack("!B", self.type)) |
| 5301 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 5302 | packed.append(struct.pack("!L", self.xid)) |
| 5303 | packed.append(struct.pack("!L", self.experimenter)) |
| 5304 | packed.append(struct.pack("!L", self.subtype)) |
| 5305 | packed.append(struct.pack("!B", self.report_mirror_ports)) |
| 5306 | packed.append('\x00' * 3) |
| 5307 | length = sum([len(x) for x in packed]) |
| 5308 | packed[2] = struct.pack("!H", length) |
| 5309 | return ''.join(packed) |
| 5310 | |
| 5311 | @staticmethod |
| 5312 | def unpack(reader): |
| 5313 | obj = bsn_get_mirroring_reply() |
| 5314 | _version = reader.read("!B")[0] |
| 5315 | assert(_version == 4) |
| 5316 | _type = reader.read("!B")[0] |
| 5317 | assert(_type == 4) |
| 5318 | _length = reader.read("!H")[0] |
| 5319 | orig_reader = reader |
| 5320 | reader = orig_reader.slice(_length, 4) |
| 5321 | obj.xid = reader.read("!L")[0] |
| 5322 | _experimenter = reader.read("!L")[0] |
| 5323 | assert(_experimenter == 6035143) |
| 5324 | _subtype = reader.read("!L")[0] |
| 5325 | assert(_subtype == 5) |
| 5326 | obj.report_mirror_ports = reader.read("!B")[0] |
| 5327 | reader.skip(3) |
| 5328 | return obj |
| 5329 | |
| 5330 | def __eq__(self, other): |
| 5331 | if type(self) != type(other): return False |
| 5332 | if self.xid != other.xid: return False |
| 5333 | if self.report_mirror_ports != other.report_mirror_ports: return False |
| 5334 | return True |
| 5335 | |
| 5336 | def pretty_print(self, q): |
| 5337 | q.text("bsn_get_mirroring_reply {") |
| 5338 | with q.group(): |
| 5339 | with q.indent(2): |
| 5340 | q.breakable() |
| 5341 | q.text("xid = "); |
| 5342 | if self.xid != None: |
| 5343 | q.text("%#x" % self.xid) |
| 5344 | else: |
| 5345 | q.text('None') |
| 5346 | q.text(","); q.breakable() |
| 5347 | q.text("report_mirror_ports = "); |
| 5348 | q.text("%#x" % self.report_mirror_ports) |
| 5349 | q.breakable() |
| 5350 | q.text('}') |
| 5351 | |
| 5352 | bsn_header.subtypes[5] = bsn_get_mirroring_reply |
| 5353 | |
| 5354 | class bsn_get_mirroring_request(bsn_header): |
| 5355 | version = 4 |
| 5356 | type = 4 |
| 5357 | experimenter = 6035143 |
| 5358 | subtype = 4 |
| 5359 | |
| 5360 | def __init__(self, xid=None, report_mirror_ports=None): |
| 5361 | if xid != None: |
| 5362 | self.xid = xid |
| 5363 | else: |
| 5364 | self.xid = None |
| 5365 | if report_mirror_ports != None: |
| 5366 | self.report_mirror_ports = report_mirror_ports |
| 5367 | else: |
| 5368 | self.report_mirror_ports = 0 |
| 5369 | return |
| 5370 | |
| 5371 | def pack(self): |
| 5372 | packed = [] |
| 5373 | packed.append(struct.pack("!B", self.version)) |
| 5374 | packed.append(struct.pack("!B", self.type)) |
| 5375 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 5376 | packed.append(struct.pack("!L", self.xid)) |
| 5377 | packed.append(struct.pack("!L", self.experimenter)) |
| 5378 | packed.append(struct.pack("!L", self.subtype)) |
| 5379 | packed.append(struct.pack("!B", self.report_mirror_ports)) |
| 5380 | packed.append('\x00' * 3) |
| 5381 | length = sum([len(x) for x in packed]) |
| 5382 | packed[2] = struct.pack("!H", length) |
| 5383 | return ''.join(packed) |
| 5384 | |
| 5385 | @staticmethod |
| 5386 | def unpack(reader): |
| 5387 | obj = bsn_get_mirroring_request() |
| 5388 | _version = reader.read("!B")[0] |
| 5389 | assert(_version == 4) |
| 5390 | _type = reader.read("!B")[0] |
| 5391 | assert(_type == 4) |
| 5392 | _length = reader.read("!H")[0] |
| 5393 | orig_reader = reader |
| 5394 | reader = orig_reader.slice(_length, 4) |
| 5395 | obj.xid = reader.read("!L")[0] |
| 5396 | _experimenter = reader.read("!L")[0] |
| 5397 | assert(_experimenter == 6035143) |
| 5398 | _subtype = reader.read("!L")[0] |
| 5399 | assert(_subtype == 4) |
| 5400 | obj.report_mirror_ports = reader.read("!B")[0] |
| 5401 | reader.skip(3) |
| 5402 | return obj |
| 5403 | |
| 5404 | def __eq__(self, other): |
| 5405 | if type(self) != type(other): return False |
| 5406 | if self.xid != other.xid: return False |
| 5407 | if self.report_mirror_ports != other.report_mirror_ports: return False |
| 5408 | return True |
| 5409 | |
| 5410 | def pretty_print(self, q): |
| 5411 | q.text("bsn_get_mirroring_request {") |
| 5412 | with q.group(): |
| 5413 | with q.indent(2): |
| 5414 | q.breakable() |
| 5415 | q.text("xid = "); |
| 5416 | if self.xid != None: |
| 5417 | q.text("%#x" % self.xid) |
| 5418 | else: |
| 5419 | q.text('None') |
| 5420 | q.text(","); q.breakable() |
| 5421 | q.text("report_mirror_ports = "); |
| 5422 | q.text("%#x" % self.report_mirror_ports) |
| 5423 | q.breakable() |
| 5424 | q.text('}') |
| 5425 | |
| 5426 | bsn_header.subtypes[4] = bsn_get_mirroring_request |
| 5427 | |
| 5428 | class bsn_get_switch_pipeline_reply(bsn_header): |
| 5429 | version = 4 |
| 5430 | type = 4 |
| 5431 | experimenter = 6035143 |
| 5432 | subtype = 52 |
| 5433 | |
| 5434 | def __init__(self, xid=None, pipeline=None): |
| 5435 | if xid != None: |
| 5436 | self.xid = xid |
| 5437 | else: |
| 5438 | self.xid = None |
| 5439 | if pipeline != None: |
| 5440 | self.pipeline = pipeline |
| 5441 | else: |
| 5442 | self.pipeline = "" |
| 5443 | return |
| 5444 | |
| 5445 | def pack(self): |
| 5446 | packed = [] |
| 5447 | packed.append(struct.pack("!B", self.version)) |
| 5448 | packed.append(struct.pack("!B", self.type)) |
| 5449 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 5450 | packed.append(struct.pack("!L", self.xid)) |
| 5451 | packed.append(struct.pack("!L", self.experimenter)) |
| 5452 | packed.append(struct.pack("!L", self.subtype)) |
| 5453 | packed.append(struct.pack("!256s", self.pipeline)) |
| 5454 | length = sum([len(x) for x in packed]) |
| 5455 | packed[2] = struct.pack("!H", length) |
| 5456 | return ''.join(packed) |
| 5457 | |
| 5458 | @staticmethod |
| 5459 | def unpack(reader): |
| 5460 | obj = bsn_get_switch_pipeline_reply() |
| 5461 | _version = reader.read("!B")[0] |
| 5462 | assert(_version == 4) |
| 5463 | _type = reader.read("!B")[0] |
| 5464 | assert(_type == 4) |
| 5465 | _length = reader.read("!H")[0] |
| 5466 | orig_reader = reader |
| 5467 | reader = orig_reader.slice(_length, 4) |
| 5468 | obj.xid = reader.read("!L")[0] |
| 5469 | _experimenter = reader.read("!L")[0] |
| 5470 | assert(_experimenter == 6035143) |
| 5471 | _subtype = reader.read("!L")[0] |
| 5472 | assert(_subtype == 52) |
| 5473 | obj.pipeline = reader.read("!256s")[0].rstrip("\x00") |
| 5474 | return obj |
| 5475 | |
| 5476 | def __eq__(self, other): |
| 5477 | if type(self) != type(other): return False |
| 5478 | if self.xid != other.xid: return False |
| 5479 | if self.pipeline != other.pipeline: return False |
| 5480 | return True |
| 5481 | |
| 5482 | def pretty_print(self, q): |
| 5483 | q.text("bsn_get_switch_pipeline_reply {") |
| 5484 | with q.group(): |
| 5485 | with q.indent(2): |
| 5486 | q.breakable() |
| 5487 | q.text("xid = "); |
| 5488 | if self.xid != None: |
| 5489 | q.text("%#x" % self.xid) |
| 5490 | else: |
| 5491 | q.text('None') |
| 5492 | q.text(","); q.breakable() |
| 5493 | q.text("pipeline = "); |
| 5494 | q.pp(self.pipeline) |
| 5495 | q.breakable() |
| 5496 | q.text('}') |
| 5497 | |
| 5498 | bsn_header.subtypes[52] = bsn_get_switch_pipeline_reply |
| 5499 | |
| 5500 | class bsn_get_switch_pipeline_request(bsn_header): |
| 5501 | version = 4 |
| 5502 | type = 4 |
| 5503 | experimenter = 6035143 |
| 5504 | subtype = 51 |
| 5505 | |
| 5506 | def __init__(self, xid=None): |
| 5507 | if xid != None: |
| 5508 | self.xid = xid |
| 5509 | else: |
| 5510 | self.xid = None |
| 5511 | return |
| 5512 | |
| 5513 | def pack(self): |
| 5514 | packed = [] |
| 5515 | packed.append(struct.pack("!B", self.version)) |
| 5516 | packed.append(struct.pack("!B", self.type)) |
| 5517 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 5518 | packed.append(struct.pack("!L", self.xid)) |
| 5519 | packed.append(struct.pack("!L", self.experimenter)) |
| 5520 | packed.append(struct.pack("!L", self.subtype)) |
| 5521 | length = sum([len(x) for x in packed]) |
| 5522 | packed[2] = struct.pack("!H", length) |
| 5523 | return ''.join(packed) |
| 5524 | |
| 5525 | @staticmethod |
| 5526 | def unpack(reader): |
| 5527 | obj = bsn_get_switch_pipeline_request() |
| 5528 | _version = reader.read("!B")[0] |
| 5529 | assert(_version == 4) |
| 5530 | _type = reader.read("!B")[0] |
| 5531 | assert(_type == 4) |
| 5532 | _length = reader.read("!H")[0] |
| 5533 | orig_reader = reader |
| 5534 | reader = orig_reader.slice(_length, 4) |
| 5535 | obj.xid = reader.read("!L")[0] |
| 5536 | _experimenter = reader.read("!L")[0] |
| 5537 | assert(_experimenter == 6035143) |
| 5538 | _subtype = reader.read("!L")[0] |
| 5539 | assert(_subtype == 51) |
| 5540 | return obj |
| 5541 | |
| 5542 | def __eq__(self, other): |
| 5543 | if type(self) != type(other): return False |
| 5544 | if self.xid != other.xid: return False |
| 5545 | return True |
| 5546 | |
| 5547 | def pretty_print(self, q): |
| 5548 | q.text("bsn_get_switch_pipeline_request {") |
| 5549 | with q.group(): |
| 5550 | with q.indent(2): |
| 5551 | q.breakable() |
| 5552 | q.text("xid = "); |
| 5553 | if self.xid != None: |
| 5554 | q.text("%#x" % self.xid) |
| 5555 | else: |
| 5556 | q.text('None') |
| 5557 | q.breakable() |
| 5558 | q.text('}') |
| 5559 | |
| 5560 | bsn_header.subtypes[51] = bsn_get_switch_pipeline_request |
| 5561 | |
| 5562 | class bsn_image_desc_stats_reply(bsn_stats_reply): |
| 5563 | version = 4 |
| 5564 | type = 19 |
| 5565 | stats_type = 65535 |
| 5566 | experimenter = 6035143 |
| 5567 | subtype = 14 |
| 5568 | |
| 5569 | def __init__(self, xid=None, flags=None, image_checksum=None, startup_config_checksum=None): |
| 5570 | if xid != None: |
| 5571 | self.xid = xid |
| 5572 | else: |
| 5573 | self.xid = None |
| 5574 | if flags != None: |
| 5575 | self.flags = flags |
| 5576 | else: |
| 5577 | self.flags = 0 |
| 5578 | if image_checksum != None: |
| 5579 | self.image_checksum = image_checksum |
| 5580 | else: |
| 5581 | self.image_checksum = "" |
| 5582 | if startup_config_checksum != None: |
| 5583 | self.startup_config_checksum = startup_config_checksum |
| 5584 | else: |
| 5585 | self.startup_config_checksum = "" |
| 5586 | return |
| 5587 | |
| 5588 | def pack(self): |
| 5589 | packed = [] |
| 5590 | packed.append(struct.pack("!B", self.version)) |
| 5591 | packed.append(struct.pack("!B", self.type)) |
| 5592 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 5593 | packed.append(struct.pack("!L", self.xid)) |
| 5594 | packed.append(struct.pack("!H", self.stats_type)) |
| 5595 | packed.append(struct.pack("!H", self.flags)) |
| 5596 | packed.append('\x00' * 4) |
| 5597 | packed.append(struct.pack("!L", self.experimenter)) |
| 5598 | packed.append(struct.pack("!L", self.subtype)) |
| 5599 | packed.append(struct.pack("!256s", self.image_checksum)) |
| 5600 | packed.append(struct.pack("!256s", self.startup_config_checksum)) |
| 5601 | length = sum([len(x) for x in packed]) |
| 5602 | packed[2] = struct.pack("!H", length) |
| 5603 | return ''.join(packed) |
| 5604 | |
| 5605 | @staticmethod |
| 5606 | def unpack(reader): |
| 5607 | obj = bsn_image_desc_stats_reply() |
| 5608 | _version = reader.read("!B")[0] |
| 5609 | assert(_version == 4) |
| 5610 | _type = reader.read("!B")[0] |
| 5611 | assert(_type == 19) |
| 5612 | _length = reader.read("!H")[0] |
| 5613 | orig_reader = reader |
| 5614 | reader = orig_reader.slice(_length, 4) |
| 5615 | obj.xid = reader.read("!L")[0] |
| 5616 | _stats_type = reader.read("!H")[0] |
| 5617 | assert(_stats_type == 65535) |
| 5618 | obj.flags = reader.read("!H")[0] |
| 5619 | reader.skip(4) |
| 5620 | _experimenter = reader.read("!L")[0] |
| 5621 | assert(_experimenter == 6035143) |
| 5622 | _subtype = reader.read("!L")[0] |
| 5623 | assert(_subtype == 14) |
| 5624 | obj.image_checksum = reader.read("!256s")[0].rstrip("\x00") |
| 5625 | obj.startup_config_checksum = reader.read("!256s")[0].rstrip("\x00") |
| 5626 | return obj |
| 5627 | |
| 5628 | def __eq__(self, other): |
| 5629 | if type(self) != type(other): return False |
| 5630 | if self.xid != other.xid: return False |
| 5631 | if self.flags != other.flags: return False |
| 5632 | if self.image_checksum != other.image_checksum: return False |
| 5633 | if self.startup_config_checksum != other.startup_config_checksum: return False |
| 5634 | return True |
| 5635 | |
| 5636 | def pretty_print(self, q): |
| 5637 | q.text("bsn_image_desc_stats_reply {") |
| 5638 | with q.group(): |
| 5639 | with q.indent(2): |
| 5640 | q.breakable() |
| 5641 | q.text("xid = "); |
| 5642 | if self.xid != None: |
| 5643 | q.text("%#x" % self.xid) |
| 5644 | else: |
| 5645 | q.text('None') |
| 5646 | q.text(","); q.breakable() |
| 5647 | q.text("flags = "); |
| 5648 | q.text("%#x" % self.flags) |
| 5649 | q.text(","); q.breakable() |
| 5650 | q.text("image_checksum = "); |
| 5651 | q.pp(self.image_checksum) |
| 5652 | q.text(","); q.breakable() |
| 5653 | q.text("startup_config_checksum = "); |
| 5654 | q.pp(self.startup_config_checksum) |
| 5655 | q.breakable() |
| 5656 | q.text('}') |
| 5657 | |
| 5658 | bsn_stats_reply.subtypes[14] = bsn_image_desc_stats_reply |
| 5659 | |
| 5660 | class bsn_image_desc_stats_request(bsn_stats_request): |
| 5661 | version = 4 |
| 5662 | type = 18 |
| 5663 | stats_type = 65535 |
| 5664 | experimenter = 6035143 |
| 5665 | subtype = 14 |
| 5666 | |
| 5667 | def __init__(self, xid=None, flags=None): |
| 5668 | if xid != None: |
| 5669 | self.xid = xid |
| 5670 | else: |
| 5671 | self.xid = None |
| 5672 | if flags != None: |
| 5673 | self.flags = flags |
| 5674 | else: |
| 5675 | self.flags = 0 |
| 5676 | return |
| 5677 | |
| 5678 | def pack(self): |
| 5679 | packed = [] |
| 5680 | packed.append(struct.pack("!B", self.version)) |
| 5681 | packed.append(struct.pack("!B", self.type)) |
| 5682 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 5683 | packed.append(struct.pack("!L", self.xid)) |
| 5684 | packed.append(struct.pack("!H", self.stats_type)) |
| 5685 | packed.append(struct.pack("!H", self.flags)) |
| 5686 | packed.append('\x00' * 4) |
| 5687 | packed.append(struct.pack("!L", self.experimenter)) |
| 5688 | packed.append(struct.pack("!L", self.subtype)) |
| 5689 | length = sum([len(x) for x in packed]) |
| 5690 | packed[2] = struct.pack("!H", length) |
| 5691 | return ''.join(packed) |
| 5692 | |
| 5693 | @staticmethod |
| 5694 | def unpack(reader): |
| 5695 | obj = bsn_image_desc_stats_request() |
| 5696 | _version = reader.read("!B")[0] |
| 5697 | assert(_version == 4) |
| 5698 | _type = reader.read("!B")[0] |
| 5699 | assert(_type == 18) |
| 5700 | _length = reader.read("!H")[0] |
| 5701 | orig_reader = reader |
| 5702 | reader = orig_reader.slice(_length, 4) |
| 5703 | obj.xid = reader.read("!L")[0] |
| 5704 | _stats_type = reader.read("!H")[0] |
| 5705 | assert(_stats_type == 65535) |
| 5706 | obj.flags = reader.read("!H")[0] |
| 5707 | reader.skip(4) |
| 5708 | _experimenter = reader.read("!L")[0] |
| 5709 | assert(_experimenter == 6035143) |
| 5710 | _subtype = reader.read("!L")[0] |
| 5711 | assert(_subtype == 14) |
| 5712 | return obj |
| 5713 | |
| 5714 | def __eq__(self, other): |
| 5715 | if type(self) != type(other): return False |
| 5716 | if self.xid != other.xid: return False |
| 5717 | if self.flags != other.flags: return False |
| 5718 | return True |
| 5719 | |
| 5720 | def pretty_print(self, q): |
| 5721 | q.text("bsn_image_desc_stats_request {") |
| 5722 | with q.group(): |
| 5723 | with q.indent(2): |
| 5724 | q.breakable() |
| 5725 | q.text("xid = "); |
| 5726 | if self.xid != None: |
| 5727 | q.text("%#x" % self.xid) |
| 5728 | else: |
| 5729 | q.text('None') |
| 5730 | q.text(","); q.breakable() |
| 5731 | q.text("flags = "); |
| 5732 | q.text("%#x" % self.flags) |
| 5733 | q.breakable() |
| 5734 | q.text('}') |
| 5735 | |
| 5736 | bsn_stats_request.subtypes[14] = bsn_image_desc_stats_request |
| 5737 | |
| 5738 | class bsn_lacp_convergence_notif(bsn_header): |
| 5739 | version = 4 |
| 5740 | type = 4 |
| 5741 | experimenter = 6035143 |
| 5742 | subtype = 43 |
| 5743 | |
| 5744 | def __init__(self, xid=None, convergence_status=None, port_no=None, actor_sys_priority=None, actor_sys_mac=None, actor_port_priority=None, actor_port_num=None, actor_key=None, partner_sys_priority=None, partner_sys_mac=None, partner_port_priority=None, partner_port_num=None, partner_key=None): |
| 5745 | if xid != None: |
| 5746 | self.xid = xid |
| 5747 | else: |
| 5748 | self.xid = None |
| 5749 | if convergence_status != None: |
| 5750 | self.convergence_status = convergence_status |
| 5751 | else: |
| 5752 | self.convergence_status = 0 |
| 5753 | if port_no != None: |
| 5754 | self.port_no = port_no |
| 5755 | else: |
| 5756 | self.port_no = 0 |
| 5757 | if actor_sys_priority != None: |
| 5758 | self.actor_sys_priority = actor_sys_priority |
| 5759 | else: |
| 5760 | self.actor_sys_priority = 0 |
| 5761 | if actor_sys_mac != None: |
| 5762 | self.actor_sys_mac = actor_sys_mac |
| 5763 | else: |
| 5764 | self.actor_sys_mac = [0,0,0,0,0,0] |
| 5765 | if actor_port_priority != None: |
| 5766 | self.actor_port_priority = actor_port_priority |
| 5767 | else: |
| 5768 | self.actor_port_priority = 0 |
| 5769 | if actor_port_num != None: |
| 5770 | self.actor_port_num = actor_port_num |
| 5771 | else: |
| 5772 | self.actor_port_num = 0 |
| 5773 | if actor_key != None: |
| 5774 | self.actor_key = actor_key |
| 5775 | else: |
| 5776 | self.actor_key = 0 |
| 5777 | if partner_sys_priority != None: |
| 5778 | self.partner_sys_priority = partner_sys_priority |
| 5779 | else: |
| 5780 | self.partner_sys_priority = 0 |
| 5781 | if partner_sys_mac != None: |
| 5782 | self.partner_sys_mac = partner_sys_mac |
| 5783 | else: |
| 5784 | self.partner_sys_mac = [0,0,0,0,0,0] |
| 5785 | if partner_port_priority != None: |
| 5786 | self.partner_port_priority = partner_port_priority |
| 5787 | else: |
| 5788 | self.partner_port_priority = 0 |
| 5789 | if partner_port_num != None: |
| 5790 | self.partner_port_num = partner_port_num |
| 5791 | else: |
| 5792 | self.partner_port_num = 0 |
| 5793 | if partner_key != None: |
| 5794 | self.partner_key = partner_key |
| 5795 | else: |
| 5796 | self.partner_key = 0 |
| 5797 | return |
| 5798 | |
| 5799 | def pack(self): |
| 5800 | packed = [] |
| 5801 | packed.append(struct.pack("!B", self.version)) |
| 5802 | packed.append(struct.pack("!B", self.type)) |
| 5803 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 5804 | packed.append(struct.pack("!L", self.xid)) |
| 5805 | packed.append(struct.pack("!L", self.experimenter)) |
| 5806 | packed.append(struct.pack("!L", self.subtype)) |
| 5807 | packed.append(struct.pack("!B", self.convergence_status)) |
| 5808 | packed.append('\x00' * 3) |
| 5809 | packed.append(util.pack_port_no(self.port_no)) |
| 5810 | packed.append(struct.pack("!H", self.actor_sys_priority)) |
| 5811 | packed.append(struct.pack("!6B", *self.actor_sys_mac)) |
| 5812 | packed.append(struct.pack("!H", self.actor_port_priority)) |
| 5813 | packed.append(struct.pack("!H", self.actor_port_num)) |
| 5814 | packed.append(struct.pack("!H", self.actor_key)) |
| 5815 | packed.append(struct.pack("!H", self.partner_sys_priority)) |
| 5816 | packed.append(struct.pack("!6B", *self.partner_sys_mac)) |
| 5817 | packed.append(struct.pack("!H", self.partner_port_priority)) |
| 5818 | packed.append(struct.pack("!H", self.partner_port_num)) |
| 5819 | packed.append(struct.pack("!H", self.partner_key)) |
| 5820 | length = sum([len(x) for x in packed]) |
| 5821 | packed[2] = struct.pack("!H", length) |
| 5822 | return ''.join(packed) |
| 5823 | |
| 5824 | @staticmethod |
| 5825 | def unpack(reader): |
| 5826 | obj = bsn_lacp_convergence_notif() |
| 5827 | _version = reader.read("!B")[0] |
| 5828 | assert(_version == 4) |
| 5829 | _type = reader.read("!B")[0] |
| 5830 | assert(_type == 4) |
| 5831 | _length = reader.read("!H")[0] |
| 5832 | orig_reader = reader |
| 5833 | reader = orig_reader.slice(_length, 4) |
| 5834 | obj.xid = reader.read("!L")[0] |
| 5835 | _experimenter = reader.read("!L")[0] |
| 5836 | assert(_experimenter == 6035143) |
| 5837 | _subtype = reader.read("!L")[0] |
| 5838 | assert(_subtype == 43) |
| 5839 | obj.convergence_status = reader.read("!B")[0] |
| 5840 | reader.skip(3) |
| 5841 | obj.port_no = util.unpack_port_no(reader) |
| 5842 | obj.actor_sys_priority = reader.read("!H")[0] |
| 5843 | obj.actor_sys_mac = list(reader.read('!6B')) |
| 5844 | obj.actor_port_priority = reader.read("!H")[0] |
| 5845 | obj.actor_port_num = reader.read("!H")[0] |
| 5846 | obj.actor_key = reader.read("!H")[0] |
| 5847 | obj.partner_sys_priority = reader.read("!H")[0] |
| 5848 | obj.partner_sys_mac = list(reader.read('!6B')) |
| 5849 | obj.partner_port_priority = reader.read("!H")[0] |
| 5850 | obj.partner_port_num = reader.read("!H")[0] |
| 5851 | obj.partner_key = reader.read("!H")[0] |
| 5852 | return obj |
| 5853 | |
| 5854 | def __eq__(self, other): |
| 5855 | if type(self) != type(other): return False |
| 5856 | if self.xid != other.xid: return False |
| 5857 | if self.convergence_status != other.convergence_status: return False |
| 5858 | if self.port_no != other.port_no: return False |
| 5859 | if self.actor_sys_priority != other.actor_sys_priority: return False |
| 5860 | if self.actor_sys_mac != other.actor_sys_mac: return False |
| 5861 | if self.actor_port_priority != other.actor_port_priority: return False |
| 5862 | if self.actor_port_num != other.actor_port_num: return False |
| 5863 | if self.actor_key != other.actor_key: return False |
| 5864 | if self.partner_sys_priority != other.partner_sys_priority: return False |
| 5865 | if self.partner_sys_mac != other.partner_sys_mac: return False |
| 5866 | if self.partner_port_priority != other.partner_port_priority: return False |
| 5867 | if self.partner_port_num != other.partner_port_num: return False |
| 5868 | if self.partner_key != other.partner_key: return False |
| 5869 | return True |
| 5870 | |
| 5871 | def pretty_print(self, q): |
| 5872 | q.text("bsn_lacp_convergence_notif {") |
| 5873 | with q.group(): |
| 5874 | with q.indent(2): |
| 5875 | q.breakable() |
| 5876 | q.text("xid = "); |
| 5877 | if self.xid != None: |
| 5878 | q.text("%#x" % self.xid) |
| 5879 | else: |
| 5880 | q.text('None') |
| 5881 | q.text(","); q.breakable() |
| 5882 | q.text("convergence_status = "); |
| 5883 | q.text("%#x" % self.convergence_status) |
| 5884 | q.text(","); q.breakable() |
| 5885 | q.text("port_no = "); |
| 5886 | q.text(util.pretty_port(self.port_no)) |
| 5887 | q.text(","); q.breakable() |
| 5888 | q.text("actor_sys_priority = "); |
| 5889 | q.text("%#x" % self.actor_sys_priority) |
| 5890 | q.text(","); q.breakable() |
| 5891 | q.text("actor_sys_mac = "); |
| 5892 | q.text(util.pretty_mac(self.actor_sys_mac)) |
| 5893 | q.text(","); q.breakable() |
| 5894 | q.text("actor_port_priority = "); |
| 5895 | q.text("%#x" % self.actor_port_priority) |
| 5896 | q.text(","); q.breakable() |
| 5897 | q.text("actor_port_num = "); |
| 5898 | q.text("%#x" % self.actor_port_num) |
| 5899 | q.text(","); q.breakable() |
| 5900 | q.text("actor_key = "); |
| 5901 | q.text("%#x" % self.actor_key) |
| 5902 | q.text(","); q.breakable() |
| 5903 | q.text("partner_sys_priority = "); |
| 5904 | q.text("%#x" % self.partner_sys_priority) |
| 5905 | q.text(","); q.breakable() |
| 5906 | q.text("partner_sys_mac = "); |
| 5907 | q.text(util.pretty_mac(self.partner_sys_mac)) |
| 5908 | q.text(","); q.breakable() |
| 5909 | q.text("partner_port_priority = "); |
| 5910 | q.text("%#x" % self.partner_port_priority) |
| 5911 | q.text(","); q.breakable() |
| 5912 | q.text("partner_port_num = "); |
| 5913 | q.text("%#x" % self.partner_port_num) |
| 5914 | q.text(","); q.breakable() |
| 5915 | q.text("partner_key = "); |
| 5916 | q.text("%#x" % self.partner_key) |
| 5917 | q.breakable() |
| 5918 | q.text('}') |
| 5919 | |
| 5920 | bsn_header.subtypes[43] = bsn_lacp_convergence_notif |
| 5921 | |
| 5922 | class bsn_lacp_stats_reply(bsn_stats_reply): |
| 5923 | version = 4 |
| 5924 | type = 19 |
| 5925 | stats_type = 65535 |
| 5926 | experimenter = 6035143 |
| 5927 | subtype = 1 |
| 5928 | |
| 5929 | def __init__(self, xid=None, flags=None, entries=None): |
| 5930 | if xid != None: |
| 5931 | self.xid = xid |
| 5932 | else: |
| 5933 | self.xid = None |
| 5934 | if flags != None: |
| 5935 | self.flags = flags |
| 5936 | else: |
| 5937 | self.flags = 0 |
| 5938 | if entries != None: |
| 5939 | self.entries = entries |
| 5940 | else: |
| 5941 | self.entries = [] |
| 5942 | return |
| 5943 | |
| 5944 | def pack(self): |
| 5945 | packed = [] |
| 5946 | packed.append(struct.pack("!B", self.version)) |
| 5947 | packed.append(struct.pack("!B", self.type)) |
| 5948 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 5949 | packed.append(struct.pack("!L", self.xid)) |
| 5950 | packed.append(struct.pack("!H", self.stats_type)) |
| 5951 | packed.append(struct.pack("!H", self.flags)) |
| 5952 | packed.append('\x00' * 4) |
| 5953 | packed.append(struct.pack("!L", self.experimenter)) |
| 5954 | packed.append(struct.pack("!L", self.subtype)) |
| 5955 | packed.append(loxi.generic_util.pack_list(self.entries)) |
| 5956 | length = sum([len(x) for x in packed]) |
| 5957 | packed[2] = struct.pack("!H", length) |
| 5958 | return ''.join(packed) |
| 5959 | |
| 5960 | @staticmethod |
| 5961 | def unpack(reader): |
| 5962 | obj = bsn_lacp_stats_reply() |
| 5963 | _version = reader.read("!B")[0] |
| 5964 | assert(_version == 4) |
| 5965 | _type = reader.read("!B")[0] |
| 5966 | assert(_type == 19) |
| 5967 | _length = reader.read("!H")[0] |
| 5968 | orig_reader = reader |
| 5969 | reader = orig_reader.slice(_length, 4) |
| 5970 | obj.xid = reader.read("!L")[0] |
| 5971 | _stats_type = reader.read("!H")[0] |
| 5972 | assert(_stats_type == 65535) |
| 5973 | obj.flags = reader.read("!H")[0] |
| 5974 | reader.skip(4) |
| 5975 | _experimenter = reader.read("!L")[0] |
| 5976 | assert(_experimenter == 6035143) |
| 5977 | _subtype = reader.read("!L")[0] |
| 5978 | assert(_subtype == 1) |
| 5979 | obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.bsn_lacp_stats_entry.unpack) |
| 5980 | return obj |
| 5981 | |
| 5982 | def __eq__(self, other): |
| 5983 | if type(self) != type(other): return False |
| 5984 | if self.xid != other.xid: return False |
| 5985 | if self.flags != other.flags: return False |
| 5986 | if self.entries != other.entries: return False |
| 5987 | return True |
| 5988 | |
| 5989 | def pretty_print(self, q): |
| 5990 | q.text("bsn_lacp_stats_reply {") |
| 5991 | with q.group(): |
| 5992 | with q.indent(2): |
| 5993 | q.breakable() |
| 5994 | q.text("xid = "); |
| 5995 | if self.xid != None: |
| 5996 | q.text("%#x" % self.xid) |
| 5997 | else: |
| 5998 | q.text('None') |
| 5999 | q.text(","); q.breakable() |
| 6000 | q.text("flags = "); |
| 6001 | q.text("%#x" % self.flags) |
| 6002 | q.text(","); q.breakable() |
| 6003 | q.text("entries = "); |
| 6004 | q.pp(self.entries) |
| 6005 | q.breakable() |
| 6006 | q.text('}') |
| 6007 | |
| 6008 | bsn_stats_reply.subtypes[1] = bsn_lacp_stats_reply |
| 6009 | |
| 6010 | class bsn_lacp_stats_request(bsn_stats_request): |
| 6011 | version = 4 |
| 6012 | type = 18 |
| 6013 | stats_type = 65535 |
| 6014 | experimenter = 6035143 |
| 6015 | subtype = 1 |
| 6016 | |
| 6017 | def __init__(self, xid=None, flags=None): |
| 6018 | if xid != None: |
| 6019 | self.xid = xid |
| 6020 | else: |
| 6021 | self.xid = None |
| 6022 | if flags != None: |
| 6023 | self.flags = flags |
| 6024 | else: |
| 6025 | self.flags = 0 |
| 6026 | return |
| 6027 | |
| 6028 | def pack(self): |
| 6029 | packed = [] |
| 6030 | packed.append(struct.pack("!B", self.version)) |
| 6031 | packed.append(struct.pack("!B", self.type)) |
| 6032 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 6033 | packed.append(struct.pack("!L", self.xid)) |
| 6034 | packed.append(struct.pack("!H", self.stats_type)) |
| 6035 | packed.append(struct.pack("!H", self.flags)) |
| 6036 | packed.append('\x00' * 4) |
| 6037 | packed.append(struct.pack("!L", self.experimenter)) |
| 6038 | packed.append(struct.pack("!L", self.subtype)) |
| 6039 | length = sum([len(x) for x in packed]) |
| 6040 | packed[2] = struct.pack("!H", length) |
| 6041 | return ''.join(packed) |
| 6042 | |
| 6043 | @staticmethod |
| 6044 | def unpack(reader): |
| 6045 | obj = bsn_lacp_stats_request() |
| 6046 | _version = reader.read("!B")[0] |
| 6047 | assert(_version == 4) |
| 6048 | _type = reader.read("!B")[0] |
| 6049 | assert(_type == 18) |
| 6050 | _length = reader.read("!H")[0] |
| 6051 | orig_reader = reader |
| 6052 | reader = orig_reader.slice(_length, 4) |
| 6053 | obj.xid = reader.read("!L")[0] |
| 6054 | _stats_type = reader.read("!H")[0] |
| 6055 | assert(_stats_type == 65535) |
| 6056 | obj.flags = reader.read("!H")[0] |
| 6057 | reader.skip(4) |
| 6058 | _experimenter = reader.read("!L")[0] |
| 6059 | assert(_experimenter == 6035143) |
| 6060 | _subtype = reader.read("!L")[0] |
| 6061 | assert(_subtype == 1) |
| 6062 | return obj |
| 6063 | |
| 6064 | def __eq__(self, other): |
| 6065 | if type(self) != type(other): return False |
| 6066 | if self.xid != other.xid: return False |
| 6067 | if self.flags != other.flags: return False |
| 6068 | return True |
| 6069 | |
| 6070 | def pretty_print(self, q): |
| 6071 | q.text("bsn_lacp_stats_request {") |
| 6072 | with q.group(): |
| 6073 | with q.indent(2): |
| 6074 | q.breakable() |
| 6075 | q.text("xid = "); |
| 6076 | if self.xid != None: |
| 6077 | q.text("%#x" % self.xid) |
| 6078 | else: |
| 6079 | q.text('None') |
| 6080 | q.text(","); q.breakable() |
| 6081 | q.text("flags = "); |
| 6082 | q.text("%#x" % self.flags) |
| 6083 | q.breakable() |
| 6084 | q.text('}') |
| 6085 | |
| 6086 | bsn_stats_request.subtypes[1] = bsn_lacp_stats_request |
| 6087 | |
| 6088 | class bsn_log(bsn_header): |
| 6089 | version = 4 |
| 6090 | type = 4 |
| 6091 | experimenter = 6035143 |
| 6092 | subtype = 63 |
| 6093 | |
| 6094 | def __init__(self, xid=None, loglevel=None, data=None): |
| 6095 | if xid != None: |
| 6096 | self.xid = xid |
| 6097 | else: |
| 6098 | self.xid = None |
| 6099 | if loglevel != None: |
| 6100 | self.loglevel = loglevel |
| 6101 | else: |
| 6102 | self.loglevel = 0 |
| 6103 | if data != None: |
| 6104 | self.data = data |
| 6105 | else: |
| 6106 | self.data = '' |
| 6107 | return |
| 6108 | |
| 6109 | def pack(self): |
| 6110 | packed = [] |
| 6111 | packed.append(struct.pack("!B", self.version)) |
| 6112 | packed.append(struct.pack("!B", self.type)) |
| 6113 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 6114 | packed.append(struct.pack("!L", self.xid)) |
| 6115 | packed.append(struct.pack("!L", self.experimenter)) |
| 6116 | packed.append(struct.pack("!L", self.subtype)) |
| 6117 | packed.append(struct.pack("!B", self.loglevel)) |
| 6118 | packed.append(self.data) |
| 6119 | length = sum([len(x) for x in packed]) |
| 6120 | packed[2] = struct.pack("!H", length) |
| 6121 | return ''.join(packed) |
| 6122 | |
| 6123 | @staticmethod |
| 6124 | def unpack(reader): |
| 6125 | obj = bsn_log() |
| 6126 | _version = reader.read("!B")[0] |
| 6127 | assert(_version == 4) |
| 6128 | _type = reader.read("!B")[0] |
| 6129 | assert(_type == 4) |
| 6130 | _length = reader.read("!H")[0] |
| 6131 | orig_reader = reader |
| 6132 | reader = orig_reader.slice(_length, 4) |
| 6133 | obj.xid = reader.read("!L")[0] |
| 6134 | _experimenter = reader.read("!L")[0] |
| 6135 | assert(_experimenter == 6035143) |
| 6136 | _subtype = reader.read("!L")[0] |
| 6137 | assert(_subtype == 63) |
| 6138 | obj.loglevel = reader.read("!B")[0] |
| 6139 | obj.data = str(reader.read_all()) |
| 6140 | return obj |
| 6141 | |
| 6142 | def __eq__(self, other): |
| 6143 | if type(self) != type(other): return False |
| 6144 | if self.xid != other.xid: return False |
| 6145 | if self.loglevel != other.loglevel: return False |
| 6146 | if self.data != other.data: return False |
| 6147 | return True |
| 6148 | |
| 6149 | def pretty_print(self, q): |
| 6150 | q.text("bsn_log {") |
| 6151 | with q.group(): |
| 6152 | with q.indent(2): |
| 6153 | q.breakable() |
| 6154 | q.text("xid = "); |
| 6155 | if self.xid != None: |
| 6156 | q.text("%#x" % self.xid) |
| 6157 | else: |
| 6158 | q.text('None') |
| 6159 | q.text(","); q.breakable() |
| 6160 | q.text("loglevel = "); |
| 6161 | q.text("%#x" % self.loglevel) |
| 6162 | q.text(","); q.breakable() |
| 6163 | q.text("data = "); |
| 6164 | q.pp(self.data) |
| 6165 | q.breakable() |
| 6166 | q.text('}') |
| 6167 | |
| 6168 | bsn_header.subtypes[63] = bsn_log |
| 6169 | |
| 6170 | class bsn_lua_command_reply(bsn_header): |
| 6171 | version = 4 |
| 6172 | type = 4 |
| 6173 | experimenter = 6035143 |
| 6174 | subtype = 66 |
| 6175 | |
| 6176 | def __init__(self, xid=None, data=None): |
| 6177 | if xid != None: |
| 6178 | self.xid = xid |
| 6179 | else: |
| 6180 | self.xid = None |
| 6181 | if data != None: |
| 6182 | self.data = data |
| 6183 | else: |
| 6184 | self.data = '' |
| 6185 | return |
| 6186 | |
| 6187 | def pack(self): |
| 6188 | packed = [] |
| 6189 | packed.append(struct.pack("!B", self.version)) |
| 6190 | packed.append(struct.pack("!B", self.type)) |
| 6191 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 6192 | packed.append(struct.pack("!L", self.xid)) |
| 6193 | packed.append(struct.pack("!L", self.experimenter)) |
| 6194 | packed.append(struct.pack("!L", self.subtype)) |
| 6195 | packed.append(self.data) |
| 6196 | length = sum([len(x) for x in packed]) |
| 6197 | packed[2] = struct.pack("!H", length) |
| 6198 | return ''.join(packed) |
| 6199 | |
| 6200 | @staticmethod |
| 6201 | def unpack(reader): |
| 6202 | obj = bsn_lua_command_reply() |
| 6203 | _version = reader.read("!B")[0] |
| 6204 | assert(_version == 4) |
| 6205 | _type = reader.read("!B")[0] |
| 6206 | assert(_type == 4) |
| 6207 | _length = reader.read("!H")[0] |
| 6208 | orig_reader = reader |
| 6209 | reader = orig_reader.slice(_length, 4) |
| 6210 | obj.xid = reader.read("!L")[0] |
| 6211 | _experimenter = reader.read("!L")[0] |
| 6212 | assert(_experimenter == 6035143) |
| 6213 | _subtype = reader.read("!L")[0] |
| 6214 | assert(_subtype == 66) |
| 6215 | obj.data = str(reader.read_all()) |
| 6216 | return obj |
| 6217 | |
| 6218 | def __eq__(self, other): |
| 6219 | if type(self) != type(other): return False |
| 6220 | if self.xid != other.xid: return False |
| 6221 | if self.data != other.data: return False |
| 6222 | return True |
| 6223 | |
| 6224 | def pretty_print(self, q): |
| 6225 | q.text("bsn_lua_command_reply {") |
| 6226 | with q.group(): |
| 6227 | with q.indent(2): |
| 6228 | q.breakable() |
| 6229 | q.text("xid = "); |
| 6230 | if self.xid != None: |
| 6231 | q.text("%#x" % self.xid) |
| 6232 | else: |
| 6233 | q.text('None') |
| 6234 | q.text(","); q.breakable() |
| 6235 | q.text("data = "); |
| 6236 | q.pp(self.data) |
| 6237 | q.breakable() |
| 6238 | q.text('}') |
| 6239 | |
| 6240 | bsn_header.subtypes[66] = bsn_lua_command_reply |
| 6241 | |
| 6242 | class bsn_lua_command_request(bsn_header): |
| 6243 | version = 4 |
| 6244 | type = 4 |
| 6245 | experimenter = 6035143 |
| 6246 | subtype = 65 |
| 6247 | |
| 6248 | def __init__(self, xid=None, data=None): |
| 6249 | if xid != None: |
| 6250 | self.xid = xid |
| 6251 | else: |
| 6252 | self.xid = None |
| 6253 | if data != None: |
| 6254 | self.data = data |
| 6255 | else: |
| 6256 | self.data = '' |
| 6257 | return |
| 6258 | |
| 6259 | def pack(self): |
| 6260 | packed = [] |
| 6261 | packed.append(struct.pack("!B", self.version)) |
| 6262 | packed.append(struct.pack("!B", self.type)) |
| 6263 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 6264 | packed.append(struct.pack("!L", self.xid)) |
| 6265 | packed.append(struct.pack("!L", self.experimenter)) |
| 6266 | packed.append(struct.pack("!L", self.subtype)) |
| 6267 | packed.append(self.data) |
| 6268 | length = sum([len(x) for x in packed]) |
| 6269 | packed[2] = struct.pack("!H", length) |
| 6270 | return ''.join(packed) |
| 6271 | |
| 6272 | @staticmethod |
| 6273 | def unpack(reader): |
| 6274 | obj = bsn_lua_command_request() |
| 6275 | _version = reader.read("!B")[0] |
| 6276 | assert(_version == 4) |
| 6277 | _type = reader.read("!B")[0] |
| 6278 | assert(_type == 4) |
| 6279 | _length = reader.read("!H")[0] |
| 6280 | orig_reader = reader |
| 6281 | reader = orig_reader.slice(_length, 4) |
| 6282 | obj.xid = reader.read("!L")[0] |
| 6283 | _experimenter = reader.read("!L")[0] |
| 6284 | assert(_experimenter == 6035143) |
| 6285 | _subtype = reader.read("!L")[0] |
| 6286 | assert(_subtype == 65) |
| 6287 | obj.data = str(reader.read_all()) |
| 6288 | return obj |
| 6289 | |
| 6290 | def __eq__(self, other): |
| 6291 | if type(self) != type(other): return False |
| 6292 | if self.xid != other.xid: return False |
| 6293 | if self.data != other.data: return False |
| 6294 | return True |
| 6295 | |
| 6296 | def pretty_print(self, q): |
| 6297 | q.text("bsn_lua_command_request {") |
| 6298 | with q.group(): |
| 6299 | with q.indent(2): |
| 6300 | q.breakable() |
| 6301 | q.text("xid = "); |
| 6302 | if self.xid != None: |
| 6303 | q.text("%#x" % self.xid) |
| 6304 | else: |
| 6305 | q.text('None') |
| 6306 | q.text(","); q.breakable() |
| 6307 | q.text("data = "); |
| 6308 | q.pp(self.data) |
| 6309 | q.breakable() |
| 6310 | q.text('}') |
| 6311 | |
| 6312 | bsn_header.subtypes[65] = bsn_lua_command_request |
| 6313 | |
| 6314 | class bsn_lua_notification(bsn_header): |
| 6315 | version = 4 |
| 6316 | type = 4 |
| 6317 | experimenter = 6035143 |
| 6318 | subtype = 67 |
| 6319 | |
| 6320 | def __init__(self, xid=None, data=None): |
| 6321 | if xid != None: |
| 6322 | self.xid = xid |
| 6323 | else: |
| 6324 | self.xid = None |
| 6325 | if data != None: |
| 6326 | self.data = data |
| 6327 | else: |
| 6328 | self.data = '' |
| 6329 | return |
| 6330 | |
| 6331 | def pack(self): |
| 6332 | packed = [] |
| 6333 | packed.append(struct.pack("!B", self.version)) |
| 6334 | packed.append(struct.pack("!B", self.type)) |
| 6335 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 6336 | packed.append(struct.pack("!L", self.xid)) |
| 6337 | packed.append(struct.pack("!L", self.experimenter)) |
| 6338 | packed.append(struct.pack("!L", self.subtype)) |
| 6339 | packed.append(self.data) |
| 6340 | length = sum([len(x) for x in packed]) |
| 6341 | packed[2] = struct.pack("!H", length) |
| 6342 | return ''.join(packed) |
| 6343 | |
| 6344 | @staticmethod |
| 6345 | def unpack(reader): |
| 6346 | obj = bsn_lua_notification() |
| 6347 | _version = reader.read("!B")[0] |
| 6348 | assert(_version == 4) |
| 6349 | _type = reader.read("!B")[0] |
| 6350 | assert(_type == 4) |
| 6351 | _length = reader.read("!H")[0] |
| 6352 | orig_reader = reader |
| 6353 | reader = orig_reader.slice(_length, 4) |
| 6354 | obj.xid = reader.read("!L")[0] |
| 6355 | _experimenter = reader.read("!L")[0] |
| 6356 | assert(_experimenter == 6035143) |
| 6357 | _subtype = reader.read("!L")[0] |
| 6358 | assert(_subtype == 67) |
| 6359 | obj.data = str(reader.read_all()) |
| 6360 | return obj |
| 6361 | |
| 6362 | def __eq__(self, other): |
| 6363 | if type(self) != type(other): return False |
| 6364 | if self.xid != other.xid: return False |
| 6365 | if self.data != other.data: return False |
| 6366 | return True |
| 6367 | |
| 6368 | def pretty_print(self, q): |
| 6369 | q.text("bsn_lua_notification {") |
| 6370 | with q.group(): |
| 6371 | with q.indent(2): |
| 6372 | q.breakable() |
| 6373 | q.text("xid = "); |
| 6374 | if self.xid != None: |
| 6375 | q.text("%#x" % self.xid) |
| 6376 | else: |
| 6377 | q.text('None') |
| 6378 | q.text(","); q.breakable() |
| 6379 | q.text("data = "); |
| 6380 | q.pp(self.data) |
| 6381 | q.breakable() |
| 6382 | q.text('}') |
| 6383 | |
| 6384 | bsn_header.subtypes[67] = bsn_lua_notification |
| 6385 | |
| 6386 | class bsn_lua_upload(bsn_header): |
| 6387 | version = 4 |
| 6388 | type = 4 |
| 6389 | experimenter = 6035143 |
| 6390 | subtype = 64 |
| 6391 | |
| 6392 | def __init__(self, xid=None, flags=None, filename=None, data=None): |
| 6393 | if xid != None: |
| 6394 | self.xid = xid |
| 6395 | else: |
| 6396 | self.xid = None |
| 6397 | if flags != None: |
| 6398 | self.flags = flags |
| 6399 | else: |
| 6400 | self.flags = 0 |
| 6401 | if filename != None: |
| 6402 | self.filename = filename |
| 6403 | else: |
| 6404 | self.filename = "" |
| 6405 | if data != None: |
| 6406 | self.data = data |
| 6407 | else: |
| 6408 | self.data = '' |
| 6409 | return |
| 6410 | |
| 6411 | def pack(self): |
| 6412 | packed = [] |
| 6413 | packed.append(struct.pack("!B", self.version)) |
| 6414 | packed.append(struct.pack("!B", self.type)) |
| 6415 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 6416 | packed.append(struct.pack("!L", self.xid)) |
| 6417 | packed.append(struct.pack("!L", self.experimenter)) |
| 6418 | packed.append(struct.pack("!L", self.subtype)) |
| 6419 | packed.append(struct.pack("!H", self.flags)) |
| 6420 | packed.append(struct.pack("!64s", self.filename)) |
| 6421 | packed.append(self.data) |
| 6422 | length = sum([len(x) for x in packed]) |
| 6423 | packed[2] = struct.pack("!H", length) |
| 6424 | return ''.join(packed) |
| 6425 | |
| 6426 | @staticmethod |
| 6427 | def unpack(reader): |
| 6428 | obj = bsn_lua_upload() |
| 6429 | _version = reader.read("!B")[0] |
| 6430 | assert(_version == 4) |
| 6431 | _type = reader.read("!B")[0] |
| 6432 | assert(_type == 4) |
| 6433 | _length = reader.read("!H")[0] |
| 6434 | orig_reader = reader |
| 6435 | reader = orig_reader.slice(_length, 4) |
| 6436 | obj.xid = reader.read("!L")[0] |
| 6437 | _experimenter = reader.read("!L")[0] |
| 6438 | assert(_experimenter == 6035143) |
| 6439 | _subtype = reader.read("!L")[0] |
| 6440 | assert(_subtype == 64) |
| 6441 | obj.flags = reader.read("!H")[0] |
| 6442 | obj.filename = reader.read("!64s")[0].rstrip("\x00") |
| 6443 | obj.data = str(reader.read_all()) |
| 6444 | return obj |
| 6445 | |
| 6446 | def __eq__(self, other): |
| 6447 | if type(self) != type(other): return False |
| 6448 | if self.xid != other.xid: return False |
| 6449 | if self.flags != other.flags: return False |
| 6450 | if self.filename != other.filename: return False |
| 6451 | if self.data != other.data: return False |
| 6452 | return True |
| 6453 | |
| 6454 | def pretty_print(self, q): |
| 6455 | q.text("bsn_lua_upload {") |
| 6456 | with q.group(): |
| 6457 | with q.indent(2): |
| 6458 | q.breakable() |
| 6459 | q.text("xid = "); |
| 6460 | if self.xid != None: |
| 6461 | q.text("%#x" % self.xid) |
| 6462 | else: |
| 6463 | q.text('None') |
| 6464 | q.text(","); q.breakable() |
| 6465 | q.text("flags = "); |
| 6466 | q.text("%#x" % self.flags) |
| 6467 | q.text(","); q.breakable() |
| 6468 | q.text("filename = "); |
| 6469 | q.pp(self.filename) |
| 6470 | q.text(","); q.breakable() |
| 6471 | q.text("data = "); |
| 6472 | q.pp(self.data) |
| 6473 | q.breakable() |
| 6474 | q.text('}') |
| 6475 | |
| 6476 | bsn_header.subtypes[64] = bsn_lua_upload |
| 6477 | |
| 6478 | class bsn_pdu_rx_reply(bsn_header): |
| 6479 | version = 4 |
| 6480 | type = 4 |
| 6481 | experimenter = 6035143 |
| 6482 | subtype = 34 |
| 6483 | |
| 6484 | def __init__(self, xid=None, status=None, port_no=None, slot_num=None): |
| 6485 | if xid != None: |
| 6486 | self.xid = xid |
| 6487 | else: |
| 6488 | self.xid = None |
| 6489 | if status != None: |
| 6490 | self.status = status |
| 6491 | else: |
| 6492 | self.status = 0 |
| 6493 | if port_no != None: |
| 6494 | self.port_no = port_no |
| 6495 | else: |
| 6496 | self.port_no = 0 |
| 6497 | if slot_num != None: |
| 6498 | self.slot_num = slot_num |
| 6499 | else: |
| 6500 | self.slot_num = 0 |
| 6501 | return |
| 6502 | |
| 6503 | def pack(self): |
| 6504 | packed = [] |
| 6505 | packed.append(struct.pack("!B", self.version)) |
| 6506 | packed.append(struct.pack("!B", self.type)) |
| 6507 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 6508 | packed.append(struct.pack("!L", self.xid)) |
| 6509 | packed.append(struct.pack("!L", self.experimenter)) |
| 6510 | packed.append(struct.pack("!L", self.subtype)) |
| 6511 | packed.append(struct.pack("!L", self.status)) |
| 6512 | packed.append(util.pack_port_no(self.port_no)) |
| 6513 | packed.append(struct.pack("!B", self.slot_num)) |
| 6514 | length = sum([len(x) for x in packed]) |
| 6515 | packed[2] = struct.pack("!H", length) |
| 6516 | return ''.join(packed) |
| 6517 | |
| 6518 | @staticmethod |
| 6519 | def unpack(reader): |
| 6520 | obj = bsn_pdu_rx_reply() |
| 6521 | _version = reader.read("!B")[0] |
| 6522 | assert(_version == 4) |
| 6523 | _type = reader.read("!B")[0] |
| 6524 | assert(_type == 4) |
| 6525 | _length = reader.read("!H")[0] |
| 6526 | orig_reader = reader |
| 6527 | reader = orig_reader.slice(_length, 4) |
| 6528 | obj.xid = reader.read("!L")[0] |
| 6529 | _experimenter = reader.read("!L")[0] |
| 6530 | assert(_experimenter == 6035143) |
| 6531 | _subtype = reader.read("!L")[0] |
| 6532 | assert(_subtype == 34) |
| 6533 | obj.status = reader.read("!L")[0] |
| 6534 | obj.port_no = util.unpack_port_no(reader) |
| 6535 | obj.slot_num = reader.read("!B")[0] |
| 6536 | return obj |
| 6537 | |
| 6538 | def __eq__(self, other): |
| 6539 | if type(self) != type(other): return False |
| 6540 | if self.xid != other.xid: return False |
| 6541 | if self.status != other.status: return False |
| 6542 | if self.port_no != other.port_no: return False |
| 6543 | if self.slot_num != other.slot_num: return False |
| 6544 | return True |
| 6545 | |
| 6546 | def pretty_print(self, q): |
| 6547 | q.text("bsn_pdu_rx_reply {") |
| 6548 | with q.group(): |
| 6549 | with q.indent(2): |
| 6550 | q.breakable() |
| 6551 | q.text("xid = "); |
| 6552 | if self.xid != None: |
| 6553 | q.text("%#x" % self.xid) |
| 6554 | else: |
| 6555 | q.text('None') |
| 6556 | q.text(","); q.breakable() |
| 6557 | q.text("status = "); |
| 6558 | q.text("%#x" % self.status) |
| 6559 | q.text(","); q.breakable() |
| 6560 | q.text("port_no = "); |
| 6561 | q.text(util.pretty_port(self.port_no)) |
| 6562 | q.text(","); q.breakable() |
| 6563 | q.text("slot_num = "); |
| 6564 | q.text("%#x" % self.slot_num) |
| 6565 | q.breakable() |
| 6566 | q.text('}') |
| 6567 | |
| 6568 | bsn_header.subtypes[34] = bsn_pdu_rx_reply |
| 6569 | |
| 6570 | class bsn_pdu_rx_request(bsn_header): |
| 6571 | version = 4 |
| 6572 | type = 4 |
| 6573 | experimenter = 6035143 |
| 6574 | subtype = 33 |
| 6575 | |
| 6576 | def __init__(self, xid=None, timeout_ms=None, port_no=None, slot_num=None, data=None): |
| 6577 | if xid != None: |
| 6578 | self.xid = xid |
| 6579 | else: |
| 6580 | self.xid = None |
| 6581 | if timeout_ms != None: |
| 6582 | self.timeout_ms = timeout_ms |
| 6583 | else: |
| 6584 | self.timeout_ms = 0 |
| 6585 | if port_no != None: |
| 6586 | self.port_no = port_no |
| 6587 | else: |
| 6588 | self.port_no = 0 |
| 6589 | if slot_num != None: |
| 6590 | self.slot_num = slot_num |
| 6591 | else: |
| 6592 | self.slot_num = 0 |
| 6593 | if data != None: |
| 6594 | self.data = data |
| 6595 | else: |
| 6596 | self.data = '' |
| 6597 | return |
| 6598 | |
| 6599 | def pack(self): |
| 6600 | packed = [] |
| 6601 | packed.append(struct.pack("!B", self.version)) |
| 6602 | packed.append(struct.pack("!B", self.type)) |
| 6603 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 6604 | packed.append(struct.pack("!L", self.xid)) |
| 6605 | packed.append(struct.pack("!L", self.experimenter)) |
| 6606 | packed.append(struct.pack("!L", self.subtype)) |
| 6607 | packed.append(struct.pack("!L", self.timeout_ms)) |
| 6608 | packed.append(util.pack_port_no(self.port_no)) |
| 6609 | packed.append(struct.pack("!B", self.slot_num)) |
| 6610 | packed.append('\x00' * 3) |
| 6611 | packed.append(self.data) |
| 6612 | length = sum([len(x) for x in packed]) |
| 6613 | packed[2] = struct.pack("!H", length) |
| 6614 | return ''.join(packed) |
| 6615 | |
| 6616 | @staticmethod |
| 6617 | def unpack(reader): |
| 6618 | obj = bsn_pdu_rx_request() |
| 6619 | _version = reader.read("!B")[0] |
| 6620 | assert(_version == 4) |
| 6621 | _type = reader.read("!B")[0] |
| 6622 | assert(_type == 4) |
| 6623 | _length = reader.read("!H")[0] |
| 6624 | orig_reader = reader |
| 6625 | reader = orig_reader.slice(_length, 4) |
| 6626 | obj.xid = reader.read("!L")[0] |
| 6627 | _experimenter = reader.read("!L")[0] |
| 6628 | assert(_experimenter == 6035143) |
| 6629 | _subtype = reader.read("!L")[0] |
| 6630 | assert(_subtype == 33) |
| 6631 | obj.timeout_ms = reader.read("!L")[0] |
| 6632 | obj.port_no = util.unpack_port_no(reader) |
| 6633 | obj.slot_num = reader.read("!B")[0] |
| 6634 | reader.skip(3) |
| 6635 | obj.data = str(reader.read_all()) |
| 6636 | return obj |
| 6637 | |
| 6638 | def __eq__(self, other): |
| 6639 | if type(self) != type(other): return False |
| 6640 | if self.xid != other.xid: return False |
| 6641 | if self.timeout_ms != other.timeout_ms: return False |
| 6642 | if self.port_no != other.port_no: return False |
| 6643 | if self.slot_num != other.slot_num: return False |
| 6644 | if self.data != other.data: return False |
| 6645 | return True |
| 6646 | |
| 6647 | def pretty_print(self, q): |
| 6648 | q.text("bsn_pdu_rx_request {") |
| 6649 | with q.group(): |
| 6650 | with q.indent(2): |
| 6651 | q.breakable() |
| 6652 | q.text("xid = "); |
| 6653 | if self.xid != None: |
| 6654 | q.text("%#x" % self.xid) |
| 6655 | else: |
| 6656 | q.text('None') |
| 6657 | q.text(","); q.breakable() |
| 6658 | q.text("timeout_ms = "); |
| 6659 | q.text("%#x" % self.timeout_ms) |
| 6660 | q.text(","); q.breakable() |
| 6661 | q.text("port_no = "); |
| 6662 | q.text(util.pretty_port(self.port_no)) |
| 6663 | q.text(","); q.breakable() |
| 6664 | q.text("slot_num = "); |
| 6665 | q.text("%#x" % self.slot_num) |
| 6666 | q.text(","); q.breakable() |
| 6667 | q.text("data = "); |
| 6668 | q.pp(self.data) |
| 6669 | q.breakable() |
| 6670 | q.text('}') |
| 6671 | |
| 6672 | bsn_header.subtypes[33] = bsn_pdu_rx_request |
| 6673 | |
| 6674 | class bsn_pdu_rx_timeout(bsn_header): |
| 6675 | version = 4 |
| 6676 | type = 4 |
| 6677 | experimenter = 6035143 |
| 6678 | subtype = 35 |
| 6679 | |
| 6680 | def __init__(self, xid=None, port_no=None, slot_num=None): |
| 6681 | if xid != None: |
| 6682 | self.xid = xid |
| 6683 | else: |
| 6684 | self.xid = None |
| 6685 | if port_no != None: |
| 6686 | self.port_no = port_no |
| 6687 | else: |
| 6688 | self.port_no = 0 |
| 6689 | if slot_num != None: |
| 6690 | self.slot_num = slot_num |
| 6691 | else: |
| 6692 | self.slot_num = 0 |
| 6693 | return |
| 6694 | |
| 6695 | def pack(self): |
| 6696 | packed = [] |
| 6697 | packed.append(struct.pack("!B", self.version)) |
| 6698 | packed.append(struct.pack("!B", self.type)) |
| 6699 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 6700 | packed.append(struct.pack("!L", self.xid)) |
| 6701 | packed.append(struct.pack("!L", self.experimenter)) |
| 6702 | packed.append(struct.pack("!L", self.subtype)) |
| 6703 | packed.append(util.pack_port_no(self.port_no)) |
| 6704 | packed.append(struct.pack("!B", self.slot_num)) |
| 6705 | length = sum([len(x) for x in packed]) |
| 6706 | packed[2] = struct.pack("!H", length) |
| 6707 | return ''.join(packed) |
| 6708 | |
| 6709 | @staticmethod |
| 6710 | def unpack(reader): |
| 6711 | obj = bsn_pdu_rx_timeout() |
| 6712 | _version = reader.read("!B")[0] |
| 6713 | assert(_version == 4) |
| 6714 | _type = reader.read("!B")[0] |
| 6715 | assert(_type == 4) |
| 6716 | _length = reader.read("!H")[0] |
| 6717 | orig_reader = reader |
| 6718 | reader = orig_reader.slice(_length, 4) |
| 6719 | obj.xid = reader.read("!L")[0] |
| 6720 | _experimenter = reader.read("!L")[0] |
| 6721 | assert(_experimenter == 6035143) |
| 6722 | _subtype = reader.read("!L")[0] |
| 6723 | assert(_subtype == 35) |
| 6724 | obj.port_no = util.unpack_port_no(reader) |
| 6725 | obj.slot_num = reader.read("!B")[0] |
| 6726 | return obj |
| 6727 | |
| 6728 | def __eq__(self, other): |
| 6729 | if type(self) != type(other): return False |
| 6730 | if self.xid != other.xid: return False |
| 6731 | if self.port_no != other.port_no: return False |
| 6732 | if self.slot_num != other.slot_num: return False |
| 6733 | return True |
| 6734 | |
| 6735 | def pretty_print(self, q): |
| 6736 | q.text("bsn_pdu_rx_timeout {") |
| 6737 | with q.group(): |
| 6738 | with q.indent(2): |
| 6739 | q.breakable() |
| 6740 | q.text("xid = "); |
| 6741 | if self.xid != None: |
| 6742 | q.text("%#x" % self.xid) |
| 6743 | else: |
| 6744 | q.text('None') |
| 6745 | q.text(","); q.breakable() |
| 6746 | q.text("port_no = "); |
| 6747 | q.text(util.pretty_port(self.port_no)) |
| 6748 | q.text(","); q.breakable() |
| 6749 | q.text("slot_num = "); |
| 6750 | q.text("%#x" % self.slot_num) |
| 6751 | q.breakable() |
| 6752 | q.text('}') |
| 6753 | |
| 6754 | bsn_header.subtypes[35] = bsn_pdu_rx_timeout |
| 6755 | |
| 6756 | class bsn_pdu_tx_reply(bsn_header): |
| 6757 | version = 4 |
| 6758 | type = 4 |
| 6759 | experimenter = 6035143 |
| 6760 | subtype = 32 |
| 6761 | |
| 6762 | def __init__(self, xid=None, status=None, port_no=None, slot_num=None): |
| 6763 | if xid != None: |
| 6764 | self.xid = xid |
| 6765 | else: |
| 6766 | self.xid = None |
| 6767 | if status != None: |
| 6768 | self.status = status |
| 6769 | else: |
| 6770 | self.status = 0 |
| 6771 | if port_no != None: |
| 6772 | self.port_no = port_no |
| 6773 | else: |
| 6774 | self.port_no = 0 |
| 6775 | if slot_num != None: |
| 6776 | self.slot_num = slot_num |
| 6777 | else: |
| 6778 | self.slot_num = 0 |
| 6779 | return |
| 6780 | |
| 6781 | def pack(self): |
| 6782 | packed = [] |
| 6783 | packed.append(struct.pack("!B", self.version)) |
| 6784 | packed.append(struct.pack("!B", self.type)) |
| 6785 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 6786 | packed.append(struct.pack("!L", self.xid)) |
| 6787 | packed.append(struct.pack("!L", self.experimenter)) |
| 6788 | packed.append(struct.pack("!L", self.subtype)) |
| 6789 | packed.append(struct.pack("!L", self.status)) |
| 6790 | packed.append(util.pack_port_no(self.port_no)) |
| 6791 | packed.append(struct.pack("!B", self.slot_num)) |
| 6792 | length = sum([len(x) for x in packed]) |
| 6793 | packed[2] = struct.pack("!H", length) |
| 6794 | return ''.join(packed) |
| 6795 | |
| 6796 | @staticmethod |
| 6797 | def unpack(reader): |
| 6798 | obj = bsn_pdu_tx_reply() |
| 6799 | _version = reader.read("!B")[0] |
| 6800 | assert(_version == 4) |
| 6801 | _type = reader.read("!B")[0] |
| 6802 | assert(_type == 4) |
| 6803 | _length = reader.read("!H")[0] |
| 6804 | orig_reader = reader |
| 6805 | reader = orig_reader.slice(_length, 4) |
| 6806 | obj.xid = reader.read("!L")[0] |
| 6807 | _experimenter = reader.read("!L")[0] |
| 6808 | assert(_experimenter == 6035143) |
| 6809 | _subtype = reader.read("!L")[0] |
| 6810 | assert(_subtype == 32) |
| 6811 | obj.status = reader.read("!L")[0] |
| 6812 | obj.port_no = util.unpack_port_no(reader) |
| 6813 | obj.slot_num = reader.read("!B")[0] |
| 6814 | return obj |
| 6815 | |
| 6816 | def __eq__(self, other): |
| 6817 | if type(self) != type(other): return False |
| 6818 | if self.xid != other.xid: return False |
| 6819 | if self.status != other.status: return False |
| 6820 | if self.port_no != other.port_no: return False |
| 6821 | if self.slot_num != other.slot_num: return False |
| 6822 | return True |
| 6823 | |
| 6824 | def pretty_print(self, q): |
| 6825 | q.text("bsn_pdu_tx_reply {") |
| 6826 | with q.group(): |
| 6827 | with q.indent(2): |
| 6828 | q.breakable() |
| 6829 | q.text("xid = "); |
| 6830 | if self.xid != None: |
| 6831 | q.text("%#x" % self.xid) |
| 6832 | else: |
| 6833 | q.text('None') |
| 6834 | q.text(","); q.breakable() |
| 6835 | q.text("status = "); |
| 6836 | q.text("%#x" % self.status) |
| 6837 | q.text(","); q.breakable() |
| 6838 | q.text("port_no = "); |
| 6839 | q.text(util.pretty_port(self.port_no)) |
| 6840 | q.text(","); q.breakable() |
| 6841 | q.text("slot_num = "); |
| 6842 | q.text("%#x" % self.slot_num) |
| 6843 | q.breakable() |
| 6844 | q.text('}') |
| 6845 | |
| 6846 | bsn_header.subtypes[32] = bsn_pdu_tx_reply |
| 6847 | |
| 6848 | class bsn_pdu_tx_request(bsn_header): |
| 6849 | version = 4 |
| 6850 | type = 4 |
| 6851 | experimenter = 6035143 |
| 6852 | subtype = 31 |
| 6853 | |
| 6854 | def __init__(self, xid=None, tx_interval_ms=None, port_no=None, slot_num=None, data=None): |
| 6855 | if xid != None: |
| 6856 | self.xid = xid |
| 6857 | else: |
| 6858 | self.xid = None |
| 6859 | if tx_interval_ms != None: |
| 6860 | self.tx_interval_ms = tx_interval_ms |
| 6861 | else: |
| 6862 | self.tx_interval_ms = 0 |
| 6863 | if port_no != None: |
| 6864 | self.port_no = port_no |
| 6865 | else: |
| 6866 | self.port_no = 0 |
| 6867 | if slot_num != None: |
| 6868 | self.slot_num = slot_num |
| 6869 | else: |
| 6870 | self.slot_num = 0 |
| 6871 | if data != None: |
| 6872 | self.data = data |
| 6873 | else: |
| 6874 | self.data = '' |
| 6875 | return |
| 6876 | |
| 6877 | def pack(self): |
| 6878 | packed = [] |
| 6879 | packed.append(struct.pack("!B", self.version)) |
| 6880 | packed.append(struct.pack("!B", self.type)) |
| 6881 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 6882 | packed.append(struct.pack("!L", self.xid)) |
| 6883 | packed.append(struct.pack("!L", self.experimenter)) |
| 6884 | packed.append(struct.pack("!L", self.subtype)) |
| 6885 | packed.append(struct.pack("!L", self.tx_interval_ms)) |
| 6886 | packed.append(util.pack_port_no(self.port_no)) |
| 6887 | packed.append(struct.pack("!B", self.slot_num)) |
| 6888 | packed.append('\x00' * 3) |
| 6889 | packed.append(self.data) |
| 6890 | length = sum([len(x) for x in packed]) |
| 6891 | packed[2] = struct.pack("!H", length) |
| 6892 | return ''.join(packed) |
| 6893 | |
| 6894 | @staticmethod |
| 6895 | def unpack(reader): |
| 6896 | obj = bsn_pdu_tx_request() |
| 6897 | _version = reader.read("!B")[0] |
| 6898 | assert(_version == 4) |
| 6899 | _type = reader.read("!B")[0] |
| 6900 | assert(_type == 4) |
| 6901 | _length = reader.read("!H")[0] |
| 6902 | orig_reader = reader |
| 6903 | reader = orig_reader.slice(_length, 4) |
| 6904 | obj.xid = reader.read("!L")[0] |
| 6905 | _experimenter = reader.read("!L")[0] |
| 6906 | assert(_experimenter == 6035143) |
| 6907 | _subtype = reader.read("!L")[0] |
| 6908 | assert(_subtype == 31) |
| 6909 | obj.tx_interval_ms = reader.read("!L")[0] |
| 6910 | obj.port_no = util.unpack_port_no(reader) |
| 6911 | obj.slot_num = reader.read("!B")[0] |
| 6912 | reader.skip(3) |
| 6913 | obj.data = str(reader.read_all()) |
| 6914 | return obj |
| 6915 | |
| 6916 | def __eq__(self, other): |
| 6917 | if type(self) != type(other): return False |
| 6918 | if self.xid != other.xid: return False |
| 6919 | if self.tx_interval_ms != other.tx_interval_ms: return False |
| 6920 | if self.port_no != other.port_no: return False |
| 6921 | if self.slot_num != other.slot_num: return False |
| 6922 | if self.data != other.data: return False |
| 6923 | return True |
| 6924 | |
| 6925 | def pretty_print(self, q): |
| 6926 | q.text("bsn_pdu_tx_request {") |
| 6927 | with q.group(): |
| 6928 | with q.indent(2): |
| 6929 | q.breakable() |
| 6930 | q.text("xid = "); |
| 6931 | if self.xid != None: |
| 6932 | q.text("%#x" % self.xid) |
| 6933 | else: |
| 6934 | q.text('None') |
| 6935 | q.text(","); q.breakable() |
| 6936 | q.text("tx_interval_ms = "); |
| 6937 | q.text("%#x" % self.tx_interval_ms) |
| 6938 | q.text(","); q.breakable() |
| 6939 | q.text("port_no = "); |
| 6940 | q.text(util.pretty_port(self.port_no)) |
| 6941 | q.text(","); q.breakable() |
| 6942 | q.text("slot_num = "); |
| 6943 | q.text("%#x" % self.slot_num) |
| 6944 | q.text(","); q.breakable() |
| 6945 | q.text("data = "); |
| 6946 | q.pp(self.data) |
| 6947 | q.breakable() |
| 6948 | q.text('}') |
| 6949 | |
| 6950 | bsn_header.subtypes[31] = bsn_pdu_tx_request |
| 6951 | |
| 6952 | class bsn_port_counter_stats_reply(bsn_stats_reply): |
| 6953 | version = 4 |
| 6954 | type = 19 |
| 6955 | stats_type = 65535 |
| 6956 | experimenter = 6035143 |
| 6957 | subtype = 8 |
| 6958 | |
| 6959 | def __init__(self, xid=None, flags=None, entries=None): |
| 6960 | if xid != None: |
| 6961 | self.xid = xid |
| 6962 | else: |
| 6963 | self.xid = None |
| 6964 | if flags != None: |
| 6965 | self.flags = flags |
| 6966 | else: |
| 6967 | self.flags = 0 |
| 6968 | if entries != None: |
| 6969 | self.entries = entries |
| 6970 | else: |
| 6971 | self.entries = [] |
| 6972 | return |
| 6973 | |
| 6974 | def pack(self): |
| 6975 | packed = [] |
| 6976 | packed.append(struct.pack("!B", self.version)) |
| 6977 | packed.append(struct.pack("!B", self.type)) |
| 6978 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 6979 | packed.append(struct.pack("!L", self.xid)) |
| 6980 | packed.append(struct.pack("!H", self.stats_type)) |
| 6981 | packed.append(struct.pack("!H", self.flags)) |
| 6982 | packed.append('\x00' * 4) |
| 6983 | packed.append(struct.pack("!L", self.experimenter)) |
| 6984 | packed.append(struct.pack("!L", self.subtype)) |
| 6985 | packed.append(loxi.generic_util.pack_list(self.entries)) |
| 6986 | length = sum([len(x) for x in packed]) |
| 6987 | packed[2] = struct.pack("!H", length) |
| 6988 | return ''.join(packed) |
| 6989 | |
| 6990 | @staticmethod |
| 6991 | def unpack(reader): |
| 6992 | obj = bsn_port_counter_stats_reply() |
| 6993 | _version = reader.read("!B")[0] |
| 6994 | assert(_version == 4) |
| 6995 | _type = reader.read("!B")[0] |
| 6996 | assert(_type == 19) |
| 6997 | _length = reader.read("!H")[0] |
| 6998 | orig_reader = reader |
| 6999 | reader = orig_reader.slice(_length, 4) |
| 7000 | obj.xid = reader.read("!L")[0] |
| 7001 | _stats_type = reader.read("!H")[0] |
| 7002 | assert(_stats_type == 65535) |
| 7003 | obj.flags = reader.read("!H")[0] |
| 7004 | reader.skip(4) |
| 7005 | _experimenter = reader.read("!L")[0] |
| 7006 | assert(_experimenter == 6035143) |
| 7007 | _subtype = reader.read("!L")[0] |
| 7008 | assert(_subtype == 8) |
| 7009 | obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.bsn_port_counter_stats_entry.unpack) |
| 7010 | return obj |
| 7011 | |
| 7012 | def __eq__(self, other): |
| 7013 | if type(self) != type(other): return False |
| 7014 | if self.xid != other.xid: return False |
| 7015 | if self.flags != other.flags: return False |
| 7016 | if self.entries != other.entries: return False |
| 7017 | return True |
| 7018 | |
| 7019 | def pretty_print(self, q): |
| 7020 | q.text("bsn_port_counter_stats_reply {") |
| 7021 | with q.group(): |
| 7022 | with q.indent(2): |
| 7023 | q.breakable() |
| 7024 | q.text("xid = "); |
| 7025 | if self.xid != None: |
| 7026 | q.text("%#x" % self.xid) |
| 7027 | else: |
| 7028 | q.text('None') |
| 7029 | q.text(","); q.breakable() |
| 7030 | q.text("flags = "); |
| 7031 | q.text("%#x" % self.flags) |
| 7032 | q.text(","); q.breakable() |
| 7033 | q.text("entries = "); |
| 7034 | q.pp(self.entries) |
| 7035 | q.breakable() |
| 7036 | q.text('}') |
| 7037 | |
| 7038 | bsn_stats_reply.subtypes[8] = bsn_port_counter_stats_reply |
| 7039 | |
| 7040 | class bsn_port_counter_stats_request(bsn_stats_request): |
| 7041 | version = 4 |
| 7042 | type = 18 |
| 7043 | stats_type = 65535 |
| 7044 | experimenter = 6035143 |
| 7045 | subtype = 8 |
| 7046 | |
| 7047 | def __init__(self, xid=None, flags=None, port_no=None): |
| 7048 | if xid != None: |
| 7049 | self.xid = xid |
| 7050 | else: |
| 7051 | self.xid = None |
| 7052 | if flags != None: |
| 7053 | self.flags = flags |
| 7054 | else: |
| 7055 | self.flags = 0 |
| 7056 | if port_no != None: |
| 7057 | self.port_no = port_no |
| 7058 | else: |
| 7059 | self.port_no = 0 |
| 7060 | return |
| 7061 | |
| 7062 | def pack(self): |
| 7063 | packed = [] |
| 7064 | packed.append(struct.pack("!B", self.version)) |
| 7065 | packed.append(struct.pack("!B", self.type)) |
| 7066 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 7067 | packed.append(struct.pack("!L", self.xid)) |
| 7068 | packed.append(struct.pack("!H", self.stats_type)) |
| 7069 | packed.append(struct.pack("!H", self.flags)) |
| 7070 | packed.append('\x00' * 4) |
| 7071 | packed.append(struct.pack("!L", self.experimenter)) |
| 7072 | packed.append(struct.pack("!L", self.subtype)) |
| 7073 | packed.append(util.pack_port_no(self.port_no)) |
| 7074 | length = sum([len(x) for x in packed]) |
| 7075 | packed[2] = struct.pack("!H", length) |
| 7076 | return ''.join(packed) |
| 7077 | |
| 7078 | @staticmethod |
| 7079 | def unpack(reader): |
| 7080 | obj = bsn_port_counter_stats_request() |
| 7081 | _version = reader.read("!B")[0] |
| 7082 | assert(_version == 4) |
| 7083 | _type = reader.read("!B")[0] |
| 7084 | assert(_type == 18) |
| 7085 | _length = reader.read("!H")[0] |
| 7086 | orig_reader = reader |
| 7087 | reader = orig_reader.slice(_length, 4) |
| 7088 | obj.xid = reader.read("!L")[0] |
| 7089 | _stats_type = reader.read("!H")[0] |
| 7090 | assert(_stats_type == 65535) |
| 7091 | obj.flags = reader.read("!H")[0] |
| 7092 | reader.skip(4) |
| 7093 | _experimenter = reader.read("!L")[0] |
| 7094 | assert(_experimenter == 6035143) |
| 7095 | _subtype = reader.read("!L")[0] |
| 7096 | assert(_subtype == 8) |
| 7097 | obj.port_no = util.unpack_port_no(reader) |
| 7098 | return obj |
| 7099 | |
| 7100 | def __eq__(self, other): |
| 7101 | if type(self) != type(other): return False |
| 7102 | if self.xid != other.xid: return False |
| 7103 | if self.flags != other.flags: return False |
| 7104 | if self.port_no != other.port_no: return False |
| 7105 | return True |
| 7106 | |
| 7107 | def pretty_print(self, q): |
| 7108 | q.text("bsn_port_counter_stats_request {") |
| 7109 | with q.group(): |
| 7110 | with q.indent(2): |
| 7111 | q.breakable() |
| 7112 | q.text("xid = "); |
| 7113 | if self.xid != None: |
| 7114 | q.text("%#x" % self.xid) |
| 7115 | else: |
| 7116 | q.text('None') |
| 7117 | q.text(","); q.breakable() |
| 7118 | q.text("flags = "); |
| 7119 | q.text("%#x" % self.flags) |
| 7120 | q.text(","); q.breakable() |
| 7121 | q.text("port_no = "); |
| 7122 | q.text(util.pretty_port(self.port_no)) |
| 7123 | q.breakable() |
| 7124 | q.text('}') |
| 7125 | |
| 7126 | bsn_stats_request.subtypes[8] = bsn_port_counter_stats_request |
| 7127 | |
| 7128 | class bsn_role_status(bsn_header): |
| 7129 | version = 4 |
| 7130 | type = 4 |
| 7131 | experimenter = 6035143 |
| 7132 | subtype = 55 |
| 7133 | |
| 7134 | def __init__(self, xid=None, role=None, reason=None, generation_id=None): |
| 7135 | if xid != None: |
| 7136 | self.xid = xid |
| 7137 | else: |
| 7138 | self.xid = None |
| 7139 | if role != None: |
| 7140 | self.role = role |
| 7141 | else: |
| 7142 | self.role = 0 |
| 7143 | if reason != None: |
| 7144 | self.reason = reason |
| 7145 | else: |
| 7146 | self.reason = 0 |
| 7147 | if generation_id != None: |
| 7148 | self.generation_id = generation_id |
| 7149 | else: |
| 7150 | self.generation_id = 0 |
| 7151 | return |
| 7152 | |
| 7153 | def pack(self): |
| 7154 | packed = [] |
| 7155 | packed.append(struct.pack("!B", self.version)) |
| 7156 | packed.append(struct.pack("!B", self.type)) |
| 7157 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 7158 | packed.append(struct.pack("!L", self.xid)) |
| 7159 | packed.append(struct.pack("!L", self.experimenter)) |
| 7160 | packed.append(struct.pack("!L", self.subtype)) |
| 7161 | packed.append(struct.pack("!L", self.role)) |
| 7162 | packed.append(struct.pack("!B", self.reason)) |
| 7163 | packed.append('\x00' * 3) |
| 7164 | packed.append(struct.pack("!Q", self.generation_id)) |
| 7165 | length = sum([len(x) for x in packed]) |
| 7166 | packed[2] = struct.pack("!H", length) |
| 7167 | return ''.join(packed) |
| 7168 | |
| 7169 | @staticmethod |
| 7170 | def unpack(reader): |
| 7171 | obj = bsn_role_status() |
| 7172 | _version = reader.read("!B")[0] |
| 7173 | assert(_version == 4) |
| 7174 | _type = reader.read("!B")[0] |
| 7175 | assert(_type == 4) |
| 7176 | _length = reader.read("!H")[0] |
| 7177 | orig_reader = reader |
| 7178 | reader = orig_reader.slice(_length, 4) |
| 7179 | obj.xid = reader.read("!L")[0] |
| 7180 | _experimenter = reader.read("!L")[0] |
| 7181 | assert(_experimenter == 6035143) |
| 7182 | _subtype = reader.read("!L")[0] |
| 7183 | assert(_subtype == 55) |
| 7184 | obj.role = reader.read("!L")[0] |
| 7185 | obj.reason = reader.read("!B")[0] |
| 7186 | reader.skip(3) |
| 7187 | obj.generation_id = reader.read("!Q")[0] |
| 7188 | return obj |
| 7189 | |
| 7190 | def __eq__(self, other): |
| 7191 | if type(self) != type(other): return False |
| 7192 | if self.xid != other.xid: return False |
| 7193 | if self.role != other.role: return False |
| 7194 | if self.reason != other.reason: return False |
| 7195 | if self.generation_id != other.generation_id: return False |
| 7196 | return True |
| 7197 | |
| 7198 | def pretty_print(self, q): |
| 7199 | q.text("bsn_role_status {") |
| 7200 | with q.group(): |
| 7201 | with q.indent(2): |
| 7202 | q.breakable() |
| 7203 | q.text("xid = "); |
| 7204 | if self.xid != None: |
| 7205 | q.text("%#x" % self.xid) |
| 7206 | else: |
| 7207 | q.text('None') |
| 7208 | q.text(","); q.breakable() |
| 7209 | q.text("role = "); |
| 7210 | q.text("%#x" % self.role) |
| 7211 | q.text(","); q.breakable() |
| 7212 | q.text("reason = "); |
| 7213 | q.text("%#x" % self.reason) |
| 7214 | q.text(","); q.breakable() |
| 7215 | q.text("generation_id = "); |
| 7216 | q.text("%#x" % self.generation_id) |
| 7217 | q.breakable() |
| 7218 | q.text('}') |
| 7219 | |
| 7220 | bsn_header.subtypes[55] = bsn_role_status |
| 7221 | |
| 7222 | class bsn_set_aux_cxns_reply(bsn_header): |
| 7223 | version = 4 |
| 7224 | type = 4 |
| 7225 | experimenter = 6035143 |
| 7226 | subtype = 59 |
| 7227 | |
| 7228 | def __init__(self, xid=None, num_aux=None, status=None): |
| 7229 | if xid != None: |
| 7230 | self.xid = xid |
| 7231 | else: |
| 7232 | self.xid = None |
| 7233 | if num_aux != None: |
| 7234 | self.num_aux = num_aux |
| 7235 | else: |
| 7236 | self.num_aux = 0 |
| 7237 | if status != None: |
| 7238 | self.status = status |
| 7239 | else: |
| 7240 | self.status = 0 |
| 7241 | return |
| 7242 | |
| 7243 | def pack(self): |
| 7244 | packed = [] |
| 7245 | packed.append(struct.pack("!B", self.version)) |
| 7246 | packed.append(struct.pack("!B", self.type)) |
| 7247 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 7248 | packed.append(struct.pack("!L", self.xid)) |
| 7249 | packed.append(struct.pack("!L", self.experimenter)) |
| 7250 | packed.append(struct.pack("!L", self.subtype)) |
| 7251 | packed.append(struct.pack("!L", self.num_aux)) |
| 7252 | packed.append(struct.pack("!L", self.status)) |
| 7253 | length = sum([len(x) for x in packed]) |
| 7254 | packed[2] = struct.pack("!H", length) |
| 7255 | return ''.join(packed) |
| 7256 | |
| 7257 | @staticmethod |
| 7258 | def unpack(reader): |
| 7259 | obj = bsn_set_aux_cxns_reply() |
| 7260 | _version = reader.read("!B")[0] |
| 7261 | assert(_version == 4) |
| 7262 | _type = reader.read("!B")[0] |
| 7263 | assert(_type == 4) |
| 7264 | _length = reader.read("!H")[0] |
| 7265 | orig_reader = reader |
| 7266 | reader = orig_reader.slice(_length, 4) |
| 7267 | obj.xid = reader.read("!L")[0] |
| 7268 | _experimenter = reader.read("!L")[0] |
| 7269 | assert(_experimenter == 6035143) |
| 7270 | _subtype = reader.read("!L")[0] |
| 7271 | assert(_subtype == 59) |
| 7272 | obj.num_aux = reader.read("!L")[0] |
| 7273 | obj.status = reader.read("!L")[0] |
| 7274 | return obj |
| 7275 | |
| 7276 | def __eq__(self, other): |
| 7277 | if type(self) != type(other): return False |
| 7278 | if self.xid != other.xid: return False |
| 7279 | if self.num_aux != other.num_aux: return False |
| 7280 | if self.status != other.status: return False |
| 7281 | return True |
| 7282 | |
| 7283 | def pretty_print(self, q): |
| 7284 | q.text("bsn_set_aux_cxns_reply {") |
| 7285 | with q.group(): |
| 7286 | with q.indent(2): |
| 7287 | q.breakable() |
| 7288 | q.text("xid = "); |
| 7289 | if self.xid != None: |
| 7290 | q.text("%#x" % self.xid) |
| 7291 | else: |
| 7292 | q.text('None') |
| 7293 | q.text(","); q.breakable() |
| 7294 | q.text("num_aux = "); |
| 7295 | q.text("%#x" % self.num_aux) |
| 7296 | q.text(","); q.breakable() |
| 7297 | q.text("status = "); |
| 7298 | q.text("%#x" % self.status) |
| 7299 | q.breakable() |
| 7300 | q.text('}') |
| 7301 | |
| 7302 | bsn_header.subtypes[59] = bsn_set_aux_cxns_reply |
| 7303 | |
| 7304 | class bsn_set_aux_cxns_request(bsn_header): |
| 7305 | version = 4 |
| 7306 | type = 4 |
| 7307 | experimenter = 6035143 |
| 7308 | subtype = 58 |
| 7309 | |
| 7310 | def __init__(self, xid=None, num_aux=None): |
| 7311 | if xid != None: |
| 7312 | self.xid = xid |
| 7313 | else: |
| 7314 | self.xid = None |
| 7315 | if num_aux != None: |
| 7316 | self.num_aux = num_aux |
| 7317 | else: |
| 7318 | self.num_aux = 0 |
| 7319 | return |
| 7320 | |
| 7321 | def pack(self): |
| 7322 | packed = [] |
| 7323 | packed.append(struct.pack("!B", self.version)) |
| 7324 | packed.append(struct.pack("!B", self.type)) |
| 7325 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 7326 | packed.append(struct.pack("!L", self.xid)) |
| 7327 | packed.append(struct.pack("!L", self.experimenter)) |
| 7328 | packed.append(struct.pack("!L", self.subtype)) |
| 7329 | packed.append(struct.pack("!L", self.num_aux)) |
| 7330 | length = sum([len(x) for x in packed]) |
| 7331 | packed[2] = struct.pack("!H", length) |
| 7332 | return ''.join(packed) |
| 7333 | |
| 7334 | @staticmethod |
| 7335 | def unpack(reader): |
| 7336 | obj = bsn_set_aux_cxns_request() |
| 7337 | _version = reader.read("!B")[0] |
| 7338 | assert(_version == 4) |
| 7339 | _type = reader.read("!B")[0] |
| 7340 | assert(_type == 4) |
| 7341 | _length = reader.read("!H")[0] |
| 7342 | orig_reader = reader |
| 7343 | reader = orig_reader.slice(_length, 4) |
| 7344 | obj.xid = reader.read("!L")[0] |
| 7345 | _experimenter = reader.read("!L")[0] |
| 7346 | assert(_experimenter == 6035143) |
| 7347 | _subtype = reader.read("!L")[0] |
| 7348 | assert(_subtype == 58) |
| 7349 | obj.num_aux = reader.read("!L")[0] |
| 7350 | return obj |
| 7351 | |
| 7352 | def __eq__(self, other): |
| 7353 | if type(self) != type(other): return False |
| 7354 | if self.xid != other.xid: return False |
| 7355 | if self.num_aux != other.num_aux: return False |
| 7356 | return True |
| 7357 | |
| 7358 | def pretty_print(self, q): |
| 7359 | q.text("bsn_set_aux_cxns_request {") |
| 7360 | with q.group(): |
| 7361 | with q.indent(2): |
| 7362 | q.breakable() |
| 7363 | q.text("xid = "); |
| 7364 | if self.xid != None: |
| 7365 | q.text("%#x" % self.xid) |
| 7366 | else: |
| 7367 | q.text('None') |
| 7368 | q.text(","); q.breakable() |
| 7369 | q.text("num_aux = "); |
| 7370 | q.text("%#x" % self.num_aux) |
| 7371 | q.breakable() |
| 7372 | q.text('}') |
| 7373 | |
| 7374 | bsn_header.subtypes[58] = bsn_set_aux_cxns_request |
| 7375 | |
| 7376 | class bsn_set_lacp_reply(bsn_header): |
| 7377 | version = 4 |
| 7378 | type = 4 |
| 7379 | experimenter = 6035143 |
| 7380 | subtype = 42 |
| 7381 | |
| 7382 | def __init__(self, xid=None, status=None, port_no=None): |
| 7383 | if xid != None: |
| 7384 | self.xid = xid |
| 7385 | else: |
| 7386 | self.xid = None |
| 7387 | if status != None: |
| 7388 | self.status = status |
| 7389 | else: |
| 7390 | self.status = 0 |
| 7391 | if port_no != None: |
| 7392 | self.port_no = port_no |
| 7393 | else: |
| 7394 | self.port_no = 0 |
| 7395 | return |
| 7396 | |
| 7397 | def pack(self): |
| 7398 | packed = [] |
| 7399 | packed.append(struct.pack("!B", self.version)) |
| 7400 | packed.append(struct.pack("!B", self.type)) |
| 7401 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 7402 | packed.append(struct.pack("!L", self.xid)) |
| 7403 | packed.append(struct.pack("!L", self.experimenter)) |
| 7404 | packed.append(struct.pack("!L", self.subtype)) |
| 7405 | packed.append(struct.pack("!L", self.status)) |
| 7406 | packed.append(util.pack_port_no(self.port_no)) |
| 7407 | length = sum([len(x) for x in packed]) |
| 7408 | packed[2] = struct.pack("!H", length) |
| 7409 | return ''.join(packed) |
| 7410 | |
| 7411 | @staticmethod |
| 7412 | def unpack(reader): |
| 7413 | obj = bsn_set_lacp_reply() |
| 7414 | _version = reader.read("!B")[0] |
| 7415 | assert(_version == 4) |
| 7416 | _type = reader.read("!B")[0] |
| 7417 | assert(_type == 4) |
| 7418 | _length = reader.read("!H")[0] |
| 7419 | orig_reader = reader |
| 7420 | reader = orig_reader.slice(_length, 4) |
| 7421 | obj.xid = reader.read("!L")[0] |
| 7422 | _experimenter = reader.read("!L")[0] |
| 7423 | assert(_experimenter == 6035143) |
| 7424 | _subtype = reader.read("!L")[0] |
| 7425 | assert(_subtype == 42) |
| 7426 | obj.status = reader.read("!L")[0] |
| 7427 | obj.port_no = util.unpack_port_no(reader) |
| 7428 | return obj |
| 7429 | |
| 7430 | def __eq__(self, other): |
| 7431 | if type(self) != type(other): return False |
| 7432 | if self.xid != other.xid: return False |
| 7433 | if self.status != other.status: return False |
| 7434 | if self.port_no != other.port_no: return False |
| 7435 | return True |
| 7436 | |
| 7437 | def pretty_print(self, q): |
| 7438 | q.text("bsn_set_lacp_reply {") |
| 7439 | with q.group(): |
| 7440 | with q.indent(2): |
| 7441 | q.breakable() |
| 7442 | q.text("xid = "); |
| 7443 | if self.xid != None: |
| 7444 | q.text("%#x" % self.xid) |
| 7445 | else: |
| 7446 | q.text('None') |
| 7447 | q.text(","); q.breakable() |
| 7448 | q.text("status = "); |
| 7449 | q.text("%#x" % self.status) |
| 7450 | q.text(","); q.breakable() |
| 7451 | q.text("port_no = "); |
| 7452 | q.text(util.pretty_port(self.port_no)) |
| 7453 | q.breakable() |
| 7454 | q.text('}') |
| 7455 | |
| 7456 | bsn_header.subtypes[42] = bsn_set_lacp_reply |
| 7457 | |
| 7458 | class bsn_set_lacp_request(bsn_header): |
| 7459 | version = 4 |
| 7460 | type = 4 |
| 7461 | experimenter = 6035143 |
| 7462 | subtype = 41 |
| 7463 | |
| 7464 | def __init__(self, xid=None, enabled=None, port_no=None, actor_sys_priority=None, actor_sys_mac=None, actor_port_priority=None, actor_port_num=None, actor_key=None): |
| 7465 | if xid != None: |
| 7466 | self.xid = xid |
| 7467 | else: |
| 7468 | self.xid = None |
| 7469 | if enabled != None: |
| 7470 | self.enabled = enabled |
| 7471 | else: |
| 7472 | self.enabled = 0 |
| 7473 | if port_no != None: |
| 7474 | self.port_no = port_no |
| 7475 | else: |
| 7476 | self.port_no = 0 |
| 7477 | if actor_sys_priority != None: |
| 7478 | self.actor_sys_priority = actor_sys_priority |
| 7479 | else: |
| 7480 | self.actor_sys_priority = 0 |
| 7481 | if actor_sys_mac != None: |
| 7482 | self.actor_sys_mac = actor_sys_mac |
| 7483 | else: |
| 7484 | self.actor_sys_mac = [0,0,0,0,0,0] |
| 7485 | if actor_port_priority != None: |
| 7486 | self.actor_port_priority = actor_port_priority |
| 7487 | else: |
| 7488 | self.actor_port_priority = 0 |
| 7489 | if actor_port_num != None: |
| 7490 | self.actor_port_num = actor_port_num |
| 7491 | else: |
| 7492 | self.actor_port_num = 0 |
| 7493 | if actor_key != None: |
| 7494 | self.actor_key = actor_key |
| 7495 | else: |
| 7496 | self.actor_key = 0 |
| 7497 | return |
| 7498 | |
| 7499 | def pack(self): |
| 7500 | packed = [] |
| 7501 | packed.append(struct.pack("!B", self.version)) |
| 7502 | packed.append(struct.pack("!B", self.type)) |
| 7503 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 7504 | packed.append(struct.pack("!L", self.xid)) |
| 7505 | packed.append(struct.pack("!L", self.experimenter)) |
| 7506 | packed.append(struct.pack("!L", self.subtype)) |
| 7507 | packed.append(struct.pack("!B", self.enabled)) |
| 7508 | packed.append('\x00' * 3) |
| 7509 | packed.append(util.pack_port_no(self.port_no)) |
| 7510 | packed.append(struct.pack("!H", self.actor_sys_priority)) |
| 7511 | packed.append(struct.pack("!6B", *self.actor_sys_mac)) |
| 7512 | packed.append(struct.pack("!H", self.actor_port_priority)) |
| 7513 | packed.append(struct.pack("!H", self.actor_port_num)) |
| 7514 | packed.append(struct.pack("!H", self.actor_key)) |
| 7515 | length = sum([len(x) for x in packed]) |
| 7516 | packed[2] = struct.pack("!H", length) |
| 7517 | return ''.join(packed) |
| 7518 | |
| 7519 | @staticmethod |
| 7520 | def unpack(reader): |
| 7521 | obj = bsn_set_lacp_request() |
| 7522 | _version = reader.read("!B")[0] |
| 7523 | assert(_version == 4) |
| 7524 | _type = reader.read("!B")[0] |
| 7525 | assert(_type == 4) |
| 7526 | _length = reader.read("!H")[0] |
| 7527 | orig_reader = reader |
| 7528 | reader = orig_reader.slice(_length, 4) |
| 7529 | obj.xid = reader.read("!L")[0] |
| 7530 | _experimenter = reader.read("!L")[0] |
| 7531 | assert(_experimenter == 6035143) |
| 7532 | _subtype = reader.read("!L")[0] |
| 7533 | assert(_subtype == 41) |
| 7534 | obj.enabled = reader.read("!B")[0] |
| 7535 | reader.skip(3) |
| 7536 | obj.port_no = util.unpack_port_no(reader) |
| 7537 | obj.actor_sys_priority = reader.read("!H")[0] |
| 7538 | obj.actor_sys_mac = list(reader.read('!6B')) |
| 7539 | obj.actor_port_priority = reader.read("!H")[0] |
| 7540 | obj.actor_port_num = reader.read("!H")[0] |
| 7541 | obj.actor_key = reader.read("!H")[0] |
| 7542 | return obj |
| 7543 | |
| 7544 | def __eq__(self, other): |
| 7545 | if type(self) != type(other): return False |
| 7546 | if self.xid != other.xid: return False |
| 7547 | if self.enabled != other.enabled: return False |
| 7548 | if self.port_no != other.port_no: return False |
| 7549 | if self.actor_sys_priority != other.actor_sys_priority: return False |
| 7550 | if self.actor_sys_mac != other.actor_sys_mac: return False |
| 7551 | if self.actor_port_priority != other.actor_port_priority: return False |
| 7552 | if self.actor_port_num != other.actor_port_num: return False |
| 7553 | if self.actor_key != other.actor_key: return False |
| 7554 | return True |
| 7555 | |
| 7556 | def pretty_print(self, q): |
| 7557 | q.text("bsn_set_lacp_request {") |
| 7558 | with q.group(): |
| 7559 | with q.indent(2): |
| 7560 | q.breakable() |
| 7561 | q.text("xid = "); |
| 7562 | if self.xid != None: |
| 7563 | q.text("%#x" % self.xid) |
| 7564 | else: |
| 7565 | q.text('None') |
| 7566 | q.text(","); q.breakable() |
| 7567 | q.text("enabled = "); |
| 7568 | q.text("%#x" % self.enabled) |
| 7569 | q.text(","); q.breakable() |
| 7570 | q.text("port_no = "); |
| 7571 | q.text(util.pretty_port(self.port_no)) |
| 7572 | q.text(","); q.breakable() |
| 7573 | q.text("actor_sys_priority = "); |
| 7574 | q.text("%#x" % self.actor_sys_priority) |
| 7575 | q.text(","); q.breakable() |
| 7576 | q.text("actor_sys_mac = "); |
| 7577 | q.text(util.pretty_mac(self.actor_sys_mac)) |
| 7578 | q.text(","); q.breakable() |
| 7579 | q.text("actor_port_priority = "); |
| 7580 | q.text("%#x" % self.actor_port_priority) |
| 7581 | q.text(","); q.breakable() |
| 7582 | q.text("actor_port_num = "); |
| 7583 | q.text("%#x" % self.actor_port_num) |
| 7584 | q.text(","); q.breakable() |
| 7585 | q.text("actor_key = "); |
| 7586 | q.text("%#x" % self.actor_key) |
| 7587 | q.breakable() |
| 7588 | q.text('}') |
| 7589 | |
| 7590 | bsn_header.subtypes[41] = bsn_set_lacp_request |
| 7591 | |
| 7592 | class bsn_set_mirroring(bsn_header): |
| 7593 | version = 4 |
| 7594 | type = 4 |
| 7595 | experimenter = 6035143 |
| 7596 | subtype = 3 |
| 7597 | |
| 7598 | def __init__(self, xid=None, report_mirror_ports=None): |
| 7599 | if xid != None: |
| 7600 | self.xid = xid |
| 7601 | else: |
| 7602 | self.xid = None |
| 7603 | if report_mirror_ports != None: |
| 7604 | self.report_mirror_ports = report_mirror_ports |
| 7605 | else: |
| 7606 | self.report_mirror_ports = 0 |
| 7607 | return |
| 7608 | |
| 7609 | def pack(self): |
| 7610 | packed = [] |
| 7611 | packed.append(struct.pack("!B", self.version)) |
| 7612 | packed.append(struct.pack("!B", self.type)) |
| 7613 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 7614 | packed.append(struct.pack("!L", self.xid)) |
| 7615 | packed.append(struct.pack("!L", self.experimenter)) |
| 7616 | packed.append(struct.pack("!L", self.subtype)) |
| 7617 | packed.append(struct.pack("!B", self.report_mirror_ports)) |
| 7618 | packed.append('\x00' * 3) |
| 7619 | length = sum([len(x) for x in packed]) |
| 7620 | packed[2] = struct.pack("!H", length) |
| 7621 | return ''.join(packed) |
| 7622 | |
| 7623 | @staticmethod |
| 7624 | def unpack(reader): |
| 7625 | obj = bsn_set_mirroring() |
| 7626 | _version = reader.read("!B")[0] |
| 7627 | assert(_version == 4) |
| 7628 | _type = reader.read("!B")[0] |
| 7629 | assert(_type == 4) |
| 7630 | _length = reader.read("!H")[0] |
| 7631 | orig_reader = reader |
| 7632 | reader = orig_reader.slice(_length, 4) |
| 7633 | obj.xid = reader.read("!L")[0] |
| 7634 | _experimenter = reader.read("!L")[0] |
| 7635 | assert(_experimenter == 6035143) |
| 7636 | _subtype = reader.read("!L")[0] |
| 7637 | assert(_subtype == 3) |
| 7638 | obj.report_mirror_ports = reader.read("!B")[0] |
| 7639 | reader.skip(3) |
| 7640 | return obj |
| 7641 | |
| 7642 | def __eq__(self, other): |
| 7643 | if type(self) != type(other): return False |
| 7644 | if self.xid != other.xid: return False |
| 7645 | if self.report_mirror_ports != other.report_mirror_ports: return False |
| 7646 | return True |
| 7647 | |
| 7648 | def pretty_print(self, q): |
| 7649 | q.text("bsn_set_mirroring {") |
| 7650 | with q.group(): |
| 7651 | with q.indent(2): |
| 7652 | q.breakable() |
| 7653 | q.text("xid = "); |
| 7654 | if self.xid != None: |
| 7655 | q.text("%#x" % self.xid) |
| 7656 | else: |
| 7657 | q.text('None') |
| 7658 | q.text(","); q.breakable() |
| 7659 | q.text("report_mirror_ports = "); |
| 7660 | q.text("%#x" % self.report_mirror_ports) |
| 7661 | q.breakable() |
| 7662 | q.text('}') |
| 7663 | |
| 7664 | bsn_header.subtypes[3] = bsn_set_mirroring |
| 7665 | |
| 7666 | class bsn_set_pktin_suppression_reply(bsn_header): |
| 7667 | version = 4 |
| 7668 | type = 4 |
| 7669 | experimenter = 6035143 |
| 7670 | subtype = 25 |
| 7671 | |
| 7672 | def __init__(self, xid=None, status=None): |
| 7673 | if xid != None: |
| 7674 | self.xid = xid |
| 7675 | else: |
| 7676 | self.xid = None |
| 7677 | if status != None: |
| 7678 | self.status = status |
| 7679 | else: |
| 7680 | self.status = 0 |
| 7681 | return |
| 7682 | |
| 7683 | def pack(self): |
| 7684 | packed = [] |
| 7685 | packed.append(struct.pack("!B", self.version)) |
| 7686 | packed.append(struct.pack("!B", self.type)) |
| 7687 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 7688 | packed.append(struct.pack("!L", self.xid)) |
| 7689 | packed.append(struct.pack("!L", self.experimenter)) |
| 7690 | packed.append(struct.pack("!L", self.subtype)) |
| 7691 | packed.append(struct.pack("!L", self.status)) |
| 7692 | length = sum([len(x) for x in packed]) |
| 7693 | packed[2] = struct.pack("!H", length) |
| 7694 | return ''.join(packed) |
| 7695 | |
| 7696 | @staticmethod |
| 7697 | def unpack(reader): |
| 7698 | obj = bsn_set_pktin_suppression_reply() |
| 7699 | _version = reader.read("!B")[0] |
| 7700 | assert(_version == 4) |
| 7701 | _type = reader.read("!B")[0] |
| 7702 | assert(_type == 4) |
| 7703 | _length = reader.read("!H")[0] |
| 7704 | orig_reader = reader |
| 7705 | reader = orig_reader.slice(_length, 4) |
| 7706 | obj.xid = reader.read("!L")[0] |
| 7707 | _experimenter = reader.read("!L")[0] |
| 7708 | assert(_experimenter == 6035143) |
| 7709 | _subtype = reader.read("!L")[0] |
| 7710 | assert(_subtype == 25) |
| 7711 | obj.status = reader.read("!L")[0] |
| 7712 | return obj |
| 7713 | |
| 7714 | def __eq__(self, other): |
| 7715 | if type(self) != type(other): return False |
| 7716 | if self.xid != other.xid: return False |
| 7717 | if self.status != other.status: return False |
| 7718 | return True |
| 7719 | |
| 7720 | def pretty_print(self, q): |
| 7721 | q.text("bsn_set_pktin_suppression_reply {") |
| 7722 | with q.group(): |
| 7723 | with q.indent(2): |
| 7724 | q.breakable() |
| 7725 | q.text("xid = "); |
| 7726 | if self.xid != None: |
| 7727 | q.text("%#x" % self.xid) |
| 7728 | else: |
| 7729 | q.text('None') |
| 7730 | q.text(","); q.breakable() |
| 7731 | q.text("status = "); |
| 7732 | q.text("%#x" % self.status) |
| 7733 | q.breakable() |
| 7734 | q.text('}') |
| 7735 | |
| 7736 | bsn_header.subtypes[25] = bsn_set_pktin_suppression_reply |
| 7737 | |
| 7738 | class bsn_set_pktin_suppression_request(bsn_header): |
| 7739 | version = 4 |
| 7740 | type = 4 |
| 7741 | experimenter = 6035143 |
| 7742 | subtype = 11 |
| 7743 | |
| 7744 | def __init__(self, xid=None, enabled=None, idle_timeout=None, hard_timeout=None, priority=None, cookie=None): |
| 7745 | if xid != None: |
| 7746 | self.xid = xid |
| 7747 | else: |
| 7748 | self.xid = None |
| 7749 | if enabled != None: |
| 7750 | self.enabled = enabled |
| 7751 | else: |
| 7752 | self.enabled = 0 |
| 7753 | if idle_timeout != None: |
| 7754 | self.idle_timeout = idle_timeout |
| 7755 | else: |
| 7756 | self.idle_timeout = 0 |
| 7757 | if hard_timeout != None: |
| 7758 | self.hard_timeout = hard_timeout |
| 7759 | else: |
| 7760 | self.hard_timeout = 0 |
| 7761 | if priority != None: |
| 7762 | self.priority = priority |
| 7763 | else: |
| 7764 | self.priority = 0 |
| 7765 | if cookie != None: |
| 7766 | self.cookie = cookie |
| 7767 | else: |
| 7768 | self.cookie = 0 |
| 7769 | return |
| 7770 | |
| 7771 | def pack(self): |
| 7772 | packed = [] |
| 7773 | packed.append(struct.pack("!B", self.version)) |
| 7774 | packed.append(struct.pack("!B", self.type)) |
| 7775 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 7776 | packed.append(struct.pack("!L", self.xid)) |
| 7777 | packed.append(struct.pack("!L", self.experimenter)) |
| 7778 | packed.append(struct.pack("!L", self.subtype)) |
| 7779 | packed.append(struct.pack("!B", self.enabled)) |
| 7780 | packed.append('\x00' * 1) |
| 7781 | packed.append(struct.pack("!H", self.idle_timeout)) |
| 7782 | packed.append(struct.pack("!H", self.hard_timeout)) |
| 7783 | packed.append(struct.pack("!H", self.priority)) |
| 7784 | packed.append(struct.pack("!Q", self.cookie)) |
| 7785 | length = sum([len(x) for x in packed]) |
| 7786 | packed[2] = struct.pack("!H", length) |
| 7787 | return ''.join(packed) |
| 7788 | |
| 7789 | @staticmethod |
| 7790 | def unpack(reader): |
| 7791 | obj = bsn_set_pktin_suppression_request() |
| 7792 | _version = reader.read("!B")[0] |
| 7793 | assert(_version == 4) |
| 7794 | _type = reader.read("!B")[0] |
| 7795 | assert(_type == 4) |
| 7796 | _length = reader.read("!H")[0] |
| 7797 | orig_reader = reader |
| 7798 | reader = orig_reader.slice(_length, 4) |
| 7799 | obj.xid = reader.read("!L")[0] |
| 7800 | _experimenter = reader.read("!L")[0] |
| 7801 | assert(_experimenter == 6035143) |
| 7802 | _subtype = reader.read("!L")[0] |
| 7803 | assert(_subtype == 11) |
| 7804 | obj.enabled = reader.read("!B")[0] |
| 7805 | reader.skip(1) |
| 7806 | obj.idle_timeout = reader.read("!H")[0] |
| 7807 | obj.hard_timeout = reader.read("!H")[0] |
| 7808 | obj.priority = reader.read("!H")[0] |
| 7809 | obj.cookie = reader.read("!Q")[0] |
| 7810 | return obj |
| 7811 | |
| 7812 | def __eq__(self, other): |
| 7813 | if type(self) != type(other): return False |
| 7814 | if self.xid != other.xid: return False |
| 7815 | if self.enabled != other.enabled: return False |
| 7816 | if self.idle_timeout != other.idle_timeout: return False |
| 7817 | if self.hard_timeout != other.hard_timeout: return False |
| 7818 | if self.priority != other.priority: return False |
| 7819 | if self.cookie != other.cookie: return False |
| 7820 | return True |
| 7821 | |
| 7822 | def pretty_print(self, q): |
| 7823 | q.text("bsn_set_pktin_suppression_request {") |
| 7824 | with q.group(): |
| 7825 | with q.indent(2): |
| 7826 | q.breakable() |
| 7827 | q.text("xid = "); |
| 7828 | if self.xid != None: |
| 7829 | q.text("%#x" % self.xid) |
| 7830 | else: |
| 7831 | q.text('None') |
| 7832 | q.text(","); q.breakable() |
| 7833 | q.text("enabled = "); |
| 7834 | q.text("%#x" % self.enabled) |
| 7835 | q.text(","); q.breakable() |
| 7836 | q.text("idle_timeout = "); |
| 7837 | q.text("%#x" % self.idle_timeout) |
| 7838 | q.text(","); q.breakable() |
| 7839 | q.text("hard_timeout = "); |
| 7840 | q.text("%#x" % self.hard_timeout) |
| 7841 | q.text(","); q.breakable() |
| 7842 | q.text("priority = "); |
| 7843 | q.text("%#x" % self.priority) |
| 7844 | q.text(","); q.breakable() |
| 7845 | q.text("cookie = "); |
| 7846 | q.text("%#x" % self.cookie) |
| 7847 | q.breakable() |
| 7848 | q.text('}') |
| 7849 | |
| 7850 | bsn_header.subtypes[11] = bsn_set_pktin_suppression_request |
| 7851 | |
| 7852 | class bsn_set_switch_pipeline_reply(bsn_header): |
| 7853 | version = 4 |
| 7854 | type = 4 |
| 7855 | experimenter = 6035143 |
| 7856 | subtype = 54 |
| 7857 | |
| 7858 | def __init__(self, xid=None, status=None): |
| 7859 | if xid != None: |
| 7860 | self.xid = xid |
| 7861 | else: |
| 7862 | self.xid = None |
| 7863 | if status != None: |
| 7864 | self.status = status |
| 7865 | else: |
| 7866 | self.status = 0 |
| 7867 | return |
| 7868 | |
| 7869 | def pack(self): |
| 7870 | packed = [] |
| 7871 | packed.append(struct.pack("!B", self.version)) |
| 7872 | packed.append(struct.pack("!B", self.type)) |
| 7873 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 7874 | packed.append(struct.pack("!L", self.xid)) |
| 7875 | packed.append(struct.pack("!L", self.experimenter)) |
| 7876 | packed.append(struct.pack("!L", self.subtype)) |
| 7877 | packed.append(struct.pack("!L", self.status)) |
| 7878 | length = sum([len(x) for x in packed]) |
| 7879 | packed[2] = struct.pack("!H", length) |
| 7880 | return ''.join(packed) |
| 7881 | |
| 7882 | @staticmethod |
| 7883 | def unpack(reader): |
| 7884 | obj = bsn_set_switch_pipeline_reply() |
| 7885 | _version = reader.read("!B")[0] |
| 7886 | assert(_version == 4) |
| 7887 | _type = reader.read("!B")[0] |
| 7888 | assert(_type == 4) |
| 7889 | _length = reader.read("!H")[0] |
| 7890 | orig_reader = reader |
| 7891 | reader = orig_reader.slice(_length, 4) |
| 7892 | obj.xid = reader.read("!L")[0] |
| 7893 | _experimenter = reader.read("!L")[0] |
| 7894 | assert(_experimenter == 6035143) |
| 7895 | _subtype = reader.read("!L")[0] |
| 7896 | assert(_subtype == 54) |
| 7897 | obj.status = reader.read("!L")[0] |
| 7898 | return obj |
| 7899 | |
| 7900 | def __eq__(self, other): |
| 7901 | if type(self) != type(other): return False |
| 7902 | if self.xid != other.xid: return False |
| 7903 | if self.status != other.status: return False |
| 7904 | return True |
| 7905 | |
| 7906 | def pretty_print(self, q): |
| 7907 | q.text("bsn_set_switch_pipeline_reply {") |
| 7908 | with q.group(): |
| 7909 | with q.indent(2): |
| 7910 | q.breakable() |
| 7911 | q.text("xid = "); |
| 7912 | if self.xid != None: |
| 7913 | q.text("%#x" % self.xid) |
| 7914 | else: |
| 7915 | q.text('None') |
| 7916 | q.text(","); q.breakable() |
| 7917 | q.text("status = "); |
| 7918 | q.text("%#x" % self.status) |
| 7919 | q.breakable() |
| 7920 | q.text('}') |
| 7921 | |
| 7922 | bsn_header.subtypes[54] = bsn_set_switch_pipeline_reply |
| 7923 | |
| 7924 | class bsn_set_switch_pipeline_request(bsn_header): |
| 7925 | version = 4 |
| 7926 | type = 4 |
| 7927 | experimenter = 6035143 |
| 7928 | subtype = 53 |
| 7929 | |
| 7930 | def __init__(self, xid=None, pipeline=None): |
| 7931 | if xid != None: |
| 7932 | self.xid = xid |
| 7933 | else: |
| 7934 | self.xid = None |
| 7935 | if pipeline != None: |
| 7936 | self.pipeline = pipeline |
| 7937 | else: |
| 7938 | self.pipeline = "" |
| 7939 | return |
| 7940 | |
| 7941 | def pack(self): |
| 7942 | packed = [] |
| 7943 | packed.append(struct.pack("!B", self.version)) |
| 7944 | packed.append(struct.pack("!B", self.type)) |
| 7945 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 7946 | packed.append(struct.pack("!L", self.xid)) |
| 7947 | packed.append(struct.pack("!L", self.experimenter)) |
| 7948 | packed.append(struct.pack("!L", self.subtype)) |
| 7949 | packed.append(struct.pack("!256s", self.pipeline)) |
| 7950 | length = sum([len(x) for x in packed]) |
| 7951 | packed[2] = struct.pack("!H", length) |
| 7952 | return ''.join(packed) |
| 7953 | |
| 7954 | @staticmethod |
| 7955 | def unpack(reader): |
| 7956 | obj = bsn_set_switch_pipeline_request() |
| 7957 | _version = reader.read("!B")[0] |
| 7958 | assert(_version == 4) |
| 7959 | _type = reader.read("!B")[0] |
| 7960 | assert(_type == 4) |
| 7961 | _length = reader.read("!H")[0] |
| 7962 | orig_reader = reader |
| 7963 | reader = orig_reader.slice(_length, 4) |
| 7964 | obj.xid = reader.read("!L")[0] |
| 7965 | _experimenter = reader.read("!L")[0] |
| 7966 | assert(_experimenter == 6035143) |
| 7967 | _subtype = reader.read("!L")[0] |
| 7968 | assert(_subtype == 53) |
| 7969 | obj.pipeline = reader.read("!256s")[0].rstrip("\x00") |
| 7970 | return obj |
| 7971 | |
| 7972 | def __eq__(self, other): |
| 7973 | if type(self) != type(other): return False |
| 7974 | if self.xid != other.xid: return False |
| 7975 | if self.pipeline != other.pipeline: return False |
| 7976 | return True |
| 7977 | |
| 7978 | def pretty_print(self, q): |
| 7979 | q.text("bsn_set_switch_pipeline_request {") |
| 7980 | with q.group(): |
| 7981 | with q.indent(2): |
| 7982 | q.breakable() |
| 7983 | q.text("xid = "); |
| 7984 | if self.xid != None: |
| 7985 | q.text("%#x" % self.xid) |
| 7986 | else: |
| 7987 | q.text('None') |
| 7988 | q.text(","); q.breakable() |
| 7989 | q.text("pipeline = "); |
| 7990 | q.pp(self.pipeline) |
| 7991 | q.breakable() |
| 7992 | q.text('}') |
| 7993 | |
| 7994 | bsn_header.subtypes[53] = bsn_set_switch_pipeline_request |
| 7995 | |
| 7996 | class bsn_switch_pipeline_stats_reply(bsn_stats_reply): |
| 7997 | version = 4 |
| 7998 | type = 19 |
| 7999 | stats_type = 65535 |
| 8000 | experimenter = 6035143 |
| 8001 | subtype = 6 |
| 8002 | |
| 8003 | def __init__(self, xid=None, flags=None, entries=None): |
| 8004 | if xid != None: |
| 8005 | self.xid = xid |
| 8006 | else: |
| 8007 | self.xid = None |
| 8008 | if flags != None: |
| 8009 | self.flags = flags |
| 8010 | else: |
| 8011 | self.flags = 0 |
| 8012 | if entries != None: |
| 8013 | self.entries = entries |
| 8014 | else: |
| 8015 | self.entries = [] |
| 8016 | return |
| 8017 | |
| 8018 | def pack(self): |
| 8019 | packed = [] |
| 8020 | packed.append(struct.pack("!B", self.version)) |
| 8021 | packed.append(struct.pack("!B", self.type)) |
| 8022 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 8023 | packed.append(struct.pack("!L", self.xid)) |
| 8024 | packed.append(struct.pack("!H", self.stats_type)) |
| 8025 | packed.append(struct.pack("!H", self.flags)) |
| 8026 | packed.append('\x00' * 4) |
| 8027 | packed.append(struct.pack("!L", self.experimenter)) |
| 8028 | packed.append(struct.pack("!L", self.subtype)) |
| 8029 | packed.append(loxi.generic_util.pack_list(self.entries)) |
| 8030 | length = sum([len(x) for x in packed]) |
| 8031 | packed[2] = struct.pack("!H", length) |
| 8032 | return ''.join(packed) |
| 8033 | |
| 8034 | @staticmethod |
| 8035 | def unpack(reader): |
| 8036 | obj = bsn_switch_pipeline_stats_reply() |
| 8037 | _version = reader.read("!B")[0] |
| 8038 | assert(_version == 4) |
| 8039 | _type = reader.read("!B")[0] |
| 8040 | assert(_type == 19) |
| 8041 | _length = reader.read("!H")[0] |
| 8042 | orig_reader = reader |
| 8043 | reader = orig_reader.slice(_length, 4) |
| 8044 | obj.xid = reader.read("!L")[0] |
| 8045 | _stats_type = reader.read("!H")[0] |
| 8046 | assert(_stats_type == 65535) |
| 8047 | obj.flags = reader.read("!H")[0] |
| 8048 | reader.skip(4) |
| 8049 | _experimenter = reader.read("!L")[0] |
| 8050 | assert(_experimenter == 6035143) |
| 8051 | _subtype = reader.read("!L")[0] |
| 8052 | assert(_subtype == 6) |
| 8053 | obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.bsn_switch_pipeline_stats_entry.unpack) |
| 8054 | return obj |
| 8055 | |
| 8056 | def __eq__(self, other): |
| 8057 | if type(self) != type(other): return False |
| 8058 | if self.xid != other.xid: return False |
| 8059 | if self.flags != other.flags: return False |
| 8060 | if self.entries != other.entries: return False |
| 8061 | return True |
| 8062 | |
| 8063 | def pretty_print(self, q): |
| 8064 | q.text("bsn_switch_pipeline_stats_reply {") |
| 8065 | with q.group(): |
| 8066 | with q.indent(2): |
| 8067 | q.breakable() |
| 8068 | q.text("xid = "); |
| 8069 | if self.xid != None: |
| 8070 | q.text("%#x" % self.xid) |
| 8071 | else: |
| 8072 | q.text('None') |
| 8073 | q.text(","); q.breakable() |
| 8074 | q.text("flags = "); |
| 8075 | q.text("%#x" % self.flags) |
| 8076 | q.text(","); q.breakable() |
| 8077 | q.text("entries = "); |
| 8078 | q.pp(self.entries) |
| 8079 | q.breakable() |
| 8080 | q.text('}') |
| 8081 | |
| 8082 | bsn_stats_reply.subtypes[6] = bsn_switch_pipeline_stats_reply |
| 8083 | |
| 8084 | class bsn_switch_pipeline_stats_request(bsn_stats_request): |
| 8085 | version = 4 |
| 8086 | type = 18 |
| 8087 | stats_type = 65535 |
| 8088 | experimenter = 6035143 |
| 8089 | subtype = 6 |
| 8090 | |
| 8091 | def __init__(self, xid=None, flags=None): |
| 8092 | if xid != None: |
| 8093 | self.xid = xid |
| 8094 | else: |
| 8095 | self.xid = None |
| 8096 | if flags != None: |
| 8097 | self.flags = flags |
| 8098 | else: |
| 8099 | self.flags = 0 |
| 8100 | return |
| 8101 | |
| 8102 | def pack(self): |
| 8103 | packed = [] |
| 8104 | packed.append(struct.pack("!B", self.version)) |
| 8105 | packed.append(struct.pack("!B", self.type)) |
| 8106 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 8107 | packed.append(struct.pack("!L", self.xid)) |
| 8108 | packed.append(struct.pack("!H", self.stats_type)) |
| 8109 | packed.append(struct.pack("!H", self.flags)) |
| 8110 | packed.append('\x00' * 4) |
| 8111 | packed.append(struct.pack("!L", self.experimenter)) |
| 8112 | packed.append(struct.pack("!L", self.subtype)) |
| 8113 | length = sum([len(x) for x in packed]) |
| 8114 | packed[2] = struct.pack("!H", length) |
| 8115 | return ''.join(packed) |
| 8116 | |
| 8117 | @staticmethod |
| 8118 | def unpack(reader): |
| 8119 | obj = bsn_switch_pipeline_stats_request() |
| 8120 | _version = reader.read("!B")[0] |
| 8121 | assert(_version == 4) |
| 8122 | _type = reader.read("!B")[0] |
| 8123 | assert(_type == 18) |
| 8124 | _length = reader.read("!H")[0] |
| 8125 | orig_reader = reader |
| 8126 | reader = orig_reader.slice(_length, 4) |
| 8127 | obj.xid = reader.read("!L")[0] |
| 8128 | _stats_type = reader.read("!H")[0] |
| 8129 | assert(_stats_type == 65535) |
| 8130 | obj.flags = reader.read("!H")[0] |
| 8131 | reader.skip(4) |
| 8132 | _experimenter = reader.read("!L")[0] |
| 8133 | assert(_experimenter == 6035143) |
| 8134 | _subtype = reader.read("!L")[0] |
| 8135 | assert(_subtype == 6) |
| 8136 | return obj |
| 8137 | |
| 8138 | def __eq__(self, other): |
| 8139 | if type(self) != type(other): return False |
| 8140 | if self.xid != other.xid: return False |
| 8141 | if self.flags != other.flags: return False |
| 8142 | return True |
| 8143 | |
| 8144 | def pretty_print(self, q): |
| 8145 | q.text("bsn_switch_pipeline_stats_request {") |
| 8146 | with q.group(): |
| 8147 | with q.indent(2): |
| 8148 | q.breakable() |
| 8149 | q.text("xid = "); |
| 8150 | if self.xid != None: |
| 8151 | q.text("%#x" % self.xid) |
| 8152 | else: |
| 8153 | q.text('None') |
| 8154 | q.text(","); q.breakable() |
| 8155 | q.text("flags = "); |
| 8156 | q.text("%#x" % self.flags) |
| 8157 | q.breakable() |
| 8158 | q.text('}') |
| 8159 | |
| 8160 | bsn_stats_request.subtypes[6] = bsn_switch_pipeline_stats_request |
| 8161 | |
| 8162 | class bsn_table_checksum_stats_reply(bsn_stats_reply): |
| 8163 | version = 4 |
| 8164 | type = 19 |
| 8165 | stats_type = 65535 |
| 8166 | experimenter = 6035143 |
| 8167 | subtype = 11 |
| 8168 | |
| 8169 | def __init__(self, xid=None, flags=None, entries=None): |
| 8170 | if xid != None: |
| 8171 | self.xid = xid |
| 8172 | else: |
| 8173 | self.xid = None |
| 8174 | if flags != None: |
| 8175 | self.flags = flags |
| 8176 | else: |
| 8177 | self.flags = 0 |
| 8178 | if entries != None: |
| 8179 | self.entries = entries |
| 8180 | else: |
| 8181 | self.entries = [] |
| 8182 | return |
| 8183 | |
| 8184 | def pack(self): |
| 8185 | packed = [] |
| 8186 | packed.append(struct.pack("!B", self.version)) |
| 8187 | packed.append(struct.pack("!B", self.type)) |
| 8188 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 8189 | packed.append(struct.pack("!L", self.xid)) |
| 8190 | packed.append(struct.pack("!H", self.stats_type)) |
| 8191 | packed.append(struct.pack("!H", self.flags)) |
| 8192 | packed.append('\x00' * 4) |
| 8193 | packed.append(struct.pack("!L", self.experimenter)) |
| 8194 | packed.append(struct.pack("!L", self.subtype)) |
| 8195 | packed.append(loxi.generic_util.pack_list(self.entries)) |
| 8196 | length = sum([len(x) for x in packed]) |
| 8197 | packed[2] = struct.pack("!H", length) |
| 8198 | return ''.join(packed) |
| 8199 | |
| 8200 | @staticmethod |
| 8201 | def unpack(reader): |
| 8202 | obj = bsn_table_checksum_stats_reply() |
| 8203 | _version = reader.read("!B")[0] |
| 8204 | assert(_version == 4) |
| 8205 | _type = reader.read("!B")[0] |
| 8206 | assert(_type == 19) |
| 8207 | _length = reader.read("!H")[0] |
| 8208 | orig_reader = reader |
| 8209 | reader = orig_reader.slice(_length, 4) |
| 8210 | obj.xid = reader.read("!L")[0] |
| 8211 | _stats_type = reader.read("!H")[0] |
| 8212 | assert(_stats_type == 65535) |
| 8213 | obj.flags = reader.read("!H")[0] |
| 8214 | reader.skip(4) |
| 8215 | _experimenter = reader.read("!L")[0] |
| 8216 | assert(_experimenter == 6035143) |
| 8217 | _subtype = reader.read("!L")[0] |
| 8218 | assert(_subtype == 11) |
| 8219 | obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.bsn_table_checksum_stats_entry.unpack) |
| 8220 | return obj |
| 8221 | |
| 8222 | def __eq__(self, other): |
| 8223 | if type(self) != type(other): return False |
| 8224 | if self.xid != other.xid: return False |
| 8225 | if self.flags != other.flags: return False |
| 8226 | if self.entries != other.entries: return False |
| 8227 | return True |
| 8228 | |
| 8229 | def pretty_print(self, q): |
| 8230 | q.text("bsn_table_checksum_stats_reply {") |
| 8231 | with q.group(): |
| 8232 | with q.indent(2): |
| 8233 | q.breakable() |
| 8234 | q.text("xid = "); |
| 8235 | if self.xid != None: |
| 8236 | q.text("%#x" % self.xid) |
| 8237 | else: |
| 8238 | q.text('None') |
| 8239 | q.text(","); q.breakable() |
| 8240 | q.text("flags = "); |
| 8241 | q.text("%#x" % self.flags) |
| 8242 | q.text(","); q.breakable() |
| 8243 | q.text("entries = "); |
| 8244 | q.pp(self.entries) |
| 8245 | q.breakable() |
| 8246 | q.text('}') |
| 8247 | |
| 8248 | bsn_stats_reply.subtypes[11] = bsn_table_checksum_stats_reply |
| 8249 | |
| 8250 | class bsn_table_checksum_stats_request(bsn_stats_request): |
| 8251 | version = 4 |
| 8252 | type = 18 |
| 8253 | stats_type = 65535 |
| 8254 | experimenter = 6035143 |
| 8255 | subtype = 11 |
| 8256 | |
| 8257 | def __init__(self, xid=None, flags=None): |
| 8258 | if xid != None: |
| 8259 | self.xid = xid |
| 8260 | else: |
| 8261 | self.xid = None |
| 8262 | if flags != None: |
| 8263 | self.flags = flags |
| 8264 | else: |
| 8265 | self.flags = 0 |
| 8266 | return |
| 8267 | |
| 8268 | def pack(self): |
| 8269 | packed = [] |
| 8270 | packed.append(struct.pack("!B", self.version)) |
| 8271 | packed.append(struct.pack("!B", self.type)) |
| 8272 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 8273 | packed.append(struct.pack("!L", self.xid)) |
| 8274 | packed.append(struct.pack("!H", self.stats_type)) |
| 8275 | packed.append(struct.pack("!H", self.flags)) |
| 8276 | packed.append('\x00' * 4) |
| 8277 | packed.append(struct.pack("!L", self.experimenter)) |
| 8278 | packed.append(struct.pack("!L", self.subtype)) |
| 8279 | length = sum([len(x) for x in packed]) |
| 8280 | packed[2] = struct.pack("!H", length) |
| 8281 | return ''.join(packed) |
| 8282 | |
| 8283 | @staticmethod |
| 8284 | def unpack(reader): |
| 8285 | obj = bsn_table_checksum_stats_request() |
| 8286 | _version = reader.read("!B")[0] |
| 8287 | assert(_version == 4) |
| 8288 | _type = reader.read("!B")[0] |
| 8289 | assert(_type == 18) |
| 8290 | _length = reader.read("!H")[0] |
| 8291 | orig_reader = reader |
| 8292 | reader = orig_reader.slice(_length, 4) |
| 8293 | obj.xid = reader.read("!L")[0] |
| 8294 | _stats_type = reader.read("!H")[0] |
| 8295 | assert(_stats_type == 65535) |
| 8296 | obj.flags = reader.read("!H")[0] |
| 8297 | reader.skip(4) |
| 8298 | _experimenter = reader.read("!L")[0] |
| 8299 | assert(_experimenter == 6035143) |
| 8300 | _subtype = reader.read("!L")[0] |
| 8301 | assert(_subtype == 11) |
| 8302 | return obj |
| 8303 | |
| 8304 | def __eq__(self, other): |
| 8305 | if type(self) != type(other): return False |
| 8306 | if self.xid != other.xid: return False |
| 8307 | if self.flags != other.flags: return False |
| 8308 | return True |
| 8309 | |
| 8310 | def pretty_print(self, q): |
| 8311 | q.text("bsn_table_checksum_stats_request {") |
| 8312 | with q.group(): |
| 8313 | with q.indent(2): |
| 8314 | q.breakable() |
| 8315 | q.text("xid = "); |
| 8316 | if self.xid != None: |
| 8317 | q.text("%#x" % self.xid) |
| 8318 | else: |
| 8319 | q.text('None') |
| 8320 | q.text(","); q.breakable() |
| 8321 | q.text("flags = "); |
| 8322 | q.text("%#x" % self.flags) |
| 8323 | q.breakable() |
| 8324 | q.text('}') |
| 8325 | |
| 8326 | bsn_stats_request.subtypes[11] = bsn_table_checksum_stats_request |
| 8327 | |
| 8328 | class bsn_table_set_buckets_size(bsn_header): |
| 8329 | version = 4 |
| 8330 | type = 4 |
| 8331 | experimenter = 6035143 |
| 8332 | subtype = 61 |
| 8333 | |
| 8334 | def __init__(self, xid=None, table_id=None, buckets_size=None): |
| 8335 | if xid != None: |
| 8336 | self.xid = xid |
| 8337 | else: |
| 8338 | self.xid = None |
| 8339 | if table_id != None: |
| 8340 | self.table_id = table_id |
| 8341 | else: |
| 8342 | self.table_id = 0 |
| 8343 | if buckets_size != None: |
| 8344 | self.buckets_size = buckets_size |
| 8345 | else: |
| 8346 | self.buckets_size = 0 |
| 8347 | return |
| 8348 | |
| 8349 | def pack(self): |
| 8350 | packed = [] |
| 8351 | packed.append(struct.pack("!B", self.version)) |
| 8352 | packed.append(struct.pack("!B", self.type)) |
| 8353 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 8354 | packed.append(struct.pack("!L", self.xid)) |
| 8355 | packed.append(struct.pack("!L", self.experimenter)) |
| 8356 | packed.append(struct.pack("!L", self.subtype)) |
| 8357 | packed.append('\x00' * 1) |
| 8358 | packed.append(struct.pack("!B", self.table_id)) |
| 8359 | packed.append('\x00' * 2) |
| 8360 | packed.append(struct.pack("!L", self.buckets_size)) |
| 8361 | length = sum([len(x) for x in packed]) |
| 8362 | packed[2] = struct.pack("!H", length) |
| 8363 | return ''.join(packed) |
| 8364 | |
| 8365 | @staticmethod |
| 8366 | def unpack(reader): |
| 8367 | obj = bsn_table_set_buckets_size() |
| 8368 | _version = reader.read("!B")[0] |
| 8369 | assert(_version == 4) |
| 8370 | _type = reader.read("!B")[0] |
| 8371 | assert(_type == 4) |
| 8372 | _length = reader.read("!H")[0] |
| 8373 | orig_reader = reader |
| 8374 | reader = orig_reader.slice(_length, 4) |
| 8375 | obj.xid = reader.read("!L")[0] |
| 8376 | _experimenter = reader.read("!L")[0] |
| 8377 | assert(_experimenter == 6035143) |
| 8378 | _subtype = reader.read("!L")[0] |
| 8379 | assert(_subtype == 61) |
| 8380 | reader.skip(1) |
| 8381 | obj.table_id = reader.read("!B")[0] |
| 8382 | reader.skip(2) |
| 8383 | obj.buckets_size = reader.read("!L")[0] |
| 8384 | return obj |
| 8385 | |
| 8386 | def __eq__(self, other): |
| 8387 | if type(self) != type(other): return False |
| 8388 | if self.xid != other.xid: return False |
| 8389 | if self.table_id != other.table_id: return False |
| 8390 | if self.buckets_size != other.buckets_size: return False |
| 8391 | return True |
| 8392 | |
| 8393 | def pretty_print(self, q): |
| 8394 | q.text("bsn_table_set_buckets_size {") |
| 8395 | with q.group(): |
| 8396 | with q.indent(2): |
| 8397 | q.breakable() |
| 8398 | q.text("xid = "); |
| 8399 | if self.xid != None: |
| 8400 | q.text("%#x" % self.xid) |
| 8401 | else: |
| 8402 | q.text('None') |
| 8403 | q.text(","); q.breakable() |
| 8404 | q.text("table_id = "); |
| 8405 | q.text("%#x" % self.table_id) |
| 8406 | q.text(","); q.breakable() |
| 8407 | q.text("buckets_size = "); |
| 8408 | q.text("%#x" % self.buckets_size) |
| 8409 | q.breakable() |
| 8410 | q.text('}') |
| 8411 | |
| 8412 | bsn_header.subtypes[61] = bsn_table_set_buckets_size |
| 8413 | |
| 8414 | class bsn_time_reply(bsn_header): |
| 8415 | version = 4 |
| 8416 | type = 4 |
| 8417 | experimenter = 6035143 |
| 8418 | subtype = 45 |
| 8419 | |
| 8420 | def __init__(self, xid=None, time_ms=None): |
| 8421 | if xid != None: |
| 8422 | self.xid = xid |
| 8423 | else: |
| 8424 | self.xid = None |
| 8425 | if time_ms != None: |
| 8426 | self.time_ms = time_ms |
| 8427 | else: |
| 8428 | self.time_ms = 0 |
| 8429 | return |
| 8430 | |
| 8431 | def pack(self): |
| 8432 | packed = [] |
| 8433 | packed.append(struct.pack("!B", self.version)) |
| 8434 | packed.append(struct.pack("!B", self.type)) |
| 8435 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 8436 | packed.append(struct.pack("!L", self.xid)) |
| 8437 | packed.append(struct.pack("!L", self.experimenter)) |
| 8438 | packed.append(struct.pack("!L", self.subtype)) |
| 8439 | packed.append(struct.pack("!Q", self.time_ms)) |
| 8440 | length = sum([len(x) for x in packed]) |
| 8441 | packed[2] = struct.pack("!H", length) |
| 8442 | return ''.join(packed) |
| 8443 | |
| 8444 | @staticmethod |
| 8445 | def unpack(reader): |
| 8446 | obj = bsn_time_reply() |
| 8447 | _version = reader.read("!B")[0] |
| 8448 | assert(_version == 4) |
| 8449 | _type = reader.read("!B")[0] |
| 8450 | assert(_type == 4) |
| 8451 | _length = reader.read("!H")[0] |
| 8452 | orig_reader = reader |
| 8453 | reader = orig_reader.slice(_length, 4) |
| 8454 | obj.xid = reader.read("!L")[0] |
| 8455 | _experimenter = reader.read("!L")[0] |
| 8456 | assert(_experimenter == 6035143) |
| 8457 | _subtype = reader.read("!L")[0] |
| 8458 | assert(_subtype == 45) |
| 8459 | obj.time_ms = reader.read("!Q")[0] |
| 8460 | return obj |
| 8461 | |
| 8462 | def __eq__(self, other): |
| 8463 | if type(self) != type(other): return False |
| 8464 | if self.xid != other.xid: return False |
| 8465 | if self.time_ms != other.time_ms: return False |
| 8466 | return True |
| 8467 | |
| 8468 | def pretty_print(self, q): |
| 8469 | q.text("bsn_time_reply {") |
| 8470 | with q.group(): |
| 8471 | with q.indent(2): |
| 8472 | q.breakable() |
| 8473 | q.text("xid = "); |
| 8474 | if self.xid != None: |
| 8475 | q.text("%#x" % self.xid) |
| 8476 | else: |
| 8477 | q.text('None') |
| 8478 | q.text(","); q.breakable() |
| 8479 | q.text("time_ms = "); |
| 8480 | q.text("%#x" % self.time_ms) |
| 8481 | q.breakable() |
| 8482 | q.text('}') |
| 8483 | |
| 8484 | bsn_header.subtypes[45] = bsn_time_reply |
| 8485 | |
| 8486 | class bsn_time_request(bsn_header): |
| 8487 | version = 4 |
| 8488 | type = 4 |
| 8489 | experimenter = 6035143 |
| 8490 | subtype = 44 |
| 8491 | |
| 8492 | def __init__(self, xid=None): |
| 8493 | if xid != None: |
| 8494 | self.xid = xid |
| 8495 | else: |
| 8496 | self.xid = None |
| 8497 | return |
| 8498 | |
| 8499 | def pack(self): |
| 8500 | packed = [] |
| 8501 | packed.append(struct.pack("!B", self.version)) |
| 8502 | packed.append(struct.pack("!B", self.type)) |
| 8503 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 8504 | packed.append(struct.pack("!L", self.xid)) |
| 8505 | packed.append(struct.pack("!L", self.experimenter)) |
| 8506 | packed.append(struct.pack("!L", self.subtype)) |
| 8507 | length = sum([len(x) for x in packed]) |
| 8508 | packed[2] = struct.pack("!H", length) |
| 8509 | return ''.join(packed) |
| 8510 | |
| 8511 | @staticmethod |
| 8512 | def unpack(reader): |
| 8513 | obj = bsn_time_request() |
| 8514 | _version = reader.read("!B")[0] |
| 8515 | assert(_version == 4) |
| 8516 | _type = reader.read("!B")[0] |
| 8517 | assert(_type == 4) |
| 8518 | _length = reader.read("!H")[0] |
| 8519 | orig_reader = reader |
| 8520 | reader = orig_reader.slice(_length, 4) |
| 8521 | obj.xid = reader.read("!L")[0] |
| 8522 | _experimenter = reader.read("!L")[0] |
| 8523 | assert(_experimenter == 6035143) |
| 8524 | _subtype = reader.read("!L")[0] |
| 8525 | assert(_subtype == 44) |
| 8526 | return obj |
| 8527 | |
| 8528 | def __eq__(self, other): |
| 8529 | if type(self) != type(other): return False |
| 8530 | if self.xid != other.xid: return False |
| 8531 | return True |
| 8532 | |
| 8533 | def pretty_print(self, q): |
| 8534 | q.text("bsn_time_request {") |
| 8535 | with q.group(): |
| 8536 | with q.indent(2): |
| 8537 | q.breakable() |
| 8538 | q.text("xid = "); |
| 8539 | if self.xid != None: |
| 8540 | q.text("%#x" % self.xid) |
| 8541 | else: |
| 8542 | q.text('None') |
| 8543 | q.breakable() |
| 8544 | q.text('}') |
| 8545 | |
| 8546 | bsn_header.subtypes[44] = bsn_time_request |
| 8547 | |
| 8548 | class bsn_virtual_port_create_reply(bsn_header): |
| 8549 | version = 4 |
| 8550 | type = 4 |
| 8551 | experimenter = 6035143 |
| 8552 | subtype = 16 |
| 8553 | |
| 8554 | def __init__(self, xid=None, status=None, vport_no=None): |
| 8555 | if xid != None: |
| 8556 | self.xid = xid |
| 8557 | else: |
| 8558 | self.xid = None |
| 8559 | if status != None: |
| 8560 | self.status = status |
| 8561 | else: |
| 8562 | self.status = 0 |
| 8563 | if vport_no != None: |
| 8564 | self.vport_no = vport_no |
| 8565 | else: |
| 8566 | self.vport_no = 0 |
| 8567 | return |
| 8568 | |
| 8569 | def pack(self): |
| 8570 | packed = [] |
| 8571 | packed.append(struct.pack("!B", self.version)) |
| 8572 | packed.append(struct.pack("!B", self.type)) |
| 8573 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 8574 | packed.append(struct.pack("!L", self.xid)) |
| 8575 | packed.append(struct.pack("!L", self.experimenter)) |
| 8576 | packed.append(struct.pack("!L", self.subtype)) |
| 8577 | packed.append(struct.pack("!L", self.status)) |
| 8578 | packed.append(struct.pack("!L", self.vport_no)) |
| 8579 | length = sum([len(x) for x in packed]) |
| 8580 | packed[2] = struct.pack("!H", length) |
| 8581 | return ''.join(packed) |
| 8582 | |
| 8583 | @staticmethod |
| 8584 | def unpack(reader): |
| 8585 | obj = bsn_virtual_port_create_reply() |
| 8586 | _version = reader.read("!B")[0] |
| 8587 | assert(_version == 4) |
| 8588 | _type = reader.read("!B")[0] |
| 8589 | assert(_type == 4) |
| 8590 | _length = reader.read("!H")[0] |
| 8591 | orig_reader = reader |
| 8592 | reader = orig_reader.slice(_length, 4) |
| 8593 | obj.xid = reader.read("!L")[0] |
| 8594 | _experimenter = reader.read("!L")[0] |
| 8595 | assert(_experimenter == 6035143) |
| 8596 | _subtype = reader.read("!L")[0] |
| 8597 | assert(_subtype == 16) |
| 8598 | obj.status = reader.read("!L")[0] |
| 8599 | obj.vport_no = reader.read("!L")[0] |
| 8600 | return obj |
| 8601 | |
| 8602 | def __eq__(self, other): |
| 8603 | if type(self) != type(other): return False |
| 8604 | if self.xid != other.xid: return False |
| 8605 | if self.status != other.status: return False |
| 8606 | if self.vport_no != other.vport_no: return False |
| 8607 | return True |
| 8608 | |
| 8609 | def pretty_print(self, q): |
| 8610 | q.text("bsn_virtual_port_create_reply {") |
| 8611 | with q.group(): |
| 8612 | with q.indent(2): |
| 8613 | q.breakable() |
| 8614 | q.text("xid = "); |
| 8615 | if self.xid != None: |
| 8616 | q.text("%#x" % self.xid) |
| 8617 | else: |
| 8618 | q.text('None') |
| 8619 | q.text(","); q.breakable() |
| 8620 | q.text("status = "); |
| 8621 | q.text("%#x" % self.status) |
| 8622 | q.text(","); q.breakable() |
| 8623 | q.text("vport_no = "); |
| 8624 | q.text("%#x" % self.vport_no) |
| 8625 | q.breakable() |
| 8626 | q.text('}') |
| 8627 | |
| 8628 | bsn_header.subtypes[16] = bsn_virtual_port_create_reply |
| 8629 | |
| 8630 | class bsn_virtual_port_create_request(bsn_header): |
| 8631 | version = 4 |
| 8632 | type = 4 |
| 8633 | experimenter = 6035143 |
| 8634 | subtype = 15 |
| 8635 | |
| 8636 | def __init__(self, xid=None, vport=None): |
| 8637 | if xid != None: |
| 8638 | self.xid = xid |
| 8639 | else: |
| 8640 | self.xid = None |
| 8641 | if vport != None: |
| 8642 | self.vport = vport |
| 8643 | else: |
| 8644 | self.vport = ofp.bsn_vport() |
| 8645 | return |
| 8646 | |
| 8647 | def pack(self): |
| 8648 | packed = [] |
| 8649 | packed.append(struct.pack("!B", self.version)) |
| 8650 | packed.append(struct.pack("!B", self.type)) |
| 8651 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 8652 | packed.append(struct.pack("!L", self.xid)) |
| 8653 | packed.append(struct.pack("!L", self.experimenter)) |
| 8654 | packed.append(struct.pack("!L", self.subtype)) |
| 8655 | packed.append(self.vport.pack()) |
| 8656 | length = sum([len(x) for x in packed]) |
| 8657 | packed[2] = struct.pack("!H", length) |
| 8658 | return ''.join(packed) |
| 8659 | |
| 8660 | @staticmethod |
| 8661 | def unpack(reader): |
| 8662 | obj = bsn_virtual_port_create_request() |
| 8663 | _version = reader.read("!B")[0] |
| 8664 | assert(_version == 4) |
| 8665 | _type = reader.read("!B")[0] |
| 8666 | assert(_type == 4) |
| 8667 | _length = reader.read("!H")[0] |
| 8668 | orig_reader = reader |
| 8669 | reader = orig_reader.slice(_length, 4) |
| 8670 | obj.xid = reader.read("!L")[0] |
| 8671 | _experimenter = reader.read("!L")[0] |
| 8672 | assert(_experimenter == 6035143) |
| 8673 | _subtype = reader.read("!L")[0] |
| 8674 | assert(_subtype == 15) |
| 8675 | obj.vport = ofp.bsn_vport.unpack(reader) |
| 8676 | return obj |
| 8677 | |
| 8678 | def __eq__(self, other): |
| 8679 | if type(self) != type(other): return False |
| 8680 | if self.xid != other.xid: return False |
| 8681 | if self.vport != other.vport: return False |
| 8682 | return True |
| 8683 | |
| 8684 | def pretty_print(self, q): |
| 8685 | q.text("bsn_virtual_port_create_request {") |
| 8686 | with q.group(): |
| 8687 | with q.indent(2): |
| 8688 | q.breakable() |
| 8689 | q.text("xid = "); |
| 8690 | if self.xid != None: |
| 8691 | q.text("%#x" % self.xid) |
| 8692 | else: |
| 8693 | q.text('None') |
| 8694 | q.text(","); q.breakable() |
| 8695 | q.text("vport = "); |
| 8696 | q.pp(self.vport) |
| 8697 | q.breakable() |
| 8698 | q.text('}') |
| 8699 | |
| 8700 | bsn_header.subtypes[15] = bsn_virtual_port_create_request |
| 8701 | |
| 8702 | class bsn_virtual_port_remove_reply(bsn_header): |
| 8703 | version = 4 |
| 8704 | type = 4 |
| 8705 | experimenter = 6035143 |
| 8706 | subtype = 26 |
| 8707 | |
| 8708 | def __init__(self, xid=None, status=None): |
| 8709 | if xid != None: |
| 8710 | self.xid = xid |
| 8711 | else: |
| 8712 | self.xid = None |
| 8713 | if status != None: |
| 8714 | self.status = status |
| 8715 | else: |
| 8716 | self.status = 0 |
| 8717 | return |
| 8718 | |
| 8719 | def pack(self): |
| 8720 | packed = [] |
| 8721 | packed.append(struct.pack("!B", self.version)) |
| 8722 | packed.append(struct.pack("!B", self.type)) |
| 8723 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 8724 | packed.append(struct.pack("!L", self.xid)) |
| 8725 | packed.append(struct.pack("!L", self.experimenter)) |
| 8726 | packed.append(struct.pack("!L", self.subtype)) |
| 8727 | packed.append(struct.pack("!L", self.status)) |
| 8728 | length = sum([len(x) for x in packed]) |
| 8729 | packed[2] = struct.pack("!H", length) |
| 8730 | return ''.join(packed) |
| 8731 | |
| 8732 | @staticmethod |
| 8733 | def unpack(reader): |
| 8734 | obj = bsn_virtual_port_remove_reply() |
| 8735 | _version = reader.read("!B")[0] |
| 8736 | assert(_version == 4) |
| 8737 | _type = reader.read("!B")[0] |
| 8738 | assert(_type == 4) |
| 8739 | _length = reader.read("!H")[0] |
| 8740 | orig_reader = reader |
| 8741 | reader = orig_reader.slice(_length, 4) |
| 8742 | obj.xid = reader.read("!L")[0] |
| 8743 | _experimenter = reader.read("!L")[0] |
| 8744 | assert(_experimenter == 6035143) |
| 8745 | _subtype = reader.read("!L")[0] |
| 8746 | assert(_subtype == 26) |
| 8747 | obj.status = reader.read("!L")[0] |
| 8748 | return obj |
| 8749 | |
| 8750 | def __eq__(self, other): |
| 8751 | if type(self) != type(other): return False |
| 8752 | if self.xid != other.xid: return False |
| 8753 | if self.status != other.status: return False |
| 8754 | return True |
| 8755 | |
| 8756 | def pretty_print(self, q): |
| 8757 | q.text("bsn_virtual_port_remove_reply {") |
| 8758 | with q.group(): |
| 8759 | with q.indent(2): |
| 8760 | q.breakable() |
| 8761 | q.text("xid = "); |
| 8762 | if self.xid != None: |
| 8763 | q.text("%#x" % self.xid) |
| 8764 | else: |
| 8765 | q.text('None') |
| 8766 | q.text(","); q.breakable() |
| 8767 | q.text("status = "); |
| 8768 | q.text("%#x" % self.status) |
| 8769 | q.breakable() |
| 8770 | q.text('}') |
| 8771 | |
| 8772 | bsn_header.subtypes[26] = bsn_virtual_port_remove_reply |
| 8773 | |
| 8774 | class bsn_virtual_port_remove_request(bsn_header): |
| 8775 | version = 4 |
| 8776 | type = 4 |
| 8777 | experimenter = 6035143 |
| 8778 | subtype = 17 |
| 8779 | |
| 8780 | def __init__(self, xid=None, vport_no=None): |
| 8781 | if xid != None: |
| 8782 | self.xid = xid |
| 8783 | else: |
| 8784 | self.xid = None |
| 8785 | if vport_no != None: |
| 8786 | self.vport_no = vport_no |
| 8787 | else: |
| 8788 | self.vport_no = 0 |
| 8789 | return |
| 8790 | |
| 8791 | def pack(self): |
| 8792 | packed = [] |
| 8793 | packed.append(struct.pack("!B", self.version)) |
| 8794 | packed.append(struct.pack("!B", self.type)) |
| 8795 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 8796 | packed.append(struct.pack("!L", self.xid)) |
| 8797 | packed.append(struct.pack("!L", self.experimenter)) |
| 8798 | packed.append(struct.pack("!L", self.subtype)) |
| 8799 | packed.append(struct.pack("!L", self.vport_no)) |
| 8800 | length = sum([len(x) for x in packed]) |
| 8801 | packed[2] = struct.pack("!H", length) |
| 8802 | return ''.join(packed) |
| 8803 | |
| 8804 | @staticmethod |
| 8805 | def unpack(reader): |
| 8806 | obj = bsn_virtual_port_remove_request() |
| 8807 | _version = reader.read("!B")[0] |
| 8808 | assert(_version == 4) |
| 8809 | _type = reader.read("!B")[0] |
| 8810 | assert(_type == 4) |
| 8811 | _length = reader.read("!H")[0] |
| 8812 | orig_reader = reader |
| 8813 | reader = orig_reader.slice(_length, 4) |
| 8814 | obj.xid = reader.read("!L")[0] |
| 8815 | _experimenter = reader.read("!L")[0] |
| 8816 | assert(_experimenter == 6035143) |
| 8817 | _subtype = reader.read("!L")[0] |
| 8818 | assert(_subtype == 17) |
| 8819 | obj.vport_no = reader.read("!L")[0] |
| 8820 | return obj |
| 8821 | |
| 8822 | def __eq__(self, other): |
| 8823 | if type(self) != type(other): return False |
| 8824 | if self.xid != other.xid: return False |
| 8825 | if self.vport_no != other.vport_no: return False |
| 8826 | return True |
| 8827 | |
| 8828 | def pretty_print(self, q): |
| 8829 | q.text("bsn_virtual_port_remove_request {") |
| 8830 | with q.group(): |
| 8831 | with q.indent(2): |
| 8832 | q.breakable() |
| 8833 | q.text("xid = "); |
| 8834 | if self.xid != None: |
| 8835 | q.text("%#x" % self.xid) |
| 8836 | else: |
| 8837 | q.text('None') |
| 8838 | q.text(","); q.breakable() |
| 8839 | q.text("vport_no = "); |
| 8840 | q.text("%#x" % self.vport_no) |
| 8841 | q.breakable() |
| 8842 | q.text('}') |
| 8843 | |
| 8844 | bsn_header.subtypes[17] = bsn_virtual_port_remove_request |
| 8845 | |
| 8846 | class bsn_vlan_counter_clear(bsn_header): |
| 8847 | version = 4 |
| 8848 | type = 4 |
| 8849 | experimenter = 6035143 |
| 8850 | subtype = 70 |
| 8851 | |
| 8852 | def __init__(self, xid=None, vlan_vid=None): |
| 8853 | if xid != None: |
| 8854 | self.xid = xid |
| 8855 | else: |
| 8856 | self.xid = None |
| 8857 | if vlan_vid != None: |
| 8858 | self.vlan_vid = vlan_vid |
| 8859 | else: |
| 8860 | self.vlan_vid = 0 |
| 8861 | return |
| 8862 | |
| 8863 | def pack(self): |
| 8864 | packed = [] |
| 8865 | packed.append(struct.pack("!B", self.version)) |
| 8866 | packed.append(struct.pack("!B", self.type)) |
| 8867 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 8868 | packed.append(struct.pack("!L", self.xid)) |
| 8869 | packed.append(struct.pack("!L", self.experimenter)) |
| 8870 | packed.append(struct.pack("!L", self.subtype)) |
| 8871 | packed.append(struct.pack("!H", self.vlan_vid)) |
| 8872 | length = sum([len(x) for x in packed]) |
| 8873 | packed[2] = struct.pack("!H", length) |
| 8874 | return ''.join(packed) |
| 8875 | |
| 8876 | @staticmethod |
| 8877 | def unpack(reader): |
| 8878 | obj = bsn_vlan_counter_clear() |
| 8879 | _version = reader.read("!B")[0] |
| 8880 | assert(_version == 4) |
| 8881 | _type = reader.read("!B")[0] |
| 8882 | assert(_type == 4) |
| 8883 | _length = reader.read("!H")[0] |
| 8884 | orig_reader = reader |
| 8885 | reader = orig_reader.slice(_length, 4) |
| 8886 | obj.xid = reader.read("!L")[0] |
| 8887 | _experimenter = reader.read("!L")[0] |
| 8888 | assert(_experimenter == 6035143) |
| 8889 | _subtype = reader.read("!L")[0] |
| 8890 | assert(_subtype == 70) |
| 8891 | obj.vlan_vid = reader.read("!H")[0] |
| 8892 | return obj |
| 8893 | |
| 8894 | def __eq__(self, other): |
| 8895 | if type(self) != type(other): return False |
| 8896 | if self.xid != other.xid: return False |
| 8897 | if self.vlan_vid != other.vlan_vid: return False |
| 8898 | return True |
| 8899 | |
| 8900 | def pretty_print(self, q): |
| 8901 | q.text("bsn_vlan_counter_clear {") |
| 8902 | with q.group(): |
| 8903 | with q.indent(2): |
| 8904 | q.breakable() |
| 8905 | q.text("xid = "); |
| 8906 | if self.xid != None: |
| 8907 | q.text("%#x" % self.xid) |
| 8908 | else: |
| 8909 | q.text('None') |
| 8910 | q.text(","); q.breakable() |
| 8911 | q.text("vlan_vid = "); |
| 8912 | q.text("%#x" % self.vlan_vid) |
| 8913 | q.breakable() |
| 8914 | q.text('}') |
| 8915 | |
| 8916 | bsn_header.subtypes[70] = bsn_vlan_counter_clear |
| 8917 | |
| 8918 | class bsn_vlan_counter_stats_reply(bsn_stats_reply): |
| 8919 | version = 4 |
| 8920 | type = 19 |
| 8921 | stats_type = 65535 |
| 8922 | experimenter = 6035143 |
| 8923 | subtype = 9 |
| 8924 | |
| 8925 | def __init__(self, xid=None, flags=None, entries=None): |
| 8926 | if xid != None: |
| 8927 | self.xid = xid |
| 8928 | else: |
| 8929 | self.xid = None |
| 8930 | if flags != None: |
| 8931 | self.flags = flags |
| 8932 | else: |
| 8933 | self.flags = 0 |
| 8934 | if entries != None: |
| 8935 | self.entries = entries |
| 8936 | else: |
| 8937 | self.entries = [] |
| 8938 | return |
| 8939 | |
| 8940 | def pack(self): |
| 8941 | packed = [] |
| 8942 | packed.append(struct.pack("!B", self.version)) |
| 8943 | packed.append(struct.pack("!B", self.type)) |
| 8944 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 8945 | packed.append(struct.pack("!L", self.xid)) |
| 8946 | packed.append(struct.pack("!H", self.stats_type)) |
| 8947 | packed.append(struct.pack("!H", self.flags)) |
| 8948 | packed.append('\x00' * 4) |
| 8949 | packed.append(struct.pack("!L", self.experimenter)) |
| 8950 | packed.append(struct.pack("!L", self.subtype)) |
| 8951 | packed.append(loxi.generic_util.pack_list(self.entries)) |
| 8952 | length = sum([len(x) for x in packed]) |
| 8953 | packed[2] = struct.pack("!H", length) |
| 8954 | return ''.join(packed) |
| 8955 | |
| 8956 | @staticmethod |
| 8957 | def unpack(reader): |
| 8958 | obj = bsn_vlan_counter_stats_reply() |
| 8959 | _version = reader.read("!B")[0] |
| 8960 | assert(_version == 4) |
| 8961 | _type = reader.read("!B")[0] |
| 8962 | assert(_type == 19) |
| 8963 | _length = reader.read("!H")[0] |
| 8964 | orig_reader = reader |
| 8965 | reader = orig_reader.slice(_length, 4) |
| 8966 | obj.xid = reader.read("!L")[0] |
| 8967 | _stats_type = reader.read("!H")[0] |
| 8968 | assert(_stats_type == 65535) |
| 8969 | obj.flags = reader.read("!H")[0] |
| 8970 | reader.skip(4) |
| 8971 | _experimenter = reader.read("!L")[0] |
| 8972 | assert(_experimenter == 6035143) |
| 8973 | _subtype = reader.read("!L")[0] |
| 8974 | assert(_subtype == 9) |
| 8975 | obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.bsn_vlan_counter_stats_entry.unpack) |
| 8976 | return obj |
| 8977 | |
| 8978 | def __eq__(self, other): |
| 8979 | if type(self) != type(other): return False |
| 8980 | if self.xid != other.xid: return False |
| 8981 | if self.flags != other.flags: return False |
| 8982 | if self.entries != other.entries: return False |
| 8983 | return True |
| 8984 | |
| 8985 | def pretty_print(self, q): |
| 8986 | q.text("bsn_vlan_counter_stats_reply {") |
| 8987 | with q.group(): |
| 8988 | with q.indent(2): |
| 8989 | q.breakable() |
| 8990 | q.text("xid = "); |
| 8991 | if self.xid != None: |
| 8992 | q.text("%#x" % self.xid) |
| 8993 | else: |
| 8994 | q.text('None') |
| 8995 | q.text(","); q.breakable() |
| 8996 | q.text("flags = "); |
| 8997 | q.text("%#x" % self.flags) |
| 8998 | q.text(","); q.breakable() |
| 8999 | q.text("entries = "); |
| 9000 | q.pp(self.entries) |
| 9001 | q.breakable() |
| 9002 | q.text('}') |
| 9003 | |
| 9004 | bsn_stats_reply.subtypes[9] = bsn_vlan_counter_stats_reply |
| 9005 | |
| 9006 | class bsn_vlan_counter_stats_request(bsn_stats_request): |
| 9007 | version = 4 |
| 9008 | type = 18 |
| 9009 | stats_type = 65535 |
| 9010 | experimenter = 6035143 |
| 9011 | subtype = 9 |
| 9012 | |
| 9013 | def __init__(self, xid=None, flags=None, vlan_vid=None): |
| 9014 | if xid != None: |
| 9015 | self.xid = xid |
| 9016 | else: |
| 9017 | self.xid = None |
| 9018 | if flags != None: |
| 9019 | self.flags = flags |
| 9020 | else: |
| 9021 | self.flags = 0 |
| 9022 | if vlan_vid != None: |
| 9023 | self.vlan_vid = vlan_vid |
| 9024 | else: |
| 9025 | self.vlan_vid = 0 |
| 9026 | return |
| 9027 | |
| 9028 | def pack(self): |
| 9029 | packed = [] |
| 9030 | packed.append(struct.pack("!B", self.version)) |
| 9031 | packed.append(struct.pack("!B", self.type)) |
| 9032 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 9033 | packed.append(struct.pack("!L", self.xid)) |
| 9034 | packed.append(struct.pack("!H", self.stats_type)) |
| 9035 | packed.append(struct.pack("!H", self.flags)) |
| 9036 | packed.append('\x00' * 4) |
| 9037 | packed.append(struct.pack("!L", self.experimenter)) |
| 9038 | packed.append(struct.pack("!L", self.subtype)) |
| 9039 | packed.append(struct.pack("!H", self.vlan_vid)) |
| 9040 | length = sum([len(x) for x in packed]) |
| 9041 | packed[2] = struct.pack("!H", length) |
| 9042 | return ''.join(packed) |
| 9043 | |
| 9044 | @staticmethod |
| 9045 | def unpack(reader): |
| 9046 | obj = bsn_vlan_counter_stats_request() |
| 9047 | _version = reader.read("!B")[0] |
| 9048 | assert(_version == 4) |
| 9049 | _type = reader.read("!B")[0] |
| 9050 | assert(_type == 18) |
| 9051 | _length = reader.read("!H")[0] |
| 9052 | orig_reader = reader |
| 9053 | reader = orig_reader.slice(_length, 4) |
| 9054 | obj.xid = reader.read("!L")[0] |
| 9055 | _stats_type = reader.read("!H")[0] |
| 9056 | assert(_stats_type == 65535) |
| 9057 | obj.flags = reader.read("!H")[0] |
| 9058 | reader.skip(4) |
| 9059 | _experimenter = reader.read("!L")[0] |
| 9060 | assert(_experimenter == 6035143) |
| 9061 | _subtype = reader.read("!L")[0] |
| 9062 | assert(_subtype == 9) |
| 9063 | obj.vlan_vid = reader.read("!H")[0] |
| 9064 | return obj |
| 9065 | |
| 9066 | def __eq__(self, other): |
| 9067 | if type(self) != type(other): return False |
| 9068 | if self.xid != other.xid: return False |
| 9069 | if self.flags != other.flags: return False |
| 9070 | if self.vlan_vid != other.vlan_vid: return False |
| 9071 | return True |
| 9072 | |
| 9073 | def pretty_print(self, q): |
| 9074 | q.text("bsn_vlan_counter_stats_request {") |
| 9075 | with q.group(): |
| 9076 | with q.indent(2): |
| 9077 | q.breakable() |
| 9078 | q.text("xid = "); |
| 9079 | if self.xid != None: |
| 9080 | q.text("%#x" % self.xid) |
| 9081 | else: |
| 9082 | q.text('None') |
| 9083 | q.text(","); q.breakable() |
| 9084 | q.text("flags = "); |
| 9085 | q.text("%#x" % self.flags) |
| 9086 | q.text(","); q.breakable() |
| 9087 | q.text("vlan_vid = "); |
| 9088 | q.text("%#x" % self.vlan_vid) |
| 9089 | q.breakable() |
| 9090 | q.text('}') |
| 9091 | |
| 9092 | bsn_stats_request.subtypes[9] = bsn_vlan_counter_stats_request |
| 9093 | |
| 9094 | class bsn_vrf_counter_stats_reply(bsn_stats_reply): |
| 9095 | version = 4 |
| 9096 | type = 19 |
| 9097 | stats_type = 65535 |
| 9098 | experimenter = 6035143 |
| 9099 | subtype = 15 |
| 9100 | |
| 9101 | def __init__(self, xid=None, flags=None, entries=None): |
| 9102 | if xid != None: |
| 9103 | self.xid = xid |
| 9104 | else: |
| 9105 | self.xid = None |
| 9106 | if flags != None: |
| 9107 | self.flags = flags |
| 9108 | else: |
| 9109 | self.flags = 0 |
| 9110 | if entries != None: |
| 9111 | self.entries = entries |
| 9112 | else: |
| 9113 | self.entries = [] |
| 9114 | return |
| 9115 | |
| 9116 | def pack(self): |
| 9117 | packed = [] |
| 9118 | packed.append(struct.pack("!B", self.version)) |
| 9119 | packed.append(struct.pack("!B", self.type)) |
| 9120 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 9121 | packed.append(struct.pack("!L", self.xid)) |
| 9122 | packed.append(struct.pack("!H", self.stats_type)) |
| 9123 | packed.append(struct.pack("!H", self.flags)) |
| 9124 | packed.append('\x00' * 4) |
| 9125 | packed.append(struct.pack("!L", self.experimenter)) |
| 9126 | packed.append(struct.pack("!L", self.subtype)) |
| 9127 | packed.append(loxi.generic_util.pack_list(self.entries)) |
| 9128 | length = sum([len(x) for x in packed]) |
| 9129 | packed[2] = struct.pack("!H", length) |
| 9130 | return ''.join(packed) |
| 9131 | |
| 9132 | @staticmethod |
| 9133 | def unpack(reader): |
| 9134 | obj = bsn_vrf_counter_stats_reply() |
| 9135 | _version = reader.read("!B")[0] |
| 9136 | assert(_version == 4) |
| 9137 | _type = reader.read("!B")[0] |
| 9138 | assert(_type == 19) |
| 9139 | _length = reader.read("!H")[0] |
| 9140 | orig_reader = reader |
| 9141 | reader = orig_reader.slice(_length, 4) |
| 9142 | obj.xid = reader.read("!L")[0] |
| 9143 | _stats_type = reader.read("!H")[0] |
| 9144 | assert(_stats_type == 65535) |
| 9145 | obj.flags = reader.read("!H")[0] |
| 9146 | reader.skip(4) |
| 9147 | _experimenter = reader.read("!L")[0] |
| 9148 | assert(_experimenter == 6035143) |
| 9149 | _subtype = reader.read("!L")[0] |
| 9150 | assert(_subtype == 15) |
| 9151 | obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.bsn_vrf_counter_stats_entry.unpack) |
| 9152 | return obj |
| 9153 | |
| 9154 | def __eq__(self, other): |
| 9155 | if type(self) != type(other): return False |
| 9156 | if self.xid != other.xid: return False |
| 9157 | if self.flags != other.flags: return False |
| 9158 | if self.entries != other.entries: return False |
| 9159 | return True |
| 9160 | |
| 9161 | def pretty_print(self, q): |
| 9162 | q.text("bsn_vrf_counter_stats_reply {") |
| 9163 | with q.group(): |
| 9164 | with q.indent(2): |
| 9165 | q.breakable() |
| 9166 | q.text("xid = "); |
| 9167 | if self.xid != None: |
| 9168 | q.text("%#x" % self.xid) |
| 9169 | else: |
| 9170 | q.text('None') |
| 9171 | q.text(","); q.breakable() |
| 9172 | q.text("flags = "); |
| 9173 | q.text("%#x" % self.flags) |
| 9174 | q.text(","); q.breakable() |
| 9175 | q.text("entries = "); |
| 9176 | q.pp(self.entries) |
| 9177 | q.breakable() |
| 9178 | q.text('}') |
| 9179 | |
| 9180 | bsn_stats_reply.subtypes[15] = bsn_vrf_counter_stats_reply |
| 9181 | |
| 9182 | class bsn_vrf_counter_stats_request(bsn_stats_request): |
| 9183 | version = 4 |
| 9184 | type = 18 |
| 9185 | stats_type = 65535 |
| 9186 | experimenter = 6035143 |
| 9187 | subtype = 15 |
| 9188 | |
| 9189 | def __init__(self, xid=None, flags=None, vrf=None): |
| 9190 | if xid != None: |
| 9191 | self.xid = xid |
| 9192 | else: |
| 9193 | self.xid = None |
| 9194 | if flags != None: |
| 9195 | self.flags = flags |
| 9196 | else: |
| 9197 | self.flags = 0 |
| 9198 | if vrf != None: |
| 9199 | self.vrf = vrf |
| 9200 | else: |
| 9201 | self.vrf = 0 |
| 9202 | return |
| 9203 | |
| 9204 | def pack(self): |
| 9205 | packed = [] |
| 9206 | packed.append(struct.pack("!B", self.version)) |
| 9207 | packed.append(struct.pack("!B", self.type)) |
| 9208 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 9209 | packed.append(struct.pack("!L", self.xid)) |
| 9210 | packed.append(struct.pack("!H", self.stats_type)) |
| 9211 | packed.append(struct.pack("!H", self.flags)) |
| 9212 | packed.append('\x00' * 4) |
| 9213 | packed.append(struct.pack("!L", self.experimenter)) |
| 9214 | packed.append(struct.pack("!L", self.subtype)) |
| 9215 | packed.append(struct.pack("!L", self.vrf)) |
| 9216 | length = sum([len(x) for x in packed]) |
| 9217 | packed[2] = struct.pack("!H", length) |
| 9218 | return ''.join(packed) |
| 9219 | |
| 9220 | @staticmethod |
| 9221 | def unpack(reader): |
| 9222 | obj = bsn_vrf_counter_stats_request() |
| 9223 | _version = reader.read("!B")[0] |
| 9224 | assert(_version == 4) |
| 9225 | _type = reader.read("!B")[0] |
| 9226 | assert(_type == 18) |
| 9227 | _length = reader.read("!H")[0] |
| 9228 | orig_reader = reader |
| 9229 | reader = orig_reader.slice(_length, 4) |
| 9230 | obj.xid = reader.read("!L")[0] |
| 9231 | _stats_type = reader.read("!H")[0] |
| 9232 | assert(_stats_type == 65535) |
| 9233 | obj.flags = reader.read("!H")[0] |
| 9234 | reader.skip(4) |
| 9235 | _experimenter = reader.read("!L")[0] |
| 9236 | assert(_experimenter == 6035143) |
| 9237 | _subtype = reader.read("!L")[0] |
| 9238 | assert(_subtype == 15) |
| 9239 | obj.vrf = reader.read("!L")[0] |
| 9240 | return obj |
| 9241 | |
| 9242 | def __eq__(self, other): |
| 9243 | if type(self) != type(other): return False |
| 9244 | if self.xid != other.xid: return False |
| 9245 | if self.flags != other.flags: return False |
| 9246 | if self.vrf != other.vrf: return False |
| 9247 | return True |
| 9248 | |
| 9249 | def pretty_print(self, q): |
| 9250 | q.text("bsn_vrf_counter_stats_request {") |
| 9251 | with q.group(): |
| 9252 | with q.indent(2): |
| 9253 | q.breakable() |
| 9254 | q.text("xid = "); |
| 9255 | if self.xid != None: |
| 9256 | q.text("%#x" % self.xid) |
| 9257 | else: |
| 9258 | q.text('None') |
| 9259 | q.text(","); q.breakable() |
| 9260 | q.text("flags = "); |
| 9261 | q.text("%#x" % self.flags) |
| 9262 | q.text(","); q.breakable() |
| 9263 | q.text("vrf = "); |
| 9264 | q.text("%#x" % self.vrf) |
| 9265 | q.breakable() |
| 9266 | q.text('}') |
| 9267 | |
| 9268 | bsn_stats_request.subtypes[15] = bsn_vrf_counter_stats_request |
| 9269 | |
| 9270 | class desc_stats_reply(stats_reply): |
| 9271 | version = 4 |
| 9272 | type = 19 |
| 9273 | stats_type = 0 |
| 9274 | |
| 9275 | def __init__(self, xid=None, flags=None, mfr_desc=None, hw_desc=None, sw_desc=None, serial_num=None, dp_desc=None): |
| 9276 | if xid != None: |
| 9277 | self.xid = xid |
| 9278 | else: |
| 9279 | self.xid = None |
| 9280 | if flags != None: |
| 9281 | self.flags = flags |
| 9282 | else: |
| 9283 | self.flags = 0 |
| 9284 | if mfr_desc != None: |
| 9285 | self.mfr_desc = mfr_desc |
| 9286 | else: |
| 9287 | self.mfr_desc = "" |
| 9288 | if hw_desc != None: |
| 9289 | self.hw_desc = hw_desc |
| 9290 | else: |
| 9291 | self.hw_desc = "" |
| 9292 | if sw_desc != None: |
| 9293 | self.sw_desc = sw_desc |
| 9294 | else: |
| 9295 | self.sw_desc = "" |
| 9296 | if serial_num != None: |
| 9297 | self.serial_num = serial_num |
| 9298 | else: |
| 9299 | self.serial_num = "" |
| 9300 | if dp_desc != None: |
| 9301 | self.dp_desc = dp_desc |
| 9302 | else: |
| 9303 | self.dp_desc = "" |
| 9304 | return |
| 9305 | |
| 9306 | def pack(self): |
| 9307 | packed = [] |
| 9308 | packed.append(struct.pack("!B", self.version)) |
| 9309 | packed.append(struct.pack("!B", self.type)) |
| 9310 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 9311 | packed.append(struct.pack("!L", self.xid)) |
| 9312 | packed.append(struct.pack("!H", self.stats_type)) |
| 9313 | packed.append(struct.pack("!H", self.flags)) |
| 9314 | packed.append('\x00' * 4) |
| 9315 | packed.append(struct.pack("!256s", self.mfr_desc)) |
| 9316 | packed.append(struct.pack("!256s", self.hw_desc)) |
| 9317 | packed.append(struct.pack("!256s", self.sw_desc)) |
| 9318 | packed.append(struct.pack("!32s", self.serial_num)) |
| 9319 | packed.append(struct.pack("!256s", self.dp_desc)) |
| 9320 | length = sum([len(x) for x in packed]) |
| 9321 | packed[2] = struct.pack("!H", length) |
| 9322 | return ''.join(packed) |
| 9323 | |
| 9324 | @staticmethod |
| 9325 | def unpack(reader): |
| 9326 | obj = desc_stats_reply() |
| 9327 | _version = reader.read("!B")[0] |
| 9328 | assert(_version == 4) |
| 9329 | _type = reader.read("!B")[0] |
| 9330 | assert(_type == 19) |
| 9331 | _length = reader.read("!H")[0] |
| 9332 | orig_reader = reader |
| 9333 | reader = orig_reader.slice(_length, 4) |
| 9334 | obj.xid = reader.read("!L")[0] |
| 9335 | _stats_type = reader.read("!H")[0] |
| 9336 | assert(_stats_type == 0) |
| 9337 | obj.flags = reader.read("!H")[0] |
| 9338 | reader.skip(4) |
| 9339 | obj.mfr_desc = reader.read("!256s")[0].rstrip("\x00") |
| 9340 | obj.hw_desc = reader.read("!256s")[0].rstrip("\x00") |
| 9341 | obj.sw_desc = reader.read("!256s")[0].rstrip("\x00") |
| 9342 | obj.serial_num = reader.read("!32s")[0].rstrip("\x00") |
| 9343 | obj.dp_desc = reader.read("!256s")[0].rstrip("\x00") |
| 9344 | return obj |
| 9345 | |
| 9346 | def __eq__(self, other): |
| 9347 | if type(self) != type(other): return False |
| 9348 | if self.xid != other.xid: return False |
| 9349 | if self.flags != other.flags: return False |
| 9350 | if self.mfr_desc != other.mfr_desc: return False |
| 9351 | if self.hw_desc != other.hw_desc: return False |
| 9352 | if self.sw_desc != other.sw_desc: return False |
| 9353 | if self.serial_num != other.serial_num: return False |
| 9354 | if self.dp_desc != other.dp_desc: return False |
| 9355 | return True |
| 9356 | |
| 9357 | def pretty_print(self, q): |
| 9358 | q.text("desc_stats_reply {") |
| 9359 | with q.group(): |
| 9360 | with q.indent(2): |
| 9361 | q.breakable() |
| 9362 | q.text("xid = "); |
| 9363 | if self.xid != None: |
| 9364 | q.text("%#x" % self.xid) |
| 9365 | else: |
| 9366 | q.text('None') |
| 9367 | q.text(","); q.breakable() |
| 9368 | q.text("flags = "); |
| 9369 | q.text("%#x" % self.flags) |
| 9370 | q.text(","); q.breakable() |
| 9371 | q.text("mfr_desc = "); |
| 9372 | q.pp(self.mfr_desc) |
| 9373 | q.text(","); q.breakable() |
| 9374 | q.text("hw_desc = "); |
| 9375 | q.pp(self.hw_desc) |
| 9376 | q.text(","); q.breakable() |
| 9377 | q.text("sw_desc = "); |
| 9378 | q.pp(self.sw_desc) |
| 9379 | q.text(","); q.breakable() |
| 9380 | q.text("serial_num = "); |
| 9381 | q.pp(self.serial_num) |
| 9382 | q.text(","); q.breakable() |
| 9383 | q.text("dp_desc = "); |
| 9384 | q.pp(self.dp_desc) |
| 9385 | q.breakable() |
| 9386 | q.text('}') |
| 9387 | |
| 9388 | stats_reply.subtypes[0] = desc_stats_reply |
| 9389 | |
| 9390 | class desc_stats_request(stats_request): |
| 9391 | version = 4 |
| 9392 | type = 18 |
| 9393 | stats_type = 0 |
| 9394 | |
| 9395 | def __init__(self, xid=None, flags=None): |
| 9396 | if xid != None: |
| 9397 | self.xid = xid |
| 9398 | else: |
| 9399 | self.xid = None |
| 9400 | if flags != None: |
| 9401 | self.flags = flags |
| 9402 | else: |
| 9403 | self.flags = 0 |
| 9404 | return |
| 9405 | |
| 9406 | def pack(self): |
| 9407 | packed = [] |
| 9408 | packed.append(struct.pack("!B", self.version)) |
| 9409 | packed.append(struct.pack("!B", self.type)) |
| 9410 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 9411 | packed.append(struct.pack("!L", self.xid)) |
| 9412 | packed.append(struct.pack("!H", self.stats_type)) |
| 9413 | packed.append(struct.pack("!H", self.flags)) |
| 9414 | packed.append('\x00' * 4) |
| 9415 | length = sum([len(x) for x in packed]) |
| 9416 | packed[2] = struct.pack("!H", length) |
| 9417 | return ''.join(packed) |
| 9418 | |
| 9419 | @staticmethod |
| 9420 | def unpack(reader): |
| 9421 | obj = desc_stats_request() |
| 9422 | _version = reader.read("!B")[0] |
| 9423 | assert(_version == 4) |
| 9424 | _type = reader.read("!B")[0] |
| 9425 | assert(_type == 18) |
| 9426 | _length = reader.read("!H")[0] |
| 9427 | orig_reader = reader |
| 9428 | reader = orig_reader.slice(_length, 4) |
| 9429 | obj.xid = reader.read("!L")[0] |
| 9430 | _stats_type = reader.read("!H")[0] |
| 9431 | assert(_stats_type == 0) |
| 9432 | obj.flags = reader.read("!H")[0] |
| 9433 | reader.skip(4) |
| 9434 | return obj |
| 9435 | |
| 9436 | def __eq__(self, other): |
| 9437 | if type(self) != type(other): return False |
| 9438 | if self.xid != other.xid: return False |
| 9439 | if self.flags != other.flags: return False |
| 9440 | return True |
| 9441 | |
| 9442 | def pretty_print(self, q): |
| 9443 | q.text("desc_stats_request {") |
| 9444 | with q.group(): |
| 9445 | with q.indent(2): |
| 9446 | q.breakable() |
| 9447 | q.text("xid = "); |
| 9448 | if self.xid != None: |
| 9449 | q.text("%#x" % self.xid) |
| 9450 | else: |
| 9451 | q.text('None') |
| 9452 | q.text(","); q.breakable() |
| 9453 | q.text("flags = "); |
| 9454 | q.text("%#x" % self.flags) |
| 9455 | q.breakable() |
| 9456 | q.text('}') |
| 9457 | |
| 9458 | stats_request.subtypes[0] = desc_stats_request |
| 9459 | |
| 9460 | class echo_reply(message): |
| 9461 | version = 4 |
| 9462 | type = 3 |
| 9463 | |
| 9464 | def __init__(self, xid=None, data=None): |
| 9465 | if xid != None: |
| 9466 | self.xid = xid |
| 9467 | else: |
| 9468 | self.xid = None |
| 9469 | if data != None: |
| 9470 | self.data = data |
| 9471 | else: |
| 9472 | self.data = '' |
| 9473 | return |
| 9474 | |
| 9475 | def pack(self): |
| 9476 | packed = [] |
| 9477 | packed.append(struct.pack("!B", self.version)) |
| 9478 | packed.append(struct.pack("!B", self.type)) |
| 9479 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 9480 | packed.append(struct.pack("!L", self.xid)) |
| 9481 | packed.append(self.data) |
| 9482 | length = sum([len(x) for x in packed]) |
| 9483 | packed[2] = struct.pack("!H", length) |
| 9484 | return ''.join(packed) |
| 9485 | |
| 9486 | @staticmethod |
| 9487 | def unpack(reader): |
| 9488 | obj = echo_reply() |
| 9489 | _version = reader.read("!B")[0] |
| 9490 | assert(_version == 4) |
| 9491 | _type = reader.read("!B")[0] |
| 9492 | assert(_type == 3) |
| 9493 | _length = reader.read("!H")[0] |
| 9494 | orig_reader = reader |
| 9495 | reader = orig_reader.slice(_length, 4) |
| 9496 | obj.xid = reader.read("!L")[0] |
| 9497 | obj.data = str(reader.read_all()) |
| 9498 | return obj |
| 9499 | |
| 9500 | def __eq__(self, other): |
| 9501 | if type(self) != type(other): return False |
| 9502 | if self.xid != other.xid: return False |
| 9503 | if self.data != other.data: return False |
| 9504 | return True |
| 9505 | |
| 9506 | def pretty_print(self, q): |
| 9507 | q.text("echo_reply {") |
| 9508 | with q.group(): |
| 9509 | with q.indent(2): |
| 9510 | q.breakable() |
| 9511 | q.text("xid = "); |
| 9512 | if self.xid != None: |
| 9513 | q.text("%#x" % self.xid) |
| 9514 | else: |
| 9515 | q.text('None') |
| 9516 | q.text(","); q.breakable() |
| 9517 | q.text("data = "); |
| 9518 | q.pp(self.data) |
| 9519 | q.breakable() |
| 9520 | q.text('}') |
| 9521 | |
| 9522 | message.subtypes[3] = echo_reply |
| 9523 | |
| 9524 | class echo_request(message): |
| 9525 | version = 4 |
| 9526 | type = 2 |
| 9527 | |
| 9528 | def __init__(self, xid=None, data=None): |
| 9529 | if xid != None: |
| 9530 | self.xid = xid |
| 9531 | else: |
| 9532 | self.xid = None |
| 9533 | if data != None: |
| 9534 | self.data = data |
| 9535 | else: |
| 9536 | self.data = '' |
| 9537 | return |
| 9538 | |
| 9539 | def pack(self): |
| 9540 | packed = [] |
| 9541 | packed.append(struct.pack("!B", self.version)) |
| 9542 | packed.append(struct.pack("!B", self.type)) |
| 9543 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 9544 | packed.append(struct.pack("!L", self.xid)) |
| 9545 | packed.append(self.data) |
| 9546 | length = sum([len(x) for x in packed]) |
| 9547 | packed[2] = struct.pack("!H", length) |
| 9548 | return ''.join(packed) |
| 9549 | |
| 9550 | @staticmethod |
| 9551 | def unpack(reader): |
| 9552 | obj = echo_request() |
| 9553 | _version = reader.read("!B")[0] |
| 9554 | assert(_version == 4) |
| 9555 | _type = reader.read("!B")[0] |
| 9556 | assert(_type == 2) |
| 9557 | _length = reader.read("!H")[0] |
| 9558 | orig_reader = reader |
| 9559 | reader = orig_reader.slice(_length, 4) |
| 9560 | obj.xid = reader.read("!L")[0] |
| 9561 | obj.data = str(reader.read_all()) |
| 9562 | return obj |
| 9563 | |
| 9564 | def __eq__(self, other): |
| 9565 | if type(self) != type(other): return False |
| 9566 | if self.xid != other.xid: return False |
| 9567 | if self.data != other.data: return False |
| 9568 | return True |
| 9569 | |
| 9570 | def pretty_print(self, q): |
| 9571 | q.text("echo_request {") |
| 9572 | with q.group(): |
| 9573 | with q.indent(2): |
| 9574 | q.breakable() |
| 9575 | q.text("xid = "); |
| 9576 | if self.xid != None: |
| 9577 | q.text("%#x" % self.xid) |
| 9578 | else: |
| 9579 | q.text('None') |
| 9580 | q.text(","); q.breakable() |
| 9581 | q.text("data = "); |
| 9582 | q.pp(self.data) |
| 9583 | q.breakable() |
| 9584 | q.text('}') |
| 9585 | |
| 9586 | message.subtypes[2] = echo_request |
| 9587 | |
| 9588 | class features_reply(message): |
| 9589 | version = 4 |
| 9590 | type = 6 |
| 9591 | |
| 9592 | def __init__(self, xid=None, datapath_id=None, n_buffers=None, n_tables=None, auxiliary_id=None, capabilities=None, reserved=None): |
| 9593 | if xid != None: |
| 9594 | self.xid = xid |
| 9595 | else: |
| 9596 | self.xid = None |
| 9597 | if datapath_id != None: |
| 9598 | self.datapath_id = datapath_id |
| 9599 | else: |
| 9600 | self.datapath_id = 0 |
| 9601 | if n_buffers != None: |
| 9602 | self.n_buffers = n_buffers |
| 9603 | else: |
| 9604 | self.n_buffers = 0 |
| 9605 | if n_tables != None: |
| 9606 | self.n_tables = n_tables |
| 9607 | else: |
| 9608 | self.n_tables = 0 |
| 9609 | if auxiliary_id != None: |
| 9610 | self.auxiliary_id = auxiliary_id |
| 9611 | else: |
| 9612 | self.auxiliary_id = 0 |
| 9613 | if capabilities != None: |
| 9614 | self.capabilities = capabilities |
| 9615 | else: |
| 9616 | self.capabilities = 0 |
| 9617 | if reserved != None: |
| 9618 | self.reserved = reserved |
| 9619 | else: |
| 9620 | self.reserved = 0 |
| 9621 | return |
| 9622 | |
| 9623 | def pack(self): |
| 9624 | packed = [] |
| 9625 | packed.append(struct.pack("!B", self.version)) |
| 9626 | packed.append(struct.pack("!B", self.type)) |
| 9627 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 9628 | packed.append(struct.pack("!L", self.xid)) |
| 9629 | packed.append(struct.pack("!Q", self.datapath_id)) |
| 9630 | packed.append(struct.pack("!L", self.n_buffers)) |
| 9631 | packed.append(struct.pack("!B", self.n_tables)) |
| 9632 | packed.append(struct.pack("!B", self.auxiliary_id)) |
| 9633 | packed.append('\x00' * 2) |
| 9634 | packed.append(struct.pack("!L", self.capabilities)) |
| 9635 | packed.append(struct.pack("!L", self.reserved)) |
| 9636 | length = sum([len(x) for x in packed]) |
| 9637 | packed[2] = struct.pack("!H", length) |
| 9638 | return ''.join(packed) |
| 9639 | |
| 9640 | @staticmethod |
| 9641 | def unpack(reader): |
| 9642 | obj = features_reply() |
| 9643 | _version = reader.read("!B")[0] |
| 9644 | assert(_version == 4) |
| 9645 | _type = reader.read("!B")[0] |
| 9646 | assert(_type == 6) |
| 9647 | _length = reader.read("!H")[0] |
| 9648 | orig_reader = reader |
| 9649 | reader = orig_reader.slice(_length, 4) |
| 9650 | obj.xid = reader.read("!L")[0] |
| 9651 | obj.datapath_id = reader.read("!Q")[0] |
| 9652 | obj.n_buffers = reader.read("!L")[0] |
| 9653 | obj.n_tables = reader.read("!B")[0] |
| 9654 | obj.auxiliary_id = reader.read("!B")[0] |
| 9655 | reader.skip(2) |
| 9656 | obj.capabilities = reader.read("!L")[0] |
| 9657 | obj.reserved = reader.read("!L")[0] |
| 9658 | return obj |
| 9659 | |
| 9660 | def __eq__(self, other): |
| 9661 | if type(self) != type(other): return False |
| 9662 | if self.xid != other.xid: return False |
| 9663 | if self.datapath_id != other.datapath_id: return False |
| 9664 | if self.n_buffers != other.n_buffers: return False |
| 9665 | if self.n_tables != other.n_tables: return False |
| 9666 | if self.auxiliary_id != other.auxiliary_id: return False |
| 9667 | if self.capabilities != other.capabilities: return False |
| 9668 | if self.reserved != other.reserved: return False |
| 9669 | return True |
| 9670 | |
| 9671 | def pretty_print(self, q): |
| 9672 | q.text("features_reply {") |
| 9673 | with q.group(): |
| 9674 | with q.indent(2): |
| 9675 | q.breakable() |
| 9676 | q.text("xid = "); |
| 9677 | if self.xid != None: |
| 9678 | q.text("%#x" % self.xid) |
| 9679 | else: |
| 9680 | q.text('None') |
| 9681 | q.text(","); q.breakable() |
| 9682 | q.text("datapath_id = "); |
| 9683 | q.text("%#x" % self.datapath_id) |
| 9684 | q.text(","); q.breakable() |
| 9685 | q.text("n_buffers = "); |
| 9686 | q.text("%#x" % self.n_buffers) |
| 9687 | q.text(","); q.breakable() |
| 9688 | q.text("n_tables = "); |
| 9689 | q.text("%#x" % self.n_tables) |
| 9690 | q.text(","); q.breakable() |
| 9691 | q.text("auxiliary_id = "); |
| 9692 | q.text("%#x" % self.auxiliary_id) |
| 9693 | q.text(","); q.breakable() |
| 9694 | q.text("capabilities = "); |
| 9695 | q.text("%#x" % self.capabilities) |
| 9696 | q.text(","); q.breakable() |
| 9697 | q.text("reserved = "); |
| 9698 | q.text("%#x" % self.reserved) |
| 9699 | q.breakable() |
| 9700 | q.text('}') |
| 9701 | |
| 9702 | message.subtypes[6] = features_reply |
| 9703 | |
| 9704 | class features_request(message): |
| 9705 | version = 4 |
| 9706 | type = 5 |
| 9707 | |
| 9708 | def __init__(self, xid=None): |
| 9709 | if xid != None: |
| 9710 | self.xid = xid |
| 9711 | else: |
| 9712 | self.xid = None |
| 9713 | return |
| 9714 | |
| 9715 | def pack(self): |
| 9716 | packed = [] |
| 9717 | packed.append(struct.pack("!B", self.version)) |
| 9718 | packed.append(struct.pack("!B", self.type)) |
| 9719 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 9720 | packed.append(struct.pack("!L", self.xid)) |
| 9721 | length = sum([len(x) for x in packed]) |
| 9722 | packed[2] = struct.pack("!H", length) |
| 9723 | return ''.join(packed) |
| 9724 | |
| 9725 | @staticmethod |
| 9726 | def unpack(reader): |
| 9727 | obj = features_request() |
| 9728 | _version = reader.read("!B")[0] |
| 9729 | assert(_version == 4) |
| 9730 | _type = reader.read("!B")[0] |
| 9731 | assert(_type == 5) |
| 9732 | _length = reader.read("!H")[0] |
| 9733 | orig_reader = reader |
| 9734 | reader = orig_reader.slice(_length, 4) |
| 9735 | obj.xid = reader.read("!L")[0] |
| 9736 | return obj |
| 9737 | |
| 9738 | def __eq__(self, other): |
| 9739 | if type(self) != type(other): return False |
| 9740 | if self.xid != other.xid: return False |
| 9741 | return True |
| 9742 | |
| 9743 | def pretty_print(self, q): |
| 9744 | q.text("features_request {") |
| 9745 | with q.group(): |
| 9746 | with q.indent(2): |
| 9747 | q.breakable() |
| 9748 | q.text("xid = "); |
| 9749 | if self.xid != None: |
| 9750 | q.text("%#x" % self.xid) |
| 9751 | else: |
| 9752 | q.text('None') |
| 9753 | q.breakable() |
| 9754 | q.text('}') |
| 9755 | |
| 9756 | message.subtypes[5] = features_request |
| 9757 | |
| 9758 | class flow_mod(message): |
| 9759 | subtypes = {} |
| 9760 | |
| 9761 | version = 4 |
| 9762 | type = 14 |
| 9763 | |
| 9764 | def __init__(self, xid=None, cookie=None, cookie_mask=None, table_id=None, _command=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, out_group=None, flags=None, match=None, instructions=None): |
| 9765 | if xid != None: |
| 9766 | self.xid = xid |
| 9767 | else: |
| 9768 | self.xid = None |
| 9769 | if cookie != None: |
| 9770 | self.cookie = cookie |
| 9771 | else: |
| 9772 | self.cookie = 0 |
| 9773 | if cookie_mask != None: |
| 9774 | self.cookie_mask = cookie_mask |
| 9775 | else: |
| 9776 | self.cookie_mask = 0 |
| 9777 | if table_id != None: |
| 9778 | self.table_id = table_id |
| 9779 | else: |
| 9780 | self.table_id = 0 |
| 9781 | if _command != None: |
| 9782 | self._command = _command |
| 9783 | else: |
| 9784 | self._command = 0 |
| 9785 | if idle_timeout != None: |
| 9786 | self.idle_timeout = idle_timeout |
| 9787 | else: |
| 9788 | self.idle_timeout = 0 |
| 9789 | if hard_timeout != None: |
| 9790 | self.hard_timeout = hard_timeout |
| 9791 | else: |
| 9792 | self.hard_timeout = 0 |
| 9793 | if priority != None: |
| 9794 | self.priority = priority |
| 9795 | else: |
| 9796 | self.priority = 0 |
| 9797 | if buffer_id != None: |
| 9798 | self.buffer_id = buffer_id |
| 9799 | else: |
| 9800 | self.buffer_id = 0 |
| 9801 | if out_port != None: |
| 9802 | self.out_port = out_port |
| 9803 | else: |
| 9804 | self.out_port = 0 |
| 9805 | if out_group != None: |
| 9806 | self.out_group = out_group |
| 9807 | else: |
| 9808 | self.out_group = 0 |
| 9809 | if flags != None: |
| 9810 | self.flags = flags |
| 9811 | else: |
| 9812 | self.flags = 0 |
| 9813 | if match != None: |
| 9814 | self.match = match |
| 9815 | else: |
| 9816 | self.match = ofp.match() |
| 9817 | if instructions != None: |
| 9818 | self.instructions = instructions |
| 9819 | else: |
| 9820 | self.instructions = [] |
| 9821 | return |
| 9822 | |
| 9823 | def pack(self): |
| 9824 | packed = [] |
| 9825 | packed.append(struct.pack("!B", self.version)) |
| 9826 | packed.append(struct.pack("!B", self.type)) |
| 9827 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 9828 | packed.append(struct.pack("!L", self.xid)) |
| 9829 | packed.append(struct.pack("!Q", self.cookie)) |
| 9830 | packed.append(struct.pack("!Q", self.cookie_mask)) |
| 9831 | packed.append(struct.pack("!B", self.table_id)) |
| 9832 | packed.append(util.pack_fm_cmd(self._command)) |
| 9833 | packed.append(struct.pack("!H", self.idle_timeout)) |
| 9834 | packed.append(struct.pack("!H", self.hard_timeout)) |
| 9835 | packed.append(struct.pack("!H", self.priority)) |
| 9836 | packed.append(struct.pack("!L", self.buffer_id)) |
| 9837 | packed.append(util.pack_port_no(self.out_port)) |
| 9838 | packed.append(struct.pack("!L", self.out_group)) |
| 9839 | packed.append(struct.pack("!H", self.flags)) |
| 9840 | packed.append('\x00' * 2) |
| 9841 | packed.append(self.match.pack()) |
| 9842 | packed.append(loxi.generic_util.pack_list(self.instructions)) |
| 9843 | length = sum([len(x) for x in packed]) |
| 9844 | packed[2] = struct.pack("!H", length) |
| 9845 | return ''.join(packed) |
| 9846 | |
| 9847 | @staticmethod |
| 9848 | def unpack(reader): |
| 9849 | subtype, = reader.peek('B', 25) |
| 9850 | subclass = flow_mod.subtypes.get(subtype) |
| 9851 | if subclass: |
| 9852 | return subclass.unpack(reader) |
| 9853 | |
| 9854 | obj = flow_mod() |
| 9855 | _version = reader.read("!B")[0] |
| 9856 | assert(_version == 4) |
| 9857 | _type = reader.read("!B")[0] |
| 9858 | assert(_type == 14) |
| 9859 | _length = reader.read("!H")[0] |
| 9860 | orig_reader = reader |
| 9861 | reader = orig_reader.slice(_length, 4) |
| 9862 | obj.xid = reader.read("!L")[0] |
| 9863 | obj.cookie = reader.read("!Q")[0] |
| 9864 | obj.cookie_mask = reader.read("!Q")[0] |
| 9865 | obj.table_id = reader.read("!B")[0] |
| 9866 | obj._command = util.unpack_fm_cmd(reader) |
| 9867 | obj.idle_timeout = reader.read("!H")[0] |
| 9868 | obj.hard_timeout = reader.read("!H")[0] |
| 9869 | obj.priority = reader.read("!H")[0] |
| 9870 | obj.buffer_id = reader.read("!L")[0] |
| 9871 | obj.out_port = util.unpack_port_no(reader) |
| 9872 | obj.out_group = reader.read("!L")[0] |
| 9873 | obj.flags = reader.read("!H")[0] |
| 9874 | reader.skip(2) |
| 9875 | obj.match = ofp.match.unpack(reader) |
| 9876 | obj.instructions = loxi.generic_util.unpack_list(reader, ofp.instruction.instruction.unpack) |
| 9877 | return obj |
| 9878 | |
| 9879 | def __eq__(self, other): |
| 9880 | if type(self) != type(other): return False |
| 9881 | if self.xid != other.xid: return False |
| 9882 | if self.cookie != other.cookie: return False |
| 9883 | if self.cookie_mask != other.cookie_mask: return False |
| 9884 | if self.table_id != other.table_id: return False |
| 9885 | if self._command != other._command: return False |
| 9886 | if self.idle_timeout != other.idle_timeout: return False |
| 9887 | if self.hard_timeout != other.hard_timeout: return False |
| 9888 | if self.priority != other.priority: return False |
| 9889 | if self.buffer_id != other.buffer_id: return False |
| 9890 | if self.out_port != other.out_port: return False |
| 9891 | if self.out_group != other.out_group: return False |
| 9892 | if self.flags != other.flags: return False |
| 9893 | if self.match != other.match: return False |
| 9894 | if self.instructions != other.instructions: return False |
| 9895 | return True |
| 9896 | |
| 9897 | def pretty_print(self, q): |
| 9898 | q.text("flow_mod {") |
| 9899 | with q.group(): |
| 9900 | with q.indent(2): |
| 9901 | q.breakable() |
| 9902 | q.text("xid = "); |
| 9903 | if self.xid != None: |
| 9904 | q.text("%#x" % self.xid) |
| 9905 | else: |
| 9906 | q.text('None') |
| 9907 | q.text(","); q.breakable() |
| 9908 | q.text("cookie = "); |
| 9909 | q.text("%#x" % self.cookie) |
| 9910 | q.text(","); q.breakable() |
| 9911 | q.text("cookie_mask = "); |
| 9912 | q.text("%#x" % self.cookie_mask) |
| 9913 | q.text(","); q.breakable() |
| 9914 | q.text("table_id = "); |
| 9915 | q.text("%#x" % self.table_id) |
| 9916 | q.text(","); q.breakable() |
| 9917 | q.text("idle_timeout = "); |
| 9918 | q.text("%#x" % self.idle_timeout) |
| 9919 | q.text(","); q.breakable() |
| 9920 | q.text("hard_timeout = "); |
| 9921 | q.text("%#x" % self.hard_timeout) |
| 9922 | q.text(","); q.breakable() |
| 9923 | q.text("priority = "); |
| 9924 | q.text("%#x" % self.priority) |
| 9925 | q.text(","); q.breakable() |
| 9926 | q.text("buffer_id = "); |
| 9927 | q.text("%#x" % self.buffer_id) |
| 9928 | q.text(","); q.breakable() |
| 9929 | q.text("out_port = "); |
| 9930 | q.text(util.pretty_port(self.out_port)) |
| 9931 | q.text(","); q.breakable() |
| 9932 | q.text("out_group = "); |
| 9933 | q.text("%#x" % self.out_group) |
| 9934 | q.text(","); q.breakable() |
| 9935 | q.text("flags = "); |
| 9936 | q.text("%#x" % self.flags) |
| 9937 | q.text(","); q.breakable() |
| 9938 | q.text("match = "); |
| 9939 | q.pp(self.match) |
| 9940 | q.text(","); q.breakable() |
| 9941 | q.text("instructions = "); |
| 9942 | q.pp(self.instructions) |
| 9943 | q.breakable() |
| 9944 | q.text('}') |
| 9945 | |
| 9946 | message.subtypes[14] = flow_mod |
| 9947 | |
| 9948 | class flow_add(flow_mod): |
| 9949 | version = 4 |
| 9950 | type = 14 |
| 9951 | _command = 0 |
| 9952 | |
| 9953 | def __init__(self, xid=None, cookie=None, cookie_mask=None, table_id=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, out_group=None, flags=None, match=None, instructions=None): |
| 9954 | if xid != None: |
| 9955 | self.xid = xid |
| 9956 | else: |
| 9957 | self.xid = None |
| 9958 | if cookie != None: |
| 9959 | self.cookie = cookie |
| 9960 | else: |
| 9961 | self.cookie = 0 |
| 9962 | if cookie_mask != None: |
| 9963 | self.cookie_mask = cookie_mask |
| 9964 | else: |
| 9965 | self.cookie_mask = 0 |
| 9966 | if table_id != None: |
| 9967 | self.table_id = table_id |
| 9968 | else: |
| 9969 | self.table_id = 0 |
| 9970 | if idle_timeout != None: |
| 9971 | self.idle_timeout = idle_timeout |
| 9972 | else: |
| 9973 | self.idle_timeout = 0 |
| 9974 | if hard_timeout != None: |
| 9975 | self.hard_timeout = hard_timeout |
| 9976 | else: |
| 9977 | self.hard_timeout = 0 |
| 9978 | if priority != None: |
| 9979 | self.priority = priority |
| 9980 | else: |
| 9981 | self.priority = 0 |
| 9982 | if buffer_id != None: |
| 9983 | self.buffer_id = buffer_id |
| 9984 | else: |
| 9985 | self.buffer_id = 0 |
| 9986 | if out_port != None: |
| 9987 | self.out_port = out_port |
| 9988 | else: |
| 9989 | self.out_port = 0 |
| 9990 | if out_group != None: |
| 9991 | self.out_group = out_group |
| 9992 | else: |
| 9993 | self.out_group = 0 |
| 9994 | if flags != None: |
| 9995 | self.flags = flags |
| 9996 | else: |
| 9997 | self.flags = 0 |
| 9998 | if match != None: |
| 9999 | self.match = match |
| 10000 | else: |
| 10001 | self.match = ofp.match() |
| 10002 | if instructions != None: |
| 10003 | self.instructions = instructions |
| 10004 | else: |
| 10005 | self.instructions = [] |
| 10006 | return |
| 10007 | |
| 10008 | def pack(self): |
| 10009 | packed = [] |
| 10010 | packed.append(struct.pack("!B", self.version)) |
| 10011 | packed.append(struct.pack("!B", self.type)) |
| 10012 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 10013 | packed.append(struct.pack("!L", self.xid)) |
| 10014 | packed.append(struct.pack("!Q", self.cookie)) |
| 10015 | packed.append(struct.pack("!Q", self.cookie_mask)) |
| 10016 | packed.append(struct.pack("!B", self.table_id)) |
| 10017 | packed.append(util.pack_fm_cmd(self._command)) |
| 10018 | packed.append(struct.pack("!H", self.idle_timeout)) |
| 10019 | packed.append(struct.pack("!H", self.hard_timeout)) |
| 10020 | packed.append(struct.pack("!H", self.priority)) |
| 10021 | packed.append(struct.pack("!L", self.buffer_id)) |
| 10022 | packed.append(util.pack_port_no(self.out_port)) |
| 10023 | packed.append(struct.pack("!L", self.out_group)) |
| 10024 | packed.append(struct.pack("!H", self.flags)) |
| 10025 | packed.append('\x00' * 2) |
| 10026 | packed.append(self.match.pack()) |
| 10027 | packed.append(loxi.generic_util.pack_list(self.instructions)) |
| 10028 | length = sum([len(x) for x in packed]) |
| 10029 | packed[2] = struct.pack("!H", length) |
| 10030 | return ''.join(packed) |
| 10031 | |
| 10032 | @staticmethod |
| 10033 | def unpack(reader): |
| 10034 | obj = flow_add() |
| 10035 | _version = reader.read("!B")[0] |
| 10036 | assert(_version == 4) |
| 10037 | _type = reader.read("!B")[0] |
| 10038 | assert(_type == 14) |
| 10039 | _length = reader.read("!H")[0] |
| 10040 | orig_reader = reader |
| 10041 | reader = orig_reader.slice(_length, 4) |
| 10042 | obj.xid = reader.read("!L")[0] |
| 10043 | obj.cookie = reader.read("!Q")[0] |
| 10044 | obj.cookie_mask = reader.read("!Q")[0] |
| 10045 | obj.table_id = reader.read("!B")[0] |
| 10046 | __command = util.unpack_fm_cmd(reader) |
| 10047 | assert(__command == 0) |
| 10048 | obj.idle_timeout = reader.read("!H")[0] |
| 10049 | obj.hard_timeout = reader.read("!H")[0] |
| 10050 | obj.priority = reader.read("!H")[0] |
| 10051 | obj.buffer_id = reader.read("!L")[0] |
| 10052 | obj.out_port = util.unpack_port_no(reader) |
| 10053 | obj.out_group = reader.read("!L")[0] |
| 10054 | obj.flags = reader.read("!H")[0] |
| 10055 | reader.skip(2) |
| 10056 | obj.match = ofp.match.unpack(reader) |
| 10057 | obj.instructions = loxi.generic_util.unpack_list(reader, ofp.instruction.instruction.unpack) |
| 10058 | return obj |
| 10059 | |
| 10060 | def __eq__(self, other): |
| 10061 | if type(self) != type(other): return False |
| 10062 | if self.xid != other.xid: return False |
| 10063 | if self.cookie != other.cookie: return False |
| 10064 | if self.cookie_mask != other.cookie_mask: return False |
| 10065 | if self.table_id != other.table_id: return False |
| 10066 | if self.idle_timeout != other.idle_timeout: return False |
| 10067 | if self.hard_timeout != other.hard_timeout: return False |
| 10068 | if self.priority != other.priority: return False |
| 10069 | if self.buffer_id != other.buffer_id: return False |
| 10070 | if self.out_port != other.out_port: return False |
| 10071 | if self.out_group != other.out_group: return False |
| 10072 | if self.flags != other.flags: return False |
| 10073 | if self.match != other.match: return False |
| 10074 | if self.instructions != other.instructions: return False |
| 10075 | return True |
| 10076 | |
| 10077 | def pretty_print(self, q): |
| 10078 | q.text("flow_add {") |
| 10079 | with q.group(): |
| 10080 | with q.indent(2): |
| 10081 | q.breakable() |
| 10082 | q.text("xid = "); |
| 10083 | if self.xid != None: |
| 10084 | q.text("%#x" % self.xid) |
| 10085 | else: |
| 10086 | q.text('None') |
| 10087 | q.text(","); q.breakable() |
| 10088 | q.text("cookie = "); |
| 10089 | q.text("%#x" % self.cookie) |
| 10090 | q.text(","); q.breakable() |
| 10091 | q.text("cookie_mask = "); |
| 10092 | q.text("%#x" % self.cookie_mask) |
| 10093 | q.text(","); q.breakable() |
| 10094 | q.text("table_id = "); |
| 10095 | q.text("%#x" % self.table_id) |
| 10096 | q.text(","); q.breakable() |
| 10097 | q.text("idle_timeout = "); |
| 10098 | q.text("%#x" % self.idle_timeout) |
| 10099 | q.text(","); q.breakable() |
| 10100 | q.text("hard_timeout = "); |
| 10101 | q.text("%#x" % self.hard_timeout) |
| 10102 | q.text(","); q.breakable() |
| 10103 | q.text("priority = "); |
| 10104 | q.text("%#x" % self.priority) |
| 10105 | q.text(","); q.breakable() |
| 10106 | q.text("buffer_id = "); |
| 10107 | q.text("%#x" % self.buffer_id) |
| 10108 | q.text(","); q.breakable() |
| 10109 | q.text("out_port = "); |
| 10110 | q.text(util.pretty_port(self.out_port)) |
| 10111 | q.text(","); q.breakable() |
| 10112 | q.text("out_group = "); |
| 10113 | q.text("%#x" % self.out_group) |
| 10114 | q.text(","); q.breakable() |
| 10115 | q.text("flags = "); |
| 10116 | q.text("%#x" % self.flags) |
| 10117 | q.text(","); q.breakable() |
| 10118 | q.text("match = "); |
| 10119 | q.pp(self.match) |
| 10120 | q.text(","); q.breakable() |
| 10121 | q.text("instructions = "); |
| 10122 | q.pp(self.instructions) |
| 10123 | q.breakable() |
| 10124 | q.text('}') |
| 10125 | |
| 10126 | flow_mod.subtypes[0] = flow_add |
| 10127 | |
| 10128 | class flow_delete(flow_mod): |
| 10129 | version = 4 |
| 10130 | type = 14 |
| 10131 | _command = 3 |
| 10132 | |
| 10133 | def __init__(self, xid=None, cookie=None, cookie_mask=None, table_id=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, out_group=None, flags=None, match=None, instructions=None): |
| 10134 | if xid != None: |
| 10135 | self.xid = xid |
| 10136 | else: |
| 10137 | self.xid = None |
| 10138 | if cookie != None: |
| 10139 | self.cookie = cookie |
| 10140 | else: |
| 10141 | self.cookie = 0 |
| 10142 | if cookie_mask != None: |
| 10143 | self.cookie_mask = cookie_mask |
| 10144 | else: |
| 10145 | self.cookie_mask = 0 |
| 10146 | if table_id != None: |
| 10147 | self.table_id = table_id |
| 10148 | else: |
| 10149 | self.table_id = 0 |
| 10150 | if idle_timeout != None: |
| 10151 | self.idle_timeout = idle_timeout |
| 10152 | else: |
| 10153 | self.idle_timeout = 0 |
| 10154 | if hard_timeout != None: |
| 10155 | self.hard_timeout = hard_timeout |
| 10156 | else: |
| 10157 | self.hard_timeout = 0 |
| 10158 | if priority != None: |
| 10159 | self.priority = priority |
| 10160 | else: |
| 10161 | self.priority = 0 |
| 10162 | if buffer_id != None: |
| 10163 | self.buffer_id = buffer_id |
| 10164 | else: |
| 10165 | self.buffer_id = 0 |
| 10166 | if out_port != None: |
| 10167 | self.out_port = out_port |
| 10168 | else: |
| 10169 | self.out_port = 0 |
| 10170 | if out_group != None: |
| 10171 | self.out_group = out_group |
| 10172 | else: |
| 10173 | self.out_group = 0 |
| 10174 | if flags != None: |
| 10175 | self.flags = flags |
| 10176 | else: |
| 10177 | self.flags = 0 |
| 10178 | if match != None: |
| 10179 | self.match = match |
| 10180 | else: |
| 10181 | self.match = ofp.match() |
| 10182 | if instructions != None: |
| 10183 | self.instructions = instructions |
| 10184 | else: |
| 10185 | self.instructions = [] |
| 10186 | return |
| 10187 | |
| 10188 | def pack(self): |
| 10189 | packed = [] |
| 10190 | packed.append(struct.pack("!B", self.version)) |
| 10191 | packed.append(struct.pack("!B", self.type)) |
| 10192 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 10193 | packed.append(struct.pack("!L", self.xid)) |
| 10194 | packed.append(struct.pack("!Q", self.cookie)) |
| 10195 | packed.append(struct.pack("!Q", self.cookie_mask)) |
| 10196 | packed.append(struct.pack("!B", self.table_id)) |
| 10197 | packed.append(util.pack_fm_cmd(self._command)) |
| 10198 | packed.append(struct.pack("!H", self.idle_timeout)) |
| 10199 | packed.append(struct.pack("!H", self.hard_timeout)) |
| 10200 | packed.append(struct.pack("!H", self.priority)) |
| 10201 | packed.append(struct.pack("!L", self.buffer_id)) |
| 10202 | packed.append(util.pack_port_no(self.out_port)) |
| 10203 | packed.append(struct.pack("!L", self.out_group)) |
| 10204 | packed.append(struct.pack("!H", self.flags)) |
| 10205 | packed.append('\x00' * 2) |
| 10206 | packed.append(self.match.pack()) |
| 10207 | packed.append(loxi.generic_util.pack_list(self.instructions)) |
| 10208 | length = sum([len(x) for x in packed]) |
| 10209 | packed[2] = struct.pack("!H", length) |
| 10210 | return ''.join(packed) |
| 10211 | |
| 10212 | @staticmethod |
| 10213 | def unpack(reader): |
| 10214 | obj = flow_delete() |
| 10215 | _version = reader.read("!B")[0] |
| 10216 | assert(_version == 4) |
| 10217 | _type = reader.read("!B")[0] |
| 10218 | assert(_type == 14) |
| 10219 | _length = reader.read("!H")[0] |
| 10220 | orig_reader = reader |
| 10221 | reader = orig_reader.slice(_length, 4) |
| 10222 | obj.xid = reader.read("!L")[0] |
| 10223 | obj.cookie = reader.read("!Q")[0] |
| 10224 | obj.cookie_mask = reader.read("!Q")[0] |
| 10225 | obj.table_id = reader.read("!B")[0] |
| 10226 | __command = util.unpack_fm_cmd(reader) |
| 10227 | assert(__command == 3) |
| 10228 | obj.idle_timeout = reader.read("!H")[0] |
| 10229 | obj.hard_timeout = reader.read("!H")[0] |
| 10230 | obj.priority = reader.read("!H")[0] |
| 10231 | obj.buffer_id = reader.read("!L")[0] |
| 10232 | obj.out_port = util.unpack_port_no(reader) |
| 10233 | obj.out_group = reader.read("!L")[0] |
| 10234 | obj.flags = reader.read("!H")[0] |
| 10235 | reader.skip(2) |
| 10236 | obj.match = ofp.match.unpack(reader) |
| 10237 | obj.instructions = loxi.generic_util.unpack_list(reader, ofp.instruction.instruction.unpack) |
| 10238 | return obj |
| 10239 | |
| 10240 | def __eq__(self, other): |
| 10241 | if type(self) != type(other): return False |
| 10242 | if self.xid != other.xid: return False |
| 10243 | if self.cookie != other.cookie: return False |
| 10244 | if self.cookie_mask != other.cookie_mask: return False |
| 10245 | if self.table_id != other.table_id: return False |
| 10246 | if self.idle_timeout != other.idle_timeout: return False |
| 10247 | if self.hard_timeout != other.hard_timeout: return False |
| 10248 | if self.priority != other.priority: return False |
| 10249 | if self.buffer_id != other.buffer_id: return False |
| 10250 | if self.out_port != other.out_port: return False |
| 10251 | if self.out_group != other.out_group: return False |
| 10252 | if self.flags != other.flags: return False |
| 10253 | if self.match != other.match: return False |
| 10254 | if self.instructions != other.instructions: return False |
| 10255 | return True |
| 10256 | |
| 10257 | def pretty_print(self, q): |
| 10258 | q.text("flow_delete {") |
| 10259 | with q.group(): |
| 10260 | with q.indent(2): |
| 10261 | q.breakable() |
| 10262 | q.text("xid = "); |
| 10263 | if self.xid != None: |
| 10264 | q.text("%#x" % self.xid) |
| 10265 | else: |
| 10266 | q.text('None') |
| 10267 | q.text(","); q.breakable() |
| 10268 | q.text("cookie = "); |
| 10269 | q.text("%#x" % self.cookie) |
| 10270 | q.text(","); q.breakable() |
| 10271 | q.text("cookie_mask = "); |
| 10272 | q.text("%#x" % self.cookie_mask) |
| 10273 | q.text(","); q.breakable() |
| 10274 | q.text("table_id = "); |
| 10275 | q.text("%#x" % self.table_id) |
| 10276 | q.text(","); q.breakable() |
| 10277 | q.text("idle_timeout = "); |
| 10278 | q.text("%#x" % self.idle_timeout) |
| 10279 | q.text(","); q.breakable() |
| 10280 | q.text("hard_timeout = "); |
| 10281 | q.text("%#x" % self.hard_timeout) |
| 10282 | q.text(","); q.breakable() |
| 10283 | q.text("priority = "); |
| 10284 | q.text("%#x" % self.priority) |
| 10285 | q.text(","); q.breakable() |
| 10286 | q.text("buffer_id = "); |
| 10287 | q.text("%#x" % self.buffer_id) |
| 10288 | q.text(","); q.breakable() |
| 10289 | q.text("out_port = "); |
| 10290 | q.text(util.pretty_port(self.out_port)) |
| 10291 | q.text(","); q.breakable() |
| 10292 | q.text("out_group = "); |
| 10293 | q.text("%#x" % self.out_group) |
| 10294 | q.text(","); q.breakable() |
| 10295 | q.text("flags = "); |
| 10296 | q.text("%#x" % self.flags) |
| 10297 | q.text(","); q.breakable() |
| 10298 | q.text("match = "); |
| 10299 | q.pp(self.match) |
| 10300 | q.text(","); q.breakable() |
| 10301 | q.text("instructions = "); |
| 10302 | q.pp(self.instructions) |
| 10303 | q.breakable() |
| 10304 | q.text('}') |
| 10305 | |
| 10306 | flow_mod.subtypes[3] = flow_delete |
| 10307 | |
| 10308 | class flow_delete_strict(flow_mod): |
| 10309 | version = 4 |
| 10310 | type = 14 |
| 10311 | _command = 4 |
| 10312 | |
| 10313 | def __init__(self, xid=None, cookie=None, cookie_mask=None, table_id=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, out_group=None, flags=None, match=None, instructions=None): |
| 10314 | if xid != None: |
| 10315 | self.xid = xid |
| 10316 | else: |
| 10317 | self.xid = None |
| 10318 | if cookie != None: |
| 10319 | self.cookie = cookie |
| 10320 | else: |
| 10321 | self.cookie = 0 |
| 10322 | if cookie_mask != None: |
| 10323 | self.cookie_mask = cookie_mask |
| 10324 | else: |
| 10325 | self.cookie_mask = 0 |
| 10326 | if table_id != None: |
| 10327 | self.table_id = table_id |
| 10328 | else: |
| 10329 | self.table_id = 0 |
| 10330 | if idle_timeout != None: |
| 10331 | self.idle_timeout = idle_timeout |
| 10332 | else: |
| 10333 | self.idle_timeout = 0 |
| 10334 | if hard_timeout != None: |
| 10335 | self.hard_timeout = hard_timeout |
| 10336 | else: |
| 10337 | self.hard_timeout = 0 |
| 10338 | if priority != None: |
| 10339 | self.priority = priority |
| 10340 | else: |
| 10341 | self.priority = 0 |
| 10342 | if buffer_id != None: |
| 10343 | self.buffer_id = buffer_id |
| 10344 | else: |
| 10345 | self.buffer_id = 0 |
| 10346 | if out_port != None: |
| 10347 | self.out_port = out_port |
| 10348 | else: |
| 10349 | self.out_port = 0 |
| 10350 | if out_group != None: |
| 10351 | self.out_group = out_group |
| 10352 | else: |
| 10353 | self.out_group = 0 |
| 10354 | if flags != None: |
| 10355 | self.flags = flags |
| 10356 | else: |
| 10357 | self.flags = 0 |
| 10358 | if match != None: |
| 10359 | self.match = match |
| 10360 | else: |
| 10361 | self.match = ofp.match() |
| 10362 | if instructions != None: |
| 10363 | self.instructions = instructions |
| 10364 | else: |
| 10365 | self.instructions = [] |
| 10366 | return |
| 10367 | |
| 10368 | def pack(self): |
| 10369 | packed = [] |
| 10370 | packed.append(struct.pack("!B", self.version)) |
| 10371 | packed.append(struct.pack("!B", self.type)) |
| 10372 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 10373 | packed.append(struct.pack("!L", self.xid)) |
| 10374 | packed.append(struct.pack("!Q", self.cookie)) |
| 10375 | packed.append(struct.pack("!Q", self.cookie_mask)) |
| 10376 | packed.append(struct.pack("!B", self.table_id)) |
| 10377 | packed.append(util.pack_fm_cmd(self._command)) |
| 10378 | packed.append(struct.pack("!H", self.idle_timeout)) |
| 10379 | packed.append(struct.pack("!H", self.hard_timeout)) |
| 10380 | packed.append(struct.pack("!H", self.priority)) |
| 10381 | packed.append(struct.pack("!L", self.buffer_id)) |
| 10382 | packed.append(util.pack_port_no(self.out_port)) |
| 10383 | packed.append(struct.pack("!L", self.out_group)) |
| 10384 | packed.append(struct.pack("!H", self.flags)) |
| 10385 | packed.append('\x00' * 2) |
| 10386 | packed.append(self.match.pack()) |
| 10387 | packed.append(loxi.generic_util.pack_list(self.instructions)) |
| 10388 | length = sum([len(x) for x in packed]) |
| 10389 | packed[2] = struct.pack("!H", length) |
| 10390 | return ''.join(packed) |
| 10391 | |
| 10392 | @staticmethod |
| 10393 | def unpack(reader): |
| 10394 | obj = flow_delete_strict() |
| 10395 | _version = reader.read("!B")[0] |
| 10396 | assert(_version == 4) |
| 10397 | _type = reader.read("!B")[0] |
| 10398 | assert(_type == 14) |
| 10399 | _length = reader.read("!H")[0] |
| 10400 | orig_reader = reader |
| 10401 | reader = orig_reader.slice(_length, 4) |
| 10402 | obj.xid = reader.read("!L")[0] |
| 10403 | obj.cookie = reader.read("!Q")[0] |
| 10404 | obj.cookie_mask = reader.read("!Q")[0] |
| 10405 | obj.table_id = reader.read("!B")[0] |
| 10406 | __command = util.unpack_fm_cmd(reader) |
| 10407 | assert(__command == 4) |
| 10408 | obj.idle_timeout = reader.read("!H")[0] |
| 10409 | obj.hard_timeout = reader.read("!H")[0] |
| 10410 | obj.priority = reader.read("!H")[0] |
| 10411 | obj.buffer_id = reader.read("!L")[0] |
| 10412 | obj.out_port = util.unpack_port_no(reader) |
| 10413 | obj.out_group = reader.read("!L")[0] |
| 10414 | obj.flags = reader.read("!H")[0] |
| 10415 | reader.skip(2) |
| 10416 | obj.match = ofp.match.unpack(reader) |
| 10417 | obj.instructions = loxi.generic_util.unpack_list(reader, ofp.instruction.instruction.unpack) |
| 10418 | return obj |
| 10419 | |
| 10420 | def __eq__(self, other): |
| 10421 | if type(self) != type(other): return False |
| 10422 | if self.xid != other.xid: return False |
| 10423 | if self.cookie != other.cookie: return False |
| 10424 | if self.cookie_mask != other.cookie_mask: return False |
| 10425 | if self.table_id != other.table_id: return False |
| 10426 | if self.idle_timeout != other.idle_timeout: return False |
| 10427 | if self.hard_timeout != other.hard_timeout: return False |
| 10428 | if self.priority != other.priority: return False |
| 10429 | if self.buffer_id != other.buffer_id: return False |
| 10430 | if self.out_port != other.out_port: return False |
| 10431 | if self.out_group != other.out_group: return False |
| 10432 | if self.flags != other.flags: return False |
| 10433 | if self.match != other.match: return False |
| 10434 | if self.instructions != other.instructions: return False |
| 10435 | return True |
| 10436 | |
| 10437 | def pretty_print(self, q): |
| 10438 | q.text("flow_delete_strict {") |
| 10439 | with q.group(): |
| 10440 | with q.indent(2): |
| 10441 | q.breakable() |
| 10442 | q.text("xid = "); |
| 10443 | if self.xid != None: |
| 10444 | q.text("%#x" % self.xid) |
| 10445 | else: |
| 10446 | q.text('None') |
| 10447 | q.text(","); q.breakable() |
| 10448 | q.text("cookie = "); |
| 10449 | q.text("%#x" % self.cookie) |
| 10450 | q.text(","); q.breakable() |
| 10451 | q.text("cookie_mask = "); |
| 10452 | q.text("%#x" % self.cookie_mask) |
| 10453 | q.text(","); q.breakable() |
| 10454 | q.text("table_id = "); |
| 10455 | q.text("%#x" % self.table_id) |
| 10456 | q.text(","); q.breakable() |
| 10457 | q.text("idle_timeout = "); |
| 10458 | q.text("%#x" % self.idle_timeout) |
| 10459 | q.text(","); q.breakable() |
| 10460 | q.text("hard_timeout = "); |
| 10461 | q.text("%#x" % self.hard_timeout) |
| 10462 | q.text(","); q.breakable() |
| 10463 | q.text("priority = "); |
| 10464 | q.text("%#x" % self.priority) |
| 10465 | q.text(","); q.breakable() |
| 10466 | q.text("buffer_id = "); |
| 10467 | q.text("%#x" % self.buffer_id) |
| 10468 | q.text(","); q.breakable() |
| 10469 | q.text("out_port = "); |
| 10470 | q.text(util.pretty_port(self.out_port)) |
| 10471 | q.text(","); q.breakable() |
| 10472 | q.text("out_group = "); |
| 10473 | q.text("%#x" % self.out_group) |
| 10474 | q.text(","); q.breakable() |
| 10475 | q.text("flags = "); |
| 10476 | q.text("%#x" % self.flags) |
| 10477 | q.text(","); q.breakable() |
| 10478 | q.text("match = "); |
| 10479 | q.pp(self.match) |
| 10480 | q.text(","); q.breakable() |
| 10481 | q.text("instructions = "); |
| 10482 | q.pp(self.instructions) |
| 10483 | q.breakable() |
| 10484 | q.text('}') |
| 10485 | |
| 10486 | flow_mod.subtypes[4] = flow_delete_strict |
| 10487 | |
| 10488 | class flow_mod_failed_error_msg(error_msg): |
| 10489 | version = 4 |
| 10490 | type = 1 |
| 10491 | err_type = 5 |
| 10492 | |
| 10493 | def __init__(self, xid=None, code=None, data=None): |
| 10494 | if xid != None: |
| 10495 | self.xid = xid |
| 10496 | else: |
| 10497 | self.xid = None |
| 10498 | if code != None: |
| 10499 | self.code = code |
| 10500 | else: |
| 10501 | self.code = 0 |
| 10502 | if data != None: |
| 10503 | self.data = data |
| 10504 | else: |
| 10505 | self.data = '' |
| 10506 | return |
| 10507 | |
| 10508 | def pack(self): |
| 10509 | packed = [] |
| 10510 | packed.append(struct.pack("!B", self.version)) |
| 10511 | packed.append(struct.pack("!B", self.type)) |
| 10512 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 10513 | packed.append(struct.pack("!L", self.xid)) |
| 10514 | packed.append(struct.pack("!H", self.err_type)) |
| 10515 | packed.append(struct.pack("!H", self.code)) |
| 10516 | packed.append(self.data) |
| 10517 | length = sum([len(x) for x in packed]) |
| 10518 | packed[2] = struct.pack("!H", length) |
| 10519 | return ''.join(packed) |
| 10520 | |
| 10521 | @staticmethod |
| 10522 | def unpack(reader): |
| 10523 | obj = flow_mod_failed_error_msg() |
| 10524 | _version = reader.read("!B")[0] |
| 10525 | assert(_version == 4) |
| 10526 | _type = reader.read("!B")[0] |
| 10527 | assert(_type == 1) |
| 10528 | _length = reader.read("!H")[0] |
| 10529 | orig_reader = reader |
| 10530 | reader = orig_reader.slice(_length, 4) |
| 10531 | obj.xid = reader.read("!L")[0] |
| 10532 | _err_type = reader.read("!H")[0] |
| 10533 | assert(_err_type == 5) |
| 10534 | obj.code = reader.read("!H")[0] |
| 10535 | obj.data = str(reader.read_all()) |
| 10536 | return obj |
| 10537 | |
| 10538 | def __eq__(self, other): |
| 10539 | if type(self) != type(other): return False |
| 10540 | if self.xid != other.xid: return False |
| 10541 | if self.code != other.code: return False |
| 10542 | if self.data != other.data: return False |
| 10543 | return True |
| 10544 | |
| 10545 | def pretty_print(self, q): |
| 10546 | q.text("flow_mod_failed_error_msg {") |
| 10547 | with q.group(): |
| 10548 | with q.indent(2): |
| 10549 | q.breakable() |
| 10550 | q.text("xid = "); |
| 10551 | if self.xid != None: |
| 10552 | q.text("%#x" % self.xid) |
| 10553 | else: |
| 10554 | q.text('None') |
| 10555 | q.text(","); q.breakable() |
| 10556 | q.text("code = "); |
| 10557 | q.text("%#x" % self.code) |
| 10558 | q.text(","); q.breakable() |
| 10559 | q.text("data = "); |
| 10560 | q.pp(self.data) |
| 10561 | q.breakable() |
| 10562 | q.text('}') |
| 10563 | |
| 10564 | error_msg.subtypes[5] = flow_mod_failed_error_msg |
| 10565 | |
| 10566 | class flow_modify(flow_mod): |
| 10567 | version = 4 |
| 10568 | type = 14 |
| 10569 | _command = 1 |
| 10570 | |
| 10571 | def __init__(self, xid=None, cookie=None, cookie_mask=None, table_id=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, out_group=None, flags=None, match=None, instructions=None): |
| 10572 | if xid != None: |
| 10573 | self.xid = xid |
| 10574 | else: |
| 10575 | self.xid = None |
| 10576 | if cookie != None: |
| 10577 | self.cookie = cookie |
| 10578 | else: |
| 10579 | self.cookie = 0 |
| 10580 | if cookie_mask != None: |
| 10581 | self.cookie_mask = cookie_mask |
| 10582 | else: |
| 10583 | self.cookie_mask = 0 |
| 10584 | if table_id != None: |
| 10585 | self.table_id = table_id |
| 10586 | else: |
| 10587 | self.table_id = 0 |
| 10588 | if idle_timeout != None: |
| 10589 | self.idle_timeout = idle_timeout |
| 10590 | else: |
| 10591 | self.idle_timeout = 0 |
| 10592 | if hard_timeout != None: |
| 10593 | self.hard_timeout = hard_timeout |
| 10594 | else: |
| 10595 | self.hard_timeout = 0 |
| 10596 | if priority != None: |
| 10597 | self.priority = priority |
| 10598 | else: |
| 10599 | self.priority = 0 |
| 10600 | if buffer_id != None: |
| 10601 | self.buffer_id = buffer_id |
| 10602 | else: |
| 10603 | self.buffer_id = 0 |
| 10604 | if out_port != None: |
| 10605 | self.out_port = out_port |
| 10606 | else: |
| 10607 | self.out_port = 0 |
| 10608 | if out_group != None: |
| 10609 | self.out_group = out_group |
| 10610 | else: |
| 10611 | self.out_group = 0 |
| 10612 | if flags != None: |
| 10613 | self.flags = flags |
| 10614 | else: |
| 10615 | self.flags = 0 |
| 10616 | if match != None: |
| 10617 | self.match = match |
| 10618 | else: |
| 10619 | self.match = ofp.match() |
| 10620 | if instructions != None: |
| 10621 | self.instructions = instructions |
| 10622 | else: |
| 10623 | self.instructions = [] |
| 10624 | return |
| 10625 | |
| 10626 | def pack(self): |
| 10627 | packed = [] |
| 10628 | packed.append(struct.pack("!B", self.version)) |
| 10629 | packed.append(struct.pack("!B", self.type)) |
| 10630 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 10631 | packed.append(struct.pack("!L", self.xid)) |
| 10632 | packed.append(struct.pack("!Q", self.cookie)) |
| 10633 | packed.append(struct.pack("!Q", self.cookie_mask)) |
| 10634 | packed.append(struct.pack("!B", self.table_id)) |
| 10635 | packed.append(util.pack_fm_cmd(self._command)) |
| 10636 | packed.append(struct.pack("!H", self.idle_timeout)) |
| 10637 | packed.append(struct.pack("!H", self.hard_timeout)) |
| 10638 | packed.append(struct.pack("!H", self.priority)) |
| 10639 | packed.append(struct.pack("!L", self.buffer_id)) |
| 10640 | packed.append(util.pack_port_no(self.out_port)) |
| 10641 | packed.append(struct.pack("!L", self.out_group)) |
| 10642 | packed.append(struct.pack("!H", self.flags)) |
| 10643 | packed.append('\x00' * 2) |
| 10644 | packed.append(self.match.pack()) |
| 10645 | packed.append(loxi.generic_util.pack_list(self.instructions)) |
| 10646 | length = sum([len(x) for x in packed]) |
| 10647 | packed[2] = struct.pack("!H", length) |
| 10648 | return ''.join(packed) |
| 10649 | |
| 10650 | @staticmethod |
| 10651 | def unpack(reader): |
| 10652 | obj = flow_modify() |
| 10653 | _version = reader.read("!B")[0] |
| 10654 | assert(_version == 4) |
| 10655 | _type = reader.read("!B")[0] |
| 10656 | assert(_type == 14) |
| 10657 | _length = reader.read("!H")[0] |
| 10658 | orig_reader = reader |
| 10659 | reader = orig_reader.slice(_length, 4) |
| 10660 | obj.xid = reader.read("!L")[0] |
| 10661 | obj.cookie = reader.read("!Q")[0] |
| 10662 | obj.cookie_mask = reader.read("!Q")[0] |
| 10663 | obj.table_id = reader.read("!B")[0] |
| 10664 | __command = util.unpack_fm_cmd(reader) |
| 10665 | assert(__command == 1) |
| 10666 | obj.idle_timeout = reader.read("!H")[0] |
| 10667 | obj.hard_timeout = reader.read("!H")[0] |
| 10668 | obj.priority = reader.read("!H")[0] |
| 10669 | obj.buffer_id = reader.read("!L")[0] |
| 10670 | obj.out_port = util.unpack_port_no(reader) |
| 10671 | obj.out_group = reader.read("!L")[0] |
| 10672 | obj.flags = reader.read("!H")[0] |
| 10673 | reader.skip(2) |
| 10674 | obj.match = ofp.match.unpack(reader) |
| 10675 | obj.instructions = loxi.generic_util.unpack_list(reader, ofp.instruction.instruction.unpack) |
| 10676 | return obj |
| 10677 | |
| 10678 | def __eq__(self, other): |
| 10679 | if type(self) != type(other): return False |
| 10680 | if self.xid != other.xid: return False |
| 10681 | if self.cookie != other.cookie: return False |
| 10682 | if self.cookie_mask != other.cookie_mask: return False |
| 10683 | if self.table_id != other.table_id: return False |
| 10684 | if self.idle_timeout != other.idle_timeout: return False |
| 10685 | if self.hard_timeout != other.hard_timeout: return False |
| 10686 | if self.priority != other.priority: return False |
| 10687 | if self.buffer_id != other.buffer_id: return False |
| 10688 | if self.out_port != other.out_port: return False |
| 10689 | if self.out_group != other.out_group: return False |
| 10690 | if self.flags != other.flags: return False |
| 10691 | if self.match != other.match: return False |
| 10692 | if self.instructions != other.instructions: return False |
| 10693 | return True |
| 10694 | |
| 10695 | def pretty_print(self, q): |
| 10696 | q.text("flow_modify {") |
| 10697 | with q.group(): |
| 10698 | with q.indent(2): |
| 10699 | q.breakable() |
| 10700 | q.text("xid = "); |
| 10701 | if self.xid != None: |
| 10702 | q.text("%#x" % self.xid) |
| 10703 | else: |
| 10704 | q.text('None') |
| 10705 | q.text(","); q.breakable() |
| 10706 | q.text("cookie = "); |
| 10707 | q.text("%#x" % self.cookie) |
| 10708 | q.text(","); q.breakable() |
| 10709 | q.text("cookie_mask = "); |
| 10710 | q.text("%#x" % self.cookie_mask) |
| 10711 | q.text(","); q.breakable() |
| 10712 | q.text("table_id = "); |
| 10713 | q.text("%#x" % self.table_id) |
| 10714 | q.text(","); q.breakable() |
| 10715 | q.text("idle_timeout = "); |
| 10716 | q.text("%#x" % self.idle_timeout) |
| 10717 | q.text(","); q.breakable() |
| 10718 | q.text("hard_timeout = "); |
| 10719 | q.text("%#x" % self.hard_timeout) |
| 10720 | q.text(","); q.breakable() |
| 10721 | q.text("priority = "); |
| 10722 | q.text("%#x" % self.priority) |
| 10723 | q.text(","); q.breakable() |
| 10724 | q.text("buffer_id = "); |
| 10725 | q.text("%#x" % self.buffer_id) |
| 10726 | q.text(","); q.breakable() |
| 10727 | q.text("out_port = "); |
| 10728 | q.text(util.pretty_port(self.out_port)) |
| 10729 | q.text(","); q.breakable() |
| 10730 | q.text("out_group = "); |
| 10731 | q.text("%#x" % self.out_group) |
| 10732 | q.text(","); q.breakable() |
| 10733 | q.text("flags = "); |
| 10734 | q.text("%#x" % self.flags) |
| 10735 | q.text(","); q.breakable() |
| 10736 | q.text("match = "); |
| 10737 | q.pp(self.match) |
| 10738 | q.text(","); q.breakable() |
| 10739 | q.text("instructions = "); |
| 10740 | q.pp(self.instructions) |
| 10741 | q.breakable() |
| 10742 | q.text('}') |
| 10743 | |
| 10744 | flow_mod.subtypes[1] = flow_modify |
| 10745 | |
| 10746 | class flow_modify_strict(flow_mod): |
| 10747 | version = 4 |
| 10748 | type = 14 |
| 10749 | _command = 2 |
| 10750 | |
| 10751 | def __init__(self, xid=None, cookie=None, cookie_mask=None, table_id=None, idle_timeout=None, hard_timeout=None, priority=None, buffer_id=None, out_port=None, out_group=None, flags=None, match=None, instructions=None): |
| 10752 | if xid != None: |
| 10753 | self.xid = xid |
| 10754 | else: |
| 10755 | self.xid = None |
| 10756 | if cookie != None: |
| 10757 | self.cookie = cookie |
| 10758 | else: |
| 10759 | self.cookie = 0 |
| 10760 | if cookie_mask != None: |
| 10761 | self.cookie_mask = cookie_mask |
| 10762 | else: |
| 10763 | self.cookie_mask = 0 |
| 10764 | if table_id != None: |
| 10765 | self.table_id = table_id |
| 10766 | else: |
| 10767 | self.table_id = 0 |
| 10768 | if idle_timeout != None: |
| 10769 | self.idle_timeout = idle_timeout |
| 10770 | else: |
| 10771 | self.idle_timeout = 0 |
| 10772 | if hard_timeout != None: |
| 10773 | self.hard_timeout = hard_timeout |
| 10774 | else: |
| 10775 | self.hard_timeout = 0 |
| 10776 | if priority != None: |
| 10777 | self.priority = priority |
| 10778 | else: |
| 10779 | self.priority = 0 |
| 10780 | if buffer_id != None: |
| 10781 | self.buffer_id = buffer_id |
| 10782 | else: |
| 10783 | self.buffer_id = 0 |
| 10784 | if out_port != None: |
| 10785 | self.out_port = out_port |
| 10786 | else: |
| 10787 | self.out_port = 0 |
| 10788 | if out_group != None: |
| 10789 | self.out_group = out_group |
| 10790 | else: |
| 10791 | self.out_group = 0 |
| 10792 | if flags != None: |
| 10793 | self.flags = flags |
| 10794 | else: |
| 10795 | self.flags = 0 |
| 10796 | if match != None: |
| 10797 | self.match = match |
| 10798 | else: |
| 10799 | self.match = ofp.match() |
| 10800 | if instructions != None: |
| 10801 | self.instructions = instructions |
| 10802 | else: |
| 10803 | self.instructions = [] |
| 10804 | return |
| 10805 | |
| 10806 | def pack(self): |
| 10807 | packed = [] |
| 10808 | packed.append(struct.pack("!B", self.version)) |
| 10809 | packed.append(struct.pack("!B", self.type)) |
| 10810 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 10811 | packed.append(struct.pack("!L", self.xid)) |
| 10812 | packed.append(struct.pack("!Q", self.cookie)) |
| 10813 | packed.append(struct.pack("!Q", self.cookie_mask)) |
| 10814 | packed.append(struct.pack("!B", self.table_id)) |
| 10815 | packed.append(util.pack_fm_cmd(self._command)) |
| 10816 | packed.append(struct.pack("!H", self.idle_timeout)) |
| 10817 | packed.append(struct.pack("!H", self.hard_timeout)) |
| 10818 | packed.append(struct.pack("!H", self.priority)) |
| 10819 | packed.append(struct.pack("!L", self.buffer_id)) |
| 10820 | packed.append(util.pack_port_no(self.out_port)) |
| 10821 | packed.append(struct.pack("!L", self.out_group)) |
| 10822 | packed.append(struct.pack("!H", self.flags)) |
| 10823 | packed.append('\x00' * 2) |
| 10824 | packed.append(self.match.pack()) |
| 10825 | packed.append(loxi.generic_util.pack_list(self.instructions)) |
| 10826 | length = sum([len(x) for x in packed]) |
| 10827 | packed[2] = struct.pack("!H", length) |
| 10828 | return ''.join(packed) |
| 10829 | |
| 10830 | @staticmethod |
| 10831 | def unpack(reader): |
| 10832 | obj = flow_modify_strict() |
| 10833 | _version = reader.read("!B")[0] |
| 10834 | assert(_version == 4) |
| 10835 | _type = reader.read("!B")[0] |
| 10836 | assert(_type == 14) |
| 10837 | _length = reader.read("!H")[0] |
| 10838 | orig_reader = reader |
| 10839 | reader = orig_reader.slice(_length, 4) |
| 10840 | obj.xid = reader.read("!L")[0] |
| 10841 | obj.cookie = reader.read("!Q")[0] |
| 10842 | obj.cookie_mask = reader.read("!Q")[0] |
| 10843 | obj.table_id = reader.read("!B")[0] |
| 10844 | __command = util.unpack_fm_cmd(reader) |
| 10845 | assert(__command == 2) |
| 10846 | obj.idle_timeout = reader.read("!H")[0] |
| 10847 | obj.hard_timeout = reader.read("!H")[0] |
| 10848 | obj.priority = reader.read("!H")[0] |
| 10849 | obj.buffer_id = reader.read("!L")[0] |
| 10850 | obj.out_port = util.unpack_port_no(reader) |
| 10851 | obj.out_group = reader.read("!L")[0] |
| 10852 | obj.flags = reader.read("!H")[0] |
| 10853 | reader.skip(2) |
| 10854 | obj.match = ofp.match.unpack(reader) |
| 10855 | obj.instructions = loxi.generic_util.unpack_list(reader, ofp.instruction.instruction.unpack) |
| 10856 | return obj |
| 10857 | |
| 10858 | def __eq__(self, other): |
| 10859 | if type(self) != type(other): return False |
| 10860 | if self.xid != other.xid: return False |
| 10861 | if self.cookie != other.cookie: return False |
| 10862 | if self.cookie_mask != other.cookie_mask: return False |
| 10863 | if self.table_id != other.table_id: return False |
| 10864 | if self.idle_timeout != other.idle_timeout: return False |
| 10865 | if self.hard_timeout != other.hard_timeout: return False |
| 10866 | if self.priority != other.priority: return False |
| 10867 | if self.buffer_id != other.buffer_id: return False |
| 10868 | if self.out_port != other.out_port: return False |
| 10869 | if self.out_group != other.out_group: return False |
| 10870 | if self.flags != other.flags: return False |
| 10871 | if self.match != other.match: return False |
| 10872 | if self.instructions != other.instructions: return False |
| 10873 | return True |
| 10874 | |
| 10875 | def pretty_print(self, q): |
| 10876 | q.text("flow_modify_strict {") |
| 10877 | with q.group(): |
| 10878 | with q.indent(2): |
| 10879 | q.breakable() |
| 10880 | q.text("xid = "); |
| 10881 | if self.xid != None: |
| 10882 | q.text("%#x" % self.xid) |
| 10883 | else: |
| 10884 | q.text('None') |
| 10885 | q.text(","); q.breakable() |
| 10886 | q.text("cookie = "); |
| 10887 | q.text("%#x" % self.cookie) |
| 10888 | q.text(","); q.breakable() |
| 10889 | q.text("cookie_mask = "); |
| 10890 | q.text("%#x" % self.cookie_mask) |
| 10891 | q.text(","); q.breakable() |
| 10892 | q.text("table_id = "); |
| 10893 | q.text("%#x" % self.table_id) |
| 10894 | q.text(","); q.breakable() |
| 10895 | q.text("idle_timeout = "); |
| 10896 | q.text("%#x" % self.idle_timeout) |
| 10897 | q.text(","); q.breakable() |
| 10898 | q.text("hard_timeout = "); |
| 10899 | q.text("%#x" % self.hard_timeout) |
| 10900 | q.text(","); q.breakable() |
| 10901 | q.text("priority = "); |
| 10902 | q.text("%#x" % self.priority) |
| 10903 | q.text(","); q.breakable() |
| 10904 | q.text("buffer_id = "); |
| 10905 | q.text("%#x" % self.buffer_id) |
| 10906 | q.text(","); q.breakable() |
| 10907 | q.text("out_port = "); |
| 10908 | q.text(util.pretty_port(self.out_port)) |
| 10909 | q.text(","); q.breakable() |
| 10910 | q.text("out_group = "); |
| 10911 | q.text("%#x" % self.out_group) |
| 10912 | q.text(","); q.breakable() |
| 10913 | q.text("flags = "); |
| 10914 | q.text("%#x" % self.flags) |
| 10915 | q.text(","); q.breakable() |
| 10916 | q.text("match = "); |
| 10917 | q.pp(self.match) |
| 10918 | q.text(","); q.breakable() |
| 10919 | q.text("instructions = "); |
| 10920 | q.pp(self.instructions) |
| 10921 | q.breakable() |
| 10922 | q.text('}') |
| 10923 | |
| 10924 | flow_mod.subtypes[2] = flow_modify_strict |
| 10925 | |
| 10926 | class flow_removed(message): |
| 10927 | version = 4 |
| 10928 | type = 11 |
| 10929 | |
| 10930 | def __init__(self, xid=None, cookie=None, priority=None, reason=None, table_id=None, duration_sec=None, duration_nsec=None, idle_timeout=None, hard_timeout=None, packet_count=None, byte_count=None, match=None): |
| 10931 | if xid != None: |
| 10932 | self.xid = xid |
| 10933 | else: |
| 10934 | self.xid = None |
| 10935 | if cookie != None: |
| 10936 | self.cookie = cookie |
| 10937 | else: |
| 10938 | self.cookie = 0 |
| 10939 | if priority != None: |
| 10940 | self.priority = priority |
| 10941 | else: |
| 10942 | self.priority = 0 |
| 10943 | if reason != None: |
| 10944 | self.reason = reason |
| 10945 | else: |
| 10946 | self.reason = 0 |
| 10947 | if table_id != None: |
| 10948 | self.table_id = table_id |
| 10949 | else: |
| 10950 | self.table_id = 0 |
| 10951 | if duration_sec != None: |
| 10952 | self.duration_sec = duration_sec |
| 10953 | else: |
| 10954 | self.duration_sec = 0 |
| 10955 | if duration_nsec != None: |
| 10956 | self.duration_nsec = duration_nsec |
| 10957 | else: |
| 10958 | self.duration_nsec = 0 |
| 10959 | if idle_timeout != None: |
| 10960 | self.idle_timeout = idle_timeout |
| 10961 | else: |
| 10962 | self.idle_timeout = 0 |
| 10963 | if hard_timeout != None: |
| 10964 | self.hard_timeout = hard_timeout |
| 10965 | else: |
| 10966 | self.hard_timeout = 0 |
| 10967 | if packet_count != None: |
| 10968 | self.packet_count = packet_count |
| 10969 | else: |
| 10970 | self.packet_count = 0 |
| 10971 | if byte_count != None: |
| 10972 | self.byte_count = byte_count |
| 10973 | else: |
| 10974 | self.byte_count = 0 |
| 10975 | if match != None: |
| 10976 | self.match = match |
| 10977 | else: |
| 10978 | self.match = ofp.match() |
| 10979 | return |
| 10980 | |
| 10981 | def pack(self): |
| 10982 | packed = [] |
| 10983 | packed.append(struct.pack("!B", self.version)) |
| 10984 | packed.append(struct.pack("!B", self.type)) |
| 10985 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 10986 | packed.append(struct.pack("!L", self.xid)) |
| 10987 | packed.append(struct.pack("!Q", self.cookie)) |
| 10988 | packed.append(struct.pack("!H", self.priority)) |
| 10989 | packed.append(struct.pack("!B", self.reason)) |
| 10990 | packed.append(struct.pack("!B", self.table_id)) |
| 10991 | packed.append(struct.pack("!L", self.duration_sec)) |
| 10992 | packed.append(struct.pack("!L", self.duration_nsec)) |
| 10993 | packed.append(struct.pack("!H", self.idle_timeout)) |
| 10994 | packed.append(struct.pack("!H", self.hard_timeout)) |
| 10995 | packed.append(struct.pack("!Q", self.packet_count)) |
| 10996 | packed.append(struct.pack("!Q", self.byte_count)) |
| 10997 | packed.append(self.match.pack()) |
| 10998 | length = sum([len(x) for x in packed]) |
| 10999 | packed[2] = struct.pack("!H", length) |
| 11000 | return ''.join(packed) |
| 11001 | |
| 11002 | @staticmethod |
| 11003 | def unpack(reader): |
| 11004 | obj = flow_removed() |
| 11005 | _version = reader.read("!B")[0] |
| 11006 | assert(_version == 4) |
| 11007 | _type = reader.read("!B")[0] |
| 11008 | assert(_type == 11) |
| 11009 | _length = reader.read("!H")[0] |
| 11010 | orig_reader = reader |
| 11011 | reader = orig_reader.slice(_length, 4) |
| 11012 | obj.xid = reader.read("!L")[0] |
| 11013 | obj.cookie = reader.read("!Q")[0] |
| 11014 | obj.priority = reader.read("!H")[0] |
| 11015 | obj.reason = reader.read("!B")[0] |
| 11016 | obj.table_id = reader.read("!B")[0] |
| 11017 | obj.duration_sec = reader.read("!L")[0] |
| 11018 | obj.duration_nsec = reader.read("!L")[0] |
| 11019 | obj.idle_timeout = reader.read("!H")[0] |
| 11020 | obj.hard_timeout = reader.read("!H")[0] |
| 11021 | obj.packet_count = reader.read("!Q")[0] |
| 11022 | obj.byte_count = reader.read("!Q")[0] |
| 11023 | obj.match = ofp.match.unpack(reader) |
| 11024 | return obj |
| 11025 | |
| 11026 | def __eq__(self, other): |
| 11027 | if type(self) != type(other): return False |
| 11028 | if self.xid != other.xid: return False |
| 11029 | if self.cookie != other.cookie: return False |
| 11030 | if self.priority != other.priority: return False |
| 11031 | if self.reason != other.reason: return False |
| 11032 | if self.table_id != other.table_id: return False |
| 11033 | if self.duration_sec != other.duration_sec: return False |
| 11034 | if self.duration_nsec != other.duration_nsec: return False |
| 11035 | if self.idle_timeout != other.idle_timeout: return False |
| 11036 | if self.hard_timeout != other.hard_timeout: return False |
| 11037 | if self.packet_count != other.packet_count: return False |
| 11038 | if self.byte_count != other.byte_count: return False |
| 11039 | if self.match != other.match: return False |
| 11040 | return True |
| 11041 | |
| 11042 | def pretty_print(self, q): |
| 11043 | q.text("flow_removed {") |
| 11044 | with q.group(): |
| 11045 | with q.indent(2): |
| 11046 | q.breakable() |
| 11047 | q.text("xid = "); |
| 11048 | if self.xid != None: |
| 11049 | q.text("%#x" % self.xid) |
| 11050 | else: |
| 11051 | q.text('None') |
| 11052 | q.text(","); q.breakable() |
| 11053 | q.text("cookie = "); |
| 11054 | q.text("%#x" % self.cookie) |
| 11055 | q.text(","); q.breakable() |
| 11056 | q.text("priority = "); |
| 11057 | q.text("%#x" % self.priority) |
| 11058 | q.text(","); q.breakable() |
| 11059 | q.text("reason = "); |
| 11060 | q.text("%#x" % self.reason) |
| 11061 | q.text(","); q.breakable() |
| 11062 | q.text("table_id = "); |
| 11063 | q.text("%#x" % self.table_id) |
| 11064 | q.text(","); q.breakable() |
| 11065 | q.text("duration_sec = "); |
| 11066 | q.text("%#x" % self.duration_sec) |
| 11067 | q.text(","); q.breakable() |
| 11068 | q.text("duration_nsec = "); |
| 11069 | q.text("%#x" % self.duration_nsec) |
| 11070 | q.text(","); q.breakable() |
| 11071 | q.text("idle_timeout = "); |
| 11072 | q.text("%#x" % self.idle_timeout) |
| 11073 | q.text(","); q.breakable() |
| 11074 | q.text("hard_timeout = "); |
| 11075 | q.text("%#x" % self.hard_timeout) |
| 11076 | q.text(","); q.breakable() |
| 11077 | q.text("packet_count = "); |
| 11078 | q.text("%#x" % self.packet_count) |
| 11079 | q.text(","); q.breakable() |
| 11080 | q.text("byte_count = "); |
| 11081 | q.text("%#x" % self.byte_count) |
| 11082 | q.text(","); q.breakable() |
| 11083 | q.text("match = "); |
| 11084 | q.pp(self.match) |
| 11085 | q.breakable() |
| 11086 | q.text('}') |
| 11087 | |
| 11088 | message.subtypes[11] = flow_removed |
| 11089 | |
| 11090 | class flow_stats_reply(stats_reply): |
| 11091 | version = 4 |
| 11092 | type = 19 |
| 11093 | stats_type = 1 |
| 11094 | |
| 11095 | def __init__(self, xid=None, flags=None, entries=None): |
| 11096 | if xid != None: |
| 11097 | self.xid = xid |
| 11098 | else: |
| 11099 | self.xid = None |
| 11100 | if flags != None: |
| 11101 | self.flags = flags |
| 11102 | else: |
| 11103 | self.flags = 0 |
| 11104 | if entries != None: |
| 11105 | self.entries = entries |
| 11106 | else: |
| 11107 | self.entries = [] |
| 11108 | return |
| 11109 | |
| 11110 | def pack(self): |
| 11111 | packed = [] |
| 11112 | packed.append(struct.pack("!B", self.version)) |
| 11113 | packed.append(struct.pack("!B", self.type)) |
| 11114 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 11115 | packed.append(struct.pack("!L", self.xid)) |
| 11116 | packed.append(struct.pack("!H", self.stats_type)) |
| 11117 | packed.append(struct.pack("!H", self.flags)) |
| 11118 | packed.append('\x00' * 4) |
| 11119 | packed.append(loxi.generic_util.pack_list(self.entries)) |
| 11120 | length = sum([len(x) for x in packed]) |
| 11121 | packed[2] = struct.pack("!H", length) |
| 11122 | return ''.join(packed) |
| 11123 | |
| 11124 | @staticmethod |
| 11125 | def unpack(reader): |
| 11126 | obj = flow_stats_reply() |
| 11127 | _version = reader.read("!B")[0] |
| 11128 | assert(_version == 4) |
| 11129 | _type = reader.read("!B")[0] |
| 11130 | assert(_type == 19) |
| 11131 | _length = reader.read("!H")[0] |
| 11132 | orig_reader = reader |
| 11133 | reader = orig_reader.slice(_length, 4) |
| 11134 | obj.xid = reader.read("!L")[0] |
| 11135 | _stats_type = reader.read("!H")[0] |
| 11136 | assert(_stats_type == 1) |
| 11137 | obj.flags = reader.read("!H")[0] |
| 11138 | reader.skip(4) |
| 11139 | obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.flow_stats_entry.unpack) |
| 11140 | return obj |
| 11141 | |
| 11142 | def __eq__(self, other): |
| 11143 | if type(self) != type(other): return False |
| 11144 | if self.xid != other.xid: return False |
| 11145 | if self.flags != other.flags: return False |
| 11146 | if self.entries != other.entries: return False |
| 11147 | return True |
| 11148 | |
| 11149 | def pretty_print(self, q): |
| 11150 | q.text("flow_stats_reply {") |
| 11151 | with q.group(): |
| 11152 | with q.indent(2): |
| 11153 | q.breakable() |
| 11154 | q.text("xid = "); |
| 11155 | if self.xid != None: |
| 11156 | q.text("%#x" % self.xid) |
| 11157 | else: |
| 11158 | q.text('None') |
| 11159 | q.text(","); q.breakable() |
| 11160 | q.text("flags = "); |
| 11161 | q.text("%#x" % self.flags) |
| 11162 | q.text(","); q.breakable() |
| 11163 | q.text("entries = "); |
| 11164 | q.pp(self.entries) |
| 11165 | q.breakable() |
| 11166 | q.text('}') |
| 11167 | |
| 11168 | stats_reply.subtypes[1] = flow_stats_reply |
| 11169 | |
| 11170 | class flow_stats_request(stats_request): |
| 11171 | version = 4 |
| 11172 | type = 18 |
| 11173 | stats_type = 1 |
| 11174 | |
| 11175 | def __init__(self, xid=None, flags=None, table_id=None, out_port=None, out_group=None, cookie=None, cookie_mask=None, match=None): |
| 11176 | if xid != None: |
| 11177 | self.xid = xid |
| 11178 | else: |
| 11179 | self.xid = None |
| 11180 | if flags != None: |
| 11181 | self.flags = flags |
| 11182 | else: |
| 11183 | self.flags = 0 |
| 11184 | if table_id != None: |
| 11185 | self.table_id = table_id |
| 11186 | else: |
| 11187 | self.table_id = 0 |
| 11188 | if out_port != None: |
| 11189 | self.out_port = out_port |
| 11190 | else: |
| 11191 | self.out_port = 0 |
| 11192 | if out_group != None: |
| 11193 | self.out_group = out_group |
| 11194 | else: |
| 11195 | self.out_group = 0 |
| 11196 | if cookie != None: |
| 11197 | self.cookie = cookie |
| 11198 | else: |
| 11199 | self.cookie = 0 |
| 11200 | if cookie_mask != None: |
| 11201 | self.cookie_mask = cookie_mask |
| 11202 | else: |
| 11203 | self.cookie_mask = 0 |
| 11204 | if match != None: |
| 11205 | self.match = match |
| 11206 | else: |
| 11207 | self.match = ofp.match() |
| 11208 | return |
| 11209 | |
| 11210 | def pack(self): |
| 11211 | packed = [] |
| 11212 | packed.append(struct.pack("!B", self.version)) |
| 11213 | packed.append(struct.pack("!B", self.type)) |
| 11214 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 11215 | packed.append(struct.pack("!L", self.xid)) |
| 11216 | packed.append(struct.pack("!H", self.stats_type)) |
| 11217 | packed.append(struct.pack("!H", self.flags)) |
| 11218 | packed.append('\x00' * 4) |
| 11219 | packed.append(struct.pack("!B", self.table_id)) |
| 11220 | packed.append('\x00' * 3) |
| 11221 | packed.append(util.pack_port_no(self.out_port)) |
| 11222 | packed.append(struct.pack("!L", self.out_group)) |
| 11223 | packed.append('\x00' * 4) |
| 11224 | packed.append(struct.pack("!Q", self.cookie)) |
| 11225 | packed.append(struct.pack("!Q", self.cookie_mask)) |
| 11226 | packed.append(self.match.pack()) |
| 11227 | length = sum([len(x) for x in packed]) |
| 11228 | packed[2] = struct.pack("!H", length) |
| 11229 | return ''.join(packed) |
| 11230 | |
| 11231 | @staticmethod |
| 11232 | def unpack(reader): |
| 11233 | obj = flow_stats_request() |
| 11234 | _version = reader.read("!B")[0] |
| 11235 | assert(_version == 4) |
| 11236 | _type = reader.read("!B")[0] |
| 11237 | assert(_type == 18) |
| 11238 | _length = reader.read("!H")[0] |
| 11239 | orig_reader = reader |
| 11240 | reader = orig_reader.slice(_length, 4) |
| 11241 | obj.xid = reader.read("!L")[0] |
| 11242 | _stats_type = reader.read("!H")[0] |
| 11243 | assert(_stats_type == 1) |
| 11244 | obj.flags = reader.read("!H")[0] |
| 11245 | reader.skip(4) |
| 11246 | obj.table_id = reader.read("!B")[0] |
| 11247 | reader.skip(3) |
| 11248 | obj.out_port = util.unpack_port_no(reader) |
| 11249 | obj.out_group = reader.read("!L")[0] |
| 11250 | reader.skip(4) |
| 11251 | obj.cookie = reader.read("!Q")[0] |
| 11252 | obj.cookie_mask = reader.read("!Q")[0] |
| 11253 | obj.match = ofp.match.unpack(reader) |
| 11254 | return obj |
| 11255 | |
| 11256 | def __eq__(self, other): |
| 11257 | if type(self) != type(other): return False |
| 11258 | if self.xid != other.xid: return False |
| 11259 | if self.flags != other.flags: return False |
| 11260 | if self.table_id != other.table_id: return False |
| 11261 | if self.out_port != other.out_port: return False |
| 11262 | if self.out_group != other.out_group: return False |
| 11263 | if self.cookie != other.cookie: return False |
| 11264 | if self.cookie_mask != other.cookie_mask: return False |
| 11265 | if self.match != other.match: return False |
| 11266 | return True |
| 11267 | |
| 11268 | def pretty_print(self, q): |
| 11269 | q.text("flow_stats_request {") |
| 11270 | with q.group(): |
| 11271 | with q.indent(2): |
| 11272 | q.breakable() |
| 11273 | q.text("xid = "); |
| 11274 | if self.xid != None: |
| 11275 | q.text("%#x" % self.xid) |
| 11276 | else: |
| 11277 | q.text('None') |
| 11278 | q.text(","); q.breakable() |
| 11279 | q.text("flags = "); |
| 11280 | q.text("%#x" % self.flags) |
| 11281 | q.text(","); q.breakable() |
| 11282 | q.text("table_id = "); |
| 11283 | q.text("%#x" % self.table_id) |
| 11284 | q.text(","); q.breakable() |
| 11285 | q.text("out_port = "); |
| 11286 | q.text(util.pretty_port(self.out_port)) |
| 11287 | q.text(","); q.breakable() |
| 11288 | q.text("out_group = "); |
| 11289 | q.text("%#x" % self.out_group) |
| 11290 | q.text(","); q.breakable() |
| 11291 | q.text("cookie = "); |
| 11292 | q.text("%#x" % self.cookie) |
| 11293 | q.text(","); q.breakable() |
| 11294 | q.text("cookie_mask = "); |
| 11295 | q.text("%#x" % self.cookie_mask) |
| 11296 | q.text(","); q.breakable() |
| 11297 | q.text("match = "); |
| 11298 | q.pp(self.match) |
| 11299 | q.breakable() |
| 11300 | q.text('}') |
| 11301 | |
| 11302 | stats_request.subtypes[1] = flow_stats_request |
| 11303 | |
| 11304 | class get_config_reply(message): |
| 11305 | version = 4 |
| 11306 | type = 8 |
| 11307 | |
| 11308 | def __init__(self, xid=None, flags=None, miss_send_len=None): |
| 11309 | if xid != None: |
| 11310 | self.xid = xid |
| 11311 | else: |
| 11312 | self.xid = None |
| 11313 | if flags != None: |
| 11314 | self.flags = flags |
| 11315 | else: |
| 11316 | self.flags = 0 |
| 11317 | if miss_send_len != None: |
| 11318 | self.miss_send_len = miss_send_len |
| 11319 | else: |
| 11320 | self.miss_send_len = 0 |
| 11321 | return |
| 11322 | |
| 11323 | def pack(self): |
| 11324 | packed = [] |
| 11325 | packed.append(struct.pack("!B", self.version)) |
| 11326 | packed.append(struct.pack("!B", self.type)) |
| 11327 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 11328 | packed.append(struct.pack("!L", self.xid)) |
| 11329 | packed.append(struct.pack("!H", self.flags)) |
| 11330 | packed.append(struct.pack("!H", self.miss_send_len)) |
| 11331 | length = sum([len(x) for x in packed]) |
| 11332 | packed[2] = struct.pack("!H", length) |
| 11333 | return ''.join(packed) |
| 11334 | |
| 11335 | @staticmethod |
| 11336 | def unpack(reader): |
| 11337 | obj = get_config_reply() |
| 11338 | _version = reader.read("!B")[0] |
| 11339 | assert(_version == 4) |
| 11340 | _type = reader.read("!B")[0] |
| 11341 | assert(_type == 8) |
| 11342 | _length = reader.read("!H")[0] |
| 11343 | orig_reader = reader |
| 11344 | reader = orig_reader.slice(_length, 4) |
| 11345 | obj.xid = reader.read("!L")[0] |
| 11346 | obj.flags = reader.read("!H")[0] |
| 11347 | obj.miss_send_len = reader.read("!H")[0] |
| 11348 | return obj |
| 11349 | |
| 11350 | def __eq__(self, other): |
| 11351 | if type(self) != type(other): return False |
| 11352 | if self.xid != other.xid: return False |
| 11353 | if self.flags != other.flags: return False |
| 11354 | if self.miss_send_len != other.miss_send_len: return False |
| 11355 | return True |
| 11356 | |
| 11357 | def pretty_print(self, q): |
| 11358 | q.text("get_config_reply {") |
| 11359 | with q.group(): |
| 11360 | with q.indent(2): |
| 11361 | q.breakable() |
| 11362 | q.text("xid = "); |
| 11363 | if self.xid != None: |
| 11364 | q.text("%#x" % self.xid) |
| 11365 | else: |
| 11366 | q.text('None') |
| 11367 | q.text(","); q.breakable() |
| 11368 | q.text("flags = "); |
| 11369 | q.text("%#x" % self.flags) |
| 11370 | q.text(","); q.breakable() |
| 11371 | q.text("miss_send_len = "); |
| 11372 | q.text("%#x" % self.miss_send_len) |
| 11373 | q.breakable() |
| 11374 | q.text('}') |
| 11375 | |
| 11376 | message.subtypes[8] = get_config_reply |
| 11377 | |
| 11378 | class get_config_request(message): |
| 11379 | version = 4 |
| 11380 | type = 7 |
| 11381 | |
| 11382 | def __init__(self, xid=None): |
| 11383 | if xid != None: |
| 11384 | self.xid = xid |
| 11385 | else: |
| 11386 | self.xid = None |
| 11387 | return |
| 11388 | |
| 11389 | def pack(self): |
| 11390 | packed = [] |
| 11391 | packed.append(struct.pack("!B", self.version)) |
| 11392 | packed.append(struct.pack("!B", self.type)) |
| 11393 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 11394 | packed.append(struct.pack("!L", self.xid)) |
| 11395 | length = sum([len(x) for x in packed]) |
| 11396 | packed[2] = struct.pack("!H", length) |
| 11397 | return ''.join(packed) |
| 11398 | |
| 11399 | @staticmethod |
| 11400 | def unpack(reader): |
| 11401 | obj = get_config_request() |
| 11402 | _version = reader.read("!B")[0] |
| 11403 | assert(_version == 4) |
| 11404 | _type = reader.read("!B")[0] |
| 11405 | assert(_type == 7) |
| 11406 | _length = reader.read("!H")[0] |
| 11407 | orig_reader = reader |
| 11408 | reader = orig_reader.slice(_length, 4) |
| 11409 | obj.xid = reader.read("!L")[0] |
| 11410 | return obj |
| 11411 | |
| 11412 | def __eq__(self, other): |
| 11413 | if type(self) != type(other): return False |
| 11414 | if self.xid != other.xid: return False |
| 11415 | return True |
| 11416 | |
| 11417 | def pretty_print(self, q): |
| 11418 | q.text("get_config_request {") |
| 11419 | with q.group(): |
| 11420 | with q.indent(2): |
| 11421 | q.breakable() |
| 11422 | q.text("xid = "); |
| 11423 | if self.xid != None: |
| 11424 | q.text("%#x" % self.xid) |
| 11425 | else: |
| 11426 | q.text('None') |
| 11427 | q.breakable() |
| 11428 | q.text('}') |
| 11429 | |
| 11430 | message.subtypes[7] = get_config_request |
| 11431 | |
| 11432 | class group_mod(message): |
| 11433 | subtypes = {} |
| 11434 | |
| 11435 | version = 4 |
| 11436 | type = 15 |
| 11437 | |
| 11438 | def __init__(self, xid=None, command=None, group_type=None, group_id=None, buckets=None): |
| 11439 | if xid != None: |
| 11440 | self.xid = xid |
| 11441 | else: |
| 11442 | self.xid = None |
| 11443 | if command != None: |
| 11444 | self.command = command |
| 11445 | else: |
| 11446 | self.command = 0 |
| 11447 | if group_type != None: |
| 11448 | self.group_type = group_type |
| 11449 | else: |
| 11450 | self.group_type = 0 |
| 11451 | if group_id != None: |
| 11452 | self.group_id = group_id |
| 11453 | else: |
| 11454 | self.group_id = 0 |
| 11455 | if buckets != None: |
| 11456 | self.buckets = buckets |
| 11457 | else: |
| 11458 | self.buckets = [] |
| 11459 | return |
| 11460 | |
| 11461 | def pack(self): |
| 11462 | packed = [] |
| 11463 | packed.append(struct.pack("!B", self.version)) |
| 11464 | packed.append(struct.pack("!B", self.type)) |
| 11465 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 11466 | packed.append(struct.pack("!L", self.xid)) |
| 11467 | packed.append(struct.pack("!H", self.command)) |
| 11468 | packed.append(struct.pack("!B", self.group_type)) |
| 11469 | packed.append('\x00' * 1) |
| 11470 | packed.append(struct.pack("!L", self.group_id)) |
| 11471 | packed.append(loxi.generic_util.pack_list(self.buckets)) |
| 11472 | length = sum([len(x) for x in packed]) |
| 11473 | packed[2] = struct.pack("!H", length) |
| 11474 | return ''.join(packed) |
| 11475 | |
| 11476 | @staticmethod |
| 11477 | def unpack(reader): |
| 11478 | subtype, = reader.peek('!H', 8) |
| 11479 | subclass = group_mod.subtypes.get(subtype) |
| 11480 | if subclass: |
| 11481 | return subclass.unpack(reader) |
| 11482 | |
| 11483 | obj = group_mod() |
| 11484 | _version = reader.read("!B")[0] |
| 11485 | assert(_version == 4) |
| 11486 | _type = reader.read("!B")[0] |
| 11487 | assert(_type == 15) |
| 11488 | _length = reader.read("!H")[0] |
| 11489 | orig_reader = reader |
| 11490 | reader = orig_reader.slice(_length, 4) |
| 11491 | obj.xid = reader.read("!L")[0] |
| 11492 | obj.command = reader.read("!H")[0] |
| 11493 | obj.group_type = reader.read("!B")[0] |
| 11494 | reader.skip(1) |
| 11495 | obj.group_id = reader.read("!L")[0] |
| 11496 | obj.buckets = loxi.generic_util.unpack_list(reader, ofp.common.bucket.unpack) |
| 11497 | return obj |
| 11498 | |
| 11499 | def __eq__(self, other): |
| 11500 | if type(self) != type(other): return False |
| 11501 | if self.xid != other.xid: return False |
| 11502 | if self.command != other.command: return False |
| 11503 | if self.group_type != other.group_type: return False |
| 11504 | if self.group_id != other.group_id: return False |
| 11505 | if self.buckets != other.buckets: return False |
| 11506 | return True |
| 11507 | |
| 11508 | def pretty_print(self, q): |
| 11509 | q.text("group_mod {") |
| 11510 | with q.group(): |
| 11511 | with q.indent(2): |
| 11512 | q.breakable() |
| 11513 | q.text("xid = "); |
| 11514 | if self.xid != None: |
| 11515 | q.text("%#x" % self.xid) |
| 11516 | else: |
| 11517 | q.text('None') |
| 11518 | q.text(","); q.breakable() |
| 11519 | q.text("group_type = "); |
| 11520 | q.text("%#x" % self.group_type) |
| 11521 | q.text(","); q.breakable() |
| 11522 | q.text("group_id = "); |
| 11523 | q.text("%#x" % self.group_id) |
| 11524 | q.text(","); q.breakable() |
| 11525 | q.text("buckets = "); |
| 11526 | q.pp(self.buckets) |
| 11527 | q.breakable() |
| 11528 | q.text('}') |
| 11529 | |
| 11530 | message.subtypes[15] = group_mod |
| 11531 | |
| 11532 | class group_add(group_mod): |
| 11533 | version = 4 |
| 11534 | type = 15 |
| 11535 | command = 0 |
| 11536 | |
| 11537 | def __init__(self, xid=None, group_type=None, group_id=None, buckets=None): |
| 11538 | if xid != None: |
| 11539 | self.xid = xid |
| 11540 | else: |
| 11541 | self.xid = None |
| 11542 | if group_type != None: |
| 11543 | self.group_type = group_type |
| 11544 | else: |
| 11545 | self.group_type = 0 |
| 11546 | if group_id != None: |
| 11547 | self.group_id = group_id |
| 11548 | else: |
| 11549 | self.group_id = 0 |
| 11550 | if buckets != None: |
| 11551 | self.buckets = buckets |
| 11552 | else: |
| 11553 | self.buckets = [] |
| 11554 | return |
| 11555 | |
| 11556 | def pack(self): |
| 11557 | packed = [] |
| 11558 | packed.append(struct.pack("!B", self.version)) |
| 11559 | packed.append(struct.pack("!B", self.type)) |
| 11560 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 11561 | packed.append(struct.pack("!L", self.xid)) |
| 11562 | packed.append(struct.pack("!H", self.command)) |
| 11563 | packed.append(struct.pack("!B", self.group_type)) |
| 11564 | packed.append('\x00' * 1) |
| 11565 | packed.append(struct.pack("!L", self.group_id)) |
| 11566 | packed.append(loxi.generic_util.pack_list(self.buckets)) |
| 11567 | length = sum([len(x) for x in packed]) |
| 11568 | packed[2] = struct.pack("!H", length) |
| 11569 | return ''.join(packed) |
| 11570 | |
| 11571 | @staticmethod |
| 11572 | def unpack(reader): |
| 11573 | obj = group_add() |
| 11574 | _version = reader.read("!B")[0] |
| 11575 | assert(_version == 4) |
| 11576 | _type = reader.read("!B")[0] |
| 11577 | assert(_type == 15) |
| 11578 | _length = reader.read("!H")[0] |
| 11579 | orig_reader = reader |
| 11580 | reader = orig_reader.slice(_length, 4) |
| 11581 | obj.xid = reader.read("!L")[0] |
| 11582 | _command = reader.read("!H")[0] |
| 11583 | assert(_command == 0) |
| 11584 | obj.group_type = reader.read("!B")[0] |
| 11585 | reader.skip(1) |
| 11586 | obj.group_id = reader.read("!L")[0] |
| 11587 | obj.buckets = loxi.generic_util.unpack_list(reader, ofp.common.bucket.unpack) |
| 11588 | return obj |
| 11589 | |
| 11590 | def __eq__(self, other): |
| 11591 | if type(self) != type(other): return False |
| 11592 | if self.xid != other.xid: return False |
| 11593 | if self.group_type != other.group_type: return False |
| 11594 | if self.group_id != other.group_id: return False |
| 11595 | if self.buckets != other.buckets: return False |
| 11596 | return True |
| 11597 | |
| 11598 | def pretty_print(self, q): |
| 11599 | q.text("group_add {") |
| 11600 | with q.group(): |
| 11601 | with q.indent(2): |
| 11602 | q.breakable() |
| 11603 | q.text("xid = "); |
| 11604 | if self.xid != None: |
| 11605 | q.text("%#x" % self.xid) |
| 11606 | else: |
| 11607 | q.text('None') |
| 11608 | q.text(","); q.breakable() |
| 11609 | q.text("group_type = "); |
| 11610 | q.text("%#x" % self.group_type) |
| 11611 | q.text(","); q.breakable() |
| 11612 | q.text("group_id = "); |
| 11613 | q.text("%#x" % self.group_id) |
| 11614 | q.text(","); q.breakable() |
| 11615 | q.text("buckets = "); |
| 11616 | q.pp(self.buckets) |
| 11617 | q.breakable() |
| 11618 | q.text('}') |
| 11619 | |
| 11620 | group_mod.subtypes[0] = group_add |
| 11621 | |
| 11622 | class group_delete(group_mod): |
| 11623 | version = 4 |
| 11624 | type = 15 |
| 11625 | command = 2 |
| 11626 | |
| 11627 | def __init__(self, xid=None, group_type=None, group_id=None, buckets=None): |
| 11628 | if xid != None: |
| 11629 | self.xid = xid |
| 11630 | else: |
| 11631 | self.xid = None |
| 11632 | if group_type != None: |
| 11633 | self.group_type = group_type |
| 11634 | else: |
| 11635 | self.group_type = 0 |
| 11636 | if group_id != None: |
| 11637 | self.group_id = group_id |
| 11638 | else: |
| 11639 | self.group_id = 0 |
| 11640 | if buckets != None: |
| 11641 | self.buckets = buckets |
| 11642 | else: |
| 11643 | self.buckets = [] |
| 11644 | return |
| 11645 | |
| 11646 | def pack(self): |
| 11647 | packed = [] |
| 11648 | packed.append(struct.pack("!B", self.version)) |
| 11649 | packed.append(struct.pack("!B", self.type)) |
| 11650 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 11651 | packed.append(struct.pack("!L", self.xid)) |
| 11652 | packed.append(struct.pack("!H", self.command)) |
| 11653 | packed.append(struct.pack("!B", self.group_type)) |
| 11654 | packed.append('\x00' * 1) |
| 11655 | packed.append(struct.pack("!L", self.group_id)) |
| 11656 | packed.append(loxi.generic_util.pack_list(self.buckets)) |
| 11657 | length = sum([len(x) for x in packed]) |
| 11658 | packed[2] = struct.pack("!H", length) |
| 11659 | return ''.join(packed) |
| 11660 | |
| 11661 | @staticmethod |
| 11662 | def unpack(reader): |
| 11663 | obj = group_delete() |
| 11664 | _version = reader.read("!B")[0] |
| 11665 | assert(_version == 4) |
| 11666 | _type = reader.read("!B")[0] |
| 11667 | assert(_type == 15) |
| 11668 | _length = reader.read("!H")[0] |
| 11669 | orig_reader = reader |
| 11670 | reader = orig_reader.slice(_length, 4) |
| 11671 | obj.xid = reader.read("!L")[0] |
| 11672 | _command = reader.read("!H")[0] |
| 11673 | assert(_command == 2) |
| 11674 | obj.group_type = reader.read("!B")[0] |
| 11675 | reader.skip(1) |
| 11676 | obj.group_id = reader.read("!L")[0] |
| 11677 | obj.buckets = loxi.generic_util.unpack_list(reader, ofp.common.bucket.unpack) |
| 11678 | return obj |
| 11679 | |
| 11680 | def __eq__(self, other): |
| 11681 | if type(self) != type(other): return False |
| 11682 | if self.xid != other.xid: return False |
| 11683 | if self.group_type != other.group_type: return False |
| 11684 | if self.group_id != other.group_id: return False |
| 11685 | if self.buckets != other.buckets: return False |
| 11686 | return True |
| 11687 | |
| 11688 | def pretty_print(self, q): |
| 11689 | q.text("group_delete {") |
| 11690 | with q.group(): |
| 11691 | with q.indent(2): |
| 11692 | q.breakable() |
| 11693 | q.text("xid = "); |
| 11694 | if self.xid != None: |
| 11695 | q.text("%#x" % self.xid) |
| 11696 | else: |
| 11697 | q.text('None') |
| 11698 | q.text(","); q.breakable() |
| 11699 | q.text("group_type = "); |
| 11700 | q.text("%#x" % self.group_type) |
| 11701 | q.text(","); q.breakable() |
| 11702 | q.text("group_id = "); |
| 11703 | q.text("%#x" % self.group_id) |
| 11704 | q.text(","); q.breakable() |
| 11705 | q.text("buckets = "); |
| 11706 | q.pp(self.buckets) |
| 11707 | q.breakable() |
| 11708 | q.text('}') |
| 11709 | |
| 11710 | group_mod.subtypes[2] = group_delete |
| 11711 | |
| 11712 | class group_desc_stats_reply(stats_reply): |
| 11713 | version = 4 |
| 11714 | type = 19 |
| 11715 | stats_type = 7 |
| 11716 | |
| 11717 | def __init__(self, xid=None, flags=None, entries=None): |
| 11718 | if xid != None: |
| 11719 | self.xid = xid |
| 11720 | else: |
| 11721 | self.xid = None |
| 11722 | if flags != None: |
| 11723 | self.flags = flags |
| 11724 | else: |
| 11725 | self.flags = 0 |
| 11726 | if entries != None: |
| 11727 | self.entries = entries |
| 11728 | else: |
| 11729 | self.entries = [] |
| 11730 | return |
| 11731 | |
| 11732 | def pack(self): |
| 11733 | packed = [] |
| 11734 | packed.append(struct.pack("!B", self.version)) |
| 11735 | packed.append(struct.pack("!B", self.type)) |
| 11736 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 11737 | packed.append(struct.pack("!L", self.xid)) |
| 11738 | packed.append(struct.pack("!H", self.stats_type)) |
| 11739 | packed.append(struct.pack("!H", self.flags)) |
| 11740 | packed.append('\x00' * 4) |
| 11741 | packed.append(loxi.generic_util.pack_list(self.entries)) |
| 11742 | length = sum([len(x) for x in packed]) |
| 11743 | packed[2] = struct.pack("!H", length) |
| 11744 | return ''.join(packed) |
| 11745 | |
| 11746 | @staticmethod |
| 11747 | def unpack(reader): |
| 11748 | obj = group_desc_stats_reply() |
| 11749 | _version = reader.read("!B")[0] |
| 11750 | assert(_version == 4) |
| 11751 | _type = reader.read("!B")[0] |
| 11752 | assert(_type == 19) |
| 11753 | _length = reader.read("!H")[0] |
| 11754 | orig_reader = reader |
| 11755 | reader = orig_reader.slice(_length, 4) |
| 11756 | obj.xid = reader.read("!L")[0] |
| 11757 | _stats_type = reader.read("!H")[0] |
| 11758 | assert(_stats_type == 7) |
| 11759 | obj.flags = reader.read("!H")[0] |
| 11760 | reader.skip(4) |
| 11761 | obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.group_desc_stats_entry.unpack) |
| 11762 | return obj |
| 11763 | |
| 11764 | def __eq__(self, other): |
| 11765 | if type(self) != type(other): return False |
| 11766 | if self.xid != other.xid: return False |
| 11767 | if self.flags != other.flags: return False |
| 11768 | if self.entries != other.entries: return False |
| 11769 | return True |
| 11770 | |
| 11771 | def pretty_print(self, q): |
| 11772 | q.text("group_desc_stats_reply {") |
| 11773 | with q.group(): |
| 11774 | with q.indent(2): |
| 11775 | q.breakable() |
| 11776 | q.text("xid = "); |
| 11777 | if self.xid != None: |
| 11778 | q.text("%#x" % self.xid) |
| 11779 | else: |
| 11780 | q.text('None') |
| 11781 | q.text(","); q.breakable() |
| 11782 | q.text("flags = "); |
| 11783 | q.text("%#x" % self.flags) |
| 11784 | q.text(","); q.breakable() |
| 11785 | q.text("entries = "); |
| 11786 | q.pp(self.entries) |
| 11787 | q.breakable() |
| 11788 | q.text('}') |
| 11789 | |
| 11790 | stats_reply.subtypes[7] = group_desc_stats_reply |
| 11791 | |
| 11792 | class group_desc_stats_request(stats_request): |
| 11793 | version = 4 |
| 11794 | type = 18 |
| 11795 | stats_type = 7 |
| 11796 | |
| 11797 | def __init__(self, xid=None, flags=None): |
| 11798 | if xid != None: |
| 11799 | self.xid = xid |
| 11800 | else: |
| 11801 | self.xid = None |
| 11802 | if flags != None: |
| 11803 | self.flags = flags |
| 11804 | else: |
| 11805 | self.flags = 0 |
| 11806 | return |
| 11807 | |
| 11808 | def pack(self): |
| 11809 | packed = [] |
| 11810 | packed.append(struct.pack("!B", self.version)) |
| 11811 | packed.append(struct.pack("!B", self.type)) |
| 11812 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 11813 | packed.append(struct.pack("!L", self.xid)) |
| 11814 | packed.append(struct.pack("!H", self.stats_type)) |
| 11815 | packed.append(struct.pack("!H", self.flags)) |
| 11816 | packed.append('\x00' * 4) |
| 11817 | length = sum([len(x) for x in packed]) |
| 11818 | packed[2] = struct.pack("!H", length) |
| 11819 | return ''.join(packed) |
| 11820 | |
| 11821 | @staticmethod |
| 11822 | def unpack(reader): |
| 11823 | obj = group_desc_stats_request() |
| 11824 | _version = reader.read("!B")[0] |
| 11825 | assert(_version == 4) |
| 11826 | _type = reader.read("!B")[0] |
| 11827 | assert(_type == 18) |
| 11828 | _length = reader.read("!H")[0] |
| 11829 | orig_reader = reader |
| 11830 | reader = orig_reader.slice(_length, 4) |
| 11831 | obj.xid = reader.read("!L")[0] |
| 11832 | _stats_type = reader.read("!H")[0] |
| 11833 | assert(_stats_type == 7) |
| 11834 | obj.flags = reader.read("!H")[0] |
| 11835 | reader.skip(4) |
| 11836 | return obj |
| 11837 | |
| 11838 | def __eq__(self, other): |
| 11839 | if type(self) != type(other): return False |
| 11840 | if self.xid != other.xid: return False |
| 11841 | if self.flags != other.flags: return False |
| 11842 | return True |
| 11843 | |
| 11844 | def pretty_print(self, q): |
| 11845 | q.text("group_desc_stats_request {") |
| 11846 | with q.group(): |
| 11847 | with q.indent(2): |
| 11848 | q.breakable() |
| 11849 | q.text("xid = "); |
| 11850 | if self.xid != None: |
| 11851 | q.text("%#x" % self.xid) |
| 11852 | else: |
| 11853 | q.text('None') |
| 11854 | q.text(","); q.breakable() |
| 11855 | q.text("flags = "); |
| 11856 | q.text("%#x" % self.flags) |
| 11857 | q.breakable() |
| 11858 | q.text('}') |
| 11859 | |
| 11860 | stats_request.subtypes[7] = group_desc_stats_request |
| 11861 | |
| 11862 | class group_features_stats_reply(stats_reply): |
| 11863 | version = 4 |
| 11864 | type = 19 |
| 11865 | stats_type = 8 |
| 11866 | |
| 11867 | def __init__(self, xid=None, flags=None, types=None, capabilities=None, max_groups_all=None, max_groups_select=None, max_groups_indirect=None, max_groups_ff=None, actions_all=None, actions_select=None, actions_indirect=None, actions_ff=None): |
| 11868 | if xid != None: |
| 11869 | self.xid = xid |
| 11870 | else: |
| 11871 | self.xid = None |
| 11872 | if flags != None: |
| 11873 | self.flags = flags |
| 11874 | else: |
| 11875 | self.flags = 0 |
| 11876 | if types != None: |
| 11877 | self.types = types |
| 11878 | else: |
| 11879 | self.types = 0 |
| 11880 | if capabilities != None: |
| 11881 | self.capabilities = capabilities |
| 11882 | else: |
| 11883 | self.capabilities = 0 |
| 11884 | if max_groups_all != None: |
| 11885 | self.max_groups_all = max_groups_all |
| 11886 | else: |
| 11887 | self.max_groups_all = 0 |
| 11888 | if max_groups_select != None: |
| 11889 | self.max_groups_select = max_groups_select |
| 11890 | else: |
| 11891 | self.max_groups_select = 0 |
| 11892 | if max_groups_indirect != None: |
| 11893 | self.max_groups_indirect = max_groups_indirect |
| 11894 | else: |
| 11895 | self.max_groups_indirect = 0 |
| 11896 | if max_groups_ff != None: |
| 11897 | self.max_groups_ff = max_groups_ff |
| 11898 | else: |
| 11899 | self.max_groups_ff = 0 |
| 11900 | if actions_all != None: |
| 11901 | self.actions_all = actions_all |
| 11902 | else: |
| 11903 | self.actions_all = 0 |
| 11904 | if actions_select != None: |
| 11905 | self.actions_select = actions_select |
| 11906 | else: |
| 11907 | self.actions_select = 0 |
| 11908 | if actions_indirect != None: |
| 11909 | self.actions_indirect = actions_indirect |
| 11910 | else: |
| 11911 | self.actions_indirect = 0 |
| 11912 | if actions_ff != None: |
| 11913 | self.actions_ff = actions_ff |
| 11914 | else: |
| 11915 | self.actions_ff = 0 |
| 11916 | return |
| 11917 | |
| 11918 | def pack(self): |
| 11919 | packed = [] |
| 11920 | packed.append(struct.pack("!B", self.version)) |
| 11921 | packed.append(struct.pack("!B", self.type)) |
| 11922 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 11923 | packed.append(struct.pack("!L", self.xid)) |
| 11924 | packed.append(struct.pack("!H", self.stats_type)) |
| 11925 | packed.append(struct.pack("!H", self.flags)) |
| 11926 | packed.append('\x00' * 4) |
| 11927 | packed.append(struct.pack("!L", self.types)) |
| 11928 | packed.append(struct.pack("!L", self.capabilities)) |
| 11929 | packed.append(struct.pack("!L", self.max_groups_all)) |
| 11930 | packed.append(struct.pack("!L", self.max_groups_select)) |
| 11931 | packed.append(struct.pack("!L", self.max_groups_indirect)) |
| 11932 | packed.append(struct.pack("!L", self.max_groups_ff)) |
| 11933 | packed.append(struct.pack("!L", self.actions_all)) |
| 11934 | packed.append(struct.pack("!L", self.actions_select)) |
| 11935 | packed.append(struct.pack("!L", self.actions_indirect)) |
| 11936 | packed.append(struct.pack("!L", self.actions_ff)) |
| 11937 | length = sum([len(x) for x in packed]) |
| 11938 | packed[2] = struct.pack("!H", length) |
| 11939 | return ''.join(packed) |
| 11940 | |
| 11941 | @staticmethod |
| 11942 | def unpack(reader): |
| 11943 | obj = group_features_stats_reply() |
| 11944 | _version = reader.read("!B")[0] |
| 11945 | assert(_version == 4) |
| 11946 | _type = reader.read("!B")[0] |
| 11947 | assert(_type == 19) |
| 11948 | _length = reader.read("!H")[0] |
| 11949 | orig_reader = reader |
| 11950 | reader = orig_reader.slice(_length, 4) |
| 11951 | obj.xid = reader.read("!L")[0] |
| 11952 | _stats_type = reader.read("!H")[0] |
| 11953 | assert(_stats_type == 8) |
| 11954 | obj.flags = reader.read("!H")[0] |
| 11955 | reader.skip(4) |
| 11956 | obj.types = reader.read("!L")[0] |
| 11957 | obj.capabilities = reader.read("!L")[0] |
| 11958 | obj.max_groups_all = reader.read("!L")[0] |
| 11959 | obj.max_groups_select = reader.read("!L")[0] |
| 11960 | obj.max_groups_indirect = reader.read("!L")[0] |
| 11961 | obj.max_groups_ff = reader.read("!L")[0] |
| 11962 | obj.actions_all = reader.read("!L")[0] |
| 11963 | obj.actions_select = reader.read("!L")[0] |
| 11964 | obj.actions_indirect = reader.read("!L")[0] |
| 11965 | obj.actions_ff = reader.read("!L")[0] |
| 11966 | return obj |
| 11967 | |
| 11968 | def __eq__(self, other): |
| 11969 | if type(self) != type(other): return False |
| 11970 | if self.xid != other.xid: return False |
| 11971 | if self.flags != other.flags: return False |
| 11972 | if self.types != other.types: return False |
| 11973 | if self.capabilities != other.capabilities: return False |
| 11974 | if self.max_groups_all != other.max_groups_all: return False |
| 11975 | if self.max_groups_select != other.max_groups_select: return False |
| 11976 | if self.max_groups_indirect != other.max_groups_indirect: return False |
| 11977 | if self.max_groups_ff != other.max_groups_ff: return False |
| 11978 | if self.actions_all != other.actions_all: return False |
| 11979 | if self.actions_select != other.actions_select: return False |
| 11980 | if self.actions_indirect != other.actions_indirect: return False |
| 11981 | if self.actions_ff != other.actions_ff: return False |
| 11982 | return True |
| 11983 | |
| 11984 | def pretty_print(self, q): |
| 11985 | q.text("group_features_stats_reply {") |
| 11986 | with q.group(): |
| 11987 | with q.indent(2): |
| 11988 | q.breakable() |
| 11989 | q.text("xid = "); |
| 11990 | if self.xid != None: |
| 11991 | q.text("%#x" % self.xid) |
| 11992 | else: |
| 11993 | q.text('None') |
| 11994 | q.text(","); q.breakable() |
| 11995 | q.text("flags = "); |
| 11996 | q.text("%#x" % self.flags) |
| 11997 | q.text(","); q.breakable() |
| 11998 | q.text("types = "); |
| 11999 | q.text("%#x" % self.types) |
| 12000 | q.text(","); q.breakable() |
| 12001 | q.text("capabilities = "); |
| 12002 | q.text("%#x" % self.capabilities) |
| 12003 | q.text(","); q.breakable() |
| 12004 | q.text("max_groups_all = "); |
| 12005 | q.text("%#x" % self.max_groups_all) |
| 12006 | q.text(","); q.breakable() |
| 12007 | q.text("max_groups_select = "); |
| 12008 | q.text("%#x" % self.max_groups_select) |
| 12009 | q.text(","); q.breakable() |
| 12010 | q.text("max_groups_indirect = "); |
| 12011 | q.text("%#x" % self.max_groups_indirect) |
| 12012 | q.text(","); q.breakable() |
| 12013 | q.text("max_groups_ff = "); |
| 12014 | q.text("%#x" % self.max_groups_ff) |
| 12015 | q.text(","); q.breakable() |
| 12016 | q.text("actions_all = "); |
| 12017 | q.text("%#x" % self.actions_all) |
| 12018 | q.text(","); q.breakable() |
| 12019 | q.text("actions_select = "); |
| 12020 | q.text("%#x" % self.actions_select) |
| 12021 | q.text(","); q.breakable() |
| 12022 | q.text("actions_indirect = "); |
| 12023 | q.text("%#x" % self.actions_indirect) |
| 12024 | q.text(","); q.breakable() |
| 12025 | q.text("actions_ff = "); |
| 12026 | q.text("%#x" % self.actions_ff) |
| 12027 | q.breakable() |
| 12028 | q.text('}') |
| 12029 | |
| 12030 | stats_reply.subtypes[8] = group_features_stats_reply |
| 12031 | |
| 12032 | class group_features_stats_request(stats_request): |
| 12033 | version = 4 |
| 12034 | type = 18 |
| 12035 | stats_type = 8 |
| 12036 | |
| 12037 | def __init__(self, xid=None, flags=None): |
| 12038 | if xid != None: |
| 12039 | self.xid = xid |
| 12040 | else: |
| 12041 | self.xid = None |
| 12042 | if flags != None: |
| 12043 | self.flags = flags |
| 12044 | else: |
| 12045 | self.flags = 0 |
| 12046 | return |
| 12047 | |
| 12048 | def pack(self): |
| 12049 | packed = [] |
| 12050 | packed.append(struct.pack("!B", self.version)) |
| 12051 | packed.append(struct.pack("!B", self.type)) |
| 12052 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 12053 | packed.append(struct.pack("!L", self.xid)) |
| 12054 | packed.append(struct.pack("!H", self.stats_type)) |
| 12055 | packed.append(struct.pack("!H", self.flags)) |
| 12056 | packed.append('\x00' * 4) |
| 12057 | length = sum([len(x) for x in packed]) |
| 12058 | packed[2] = struct.pack("!H", length) |
| 12059 | return ''.join(packed) |
| 12060 | |
| 12061 | @staticmethod |
| 12062 | def unpack(reader): |
| 12063 | obj = group_features_stats_request() |
| 12064 | _version = reader.read("!B")[0] |
| 12065 | assert(_version == 4) |
| 12066 | _type = reader.read("!B")[0] |
| 12067 | assert(_type == 18) |
| 12068 | _length = reader.read("!H")[0] |
| 12069 | orig_reader = reader |
| 12070 | reader = orig_reader.slice(_length, 4) |
| 12071 | obj.xid = reader.read("!L")[0] |
| 12072 | _stats_type = reader.read("!H")[0] |
| 12073 | assert(_stats_type == 8) |
| 12074 | obj.flags = reader.read("!H")[0] |
| 12075 | reader.skip(4) |
| 12076 | return obj |
| 12077 | |
| 12078 | def __eq__(self, other): |
| 12079 | if type(self) != type(other): return False |
| 12080 | if self.xid != other.xid: return False |
| 12081 | if self.flags != other.flags: return False |
| 12082 | return True |
| 12083 | |
| 12084 | def pretty_print(self, q): |
| 12085 | q.text("group_features_stats_request {") |
| 12086 | with q.group(): |
| 12087 | with q.indent(2): |
| 12088 | q.breakable() |
| 12089 | q.text("xid = "); |
| 12090 | if self.xid != None: |
| 12091 | q.text("%#x" % self.xid) |
| 12092 | else: |
| 12093 | q.text('None') |
| 12094 | q.text(","); q.breakable() |
| 12095 | q.text("flags = "); |
| 12096 | q.text("%#x" % self.flags) |
| 12097 | q.breakable() |
| 12098 | q.text('}') |
| 12099 | |
| 12100 | stats_request.subtypes[8] = group_features_stats_request |
| 12101 | |
| 12102 | class group_mod_failed_error_msg(error_msg): |
| 12103 | version = 4 |
| 12104 | type = 1 |
| 12105 | err_type = 6 |
| 12106 | |
| 12107 | def __init__(self, xid=None, code=None, data=None): |
| 12108 | if xid != None: |
| 12109 | self.xid = xid |
| 12110 | else: |
| 12111 | self.xid = None |
| 12112 | if code != None: |
| 12113 | self.code = code |
| 12114 | else: |
| 12115 | self.code = 0 |
| 12116 | if data != None: |
| 12117 | self.data = data |
| 12118 | else: |
| 12119 | self.data = '' |
| 12120 | return |
| 12121 | |
| 12122 | def pack(self): |
| 12123 | packed = [] |
| 12124 | packed.append(struct.pack("!B", self.version)) |
| 12125 | packed.append(struct.pack("!B", self.type)) |
| 12126 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 12127 | packed.append(struct.pack("!L", self.xid)) |
| 12128 | packed.append(struct.pack("!H", self.err_type)) |
| 12129 | packed.append(struct.pack("!H", self.code)) |
| 12130 | packed.append(self.data) |
| 12131 | length = sum([len(x) for x in packed]) |
| 12132 | packed[2] = struct.pack("!H", length) |
| 12133 | return ''.join(packed) |
| 12134 | |
| 12135 | @staticmethod |
| 12136 | def unpack(reader): |
| 12137 | obj = group_mod_failed_error_msg() |
| 12138 | _version = reader.read("!B")[0] |
| 12139 | assert(_version == 4) |
| 12140 | _type = reader.read("!B")[0] |
| 12141 | assert(_type == 1) |
| 12142 | _length = reader.read("!H")[0] |
| 12143 | orig_reader = reader |
| 12144 | reader = orig_reader.slice(_length, 4) |
| 12145 | obj.xid = reader.read("!L")[0] |
| 12146 | _err_type = reader.read("!H")[0] |
| 12147 | assert(_err_type == 6) |
| 12148 | obj.code = reader.read("!H")[0] |
| 12149 | obj.data = str(reader.read_all()) |
| 12150 | return obj |
| 12151 | |
| 12152 | def __eq__(self, other): |
| 12153 | if type(self) != type(other): return False |
| 12154 | if self.xid != other.xid: return False |
| 12155 | if self.code != other.code: return False |
| 12156 | if self.data != other.data: return False |
| 12157 | return True |
| 12158 | |
| 12159 | def pretty_print(self, q): |
| 12160 | q.text("group_mod_failed_error_msg {") |
| 12161 | with q.group(): |
| 12162 | with q.indent(2): |
| 12163 | q.breakable() |
| 12164 | q.text("xid = "); |
| 12165 | if self.xid != None: |
| 12166 | q.text("%#x" % self.xid) |
| 12167 | else: |
| 12168 | q.text('None') |
| 12169 | q.text(","); q.breakable() |
| 12170 | q.text("code = "); |
| 12171 | q.text("%#x" % self.code) |
| 12172 | q.text(","); q.breakable() |
| 12173 | q.text("data = "); |
| 12174 | q.pp(self.data) |
| 12175 | q.breakable() |
| 12176 | q.text('}') |
| 12177 | |
| 12178 | error_msg.subtypes[6] = group_mod_failed_error_msg |
| 12179 | |
| 12180 | class group_modify(group_mod): |
| 12181 | version = 4 |
| 12182 | type = 15 |
| 12183 | command = 1 |
| 12184 | |
| 12185 | def __init__(self, xid=None, group_type=None, group_id=None, buckets=None): |
| 12186 | if xid != None: |
| 12187 | self.xid = xid |
| 12188 | else: |
| 12189 | self.xid = None |
| 12190 | if group_type != None: |
| 12191 | self.group_type = group_type |
| 12192 | else: |
| 12193 | self.group_type = 0 |
| 12194 | if group_id != None: |
| 12195 | self.group_id = group_id |
| 12196 | else: |
| 12197 | self.group_id = 0 |
| 12198 | if buckets != None: |
| 12199 | self.buckets = buckets |
| 12200 | else: |
| 12201 | self.buckets = [] |
| 12202 | return |
| 12203 | |
| 12204 | def pack(self): |
| 12205 | packed = [] |
| 12206 | packed.append(struct.pack("!B", self.version)) |
| 12207 | packed.append(struct.pack("!B", self.type)) |
| 12208 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 12209 | packed.append(struct.pack("!L", self.xid)) |
| 12210 | packed.append(struct.pack("!H", self.command)) |
| 12211 | packed.append(struct.pack("!B", self.group_type)) |
| 12212 | packed.append('\x00' * 1) |
| 12213 | packed.append(struct.pack("!L", self.group_id)) |
| 12214 | packed.append(loxi.generic_util.pack_list(self.buckets)) |
| 12215 | length = sum([len(x) for x in packed]) |
| 12216 | packed[2] = struct.pack("!H", length) |
| 12217 | return ''.join(packed) |
| 12218 | |
| 12219 | @staticmethod |
| 12220 | def unpack(reader): |
| 12221 | obj = group_modify() |
| 12222 | _version = reader.read("!B")[0] |
| 12223 | assert(_version == 4) |
| 12224 | _type = reader.read("!B")[0] |
| 12225 | assert(_type == 15) |
| 12226 | _length = reader.read("!H")[0] |
| 12227 | orig_reader = reader |
| 12228 | reader = orig_reader.slice(_length, 4) |
| 12229 | obj.xid = reader.read("!L")[0] |
| 12230 | _command = reader.read("!H")[0] |
| 12231 | assert(_command == 1) |
| 12232 | obj.group_type = reader.read("!B")[0] |
| 12233 | reader.skip(1) |
| 12234 | obj.group_id = reader.read("!L")[0] |
| 12235 | obj.buckets = loxi.generic_util.unpack_list(reader, ofp.common.bucket.unpack) |
| 12236 | return obj |
| 12237 | |
| 12238 | def __eq__(self, other): |
| 12239 | if type(self) != type(other): return False |
| 12240 | if self.xid != other.xid: return False |
| 12241 | if self.group_type != other.group_type: return False |
| 12242 | if self.group_id != other.group_id: return False |
| 12243 | if self.buckets != other.buckets: return False |
| 12244 | return True |
| 12245 | |
| 12246 | def pretty_print(self, q): |
| 12247 | q.text("group_modify {") |
| 12248 | with q.group(): |
| 12249 | with q.indent(2): |
| 12250 | q.breakable() |
| 12251 | q.text("xid = "); |
| 12252 | if self.xid != None: |
| 12253 | q.text("%#x" % self.xid) |
| 12254 | else: |
| 12255 | q.text('None') |
| 12256 | q.text(","); q.breakable() |
| 12257 | q.text("group_type = "); |
| 12258 | q.text("%#x" % self.group_type) |
| 12259 | q.text(","); q.breakable() |
| 12260 | q.text("group_id = "); |
| 12261 | q.text("%#x" % self.group_id) |
| 12262 | q.text(","); q.breakable() |
| 12263 | q.text("buckets = "); |
| 12264 | q.pp(self.buckets) |
| 12265 | q.breakable() |
| 12266 | q.text('}') |
| 12267 | |
| 12268 | group_mod.subtypes[1] = group_modify |
| 12269 | |
| 12270 | class group_stats_reply(stats_reply): |
| 12271 | version = 4 |
| 12272 | type = 19 |
| 12273 | stats_type = 6 |
| 12274 | |
| 12275 | def __init__(self, xid=None, flags=None, entries=None): |
| 12276 | if xid != None: |
| 12277 | self.xid = xid |
| 12278 | else: |
| 12279 | self.xid = None |
| 12280 | if flags != None: |
| 12281 | self.flags = flags |
| 12282 | else: |
| 12283 | self.flags = 0 |
| 12284 | if entries != None: |
| 12285 | self.entries = entries |
| 12286 | else: |
| 12287 | self.entries = [] |
| 12288 | return |
| 12289 | |
| 12290 | def pack(self): |
| 12291 | packed = [] |
| 12292 | packed.append(struct.pack("!B", self.version)) |
| 12293 | packed.append(struct.pack("!B", self.type)) |
| 12294 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 12295 | packed.append(struct.pack("!L", self.xid)) |
| 12296 | packed.append(struct.pack("!H", self.stats_type)) |
| 12297 | packed.append(struct.pack("!H", self.flags)) |
| 12298 | packed.append('\x00' * 4) |
| 12299 | packed.append(loxi.generic_util.pack_list(self.entries)) |
| 12300 | length = sum([len(x) for x in packed]) |
| 12301 | packed[2] = struct.pack("!H", length) |
| 12302 | return ''.join(packed) |
| 12303 | |
| 12304 | @staticmethod |
| 12305 | def unpack(reader): |
| 12306 | obj = group_stats_reply() |
| 12307 | _version = reader.read("!B")[0] |
| 12308 | assert(_version == 4) |
| 12309 | _type = reader.read("!B")[0] |
| 12310 | assert(_type == 19) |
| 12311 | _length = reader.read("!H")[0] |
| 12312 | orig_reader = reader |
| 12313 | reader = orig_reader.slice(_length, 4) |
| 12314 | obj.xid = reader.read("!L")[0] |
| 12315 | _stats_type = reader.read("!H")[0] |
| 12316 | assert(_stats_type == 6) |
| 12317 | obj.flags = reader.read("!H")[0] |
| 12318 | reader.skip(4) |
| 12319 | obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.group_stats_entry.unpack) |
| 12320 | return obj |
| 12321 | |
| 12322 | def __eq__(self, other): |
| 12323 | if type(self) != type(other): return False |
| 12324 | if self.xid != other.xid: return False |
| 12325 | if self.flags != other.flags: return False |
| 12326 | if self.entries != other.entries: return False |
| 12327 | return True |
| 12328 | |
| 12329 | def pretty_print(self, q): |
| 12330 | q.text("group_stats_reply {") |
| 12331 | with q.group(): |
| 12332 | with q.indent(2): |
| 12333 | q.breakable() |
| 12334 | q.text("xid = "); |
| 12335 | if self.xid != None: |
| 12336 | q.text("%#x" % self.xid) |
| 12337 | else: |
| 12338 | q.text('None') |
| 12339 | q.text(","); q.breakable() |
| 12340 | q.text("flags = "); |
| 12341 | q.text("%#x" % self.flags) |
| 12342 | q.text(","); q.breakable() |
| 12343 | q.text("entries = "); |
| 12344 | q.pp(self.entries) |
| 12345 | q.breakable() |
| 12346 | q.text('}') |
| 12347 | |
| 12348 | stats_reply.subtypes[6] = group_stats_reply |
| 12349 | |
| 12350 | class group_stats_request(stats_request): |
| 12351 | version = 4 |
| 12352 | type = 18 |
| 12353 | stats_type = 6 |
| 12354 | |
| 12355 | def __init__(self, xid=None, flags=None, group_id=None): |
| 12356 | if xid != None: |
| 12357 | self.xid = xid |
| 12358 | else: |
| 12359 | self.xid = None |
| 12360 | if flags != None: |
| 12361 | self.flags = flags |
| 12362 | else: |
| 12363 | self.flags = 0 |
| 12364 | if group_id != None: |
| 12365 | self.group_id = group_id |
| 12366 | else: |
| 12367 | self.group_id = 0 |
| 12368 | return |
| 12369 | |
| 12370 | def pack(self): |
| 12371 | packed = [] |
| 12372 | packed.append(struct.pack("!B", self.version)) |
| 12373 | packed.append(struct.pack("!B", self.type)) |
| 12374 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 12375 | packed.append(struct.pack("!L", self.xid)) |
| 12376 | packed.append(struct.pack("!H", self.stats_type)) |
| 12377 | packed.append(struct.pack("!H", self.flags)) |
| 12378 | packed.append('\x00' * 4) |
| 12379 | packed.append(struct.pack("!L", self.group_id)) |
| 12380 | packed.append('\x00' * 4) |
| 12381 | length = sum([len(x) for x in packed]) |
| 12382 | packed[2] = struct.pack("!H", length) |
| 12383 | return ''.join(packed) |
| 12384 | |
| 12385 | @staticmethod |
| 12386 | def unpack(reader): |
| 12387 | obj = group_stats_request() |
| 12388 | _version = reader.read("!B")[0] |
| 12389 | assert(_version == 4) |
| 12390 | _type = reader.read("!B")[0] |
| 12391 | assert(_type == 18) |
| 12392 | _length = reader.read("!H")[0] |
| 12393 | orig_reader = reader |
| 12394 | reader = orig_reader.slice(_length, 4) |
| 12395 | obj.xid = reader.read("!L")[0] |
| 12396 | _stats_type = reader.read("!H")[0] |
| 12397 | assert(_stats_type == 6) |
| 12398 | obj.flags = reader.read("!H")[0] |
| 12399 | reader.skip(4) |
| 12400 | obj.group_id = reader.read("!L")[0] |
| 12401 | reader.skip(4) |
| 12402 | return obj |
| 12403 | |
| 12404 | def __eq__(self, other): |
| 12405 | if type(self) != type(other): return False |
| 12406 | if self.xid != other.xid: return False |
| 12407 | if self.flags != other.flags: return False |
| 12408 | if self.group_id != other.group_id: return False |
| 12409 | return True |
| 12410 | |
| 12411 | def pretty_print(self, q): |
| 12412 | q.text("group_stats_request {") |
| 12413 | with q.group(): |
| 12414 | with q.indent(2): |
| 12415 | q.breakable() |
| 12416 | q.text("xid = "); |
| 12417 | if self.xid != None: |
| 12418 | q.text("%#x" % self.xid) |
| 12419 | else: |
| 12420 | q.text('None') |
| 12421 | q.text(","); q.breakable() |
| 12422 | q.text("flags = "); |
| 12423 | q.text("%#x" % self.flags) |
| 12424 | q.text(","); q.breakable() |
| 12425 | q.text("group_id = "); |
| 12426 | q.text("%#x" % self.group_id) |
| 12427 | q.breakable() |
| 12428 | q.text('}') |
| 12429 | |
| 12430 | stats_request.subtypes[6] = group_stats_request |
| 12431 | |
| 12432 | class hello(message): |
| 12433 | version = 4 |
| 12434 | type = 0 |
| 12435 | |
| 12436 | def __init__(self, xid=None, elements=None): |
| 12437 | if xid != None: |
| 12438 | self.xid = xid |
| 12439 | else: |
| 12440 | self.xid = None |
| 12441 | if elements != None: |
| 12442 | self.elements = elements |
| 12443 | else: |
| 12444 | self.elements = [] |
| 12445 | return |
| 12446 | |
| 12447 | def pack(self): |
| 12448 | packed = [] |
| 12449 | packed.append(struct.pack("!B", self.version)) |
| 12450 | packed.append(struct.pack("!B", self.type)) |
| 12451 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 12452 | packed.append(struct.pack("!L", self.xid)) |
| 12453 | packed.append(loxi.generic_util.pack_list(self.elements)) |
| 12454 | length = sum([len(x) for x in packed]) |
| 12455 | packed[2] = struct.pack("!H", length) |
| 12456 | return ''.join(packed) |
| 12457 | |
| 12458 | @staticmethod |
| 12459 | def unpack(reader): |
| 12460 | obj = hello() |
| 12461 | _version = reader.read("!B")[0] |
| 12462 | assert(_version == 4) |
| 12463 | _type = reader.read("!B")[0] |
| 12464 | assert(_type == 0) |
| 12465 | _length = reader.read("!H")[0] |
| 12466 | orig_reader = reader |
| 12467 | reader = orig_reader.slice(_length, 4) |
| 12468 | obj.xid = reader.read("!L")[0] |
| 12469 | obj.elements = loxi.generic_util.unpack_list(reader, ofp.common.hello_elem.unpack) |
| 12470 | return obj |
| 12471 | |
| 12472 | def __eq__(self, other): |
| 12473 | if type(self) != type(other): return False |
| 12474 | if self.xid != other.xid: return False |
| 12475 | if self.elements != other.elements: return False |
| 12476 | return True |
| 12477 | |
| 12478 | def pretty_print(self, q): |
| 12479 | q.text("hello {") |
| 12480 | with q.group(): |
| 12481 | with q.indent(2): |
| 12482 | q.breakable() |
| 12483 | q.text("xid = "); |
| 12484 | if self.xid != None: |
| 12485 | q.text("%#x" % self.xid) |
| 12486 | else: |
| 12487 | q.text('None') |
| 12488 | q.text(","); q.breakable() |
| 12489 | q.text("elements = "); |
| 12490 | q.pp(self.elements) |
| 12491 | q.breakable() |
| 12492 | q.text('}') |
| 12493 | |
| 12494 | message.subtypes[0] = hello |
| 12495 | |
| 12496 | class hello_failed_error_msg(error_msg): |
| 12497 | version = 4 |
| 12498 | type = 1 |
| 12499 | err_type = 0 |
| 12500 | |
| 12501 | def __init__(self, xid=None, code=None, data=None): |
| 12502 | if xid != None: |
| 12503 | self.xid = xid |
| 12504 | else: |
| 12505 | self.xid = None |
| 12506 | if code != None: |
| 12507 | self.code = code |
| 12508 | else: |
| 12509 | self.code = 0 |
| 12510 | if data != None: |
| 12511 | self.data = data |
| 12512 | else: |
| 12513 | self.data = '' |
| 12514 | return |
| 12515 | |
| 12516 | def pack(self): |
| 12517 | packed = [] |
| 12518 | packed.append(struct.pack("!B", self.version)) |
| 12519 | packed.append(struct.pack("!B", self.type)) |
| 12520 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 12521 | packed.append(struct.pack("!L", self.xid)) |
| 12522 | packed.append(struct.pack("!H", self.err_type)) |
| 12523 | packed.append(struct.pack("!H", self.code)) |
| 12524 | packed.append(self.data) |
| 12525 | length = sum([len(x) for x in packed]) |
| 12526 | packed[2] = struct.pack("!H", length) |
| 12527 | return ''.join(packed) |
| 12528 | |
| 12529 | @staticmethod |
| 12530 | def unpack(reader): |
| 12531 | obj = hello_failed_error_msg() |
| 12532 | _version = reader.read("!B")[0] |
| 12533 | assert(_version == 4) |
| 12534 | _type = reader.read("!B")[0] |
| 12535 | assert(_type == 1) |
| 12536 | _length = reader.read("!H")[0] |
| 12537 | orig_reader = reader |
| 12538 | reader = orig_reader.slice(_length, 4) |
| 12539 | obj.xid = reader.read("!L")[0] |
| 12540 | _err_type = reader.read("!H")[0] |
| 12541 | assert(_err_type == 0) |
| 12542 | obj.code = reader.read("!H")[0] |
| 12543 | obj.data = str(reader.read_all()) |
| 12544 | return obj |
| 12545 | |
| 12546 | def __eq__(self, other): |
| 12547 | if type(self) != type(other): return False |
| 12548 | if self.xid != other.xid: return False |
| 12549 | if self.code != other.code: return False |
| 12550 | if self.data != other.data: return False |
| 12551 | return True |
| 12552 | |
| 12553 | def pretty_print(self, q): |
| 12554 | q.text("hello_failed_error_msg {") |
| 12555 | with q.group(): |
| 12556 | with q.indent(2): |
| 12557 | q.breakable() |
| 12558 | q.text("xid = "); |
| 12559 | if self.xid != None: |
| 12560 | q.text("%#x" % self.xid) |
| 12561 | else: |
| 12562 | q.text('None') |
| 12563 | q.text(","); q.breakable() |
| 12564 | q.text("code = "); |
| 12565 | q.text("%#x" % self.code) |
| 12566 | q.text(","); q.breakable() |
| 12567 | q.text("data = "); |
| 12568 | q.pp(self.data) |
| 12569 | q.breakable() |
| 12570 | q.text('}') |
| 12571 | |
| 12572 | error_msg.subtypes[0] = hello_failed_error_msg |
| 12573 | |
| 12574 | class meter_config_stats_reply(stats_reply): |
| 12575 | version = 4 |
| 12576 | type = 19 |
| 12577 | stats_type = 10 |
| 12578 | |
| 12579 | def __init__(self, xid=None, flags=None, entries=None): |
| 12580 | if xid != None: |
| 12581 | self.xid = xid |
| 12582 | else: |
| 12583 | self.xid = None |
| 12584 | if flags != None: |
| 12585 | self.flags = flags |
| 12586 | else: |
| 12587 | self.flags = 0 |
| 12588 | if entries != None: |
| 12589 | self.entries = entries |
| 12590 | else: |
| 12591 | self.entries = [] |
| 12592 | return |
| 12593 | |
| 12594 | def pack(self): |
| 12595 | packed = [] |
| 12596 | packed.append(struct.pack("!B", self.version)) |
| 12597 | packed.append(struct.pack("!B", self.type)) |
| 12598 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 12599 | packed.append(struct.pack("!L", self.xid)) |
| 12600 | packed.append(struct.pack("!H", self.stats_type)) |
| 12601 | packed.append(struct.pack("!H", self.flags)) |
| 12602 | packed.append('\x00' * 4) |
| 12603 | packed.append(loxi.generic_util.pack_list(self.entries)) |
| 12604 | length = sum([len(x) for x in packed]) |
| 12605 | packed[2] = struct.pack("!H", length) |
| 12606 | return ''.join(packed) |
| 12607 | |
| 12608 | @staticmethod |
| 12609 | def unpack(reader): |
| 12610 | obj = meter_config_stats_reply() |
| 12611 | _version = reader.read("!B")[0] |
| 12612 | assert(_version == 4) |
| 12613 | _type = reader.read("!B")[0] |
| 12614 | assert(_type == 19) |
| 12615 | _length = reader.read("!H")[0] |
| 12616 | orig_reader = reader |
| 12617 | reader = orig_reader.slice(_length, 4) |
| 12618 | obj.xid = reader.read("!L")[0] |
| 12619 | _stats_type = reader.read("!H")[0] |
| 12620 | assert(_stats_type == 10) |
| 12621 | obj.flags = reader.read("!H")[0] |
| 12622 | reader.skip(4) |
| 12623 | obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.meter_config.unpack) |
| 12624 | return obj |
| 12625 | |
| 12626 | def __eq__(self, other): |
| 12627 | if type(self) != type(other): return False |
| 12628 | if self.xid != other.xid: return False |
| 12629 | if self.flags != other.flags: return False |
| 12630 | if self.entries != other.entries: return False |
| 12631 | return True |
| 12632 | |
| 12633 | def pretty_print(self, q): |
| 12634 | q.text("meter_config_stats_reply {") |
| 12635 | with q.group(): |
| 12636 | with q.indent(2): |
| 12637 | q.breakable() |
| 12638 | q.text("xid = "); |
| 12639 | if self.xid != None: |
| 12640 | q.text("%#x" % self.xid) |
| 12641 | else: |
| 12642 | q.text('None') |
| 12643 | q.text(","); q.breakable() |
| 12644 | q.text("flags = "); |
| 12645 | q.text("%#x" % self.flags) |
| 12646 | q.text(","); q.breakable() |
| 12647 | q.text("entries = "); |
| 12648 | q.pp(self.entries) |
| 12649 | q.breakable() |
| 12650 | q.text('}') |
| 12651 | |
| 12652 | stats_reply.subtypes[10] = meter_config_stats_reply |
| 12653 | |
| 12654 | class meter_config_stats_request(stats_request): |
| 12655 | version = 4 |
| 12656 | type = 18 |
| 12657 | stats_type = 10 |
| 12658 | |
| 12659 | def __init__(self, xid=None, flags=None, meter_id=None): |
| 12660 | if xid != None: |
| 12661 | self.xid = xid |
| 12662 | else: |
| 12663 | self.xid = None |
| 12664 | if flags != None: |
| 12665 | self.flags = flags |
| 12666 | else: |
| 12667 | self.flags = 0 |
| 12668 | if meter_id != None: |
| 12669 | self.meter_id = meter_id |
| 12670 | else: |
| 12671 | self.meter_id = 0 |
| 12672 | return |
| 12673 | |
| 12674 | def pack(self): |
| 12675 | packed = [] |
| 12676 | packed.append(struct.pack("!B", self.version)) |
| 12677 | packed.append(struct.pack("!B", self.type)) |
| 12678 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 12679 | packed.append(struct.pack("!L", self.xid)) |
| 12680 | packed.append(struct.pack("!H", self.stats_type)) |
| 12681 | packed.append(struct.pack("!H", self.flags)) |
| 12682 | packed.append('\x00' * 4) |
| 12683 | packed.append(struct.pack("!L", self.meter_id)) |
| 12684 | packed.append('\x00' * 4) |
| 12685 | length = sum([len(x) for x in packed]) |
| 12686 | packed[2] = struct.pack("!H", length) |
| 12687 | return ''.join(packed) |
| 12688 | |
| 12689 | @staticmethod |
| 12690 | def unpack(reader): |
| 12691 | obj = meter_config_stats_request() |
| 12692 | _version = reader.read("!B")[0] |
| 12693 | assert(_version == 4) |
| 12694 | _type = reader.read("!B")[0] |
| 12695 | assert(_type == 18) |
| 12696 | _length = reader.read("!H")[0] |
| 12697 | orig_reader = reader |
| 12698 | reader = orig_reader.slice(_length, 4) |
| 12699 | obj.xid = reader.read("!L")[0] |
| 12700 | _stats_type = reader.read("!H")[0] |
| 12701 | assert(_stats_type == 10) |
| 12702 | obj.flags = reader.read("!H")[0] |
| 12703 | reader.skip(4) |
| 12704 | obj.meter_id = reader.read("!L")[0] |
| 12705 | reader.skip(4) |
| 12706 | return obj |
| 12707 | |
| 12708 | def __eq__(self, other): |
| 12709 | if type(self) != type(other): return False |
| 12710 | if self.xid != other.xid: return False |
| 12711 | if self.flags != other.flags: return False |
| 12712 | if self.meter_id != other.meter_id: return False |
| 12713 | return True |
| 12714 | |
| 12715 | def pretty_print(self, q): |
| 12716 | q.text("meter_config_stats_request {") |
| 12717 | with q.group(): |
| 12718 | with q.indent(2): |
| 12719 | q.breakable() |
| 12720 | q.text("xid = "); |
| 12721 | if self.xid != None: |
| 12722 | q.text("%#x" % self.xid) |
| 12723 | else: |
| 12724 | q.text('None') |
| 12725 | q.text(","); q.breakable() |
| 12726 | q.text("flags = "); |
| 12727 | q.text("%#x" % self.flags) |
| 12728 | q.text(","); q.breakable() |
| 12729 | q.text("meter_id = "); |
| 12730 | q.text("%#x" % self.meter_id) |
| 12731 | q.breakable() |
| 12732 | q.text('}') |
| 12733 | |
| 12734 | stats_request.subtypes[10] = meter_config_stats_request |
| 12735 | |
| 12736 | class meter_features_stats_reply(stats_reply): |
| 12737 | version = 4 |
| 12738 | type = 19 |
| 12739 | stats_type = 11 |
| 12740 | |
| 12741 | def __init__(self, xid=None, flags=None, features=None): |
| 12742 | if xid != None: |
| 12743 | self.xid = xid |
| 12744 | else: |
| 12745 | self.xid = None |
| 12746 | if flags != None: |
| 12747 | self.flags = flags |
| 12748 | else: |
| 12749 | self.flags = 0 |
| 12750 | if features != None: |
| 12751 | self.features = features |
| 12752 | else: |
| 12753 | self.features = ofp.meter_features() |
| 12754 | return |
| 12755 | |
| 12756 | def pack(self): |
| 12757 | packed = [] |
| 12758 | packed.append(struct.pack("!B", self.version)) |
| 12759 | packed.append(struct.pack("!B", self.type)) |
| 12760 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 12761 | packed.append(struct.pack("!L", self.xid)) |
| 12762 | packed.append(struct.pack("!H", self.stats_type)) |
| 12763 | packed.append(struct.pack("!H", self.flags)) |
| 12764 | packed.append('\x00' * 4) |
| 12765 | packed.append(self.features.pack()) |
| 12766 | length = sum([len(x) for x in packed]) |
| 12767 | packed[2] = struct.pack("!H", length) |
| 12768 | return ''.join(packed) |
| 12769 | |
| 12770 | @staticmethod |
| 12771 | def unpack(reader): |
| 12772 | obj = meter_features_stats_reply() |
| 12773 | _version = reader.read("!B")[0] |
| 12774 | assert(_version == 4) |
| 12775 | _type = reader.read("!B")[0] |
| 12776 | assert(_type == 19) |
| 12777 | _length = reader.read("!H")[0] |
| 12778 | orig_reader = reader |
| 12779 | reader = orig_reader.slice(_length, 4) |
| 12780 | obj.xid = reader.read("!L")[0] |
| 12781 | _stats_type = reader.read("!H")[0] |
| 12782 | assert(_stats_type == 11) |
| 12783 | obj.flags = reader.read("!H")[0] |
| 12784 | reader.skip(4) |
| 12785 | obj.features = ofp.meter_features.unpack(reader) |
| 12786 | return obj |
| 12787 | |
| 12788 | def __eq__(self, other): |
| 12789 | if type(self) != type(other): return False |
| 12790 | if self.xid != other.xid: return False |
| 12791 | if self.flags != other.flags: return False |
| 12792 | if self.features != other.features: return False |
| 12793 | return True |
| 12794 | |
| 12795 | def pretty_print(self, q): |
| 12796 | q.text("meter_features_stats_reply {") |
| 12797 | with q.group(): |
| 12798 | with q.indent(2): |
| 12799 | q.breakable() |
| 12800 | q.text("xid = "); |
| 12801 | if self.xid != None: |
| 12802 | q.text("%#x" % self.xid) |
| 12803 | else: |
| 12804 | q.text('None') |
| 12805 | q.text(","); q.breakable() |
| 12806 | q.text("flags = "); |
| 12807 | q.text("%#x" % self.flags) |
| 12808 | q.text(","); q.breakable() |
| 12809 | q.text("features = "); |
| 12810 | q.pp(self.features) |
| 12811 | q.breakable() |
| 12812 | q.text('}') |
| 12813 | |
| 12814 | stats_reply.subtypes[11] = meter_features_stats_reply |
| 12815 | |
| 12816 | class meter_features_stats_request(stats_request): |
| 12817 | version = 4 |
| 12818 | type = 18 |
| 12819 | stats_type = 11 |
| 12820 | |
| 12821 | def __init__(self, xid=None, flags=None): |
| 12822 | if xid != None: |
| 12823 | self.xid = xid |
| 12824 | else: |
| 12825 | self.xid = None |
| 12826 | if flags != None: |
| 12827 | self.flags = flags |
| 12828 | else: |
| 12829 | self.flags = 0 |
| 12830 | return |
| 12831 | |
| 12832 | def pack(self): |
| 12833 | packed = [] |
| 12834 | packed.append(struct.pack("!B", self.version)) |
| 12835 | packed.append(struct.pack("!B", self.type)) |
| 12836 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 12837 | packed.append(struct.pack("!L", self.xid)) |
| 12838 | packed.append(struct.pack("!H", self.stats_type)) |
| 12839 | packed.append(struct.pack("!H", self.flags)) |
| 12840 | packed.append('\x00' * 4) |
| 12841 | length = sum([len(x) for x in packed]) |
| 12842 | packed[2] = struct.pack("!H", length) |
| 12843 | return ''.join(packed) |
| 12844 | |
| 12845 | @staticmethod |
| 12846 | def unpack(reader): |
| 12847 | obj = meter_features_stats_request() |
| 12848 | _version = reader.read("!B")[0] |
| 12849 | assert(_version == 4) |
| 12850 | _type = reader.read("!B")[0] |
| 12851 | assert(_type == 18) |
| 12852 | _length = reader.read("!H")[0] |
| 12853 | orig_reader = reader |
| 12854 | reader = orig_reader.slice(_length, 4) |
| 12855 | obj.xid = reader.read("!L")[0] |
| 12856 | _stats_type = reader.read("!H")[0] |
| 12857 | assert(_stats_type == 11) |
| 12858 | obj.flags = reader.read("!H")[0] |
| 12859 | reader.skip(4) |
| 12860 | return obj |
| 12861 | |
| 12862 | def __eq__(self, other): |
| 12863 | if type(self) != type(other): return False |
| 12864 | if self.xid != other.xid: return False |
| 12865 | if self.flags != other.flags: return False |
| 12866 | return True |
| 12867 | |
| 12868 | def pretty_print(self, q): |
| 12869 | q.text("meter_features_stats_request {") |
| 12870 | with q.group(): |
| 12871 | with q.indent(2): |
| 12872 | q.breakable() |
| 12873 | q.text("xid = "); |
| 12874 | if self.xid != None: |
| 12875 | q.text("%#x" % self.xid) |
| 12876 | else: |
| 12877 | q.text('None') |
| 12878 | q.text(","); q.breakable() |
| 12879 | q.text("flags = "); |
| 12880 | q.text("%#x" % self.flags) |
| 12881 | q.breakable() |
| 12882 | q.text('}') |
| 12883 | |
| 12884 | stats_request.subtypes[11] = meter_features_stats_request |
| 12885 | |
| 12886 | class meter_mod(message): |
| 12887 | version = 4 |
| 12888 | type = 29 |
| 12889 | |
| 12890 | def __init__(self, xid=None, command=None, flags=None, meter_id=None, meters=None): |
| 12891 | if xid != None: |
| 12892 | self.xid = xid |
| 12893 | else: |
| 12894 | self.xid = None |
| 12895 | if command != None: |
| 12896 | self.command = command |
| 12897 | else: |
| 12898 | self.command = 0 |
| 12899 | if flags != None: |
| 12900 | self.flags = flags |
| 12901 | else: |
| 12902 | self.flags = 0 |
| 12903 | if meter_id != None: |
| 12904 | self.meter_id = meter_id |
| 12905 | else: |
| 12906 | self.meter_id = 0 |
| 12907 | if meters != None: |
| 12908 | self.meters = meters |
| 12909 | else: |
| 12910 | self.meters = [] |
| 12911 | return |
| 12912 | |
| 12913 | def pack(self): |
| 12914 | packed = [] |
| 12915 | packed.append(struct.pack("!B", self.version)) |
| 12916 | packed.append(struct.pack("!B", self.type)) |
| 12917 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 12918 | packed.append(struct.pack("!L", self.xid)) |
| 12919 | packed.append(struct.pack("!H", self.command)) |
| 12920 | packed.append(struct.pack("!H", self.flags)) |
| 12921 | packed.append(struct.pack("!L", self.meter_id)) |
| 12922 | packed.append(loxi.generic_util.pack_list(self.meters)) |
| 12923 | length = sum([len(x) for x in packed]) |
| 12924 | packed[2] = struct.pack("!H", length) |
| 12925 | return ''.join(packed) |
| 12926 | |
| 12927 | @staticmethod |
| 12928 | def unpack(reader): |
| 12929 | obj = meter_mod() |
| 12930 | _version = reader.read("!B")[0] |
| 12931 | assert(_version == 4) |
| 12932 | _type = reader.read("!B")[0] |
| 12933 | assert(_type == 29) |
| 12934 | _length = reader.read("!H")[0] |
| 12935 | orig_reader = reader |
| 12936 | reader = orig_reader.slice(_length, 4) |
| 12937 | obj.xid = reader.read("!L")[0] |
| 12938 | obj.command = reader.read("!H")[0] |
| 12939 | obj.flags = reader.read("!H")[0] |
| 12940 | obj.meter_id = reader.read("!L")[0] |
| 12941 | obj.meters = loxi.generic_util.unpack_list(reader, ofp.meter_band.meter_band.unpack) |
| 12942 | return obj |
| 12943 | |
| 12944 | def __eq__(self, other): |
| 12945 | if type(self) != type(other): return False |
| 12946 | if self.xid != other.xid: return False |
| 12947 | if self.command != other.command: return False |
| 12948 | if self.flags != other.flags: return False |
| 12949 | if self.meter_id != other.meter_id: return False |
| 12950 | if self.meters != other.meters: return False |
| 12951 | return True |
| 12952 | |
| 12953 | def pretty_print(self, q): |
| 12954 | q.text("meter_mod {") |
| 12955 | with q.group(): |
| 12956 | with q.indent(2): |
| 12957 | q.breakable() |
| 12958 | q.text("xid = "); |
| 12959 | if self.xid != None: |
| 12960 | q.text("%#x" % self.xid) |
| 12961 | else: |
| 12962 | q.text('None') |
| 12963 | q.text(","); q.breakable() |
| 12964 | q.text("command = "); |
| 12965 | q.text("%#x" % self.command) |
| 12966 | q.text(","); q.breakable() |
| 12967 | q.text("flags = "); |
| 12968 | q.text("%#x" % self.flags) |
| 12969 | q.text(","); q.breakable() |
| 12970 | q.text("meter_id = "); |
| 12971 | q.text("%#x" % self.meter_id) |
| 12972 | q.text(","); q.breakable() |
| 12973 | q.text("meters = "); |
| 12974 | q.pp(self.meters) |
| 12975 | q.breakable() |
| 12976 | q.text('}') |
| 12977 | |
| 12978 | message.subtypes[29] = meter_mod |
| 12979 | |
| 12980 | class meter_mod_failed_error_msg(error_msg): |
| 12981 | version = 4 |
| 12982 | type = 1 |
| 12983 | err_type = 12 |
| 12984 | |
| 12985 | def __init__(self, xid=None, code=None, data=None): |
| 12986 | if xid != None: |
| 12987 | self.xid = xid |
| 12988 | else: |
| 12989 | self.xid = None |
| 12990 | if code != None: |
| 12991 | self.code = code |
| 12992 | else: |
| 12993 | self.code = 0 |
| 12994 | if data != None: |
| 12995 | self.data = data |
| 12996 | else: |
| 12997 | self.data = '' |
| 12998 | return |
| 12999 | |
| 13000 | def pack(self): |
| 13001 | packed = [] |
| 13002 | packed.append(struct.pack("!B", self.version)) |
| 13003 | packed.append(struct.pack("!B", self.type)) |
| 13004 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 13005 | packed.append(struct.pack("!L", self.xid)) |
| 13006 | packed.append(struct.pack("!H", self.err_type)) |
| 13007 | packed.append(struct.pack("!H", self.code)) |
| 13008 | packed.append(self.data) |
| 13009 | length = sum([len(x) for x in packed]) |
| 13010 | packed[2] = struct.pack("!H", length) |
| 13011 | return ''.join(packed) |
| 13012 | |
| 13013 | @staticmethod |
| 13014 | def unpack(reader): |
| 13015 | obj = meter_mod_failed_error_msg() |
| 13016 | _version = reader.read("!B")[0] |
| 13017 | assert(_version == 4) |
| 13018 | _type = reader.read("!B")[0] |
| 13019 | assert(_type == 1) |
| 13020 | _length = reader.read("!H")[0] |
| 13021 | orig_reader = reader |
| 13022 | reader = orig_reader.slice(_length, 4) |
| 13023 | obj.xid = reader.read("!L")[0] |
| 13024 | _err_type = reader.read("!H")[0] |
| 13025 | assert(_err_type == 12) |
| 13026 | obj.code = reader.read("!H")[0] |
| 13027 | obj.data = str(reader.read_all()) |
| 13028 | return obj |
| 13029 | |
| 13030 | def __eq__(self, other): |
| 13031 | if type(self) != type(other): return False |
| 13032 | if self.xid != other.xid: return False |
| 13033 | if self.code != other.code: return False |
| 13034 | if self.data != other.data: return False |
| 13035 | return True |
| 13036 | |
| 13037 | def pretty_print(self, q): |
| 13038 | q.text("meter_mod_failed_error_msg {") |
| 13039 | with q.group(): |
| 13040 | with q.indent(2): |
| 13041 | q.breakable() |
| 13042 | q.text("xid = "); |
| 13043 | if self.xid != None: |
| 13044 | q.text("%#x" % self.xid) |
| 13045 | else: |
| 13046 | q.text('None') |
| 13047 | q.text(","); q.breakable() |
| 13048 | q.text("code = "); |
| 13049 | q.text("%#x" % self.code) |
| 13050 | q.text(","); q.breakable() |
| 13051 | q.text("data = "); |
| 13052 | q.pp(self.data) |
| 13053 | q.breakable() |
| 13054 | q.text('}') |
| 13055 | |
| 13056 | error_msg.subtypes[12] = meter_mod_failed_error_msg |
| 13057 | |
| 13058 | class meter_stats_reply(stats_reply): |
| 13059 | version = 4 |
| 13060 | type = 19 |
| 13061 | stats_type = 9 |
| 13062 | |
| 13063 | def __init__(self, xid=None, flags=None, entries=None): |
| 13064 | if xid != None: |
| 13065 | self.xid = xid |
| 13066 | else: |
| 13067 | self.xid = None |
| 13068 | if flags != None: |
| 13069 | self.flags = flags |
| 13070 | else: |
| 13071 | self.flags = 0 |
| 13072 | if entries != None: |
| 13073 | self.entries = entries |
| 13074 | else: |
| 13075 | self.entries = [] |
| 13076 | return |
| 13077 | |
| 13078 | def pack(self): |
| 13079 | packed = [] |
| 13080 | packed.append(struct.pack("!B", self.version)) |
| 13081 | packed.append(struct.pack("!B", self.type)) |
| 13082 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 13083 | packed.append(struct.pack("!L", self.xid)) |
| 13084 | packed.append(struct.pack("!H", self.stats_type)) |
| 13085 | packed.append(struct.pack("!H", self.flags)) |
| 13086 | packed.append('\x00' * 4) |
| 13087 | packed.append(loxi.generic_util.pack_list(self.entries)) |
| 13088 | length = sum([len(x) for x in packed]) |
| 13089 | packed[2] = struct.pack("!H", length) |
| 13090 | return ''.join(packed) |
| 13091 | |
| 13092 | @staticmethod |
| 13093 | def unpack(reader): |
| 13094 | obj = meter_stats_reply() |
| 13095 | _version = reader.read("!B")[0] |
| 13096 | assert(_version == 4) |
| 13097 | _type = reader.read("!B")[0] |
| 13098 | assert(_type == 19) |
| 13099 | _length = reader.read("!H")[0] |
| 13100 | orig_reader = reader |
| 13101 | reader = orig_reader.slice(_length, 4) |
| 13102 | obj.xid = reader.read("!L")[0] |
| 13103 | _stats_type = reader.read("!H")[0] |
| 13104 | assert(_stats_type == 9) |
| 13105 | obj.flags = reader.read("!H")[0] |
| 13106 | reader.skip(4) |
| 13107 | obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.meter_stats.unpack) |
| 13108 | return obj |
| 13109 | |
| 13110 | def __eq__(self, other): |
| 13111 | if type(self) != type(other): return False |
| 13112 | if self.xid != other.xid: return False |
| 13113 | if self.flags != other.flags: return False |
| 13114 | if self.entries != other.entries: return False |
| 13115 | return True |
| 13116 | |
| 13117 | def pretty_print(self, q): |
| 13118 | q.text("meter_stats_reply {") |
| 13119 | with q.group(): |
| 13120 | with q.indent(2): |
| 13121 | q.breakable() |
| 13122 | q.text("xid = "); |
| 13123 | if self.xid != None: |
| 13124 | q.text("%#x" % self.xid) |
| 13125 | else: |
| 13126 | q.text('None') |
| 13127 | q.text(","); q.breakable() |
| 13128 | q.text("flags = "); |
| 13129 | q.text("%#x" % self.flags) |
| 13130 | q.text(","); q.breakable() |
| 13131 | q.text("entries = "); |
| 13132 | q.pp(self.entries) |
| 13133 | q.breakable() |
| 13134 | q.text('}') |
| 13135 | |
| 13136 | stats_reply.subtypes[9] = meter_stats_reply |
| 13137 | |
| 13138 | class meter_stats_request(stats_request): |
| 13139 | version = 4 |
| 13140 | type = 18 |
| 13141 | stats_type = 9 |
| 13142 | |
| 13143 | def __init__(self, xid=None, flags=None, meter_id=None): |
| 13144 | if xid != None: |
| 13145 | self.xid = xid |
| 13146 | else: |
| 13147 | self.xid = None |
| 13148 | if flags != None: |
| 13149 | self.flags = flags |
| 13150 | else: |
| 13151 | self.flags = 0 |
| 13152 | if meter_id != None: |
| 13153 | self.meter_id = meter_id |
| 13154 | else: |
| 13155 | self.meter_id = 0 |
| 13156 | return |
| 13157 | |
| 13158 | def pack(self): |
| 13159 | packed = [] |
| 13160 | packed.append(struct.pack("!B", self.version)) |
| 13161 | packed.append(struct.pack("!B", self.type)) |
| 13162 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 13163 | packed.append(struct.pack("!L", self.xid)) |
| 13164 | packed.append(struct.pack("!H", self.stats_type)) |
| 13165 | packed.append(struct.pack("!H", self.flags)) |
| 13166 | packed.append('\x00' * 4) |
| 13167 | packed.append(struct.pack("!L", self.meter_id)) |
| 13168 | packed.append('\x00' * 4) |
| 13169 | length = sum([len(x) for x in packed]) |
| 13170 | packed[2] = struct.pack("!H", length) |
| 13171 | return ''.join(packed) |
| 13172 | |
| 13173 | @staticmethod |
| 13174 | def unpack(reader): |
| 13175 | obj = meter_stats_request() |
| 13176 | _version = reader.read("!B")[0] |
| 13177 | assert(_version == 4) |
| 13178 | _type = reader.read("!B")[0] |
| 13179 | assert(_type == 18) |
| 13180 | _length = reader.read("!H")[0] |
| 13181 | orig_reader = reader |
| 13182 | reader = orig_reader.slice(_length, 4) |
| 13183 | obj.xid = reader.read("!L")[0] |
| 13184 | _stats_type = reader.read("!H")[0] |
| 13185 | assert(_stats_type == 9) |
| 13186 | obj.flags = reader.read("!H")[0] |
| 13187 | reader.skip(4) |
| 13188 | obj.meter_id = reader.read("!L")[0] |
| 13189 | reader.skip(4) |
| 13190 | return obj |
| 13191 | |
| 13192 | def __eq__(self, other): |
| 13193 | if type(self) != type(other): return False |
| 13194 | if self.xid != other.xid: return False |
| 13195 | if self.flags != other.flags: return False |
| 13196 | if self.meter_id != other.meter_id: return False |
| 13197 | return True |
| 13198 | |
| 13199 | def pretty_print(self, q): |
| 13200 | q.text("meter_stats_request {") |
| 13201 | with q.group(): |
| 13202 | with q.indent(2): |
| 13203 | q.breakable() |
| 13204 | q.text("xid = "); |
| 13205 | if self.xid != None: |
| 13206 | q.text("%#x" % self.xid) |
| 13207 | else: |
| 13208 | q.text('None') |
| 13209 | q.text(","); q.breakable() |
| 13210 | q.text("flags = "); |
| 13211 | q.text("%#x" % self.flags) |
| 13212 | q.text(","); q.breakable() |
| 13213 | q.text("meter_id = "); |
| 13214 | q.text("%#x" % self.meter_id) |
| 13215 | q.breakable() |
| 13216 | q.text('}') |
| 13217 | |
| 13218 | stats_request.subtypes[9] = meter_stats_request |
| 13219 | |
| 13220 | class nicira_header(experimenter): |
| 13221 | subtypes = {} |
| 13222 | |
| 13223 | version = 4 |
| 13224 | type = 4 |
| 13225 | experimenter = 8992 |
| 13226 | |
| 13227 | def __init__(self, xid=None, subtype=None): |
| 13228 | if xid != None: |
| 13229 | self.xid = xid |
| 13230 | else: |
| 13231 | self.xid = None |
| 13232 | if subtype != None: |
| 13233 | self.subtype = subtype |
| 13234 | else: |
| 13235 | self.subtype = 0 |
| 13236 | return |
| 13237 | |
| 13238 | def pack(self): |
| 13239 | packed = [] |
| 13240 | packed.append(struct.pack("!B", self.version)) |
| 13241 | packed.append(struct.pack("!B", self.type)) |
| 13242 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 13243 | packed.append(struct.pack("!L", self.xid)) |
| 13244 | packed.append(struct.pack("!L", self.experimenter)) |
| 13245 | packed.append(struct.pack("!L", self.subtype)) |
| 13246 | length = sum([len(x) for x in packed]) |
| 13247 | packed[2] = struct.pack("!H", length) |
| 13248 | return ''.join(packed) |
| 13249 | |
| 13250 | @staticmethod |
| 13251 | def unpack(reader): |
| 13252 | subtype, = reader.peek('!L', 12) |
| 13253 | subclass = nicira_header.subtypes.get(subtype) |
| 13254 | if subclass: |
| 13255 | return subclass.unpack(reader) |
| 13256 | |
| 13257 | obj = nicira_header() |
| 13258 | _version = reader.read("!B")[0] |
| 13259 | assert(_version == 4) |
| 13260 | _type = reader.read("!B")[0] |
| 13261 | assert(_type == 4) |
| 13262 | _length = reader.read("!H")[0] |
| 13263 | orig_reader = reader |
| 13264 | reader = orig_reader.slice(_length, 4) |
| 13265 | obj.xid = reader.read("!L")[0] |
| 13266 | _experimenter = reader.read("!L")[0] |
| 13267 | assert(_experimenter == 8992) |
| 13268 | obj.subtype = reader.read("!L")[0] |
| 13269 | return obj |
| 13270 | |
| 13271 | def __eq__(self, other): |
| 13272 | if type(self) != type(other): return False |
| 13273 | if self.xid != other.xid: return False |
| 13274 | if self.subtype != other.subtype: return False |
| 13275 | return True |
| 13276 | |
| 13277 | def pretty_print(self, q): |
| 13278 | q.text("nicira_header {") |
| 13279 | with q.group(): |
| 13280 | with q.indent(2): |
| 13281 | q.breakable() |
| 13282 | q.text("xid = "); |
| 13283 | if self.xid != None: |
| 13284 | q.text("%#x" % self.xid) |
| 13285 | else: |
| 13286 | q.text('None') |
| 13287 | q.breakable() |
| 13288 | q.text('}') |
| 13289 | |
| 13290 | experimenter.subtypes[8992] = nicira_header |
| 13291 | |
| 13292 | class packet_in(message): |
| 13293 | version = 4 |
| 13294 | type = 10 |
| 13295 | |
| 13296 | def __init__(self, xid=None, buffer_id=None, total_len=None, reason=None, table_id=None, cookie=None, match=None, data=None): |
| 13297 | if xid != None: |
| 13298 | self.xid = xid |
| 13299 | else: |
| 13300 | self.xid = None |
| 13301 | if buffer_id != None: |
| 13302 | self.buffer_id = buffer_id |
| 13303 | else: |
| 13304 | self.buffer_id = 0 |
| 13305 | if total_len != None: |
| 13306 | self.total_len = total_len |
| 13307 | else: |
| 13308 | self.total_len = 0 |
| 13309 | if reason != None: |
| 13310 | self.reason = reason |
| 13311 | else: |
| 13312 | self.reason = 0 |
| 13313 | if table_id != None: |
| 13314 | self.table_id = table_id |
| 13315 | else: |
| 13316 | self.table_id = 0 |
| 13317 | if cookie != None: |
| 13318 | self.cookie = cookie |
| 13319 | else: |
| 13320 | self.cookie = 0 |
| 13321 | if match != None: |
| 13322 | self.match = match |
| 13323 | else: |
| 13324 | self.match = ofp.match() |
| 13325 | if data != None: |
| 13326 | self.data = data |
| 13327 | else: |
| 13328 | self.data = '' |
| 13329 | return |
| 13330 | |
| 13331 | def pack(self): |
| 13332 | packed = [] |
| 13333 | packed.append(struct.pack("!B", self.version)) |
| 13334 | packed.append(struct.pack("!B", self.type)) |
| 13335 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 13336 | packed.append(struct.pack("!L", self.xid)) |
| 13337 | packed.append(struct.pack("!L", self.buffer_id)) |
| 13338 | packed.append(struct.pack("!H", self.total_len)) |
| 13339 | packed.append(struct.pack("!B", self.reason)) |
| 13340 | packed.append(struct.pack("!B", self.table_id)) |
| 13341 | packed.append(struct.pack("!Q", self.cookie)) |
| 13342 | packed.append(self.match.pack()) |
| 13343 | packed.append('\x00' * 2) |
| 13344 | packed.append(self.data) |
| 13345 | length = sum([len(x) for x in packed]) |
| 13346 | packed[2] = struct.pack("!H", length) |
| 13347 | return ''.join(packed) |
| 13348 | |
| 13349 | @staticmethod |
| 13350 | def unpack(reader): |
| 13351 | obj = packet_in() |
| 13352 | _version = reader.read("!B")[0] |
| 13353 | assert(_version == 4) |
| 13354 | _type = reader.read("!B")[0] |
| 13355 | assert(_type == 10) |
| 13356 | _length = reader.read("!H")[0] |
| 13357 | orig_reader = reader |
| 13358 | reader = orig_reader.slice(_length, 4) |
| 13359 | obj.xid = reader.read("!L")[0] |
| 13360 | obj.buffer_id = reader.read("!L")[0] |
| 13361 | obj.total_len = reader.read("!H")[0] |
| 13362 | obj.reason = reader.read("!B")[0] |
| 13363 | obj.table_id = reader.read("!B")[0] |
| 13364 | obj.cookie = reader.read("!Q")[0] |
| 13365 | obj.match = ofp.match.unpack(reader) |
| 13366 | reader.skip(2) |
| 13367 | obj.data = str(reader.read_all()) |
| 13368 | return obj |
| 13369 | |
| 13370 | def __eq__(self, other): |
| 13371 | if type(self) != type(other): return False |
| 13372 | if self.xid != other.xid: return False |
| 13373 | if self.buffer_id != other.buffer_id: return False |
| 13374 | if self.total_len != other.total_len: return False |
| 13375 | if self.reason != other.reason: return False |
| 13376 | if self.table_id != other.table_id: return False |
| 13377 | if self.cookie != other.cookie: return False |
| 13378 | if self.match != other.match: return False |
| 13379 | if self.data != other.data: return False |
| 13380 | return True |
| 13381 | |
| 13382 | def pretty_print(self, q): |
| 13383 | q.text("packet_in {") |
| 13384 | with q.group(): |
| 13385 | with q.indent(2): |
| 13386 | q.breakable() |
| 13387 | q.text("xid = "); |
| 13388 | if self.xid != None: |
| 13389 | q.text("%#x" % self.xid) |
| 13390 | else: |
| 13391 | q.text('None') |
| 13392 | q.text(","); q.breakable() |
| 13393 | q.text("buffer_id = "); |
| 13394 | q.text("%#x" % self.buffer_id) |
| 13395 | q.text(","); q.breakable() |
| 13396 | q.text("total_len = "); |
| 13397 | q.text("%#x" % self.total_len) |
| 13398 | q.text(","); q.breakable() |
| 13399 | q.text("reason = "); |
| 13400 | q.text("%#x" % self.reason) |
| 13401 | q.text(","); q.breakable() |
| 13402 | q.text("table_id = "); |
| 13403 | q.text("%#x" % self.table_id) |
| 13404 | q.text(","); q.breakable() |
| 13405 | q.text("cookie = "); |
| 13406 | q.text("%#x" % self.cookie) |
| 13407 | q.text(","); q.breakable() |
| 13408 | q.text("match = "); |
| 13409 | q.pp(self.match) |
| 13410 | q.text(","); q.breakable() |
| 13411 | q.text("data = "); |
| 13412 | q.pp(self.data) |
| 13413 | q.breakable() |
| 13414 | q.text('}') |
| 13415 | |
| 13416 | message.subtypes[10] = packet_in |
| 13417 | |
| 13418 | class packet_out(message): |
| 13419 | version = 4 |
| 13420 | type = 13 |
| 13421 | |
| 13422 | def __init__(self, xid=None, buffer_id=None, in_port=None, actions=None, data=None): |
| 13423 | if xid != None: |
| 13424 | self.xid = xid |
| 13425 | else: |
| 13426 | self.xid = None |
| 13427 | if buffer_id != None: |
| 13428 | self.buffer_id = buffer_id |
| 13429 | else: |
| 13430 | self.buffer_id = 0 |
| 13431 | if in_port != None: |
| 13432 | self.in_port = in_port |
| 13433 | else: |
| 13434 | self.in_port = 0 |
| 13435 | if actions != None: |
| 13436 | self.actions = actions |
| 13437 | else: |
| 13438 | self.actions = [] |
| 13439 | if data != None: |
| 13440 | self.data = data |
| 13441 | else: |
| 13442 | self.data = '' |
| 13443 | return |
| 13444 | |
| 13445 | def pack(self): |
| 13446 | packed = [] |
| 13447 | packed.append(struct.pack("!B", self.version)) |
| 13448 | packed.append(struct.pack("!B", self.type)) |
| 13449 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 13450 | packed.append(struct.pack("!L", self.xid)) |
| 13451 | packed.append(struct.pack("!L", self.buffer_id)) |
| 13452 | packed.append(util.pack_port_no(self.in_port)) |
| 13453 | packed.append(struct.pack("!H", 0)) # placeholder for actions_len at index 6 |
| 13454 | packed.append('\x00' * 6) |
| 13455 | packed.append(loxi.generic_util.pack_list(self.actions)) |
| 13456 | packed[6] = struct.pack("!H", len(packed[-1])) |
| 13457 | packed.append(self.data) |
| 13458 | length = sum([len(x) for x in packed]) |
| 13459 | packed[2] = struct.pack("!H", length) |
| 13460 | return ''.join(packed) |
| 13461 | |
| 13462 | @staticmethod |
| 13463 | def unpack(reader): |
| 13464 | obj = packet_out() |
| 13465 | _version = reader.read("!B")[0] |
| 13466 | assert(_version == 4) |
| 13467 | _type = reader.read("!B")[0] |
| 13468 | assert(_type == 13) |
| 13469 | _length = reader.read("!H")[0] |
| 13470 | orig_reader = reader |
| 13471 | reader = orig_reader.slice(_length, 4) |
| 13472 | obj.xid = reader.read("!L")[0] |
| 13473 | obj.buffer_id = reader.read("!L")[0] |
| 13474 | obj.in_port = util.unpack_port_no(reader) |
| 13475 | _actions_len = reader.read("!H")[0] |
| 13476 | reader.skip(6) |
| 13477 | obj.actions = loxi.generic_util.unpack_list(reader.slice(_actions_len), ofp.action.action.unpack) |
| 13478 | obj.data = str(reader.read_all()) |
| 13479 | return obj |
| 13480 | |
| 13481 | def __eq__(self, other): |
| 13482 | if type(self) != type(other): return False |
| 13483 | if self.xid != other.xid: return False |
| 13484 | if self.buffer_id != other.buffer_id: return False |
| 13485 | if self.in_port != other.in_port: return False |
| 13486 | if self.actions != other.actions: return False |
| 13487 | if self.data != other.data: return False |
| 13488 | return True |
| 13489 | |
| 13490 | def pretty_print(self, q): |
| 13491 | q.text("packet_out {") |
| 13492 | with q.group(): |
| 13493 | with q.indent(2): |
| 13494 | q.breakable() |
| 13495 | q.text("xid = "); |
| 13496 | if self.xid != None: |
| 13497 | q.text("%#x" % self.xid) |
| 13498 | else: |
| 13499 | q.text('None') |
| 13500 | q.text(","); q.breakable() |
| 13501 | q.text("buffer_id = "); |
| 13502 | q.text("%#x" % self.buffer_id) |
| 13503 | q.text(","); q.breakable() |
| 13504 | q.text("in_port = "); |
| 13505 | q.text(util.pretty_port(self.in_port)) |
| 13506 | q.text(","); q.breakable() |
| 13507 | q.text("actions = "); |
| 13508 | q.pp(self.actions) |
| 13509 | q.text(","); q.breakable() |
| 13510 | q.text("data = "); |
| 13511 | q.pp(self.data) |
| 13512 | q.breakable() |
| 13513 | q.text('}') |
| 13514 | |
| 13515 | message.subtypes[13] = packet_out |
| 13516 | |
| 13517 | class port_desc_stats_reply(stats_reply): |
| 13518 | version = 4 |
| 13519 | type = 19 |
| 13520 | stats_type = 13 |
| 13521 | |
| 13522 | def __init__(self, xid=None, flags=None, entries=None): |
| 13523 | if xid != None: |
| 13524 | self.xid = xid |
| 13525 | else: |
| 13526 | self.xid = None |
| 13527 | if flags != None: |
| 13528 | self.flags = flags |
| 13529 | else: |
| 13530 | self.flags = 0 |
| 13531 | if entries != None: |
| 13532 | self.entries = entries |
| 13533 | else: |
| 13534 | self.entries = [] |
| 13535 | return |
| 13536 | |
| 13537 | def pack(self): |
| 13538 | packed = [] |
| 13539 | packed.append(struct.pack("!B", self.version)) |
| 13540 | packed.append(struct.pack("!B", self.type)) |
| 13541 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 13542 | packed.append(struct.pack("!L", self.xid)) |
| 13543 | packed.append(struct.pack("!H", self.stats_type)) |
| 13544 | packed.append(struct.pack("!H", self.flags)) |
| 13545 | packed.append('\x00' * 4) |
| 13546 | packed.append(loxi.generic_util.pack_list(self.entries)) |
| 13547 | length = sum([len(x) for x in packed]) |
| 13548 | packed[2] = struct.pack("!H", length) |
| 13549 | return ''.join(packed) |
| 13550 | |
| 13551 | @staticmethod |
| 13552 | def unpack(reader): |
| 13553 | obj = port_desc_stats_reply() |
| 13554 | _version = reader.read("!B")[0] |
| 13555 | assert(_version == 4) |
| 13556 | _type = reader.read("!B")[0] |
| 13557 | assert(_type == 19) |
| 13558 | _length = reader.read("!H")[0] |
| 13559 | orig_reader = reader |
| 13560 | reader = orig_reader.slice(_length, 4) |
| 13561 | obj.xid = reader.read("!L")[0] |
| 13562 | _stats_type = reader.read("!H")[0] |
| 13563 | assert(_stats_type == 13) |
| 13564 | obj.flags = reader.read("!H")[0] |
| 13565 | reader.skip(4) |
| 13566 | obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.port_desc.unpack) |
| 13567 | return obj |
| 13568 | |
| 13569 | def __eq__(self, other): |
| 13570 | if type(self) != type(other): return False |
| 13571 | if self.xid != other.xid: return False |
| 13572 | if self.flags != other.flags: return False |
| 13573 | if self.entries != other.entries: return False |
| 13574 | return True |
| 13575 | |
| 13576 | def pretty_print(self, q): |
| 13577 | q.text("port_desc_stats_reply {") |
| 13578 | with q.group(): |
| 13579 | with q.indent(2): |
| 13580 | q.breakable() |
| 13581 | q.text("xid = "); |
| 13582 | if self.xid != None: |
| 13583 | q.text("%#x" % self.xid) |
| 13584 | else: |
| 13585 | q.text('None') |
| 13586 | q.text(","); q.breakable() |
| 13587 | q.text("flags = "); |
| 13588 | q.text("%#x" % self.flags) |
| 13589 | q.text(","); q.breakable() |
| 13590 | q.text("entries = "); |
| 13591 | q.pp(self.entries) |
| 13592 | q.breakable() |
| 13593 | q.text('}') |
| 13594 | |
| 13595 | stats_reply.subtypes[13] = port_desc_stats_reply |
| 13596 | |
| 13597 | class port_desc_stats_request(stats_request): |
| 13598 | version = 4 |
| 13599 | type = 18 |
| 13600 | stats_type = 13 |
| 13601 | |
| 13602 | def __init__(self, xid=None, flags=None): |
| 13603 | if xid != None: |
| 13604 | self.xid = xid |
| 13605 | else: |
| 13606 | self.xid = None |
| 13607 | if flags != None: |
| 13608 | self.flags = flags |
| 13609 | else: |
| 13610 | self.flags = 0 |
| 13611 | return |
| 13612 | |
| 13613 | def pack(self): |
| 13614 | packed = [] |
| 13615 | packed.append(struct.pack("!B", self.version)) |
| 13616 | packed.append(struct.pack("!B", self.type)) |
| 13617 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 13618 | packed.append(struct.pack("!L", self.xid)) |
| 13619 | packed.append(struct.pack("!H", self.stats_type)) |
| 13620 | packed.append(struct.pack("!H", self.flags)) |
| 13621 | packed.append('\x00' * 4) |
| 13622 | length = sum([len(x) for x in packed]) |
| 13623 | packed[2] = struct.pack("!H", length) |
| 13624 | return ''.join(packed) |
| 13625 | |
| 13626 | @staticmethod |
| 13627 | def unpack(reader): |
| 13628 | obj = port_desc_stats_request() |
| 13629 | _version = reader.read("!B")[0] |
| 13630 | assert(_version == 4) |
| 13631 | _type = reader.read("!B")[0] |
| 13632 | assert(_type == 18) |
| 13633 | _length = reader.read("!H")[0] |
| 13634 | orig_reader = reader |
| 13635 | reader = orig_reader.slice(_length, 4) |
| 13636 | obj.xid = reader.read("!L")[0] |
| 13637 | _stats_type = reader.read("!H")[0] |
| 13638 | assert(_stats_type == 13) |
| 13639 | obj.flags = reader.read("!H")[0] |
| 13640 | reader.skip(4) |
| 13641 | return obj |
| 13642 | |
| 13643 | def __eq__(self, other): |
| 13644 | if type(self) != type(other): return False |
| 13645 | if self.xid != other.xid: return False |
| 13646 | if self.flags != other.flags: return False |
| 13647 | return True |
| 13648 | |
| 13649 | def pretty_print(self, q): |
| 13650 | q.text("port_desc_stats_request {") |
| 13651 | with q.group(): |
| 13652 | with q.indent(2): |
| 13653 | q.breakable() |
| 13654 | q.text("xid = "); |
| 13655 | if self.xid != None: |
| 13656 | q.text("%#x" % self.xid) |
| 13657 | else: |
| 13658 | q.text('None') |
| 13659 | q.text(","); q.breakable() |
| 13660 | q.text("flags = "); |
| 13661 | q.text("%#x" % self.flags) |
| 13662 | q.breakable() |
| 13663 | q.text('}') |
| 13664 | |
| 13665 | stats_request.subtypes[13] = port_desc_stats_request |
| 13666 | |
| 13667 | class port_mod(message): |
| 13668 | version = 4 |
| 13669 | type = 16 |
| 13670 | |
| 13671 | def __init__(self, xid=None, port_no=None, hw_addr=None, config=None, mask=None, advertise=None): |
| 13672 | if xid != None: |
| 13673 | self.xid = xid |
| 13674 | else: |
| 13675 | self.xid = None |
| 13676 | if port_no != None: |
| 13677 | self.port_no = port_no |
| 13678 | else: |
| 13679 | self.port_no = 0 |
| 13680 | if hw_addr != None: |
| 13681 | self.hw_addr = hw_addr |
| 13682 | else: |
| 13683 | self.hw_addr = [0,0,0,0,0,0] |
| 13684 | if config != None: |
| 13685 | self.config = config |
| 13686 | else: |
| 13687 | self.config = 0 |
| 13688 | if mask != None: |
| 13689 | self.mask = mask |
| 13690 | else: |
| 13691 | self.mask = 0 |
| 13692 | if advertise != None: |
| 13693 | self.advertise = advertise |
| 13694 | else: |
| 13695 | self.advertise = 0 |
| 13696 | return |
| 13697 | |
| 13698 | def pack(self): |
| 13699 | packed = [] |
| 13700 | packed.append(struct.pack("!B", self.version)) |
| 13701 | packed.append(struct.pack("!B", self.type)) |
| 13702 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 13703 | packed.append(struct.pack("!L", self.xid)) |
| 13704 | packed.append(util.pack_port_no(self.port_no)) |
| 13705 | packed.append('\x00' * 4) |
| 13706 | packed.append(struct.pack("!6B", *self.hw_addr)) |
| 13707 | packed.append('\x00' * 2) |
| 13708 | packed.append(struct.pack("!L", self.config)) |
| 13709 | packed.append(struct.pack("!L", self.mask)) |
| 13710 | packed.append(struct.pack("!L", self.advertise)) |
| 13711 | packed.append('\x00' * 4) |
| 13712 | length = sum([len(x) for x in packed]) |
| 13713 | packed[2] = struct.pack("!H", length) |
| 13714 | return ''.join(packed) |
| 13715 | |
| 13716 | @staticmethod |
| 13717 | def unpack(reader): |
| 13718 | obj = port_mod() |
| 13719 | _version = reader.read("!B")[0] |
| 13720 | assert(_version == 4) |
| 13721 | _type = reader.read("!B")[0] |
| 13722 | assert(_type == 16) |
| 13723 | _length = reader.read("!H")[0] |
| 13724 | orig_reader = reader |
| 13725 | reader = orig_reader.slice(_length, 4) |
| 13726 | obj.xid = reader.read("!L")[0] |
| 13727 | obj.port_no = util.unpack_port_no(reader) |
| 13728 | reader.skip(4) |
| 13729 | obj.hw_addr = list(reader.read('!6B')) |
| 13730 | reader.skip(2) |
| 13731 | obj.config = reader.read("!L")[0] |
| 13732 | obj.mask = reader.read("!L")[0] |
| 13733 | obj.advertise = reader.read("!L")[0] |
| 13734 | reader.skip(4) |
| 13735 | return obj |
| 13736 | |
| 13737 | def __eq__(self, other): |
| 13738 | if type(self) != type(other): return False |
| 13739 | if self.xid != other.xid: return False |
| 13740 | if self.port_no != other.port_no: return False |
| 13741 | if self.hw_addr != other.hw_addr: return False |
| 13742 | if self.config != other.config: return False |
| 13743 | if self.mask != other.mask: return False |
| 13744 | if self.advertise != other.advertise: return False |
| 13745 | return True |
| 13746 | |
| 13747 | def pretty_print(self, q): |
| 13748 | q.text("port_mod {") |
| 13749 | with q.group(): |
| 13750 | with q.indent(2): |
| 13751 | q.breakable() |
| 13752 | q.text("xid = "); |
| 13753 | if self.xid != None: |
| 13754 | q.text("%#x" % self.xid) |
| 13755 | else: |
| 13756 | q.text('None') |
| 13757 | q.text(","); q.breakable() |
| 13758 | q.text("port_no = "); |
| 13759 | q.text(util.pretty_port(self.port_no)) |
| 13760 | q.text(","); q.breakable() |
| 13761 | q.text("hw_addr = "); |
| 13762 | q.text(util.pretty_mac(self.hw_addr)) |
| 13763 | q.text(","); q.breakable() |
| 13764 | q.text("config = "); |
| 13765 | q.text("%#x" % self.config) |
| 13766 | q.text(","); q.breakable() |
| 13767 | q.text("mask = "); |
| 13768 | q.text("%#x" % self.mask) |
| 13769 | q.text(","); q.breakable() |
| 13770 | q.text("advertise = "); |
| 13771 | q.text("%#x" % self.advertise) |
| 13772 | q.breakable() |
| 13773 | q.text('}') |
| 13774 | |
| 13775 | message.subtypes[16] = port_mod |
| 13776 | |
| 13777 | class port_mod_failed_error_msg(error_msg): |
| 13778 | version = 4 |
| 13779 | type = 1 |
| 13780 | err_type = 7 |
| 13781 | |
| 13782 | def __init__(self, xid=None, code=None, data=None): |
| 13783 | if xid != None: |
| 13784 | self.xid = xid |
| 13785 | else: |
| 13786 | self.xid = None |
| 13787 | if code != None: |
| 13788 | self.code = code |
| 13789 | else: |
| 13790 | self.code = 0 |
| 13791 | if data != None: |
| 13792 | self.data = data |
| 13793 | else: |
| 13794 | self.data = '' |
| 13795 | return |
| 13796 | |
| 13797 | def pack(self): |
| 13798 | packed = [] |
| 13799 | packed.append(struct.pack("!B", self.version)) |
| 13800 | packed.append(struct.pack("!B", self.type)) |
| 13801 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 13802 | packed.append(struct.pack("!L", self.xid)) |
| 13803 | packed.append(struct.pack("!H", self.err_type)) |
| 13804 | packed.append(struct.pack("!H", self.code)) |
| 13805 | packed.append(self.data) |
| 13806 | length = sum([len(x) for x in packed]) |
| 13807 | packed[2] = struct.pack("!H", length) |
| 13808 | return ''.join(packed) |
| 13809 | |
| 13810 | @staticmethod |
| 13811 | def unpack(reader): |
| 13812 | obj = port_mod_failed_error_msg() |
| 13813 | _version = reader.read("!B")[0] |
| 13814 | assert(_version == 4) |
| 13815 | _type = reader.read("!B")[0] |
| 13816 | assert(_type == 1) |
| 13817 | _length = reader.read("!H")[0] |
| 13818 | orig_reader = reader |
| 13819 | reader = orig_reader.slice(_length, 4) |
| 13820 | obj.xid = reader.read("!L")[0] |
| 13821 | _err_type = reader.read("!H")[0] |
| 13822 | assert(_err_type == 7) |
| 13823 | obj.code = reader.read("!H")[0] |
| 13824 | obj.data = str(reader.read_all()) |
| 13825 | return obj |
| 13826 | |
| 13827 | def __eq__(self, other): |
| 13828 | if type(self) != type(other): return False |
| 13829 | if self.xid != other.xid: return False |
| 13830 | if self.code != other.code: return False |
| 13831 | if self.data != other.data: return False |
| 13832 | return True |
| 13833 | |
| 13834 | def pretty_print(self, q): |
| 13835 | q.text("port_mod_failed_error_msg {") |
| 13836 | with q.group(): |
| 13837 | with q.indent(2): |
| 13838 | q.breakable() |
| 13839 | q.text("xid = "); |
| 13840 | if self.xid != None: |
| 13841 | q.text("%#x" % self.xid) |
| 13842 | else: |
| 13843 | q.text('None') |
| 13844 | q.text(","); q.breakable() |
| 13845 | q.text("code = "); |
| 13846 | q.text("%#x" % self.code) |
| 13847 | q.text(","); q.breakable() |
| 13848 | q.text("data = "); |
| 13849 | q.pp(self.data) |
| 13850 | q.breakable() |
| 13851 | q.text('}') |
| 13852 | |
| 13853 | error_msg.subtypes[7] = port_mod_failed_error_msg |
| 13854 | |
| 13855 | class port_stats_reply(stats_reply): |
| 13856 | version = 4 |
| 13857 | type = 19 |
| 13858 | stats_type = 4 |
| 13859 | |
| 13860 | def __init__(self, xid=None, flags=None, entries=None): |
| 13861 | if xid != None: |
| 13862 | self.xid = xid |
| 13863 | else: |
| 13864 | self.xid = None |
| 13865 | if flags != None: |
| 13866 | self.flags = flags |
| 13867 | else: |
| 13868 | self.flags = 0 |
| 13869 | if entries != None: |
| 13870 | self.entries = entries |
| 13871 | else: |
| 13872 | self.entries = [] |
| 13873 | return |
| 13874 | |
| 13875 | def pack(self): |
| 13876 | packed = [] |
| 13877 | packed.append(struct.pack("!B", self.version)) |
| 13878 | packed.append(struct.pack("!B", self.type)) |
| 13879 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 13880 | packed.append(struct.pack("!L", self.xid)) |
| 13881 | packed.append(struct.pack("!H", self.stats_type)) |
| 13882 | packed.append(struct.pack("!H", self.flags)) |
| 13883 | packed.append('\x00' * 4) |
| 13884 | packed.append(loxi.generic_util.pack_list(self.entries)) |
| 13885 | length = sum([len(x) for x in packed]) |
| 13886 | packed[2] = struct.pack("!H", length) |
| 13887 | return ''.join(packed) |
| 13888 | |
| 13889 | @staticmethod |
| 13890 | def unpack(reader): |
| 13891 | obj = port_stats_reply() |
| 13892 | _version = reader.read("!B")[0] |
| 13893 | assert(_version == 4) |
| 13894 | _type = reader.read("!B")[0] |
| 13895 | assert(_type == 19) |
| 13896 | _length = reader.read("!H")[0] |
| 13897 | orig_reader = reader |
| 13898 | reader = orig_reader.slice(_length, 4) |
| 13899 | obj.xid = reader.read("!L")[0] |
| 13900 | _stats_type = reader.read("!H")[0] |
| 13901 | assert(_stats_type == 4) |
| 13902 | obj.flags = reader.read("!H")[0] |
| 13903 | reader.skip(4) |
| 13904 | obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.port_stats_entry.unpack) |
| 13905 | return obj |
| 13906 | |
| 13907 | def __eq__(self, other): |
| 13908 | if type(self) != type(other): return False |
| 13909 | if self.xid != other.xid: return False |
| 13910 | if self.flags != other.flags: return False |
| 13911 | if self.entries != other.entries: return False |
| 13912 | return True |
| 13913 | |
| 13914 | def pretty_print(self, q): |
| 13915 | q.text("port_stats_reply {") |
| 13916 | with q.group(): |
| 13917 | with q.indent(2): |
| 13918 | q.breakable() |
| 13919 | q.text("xid = "); |
| 13920 | if self.xid != None: |
| 13921 | q.text("%#x" % self.xid) |
| 13922 | else: |
| 13923 | q.text('None') |
| 13924 | q.text(","); q.breakable() |
| 13925 | q.text("flags = "); |
| 13926 | q.text("%#x" % self.flags) |
| 13927 | q.text(","); q.breakable() |
| 13928 | q.text("entries = "); |
| 13929 | q.pp(self.entries) |
| 13930 | q.breakable() |
| 13931 | q.text('}') |
| 13932 | |
| 13933 | stats_reply.subtypes[4] = port_stats_reply |
| 13934 | |
| 13935 | class port_stats_request(stats_request): |
| 13936 | version = 4 |
| 13937 | type = 18 |
| 13938 | stats_type = 4 |
| 13939 | |
| 13940 | def __init__(self, xid=None, flags=None, port_no=None): |
| 13941 | if xid != None: |
| 13942 | self.xid = xid |
| 13943 | else: |
| 13944 | self.xid = None |
| 13945 | if flags != None: |
| 13946 | self.flags = flags |
| 13947 | else: |
| 13948 | self.flags = 0 |
| 13949 | if port_no != None: |
| 13950 | self.port_no = port_no |
| 13951 | else: |
| 13952 | self.port_no = 0 |
| 13953 | return |
| 13954 | |
| 13955 | def pack(self): |
| 13956 | packed = [] |
| 13957 | packed.append(struct.pack("!B", self.version)) |
| 13958 | packed.append(struct.pack("!B", self.type)) |
| 13959 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 13960 | packed.append(struct.pack("!L", self.xid)) |
| 13961 | packed.append(struct.pack("!H", self.stats_type)) |
| 13962 | packed.append(struct.pack("!H", self.flags)) |
| 13963 | packed.append('\x00' * 4) |
| 13964 | packed.append(util.pack_port_no(self.port_no)) |
| 13965 | packed.append('\x00' * 4) |
| 13966 | length = sum([len(x) for x in packed]) |
| 13967 | packed[2] = struct.pack("!H", length) |
| 13968 | return ''.join(packed) |
| 13969 | |
| 13970 | @staticmethod |
| 13971 | def unpack(reader): |
| 13972 | obj = port_stats_request() |
| 13973 | _version = reader.read("!B")[0] |
| 13974 | assert(_version == 4) |
| 13975 | _type = reader.read("!B")[0] |
| 13976 | assert(_type == 18) |
| 13977 | _length = reader.read("!H")[0] |
| 13978 | orig_reader = reader |
| 13979 | reader = orig_reader.slice(_length, 4) |
| 13980 | obj.xid = reader.read("!L")[0] |
| 13981 | _stats_type = reader.read("!H")[0] |
| 13982 | assert(_stats_type == 4) |
| 13983 | obj.flags = reader.read("!H")[0] |
| 13984 | reader.skip(4) |
| 13985 | obj.port_no = util.unpack_port_no(reader) |
| 13986 | reader.skip(4) |
| 13987 | return obj |
| 13988 | |
| 13989 | def __eq__(self, other): |
| 13990 | if type(self) != type(other): return False |
| 13991 | if self.xid != other.xid: return False |
| 13992 | if self.flags != other.flags: return False |
| 13993 | if self.port_no != other.port_no: return False |
| 13994 | return True |
| 13995 | |
| 13996 | def pretty_print(self, q): |
| 13997 | q.text("port_stats_request {") |
| 13998 | with q.group(): |
| 13999 | with q.indent(2): |
| 14000 | q.breakable() |
| 14001 | q.text("xid = "); |
| 14002 | if self.xid != None: |
| 14003 | q.text("%#x" % self.xid) |
| 14004 | else: |
| 14005 | q.text('None') |
| 14006 | q.text(","); q.breakable() |
| 14007 | q.text("flags = "); |
| 14008 | q.text("%#x" % self.flags) |
| 14009 | q.text(","); q.breakable() |
| 14010 | q.text("port_no = "); |
| 14011 | q.text(util.pretty_port(self.port_no)) |
| 14012 | q.breakable() |
| 14013 | q.text('}') |
| 14014 | |
| 14015 | stats_request.subtypes[4] = port_stats_request |
| 14016 | |
| 14017 | class port_status(message): |
| 14018 | version = 4 |
| 14019 | type = 12 |
| 14020 | |
| 14021 | def __init__(self, xid=None, reason=None, desc=None): |
| 14022 | if xid != None: |
| 14023 | self.xid = xid |
| 14024 | else: |
| 14025 | self.xid = None |
| 14026 | if reason != None: |
| 14027 | self.reason = reason |
| 14028 | else: |
| 14029 | self.reason = 0 |
| 14030 | if desc != None: |
| 14031 | self.desc = desc |
| 14032 | else: |
| 14033 | self.desc = ofp.port_desc() |
| 14034 | return |
| 14035 | |
| 14036 | def pack(self): |
| 14037 | packed = [] |
| 14038 | packed.append(struct.pack("!B", self.version)) |
| 14039 | packed.append(struct.pack("!B", self.type)) |
| 14040 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 14041 | packed.append(struct.pack("!L", self.xid)) |
| 14042 | packed.append(struct.pack("!B", self.reason)) |
| 14043 | packed.append('\x00' * 7) |
| 14044 | packed.append(self.desc.pack()) |
| 14045 | length = sum([len(x) for x in packed]) |
| 14046 | packed[2] = struct.pack("!H", length) |
| 14047 | return ''.join(packed) |
| 14048 | |
| 14049 | @staticmethod |
| 14050 | def unpack(reader): |
| 14051 | obj = port_status() |
| 14052 | _version = reader.read("!B")[0] |
| 14053 | assert(_version == 4) |
| 14054 | _type = reader.read("!B")[0] |
| 14055 | assert(_type == 12) |
| 14056 | _length = reader.read("!H")[0] |
| 14057 | orig_reader = reader |
| 14058 | reader = orig_reader.slice(_length, 4) |
| 14059 | obj.xid = reader.read("!L")[0] |
| 14060 | obj.reason = reader.read("!B")[0] |
| 14061 | reader.skip(7) |
| 14062 | obj.desc = ofp.port_desc.unpack(reader) |
| 14063 | return obj |
| 14064 | |
| 14065 | def __eq__(self, other): |
| 14066 | if type(self) != type(other): return False |
| 14067 | if self.xid != other.xid: return False |
| 14068 | if self.reason != other.reason: return False |
| 14069 | if self.desc != other.desc: return False |
| 14070 | return True |
| 14071 | |
| 14072 | def pretty_print(self, q): |
| 14073 | q.text("port_status {") |
| 14074 | with q.group(): |
| 14075 | with q.indent(2): |
| 14076 | q.breakable() |
| 14077 | q.text("xid = "); |
| 14078 | if self.xid != None: |
| 14079 | q.text("%#x" % self.xid) |
| 14080 | else: |
| 14081 | q.text('None') |
| 14082 | q.text(","); q.breakable() |
| 14083 | q.text("reason = "); |
| 14084 | q.text("%#x" % self.reason) |
| 14085 | q.text(","); q.breakable() |
| 14086 | q.text("desc = "); |
| 14087 | q.pp(self.desc) |
| 14088 | q.breakable() |
| 14089 | q.text('}') |
| 14090 | |
| 14091 | message.subtypes[12] = port_status |
| 14092 | |
| 14093 | class queue_get_config_reply(message): |
| 14094 | version = 4 |
| 14095 | type = 23 |
| 14096 | |
| 14097 | def __init__(self, xid=None, port=None, queues=None): |
| 14098 | if xid != None: |
| 14099 | self.xid = xid |
| 14100 | else: |
| 14101 | self.xid = None |
| 14102 | if port != None: |
| 14103 | self.port = port |
| 14104 | else: |
| 14105 | self.port = 0 |
| 14106 | if queues != None: |
| 14107 | self.queues = queues |
| 14108 | else: |
| 14109 | self.queues = [] |
| 14110 | return |
| 14111 | |
| 14112 | def pack(self): |
| 14113 | packed = [] |
| 14114 | packed.append(struct.pack("!B", self.version)) |
| 14115 | packed.append(struct.pack("!B", self.type)) |
| 14116 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 14117 | packed.append(struct.pack("!L", self.xid)) |
| 14118 | packed.append(util.pack_port_no(self.port)) |
| 14119 | packed.append('\x00' * 4) |
| 14120 | packed.append(loxi.generic_util.pack_list(self.queues)) |
| 14121 | length = sum([len(x) for x in packed]) |
| 14122 | packed[2] = struct.pack("!H", length) |
| 14123 | return ''.join(packed) |
| 14124 | |
| 14125 | @staticmethod |
| 14126 | def unpack(reader): |
| 14127 | obj = queue_get_config_reply() |
| 14128 | _version = reader.read("!B")[0] |
| 14129 | assert(_version == 4) |
| 14130 | _type = reader.read("!B")[0] |
| 14131 | assert(_type == 23) |
| 14132 | _length = reader.read("!H")[0] |
| 14133 | orig_reader = reader |
| 14134 | reader = orig_reader.slice(_length, 4) |
| 14135 | obj.xid = reader.read("!L")[0] |
| 14136 | obj.port = util.unpack_port_no(reader) |
| 14137 | reader.skip(4) |
| 14138 | obj.queues = loxi.generic_util.unpack_list(reader, ofp.common.packet_queue.unpack) |
| 14139 | return obj |
| 14140 | |
| 14141 | def __eq__(self, other): |
| 14142 | if type(self) != type(other): return False |
| 14143 | if self.xid != other.xid: return False |
| 14144 | if self.port != other.port: return False |
| 14145 | if self.queues != other.queues: return False |
| 14146 | return True |
| 14147 | |
| 14148 | def pretty_print(self, q): |
| 14149 | q.text("queue_get_config_reply {") |
| 14150 | with q.group(): |
| 14151 | with q.indent(2): |
| 14152 | q.breakable() |
| 14153 | q.text("xid = "); |
| 14154 | if self.xid != None: |
| 14155 | q.text("%#x" % self.xid) |
| 14156 | else: |
| 14157 | q.text('None') |
| 14158 | q.text(","); q.breakable() |
| 14159 | q.text("port = "); |
| 14160 | q.text(util.pretty_port(self.port)) |
| 14161 | q.text(","); q.breakable() |
| 14162 | q.text("queues = "); |
| 14163 | q.pp(self.queues) |
| 14164 | q.breakable() |
| 14165 | q.text('}') |
| 14166 | |
| 14167 | message.subtypes[23] = queue_get_config_reply |
| 14168 | |
| 14169 | class queue_get_config_request(message): |
| 14170 | version = 4 |
| 14171 | type = 22 |
| 14172 | |
| 14173 | def __init__(self, xid=None, port=None): |
| 14174 | if xid != None: |
| 14175 | self.xid = xid |
| 14176 | else: |
| 14177 | self.xid = None |
| 14178 | if port != None: |
| 14179 | self.port = port |
| 14180 | else: |
| 14181 | self.port = 0 |
| 14182 | return |
| 14183 | |
| 14184 | def pack(self): |
| 14185 | packed = [] |
| 14186 | packed.append(struct.pack("!B", self.version)) |
| 14187 | packed.append(struct.pack("!B", self.type)) |
| 14188 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 14189 | packed.append(struct.pack("!L", self.xid)) |
| 14190 | packed.append(util.pack_port_no(self.port)) |
| 14191 | packed.append('\x00' * 4) |
| 14192 | length = sum([len(x) for x in packed]) |
| 14193 | packed[2] = struct.pack("!H", length) |
| 14194 | return ''.join(packed) |
| 14195 | |
| 14196 | @staticmethod |
| 14197 | def unpack(reader): |
| 14198 | obj = queue_get_config_request() |
| 14199 | _version = reader.read("!B")[0] |
| 14200 | assert(_version == 4) |
| 14201 | _type = reader.read("!B")[0] |
| 14202 | assert(_type == 22) |
| 14203 | _length = reader.read("!H")[0] |
| 14204 | orig_reader = reader |
| 14205 | reader = orig_reader.slice(_length, 4) |
| 14206 | obj.xid = reader.read("!L")[0] |
| 14207 | obj.port = util.unpack_port_no(reader) |
| 14208 | reader.skip(4) |
| 14209 | return obj |
| 14210 | |
| 14211 | def __eq__(self, other): |
| 14212 | if type(self) != type(other): return False |
| 14213 | if self.xid != other.xid: return False |
| 14214 | if self.port != other.port: return False |
| 14215 | return True |
| 14216 | |
| 14217 | def pretty_print(self, q): |
| 14218 | q.text("queue_get_config_request {") |
| 14219 | with q.group(): |
| 14220 | with q.indent(2): |
| 14221 | q.breakable() |
| 14222 | q.text("xid = "); |
| 14223 | if self.xid != None: |
| 14224 | q.text("%#x" % self.xid) |
| 14225 | else: |
| 14226 | q.text('None') |
| 14227 | q.text(","); q.breakable() |
| 14228 | q.text("port = "); |
| 14229 | q.text(util.pretty_port(self.port)) |
| 14230 | q.breakable() |
| 14231 | q.text('}') |
| 14232 | |
| 14233 | message.subtypes[22] = queue_get_config_request |
| 14234 | |
| 14235 | class queue_op_failed_error_msg(error_msg): |
| 14236 | version = 4 |
| 14237 | type = 1 |
| 14238 | err_type = 9 |
| 14239 | |
| 14240 | def __init__(self, xid=None, code=None, data=None): |
| 14241 | if xid != None: |
| 14242 | self.xid = xid |
| 14243 | else: |
| 14244 | self.xid = None |
| 14245 | if code != None: |
| 14246 | self.code = code |
| 14247 | else: |
| 14248 | self.code = 0 |
| 14249 | if data != None: |
| 14250 | self.data = data |
| 14251 | else: |
| 14252 | self.data = '' |
| 14253 | return |
| 14254 | |
| 14255 | def pack(self): |
| 14256 | packed = [] |
| 14257 | packed.append(struct.pack("!B", self.version)) |
| 14258 | packed.append(struct.pack("!B", self.type)) |
| 14259 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 14260 | packed.append(struct.pack("!L", self.xid)) |
| 14261 | packed.append(struct.pack("!H", self.err_type)) |
| 14262 | packed.append(struct.pack("!H", self.code)) |
| 14263 | packed.append(self.data) |
| 14264 | length = sum([len(x) for x in packed]) |
| 14265 | packed[2] = struct.pack("!H", length) |
| 14266 | return ''.join(packed) |
| 14267 | |
| 14268 | @staticmethod |
| 14269 | def unpack(reader): |
| 14270 | obj = queue_op_failed_error_msg() |
| 14271 | _version = reader.read("!B")[0] |
| 14272 | assert(_version == 4) |
| 14273 | _type = reader.read("!B")[0] |
| 14274 | assert(_type == 1) |
| 14275 | _length = reader.read("!H")[0] |
| 14276 | orig_reader = reader |
| 14277 | reader = orig_reader.slice(_length, 4) |
| 14278 | obj.xid = reader.read("!L")[0] |
| 14279 | _err_type = reader.read("!H")[0] |
| 14280 | assert(_err_type == 9) |
| 14281 | obj.code = reader.read("!H")[0] |
| 14282 | obj.data = str(reader.read_all()) |
| 14283 | return obj |
| 14284 | |
| 14285 | def __eq__(self, other): |
| 14286 | if type(self) != type(other): return False |
| 14287 | if self.xid != other.xid: return False |
| 14288 | if self.code != other.code: return False |
| 14289 | if self.data != other.data: return False |
| 14290 | return True |
| 14291 | |
| 14292 | def pretty_print(self, q): |
| 14293 | q.text("queue_op_failed_error_msg {") |
| 14294 | with q.group(): |
| 14295 | with q.indent(2): |
| 14296 | q.breakable() |
| 14297 | q.text("xid = "); |
| 14298 | if self.xid != None: |
| 14299 | q.text("%#x" % self.xid) |
| 14300 | else: |
| 14301 | q.text('None') |
| 14302 | q.text(","); q.breakable() |
| 14303 | q.text("code = "); |
| 14304 | q.text("%#x" % self.code) |
| 14305 | q.text(","); q.breakable() |
| 14306 | q.text("data = "); |
| 14307 | q.pp(self.data) |
| 14308 | q.breakable() |
| 14309 | q.text('}') |
| 14310 | |
| 14311 | error_msg.subtypes[9] = queue_op_failed_error_msg |
| 14312 | |
| 14313 | class queue_stats_reply(stats_reply): |
| 14314 | version = 4 |
| 14315 | type = 19 |
| 14316 | stats_type = 5 |
| 14317 | |
| 14318 | def __init__(self, xid=None, flags=None, entries=None): |
| 14319 | if xid != None: |
| 14320 | self.xid = xid |
| 14321 | else: |
| 14322 | self.xid = None |
| 14323 | if flags != None: |
| 14324 | self.flags = flags |
| 14325 | else: |
| 14326 | self.flags = 0 |
| 14327 | if entries != None: |
| 14328 | self.entries = entries |
| 14329 | else: |
| 14330 | self.entries = [] |
| 14331 | return |
| 14332 | |
| 14333 | def pack(self): |
| 14334 | packed = [] |
| 14335 | packed.append(struct.pack("!B", self.version)) |
| 14336 | packed.append(struct.pack("!B", self.type)) |
| 14337 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 14338 | packed.append(struct.pack("!L", self.xid)) |
| 14339 | packed.append(struct.pack("!H", self.stats_type)) |
| 14340 | packed.append(struct.pack("!H", self.flags)) |
| 14341 | packed.append('\x00' * 4) |
| 14342 | packed.append(loxi.generic_util.pack_list(self.entries)) |
| 14343 | length = sum([len(x) for x in packed]) |
| 14344 | packed[2] = struct.pack("!H", length) |
| 14345 | return ''.join(packed) |
| 14346 | |
| 14347 | @staticmethod |
| 14348 | def unpack(reader): |
| 14349 | obj = queue_stats_reply() |
| 14350 | _version = reader.read("!B")[0] |
| 14351 | assert(_version == 4) |
| 14352 | _type = reader.read("!B")[0] |
| 14353 | assert(_type == 19) |
| 14354 | _length = reader.read("!H")[0] |
| 14355 | orig_reader = reader |
| 14356 | reader = orig_reader.slice(_length, 4) |
| 14357 | obj.xid = reader.read("!L")[0] |
| 14358 | _stats_type = reader.read("!H")[0] |
| 14359 | assert(_stats_type == 5) |
| 14360 | obj.flags = reader.read("!H")[0] |
| 14361 | reader.skip(4) |
| 14362 | obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.queue_stats_entry.unpack) |
| 14363 | return obj |
| 14364 | |
| 14365 | def __eq__(self, other): |
| 14366 | if type(self) != type(other): return False |
| 14367 | if self.xid != other.xid: return False |
| 14368 | if self.flags != other.flags: return False |
| 14369 | if self.entries != other.entries: return False |
| 14370 | return True |
| 14371 | |
| 14372 | def pretty_print(self, q): |
| 14373 | q.text("queue_stats_reply {") |
| 14374 | with q.group(): |
| 14375 | with q.indent(2): |
| 14376 | q.breakable() |
| 14377 | q.text("xid = "); |
| 14378 | if self.xid != None: |
| 14379 | q.text("%#x" % self.xid) |
| 14380 | else: |
| 14381 | q.text('None') |
| 14382 | q.text(","); q.breakable() |
| 14383 | q.text("flags = "); |
| 14384 | q.text("%#x" % self.flags) |
| 14385 | q.text(","); q.breakable() |
| 14386 | q.text("entries = "); |
| 14387 | q.pp(self.entries) |
| 14388 | q.breakable() |
| 14389 | q.text('}') |
| 14390 | |
| 14391 | stats_reply.subtypes[5] = queue_stats_reply |
| 14392 | |
| 14393 | class queue_stats_request(stats_request): |
| 14394 | version = 4 |
| 14395 | type = 18 |
| 14396 | stats_type = 5 |
| 14397 | |
| 14398 | def __init__(self, xid=None, flags=None, port_no=None, queue_id=None): |
| 14399 | if xid != None: |
| 14400 | self.xid = xid |
| 14401 | else: |
| 14402 | self.xid = None |
| 14403 | if flags != None: |
| 14404 | self.flags = flags |
| 14405 | else: |
| 14406 | self.flags = 0 |
| 14407 | if port_no != None: |
| 14408 | self.port_no = port_no |
| 14409 | else: |
| 14410 | self.port_no = 0 |
| 14411 | if queue_id != None: |
| 14412 | self.queue_id = queue_id |
| 14413 | else: |
| 14414 | self.queue_id = 0 |
| 14415 | return |
| 14416 | |
| 14417 | def pack(self): |
| 14418 | packed = [] |
| 14419 | packed.append(struct.pack("!B", self.version)) |
| 14420 | packed.append(struct.pack("!B", self.type)) |
| 14421 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 14422 | packed.append(struct.pack("!L", self.xid)) |
| 14423 | packed.append(struct.pack("!H", self.stats_type)) |
| 14424 | packed.append(struct.pack("!H", self.flags)) |
| 14425 | packed.append('\x00' * 4) |
| 14426 | packed.append(util.pack_port_no(self.port_no)) |
| 14427 | packed.append(struct.pack("!L", self.queue_id)) |
| 14428 | length = sum([len(x) for x in packed]) |
| 14429 | packed[2] = struct.pack("!H", length) |
| 14430 | return ''.join(packed) |
| 14431 | |
| 14432 | @staticmethod |
| 14433 | def unpack(reader): |
| 14434 | obj = queue_stats_request() |
| 14435 | _version = reader.read("!B")[0] |
| 14436 | assert(_version == 4) |
| 14437 | _type = reader.read("!B")[0] |
| 14438 | assert(_type == 18) |
| 14439 | _length = reader.read("!H")[0] |
| 14440 | orig_reader = reader |
| 14441 | reader = orig_reader.slice(_length, 4) |
| 14442 | obj.xid = reader.read("!L")[0] |
| 14443 | _stats_type = reader.read("!H")[0] |
| 14444 | assert(_stats_type == 5) |
| 14445 | obj.flags = reader.read("!H")[0] |
| 14446 | reader.skip(4) |
| 14447 | obj.port_no = util.unpack_port_no(reader) |
| 14448 | obj.queue_id = reader.read("!L")[0] |
| 14449 | return obj |
| 14450 | |
| 14451 | def __eq__(self, other): |
| 14452 | if type(self) != type(other): return False |
| 14453 | if self.xid != other.xid: return False |
| 14454 | if self.flags != other.flags: return False |
| 14455 | if self.port_no != other.port_no: return False |
| 14456 | if self.queue_id != other.queue_id: return False |
| 14457 | return True |
| 14458 | |
| 14459 | def pretty_print(self, q): |
| 14460 | q.text("queue_stats_request {") |
| 14461 | with q.group(): |
| 14462 | with q.indent(2): |
| 14463 | q.breakable() |
| 14464 | q.text("xid = "); |
| 14465 | if self.xid != None: |
| 14466 | q.text("%#x" % self.xid) |
| 14467 | else: |
| 14468 | q.text('None') |
| 14469 | q.text(","); q.breakable() |
| 14470 | q.text("flags = "); |
| 14471 | q.text("%#x" % self.flags) |
| 14472 | q.text(","); q.breakable() |
| 14473 | q.text("port_no = "); |
| 14474 | q.text(util.pretty_port(self.port_no)) |
| 14475 | q.text(","); q.breakable() |
| 14476 | q.text("queue_id = "); |
| 14477 | q.text("%#x" % self.queue_id) |
| 14478 | q.breakable() |
| 14479 | q.text('}') |
| 14480 | |
| 14481 | stats_request.subtypes[5] = queue_stats_request |
| 14482 | |
| 14483 | class role_reply(message): |
| 14484 | version = 4 |
| 14485 | type = 25 |
| 14486 | |
| 14487 | def __init__(self, xid=None, role=None, generation_id=None): |
| 14488 | if xid != None: |
| 14489 | self.xid = xid |
| 14490 | else: |
| 14491 | self.xid = None |
| 14492 | if role != None: |
| 14493 | self.role = role |
| 14494 | else: |
| 14495 | self.role = 0 |
| 14496 | if generation_id != None: |
| 14497 | self.generation_id = generation_id |
| 14498 | else: |
| 14499 | self.generation_id = 0 |
| 14500 | return |
| 14501 | |
| 14502 | def pack(self): |
| 14503 | packed = [] |
| 14504 | packed.append(struct.pack("!B", self.version)) |
| 14505 | packed.append(struct.pack("!B", self.type)) |
| 14506 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 14507 | packed.append(struct.pack("!L", self.xid)) |
| 14508 | packed.append(struct.pack("!L", self.role)) |
| 14509 | packed.append('\x00' * 4) |
| 14510 | packed.append(struct.pack("!Q", self.generation_id)) |
| 14511 | length = sum([len(x) for x in packed]) |
| 14512 | packed[2] = struct.pack("!H", length) |
| 14513 | return ''.join(packed) |
| 14514 | |
| 14515 | @staticmethod |
| 14516 | def unpack(reader): |
| 14517 | obj = role_reply() |
| 14518 | _version = reader.read("!B")[0] |
| 14519 | assert(_version == 4) |
| 14520 | _type = reader.read("!B")[0] |
| 14521 | assert(_type == 25) |
| 14522 | _length = reader.read("!H")[0] |
| 14523 | orig_reader = reader |
| 14524 | reader = orig_reader.slice(_length, 4) |
| 14525 | obj.xid = reader.read("!L")[0] |
| 14526 | obj.role = reader.read("!L")[0] |
| 14527 | reader.skip(4) |
| 14528 | obj.generation_id = reader.read("!Q")[0] |
| 14529 | return obj |
| 14530 | |
| 14531 | def __eq__(self, other): |
| 14532 | if type(self) != type(other): return False |
| 14533 | if self.xid != other.xid: return False |
| 14534 | if self.role != other.role: return False |
| 14535 | if self.generation_id != other.generation_id: return False |
| 14536 | return True |
| 14537 | |
| 14538 | def pretty_print(self, q): |
| 14539 | q.text("role_reply {") |
| 14540 | with q.group(): |
| 14541 | with q.indent(2): |
| 14542 | q.breakable() |
| 14543 | q.text("xid = "); |
| 14544 | if self.xid != None: |
| 14545 | q.text("%#x" % self.xid) |
| 14546 | else: |
| 14547 | q.text('None') |
| 14548 | q.text(","); q.breakable() |
| 14549 | q.text("role = "); |
| 14550 | q.text("%#x" % self.role) |
| 14551 | q.text(","); q.breakable() |
| 14552 | q.text("generation_id = "); |
| 14553 | q.text("%#x" % self.generation_id) |
| 14554 | q.breakable() |
| 14555 | q.text('}') |
| 14556 | |
| 14557 | message.subtypes[25] = role_reply |
| 14558 | |
| 14559 | class role_request(message): |
| 14560 | version = 4 |
| 14561 | type = 24 |
| 14562 | |
| 14563 | def __init__(self, xid=None, role=None, generation_id=None): |
| 14564 | if xid != None: |
| 14565 | self.xid = xid |
| 14566 | else: |
| 14567 | self.xid = None |
| 14568 | if role != None: |
| 14569 | self.role = role |
| 14570 | else: |
| 14571 | self.role = 0 |
| 14572 | if generation_id != None: |
| 14573 | self.generation_id = generation_id |
| 14574 | else: |
| 14575 | self.generation_id = 0 |
| 14576 | return |
| 14577 | |
| 14578 | def pack(self): |
| 14579 | packed = [] |
| 14580 | packed.append(struct.pack("!B", self.version)) |
| 14581 | packed.append(struct.pack("!B", self.type)) |
| 14582 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 14583 | packed.append(struct.pack("!L", self.xid)) |
| 14584 | packed.append(struct.pack("!L", self.role)) |
| 14585 | packed.append('\x00' * 4) |
| 14586 | packed.append(struct.pack("!Q", self.generation_id)) |
| 14587 | length = sum([len(x) for x in packed]) |
| 14588 | packed[2] = struct.pack("!H", length) |
| 14589 | return ''.join(packed) |
| 14590 | |
| 14591 | @staticmethod |
| 14592 | def unpack(reader): |
| 14593 | obj = role_request() |
| 14594 | _version = reader.read("!B")[0] |
| 14595 | assert(_version == 4) |
| 14596 | _type = reader.read("!B")[0] |
| 14597 | assert(_type == 24) |
| 14598 | _length = reader.read("!H")[0] |
| 14599 | orig_reader = reader |
| 14600 | reader = orig_reader.slice(_length, 4) |
| 14601 | obj.xid = reader.read("!L")[0] |
| 14602 | obj.role = reader.read("!L")[0] |
| 14603 | reader.skip(4) |
| 14604 | obj.generation_id = reader.read("!Q")[0] |
| 14605 | return obj |
| 14606 | |
| 14607 | def __eq__(self, other): |
| 14608 | if type(self) != type(other): return False |
| 14609 | if self.xid != other.xid: return False |
| 14610 | if self.role != other.role: return False |
| 14611 | if self.generation_id != other.generation_id: return False |
| 14612 | return True |
| 14613 | |
| 14614 | def pretty_print(self, q): |
| 14615 | q.text("role_request {") |
| 14616 | with q.group(): |
| 14617 | with q.indent(2): |
| 14618 | q.breakable() |
| 14619 | q.text("xid = "); |
| 14620 | if self.xid != None: |
| 14621 | q.text("%#x" % self.xid) |
| 14622 | else: |
| 14623 | q.text('None') |
| 14624 | q.text(","); q.breakable() |
| 14625 | q.text("role = "); |
| 14626 | q.text("%#x" % self.role) |
| 14627 | q.text(","); q.breakable() |
| 14628 | q.text("generation_id = "); |
| 14629 | q.text("%#x" % self.generation_id) |
| 14630 | q.breakable() |
| 14631 | q.text('}') |
| 14632 | |
| 14633 | message.subtypes[24] = role_request |
| 14634 | |
| 14635 | class role_request_failed_error_msg(error_msg): |
| 14636 | version = 4 |
| 14637 | type = 1 |
| 14638 | err_type = 11 |
| 14639 | |
| 14640 | def __init__(self, xid=None, code=None, data=None): |
| 14641 | if xid != None: |
| 14642 | self.xid = xid |
| 14643 | else: |
| 14644 | self.xid = None |
| 14645 | if code != None: |
| 14646 | self.code = code |
| 14647 | else: |
| 14648 | self.code = 0 |
| 14649 | if data != None: |
| 14650 | self.data = data |
| 14651 | else: |
| 14652 | self.data = '' |
| 14653 | return |
| 14654 | |
| 14655 | def pack(self): |
| 14656 | packed = [] |
| 14657 | packed.append(struct.pack("!B", self.version)) |
| 14658 | packed.append(struct.pack("!B", self.type)) |
| 14659 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 14660 | packed.append(struct.pack("!L", self.xid)) |
| 14661 | packed.append(struct.pack("!H", self.err_type)) |
| 14662 | packed.append(struct.pack("!H", self.code)) |
| 14663 | packed.append(self.data) |
| 14664 | length = sum([len(x) for x in packed]) |
| 14665 | packed[2] = struct.pack("!H", length) |
| 14666 | return ''.join(packed) |
| 14667 | |
| 14668 | @staticmethod |
| 14669 | def unpack(reader): |
| 14670 | obj = role_request_failed_error_msg() |
| 14671 | _version = reader.read("!B")[0] |
| 14672 | assert(_version == 4) |
| 14673 | _type = reader.read("!B")[0] |
| 14674 | assert(_type == 1) |
| 14675 | _length = reader.read("!H")[0] |
| 14676 | orig_reader = reader |
| 14677 | reader = orig_reader.slice(_length, 4) |
| 14678 | obj.xid = reader.read("!L")[0] |
| 14679 | _err_type = reader.read("!H")[0] |
| 14680 | assert(_err_type == 11) |
| 14681 | obj.code = reader.read("!H")[0] |
| 14682 | obj.data = str(reader.read_all()) |
| 14683 | return obj |
| 14684 | |
| 14685 | def __eq__(self, other): |
| 14686 | if type(self) != type(other): return False |
| 14687 | if self.xid != other.xid: return False |
| 14688 | if self.code != other.code: return False |
| 14689 | if self.data != other.data: return False |
| 14690 | return True |
| 14691 | |
| 14692 | def pretty_print(self, q): |
| 14693 | q.text("role_request_failed_error_msg {") |
| 14694 | with q.group(): |
| 14695 | with q.indent(2): |
| 14696 | q.breakable() |
| 14697 | q.text("xid = "); |
| 14698 | if self.xid != None: |
| 14699 | q.text("%#x" % self.xid) |
| 14700 | else: |
| 14701 | q.text('None') |
| 14702 | q.text(","); q.breakable() |
| 14703 | q.text("code = "); |
| 14704 | q.text("%#x" % self.code) |
| 14705 | q.text(","); q.breakable() |
| 14706 | q.text("data = "); |
| 14707 | q.pp(self.data) |
| 14708 | q.breakable() |
| 14709 | q.text('}') |
| 14710 | |
| 14711 | error_msg.subtypes[11] = role_request_failed_error_msg |
| 14712 | |
| 14713 | class set_config(message): |
| 14714 | version = 4 |
| 14715 | type = 9 |
| 14716 | |
| 14717 | def __init__(self, xid=None, flags=None, miss_send_len=None): |
| 14718 | if xid != None: |
| 14719 | self.xid = xid |
| 14720 | else: |
| 14721 | self.xid = None |
| 14722 | if flags != None: |
| 14723 | self.flags = flags |
| 14724 | else: |
| 14725 | self.flags = 0 |
| 14726 | if miss_send_len != None: |
| 14727 | self.miss_send_len = miss_send_len |
| 14728 | else: |
| 14729 | self.miss_send_len = 0 |
| 14730 | return |
| 14731 | |
| 14732 | def pack(self): |
| 14733 | packed = [] |
| 14734 | packed.append(struct.pack("!B", self.version)) |
| 14735 | packed.append(struct.pack("!B", self.type)) |
| 14736 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 14737 | packed.append(struct.pack("!L", self.xid)) |
| 14738 | packed.append(struct.pack("!H", self.flags)) |
| 14739 | packed.append(struct.pack("!H", self.miss_send_len)) |
| 14740 | length = sum([len(x) for x in packed]) |
| 14741 | packed[2] = struct.pack("!H", length) |
| 14742 | return ''.join(packed) |
| 14743 | |
| 14744 | @staticmethod |
| 14745 | def unpack(reader): |
| 14746 | obj = set_config() |
| 14747 | _version = reader.read("!B")[0] |
| 14748 | assert(_version == 4) |
| 14749 | _type = reader.read("!B")[0] |
| 14750 | assert(_type == 9) |
| 14751 | _length = reader.read("!H")[0] |
| 14752 | orig_reader = reader |
| 14753 | reader = orig_reader.slice(_length, 4) |
| 14754 | obj.xid = reader.read("!L")[0] |
| 14755 | obj.flags = reader.read("!H")[0] |
| 14756 | obj.miss_send_len = reader.read("!H")[0] |
| 14757 | return obj |
| 14758 | |
| 14759 | def __eq__(self, other): |
| 14760 | if type(self) != type(other): return False |
| 14761 | if self.xid != other.xid: return False |
| 14762 | if self.flags != other.flags: return False |
| 14763 | if self.miss_send_len != other.miss_send_len: return False |
| 14764 | return True |
| 14765 | |
| 14766 | def pretty_print(self, q): |
| 14767 | q.text("set_config {") |
| 14768 | with q.group(): |
| 14769 | with q.indent(2): |
| 14770 | q.breakable() |
| 14771 | q.text("xid = "); |
| 14772 | if self.xid != None: |
| 14773 | q.text("%#x" % self.xid) |
| 14774 | else: |
| 14775 | q.text('None') |
| 14776 | q.text(","); q.breakable() |
| 14777 | q.text("flags = "); |
| 14778 | q.text("%#x" % self.flags) |
| 14779 | q.text(","); q.breakable() |
| 14780 | q.text("miss_send_len = "); |
| 14781 | q.text("%#x" % self.miss_send_len) |
| 14782 | q.breakable() |
| 14783 | q.text('}') |
| 14784 | |
| 14785 | message.subtypes[9] = set_config |
| 14786 | |
| 14787 | class switch_config_failed_error_msg(error_msg): |
| 14788 | version = 4 |
| 14789 | type = 1 |
| 14790 | err_type = 10 |
| 14791 | |
| 14792 | def __init__(self, xid=None, code=None, data=None): |
| 14793 | if xid != None: |
| 14794 | self.xid = xid |
| 14795 | else: |
| 14796 | self.xid = None |
| 14797 | if code != None: |
| 14798 | self.code = code |
| 14799 | else: |
| 14800 | self.code = 0 |
| 14801 | if data != None: |
| 14802 | self.data = data |
| 14803 | else: |
| 14804 | self.data = '' |
| 14805 | return |
| 14806 | |
| 14807 | def pack(self): |
| 14808 | packed = [] |
| 14809 | packed.append(struct.pack("!B", self.version)) |
| 14810 | packed.append(struct.pack("!B", self.type)) |
| 14811 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 14812 | packed.append(struct.pack("!L", self.xid)) |
| 14813 | packed.append(struct.pack("!H", self.err_type)) |
| 14814 | packed.append(struct.pack("!H", self.code)) |
| 14815 | packed.append(self.data) |
| 14816 | length = sum([len(x) for x in packed]) |
| 14817 | packed[2] = struct.pack("!H", length) |
| 14818 | return ''.join(packed) |
| 14819 | |
| 14820 | @staticmethod |
| 14821 | def unpack(reader): |
| 14822 | obj = switch_config_failed_error_msg() |
| 14823 | _version = reader.read("!B")[0] |
| 14824 | assert(_version == 4) |
| 14825 | _type = reader.read("!B")[0] |
| 14826 | assert(_type == 1) |
| 14827 | _length = reader.read("!H")[0] |
| 14828 | orig_reader = reader |
| 14829 | reader = orig_reader.slice(_length, 4) |
| 14830 | obj.xid = reader.read("!L")[0] |
| 14831 | _err_type = reader.read("!H")[0] |
| 14832 | assert(_err_type == 10) |
| 14833 | obj.code = reader.read("!H")[0] |
| 14834 | obj.data = str(reader.read_all()) |
| 14835 | return obj |
| 14836 | |
| 14837 | def __eq__(self, other): |
| 14838 | if type(self) != type(other): return False |
| 14839 | if self.xid != other.xid: return False |
| 14840 | if self.code != other.code: return False |
| 14841 | if self.data != other.data: return False |
| 14842 | return True |
| 14843 | |
| 14844 | def pretty_print(self, q): |
| 14845 | q.text("switch_config_failed_error_msg {") |
| 14846 | with q.group(): |
| 14847 | with q.indent(2): |
| 14848 | q.breakable() |
| 14849 | q.text("xid = "); |
| 14850 | if self.xid != None: |
| 14851 | q.text("%#x" % self.xid) |
| 14852 | else: |
| 14853 | q.text('None') |
| 14854 | q.text(","); q.breakable() |
| 14855 | q.text("code = "); |
| 14856 | q.text("%#x" % self.code) |
| 14857 | q.text(","); q.breakable() |
| 14858 | q.text("data = "); |
| 14859 | q.pp(self.data) |
| 14860 | q.breakable() |
| 14861 | q.text('}') |
| 14862 | |
| 14863 | error_msg.subtypes[10] = switch_config_failed_error_msg |
| 14864 | |
| 14865 | class table_features_failed_error_msg(error_msg): |
| 14866 | version = 4 |
| 14867 | type = 1 |
| 14868 | err_type = 13 |
| 14869 | |
| 14870 | def __init__(self, xid=None, code=None, data=None): |
| 14871 | if xid != None: |
| 14872 | self.xid = xid |
| 14873 | else: |
| 14874 | self.xid = None |
| 14875 | if code != None: |
| 14876 | self.code = code |
| 14877 | else: |
| 14878 | self.code = 0 |
| 14879 | if data != None: |
| 14880 | self.data = data |
| 14881 | else: |
| 14882 | self.data = '' |
| 14883 | return |
| 14884 | |
| 14885 | def pack(self): |
| 14886 | packed = [] |
| 14887 | packed.append(struct.pack("!B", self.version)) |
| 14888 | packed.append(struct.pack("!B", self.type)) |
| 14889 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 14890 | packed.append(struct.pack("!L", self.xid)) |
| 14891 | packed.append(struct.pack("!H", self.err_type)) |
| 14892 | packed.append(struct.pack("!H", self.code)) |
| 14893 | packed.append(self.data) |
| 14894 | length = sum([len(x) for x in packed]) |
| 14895 | packed[2] = struct.pack("!H", length) |
| 14896 | return ''.join(packed) |
| 14897 | |
| 14898 | @staticmethod |
| 14899 | def unpack(reader): |
| 14900 | obj = table_features_failed_error_msg() |
| 14901 | _version = reader.read("!B")[0] |
| 14902 | assert(_version == 4) |
| 14903 | _type = reader.read("!B")[0] |
| 14904 | assert(_type == 1) |
| 14905 | _length = reader.read("!H")[0] |
| 14906 | orig_reader = reader |
| 14907 | reader = orig_reader.slice(_length, 4) |
| 14908 | obj.xid = reader.read("!L")[0] |
| 14909 | _err_type = reader.read("!H")[0] |
| 14910 | assert(_err_type == 13) |
| 14911 | obj.code = reader.read("!H")[0] |
| 14912 | obj.data = str(reader.read_all()) |
| 14913 | return obj |
| 14914 | |
| 14915 | def __eq__(self, other): |
| 14916 | if type(self) != type(other): return False |
| 14917 | if self.xid != other.xid: return False |
| 14918 | if self.code != other.code: return False |
| 14919 | if self.data != other.data: return False |
| 14920 | return True |
| 14921 | |
| 14922 | def pretty_print(self, q): |
| 14923 | q.text("table_features_failed_error_msg {") |
| 14924 | with q.group(): |
| 14925 | with q.indent(2): |
| 14926 | q.breakable() |
| 14927 | q.text("xid = "); |
| 14928 | if self.xid != None: |
| 14929 | q.text("%#x" % self.xid) |
| 14930 | else: |
| 14931 | q.text('None') |
| 14932 | q.text(","); q.breakable() |
| 14933 | q.text("code = "); |
| 14934 | q.text("%#x" % self.code) |
| 14935 | q.text(","); q.breakable() |
| 14936 | q.text("data = "); |
| 14937 | q.pp(self.data) |
| 14938 | q.breakable() |
| 14939 | q.text('}') |
| 14940 | |
| 14941 | error_msg.subtypes[13] = table_features_failed_error_msg |
| 14942 | |
| 14943 | class table_features_stats_reply(stats_reply): |
| 14944 | version = 4 |
| 14945 | type = 19 |
| 14946 | stats_type = 12 |
| 14947 | |
| 14948 | def __init__(self, xid=None, flags=None, entries=None): |
| 14949 | if xid != None: |
| 14950 | self.xid = xid |
| 14951 | else: |
| 14952 | self.xid = None |
| 14953 | if flags != None: |
| 14954 | self.flags = flags |
| 14955 | else: |
| 14956 | self.flags = 0 |
| 14957 | if entries != None: |
| 14958 | self.entries = entries |
| 14959 | else: |
| 14960 | self.entries = [] |
| 14961 | return |
| 14962 | |
| 14963 | def pack(self): |
| 14964 | packed = [] |
| 14965 | packed.append(struct.pack("!B", self.version)) |
| 14966 | packed.append(struct.pack("!B", self.type)) |
| 14967 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 14968 | packed.append(struct.pack("!L", self.xid)) |
| 14969 | packed.append(struct.pack("!H", self.stats_type)) |
| 14970 | packed.append(struct.pack("!H", self.flags)) |
| 14971 | packed.append('\x00' * 4) |
| 14972 | packed.append(loxi.generic_util.pack_list(self.entries)) |
| 14973 | length = sum([len(x) for x in packed]) |
| 14974 | packed[2] = struct.pack("!H", length) |
| 14975 | return ''.join(packed) |
| 14976 | |
| 14977 | @staticmethod |
| 14978 | def unpack(reader): |
| 14979 | obj = table_features_stats_reply() |
| 14980 | _version = reader.read("!B")[0] |
| 14981 | assert(_version == 4) |
| 14982 | _type = reader.read("!B")[0] |
| 14983 | assert(_type == 19) |
| 14984 | _length = reader.read("!H")[0] |
| 14985 | orig_reader = reader |
| 14986 | reader = orig_reader.slice(_length, 4) |
| 14987 | obj.xid = reader.read("!L")[0] |
| 14988 | _stats_type = reader.read("!H")[0] |
| 14989 | assert(_stats_type == 12) |
| 14990 | obj.flags = reader.read("!H")[0] |
| 14991 | reader.skip(4) |
| 14992 | obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.table_features.unpack) |
| 14993 | return obj |
| 14994 | |
| 14995 | def __eq__(self, other): |
| 14996 | if type(self) != type(other): return False |
| 14997 | if self.xid != other.xid: return False |
| 14998 | if self.flags != other.flags: return False |
| 14999 | if self.entries != other.entries: return False |
| 15000 | return True |
| 15001 | |
| 15002 | def pretty_print(self, q): |
| 15003 | q.text("table_features_stats_reply {") |
| 15004 | with q.group(): |
| 15005 | with q.indent(2): |
| 15006 | q.breakable() |
| 15007 | q.text("xid = "); |
| 15008 | if self.xid != None: |
| 15009 | q.text("%#x" % self.xid) |
| 15010 | else: |
| 15011 | q.text('None') |
| 15012 | q.text(","); q.breakable() |
| 15013 | q.text("flags = "); |
| 15014 | q.text("%#x" % self.flags) |
| 15015 | q.text(","); q.breakable() |
| 15016 | q.text("entries = "); |
| 15017 | q.pp(self.entries) |
| 15018 | q.breakable() |
| 15019 | q.text('}') |
| 15020 | |
| 15021 | stats_reply.subtypes[12] = table_features_stats_reply |
| 15022 | |
| 15023 | class table_features_stats_request(stats_request): |
| 15024 | version = 4 |
| 15025 | type = 18 |
| 15026 | stats_type = 12 |
| 15027 | |
| 15028 | def __init__(self, xid=None, flags=None, entries=None): |
| 15029 | if xid != None: |
| 15030 | self.xid = xid |
| 15031 | else: |
| 15032 | self.xid = None |
| 15033 | if flags != None: |
| 15034 | self.flags = flags |
| 15035 | else: |
| 15036 | self.flags = 0 |
| 15037 | if entries != None: |
| 15038 | self.entries = entries |
| 15039 | else: |
| 15040 | self.entries = [] |
| 15041 | return |
| 15042 | |
| 15043 | def pack(self): |
| 15044 | packed = [] |
| 15045 | packed.append(struct.pack("!B", self.version)) |
| 15046 | packed.append(struct.pack("!B", self.type)) |
| 15047 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 15048 | packed.append(struct.pack("!L", self.xid)) |
| 15049 | packed.append(struct.pack("!H", self.stats_type)) |
| 15050 | packed.append(struct.pack("!H", self.flags)) |
| 15051 | packed.append('\x00' * 4) |
| 15052 | packed.append(loxi.generic_util.pack_list(self.entries)) |
| 15053 | length = sum([len(x) for x in packed]) |
| 15054 | packed[2] = struct.pack("!H", length) |
| 15055 | return ''.join(packed) |
| 15056 | |
| 15057 | @staticmethod |
| 15058 | def unpack(reader): |
| 15059 | obj = table_features_stats_request() |
| 15060 | _version = reader.read("!B")[0] |
| 15061 | assert(_version == 4) |
| 15062 | _type = reader.read("!B")[0] |
| 15063 | assert(_type == 18) |
| 15064 | _length = reader.read("!H")[0] |
| 15065 | orig_reader = reader |
| 15066 | reader = orig_reader.slice(_length, 4) |
| 15067 | obj.xid = reader.read("!L")[0] |
| 15068 | _stats_type = reader.read("!H")[0] |
| 15069 | assert(_stats_type == 12) |
| 15070 | obj.flags = reader.read("!H")[0] |
| 15071 | reader.skip(4) |
| 15072 | obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.table_features.unpack) |
| 15073 | return obj |
| 15074 | |
| 15075 | def __eq__(self, other): |
| 15076 | if type(self) != type(other): return False |
| 15077 | if self.xid != other.xid: return False |
| 15078 | if self.flags != other.flags: return False |
| 15079 | if self.entries != other.entries: return False |
| 15080 | return True |
| 15081 | |
| 15082 | def pretty_print(self, q): |
| 15083 | q.text("table_features_stats_request {") |
| 15084 | with q.group(): |
| 15085 | with q.indent(2): |
| 15086 | q.breakable() |
| 15087 | q.text("xid = "); |
| 15088 | if self.xid != None: |
| 15089 | q.text("%#x" % self.xid) |
| 15090 | else: |
| 15091 | q.text('None') |
| 15092 | q.text(","); q.breakable() |
| 15093 | q.text("flags = "); |
| 15094 | q.text("%#x" % self.flags) |
| 15095 | q.text(","); q.breakable() |
| 15096 | q.text("entries = "); |
| 15097 | q.pp(self.entries) |
| 15098 | q.breakable() |
| 15099 | q.text('}') |
| 15100 | |
| 15101 | stats_request.subtypes[12] = table_features_stats_request |
| 15102 | |
| 15103 | class table_mod(message): |
| 15104 | version = 4 |
| 15105 | type = 17 |
| 15106 | |
| 15107 | def __init__(self, xid=None, table_id=None, config=None): |
| 15108 | if xid != None: |
| 15109 | self.xid = xid |
| 15110 | else: |
| 15111 | self.xid = None |
| 15112 | if table_id != None: |
| 15113 | self.table_id = table_id |
| 15114 | else: |
| 15115 | self.table_id = 0 |
| 15116 | if config != None: |
| 15117 | self.config = config |
| 15118 | else: |
| 15119 | self.config = 0 |
| 15120 | return |
| 15121 | |
| 15122 | def pack(self): |
| 15123 | packed = [] |
| 15124 | packed.append(struct.pack("!B", self.version)) |
| 15125 | packed.append(struct.pack("!B", self.type)) |
| 15126 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 15127 | packed.append(struct.pack("!L", self.xid)) |
| 15128 | packed.append(struct.pack("!B", self.table_id)) |
| 15129 | packed.append('\x00' * 3) |
| 15130 | packed.append(struct.pack("!L", self.config)) |
| 15131 | length = sum([len(x) for x in packed]) |
| 15132 | packed[2] = struct.pack("!H", length) |
| 15133 | return ''.join(packed) |
| 15134 | |
| 15135 | @staticmethod |
| 15136 | def unpack(reader): |
| 15137 | obj = table_mod() |
| 15138 | _version = reader.read("!B")[0] |
| 15139 | assert(_version == 4) |
| 15140 | _type = reader.read("!B")[0] |
| 15141 | assert(_type == 17) |
| 15142 | _length = reader.read("!H")[0] |
| 15143 | orig_reader = reader |
| 15144 | reader = orig_reader.slice(_length, 4) |
| 15145 | obj.xid = reader.read("!L")[0] |
| 15146 | obj.table_id = reader.read("!B")[0] |
| 15147 | reader.skip(3) |
| 15148 | obj.config = reader.read("!L")[0] |
| 15149 | return obj |
| 15150 | |
| 15151 | def __eq__(self, other): |
| 15152 | if type(self) != type(other): return False |
| 15153 | if self.xid != other.xid: return False |
| 15154 | if self.table_id != other.table_id: return False |
| 15155 | if self.config != other.config: return False |
| 15156 | return True |
| 15157 | |
| 15158 | def pretty_print(self, q): |
| 15159 | q.text("table_mod {") |
| 15160 | with q.group(): |
| 15161 | with q.indent(2): |
| 15162 | q.breakable() |
| 15163 | q.text("xid = "); |
| 15164 | if self.xid != None: |
| 15165 | q.text("%#x" % self.xid) |
| 15166 | else: |
| 15167 | q.text('None') |
| 15168 | q.text(","); q.breakable() |
| 15169 | q.text("table_id = "); |
| 15170 | q.text("%#x" % self.table_id) |
| 15171 | q.text(","); q.breakable() |
| 15172 | q.text("config = "); |
| 15173 | q.text("%#x" % self.config) |
| 15174 | q.breakable() |
| 15175 | q.text('}') |
| 15176 | |
| 15177 | message.subtypes[17] = table_mod |
| 15178 | |
| 15179 | class table_mod_failed_error_msg(error_msg): |
| 15180 | version = 4 |
| 15181 | type = 1 |
| 15182 | err_type = 8 |
| 15183 | |
| 15184 | def __init__(self, xid=None, code=None, data=None): |
| 15185 | if xid != None: |
| 15186 | self.xid = xid |
| 15187 | else: |
| 15188 | self.xid = None |
| 15189 | if code != None: |
| 15190 | self.code = code |
| 15191 | else: |
| 15192 | self.code = 0 |
| 15193 | if data != None: |
| 15194 | self.data = data |
| 15195 | else: |
| 15196 | self.data = '' |
| 15197 | return |
| 15198 | |
| 15199 | def pack(self): |
| 15200 | packed = [] |
| 15201 | packed.append(struct.pack("!B", self.version)) |
| 15202 | packed.append(struct.pack("!B", self.type)) |
| 15203 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 15204 | packed.append(struct.pack("!L", self.xid)) |
| 15205 | packed.append(struct.pack("!H", self.err_type)) |
| 15206 | packed.append(struct.pack("!H", self.code)) |
| 15207 | packed.append(self.data) |
| 15208 | length = sum([len(x) for x in packed]) |
| 15209 | packed[2] = struct.pack("!H", length) |
| 15210 | return ''.join(packed) |
| 15211 | |
| 15212 | @staticmethod |
| 15213 | def unpack(reader): |
| 15214 | obj = table_mod_failed_error_msg() |
| 15215 | _version = reader.read("!B")[0] |
| 15216 | assert(_version == 4) |
| 15217 | _type = reader.read("!B")[0] |
| 15218 | assert(_type == 1) |
| 15219 | _length = reader.read("!H")[0] |
| 15220 | orig_reader = reader |
| 15221 | reader = orig_reader.slice(_length, 4) |
| 15222 | obj.xid = reader.read("!L")[0] |
| 15223 | _err_type = reader.read("!H")[0] |
| 15224 | assert(_err_type == 8) |
| 15225 | obj.code = reader.read("!H")[0] |
| 15226 | obj.data = str(reader.read_all()) |
| 15227 | return obj |
| 15228 | |
| 15229 | def __eq__(self, other): |
| 15230 | if type(self) != type(other): return False |
| 15231 | if self.xid != other.xid: return False |
| 15232 | if self.code != other.code: return False |
| 15233 | if self.data != other.data: return False |
| 15234 | return True |
| 15235 | |
| 15236 | def pretty_print(self, q): |
| 15237 | q.text("table_mod_failed_error_msg {") |
| 15238 | with q.group(): |
| 15239 | with q.indent(2): |
| 15240 | q.breakable() |
| 15241 | q.text("xid = "); |
| 15242 | if self.xid != None: |
| 15243 | q.text("%#x" % self.xid) |
| 15244 | else: |
| 15245 | q.text('None') |
| 15246 | q.text(","); q.breakable() |
| 15247 | q.text("code = "); |
| 15248 | q.text("%#x" % self.code) |
| 15249 | q.text(","); q.breakable() |
| 15250 | q.text("data = "); |
| 15251 | q.pp(self.data) |
| 15252 | q.breakable() |
| 15253 | q.text('}') |
| 15254 | |
| 15255 | error_msg.subtypes[8] = table_mod_failed_error_msg |
| 15256 | |
| 15257 | class table_stats_reply(stats_reply): |
| 15258 | version = 4 |
| 15259 | type = 19 |
| 15260 | stats_type = 3 |
| 15261 | |
| 15262 | def __init__(self, xid=None, flags=None, entries=None): |
| 15263 | if xid != None: |
| 15264 | self.xid = xid |
| 15265 | else: |
| 15266 | self.xid = None |
| 15267 | if flags != None: |
| 15268 | self.flags = flags |
| 15269 | else: |
| 15270 | self.flags = 0 |
| 15271 | if entries != None: |
| 15272 | self.entries = entries |
| 15273 | else: |
| 15274 | self.entries = [] |
| 15275 | return |
| 15276 | |
| 15277 | def pack(self): |
| 15278 | packed = [] |
| 15279 | packed.append(struct.pack("!B", self.version)) |
| 15280 | packed.append(struct.pack("!B", self.type)) |
| 15281 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 15282 | packed.append(struct.pack("!L", self.xid)) |
| 15283 | packed.append(struct.pack("!H", self.stats_type)) |
| 15284 | packed.append(struct.pack("!H", self.flags)) |
| 15285 | packed.append('\x00' * 4) |
| 15286 | packed.append(loxi.generic_util.pack_list(self.entries)) |
| 15287 | length = sum([len(x) for x in packed]) |
| 15288 | packed[2] = struct.pack("!H", length) |
| 15289 | return ''.join(packed) |
| 15290 | |
| 15291 | @staticmethod |
| 15292 | def unpack(reader): |
| 15293 | obj = table_stats_reply() |
| 15294 | _version = reader.read("!B")[0] |
| 15295 | assert(_version == 4) |
| 15296 | _type = reader.read("!B")[0] |
| 15297 | assert(_type == 19) |
| 15298 | _length = reader.read("!H")[0] |
| 15299 | orig_reader = reader |
| 15300 | reader = orig_reader.slice(_length, 4) |
| 15301 | obj.xid = reader.read("!L")[0] |
| 15302 | _stats_type = reader.read("!H")[0] |
| 15303 | assert(_stats_type == 3) |
| 15304 | obj.flags = reader.read("!H")[0] |
| 15305 | reader.skip(4) |
| 15306 | obj.entries = loxi.generic_util.unpack_list(reader, ofp.common.table_stats_entry.unpack) |
| 15307 | return obj |
| 15308 | |
| 15309 | def __eq__(self, other): |
| 15310 | if type(self) != type(other): return False |
| 15311 | if self.xid != other.xid: return False |
| 15312 | if self.flags != other.flags: return False |
| 15313 | if self.entries != other.entries: return False |
| 15314 | return True |
| 15315 | |
| 15316 | def pretty_print(self, q): |
| 15317 | q.text("table_stats_reply {") |
| 15318 | with q.group(): |
| 15319 | with q.indent(2): |
| 15320 | q.breakable() |
| 15321 | q.text("xid = "); |
| 15322 | if self.xid != None: |
| 15323 | q.text("%#x" % self.xid) |
| 15324 | else: |
| 15325 | q.text('None') |
| 15326 | q.text(","); q.breakable() |
| 15327 | q.text("flags = "); |
| 15328 | q.text("%#x" % self.flags) |
| 15329 | q.text(","); q.breakable() |
| 15330 | q.text("entries = "); |
| 15331 | q.pp(self.entries) |
| 15332 | q.breakable() |
| 15333 | q.text('}') |
| 15334 | |
| 15335 | stats_reply.subtypes[3] = table_stats_reply |
| 15336 | |
| 15337 | class table_stats_request(stats_request): |
| 15338 | version = 4 |
| 15339 | type = 18 |
| 15340 | stats_type = 3 |
| 15341 | |
| 15342 | def __init__(self, xid=None, flags=None): |
| 15343 | if xid != None: |
| 15344 | self.xid = xid |
| 15345 | else: |
| 15346 | self.xid = None |
| 15347 | if flags != None: |
| 15348 | self.flags = flags |
| 15349 | else: |
| 15350 | self.flags = 0 |
| 15351 | return |
| 15352 | |
| 15353 | def pack(self): |
| 15354 | packed = [] |
| 15355 | packed.append(struct.pack("!B", self.version)) |
| 15356 | packed.append(struct.pack("!B", self.type)) |
| 15357 | packed.append(struct.pack("!H", 0)) # placeholder for length at index 2 |
| 15358 | packed.append(struct.pack("!L", self.xid)) |
| 15359 | packed.append(struct.pack("!H", self.stats_type)) |
| 15360 | packed.append(struct.pack("!H", self.flags)) |
| 15361 | packed.append('\x00' * 4) |
| 15362 | length = sum([len(x) for x in packed]) |
| 15363 | packed[2] = struct.pack("!H", length) |
| 15364 | return ''.join(packed) |
| 15365 | |
| 15366 | @staticmethod |
| 15367 | def unpack(reader): |
| 15368 | obj = table_stats_request() |
| 15369 | _version = reader.read("!B")[0] |
| 15370 | assert(_version == 4) |
| 15371 | _type = reader.read("!B")[0] |
| 15372 | assert(_type == 18) |
| 15373 | _length = reader.read("!H")[0] |
| 15374 | orig_reader = reader |
| 15375 | reader = orig_reader.slice(_length, 4) |
| 15376 | obj.xid = reader.read("!L")[0] |
| 15377 | _stats_type = reader.read("!H")[0] |
| 15378 | assert(_stats_type == 3) |
| 15379 | obj.flags = reader.read("!H")[0] |
| 15380 | reader.skip(4) |
| 15381 | return obj |
| 15382 | |
| 15383 | def __eq__(self, other): |
| 15384 | if type(self) != type(other): return False |
| 15385 | if self.xid != other.xid: return False |
| 15386 | if self.flags != other.flags: return False |
| 15387 | return True |
| 15388 | |
| 15389 | def pretty_print(self, q): |
| 15390 | q.text("table_stats_request {") |
| 15391 | with q.group(): |
| 15392 | with q.indent(2): |
| 15393 | q.breakable() |
| 15394 | q.text("xid = "); |
| 15395 | if self.xid != None: |
| 15396 | q.text("%#x" % self.xid) |
| 15397 | else: |
| 15398 | q.text('None') |
| 15399 | q.text(","); q.breakable() |
| 15400 | q.text("flags = "); |
| 15401 | q.text("%#x" % self.flags) |
| 15402 | q.breakable() |
| 15403 | q.text('}') |
| 15404 | |
| 15405 | stats_request.subtypes[3] = table_stats_request |
| 15406 | |
| 15407 | |
| 15408 | def parse_header(buf): |
| 15409 | if len(buf) < 8: |
| 15410 | raise loxi.ProtocolError("too short to be an OpenFlow message") |
| 15411 | return struct.unpack_from("!BBHL", buf) |
| 15412 | |
| 15413 | def parse_message(buf): |
| 15414 | msg_ver, msg_type, msg_len, msg_xid = parse_header(buf) |
| 15415 | if msg_ver != ofp.OFP_VERSION and msg_type != ofp.OFPT_HELLO: |
| 15416 | raise loxi.ProtocolError("wrong OpenFlow version (expected %d, got %d)" % (ofp.OFP_VERSION, msg_ver)) |
| 15417 | if len(buf) != msg_len: |
| 15418 | raise loxi.ProtocolError("incorrect message size") |
| 15419 | return message.unpack(loxi.generic_util.OFReader(buf)) |