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