How to use breakable method in hypothesis

Best Python code snippet using hypothesis

oxm.py

Source:oxm.py Github

copy

Full Screen

...51 def pretty_print(self, q):52 q.text("oxm {")53 with q.group():54 with q.indent(2):55 q.breakable()56 q.breakable()57 q.text('}')58class arp_op(oxm):59 type_len = 214749440260 def __init__(self, value=None):61 if value != None:62 self.value = value63 else:64 self.value = 065 return66 def pack(self):67 packed = []68 packed.append(struct.pack("!L", self.type_len))69 packed.append(struct.pack("!H", self.value))70 return ''.join(packed)71 @staticmethod72 def unpack(reader):73 obj = arp_op()74 _type_len = reader.read("!L")[0]75 assert(_type_len == 2147494402)76 obj.value = reader.read("!H")[0]77 return obj78 def __eq__(self, other):79 if type(self) != type(other): return False80 if self.value != other.value: return False81 return True82 def pretty_print(self, q):83 q.text("arp_op {")84 with q.group():85 with q.indent(2):86 q.breakable()87 q.text("value = ");88 q.text("%#x" % self.value)89 q.breakable()90 q.text('}')91oxm.subtypes[2147494402] = arp_op92class arp_op_masked(oxm):93 type_len = 214749466094 def __init__(self, value=None, value_mask=None):95 if value != None:96 self.value = value97 else:98 self.value = 099 if value_mask != None:100 self.value_mask = value_mask101 else:102 self.value_mask = 0103 return104 def pack(self):105 packed = []106 packed.append(struct.pack("!L", self.type_len))107 packed.append(struct.pack("!H", self.value))108 packed.append(struct.pack("!H", self.value_mask))109 return ''.join(packed)110 @staticmethod111 def unpack(reader):112 obj = arp_op_masked()113 _type_len = reader.read("!L")[0]114 assert(_type_len == 2147494660)115 obj.value = reader.read("!H")[0]116 obj.value_mask = reader.read("!H")[0]117 return obj118 def __eq__(self, other):119 if type(self) != type(other): return False120 if self.value != other.value: return False121 if self.value_mask != other.value_mask: return False122 return True123 def pretty_print(self, q):124 q.text("arp_op_masked {")125 with q.group():126 with q.indent(2):127 q.breakable()128 q.text("value = ");129 q.text("%#x" % self.value)130 q.text(","); q.breakable()131 q.text("value_mask = ");132 q.text("%#x" % self.value_mask)133 q.breakable()134 q.text('}')135oxm.subtypes[2147494660] = arp_op_masked136class arp_sha(oxm):137 type_len = 2147495942138 def __init__(self, value=None):139 if value != None:140 self.value = value141 else:142 self.value = [0,0,0,0,0,0]143 return144 def pack(self):145 packed = []146 packed.append(struct.pack("!L", self.type_len))147 packed.append(struct.pack("!6B", *self.value))148 return ''.join(packed)149 @staticmethod150 def unpack(reader):151 obj = arp_sha()152 _type_len = reader.read("!L")[0]153 assert(_type_len == 2147495942)154 obj.value = list(reader.read('!6B'))155 return obj156 def __eq__(self, other):157 if type(self) != type(other): return False158 if self.value != other.value: return False159 return True160 def pretty_print(self, q):161 q.text("arp_sha {")162 with q.group():163 with q.indent(2):164 q.breakable()165 q.text("value = ");166 q.text(util.pretty_mac(self.value))167 q.breakable()168 q.text('}')169oxm.subtypes[2147495942] = arp_sha170class arp_sha_masked(oxm):171 type_len = 2147496204172 def __init__(self, value=None, value_mask=None):173 if value != None:174 self.value = value175 else:176 self.value = [0,0,0,0,0,0]177 if value_mask != None:178 self.value_mask = value_mask179 else:180 self.value_mask = [0,0,0,0,0,0]181 return182 def pack(self):183 packed = []184 packed.append(struct.pack("!L", self.type_len))185 packed.append(struct.pack("!6B", *self.value))186 packed.append(struct.pack("!6B", *self.value_mask))187 return ''.join(packed)188 @staticmethod189 def unpack(reader):190 obj = arp_sha_masked()191 _type_len = reader.read("!L")[0]192 assert(_type_len == 2147496204)193 obj.value = list(reader.read('!6B'))194 obj.value_mask = list(reader.read('!6B'))195 return obj196 def __eq__(self, other):197 if type(self) != type(other): return False198 if self.value != other.value: return False199 if self.value_mask != other.value_mask: return False200 return True201 def pretty_print(self, q):202 q.text("arp_sha_masked {")203 with q.group():204 with q.indent(2):205 q.breakable()206 q.text("value = ");207 q.text(util.pretty_mac(self.value))208 q.text(","); q.breakable()209 q.text("value_mask = ");210 q.text(util.pretty_mac(self.value_mask))211 q.breakable()212 q.text('}')213oxm.subtypes[2147496204] = arp_sha_masked214class arp_spa(oxm):215 type_len = 2147494916216 def __init__(self, value=None):217 if value != None:218 self.value = value219 else:220 self.value = 0221 return222 def pack(self):223 packed = []224 packed.append(struct.pack("!L", self.type_len))225 packed.append(struct.pack("!L", self.value))226 return ''.join(packed)227 @staticmethod228 def unpack(reader):229 obj = arp_spa()230 _type_len = reader.read("!L")[0]231 assert(_type_len == 2147494916)232 obj.value = reader.read("!L")[0]233 return obj234 def __eq__(self, other):235 if type(self) != type(other): return False236 if self.value != other.value: return False237 return True238 def pretty_print(self, q):239 q.text("arp_spa {")240 with q.group():241 with q.indent(2):242 q.breakable()243 q.text("value = ");244 q.text("%#x" % self.value)245 q.breakable()246 q.text('}')247oxm.subtypes[2147494916] = arp_spa248class arp_spa_masked(oxm):249 type_len = 2147495176250 def __init__(self, value=None, value_mask=None):251 if value != None:252 self.value = value253 else:254 self.value = 0255 if value_mask != None:256 self.value_mask = value_mask257 else:258 self.value_mask = 0259 return260 def pack(self):261 packed = []262 packed.append(struct.pack("!L", self.type_len))263 packed.append(struct.pack("!L", self.value))264 packed.append(struct.pack("!L", self.value_mask))265 return ''.join(packed)266 @staticmethod267 def unpack(reader):268 obj = arp_spa_masked()269 _type_len = reader.read("!L")[0]270 assert(_type_len == 2147495176)271 obj.value = reader.read("!L")[0]272 obj.value_mask = reader.read("!L")[0]273 return obj274 def __eq__(self, other):275 if type(self) != type(other): return False276 if self.value != other.value: return False277 if self.value_mask != other.value_mask: return False278 return True279 def pretty_print(self, q):280 q.text("arp_spa_masked {")281 with q.group():282 with q.indent(2):283 q.breakable()284 q.text("value = ");285 q.text("%#x" % self.value)286 q.text(","); q.breakable()287 q.text("value_mask = ");288 q.text("%#x" % self.value_mask)289 q.breakable()290 q.text('}')291oxm.subtypes[2147495176] = arp_spa_masked292class arp_tha(oxm):293 type_len = 2147496454294 def __init__(self, value=None):295 if value != None:296 self.value = value297 else:298 self.value = [0,0,0,0,0,0]299 return300 def pack(self):301 packed = []302 packed.append(struct.pack("!L", self.type_len))303 packed.append(struct.pack("!6B", *self.value))304 return ''.join(packed)305 @staticmethod306 def unpack(reader):307 obj = arp_tha()308 _type_len = reader.read("!L")[0]309 assert(_type_len == 2147496454)310 obj.value = list(reader.read('!6B'))311 return obj312 def __eq__(self, other):313 if type(self) != type(other): return False314 if self.value != other.value: return False315 return True316 def pretty_print(self, q):317 q.text("arp_tha {")318 with q.group():319 with q.indent(2):320 q.breakable()321 q.text("value = ");322 q.text(util.pretty_mac(self.value))323 q.breakable()324 q.text('}')325oxm.subtypes[2147496454] = arp_tha326class arp_tha_masked(oxm):327 type_len = 2147496716328 def __init__(self, value=None, value_mask=None):329 if value != None:330 self.value = value331 else:332 self.value = [0,0,0,0,0,0]333 if value_mask != None:334 self.value_mask = value_mask335 else:336 self.value_mask = [0,0,0,0,0,0]337 return338 def pack(self):339 packed = []340 packed.append(struct.pack("!L", self.type_len))341 packed.append(struct.pack("!6B", *self.value))342 packed.append(struct.pack("!6B", *self.value_mask))343 return ''.join(packed)344 @staticmethod345 def unpack(reader):346 obj = arp_tha_masked()347 _type_len = reader.read("!L")[0]348 assert(_type_len == 2147496716)349 obj.value = list(reader.read('!6B'))350 obj.value_mask = list(reader.read('!6B'))351 return obj352 def __eq__(self, other):353 if type(self) != type(other): return False354 if self.value != other.value: return False355 if self.value_mask != other.value_mask: return False356 return True357 def pretty_print(self, q):358 q.text("arp_tha_masked {")359 with q.group():360 with q.indent(2):361 q.breakable()362 q.text("value = ");363 q.text(util.pretty_mac(self.value))364 q.text(","); q.breakable()365 q.text("value_mask = ");366 q.text(util.pretty_mac(self.value_mask))367 q.breakable()368 q.text('}')369oxm.subtypes[2147496716] = arp_tha_masked370class arp_tpa(oxm):371 type_len = 2147495428372 def __init__(self, value=None):373 if value != None:374 self.value = value375 else:376 self.value = 0377 return378 def pack(self):379 packed = []380 packed.append(struct.pack("!L", self.type_len))381 packed.append(struct.pack("!L", self.value))382 return ''.join(packed)383 @staticmethod384 def unpack(reader):385 obj = arp_tpa()386 _type_len = reader.read("!L")[0]387 assert(_type_len == 2147495428)388 obj.value = reader.read("!L")[0]389 return obj390 def __eq__(self, other):391 if type(self) != type(other): return False392 if self.value != other.value: return False393 return True394 def pretty_print(self, q):395 q.text("arp_tpa {")396 with q.group():397 with q.indent(2):398 q.breakable()399 q.text("value = ");400 q.text("%#x" % self.value)401 q.breakable()402 q.text('}')403oxm.subtypes[2147495428] = arp_tpa404class arp_tpa_masked(oxm):405 type_len = 2147495688406 def __init__(self, value=None, value_mask=None):407 if value != None:408 self.value = value409 else:410 self.value = 0411 if value_mask != None:412 self.value_mask = value_mask413 else:414 self.value_mask = 0415 return416 def pack(self):417 packed = []418 packed.append(struct.pack("!L", self.type_len))419 packed.append(struct.pack("!L", self.value))420 packed.append(struct.pack("!L", self.value_mask))421 return ''.join(packed)422 @staticmethod423 def unpack(reader):424 obj = arp_tpa_masked()425 _type_len = reader.read("!L")[0]426 assert(_type_len == 2147495688)427 obj.value = reader.read("!L")[0]428 obj.value_mask = reader.read("!L")[0]429 return obj430 def __eq__(self, other):431 if type(self) != type(other): return False432 if self.value != other.value: return False433 if self.value_mask != other.value_mask: return False434 return True435 def pretty_print(self, q):436 q.text("arp_tpa_masked {")437 with q.group():438 with q.indent(2):439 q.breakable()440 q.text("value = ");441 q.text("%#x" % self.value)442 q.text(","); q.breakable()443 q.text("value_mask = ");444 q.text("%#x" % self.value_mask)445 q.breakable()446 q.text('}')447oxm.subtypes[2147495688] = arp_tpa_masked448class bsn_egr_port_group_id(oxm):449 type_len = 200196450 def __init__(self, value=None):451 if value != None:452 self.value = value453 else:454 self.value = 0455 return456 def pack(self):457 packed = []458 packed.append(struct.pack("!L", self.type_len))459 packed.append(struct.pack("!L", self.value))460 return ''.join(packed)461 @staticmethod462 def unpack(reader):463 obj = bsn_egr_port_group_id()464 _type_len = reader.read("!L")[0]465 assert(_type_len == 200196)466 obj.value = reader.read("!L")[0]467 return obj468 def __eq__(self, other):469 if type(self) != type(other): return False470 if self.value != other.value: return False471 return True472 def pretty_print(self, q):473 q.text("bsn_egr_port_group_id {")474 with q.group():475 with q.indent(2):476 q.breakable()477 q.text("value = ");478 q.text("%#x" % self.value)479 q.breakable()480 q.text('}')481oxm.subtypes[200196] = bsn_egr_port_group_id482class bsn_egr_port_group_id_masked(oxm):483 type_len = 200456484 def __init__(self, value=None, value_mask=None):485 if value != None:486 self.value = value487 else:488 self.value = 0489 if value_mask != None:490 self.value_mask = value_mask491 else:492 self.value_mask = 0493 return494 def pack(self):495 packed = []496 packed.append(struct.pack("!L", self.type_len))497 packed.append(struct.pack("!L", self.value))498 packed.append(struct.pack("!L", self.value_mask))499 return ''.join(packed)500 @staticmethod501 def unpack(reader):502 obj = bsn_egr_port_group_id_masked()503 _type_len = reader.read("!L")[0]504 assert(_type_len == 200456)505 obj.value = reader.read("!L")[0]506 obj.value_mask = reader.read("!L")[0]507 return obj508 def __eq__(self, other):509 if type(self) != type(other): return False510 if self.value != other.value: return False511 if self.value_mask != other.value_mask: return False512 return True513 def pretty_print(self, q):514 q.text("bsn_egr_port_group_id_masked {")515 with q.group():516 with q.indent(2):517 q.breakable()518 q.text("value = ");519 q.text("%#x" % self.value)520 q.text(","); q.breakable()521 q.text("value_mask = ");522 q.text("%#x" % self.value_mask)523 q.breakable()524 q.text('}')525oxm.subtypes[200456] = bsn_egr_port_group_id_masked526class bsn_in_ports_128(oxm):527 type_len = 196624528 def __init__(self, value=None):529 if value != None:530 self.value = value531 else:532 self.value = set()533 return534 def pack(self):535 packed = []536 packed.append(struct.pack("!L", self.type_len))537 packed.append(util.pack_bitmap_128(self.value))538 return ''.join(packed)539 @staticmethod540 def unpack(reader):541 obj = bsn_in_ports_128()542 _type_len = reader.read("!L")[0]543 assert(_type_len == 196624)544 obj.value = util.unpack_bitmap_128(reader)545 return obj546 def __eq__(self, other):547 if type(self) != type(other): return False548 if self.value != other.value: return False549 return True550 def pretty_print(self, q):551 q.text("bsn_in_ports_128 {")552 with q.group():553 with q.indent(2):554 q.breakable()555 q.text("value = ");556 q.pp(self.value)557 q.breakable()558 q.text('}')559oxm.subtypes[196624] = bsn_in_ports_128560class bsn_in_ports_128_masked(oxm):561 type_len = 196896562 def __init__(self, value=None, value_mask=None):563 if value != None:564 self.value = value565 else:566 self.value = set()567 if value_mask != None:568 self.value_mask = value_mask569 else:570 self.value_mask = set()571 return572 def pack(self):573 packed = []574 packed.append(struct.pack("!L", self.type_len))575 packed.append(util.pack_bitmap_128(self.value))576 packed.append(util.pack_bitmap_128(self.value_mask))577 return ''.join(packed)578 @staticmethod579 def unpack(reader):580 obj = bsn_in_ports_128_masked()581 _type_len = reader.read("!L")[0]582 assert(_type_len == 196896)583 obj.value = util.unpack_bitmap_128(reader)584 obj.value_mask = util.unpack_bitmap_128(reader)585 return obj586 def __eq__(self, other):587 if type(self) != type(other): return False588 if self.value != other.value: return False589 if self.value_mask != other.value_mask: return False590 return True591 def pretty_print(self, q):592 q.text("bsn_in_ports_128_masked {")593 with q.group():594 with q.indent(2):595 q.breakable()596 q.text("value = ");597 q.pp(self.value)598 q.text(","); q.breakable()599 q.text("value_mask = ");600 q.pp(self.value_mask)601 q.breakable()602 q.text('}')603oxm.subtypes[196896] = bsn_in_ports_128_masked604class bsn_in_ports_512(oxm):605 type_len = 206400606 def __init__(self, value=None):607 if value != None:608 self.value = value609 else:610 self.value = set()611 return612 def pack(self):613 packed = []614 packed.append(struct.pack("!L", self.type_len))615 packed.append(util.pack_bitmap_512(self.value))616 return ''.join(packed)617 @staticmethod618 def unpack(reader):619 obj = bsn_in_ports_512()620 _type_len = reader.read("!L")[0]621 assert(_type_len == 206400)622 obj.value = util.unpack_bitmap_512(reader)623 return obj624 def __eq__(self, other):625 if type(self) != type(other): return False626 if self.value != other.value: return False627 return True628 def pretty_print(self, q):629 q.text("bsn_in_ports_512 {")630 with q.group():631 with q.indent(2):632 q.breakable()633 q.text("value = ");634 q.pp(self.value)635 q.breakable()636 q.text('}')637oxm.subtypes[206400] = bsn_in_ports_512638class bsn_in_ports_512_masked(oxm):639 type_len = 206720640 def __init__(self, value=None, value_mask=None):641 if value != None:642 self.value = value643 else:644 self.value = set()645 if value_mask != None:646 self.value_mask = value_mask647 else:648 self.value_mask = set()649 return650 def pack(self):651 packed = []652 packed.append(struct.pack("!L", self.type_len))653 packed.append(util.pack_bitmap_512(self.value))654 packed.append(util.pack_bitmap_512(self.value_mask))655 return ''.join(packed)656 @staticmethod657 def unpack(reader):658 obj = bsn_in_ports_512_masked()659 _type_len = reader.read("!L")[0]660 assert(_type_len == 206720)661 obj.value = util.unpack_bitmap_512(reader)662 obj.value_mask = util.unpack_bitmap_512(reader)663 return obj664 def __eq__(self, other):665 if type(self) != type(other): return False666 if self.value != other.value: return False667 if self.value_mask != other.value_mask: return False668 return True669 def pretty_print(self, q):670 q.text("bsn_in_ports_512_masked {")671 with q.group():672 with q.indent(2):673 q.breakable()674 q.text("value = ");675 q.pp(self.value)676 q.text(","); q.breakable()677 q.text("value_mask = ");678 q.pp(self.value_mask)679 q.breakable()680 q.text('}')681oxm.subtypes[206720] = bsn_in_ports_512_masked682class bsn_ingress_port_group_id(oxm):683 type_len = 206852684 def __init__(self, value=None):685 if value != None:686 self.value = value687 else:688 self.value = 0689 return690 def pack(self):691 packed = []692 packed.append(struct.pack("!L", self.type_len))693 packed.append(struct.pack("!L", self.value))694 return ''.join(packed)695 @staticmethod696 def unpack(reader):697 obj = bsn_ingress_port_group_id()698 _type_len = reader.read("!L")[0]699 assert(_type_len == 206852)700 obj.value = reader.read("!L")[0]701 return obj702 def __eq__(self, other):703 if type(self) != type(other): return False704 if self.value != other.value: return False705 return True706 def pretty_print(self, q):707 q.text("bsn_ingress_port_group_id {")708 with q.group():709 with q.indent(2):710 q.breakable()711 q.text("value = ");712 q.text("%#x" % self.value)713 q.breakable()714 q.text('}')715oxm.subtypes[206852] = bsn_ingress_port_group_id716class bsn_ingress_port_group_id_masked(oxm):717 type_len = 207112718 def __init__(self, value=None, value_mask=None):719 if value != None:720 self.value = value721 else:722 self.value = 0723 if value_mask != None:724 self.value_mask = value_mask725 else:726 self.value_mask = 0727 return728 def pack(self):729 packed = []730 packed.append(struct.pack("!L", self.type_len))731 packed.append(struct.pack("!L", self.value))732 packed.append(struct.pack("!L", self.value_mask))733 return ''.join(packed)734 @staticmethod735 def unpack(reader):736 obj = bsn_ingress_port_group_id_masked()737 _type_len = reader.read("!L")[0]738 assert(_type_len == 207112)739 obj.value = reader.read("!L")[0]740 obj.value_mask = reader.read("!L")[0]741 return obj742 def __eq__(self, other):743 if type(self) != type(other): return False744 if self.value != other.value: return False745 if self.value_mask != other.value_mask: return False746 return True747 def pretty_print(self, q):748 q.text("bsn_ingress_port_group_id_masked {")749 with q.group():750 with q.indent(2):751 q.breakable()752 q.text("value = ");753 q.text("%#x" % self.value)754 q.text(","); q.breakable()755 q.text("value_mask = ");756 q.text("%#x" % self.value_mask)757 q.breakable()758 q.text('}')759oxm.subtypes[207112] = bsn_ingress_port_group_id_masked760class bsn_inner_eth_dst(oxm):761 type_len = 207878762 def __init__(self, value=None):763 if value != None:764 self.value = value765 else:766 self.value = [0,0,0,0,0,0]767 return768 def pack(self):769 packed = []770 packed.append(struct.pack("!L", self.type_len))771 packed.append(struct.pack("!6B", *self.value))772 return ''.join(packed)773 @staticmethod774 def unpack(reader):775 obj = bsn_inner_eth_dst()776 _type_len = reader.read("!L")[0]777 assert(_type_len == 207878)778 obj.value = list(reader.read('!6B'))779 return obj780 def __eq__(self, other):781 if type(self) != type(other): return False782 if self.value != other.value: return False783 return True784 def pretty_print(self, q):785 q.text("bsn_inner_eth_dst {")786 with q.group():787 with q.indent(2):788 q.breakable()789 q.text("value = ");790 q.text(util.pretty_mac(self.value))791 q.breakable()792 q.text('}')793oxm.subtypes[207878] = bsn_inner_eth_dst794class bsn_inner_eth_dst_masked(oxm):795 type_len = 208140796 def __init__(self, value=None, value_mask=None):797 if value != None:798 self.value = value799 else:800 self.value = [0,0,0,0,0,0]801 if value_mask != None:802 self.value_mask = value_mask803 else:804 self.value_mask = [0,0,0,0,0,0]805 return806 def pack(self):807 packed = []808 packed.append(struct.pack("!L", self.type_len))809 packed.append(struct.pack("!6B", *self.value))810 packed.append(struct.pack("!6B", *self.value_mask))811 return ''.join(packed)812 @staticmethod813 def unpack(reader):814 obj = bsn_inner_eth_dst_masked()815 _type_len = reader.read("!L")[0]816 assert(_type_len == 208140)817 obj.value = list(reader.read('!6B'))818 obj.value_mask = list(reader.read('!6B'))819 return obj820 def __eq__(self, other):821 if type(self) != type(other): return False822 if self.value != other.value: return False823 if self.value_mask != other.value_mask: return False824 return True825 def pretty_print(self, q):826 q.text("bsn_inner_eth_dst_masked {")827 with q.group():828 with q.indent(2):829 q.breakable()830 q.text("value = ");831 q.text(util.pretty_mac(self.value))832 q.text(","); q.breakable()833 q.text("value_mask = ");834 q.text(util.pretty_mac(self.value_mask))835 q.breakable()836 q.text('}')837oxm.subtypes[208140] = bsn_inner_eth_dst_masked838class bsn_inner_eth_src(oxm):839 type_len = 208390840 def __init__(self, value=None):841 if value != None:842 self.value = value843 else:844 self.value = [0,0,0,0,0,0]845 return846 def pack(self):847 packed = []848 packed.append(struct.pack("!L", self.type_len))849 packed.append(struct.pack("!6B", *self.value))850 return ''.join(packed)851 @staticmethod852 def unpack(reader):853 obj = bsn_inner_eth_src()854 _type_len = reader.read("!L")[0]855 assert(_type_len == 208390)856 obj.value = list(reader.read('!6B'))857 return obj858 def __eq__(self, other):859 if type(self) != type(other): return False860 if self.value != other.value: return False861 return True862 def pretty_print(self, q):863 q.text("bsn_inner_eth_src {")864 with q.group():865 with q.indent(2):866 q.breakable()867 q.text("value = ");868 q.text(util.pretty_mac(self.value))869 q.breakable()870 q.text('}')871oxm.subtypes[208390] = bsn_inner_eth_src872class bsn_inner_eth_src_masked(oxm):873 type_len = 208652874 def __init__(self, value=None, value_mask=None):875 if value != None:876 self.value = value877 else:878 self.value = [0,0,0,0,0,0]879 if value_mask != None:880 self.value_mask = value_mask881 else:882 self.value_mask = [0,0,0,0,0,0]883 return884 def pack(self):885 packed = []886 packed.append(struct.pack("!L", self.type_len))887 packed.append(struct.pack("!6B", *self.value))888 packed.append(struct.pack("!6B", *self.value_mask))889 return ''.join(packed)890 @staticmethod891 def unpack(reader):892 obj = bsn_inner_eth_src_masked()893 _type_len = reader.read("!L")[0]894 assert(_type_len == 208652)895 obj.value = list(reader.read('!6B'))896 obj.value_mask = list(reader.read('!6B'))897 return obj898 def __eq__(self, other):899 if type(self) != type(other): return False900 if self.value != other.value: return False901 if self.value_mask != other.value_mask: return False902 return True903 def pretty_print(self, q):904 q.text("bsn_inner_eth_src_masked {")905 with q.group():906 with q.indent(2):907 q.breakable()908 q.text("value = ");909 q.text(util.pretty_mac(self.value))910 q.text(","); q.breakable()911 q.text("value_mask = ");912 q.text(util.pretty_mac(self.value_mask))913 q.breakable()914 q.text('}')915oxm.subtypes[208652] = bsn_inner_eth_src_masked916class bsn_inner_vlan_vid(oxm):917 type_len = 208898918 def __init__(self, value=None):919 if value != None:920 self.value = value921 else:922 self.value = 0923 return924 def pack(self):925 packed = []926 packed.append(struct.pack("!L", self.type_len))927 packed.append(struct.pack("!H", self.value))928 return ''.join(packed)929 @staticmethod930 def unpack(reader):931 obj = bsn_inner_vlan_vid()932 _type_len = reader.read("!L")[0]933 assert(_type_len == 208898)934 obj.value = reader.read("!H")[0]935 return obj936 def __eq__(self, other):937 if type(self) != type(other): return False938 if self.value != other.value: return False939 return True940 def pretty_print(self, q):941 q.text("bsn_inner_vlan_vid {")942 with q.group():943 with q.indent(2):944 q.breakable()945 q.text("value = ");946 q.text("%#x" % self.value)947 q.breakable()948 q.text('}')949oxm.subtypes[208898] = bsn_inner_vlan_vid950class bsn_inner_vlan_vid_masked(oxm):951 type_len = 209156952 def __init__(self, value=None, value_mask=None):953 if value != None:954 self.value = value955 else:956 self.value = 0957 if value_mask != None:958 self.value_mask = value_mask959 else:960 self.value_mask = 0961 return962 def pack(self):963 packed = []964 packed.append(struct.pack("!L", self.type_len))965 packed.append(struct.pack("!H", self.value))966 packed.append(struct.pack("!H", self.value_mask))967 return ''.join(packed)968 @staticmethod969 def unpack(reader):970 obj = bsn_inner_vlan_vid_masked()971 _type_len = reader.read("!L")[0]972 assert(_type_len == 209156)973 obj.value = reader.read("!H")[0]974 obj.value_mask = reader.read("!H")[0]975 return obj976 def __eq__(self, other):977 if type(self) != type(other): return False978 if self.value != other.value: return False979 if self.value_mask != other.value_mask: return False980 return True981 def pretty_print(self, q):982 q.text("bsn_inner_vlan_vid_masked {")983 with q.group():984 with q.indent(2):985 q.breakable()986 q.text("value = ");987 q.text("%#x" % self.value)988 q.text(","); q.breakable()989 q.text("value_mask = ");990 q.text("%#x" % self.value_mask)991 q.breakable()992 q.text('}')993oxm.subtypes[209156] = bsn_inner_vlan_vid_masked994class bsn_l2_cache_hit(oxm):995 type_len = 205825996 def __init__(self, value=None):997 if value != None:998 self.value = value999 else:1000 self.value = 01001 return1002 def pack(self):1003 packed = []1004 packed.append(struct.pack("!L", self.type_len))1005 packed.append(struct.pack("!B", self.value))1006 return ''.join(packed)1007 @staticmethod1008 def unpack(reader):1009 obj = bsn_l2_cache_hit()1010 _type_len = reader.read("!L")[0]1011 assert(_type_len == 205825)1012 obj.value = reader.read("!B")[0]1013 return obj1014 def __eq__(self, other):1015 if type(self) != type(other): return False1016 if self.value != other.value: return False1017 return True1018 def pretty_print(self, q):1019 q.text("bsn_l2_cache_hit {")1020 with q.group():1021 with q.indent(2):1022 q.breakable()1023 q.text("value = ");1024 q.text("%#x" % self.value)1025 q.breakable()1026 q.text('}')1027oxm.subtypes[205825] = bsn_l2_cache_hit1028class bsn_l2_cache_hit_masked(oxm):1029 type_len = 2060821030 def __init__(self, value=None, value_mask=None):1031 if value != None:1032 self.value = value1033 else:1034 self.value = 01035 if value_mask != None:1036 self.value_mask = value_mask1037 else:1038 self.value_mask = 01039 return1040 def pack(self):1041 packed = []1042 packed.append(struct.pack("!L", self.type_len))1043 packed.append(struct.pack("!B", self.value))1044 packed.append(struct.pack("!B", self.value_mask))1045 return ''.join(packed)1046 @staticmethod1047 def unpack(reader):1048 obj = bsn_l2_cache_hit_masked()1049 _type_len = reader.read("!L")[0]1050 assert(_type_len == 206082)1051 obj.value = reader.read("!B")[0]1052 obj.value_mask = reader.read("!B")[0]1053 return obj1054 def __eq__(self, other):1055 if type(self) != type(other): return False1056 if self.value != other.value: return False1057 if self.value_mask != other.value_mask: return False1058 return True1059 def pretty_print(self, q):1060 q.text("bsn_l2_cache_hit_masked {")1061 with q.group():1062 with q.indent(2):1063 q.breakable()1064 q.text("value = ");1065 q.text("%#x" % self.value)1066 q.text(","); q.breakable()1067 q.text("value_mask = ");1068 q.text("%#x" % self.value_mask)1069 q.breakable()1070 q.text('}')1071oxm.subtypes[206082] = bsn_l2_cache_hit_masked1072class bsn_l3_interface_class_id(oxm):1073 type_len = 1986601074 def __init__(self, value=None):1075 if value != None:1076 self.value = value1077 else:1078 self.value = 01079 return1080 def pack(self):1081 packed = []1082 packed.append(struct.pack("!L", self.type_len))1083 packed.append(struct.pack("!L", self.value))1084 return ''.join(packed)1085 @staticmethod1086 def unpack(reader):1087 obj = bsn_l3_interface_class_id()1088 _type_len = reader.read("!L")[0]1089 assert(_type_len == 198660)1090 obj.value = reader.read("!L")[0]1091 return obj1092 def __eq__(self, other):1093 if type(self) != type(other): return False1094 if self.value != other.value: return False1095 return True1096 def pretty_print(self, q):1097 q.text("bsn_l3_interface_class_id {")1098 with q.group():1099 with q.indent(2):1100 q.breakable()1101 q.text("value = ");1102 q.text("%#x" % self.value)1103 q.breakable()1104 q.text('}')1105oxm.subtypes[198660] = bsn_l3_interface_class_id1106class bsn_l3_interface_class_id_masked(oxm):1107 type_len = 1989201108 def __init__(self, value=None, value_mask=None):1109 if value != None:1110 self.value = value1111 else:1112 self.value = 01113 if value_mask != None:1114 self.value_mask = value_mask1115 else:1116 self.value_mask = 01117 return1118 def pack(self):1119 packed = []1120 packed.append(struct.pack("!L", self.type_len))1121 packed.append(struct.pack("!L", self.value))1122 packed.append(struct.pack("!L", self.value_mask))1123 return ''.join(packed)1124 @staticmethod1125 def unpack(reader):1126 obj = bsn_l3_interface_class_id_masked()1127 _type_len = reader.read("!L")[0]1128 assert(_type_len == 198920)1129 obj.value = reader.read("!L")[0]1130 obj.value_mask = reader.read("!L")[0]1131 return obj1132 def __eq__(self, other):1133 if type(self) != type(other): return False1134 if self.value != other.value: return False1135 if self.value_mask != other.value_mask: return False1136 return True1137 def pretty_print(self, q):1138 q.text("bsn_l3_interface_class_id_masked {")1139 with q.group():1140 with q.indent(2):1141 q.breakable()1142 q.text("value = ");1143 q.text("%#x" % self.value)1144 q.text(","); q.breakable()1145 q.text("value_mask = ");1146 q.text("%#x" % self.value_mask)1147 q.breakable()1148 q.text('}')1149oxm.subtypes[198920] = bsn_l3_interface_class_id_masked1150class bsn_l3_src_class_id(oxm):1151 type_len = 1991721152 def __init__(self, value=None):1153 if value != None:1154 self.value = value1155 else:1156 self.value = 01157 return1158 def pack(self):1159 packed = []1160 packed.append(struct.pack("!L", self.type_len))1161 packed.append(struct.pack("!L", self.value))1162 return ''.join(packed)1163 @staticmethod1164 def unpack(reader):1165 obj = bsn_l3_src_class_id()1166 _type_len = reader.read("!L")[0]1167 assert(_type_len == 199172)1168 obj.value = reader.read("!L")[0]1169 return obj1170 def __eq__(self, other):1171 if type(self) != type(other): return False1172 if self.value != other.value: return False1173 return True1174 def pretty_print(self, q):1175 q.text("bsn_l3_src_class_id {")1176 with q.group():1177 with q.indent(2):1178 q.breakable()1179 q.text("value = ");1180 q.text("%#x" % self.value)1181 q.breakable()1182 q.text('}')1183oxm.subtypes[199172] = bsn_l3_src_class_id1184class bsn_l3_src_class_id_masked(oxm):1185 type_len = 1994321186 def __init__(self, value=None, value_mask=None):1187 if value != None:1188 self.value = value1189 else:1190 self.value = 01191 if value_mask != None:1192 self.value_mask = value_mask1193 else:1194 self.value_mask = 01195 return1196 def pack(self):1197 packed = []1198 packed.append(struct.pack("!L", self.type_len))1199 packed.append(struct.pack("!L", self.value))1200 packed.append(struct.pack("!L", self.value_mask))1201 return ''.join(packed)1202 @staticmethod1203 def unpack(reader):1204 obj = bsn_l3_src_class_id_masked()1205 _type_len = reader.read("!L")[0]1206 assert(_type_len == 199432)1207 obj.value = reader.read("!L")[0]1208 obj.value_mask = reader.read("!L")[0]1209 return obj1210 def __eq__(self, other):1211 if type(self) != type(other): return False1212 if self.value != other.value: return False1213 if self.value_mask != other.value_mask: return False1214 return True1215 def pretty_print(self, q):1216 q.text("bsn_l3_src_class_id_masked {")1217 with q.group():1218 with q.indent(2):1219 q.breakable()1220 q.text("value = ");1221 q.text("%#x" % self.value)1222 q.text(","); q.breakable()1223 q.text("value_mask = ");1224 q.text("%#x" % self.value_mask)1225 q.breakable()1226 q.text('}')1227oxm.subtypes[199432] = bsn_l3_src_class_id_masked1228class bsn_lag_id(oxm):1229 type_len = 1971241230 def __init__(self, value=None):1231 if value != None:1232 self.value = value1233 else:1234 self.value = 01235 return1236 def pack(self):1237 packed = []1238 packed.append(struct.pack("!L", self.type_len))1239 packed.append(struct.pack("!L", self.value))1240 return ''.join(packed)1241 @staticmethod1242 def unpack(reader):1243 obj = bsn_lag_id()1244 _type_len = reader.read("!L")[0]1245 assert(_type_len == 197124)1246 obj.value = reader.read("!L")[0]1247 return obj1248 def __eq__(self, other):1249 if type(self) != type(other): return False1250 if self.value != other.value: return False1251 return True1252 def pretty_print(self, q):1253 q.text("bsn_lag_id {")1254 with q.group():1255 with q.indent(2):1256 q.breakable()1257 q.text("value = ");1258 q.text("%#x" % self.value)1259 q.breakable()1260 q.text('}')1261oxm.subtypes[197124] = bsn_lag_id1262class bsn_lag_id_masked(oxm):1263 type_len = 1973841264 def __init__(self, value=None, value_mask=None):1265 if value != None:1266 self.value = value1267 else:1268 self.value = 01269 if value_mask != None:1270 self.value_mask = value_mask1271 else:1272 self.value_mask = 01273 return1274 def pack(self):1275 packed = []1276 packed.append(struct.pack("!L", self.type_len))1277 packed.append(struct.pack("!L", self.value))1278 packed.append(struct.pack("!L", self.value_mask))1279 return ''.join(packed)1280 @staticmethod1281 def unpack(reader):1282 obj = bsn_lag_id_masked()1283 _type_len = reader.read("!L")[0]1284 assert(_type_len == 197384)1285 obj.value = reader.read("!L")[0]1286 obj.value_mask = reader.read("!L")[0]1287 return obj1288 def __eq__(self, other):1289 if type(self) != type(other): return False1290 if self.value != other.value: return False1291 if self.value_mask != other.value_mask: return False1292 return True1293 def pretty_print(self, q):1294 q.text("bsn_lag_id_masked {")1295 with q.group():1296 with q.indent(2):1297 q.breakable()1298 q.text("value = ");1299 q.text("%#x" % self.value)1300 q.text(","); q.breakable()1301 q.text("value_mask = ");1302 q.text("%#x" % self.value_mask)1303 q.breakable()1304 q.text('}')1305oxm.subtypes[197384] = bsn_lag_id_masked1306class bsn_tcp_flags(oxm):1307 type_len = 2048021308 def __init__(self, value=None):1309 if value != None:1310 self.value = value1311 else:1312 self.value = 01313 return1314 def pack(self):1315 packed = []1316 packed.append(struct.pack("!L", self.type_len))1317 packed.append(struct.pack("!H", self.value))1318 return ''.join(packed)1319 @staticmethod1320 def unpack(reader):1321 obj = bsn_tcp_flags()1322 _type_len = reader.read("!L")[0]1323 assert(_type_len == 204802)1324 obj.value = reader.read("!H")[0]1325 return obj1326 def __eq__(self, other):1327 if type(self) != type(other): return False1328 if self.value != other.value: return False1329 return True1330 def pretty_print(self, q):1331 q.text("bsn_tcp_flags {")1332 with q.group():1333 with q.indent(2):1334 q.breakable()1335 q.text("value = ");1336 q.text("%#x" % self.value)1337 q.breakable()1338 q.text('}')1339oxm.subtypes[204802] = bsn_tcp_flags1340class bsn_tcp_flags_masked(oxm):1341 type_len = 2050601342 def __init__(self, value=None, value_mask=None):1343 if value != None:1344 self.value = value1345 else:1346 self.value = 01347 if value_mask != None:1348 self.value_mask = value_mask1349 else:1350 self.value_mask = 01351 return1352 def pack(self):1353 packed = []1354 packed.append(struct.pack("!L", self.type_len))1355 packed.append(struct.pack("!H", self.value))1356 packed.append(struct.pack("!H", self.value_mask))1357 return ''.join(packed)1358 @staticmethod1359 def unpack(reader):1360 obj = bsn_tcp_flags_masked()1361 _type_len = reader.read("!L")[0]1362 assert(_type_len == 205060)1363 obj.value = reader.read("!H")[0]1364 obj.value_mask = reader.read("!H")[0]1365 return obj1366 def __eq__(self, other):1367 if type(self) != type(other): return False1368 if self.value != other.value: return False1369 if self.value_mask != other.value_mask: return False1370 return True1371 def pretty_print(self, q):1372 q.text("bsn_tcp_flags_masked {")1373 with q.group():1374 with q.indent(2):1375 q.breakable()1376 q.text("value = ");1377 q.text("%#x" % self.value)1378 q.text(","); q.breakable()1379 q.text("value_mask = ");1380 q.text("%#x" % self.value_mask)1381 q.breakable()1382 q.text('}')1383oxm.subtypes[205060] = bsn_tcp_flags_masked1384class bsn_udf0(oxm):1385 type_len = 2007081386 def __init__(self, value=None):1387 if value != None:1388 self.value = value1389 else:1390 self.value = 01391 return1392 def pack(self):1393 packed = []1394 packed.append(struct.pack("!L", self.type_len))1395 packed.append(struct.pack("!L", self.value))1396 return ''.join(packed)1397 @staticmethod1398 def unpack(reader):1399 obj = bsn_udf0()1400 _type_len = reader.read("!L")[0]1401 assert(_type_len == 200708)1402 obj.value = reader.read("!L")[0]1403 return obj1404 def __eq__(self, other):1405 if type(self) != type(other): return False1406 if self.value != other.value: return False1407 return True1408 def pretty_print(self, q):1409 q.text("bsn_udf0 {")1410 with q.group():1411 with q.indent(2):1412 q.breakable()1413 q.text("value = ");1414 q.text("%#x" % self.value)1415 q.breakable()1416 q.text('}')1417oxm.subtypes[200708] = bsn_udf01418class bsn_udf0_masked(oxm):1419 type_len = 2009681420 def __init__(self, value=None, value_mask=None):1421 if value != None:1422 self.value = value1423 else:1424 self.value = 01425 if value_mask != None:1426 self.value_mask = value_mask1427 else:1428 self.value_mask = 01429 return1430 def pack(self):1431 packed = []1432 packed.append(struct.pack("!L", self.type_len))1433 packed.append(struct.pack("!L", self.value))1434 packed.append(struct.pack("!L", self.value_mask))1435 return ''.join(packed)1436 @staticmethod1437 def unpack(reader):1438 obj = bsn_udf0_masked()1439 _type_len = reader.read("!L")[0]1440 assert(_type_len == 200968)1441 obj.value = reader.read("!L")[0]1442 obj.value_mask = reader.read("!L")[0]1443 return obj1444 def __eq__(self, other):1445 if type(self) != type(other): return False1446 if self.value != other.value: return False1447 if self.value_mask != other.value_mask: return False1448 return True1449 def pretty_print(self, q):1450 q.text("bsn_udf0_masked {")1451 with q.group():1452 with q.indent(2):1453 q.breakable()1454 q.text("value = ");1455 q.text("%#x" % self.value)1456 q.text(","); q.breakable()1457 q.text("value_mask = ");1458 q.text("%#x" % self.value_mask)1459 q.breakable()1460 q.text('}')1461oxm.subtypes[200968] = bsn_udf0_masked1462class bsn_udf1(oxm):1463 type_len = 2012201464 def __init__(self, value=None):1465 if value != None:1466 self.value = value1467 else:1468 self.value = 01469 return1470 def pack(self):1471 packed = []1472 packed.append(struct.pack("!L", self.type_len))1473 packed.append(struct.pack("!L", self.value))1474 return ''.join(packed)1475 @staticmethod1476 def unpack(reader):1477 obj = bsn_udf1()1478 _type_len = reader.read("!L")[0]1479 assert(_type_len == 201220)1480 obj.value = reader.read("!L")[0]1481 return obj1482 def __eq__(self, other):1483 if type(self) != type(other): return False1484 if self.value != other.value: return False1485 return True1486 def pretty_print(self, q):1487 q.text("bsn_udf1 {")1488 with q.group():1489 with q.indent(2):1490 q.breakable()1491 q.text("value = ");1492 q.text("%#x" % self.value)1493 q.breakable()1494 q.text('}')1495oxm.subtypes[201220] = bsn_udf11496class bsn_udf1_masked(oxm):1497 type_len = 2014801498 def __init__(self, value=None, value_mask=None):1499 if value != None:1500 self.value = value1501 else:1502 self.value = 01503 if value_mask != None:1504 self.value_mask = value_mask1505 else:1506 self.value_mask = 01507 return1508 def pack(self):1509 packed = []1510 packed.append(struct.pack("!L", self.type_len))1511 packed.append(struct.pack("!L", self.value))1512 packed.append(struct.pack("!L", self.value_mask))1513 return ''.join(packed)1514 @staticmethod1515 def unpack(reader):1516 obj = bsn_udf1_masked()1517 _type_len = reader.read("!L")[0]1518 assert(_type_len == 201480)1519 obj.value = reader.read("!L")[0]1520 obj.value_mask = reader.read("!L")[0]1521 return obj1522 def __eq__(self, other):1523 if type(self) != type(other): return False1524 if self.value != other.value: return False1525 if self.value_mask != other.value_mask: return False1526 return True1527 def pretty_print(self, q):1528 q.text("bsn_udf1_masked {")1529 with q.group():1530 with q.indent(2):1531 q.breakable()1532 q.text("value = ");1533 q.text("%#x" % self.value)1534 q.text(","); q.breakable()1535 q.text("value_mask = ");1536 q.text("%#x" % self.value_mask)1537 q.breakable()1538 q.text('}')1539oxm.subtypes[201480] = bsn_udf1_masked1540class bsn_udf2(oxm):1541 type_len = 2017321542 def __init__(self, value=None):1543 if value != None:1544 self.value = value1545 else:1546 self.value = 01547 return1548 def pack(self):1549 packed = []1550 packed.append(struct.pack("!L", self.type_len))1551 packed.append(struct.pack("!L", self.value))1552 return ''.join(packed)1553 @staticmethod1554 def unpack(reader):1555 obj = bsn_udf2()1556 _type_len = reader.read("!L")[0]1557 assert(_type_len == 201732)1558 obj.value = reader.read("!L")[0]1559 return obj1560 def __eq__(self, other):1561 if type(self) != type(other): return False1562 if self.value != other.value: return False1563 return True1564 def pretty_print(self, q):1565 q.text("bsn_udf2 {")1566 with q.group():1567 with q.indent(2):1568 q.breakable()1569 q.text("value = ");1570 q.text("%#x" % self.value)1571 q.breakable()1572 q.text('}')1573oxm.subtypes[201732] = bsn_udf21574class bsn_udf2_masked(oxm):1575 type_len = 2019921576 def __init__(self, value=None, value_mask=None):1577 if value != None:1578 self.value = value1579 else:1580 self.value = 01581 if value_mask != None:1582 self.value_mask = value_mask1583 else:1584 self.value_mask = 01585 return1586 def pack(self):1587 packed = []1588 packed.append(struct.pack("!L", self.type_len))1589 packed.append(struct.pack("!L", self.value))1590 packed.append(struct.pack("!L", self.value_mask))1591 return ''.join(packed)1592 @staticmethod1593 def unpack(reader):1594 obj = bsn_udf2_masked()1595 _type_len = reader.read("!L")[0]1596 assert(_type_len == 201992)1597 obj.value = reader.read("!L")[0]1598 obj.value_mask = reader.read("!L")[0]1599 return obj1600 def __eq__(self, other):1601 if type(self) != type(other): return False1602 if self.value != other.value: return False1603 if self.value_mask != other.value_mask: return False1604 return True1605 def pretty_print(self, q):1606 q.text("bsn_udf2_masked {")1607 with q.group():1608 with q.indent(2):1609 q.breakable()1610 q.text("value = ");1611 q.text("%#x" % self.value)1612 q.text(","); q.breakable()1613 q.text("value_mask = ");1614 q.text("%#x" % self.value_mask)1615 q.breakable()1616 q.text('}')1617oxm.subtypes[201992] = bsn_udf2_masked1618class bsn_udf3(oxm):1619 type_len = 2022441620 def __init__(self, value=None):1621 if value != None:1622 self.value = value1623 else:1624 self.value = 01625 return1626 def pack(self):1627 packed = []1628 packed.append(struct.pack("!L", self.type_len))1629 packed.append(struct.pack("!L", self.value))1630 return ''.join(packed)1631 @staticmethod1632 def unpack(reader):1633 obj = bsn_udf3()1634 _type_len = reader.read("!L")[0]1635 assert(_type_len == 202244)1636 obj.value = reader.read("!L")[0]1637 return obj1638 def __eq__(self, other):1639 if type(self) != type(other): return False1640 if self.value != other.value: return False1641 return True1642 def pretty_print(self, q):1643 q.text("bsn_udf3 {")1644 with q.group():1645 with q.indent(2):1646 q.breakable()1647 q.text("value = ");1648 q.text("%#x" % self.value)1649 q.breakable()1650 q.text('}')1651oxm.subtypes[202244] = bsn_udf31652class bsn_udf3_masked(oxm):1653 type_len = 2025041654 def __init__(self, value=None, value_mask=None):1655 if value != None:1656 self.value = value1657 else:1658 self.value = 01659 if value_mask != None:1660 self.value_mask = value_mask1661 else:1662 self.value_mask = 01663 return1664 def pack(self):1665 packed = []1666 packed.append(struct.pack("!L", self.type_len))1667 packed.append(struct.pack("!L", self.value))1668 packed.append(struct.pack("!L", self.value_mask))1669 return ''.join(packed)1670 @staticmethod1671 def unpack(reader):1672 obj = bsn_udf3_masked()1673 _type_len = reader.read("!L")[0]1674 assert(_type_len == 202504)1675 obj.value = reader.read("!L")[0]1676 obj.value_mask = reader.read("!L")[0]1677 return obj1678 def __eq__(self, other):1679 if type(self) != type(other): return False1680 if self.value != other.value: return False1681 if self.value_mask != other.value_mask: return False1682 return True1683 def pretty_print(self, q):1684 q.text("bsn_udf3_masked {")1685 with q.group():1686 with q.indent(2):1687 q.breakable()1688 q.text("value = ");1689 q.text("%#x" % self.value)1690 q.text(","); q.breakable()1691 q.text("value_mask = ");1692 q.text("%#x" % self.value_mask)1693 q.breakable()1694 q.text('}')1695oxm.subtypes[202504] = bsn_udf3_masked1696class bsn_udf4(oxm):1697 type_len = 2027561698 def __init__(self, value=None):1699 if value != None:1700 self.value = value1701 else:1702 self.value = 01703 return1704 def pack(self):1705 packed = []1706 packed.append(struct.pack("!L", self.type_len))1707 packed.append(struct.pack("!L", self.value))1708 return ''.join(packed)1709 @staticmethod1710 def unpack(reader):1711 obj = bsn_udf4()1712 _type_len = reader.read("!L")[0]1713 assert(_type_len == 202756)1714 obj.value = reader.read("!L")[0]1715 return obj1716 def __eq__(self, other):1717 if type(self) != type(other): return False1718 if self.value != other.value: return False1719 return True1720 def pretty_print(self, q):1721 q.text("bsn_udf4 {")1722 with q.group():1723 with q.indent(2):1724 q.breakable()1725 q.text("value = ");1726 q.text("%#x" % self.value)1727 q.breakable()1728 q.text('}')1729oxm.subtypes[202756] = bsn_udf41730class bsn_udf4_masked(oxm):1731 type_len = 2030161732 def __init__(self, value=None, value_mask=None):1733 if value != None:1734 self.value = value1735 else:1736 self.value = 01737 if value_mask != None:1738 self.value_mask = value_mask1739 else:1740 self.value_mask = 01741 return1742 def pack(self):1743 packed = []1744 packed.append(struct.pack("!L", self.type_len))1745 packed.append(struct.pack("!L", self.value))1746 packed.append(struct.pack("!L", self.value_mask))1747 return ''.join(packed)1748 @staticmethod1749 def unpack(reader):1750 obj = bsn_udf4_masked()1751 _type_len = reader.read("!L")[0]1752 assert(_type_len == 203016)1753 obj.value = reader.read("!L")[0]1754 obj.value_mask = reader.read("!L")[0]1755 return obj1756 def __eq__(self, other):1757 if type(self) != type(other): return False1758 if self.value != other.value: return False1759 if self.value_mask != other.value_mask: return False1760 return True1761 def pretty_print(self, q):1762 q.text("bsn_udf4_masked {")1763 with q.group():1764 with q.indent(2):1765 q.breakable()1766 q.text("value = ");1767 q.text("%#x" % self.value)1768 q.text(","); q.breakable()1769 q.text("value_mask = ");1770 q.text("%#x" % self.value_mask)1771 q.breakable()1772 q.text('}')1773oxm.subtypes[203016] = bsn_udf4_masked1774class bsn_udf5(oxm):1775 type_len = 2032681776 def __init__(self, value=None):1777 if value != None:1778 self.value = value1779 else:1780 self.value = 01781 return1782 def pack(self):1783 packed = []1784 packed.append(struct.pack("!L", self.type_len))1785 packed.append(struct.pack("!L", self.value))1786 return ''.join(packed)1787 @staticmethod1788 def unpack(reader):1789 obj = bsn_udf5()1790 _type_len = reader.read("!L")[0]1791 assert(_type_len == 203268)1792 obj.value = reader.read("!L")[0]1793 return obj1794 def __eq__(self, other):1795 if type(self) != type(other): return False1796 if self.value != other.value: return False1797 return True1798 def pretty_print(self, q):1799 q.text("bsn_udf5 {")1800 with q.group():1801 with q.indent(2):1802 q.breakable()1803 q.text("value = ");1804 q.text("%#x" % self.value)1805 q.breakable()1806 q.text('}')1807oxm.subtypes[203268] = bsn_udf51808class bsn_udf5_masked(oxm):1809 type_len = 2035281810 def __init__(self, value=None, value_mask=None):1811 if value != None:1812 self.value = value1813 else:1814 self.value = 01815 if value_mask != None:1816 self.value_mask = value_mask1817 else:1818 self.value_mask = 01819 return1820 def pack(self):1821 packed = []1822 packed.append(struct.pack("!L", self.type_len))1823 packed.append(struct.pack("!L", self.value))1824 packed.append(struct.pack("!L", self.value_mask))1825 return ''.join(packed)1826 @staticmethod1827 def unpack(reader):1828 obj = bsn_udf5_masked()1829 _type_len = reader.read("!L")[0]1830 assert(_type_len == 203528)1831 obj.value = reader.read("!L")[0]1832 obj.value_mask = reader.read("!L")[0]1833 return obj1834 def __eq__(self, other):1835 if type(self) != type(other): return False1836 if self.value != other.value: return False1837 if self.value_mask != other.value_mask: return False1838 return True1839 def pretty_print(self, q):1840 q.text("bsn_udf5_masked {")1841 with q.group():1842 with q.indent(2):1843 q.breakable()1844 q.text("value = ");1845 q.text("%#x" % self.value)1846 q.text(","); q.breakable()1847 q.text("value_mask = ");1848 q.text("%#x" % self.value_mask)1849 q.breakable()1850 q.text('}')1851oxm.subtypes[203528] = bsn_udf5_masked1852class bsn_udf6(oxm):1853 type_len = 2037801854 def __init__(self, value=None):1855 if value != None:1856 self.value = value1857 else:1858 self.value = 01859 return1860 def pack(self):1861 packed = []1862 packed.append(struct.pack("!L", self.type_len))1863 packed.append(struct.pack("!L", self.value))1864 return ''.join(packed)1865 @staticmethod1866 def unpack(reader):1867 obj = bsn_udf6()1868 _type_len = reader.read("!L")[0]1869 assert(_type_len == 203780)1870 obj.value = reader.read("!L")[0]1871 return obj1872 def __eq__(self, other):1873 if type(self) != type(other): return False1874 if self.value != other.value: return False1875 return True1876 def pretty_print(self, q):1877 q.text("bsn_udf6 {")1878 with q.group():1879 with q.indent(2):1880 q.breakable()1881 q.text("value = ");1882 q.text("%#x" % self.value)1883 q.breakable()1884 q.text('}')1885oxm.subtypes[203780] = bsn_udf61886class bsn_udf6_masked(oxm):1887 type_len = 2040401888 def __init__(self, value=None, value_mask=None):1889 if value != None:1890 self.value = value1891 else:1892 self.value = 01893 if value_mask != None:1894 self.value_mask = value_mask1895 else:1896 self.value_mask = 01897 return1898 def pack(self):1899 packed = []1900 packed.append(struct.pack("!L", self.type_len))1901 packed.append(struct.pack("!L", self.value))1902 packed.append(struct.pack("!L", self.value_mask))1903 return ''.join(packed)1904 @staticmethod1905 def unpack(reader):1906 obj = bsn_udf6_masked()1907 _type_len = reader.read("!L")[0]1908 assert(_type_len == 204040)1909 obj.value = reader.read("!L")[0]1910 obj.value_mask = reader.read("!L")[0]1911 return obj1912 def __eq__(self, other):1913 if type(self) != type(other): return False1914 if self.value != other.value: return False1915 if self.value_mask != other.value_mask: return False1916 return True1917 def pretty_print(self, q):1918 q.text("bsn_udf6_masked {")1919 with q.group():1920 with q.indent(2):1921 q.breakable()1922 q.text("value = ");1923 q.text("%#x" % self.value)1924 q.text(","); q.breakable()1925 q.text("value_mask = ");1926 q.text("%#x" % self.value_mask)1927 q.breakable()1928 q.text('}')1929oxm.subtypes[204040] = bsn_udf6_masked1930class bsn_udf7(oxm):1931 type_len = 2042921932 def __init__(self, value=None):1933 if value != None:1934 self.value = value1935 else:1936 self.value = 01937 return1938 def pack(self):1939 packed = []1940 packed.append(struct.pack("!L", self.type_len))1941 packed.append(struct.pack("!L", self.value))1942 return ''.join(packed)1943 @staticmethod1944 def unpack(reader):1945 obj = bsn_udf7()1946 _type_len = reader.read("!L")[0]1947 assert(_type_len == 204292)1948 obj.value = reader.read("!L")[0]1949 return obj1950 def __eq__(self, other):1951 if type(self) != type(other): return False1952 if self.value != other.value: return False1953 return True1954 def pretty_print(self, q):1955 q.text("bsn_udf7 {")1956 with q.group():1957 with q.indent(2):1958 q.breakable()1959 q.text("value = ");1960 q.text("%#x" % self.value)1961 q.breakable()1962 q.text('}')1963oxm.subtypes[204292] = bsn_udf71964class bsn_udf7_masked(oxm):1965 type_len = 2045521966 def __init__(self, value=None, value_mask=None):1967 if value != None:1968 self.value = value1969 else:1970 self.value = 01971 if value_mask != None:1972 self.value_mask = value_mask1973 else:1974 self.value_mask = 01975 return1976 def pack(self):1977 packed = []1978 packed.append(struct.pack("!L", self.type_len))1979 packed.append(struct.pack("!L", self.value))1980 packed.append(struct.pack("!L", self.value_mask))1981 return ''.join(packed)1982 @staticmethod1983 def unpack(reader):1984 obj = bsn_udf7_masked()1985 _type_len = reader.read("!L")[0]1986 assert(_type_len == 204552)1987 obj.value = reader.read("!L")[0]1988 obj.value_mask = reader.read("!L")[0]1989 return obj1990 def __eq__(self, other):1991 if type(self) != type(other): return False1992 if self.value != other.value: return False1993 if self.value_mask != other.value_mask: return False1994 return True1995 def pretty_print(self, q):1996 q.text("bsn_udf7_masked {")1997 with q.group():1998 with q.indent(2):1999 q.breakable()2000 q.text("value = ");2001 q.text("%#x" % self.value)2002 q.text(","); q.breakable()2003 q.text("value_mask = ");2004 q.text("%#x" % self.value_mask)2005 q.breakable()2006 q.text('}')2007oxm.subtypes[204552] = bsn_udf7_masked2008class bsn_vfi(oxm):2009 type_len = 2094102010 def __init__(self, value=None):2011 if value != None:2012 self.value = value2013 else:2014 self.value = 02015 return2016 def pack(self):2017 packed = []2018 packed.append(struct.pack("!L", self.type_len))2019 packed.append(struct.pack("!H", self.value))2020 return ''.join(packed)2021 @staticmethod2022 def unpack(reader):2023 obj = bsn_vfi()2024 _type_len = reader.read("!L")[0]2025 assert(_type_len == 209410)2026 obj.value = reader.read("!H")[0]2027 return obj2028 def __eq__(self, other):2029 if type(self) != type(other): return False2030 if self.value != other.value: return False2031 return True2032 def pretty_print(self, q):2033 q.text("bsn_vfi {")2034 with q.group():2035 with q.indent(2):2036 q.breakable()2037 q.text("value = ");2038 q.text("%#x" % self.value)2039 q.breakable()2040 q.text('}')2041oxm.subtypes[209410] = bsn_vfi2042class bsn_vfi_masked(oxm):2043 type_len = 2096682044 def __init__(self, value=None, value_mask=None):2045 if value != None:2046 self.value = value2047 else:2048 self.value = 02049 if value_mask != None:2050 self.value_mask = value_mask2051 else:2052 self.value_mask = 02053 return2054 def pack(self):2055 packed = []2056 packed.append(struct.pack("!L", self.type_len))2057 packed.append(struct.pack("!H", self.value))2058 packed.append(struct.pack("!H", self.value_mask))2059 return ''.join(packed)2060 @staticmethod2061 def unpack(reader):2062 obj = bsn_vfi_masked()2063 _type_len = reader.read("!L")[0]2064 assert(_type_len == 209668)2065 obj.value = reader.read("!H")[0]2066 obj.value_mask = reader.read("!H")[0]2067 return obj2068 def __eq__(self, other):2069 if type(self) != type(other): return False2070 if self.value != other.value: return False2071 if self.value_mask != other.value_mask: return False2072 return True2073 def pretty_print(self, q):2074 q.text("bsn_vfi_masked {")2075 with q.group():2076 with q.indent(2):2077 q.breakable()2078 q.text("value = ");2079 q.text("%#x" % self.value)2080 q.text(","); q.breakable()2081 q.text("value_mask = ");2082 q.text("%#x" % self.value_mask)2083 q.breakable()2084 q.text('}')2085oxm.subtypes[209668] = bsn_vfi_masked2086class bsn_vlan_xlate_port_group_id(oxm):2087 type_len = 2053162088 def __init__(self, value=None):2089 if value != None:2090 self.value = value2091 else:2092 self.value = 02093 return2094 def pack(self):2095 packed = []2096 packed.append(struct.pack("!L", self.type_len))2097 packed.append(struct.pack("!L", self.value))2098 return ''.join(packed)2099 @staticmethod2100 def unpack(reader):2101 obj = bsn_vlan_xlate_port_group_id()2102 _type_len = reader.read("!L")[0]2103 assert(_type_len == 205316)2104 obj.value = reader.read("!L")[0]2105 return obj2106 def __eq__(self, other):2107 if type(self) != type(other): return False2108 if self.value != other.value: return False2109 return True2110 def pretty_print(self, q):2111 q.text("bsn_vlan_xlate_port_group_id {")2112 with q.group():2113 with q.indent(2):2114 q.breakable()2115 q.text("value = ");2116 q.text("%#x" % self.value)2117 q.breakable()2118 q.text('}')2119oxm.subtypes[205316] = bsn_vlan_xlate_port_group_id2120class bsn_vlan_xlate_port_group_id_masked(oxm):2121 type_len = 2055762122 def __init__(self, value=None, value_mask=None):2123 if value != None:2124 self.value = value2125 else:2126 self.value = 02127 if value_mask != None:2128 self.value_mask = value_mask2129 else:2130 self.value_mask = 02131 return2132 def pack(self):2133 packed = []2134 packed.append(struct.pack("!L", self.type_len))2135 packed.append(struct.pack("!L", self.value))2136 packed.append(struct.pack("!L", self.value_mask))2137 return ''.join(packed)2138 @staticmethod2139 def unpack(reader):2140 obj = bsn_vlan_xlate_port_group_id_masked()2141 _type_len = reader.read("!L")[0]2142 assert(_type_len == 205576)2143 obj.value = reader.read("!L")[0]2144 obj.value_mask = reader.read("!L")[0]2145 return obj2146 def __eq__(self, other):2147 if type(self) != type(other): return False2148 if self.value != other.value: return False2149 if self.value_mask != other.value_mask: return False2150 return True2151 def pretty_print(self, q):2152 q.text("bsn_vlan_xlate_port_group_id_masked {")2153 with q.group():2154 with q.indent(2):2155 q.breakable()2156 q.text("value = ");2157 q.text("%#x" % self.value)2158 q.text(","); q.breakable()2159 q.text("value_mask = ");2160 q.text("%#x" % self.value_mask)2161 q.breakable()2162 q.text('}')2163oxm.subtypes[205576] = bsn_vlan_xlate_port_group_id_masked2164class bsn_vrf(oxm):2165 type_len = 1976362166 def __init__(self, value=None):2167 if value != None:2168 self.value = value2169 else:2170 self.value = 02171 return2172 def pack(self):2173 packed = []2174 packed.append(struct.pack("!L", self.type_len))2175 packed.append(struct.pack("!L", self.value))2176 return ''.join(packed)2177 @staticmethod2178 def unpack(reader):2179 obj = bsn_vrf()2180 _type_len = reader.read("!L")[0]2181 assert(_type_len == 197636)2182 obj.value = reader.read("!L")[0]2183 return obj2184 def __eq__(self, other):2185 if type(self) != type(other): return False2186 if self.value != other.value: return False2187 return True2188 def pretty_print(self, q):2189 q.text("bsn_vrf {")2190 with q.group():2191 with q.indent(2):2192 q.breakable()2193 q.text("value = ");2194 q.text("%#x" % self.value)2195 q.breakable()2196 q.text('}')2197oxm.subtypes[197636] = bsn_vrf2198class bsn_vrf_masked(oxm):2199 type_len = 1978962200 def __init__(self, value=None, value_mask=None):2201 if value != None:2202 self.value = value2203 else:2204 self.value = 02205 if value_mask != None:2206 self.value_mask = value_mask2207 else:2208 self.value_mask = 02209 return2210 def pack(self):2211 packed = []2212 packed.append(struct.pack("!L", self.type_len))2213 packed.append(struct.pack("!L", self.value))2214 packed.append(struct.pack("!L", self.value_mask))2215 return ''.join(packed)2216 @staticmethod2217 def unpack(reader):2218 obj = bsn_vrf_masked()2219 _type_len = reader.read("!L")[0]2220 assert(_type_len == 197896)2221 obj.value = reader.read("!L")[0]2222 obj.value_mask = reader.read("!L")[0]2223 return obj2224 def __eq__(self, other):2225 if type(self) != type(other): return False2226 if self.value != other.value: return False2227 if self.value_mask != other.value_mask: return False2228 return True2229 def pretty_print(self, q):2230 q.text("bsn_vrf_masked {")2231 with q.group():2232 with q.indent(2):2233 q.breakable()2234 q.text("value = ");2235 q.text("%#x" % self.value)2236 q.text(","); q.breakable()2237 q.text("value_mask = ");2238 q.text("%#x" % self.value_mask)2239 q.breakable()2240 q.text('}')2241oxm.subtypes[197896] = bsn_vrf_masked2242class bsn_vxlan_network_id(oxm):2243 type_len = 2073642244 def __init__(self, value=None):2245 if value != None:2246 self.value = value2247 else:2248 self.value = 02249 return2250 def pack(self):2251 packed = []2252 packed.append(struct.pack("!L", self.type_len))2253 packed.append(struct.pack("!L", self.value))2254 return ''.join(packed)2255 @staticmethod2256 def unpack(reader):2257 obj = bsn_vxlan_network_id()2258 _type_len = reader.read("!L")[0]2259 assert(_type_len == 207364)2260 obj.value = reader.read("!L")[0]2261 return obj2262 def __eq__(self, other):2263 if type(self) != type(other): return False2264 if self.value != other.value: return False2265 return True2266 def pretty_print(self, q):2267 q.text("bsn_vxlan_network_id {")2268 with q.group():2269 with q.indent(2):2270 q.breakable()2271 q.text("value = ");2272 q.text("%#x" % self.value)2273 q.breakable()2274 q.text('}')2275oxm.subtypes[207364] = bsn_vxlan_network_id2276class bsn_vxlan_network_id_masked(oxm):2277 type_len = 2076242278 def __init__(self, value=None, value_mask=None):2279 if value != None:2280 self.value = value2281 else:2282 self.value = 02283 if value_mask != None:2284 self.value_mask = value_mask2285 else:2286 self.value_mask = 02287 return2288 def pack(self):2289 packed = []2290 packed.append(struct.pack("!L", self.type_len))2291 packed.append(struct.pack("!L", self.value))2292 packed.append(struct.pack("!L", self.value_mask))2293 return ''.join(packed)2294 @staticmethod2295 def unpack(reader):2296 obj = bsn_vxlan_network_id_masked()2297 _type_len = reader.read("!L")[0]2298 assert(_type_len == 207624)2299 obj.value = reader.read("!L")[0]2300 obj.value_mask = reader.read("!L")[0]2301 return obj2302 def __eq__(self, other):2303 if type(self) != type(other): return False2304 if self.value != other.value: return False2305 if self.value_mask != other.value_mask: return False2306 return True2307 def pretty_print(self, q):2308 q.text("bsn_vxlan_network_id_masked {")2309 with q.group():2310 with q.indent(2):2311 q.breakable()2312 q.text("value = ");2313 q.text("%#x" % self.value)2314 q.text(","); q.breakable()2315 q.text("value_mask = ");2316 q.text("%#x" % self.value_mask)2317 q.breakable()2318 q.text('}')2319oxm.subtypes[207624] = bsn_vxlan_network_id_masked2320class eth_dst(oxm):2321 type_len = 21474851902322 def __init__(self, value=None):2323 if value != None:2324 self.value = value2325 else:2326 self.value = [0,0,0,0,0,0]2327 return2328 def pack(self):2329 packed = []2330 packed.append(struct.pack("!L", self.type_len))2331 packed.append(struct.pack("!6B", *self.value))2332 return ''.join(packed)2333 @staticmethod2334 def unpack(reader):2335 obj = eth_dst()2336 _type_len = reader.read("!L")[0]2337 assert(_type_len == 2147485190)2338 obj.value = list(reader.read('!6B'))2339 return obj2340 def __eq__(self, other):2341 if type(self) != type(other): return False2342 if self.value != other.value: return False2343 return True2344 def pretty_print(self, q):2345 q.text("eth_dst {")2346 with q.group():2347 with q.indent(2):2348 q.breakable()2349 q.text("value = ");2350 q.text(util.pretty_mac(self.value))2351 q.breakable()2352 q.text('}')2353oxm.subtypes[2147485190] = eth_dst2354class eth_dst_masked(oxm):2355 type_len = 21474854522356 def __init__(self, value=None, value_mask=None):2357 if value != None:2358 self.value = value2359 else:2360 self.value = [0,0,0,0,0,0]2361 if value_mask != None:2362 self.value_mask = value_mask2363 else:2364 self.value_mask = [0,0,0,0,0,0]2365 return2366 def pack(self):2367 packed = []2368 packed.append(struct.pack("!L", self.type_len))2369 packed.append(struct.pack("!6B", *self.value))2370 packed.append(struct.pack("!6B", *self.value_mask))2371 return ''.join(packed)2372 @staticmethod2373 def unpack(reader):2374 obj = eth_dst_masked()2375 _type_len = reader.read("!L")[0]2376 assert(_type_len == 2147485452)2377 obj.value = list(reader.read('!6B'))2378 obj.value_mask = list(reader.read('!6B'))2379 return obj2380 def __eq__(self, other):2381 if type(self) != type(other): return False2382 if self.value != other.value: return False2383 if self.value_mask != other.value_mask: return False2384 return True2385 def pretty_print(self, q):2386 q.text("eth_dst_masked {")2387 with q.group():2388 with q.indent(2):2389 q.breakable()2390 q.text("value = ");2391 q.text(util.pretty_mac(self.value))2392 q.text(","); q.breakable()2393 q.text("value_mask = ");2394 q.text(util.pretty_mac(self.value_mask))2395 q.breakable()2396 q.text('}')2397oxm.subtypes[2147485452] = eth_dst_masked2398class eth_src(oxm):2399 type_len = 21474857022400 def __init__(self, value=None):2401 if value != None:2402 self.value = value2403 else:2404 self.value = [0,0,0,0,0,0]2405 return2406 def pack(self):2407 packed = []2408 packed.append(struct.pack("!L", self.type_len))2409 packed.append(struct.pack("!6B", *self.value))2410 return ''.join(packed)2411 @staticmethod2412 def unpack(reader):2413 obj = eth_src()2414 _type_len = reader.read("!L")[0]2415 assert(_type_len == 2147485702)2416 obj.value = list(reader.read('!6B'))2417 return obj2418 def __eq__(self, other):2419 if type(self) != type(other): return False2420 if self.value != other.value: return False2421 return True2422 def pretty_print(self, q):2423 q.text("eth_src {")2424 with q.group():2425 with q.indent(2):2426 q.breakable()2427 q.text("value = ");2428 q.text(util.pretty_mac(self.value))2429 q.breakable()2430 q.text('}')2431oxm.subtypes[2147485702] = eth_src2432class eth_src_masked(oxm):2433 type_len = 21474859642434 def __init__(self, value=None, value_mask=None):2435 if value != None:2436 self.value = value2437 else:2438 self.value = [0,0,0,0,0,0]2439 if value_mask != None:2440 self.value_mask = value_mask2441 else:2442 self.value_mask = [0,0,0,0,0,0]2443 return2444 def pack(self):2445 packed = []2446 packed.append(struct.pack("!L", self.type_len))2447 packed.append(struct.pack("!6B", *self.value))2448 packed.append(struct.pack("!6B", *self.value_mask))2449 return ''.join(packed)2450 @staticmethod2451 def unpack(reader):2452 obj = eth_src_masked()2453 _type_len = reader.read("!L")[0]2454 assert(_type_len == 2147485964)2455 obj.value = list(reader.read('!6B'))2456 obj.value_mask = list(reader.read('!6B'))2457 return obj2458 def __eq__(self, other):2459 if type(self) != type(other): return False2460 if self.value != other.value: return False2461 if self.value_mask != other.value_mask: return False2462 return True2463 def pretty_print(self, q):2464 q.text("eth_src_masked {")2465 with q.group():2466 with q.indent(2):2467 q.breakable()2468 q.text("value = ");2469 q.text(util.pretty_mac(self.value))2470 q.text(","); q.breakable()2471 q.text("value_mask = ");2472 q.text(util.pretty_mac(self.value_mask))2473 q.breakable()2474 q.text('}')2475oxm.subtypes[2147485964] = eth_src_masked2476class eth_type(oxm):2477 type_len = 21474862102478 def __init__(self, value=None):2479 if value != None:2480 self.value = value2481 else:2482 self.value = 02483 return2484 def pack(self):2485 packed = []2486 packed.append(struct.pack("!L", self.type_len))2487 packed.append(struct.pack("!H", self.value))2488 return ''.join(packed)2489 @staticmethod2490 def unpack(reader):2491 obj = eth_type()2492 _type_len = reader.read("!L")[0]2493 assert(_type_len == 2147486210)2494 obj.value = reader.read("!H")[0]2495 return obj2496 def __eq__(self, other):2497 if type(self) != type(other): return False2498 if self.value != other.value: return False2499 return True2500 def pretty_print(self, q):2501 q.text("eth_type {")2502 with q.group():2503 with q.indent(2):2504 q.breakable()2505 q.text("value = ");2506 q.text("%#x" % self.value)2507 q.breakable()2508 q.text('}')2509oxm.subtypes[2147486210] = eth_type2510class eth_type_masked(oxm):2511 type_len = 21474864682512 def __init__(self, value=None, value_mask=None):2513 if value != None:2514 self.value = value2515 else:2516 self.value = 02517 if value_mask != None:2518 self.value_mask = value_mask2519 else:2520 self.value_mask = 02521 return2522 def pack(self):2523 packed = []2524 packed.append(struct.pack("!L", self.type_len))2525 packed.append(struct.pack("!H", self.value))2526 packed.append(struct.pack("!H", self.value_mask))2527 return ''.join(packed)2528 @staticmethod2529 def unpack(reader):2530 obj = eth_type_masked()2531 _type_len = reader.read("!L")[0]2532 assert(_type_len == 2147486468)2533 obj.value = reader.read("!H")[0]2534 obj.value_mask = reader.read("!H")[0]2535 return obj2536 def __eq__(self, other):2537 if type(self) != type(other): return False2538 if self.value != other.value: return False2539 if self.value_mask != other.value_mask: return False2540 return True2541 def pretty_print(self, q):2542 q.text("eth_type_masked {")2543 with q.group():2544 with q.indent(2):2545 q.breakable()2546 q.text("value = ");2547 q.text("%#x" % self.value)2548 q.text(","); q.breakable()2549 q.text("value_mask = ");2550 q.text("%#x" % self.value_mask)2551 q.breakable()2552 q.text('}')2553oxm.subtypes[2147486468] = eth_type_masked2554class icmpv4_code(oxm):2555 type_len = 21474938892556 def __init__(self, value=None):2557 if value != None:2558 self.value = value2559 else:2560 self.value = 02561 return2562 def pack(self):2563 packed = []2564 packed.append(struct.pack("!L", self.type_len))2565 packed.append(struct.pack("!B", self.value))2566 return ''.join(packed)2567 @staticmethod2568 def unpack(reader):2569 obj = icmpv4_code()2570 _type_len = reader.read("!L")[0]2571 assert(_type_len == 2147493889)2572 obj.value = reader.read("!B")[0]2573 return obj2574 def __eq__(self, other):2575 if type(self) != type(other): return False2576 if self.value != other.value: return False2577 return True2578 def pretty_print(self, q):2579 q.text("icmpv4_code {")2580 with q.group():2581 with q.indent(2):2582 q.breakable()2583 q.text("value = ");2584 q.text("%#x" % self.value)2585 q.breakable()2586 q.text('}')2587oxm.subtypes[2147493889] = icmpv4_code2588class icmpv4_code_masked(oxm):2589 type_len = 21474941462590 def __init__(self, value=None, value_mask=None):2591 if value != None:2592 self.value = value2593 else:2594 self.value = 02595 if value_mask != None:2596 self.value_mask = value_mask2597 else:2598 self.value_mask = 02599 return2600 def pack(self):2601 packed = []2602 packed.append(struct.pack("!L", self.type_len))2603 packed.append(struct.pack("!B", self.value))2604 packed.append(struct.pack("!B", self.value_mask))2605 return ''.join(packed)2606 @staticmethod2607 def unpack(reader):2608 obj = icmpv4_code_masked()2609 _type_len = reader.read("!L")[0]2610 assert(_type_len == 2147494146)2611 obj.value = reader.read("!B")[0]2612 obj.value_mask = reader.read("!B")[0]2613 return obj2614 def __eq__(self, other):2615 if type(self) != type(other): return False2616 if self.value != other.value: return False2617 if self.value_mask != other.value_mask: return False2618 return True2619 def pretty_print(self, q):2620 q.text("icmpv4_code_masked {")2621 with q.group():2622 with q.indent(2):2623 q.breakable()2624 q.text("value = ");2625 q.text("%#x" % self.value)2626 q.text(","); q.breakable()2627 q.text("value_mask = ");2628 q.text("%#x" % self.value_mask)2629 q.breakable()2630 q.text('}')2631oxm.subtypes[2147494146] = icmpv4_code_masked2632class icmpv4_type(oxm):2633 type_len = 21474933772634 def __init__(self, value=None):2635 if value != None:2636 self.value = value2637 else:2638 self.value = 02639 return2640 def pack(self):2641 packed = []2642 packed.append(struct.pack("!L", self.type_len))2643 packed.append(struct.pack("!B", self.value))2644 return ''.join(packed)2645 @staticmethod2646 def unpack(reader):2647 obj = icmpv4_type()2648 _type_len = reader.read("!L")[0]2649 assert(_type_len == 2147493377)2650 obj.value = reader.read("!B")[0]2651 return obj2652 def __eq__(self, other):2653 if type(self) != type(other): return False2654 if self.value != other.value: return False2655 return True2656 def pretty_print(self, q):2657 q.text("icmpv4_type {")2658 with q.group():2659 with q.indent(2):2660 q.breakable()2661 q.text("value = ");2662 q.text("%#x" % self.value)2663 q.breakable()2664 q.text('}')2665oxm.subtypes[2147493377] = icmpv4_type2666class icmpv4_type_masked(oxm):2667 type_len = 21474936342668 def __init__(self, value=None, value_mask=None):2669 if value != None:2670 self.value = value2671 else:2672 self.value = 02673 if value_mask != None:2674 self.value_mask = value_mask2675 else:2676 self.value_mask = 02677 return2678 def pack(self):2679 packed = []2680 packed.append(struct.pack("!L", self.type_len))2681 packed.append(struct.pack("!B", self.value))2682 packed.append(struct.pack("!B", self.value_mask))2683 return ''.join(packed)2684 @staticmethod2685 def unpack(reader):2686 obj = icmpv4_type_masked()2687 _type_len = reader.read("!L")[0]2688 assert(_type_len == 2147493634)2689 obj.value = reader.read("!B")[0]2690 obj.value_mask = reader.read("!B")[0]2691 return obj2692 def __eq__(self, other):2693 if type(self) != type(other): return False2694 if self.value != other.value: return False2695 if self.value_mask != other.value_mask: return False2696 return True2697 def pretty_print(self, q):2698 q.text("icmpv4_type_masked {")2699 with q.group():2700 with q.indent(2):2701 q.breakable()2702 q.text("value = ");2703 q.text("%#x" % self.value)2704 q.text(","); q.breakable()2705 q.text("value_mask = ");2706 q.text("%#x" % self.value_mask)2707 q.breakable()2708 q.text('}')2709oxm.subtypes[2147493634] = icmpv4_type_masked2710class icmpv6_code(oxm):2711 type_len = 21474990092712 def __init__(self, value=None):2713 if value != None:2714 self.value = value2715 else:2716 self.value = 02717 return2718 def pack(self):2719 packed = []2720 packed.append(struct.pack("!L", self.type_len))2721 packed.append(struct.pack("!B", self.value))2722 return ''.join(packed)2723 @staticmethod2724 def unpack(reader):2725 obj = icmpv6_code()2726 _type_len = reader.read("!L")[0]2727 assert(_type_len == 2147499009)2728 obj.value = reader.read("!B")[0]2729 return obj2730 def __eq__(self, other):2731 if type(self) != type(other): return False2732 if self.value != other.value: return False2733 return True2734 def pretty_print(self, q):2735 q.text("icmpv6_code {")2736 with q.group():2737 with q.indent(2):2738 q.breakable()2739 q.text("value = ");2740 q.text("%#x" % self.value)2741 q.breakable()2742 q.text('}')2743oxm.subtypes[2147499009] = icmpv6_code2744class icmpv6_code_masked(oxm):2745 type_len = 21474992662746 def __init__(self, value=None, value_mask=None):2747 if value != None:2748 self.value = value2749 else:2750 self.value = 02751 if value_mask != None:2752 self.value_mask = value_mask2753 else:2754 self.value_mask = 02755 return2756 def pack(self):2757 packed = []2758 packed.append(struct.pack("!L", self.type_len))2759 packed.append(struct.pack("!B", self.value))2760 packed.append(struct.pack("!B", self.value_mask))2761 return ''.join(packed)2762 @staticmethod2763 def unpack(reader):2764 obj = icmpv6_code_masked()2765 _type_len = reader.read("!L")[0]2766 assert(_type_len == 2147499266)2767 obj.value = reader.read("!B")[0]2768 obj.value_mask = reader.read("!B")[0]2769 return obj2770 def __eq__(self, other):2771 if type(self) != type(other): return False2772 if self.value != other.value: return False2773 if self.value_mask != other.value_mask: return False2774 return True2775 def pretty_print(self, q):2776 q.text("icmpv6_code_masked {")2777 with q.group():2778 with q.indent(2):2779 q.breakable()2780 q.text("value = ");2781 q.text("%#x" % self.value)2782 q.text(","); q.breakable()2783 q.text("value_mask = ");2784 q.text("%#x" % self.value_mask)2785 q.breakable()2786 q.text('}')2787oxm.subtypes[2147499266] = icmpv6_code_masked2788class icmpv6_type(oxm):2789 type_len = 21474984972790 def __init__(self, value=None):2791 if value != None:2792 self.value = value2793 else:2794 self.value = 02795 return2796 def pack(self):2797 packed = []2798 packed.append(struct.pack("!L", self.type_len))2799 packed.append(struct.pack("!B", self.value))2800 return ''.join(packed)2801 @staticmethod2802 def unpack(reader):2803 obj = icmpv6_type()2804 _type_len = reader.read("!L")[0]2805 assert(_type_len == 2147498497)2806 obj.value = reader.read("!B")[0]2807 return obj2808 def __eq__(self, other):2809 if type(self) != type(other): return False2810 if self.value != other.value: return False2811 return True2812 def pretty_print(self, q):2813 q.text("icmpv6_type {")2814 with q.group():2815 with q.indent(2):2816 q.breakable()2817 q.text("value = ");2818 q.text("%#x" % self.value)2819 q.breakable()2820 q.text('}')2821oxm.subtypes[2147498497] = icmpv6_type2822class icmpv6_type_masked(oxm):2823 type_len = 21474987542824 def __init__(self, value=None, value_mask=None):2825 if value != None:2826 self.value = value2827 else:2828 self.value = 02829 if value_mask != None:2830 self.value_mask = value_mask2831 else:2832 self.value_mask = 02833 return2834 def pack(self):2835 packed = []2836 packed.append(struct.pack("!L", self.type_len))2837 packed.append(struct.pack("!B", self.value))2838 packed.append(struct.pack("!B", self.value_mask))2839 return ''.join(packed)2840 @staticmethod2841 def unpack(reader):2842 obj = icmpv6_type_masked()2843 _type_len = reader.read("!L")[0]2844 assert(_type_len == 2147498754)2845 obj.value = reader.read("!B")[0]2846 obj.value_mask = reader.read("!B")[0]2847 return obj2848 def __eq__(self, other):2849 if type(self) != type(other): return False2850 if self.value != other.value: return False2851 if self.value_mask != other.value_mask: return False2852 return True2853 def pretty_print(self, q):2854 q.text("icmpv6_type_masked {")2855 with q.group():2856 with q.indent(2):2857 q.breakable()2858 q.text("value = ");2859 q.text("%#x" % self.value)2860 q.text(","); q.breakable()2861 q.text("value_mask = ");2862 q.text("%#x" % self.value_mask)2863 q.breakable()2864 q.text('}')2865oxm.subtypes[2147498754] = icmpv6_type_masked2866class in_phy_port(oxm):2867 type_len = 21474841642868 def __init__(self, value=None):2869 if value != None:2870 self.value = value2871 else:2872 self.value = 02873 return2874 def pack(self):2875 packed = []2876 packed.append(struct.pack("!L", self.type_len))2877 packed.append(util.pack_port_no(self.value))2878 return ''.join(packed)2879 @staticmethod2880 def unpack(reader):2881 obj = in_phy_port()2882 _type_len = reader.read("!L")[0]2883 assert(_type_len == 2147484164)2884 obj.value = util.unpack_port_no(reader)2885 return obj2886 def __eq__(self, other):2887 if type(self) != type(other): return False2888 if self.value != other.value: return False2889 return True2890 def pretty_print(self, q):2891 q.text("in_phy_port {")2892 with q.group():2893 with q.indent(2):2894 q.breakable()2895 q.text("value = ");2896 q.text(util.pretty_port(self.value))2897 q.breakable()2898 q.text('}')2899oxm.subtypes[2147484164] = in_phy_port2900class in_phy_port_masked(oxm):2901 type_len = 21474844242902 def __init__(self, value=None, value_mask=None):2903 if value != None:2904 self.value = value2905 else:2906 self.value = 02907 if value_mask != None:2908 self.value_mask = value_mask2909 else:2910 self.value_mask = 02911 return2912 def pack(self):2913 packed = []2914 packed.append(struct.pack("!L", self.type_len))2915 packed.append(util.pack_port_no(self.value))2916 packed.append(util.pack_port_no(self.value_mask))2917 return ''.join(packed)2918 @staticmethod2919 def unpack(reader):2920 obj = in_phy_port_masked()2921 _type_len = reader.read("!L")[0]2922 assert(_type_len == 2147484424)2923 obj.value = util.unpack_port_no(reader)2924 obj.value_mask = util.unpack_port_no(reader)2925 return obj2926 def __eq__(self, other):2927 if type(self) != type(other): return False2928 if self.value != other.value: return False2929 if self.value_mask != other.value_mask: return False2930 return True2931 def pretty_print(self, q):2932 q.text("in_phy_port_masked {")2933 with q.group():2934 with q.indent(2):2935 q.breakable()2936 q.text("value = ");2937 q.text(util.pretty_port(self.value))2938 q.text(","); q.breakable()2939 q.text("value_mask = ");2940 q.text(util.pretty_port(self.value_mask))2941 q.breakable()2942 q.text('}')2943oxm.subtypes[2147484424] = in_phy_port_masked2944class in_port(oxm):2945 type_len = 21474836522946 def __init__(self, value=None):2947 if value != None:2948 self.value = value2949 else:2950 self.value = 02951 return2952 def pack(self):2953 packed = []2954 packed.append(struct.pack("!L", self.type_len))2955 packed.append(util.pack_port_no(self.value))2956 return ''.join(packed)2957 @staticmethod2958 def unpack(reader):2959 obj = in_port()2960 _type_len = reader.read("!L")[0]2961 assert(_type_len == 2147483652)2962 obj.value = util.unpack_port_no(reader)2963 return obj2964 def __eq__(self, other):2965 if type(self) != type(other): return False2966 if self.value != other.value: return False2967 return True2968 def pretty_print(self, q):2969 q.text("in_port {")2970 with q.group():2971 with q.indent(2):2972 q.breakable()2973 q.text("value = ");2974 q.text(util.pretty_port(self.value))2975 q.breakable()2976 q.text('}')2977oxm.subtypes[2147483652] = in_port2978class in_port_masked(oxm):2979 type_len = 21474839122980 def __init__(self, value=None, value_mask=None):2981 if value != None:2982 self.value = value2983 else:2984 self.value = 02985 if value_mask != None:2986 self.value_mask = value_mask2987 else:2988 self.value_mask = 02989 return2990 def pack(self):2991 packed = []2992 packed.append(struct.pack("!L", self.type_len))2993 packed.append(util.pack_port_no(self.value))2994 packed.append(util.pack_port_no(self.value_mask))2995 return ''.join(packed)2996 @staticmethod2997 def unpack(reader):2998 obj = in_port_masked()2999 _type_len = reader.read("!L")[0]3000 assert(_type_len == 2147483912)3001 obj.value = util.unpack_port_no(reader)3002 obj.value_mask = util.unpack_port_no(reader)3003 return obj3004 def __eq__(self, other):3005 if type(self) != type(other): return False3006 if self.value != other.value: return False3007 if self.value_mask != other.value_mask: return False3008 return True3009 def pretty_print(self, q):3010 q.text("in_port_masked {")3011 with q.group():3012 with q.indent(2):3013 q.breakable()3014 q.text("value = ");3015 q.text(util.pretty_port(self.value))3016 q.text(","); q.breakable()3017 q.text("value_mask = ");3018 q.text(util.pretty_port(self.value_mask))3019 q.breakable()3020 q.text('}')3021oxm.subtypes[2147483912] = in_port_masked3022class ip_dscp(oxm):3023 type_len = 21474877453024 def __init__(self, value=None):3025 if value != None:3026 self.value = value3027 else:3028 self.value = 03029 return3030 def pack(self):3031 packed = []3032 packed.append(struct.pack("!L", self.type_len))3033 packed.append(struct.pack("!B", self.value))3034 return ''.join(packed)3035 @staticmethod3036 def unpack(reader):3037 obj = ip_dscp()3038 _type_len = reader.read("!L")[0]3039 assert(_type_len == 2147487745)3040 obj.value = reader.read("!B")[0]3041 return obj3042 def __eq__(self, other):3043 if type(self) != type(other): return False3044 if self.value != other.value: return False3045 return True3046 def pretty_print(self, q):3047 q.text("ip_dscp {")3048 with q.group():3049 with q.indent(2):3050 q.breakable()3051 q.text("value = ");3052 q.text("%#x" % self.value)3053 q.breakable()3054 q.text('}')3055oxm.subtypes[2147487745] = ip_dscp3056class ip_dscp_masked(oxm):3057 type_len = 21474880023058 def __init__(self, value=None, value_mask=None):3059 if value != None:3060 self.value = value3061 else:3062 self.value = 03063 if value_mask != None:3064 self.value_mask = value_mask3065 else:3066 self.value_mask = 03067 return3068 def pack(self):3069 packed = []3070 packed.append(struct.pack("!L", self.type_len))3071 packed.append(struct.pack("!B", self.value))3072 packed.append(struct.pack("!B", self.value_mask))3073 return ''.join(packed)3074 @staticmethod3075 def unpack(reader):3076 obj = ip_dscp_masked()3077 _type_len = reader.read("!L")[0]3078 assert(_type_len == 2147488002)3079 obj.value = reader.read("!B")[0]3080 obj.value_mask = reader.read("!B")[0]3081 return obj3082 def __eq__(self, other):3083 if type(self) != type(other): return False3084 if self.value != other.value: return False3085 if self.value_mask != other.value_mask: return False3086 return True3087 def pretty_print(self, q):3088 q.text("ip_dscp_masked {")3089 with q.group():3090 with q.indent(2):3091 q.breakable()3092 q.text("value = ");3093 q.text("%#x" % self.value)3094 q.text(","); q.breakable()3095 q.text("value_mask = ");3096 q.text("%#x" % self.value_mask)3097 q.breakable()3098 q.text('}')3099oxm.subtypes[2147488002] = ip_dscp_masked3100class ip_ecn(oxm):3101 type_len = 21474882573102 def __init__(self, value=None):3103 if value != None:3104 self.value = value3105 else:3106 self.value = 03107 return3108 def pack(self):3109 packed = []3110 packed.append(struct.pack("!L", self.type_len))3111 packed.append(struct.pack("!B", self.value))3112 return ''.join(packed)3113 @staticmethod3114 def unpack(reader):3115 obj = ip_ecn()3116 _type_len = reader.read("!L")[0]3117 assert(_type_len == 2147488257)3118 obj.value = reader.read("!B")[0]3119 return obj3120 def __eq__(self, other):3121 if type(self) != type(other): return False3122 if self.value != other.value: return False3123 return True3124 def pretty_print(self, q):3125 q.text("ip_ecn {")3126 with q.group():3127 with q.indent(2):3128 q.breakable()3129 q.text("value = ");3130 q.text("%#x" % self.value)3131 q.breakable()3132 q.text('}')3133oxm.subtypes[2147488257] = ip_ecn3134class ip_ecn_masked(oxm):3135 type_len = 21474885143136 def __init__(self, value=None, value_mask=None):3137 if value != None:3138 self.value = value3139 else:3140 self.value = 03141 if value_mask != None:3142 self.value_mask = value_mask3143 else:3144 self.value_mask = 03145 return3146 def pack(self):3147 packed = []3148 packed.append(struct.pack("!L", self.type_len))3149 packed.append(struct.pack("!B", self.value))3150 packed.append(struct.pack("!B", self.value_mask))3151 return ''.join(packed)3152 @staticmethod3153 def unpack(reader):3154 obj = ip_ecn_masked()3155 _type_len = reader.read("!L")[0]3156 assert(_type_len == 2147488514)3157 obj.value = reader.read("!B")[0]3158 obj.value_mask = reader.read("!B")[0]3159 return obj3160 def __eq__(self, other):3161 if type(self) != type(other): return False3162 if self.value != other.value: return False3163 if self.value_mask != other.value_mask: return False3164 return True3165 def pretty_print(self, q):3166 q.text("ip_ecn_masked {")3167 with q.group():3168 with q.indent(2):3169 q.breakable()3170 q.text("value = ");3171 q.text("%#x" % self.value)3172 q.text(","); q.breakable()3173 q.text("value_mask = ");3174 q.text("%#x" % self.value_mask)3175 q.breakable()3176 q.text('}')3177oxm.subtypes[2147488514] = ip_ecn_masked3178class ip_proto(oxm):3179 type_len = 21474887693180 def __init__(self, value=None):3181 if value != None:3182 self.value = value3183 else:3184 self.value = 03185 return3186 def pack(self):3187 packed = []3188 packed.append(struct.pack("!L", self.type_len))3189 packed.append(struct.pack("!B", self.value))3190 return ''.join(packed)3191 @staticmethod3192 def unpack(reader):3193 obj = ip_proto()3194 _type_len = reader.read("!L")[0]3195 assert(_type_len == 2147488769)3196 obj.value = reader.read("!B")[0]3197 return obj3198 def __eq__(self, other):3199 if type(self) != type(other): return False3200 if self.value != other.value: return False3201 return True3202 def pretty_print(self, q):3203 q.text("ip_proto {")3204 with q.group():3205 with q.indent(2):3206 q.breakable()3207 q.text("value = ");3208 q.text("%#x" % self.value)3209 q.breakable()3210 q.text('}')3211oxm.subtypes[2147488769] = ip_proto3212class ip_proto_masked(oxm):3213 type_len = 21474890263214 def __init__(self, value=None, value_mask=None):3215 if value != None:3216 self.value = value3217 else:3218 self.value = 03219 if value_mask != None:3220 self.value_mask = value_mask3221 else:3222 self.value_mask = 03223 return3224 def pack(self):3225 packed = []3226 packed.append(struct.pack("!L", self.type_len))3227 packed.append(struct.pack("!B", self.value))3228 packed.append(struct.pack("!B", self.value_mask))3229 return ''.join(packed)3230 @staticmethod3231 def unpack(reader):3232 obj = ip_proto_masked()3233 _type_len = reader.read("!L")[0]3234 assert(_type_len == 2147489026)3235 obj.value = reader.read("!B")[0]3236 obj.value_mask = reader.read("!B")[0]3237 return obj3238 def __eq__(self, other):3239 if type(self) != type(other): return False3240 if self.value != other.value: return False3241 if self.value_mask != other.value_mask: return False3242 return True3243 def pretty_print(self, q):3244 q.text("ip_proto_masked {")3245 with q.group():3246 with q.indent(2):3247 q.breakable()3248 q.text("value = ");3249 q.text("%#x" % self.value)3250 q.text(","); q.breakable()3251 q.text("value_mask = ");3252 q.text("%#x" % self.value_mask)3253 q.breakable()3254 q.text('}')3255oxm.subtypes[2147489026] = ip_proto_masked3256class ipv4_dst(oxm):3257 type_len = 21474897963258 def __init__(self, value=None):3259 if value != None:3260 self.value = value3261 else:3262 self.value = 03263 return3264 def pack(self):3265 packed = []3266 packed.append(struct.pack("!L", self.type_len))3267 packed.append(struct.pack("!L", self.value))3268 return ''.join(packed)3269 @staticmethod3270 def unpack(reader):3271 obj = ipv4_dst()3272 _type_len = reader.read("!L")[0]3273 assert(_type_len == 2147489796)3274 obj.value = reader.read("!L")[0]3275 return obj3276 def __eq__(self, other):3277 if type(self) != type(other): return False3278 if self.value != other.value: return False3279 return True3280 def pretty_print(self, q):3281 q.text("ipv4_dst {")3282 with q.group():3283 with q.indent(2):3284 q.breakable()3285 q.text("value = ");3286 q.text(util.pretty_ipv4(self.value))3287 q.breakable()3288 q.text('}')3289oxm.subtypes[2147489796] = ipv4_dst3290class ipv4_dst_masked(oxm):3291 type_len = 21474900563292 def __init__(self, value=None, value_mask=None):3293 if value != None:3294 self.value = value3295 else:3296 self.value = 03297 if value_mask != None:3298 self.value_mask = value_mask3299 else:3300 self.value_mask = 03301 return3302 def pack(self):3303 packed = []3304 packed.append(struct.pack("!L", self.type_len))3305 packed.append(struct.pack("!L", self.value))3306 packed.append(struct.pack("!L", self.value_mask))3307 return ''.join(packed)3308 @staticmethod3309 def unpack(reader):3310 obj = ipv4_dst_masked()3311 _type_len = reader.read("!L")[0]3312 assert(_type_len == 2147490056)3313 obj.value = reader.read("!L")[0]3314 obj.value_mask = reader.read("!L")[0]3315 return obj3316 def __eq__(self, other):3317 if type(self) != type(other): return False3318 if self.value != other.value: return False3319 if self.value_mask != other.value_mask: return False3320 return True3321 def pretty_print(self, q):3322 q.text("ipv4_dst_masked {")3323 with q.group():3324 with q.indent(2):3325 q.breakable()3326 q.text("value = ");3327 q.text(util.pretty_ipv4(self.value))3328 q.text(","); q.breakable()3329 q.text("value_mask = ");3330 q.text(util.pretty_ipv4(self.value_mask))3331 q.breakable()3332 q.text('}')3333oxm.subtypes[2147490056] = ipv4_dst_masked3334class ipv4_src(oxm):3335 type_len = 21474892843336 def __init__(self, value=None):3337 if value != None:3338 self.value = value3339 else:3340 self.value = 03341 return3342 def pack(self):3343 packed = []3344 packed.append(struct.pack("!L", self.type_len))3345 packed.append(struct.pack("!L", self.value))3346 return ''.join(packed)3347 @staticmethod3348 def unpack(reader):3349 obj = ipv4_src()3350 _type_len = reader.read("!L")[0]3351 assert(_type_len == 2147489284)3352 obj.value = reader.read("!L")[0]3353 return obj3354 def __eq__(self, other):3355 if type(self) != type(other): return False3356 if self.value != other.value: return False3357 return True3358 def pretty_print(self, q):3359 q.text("ipv4_src {")3360 with q.group():3361 with q.indent(2):3362 q.breakable()3363 q.text("value = ");3364 q.text(util.pretty_ipv4(self.value))3365 q.breakable()3366 q.text('}')3367oxm.subtypes[2147489284] = ipv4_src3368class ipv4_src_masked(oxm):3369 type_len = 21474895443370 def __init__(self, value=None, value_mask=None):3371 if value != None:3372 self.value = value3373 else:3374 self.value = 03375 if value_mask != None:3376 self.value_mask = value_mask3377 else:3378 self.value_mask = 03379 return3380 def pack(self):3381 packed = []3382 packed.append(struct.pack("!L", self.type_len))3383 packed.append(struct.pack("!L", self.value))3384 packed.append(struct.pack("!L", self.value_mask))3385 return ''.join(packed)3386 @staticmethod3387 def unpack(reader):3388 obj = ipv4_src_masked()3389 _type_len = reader.read("!L")[0]3390 assert(_type_len == 2147489544)3391 obj.value = reader.read("!L")[0]3392 obj.value_mask = reader.read("!L")[0]3393 return obj3394 def __eq__(self, other):3395 if type(self) != type(other): return False3396 if self.value != other.value: return False3397 if self.value_mask != other.value_mask: return False3398 return True3399 def pretty_print(self, q):3400 q.text("ipv4_src_masked {")3401 with q.group():3402 with q.indent(2):3403 q.breakable()3404 q.text("value = ");3405 q.text(util.pretty_ipv4(self.value))3406 q.text(","); q.breakable()3407 q.text("value_mask = ");3408 q.text(util.pretty_ipv4(self.value_mask))3409 q.breakable()3410 q.text('}')3411oxm.subtypes[2147489544] = ipv4_src_masked3412class ipv6_dst(oxm):3413 type_len = 21474974883414 def __init__(self, value=None):3415 if value != None:3416 self.value = value3417 else:3418 self.value = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'3419 return3420 def pack(self):3421 packed = []3422 packed.append(struct.pack("!L", self.type_len))3423 packed.append(struct.pack("!16s", self.value))3424 return ''.join(packed)3425 @staticmethod3426 def unpack(reader):3427 obj = ipv6_dst()3428 _type_len = reader.read("!L")[0]3429 assert(_type_len == 2147497488)3430 obj.value = reader.read('!16s')[0]3431 return obj3432 def __eq__(self, other):3433 if type(self) != type(other): return False3434 if self.value != other.value: return False3435 return True3436 def pretty_print(self, q):3437 q.text("ipv6_dst {")3438 with q.group():3439 with q.indent(2):3440 q.breakable()3441 q.text("value = ");3442 q.pp(self.value)3443 q.breakable()3444 q.text('}')3445oxm.subtypes[2147497488] = ipv6_dst3446class ipv6_dst_masked(oxm):3447 type_len = 21474977603448 def __init__(self, value=None, value_mask=None):3449 if value != None:3450 self.value = value3451 else:3452 self.value = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'3453 if value_mask != None:3454 self.value_mask = value_mask3455 else:3456 self.value_mask = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'3457 return3458 def pack(self):3459 packed = []3460 packed.append(struct.pack("!L", self.type_len))3461 packed.append(struct.pack("!16s", self.value))3462 packed.append(struct.pack("!16s", self.value_mask))3463 return ''.join(packed)3464 @staticmethod3465 def unpack(reader):3466 obj = ipv6_dst_masked()3467 _type_len = reader.read("!L")[0]3468 assert(_type_len == 2147497760)3469 obj.value = reader.read('!16s')[0]3470 obj.value_mask = reader.read('!16s')[0]3471 return obj3472 def __eq__(self, other):3473 if type(self) != type(other): return False3474 if self.value != other.value: return False3475 if self.value_mask != other.value_mask: return False3476 return True3477 def pretty_print(self, q):3478 q.text("ipv6_dst_masked {")3479 with q.group():3480 with q.indent(2):3481 q.breakable()3482 q.text("value = ");3483 q.pp(self.value)3484 q.text(","); q.breakable()3485 q.text("value_mask = ");3486 q.pp(self.value_mask)3487 q.breakable()3488 q.text('}')3489oxm.subtypes[2147497760] = ipv6_dst_masked3490class ipv6_exthdr(oxm):3491 type_len = 21475036183492 def __init__(self, value=None):3493 if value != None:3494 self.value = value3495 else:3496 self.value = 03497 return3498 def pack(self):3499 packed = []3500 packed.append(struct.pack("!L", self.type_len))3501 packed.append(struct.pack("!H", self.value))3502 return ''.join(packed)3503 @staticmethod3504 def unpack(reader):3505 obj = ipv6_exthdr()3506 _type_len = reader.read("!L")[0]3507 assert(_type_len == 2147503618)3508 obj.value = reader.read("!H")[0]3509 return obj3510 def __eq__(self, other):3511 if type(self) != type(other): return False3512 if self.value != other.value: return False3513 return True3514 def pretty_print(self, q):3515 q.text("ipv6_exthdr {")3516 with q.group():3517 with q.indent(2):3518 q.breakable()3519 q.text("value = ");3520 q.text("%#x" % self.value)3521 q.breakable()3522 q.text('}')3523oxm.subtypes[2147503618] = ipv6_exthdr3524class ipv6_exthdr_masked(oxm):3525 type_len = 21475038763526 def __init__(self, value=None, value_mask=None):3527 if value != None:3528 self.value = value3529 else:3530 self.value = 03531 if value_mask != None:3532 self.value_mask = value_mask3533 else:3534 self.value_mask = 03535 return3536 def pack(self):3537 packed = []3538 packed.append(struct.pack("!L", self.type_len))3539 packed.append(struct.pack("!H", self.value))3540 packed.append(struct.pack("!H", self.value_mask))3541 return ''.join(packed)3542 @staticmethod3543 def unpack(reader):3544 obj = ipv6_exthdr_masked()3545 _type_len = reader.read("!L")[0]3546 assert(_type_len == 2147503876)3547 obj.value = reader.read("!H")[0]3548 obj.value_mask = reader.read("!H")[0]3549 return obj3550 def __eq__(self, other):3551 if type(self) != type(other): return False3552 if self.value != other.value: return False3553 if self.value_mask != other.value_mask: return False3554 return True3555 def pretty_print(self, q):3556 q.text("ipv6_exthdr_masked {")3557 with q.group():3558 with q.indent(2):3559 q.breakable()3560 q.text("value = ");3561 q.text("%#x" % self.value)3562 q.text(","); q.breakable()3563 q.text("value_mask = ");3564 q.text("%#x" % self.value_mask)3565 q.breakable()3566 q.text('}')3567oxm.subtypes[2147503876] = ipv6_exthdr_masked3568class ipv6_flabel(oxm):3569 type_len = 21474979883570 def __init__(self, value=None):3571 if value != None:3572 self.value = value3573 else:3574 self.value = 03575 return3576 def pack(self):3577 packed = []3578 packed.append(struct.pack("!L", self.type_len))3579 packed.append(struct.pack("!L", self.value))3580 return ''.join(packed)3581 @staticmethod3582 def unpack(reader):3583 obj = ipv6_flabel()3584 _type_len = reader.read("!L")[0]3585 assert(_type_len == 2147497988)3586 obj.value = reader.read("!L")[0]3587 return obj3588 def __eq__(self, other):3589 if type(self) != type(other): return False3590 if self.value != other.value: return False3591 return True3592 def pretty_print(self, q):3593 q.text("ipv6_flabel {")3594 with q.group():3595 with q.indent(2):3596 q.breakable()3597 q.text("value = ");3598 q.text("%#x" % self.value)3599 q.breakable()3600 q.text('}')3601oxm.subtypes[2147497988] = ipv6_flabel3602class ipv6_flabel_masked(oxm):3603 type_len = 21474982483604 def __init__(self, value=None, value_mask=None):3605 if value != None:3606 self.value = value3607 else:3608 self.value = 03609 if value_mask != None:3610 self.value_mask = value_mask3611 else:3612 self.value_mask = 03613 return3614 def pack(self):3615 packed = []3616 packed.append(struct.pack("!L", self.type_len))3617 packed.append(struct.pack("!L", self.value))3618 packed.append(struct.pack("!L", self.value_mask))3619 return ''.join(packed)3620 @staticmethod3621 def unpack(reader):3622 obj = ipv6_flabel_masked()3623 _type_len = reader.read("!L")[0]3624 assert(_type_len == 2147498248)3625 obj.value = reader.read("!L")[0]3626 obj.value_mask = reader.read("!L")[0]3627 return obj3628 def __eq__(self, other):3629 if type(self) != type(other): return False3630 if self.value != other.value: return False3631 if self.value_mask != other.value_mask: return False3632 return True3633 def pretty_print(self, q):3634 q.text("ipv6_flabel_masked {")3635 with q.group():3636 with q.indent(2):3637 q.breakable()3638 q.text("value = ");3639 q.text("%#x" % self.value)3640 q.text(","); q.breakable()3641 q.text("value_mask = ");3642 q.text("%#x" % self.value_mask)3643 q.breakable()3644 q.text('}')3645oxm.subtypes[2147498248] = ipv6_flabel_masked3646class ipv6_nd_sll(oxm):3647 type_len = 21475000383648 def __init__(self, value=None):3649 if value != None:3650 self.value = value3651 else:3652 self.value = [0,0,0,0,0,0]3653 return3654 def pack(self):3655 packed = []3656 packed.append(struct.pack("!L", self.type_len))3657 packed.append(struct.pack("!6B", *self.value))3658 return ''.join(packed)3659 @staticmethod3660 def unpack(reader):3661 obj = ipv6_nd_sll()3662 _type_len = reader.read("!L")[0]3663 assert(_type_len == 2147500038)3664 obj.value = list(reader.read('!6B'))3665 return obj3666 def __eq__(self, other):3667 if type(self) != type(other): return False3668 if self.value != other.value: return False3669 return True3670 def pretty_print(self, q):3671 q.text("ipv6_nd_sll {")3672 with q.group():3673 with q.indent(2):3674 q.breakable()3675 q.text("value = ");3676 q.text(util.pretty_mac(self.value))3677 q.breakable()3678 q.text('}')3679oxm.subtypes[2147500038] = ipv6_nd_sll3680class ipv6_nd_sll_masked(oxm):3681 type_len = 21475003003682 def __init__(self, value=None, value_mask=None):3683 if value != None:3684 self.value = value3685 else:3686 self.value = [0,0,0,0,0,0]3687 if value_mask != None:3688 self.value_mask = value_mask3689 else:3690 self.value_mask = [0,0,0,0,0,0]3691 return3692 def pack(self):3693 packed = []3694 packed.append(struct.pack("!L", self.type_len))3695 packed.append(struct.pack("!6B", *self.value))3696 packed.append(struct.pack("!6B", *self.value_mask))3697 return ''.join(packed)3698 @staticmethod3699 def unpack(reader):3700 obj = ipv6_nd_sll_masked()3701 _type_len = reader.read("!L")[0]3702 assert(_type_len == 2147500300)3703 obj.value = list(reader.read('!6B'))3704 obj.value_mask = list(reader.read('!6B'))3705 return obj3706 def __eq__(self, other):3707 if type(self) != type(other): return False3708 if self.value != other.value: return False3709 if self.value_mask != other.value_mask: return False3710 return True3711 def pretty_print(self, q):3712 q.text("ipv6_nd_sll_masked {")3713 with q.group():3714 with q.indent(2):3715 q.breakable()3716 q.text("value = ");3717 q.text(util.pretty_mac(self.value))3718 q.text(","); q.breakable()3719 q.text("value_mask = ");3720 q.text(util.pretty_mac(self.value_mask))3721 q.breakable()3722 q.text('}')3723oxm.subtypes[2147500300] = ipv6_nd_sll_masked3724class ipv6_nd_target(oxm):3725 type_len = 21474995363726 def __init__(self, value=None):3727 if value != None:3728 self.value = value3729 else:3730 self.value = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'3731 return3732 def pack(self):3733 packed = []3734 packed.append(struct.pack("!L", self.type_len))3735 packed.append(struct.pack("!16s", self.value))3736 return ''.join(packed)3737 @staticmethod3738 def unpack(reader):3739 obj = ipv6_nd_target()3740 _type_len = reader.read("!L")[0]3741 assert(_type_len == 2147499536)3742 obj.value = reader.read('!16s')[0]3743 return obj3744 def __eq__(self, other):3745 if type(self) != type(other): return False3746 if self.value != other.value: return False3747 return True3748 def pretty_print(self, q):3749 q.text("ipv6_nd_target {")3750 with q.group():3751 with q.indent(2):3752 q.breakable()3753 q.text("value = ");3754 q.pp(self.value)3755 q.breakable()3756 q.text('}')3757oxm.subtypes[2147499536] = ipv6_nd_target3758class ipv6_nd_target_masked(oxm):3759 type_len = 21474998083760 def __init__(self, value=None, value_mask=None):3761 if value != None:3762 self.value = value3763 else:3764 self.value = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'3765 if value_mask != None:3766 self.value_mask = value_mask3767 else:3768 self.value_mask = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'3769 return3770 def pack(self):3771 packed = []3772 packed.append(struct.pack("!L", self.type_len))3773 packed.append(struct.pack("!16s", self.value))3774 packed.append(struct.pack("!16s", self.value_mask))3775 return ''.join(packed)3776 @staticmethod3777 def unpack(reader):3778 obj = ipv6_nd_target_masked()3779 _type_len = reader.read("!L")[0]3780 assert(_type_len == 2147499808)3781 obj.value = reader.read('!16s')[0]3782 obj.value_mask = reader.read('!16s')[0]3783 return obj3784 def __eq__(self, other):3785 if type(self) != type(other): return False3786 if self.value != other.value: return False3787 if self.value_mask != other.value_mask: return False3788 return True3789 def pretty_print(self, q):3790 q.text("ipv6_nd_target_masked {")3791 with q.group():3792 with q.indent(2):3793 q.breakable()3794 q.text("value = ");3795 q.pp(self.value)3796 q.text(","); q.breakable()3797 q.text("value_mask = ");3798 q.pp(self.value_mask)3799 q.breakable()3800 q.text('}')3801oxm.subtypes[2147499808] = ipv6_nd_target_masked3802class ipv6_nd_tll(oxm):3803 type_len = 21475005503804 def __init__(self, value=None):3805 if value != None:3806 self.value = value3807 else:3808 self.value = [0,0,0,0,0,0]3809 return3810 def pack(self):3811 packed = []3812 packed.append(struct.pack("!L", self.type_len))3813 packed.append(struct.pack("!6B", *self.value))3814 return ''.join(packed)3815 @staticmethod3816 def unpack(reader):3817 obj = ipv6_nd_tll()3818 _type_len = reader.read("!L")[0]3819 assert(_type_len == 2147500550)3820 obj.value = list(reader.read('!6B'))3821 return obj3822 def __eq__(self, other):3823 if type(self) != type(other): return False3824 if self.value != other.value: return False3825 return True3826 def pretty_print(self, q):3827 q.text("ipv6_nd_tll {")3828 with q.group():3829 with q.indent(2):3830 q.breakable()3831 q.text("value = ");3832 q.text(util.pretty_mac(self.value))3833 q.breakable()3834 q.text('}')3835oxm.subtypes[2147500550] = ipv6_nd_tll3836class ipv6_nd_tll_masked(oxm):3837 type_len = 21475008123838 def __init__(self, value=None, value_mask=None):3839 if value != None:3840 self.value = value3841 else:3842 self.value = [0,0,0,0,0,0]3843 if value_mask != None:3844 self.value_mask = value_mask3845 else:3846 self.value_mask = [0,0,0,0,0,0]3847 return3848 def pack(self):3849 packed = []3850 packed.append(struct.pack("!L", self.type_len))3851 packed.append(struct.pack("!6B", *self.value))3852 packed.append(struct.pack("!6B", *self.value_mask))3853 return ''.join(packed)3854 @staticmethod3855 def unpack(reader):3856 obj = ipv6_nd_tll_masked()3857 _type_len = reader.read("!L")[0]3858 assert(_type_len == 2147500812)3859 obj.value = list(reader.read('!6B'))3860 obj.value_mask = list(reader.read('!6B'))3861 return obj3862 def __eq__(self, other):3863 if type(self) != type(other): return False3864 if self.value != other.value: return False3865 if self.value_mask != other.value_mask: return False3866 return True3867 def pretty_print(self, q):3868 q.text("ipv6_nd_tll_masked {")3869 with q.group():3870 with q.indent(2):3871 q.breakable()3872 q.text("value = ");3873 q.text(util.pretty_mac(self.value))3874 q.text(","); q.breakable()3875 q.text("value_mask = ");3876 q.text(util.pretty_mac(self.value_mask))3877 q.breakable()3878 q.text('}')3879oxm.subtypes[2147500812] = ipv6_nd_tll_masked3880class ipv6_src(oxm):3881 type_len = 21474969763882 def __init__(self, value=None):3883 if value != None:3884 self.value = value3885 else:3886 self.value = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'3887 return3888 def pack(self):3889 packed = []3890 packed.append(struct.pack("!L", self.type_len))3891 packed.append(struct.pack("!16s", self.value))3892 return ''.join(packed)3893 @staticmethod3894 def unpack(reader):3895 obj = ipv6_src()3896 _type_len = reader.read("!L")[0]3897 assert(_type_len == 2147496976)3898 obj.value = reader.read('!16s')[0]3899 return obj3900 def __eq__(self, other):3901 if type(self) != type(other): return False3902 if self.value != other.value: return False3903 return True3904 def pretty_print(self, q):3905 q.text("ipv6_src {")3906 with q.group():3907 with q.indent(2):3908 q.breakable()3909 q.text("value = ");3910 q.pp(self.value)3911 q.breakable()3912 q.text('}')3913oxm.subtypes[2147496976] = ipv6_src3914class ipv6_src_masked(oxm):3915 type_len = 21474972483916 def __init__(self, value=None, value_mask=None):3917 if value != None:3918 self.value = value3919 else:3920 self.value = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'3921 if value_mask != None:3922 self.value_mask = value_mask3923 else:3924 self.value_mask = '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'3925 return3926 def pack(self):3927 packed = []3928 packed.append(struct.pack("!L", self.type_len))3929 packed.append(struct.pack("!16s", self.value))3930 packed.append(struct.pack("!16s", self.value_mask))3931 return ''.join(packed)3932 @staticmethod3933 def unpack(reader):3934 obj = ipv6_src_masked()3935 _type_len = reader.read("!L")[0]3936 assert(_type_len == 2147497248)3937 obj.value = reader.read('!16s')[0]3938 obj.value_mask = reader.read('!16s')[0]3939 return obj3940 def __eq__(self, other):3941 if type(self) != type(other): return False3942 if self.value != other.value: return False3943 if self.value_mask != other.value_mask: return False3944 return True3945 def pretty_print(self, q):3946 q.text("ipv6_src_masked {")3947 with q.group():3948 with q.indent(2):3949 q.breakable()3950 q.text("value = ");3951 q.pp(self.value)3952 q.text(","); q.breakable()3953 q.text("value_mask = ");3954 q.pp(self.value_mask)3955 q.breakable()3956 q.text('}')3957oxm.subtypes[2147497248] = ipv6_src_masked3958class metadata(oxm):3959 type_len = 21474846803960 def __init__(self, value=None):3961 if value != None:3962 self.value = value3963 else:3964 self.value = 03965 return3966 def pack(self):3967 packed = []3968 packed.append(struct.pack("!L", self.type_len))3969 packed.append(struct.pack("!Q", self.value))3970 return ''.join(packed)3971 @staticmethod3972 def unpack(reader):3973 obj = metadata()3974 _type_len = reader.read("!L")[0]3975 assert(_type_len == 2147484680)3976 obj.value = reader.read("!Q")[0]3977 return obj3978 def __eq__(self, other):3979 if type(self) != type(other): return False3980 if self.value != other.value: return False3981 return True3982 def pretty_print(self, q):3983 q.text("metadata {")3984 with q.group():3985 with q.indent(2):3986 q.breakable()3987 q.text("value = ");3988 q.text("%#x" % self.value)3989 q.breakable()3990 q.text('}')3991oxm.subtypes[2147484680] = metadata3992class metadata_masked(oxm):3993 type_len = 21474849443994 def __init__(self, value=None, value_mask=None):3995 if value != None:3996 self.value = value3997 else:3998 self.value = 03999 if value_mask != None:4000 self.value_mask = value_mask4001 else:4002 self.value_mask = 04003 return4004 def pack(self):4005 packed = []4006 packed.append(struct.pack("!L", self.type_len))4007 packed.append(struct.pack("!Q", self.value))4008 packed.append(struct.pack("!Q", self.value_mask))4009 return ''.join(packed)4010 @staticmethod4011 def unpack(reader):4012 obj = metadata_masked()4013 _type_len = reader.read("!L")[0]4014 assert(_type_len == 2147484944)4015 obj.value = reader.read("!Q")[0]4016 obj.value_mask = reader.read("!Q")[0]4017 return obj4018 def __eq__(self, other):4019 if type(self) != type(other): return False4020 if self.value != other.value: return False4021 if self.value_mask != other.value_mask: return False4022 return True4023 def pretty_print(self, q):4024 q.text("metadata_masked {")4025 with q.group():4026 with q.indent(2):4027 q.breakable()4028 q.text("value = ");4029 q.text("%#x" % self.value)4030 q.text(","); q.breakable()4031 q.text("value_mask = ");4032 q.text("%#x" % self.value_mask)4033 q.breakable()4034 q.text('}')4035oxm.subtypes[2147484944] = metadata_masked4036class mpls_bos(oxm):4037 type_len = 21475020814038 def __init__(self, value=None):4039 if value != None:4040 self.value = value4041 else:4042 self.value = 04043 return4044 def pack(self):4045 packed = []4046 packed.append(struct.pack("!L", self.type_len))4047 packed.append(struct.pack("!B", self.value))4048 return ''.join(packed)4049 @staticmethod4050 def unpack(reader):4051 obj = mpls_bos()4052 _type_len = reader.read("!L")[0]4053 assert(_type_len == 2147502081)4054 obj.value = reader.read("!B")[0]4055 return obj4056 def __eq__(self, other):4057 if type(self) != type(other): return False4058 if self.value != other.value: return False4059 return True4060 def pretty_print(self, q):4061 q.text("mpls_bos {")4062 with q.group():4063 with q.indent(2):4064 q.breakable()4065 q.text("value = ");4066 q.text("%#x" % self.value)4067 q.breakable()4068 q.text('}')4069oxm.subtypes[2147502081] = mpls_bos4070class mpls_bos_masked(oxm):4071 type_len = 21475023384072 def __init__(self, value=None, value_mask=None):4073 if value != None:4074 self.value = value4075 else:4076 self.value = 04077 if value_mask != None:4078 self.value_mask = value_mask4079 else:4080 self.value_mask = 04081 return4082 def pack(self):4083 packed = []4084 packed.append(struct.pack("!L", self.type_len))4085 packed.append(struct.pack("!B", self.value))4086 packed.append(struct.pack("!B", self.value_mask))4087 return ''.join(packed)4088 @staticmethod4089 def unpack(reader):4090 obj = mpls_bos_masked()4091 _type_len = reader.read("!L")[0]4092 assert(_type_len == 2147502338)4093 obj.value = reader.read("!B")[0]4094 obj.value_mask = reader.read("!B")[0]4095 return obj4096 def __eq__(self, other):4097 if type(self) != type(other): return False4098 if self.value != other.value: return False4099 if self.value_mask != other.value_mask: return False4100 return True4101 def pretty_print(self, q):4102 q.text("mpls_bos_masked {")4103 with q.group():4104 with q.indent(2):4105 q.breakable()4106 q.text("value = ");4107 q.text("%#x" % self.value)4108 q.text(","); q.breakable()4109 q.text("value_mask = ");4110 q.text("%#x" % self.value_mask)4111 q.breakable()4112 q.text('}')4113oxm.subtypes[2147502338] = mpls_bos_masked4114class mpls_label(oxm):4115 type_len = 21475010604116 def __init__(self, value=None):4117 if value != None:4118 self.value = value4119 else:4120 self.value = 04121 return4122 def pack(self):4123 packed = []4124 packed.append(struct.pack("!L", self.type_len))4125 packed.append(struct.pack("!L", self.value))4126 return ''.join(packed)4127 @staticmethod4128 def unpack(reader):4129 obj = mpls_label()4130 _type_len = reader.read("!L")[0]4131 assert(_type_len == 2147501060)4132 obj.value = reader.read("!L")[0]4133 return obj4134 def __eq__(self, other):4135 if type(self) != type(other): return False4136 if self.value != other.value: return False4137 return True4138 def pretty_print(self, q):4139 q.text("mpls_label {")4140 with q.group():4141 with q.indent(2):4142 q.breakable()4143 q.text("value = ");4144 q.text("%#x" % self.value)4145 q.breakable()4146 q.text('}')4147oxm.subtypes[2147501060] = mpls_label4148class mpls_label_masked(oxm):4149 type_len = 21475013204150 def __init__(self, value=None, value_mask=None):4151 if value != None:4152 self.value = value4153 else:4154 self.value = 04155 if value_mask != None:4156 self.value_mask = value_mask4157 else:4158 self.value_mask = 04159 return4160 def pack(self):4161 packed = []4162 packed.append(struct.pack("!L", self.type_len))4163 packed.append(struct.pack("!L", self.value))4164 packed.append(struct.pack("!L", self.value_mask))4165 return ''.join(packed)4166 @staticmethod4167 def unpack(reader):4168 obj = mpls_label_masked()4169 _type_len = reader.read("!L")[0]4170 assert(_type_len == 2147501320)4171 obj.value = reader.read("!L")[0]4172 obj.value_mask = reader.read("!L")[0]4173 return obj4174 def __eq__(self, other):4175 if type(self) != type(other): return False4176 if self.value != other.value: return False4177 if self.value_mask != other.value_mask: return False4178 return True4179 def pretty_print(self, q):4180 q.text("mpls_label_masked {")4181 with q.group():4182 with q.indent(2):4183 q.breakable()4184 q.text("value = ");4185 q.text("%#x" % self.value)4186 q.text(","); q.breakable()4187 q.text("value_mask = ");4188 q.text("%#x" % self.value_mask)4189 q.breakable()4190 q.text('}')4191oxm.subtypes[2147501320] = mpls_label_masked4192class mpls_tc(oxm):4193 type_len = 21475015694194 def __init__(self, value=None):4195 if value != None:4196 self.value = value4197 else:4198 self.value = 04199 return4200 def pack(self):4201 packed = []4202 packed.append(struct.pack("!L", self.type_len))4203 packed.append(struct.pack("!B", self.value))4204 return ''.join(packed)4205 @staticmethod4206 def unpack(reader):4207 obj = mpls_tc()4208 _type_len = reader.read("!L")[0]4209 assert(_type_len == 2147501569)4210 obj.value = reader.read("!B")[0]4211 return obj4212 def __eq__(self, other):4213 if type(self) != type(other): return False4214 if self.value != other.value: return False4215 return True4216 def pretty_print(self, q):4217 q.text("mpls_tc {")4218 with q.group():4219 with q.indent(2):4220 q.breakable()4221 q.text("value = ");4222 q.text("%#x" % self.value)4223 q.breakable()4224 q.text('}')4225oxm.subtypes[2147501569] = mpls_tc4226class mpls_tc_masked(oxm):4227 type_len = 21475018264228 def __init__(self, value=None, value_mask=None):4229 if value != None:4230 self.value = value4231 else:4232 self.value = 04233 if value_mask != None:4234 self.value_mask = value_mask4235 else:4236 self.value_mask = 04237 return4238 def pack(self):4239 packed = []4240 packed.append(struct.pack("!L", self.type_len))4241 packed.append(struct.pack("!B", self.value))4242 packed.append(struct.pack("!B", self.value_mask))4243 return ''.join(packed)4244 @staticmethod4245 def unpack(reader):4246 obj = mpls_tc_masked()4247 _type_len = reader.read("!L")[0]4248 assert(_type_len == 2147501826)4249 obj.value = reader.read("!B")[0]4250 obj.value_mask = reader.read("!B")[0]4251 return obj4252 def __eq__(self, other):4253 if type(self) != type(other): return False4254 if self.value != other.value: return False4255 if self.value_mask != other.value_mask: return False4256 return True4257 def pretty_print(self, q):4258 q.text("mpls_tc_masked {")4259 with q.group():4260 with q.indent(2):4261 q.breakable()4262 q.text("value = ");4263 q.text("%#x" % self.value)4264 q.text(","); q.breakable()4265 q.text("value_mask = ");4266 q.text("%#x" % self.value_mask)4267 q.breakable()4268 q.text('}')4269oxm.subtypes[2147501826] = mpls_tc_masked4270class pbb_uca(oxm):4271 type_len = 21475046414272 def __init__(self, value=None):4273 if value != None:4274 self.value = value4275 else:4276 self.value = 04277 return4278 def pack(self):4279 packed = []4280 packed.append(struct.pack("!L", self.type_len))4281 packed.append(struct.pack("!B", self.value))4282 return ''.join(packed)4283 @staticmethod4284 def unpack(reader):4285 obj = pbb_uca()4286 _type_len = reader.read("!L")[0]4287 assert(_type_len == 2147504641)4288 obj.value = reader.read("!B")[0]4289 return obj4290 def __eq__(self, other):4291 if type(self) != type(other): return False4292 if self.value != other.value: return False4293 return True4294 def pretty_print(self, q):4295 q.text("pbb_uca {")4296 with q.group():4297 with q.indent(2):4298 q.breakable()4299 q.text("value = ");4300 q.text("%#x" % self.value)4301 q.breakable()4302 q.text('}')4303oxm.subtypes[2147504641] = pbb_uca4304class pbb_uca_masked(oxm):4305 type_len = 21475048984306 def __init__(self, value=None, value_mask=None):4307 if value != None:4308 self.value = value4309 else:4310 self.value = 04311 if value_mask != None:4312 self.value_mask = value_mask4313 else:4314 self.value_mask = 04315 return4316 def pack(self):4317 packed = []4318 packed.append(struct.pack("!L", self.type_len))4319 packed.append(struct.pack("!B", self.value))4320 packed.append(struct.pack("!B", self.value_mask))4321 return ''.join(packed)4322 @staticmethod4323 def unpack(reader):4324 obj = pbb_uca_masked()4325 _type_len = reader.read("!L")[0]4326 assert(_type_len == 2147504898)4327 obj.value = reader.read("!B")[0]4328 obj.value_mask = reader.read("!B")[0]4329 return obj4330 def __eq__(self, other):4331 if type(self) != type(other): return False4332 if self.value != other.value: return False4333 if self.value_mask != other.value_mask: return False4334 return True4335 def pretty_print(self, q):4336 q.text("pbb_uca_masked {")4337 with q.group():4338 with q.indent(2):4339 q.breakable()4340 q.text("value = ");4341 q.text("%#x" % self.value)4342 q.text(","); q.breakable()4343 q.text("value_mask = ");4344 q.text("%#x" % self.value_mask)4345 q.breakable()4346 q.text('}')4347oxm.subtypes[2147504898] = pbb_uca_masked4348class sctp_dst(oxm):4349 type_len = 21474928664350 def __init__(self, value=None):4351 if value != None:4352 self.value = value4353 else:4354 self.value = 04355 return4356 def pack(self):4357 packed = []4358 packed.append(struct.pack("!L", self.type_len))4359 packed.append(struct.pack("!H", self.value))4360 return ''.join(packed)4361 @staticmethod4362 def unpack(reader):4363 obj = sctp_dst()4364 _type_len = reader.read("!L")[0]4365 assert(_type_len == 2147492866)4366 obj.value = reader.read("!H")[0]4367 return obj4368 def __eq__(self, other):4369 if type(self) != type(other): return False4370 if self.value != other.value: return False4371 return True4372 def pretty_print(self, q):4373 q.text("sctp_dst {")4374 with q.group():4375 with q.indent(2):4376 q.breakable()4377 q.text("value = ");4378 q.text("%#x" % self.value)4379 q.breakable()4380 q.text('}')4381oxm.subtypes[2147492866] = sctp_dst4382class sctp_dst_masked(oxm):4383 type_len = 21474931244384 def __init__(self, value=None, value_mask=None):4385 if value != None:4386 self.value = value4387 else:4388 self.value = 04389 if value_mask != None:4390 self.value_mask = value_mask4391 else:4392 self.value_mask = 04393 return4394 def pack(self):4395 packed = []4396 packed.append(struct.pack("!L", self.type_len))4397 packed.append(struct.pack("!H", self.value))4398 packed.append(struct.pack("!H", self.value_mask))4399 return ''.join(packed)4400 @staticmethod4401 def unpack(reader):4402 obj = sctp_dst_masked()4403 _type_len = reader.read("!L")[0]4404 assert(_type_len == 2147493124)4405 obj.value = reader.read("!H")[0]4406 obj.value_mask = reader.read("!H")[0]4407 return obj4408 def __eq__(self, other):4409 if type(self) != type(other): return False4410 if self.value != other.value: return False4411 if self.value_mask != other.value_mask: return False4412 return True4413 def pretty_print(self, q):4414 q.text("sctp_dst_masked {")4415 with q.group():4416 with q.indent(2):4417 q.breakable()4418 q.text("value = ");4419 q.text("%#x" % self.value)4420 q.text(","); q.breakable()4421 q.text("value_mask = ");4422 q.text("%#x" % self.value_mask)4423 q.breakable()4424 q.text('}')4425oxm.subtypes[2147493124] = sctp_dst_masked4426class sctp_src(oxm):4427 type_len = 21474923544428 def __init__(self, value=None):4429 if value != None:4430 self.value = value4431 else:4432 self.value = 04433 return4434 def pack(self):4435 packed = []4436 packed.append(struct.pack("!L", self.type_len))4437 packed.append(struct.pack("!H", self.value))4438 return ''.join(packed)4439 @staticmethod4440 def unpack(reader):4441 obj = sctp_src()4442 _type_len = reader.read("!L")[0]4443 assert(_type_len == 2147492354)4444 obj.value = reader.read("!H")[0]4445 return obj4446 def __eq__(self, other):4447 if type(self) != type(other): return False4448 if self.value != other.value: return False4449 return True4450 def pretty_print(self, q):4451 q.text("sctp_src {")4452 with q.group():4453 with q.indent(2):4454 q.breakable()4455 q.text("value = ");4456 q.text("%#x" % self.value)4457 q.breakable()4458 q.text('}')4459oxm.subtypes[2147492354] = sctp_src4460class sctp_src_masked(oxm):4461 type_len = 21474926124462 def __init__(self, value=None, value_mask=None):4463 if value != None:4464 self.value = value4465 else:4466 self.value = 04467 if value_mask != None:4468 self.value_mask = value_mask4469 else:4470 self.value_mask = 04471 return4472 def pack(self):4473 packed = []4474 packed.append(struct.pack("!L", self.type_len))4475 packed.append(struct.pack("!H", self.value))4476 packed.append(struct.pack("!H", self.value_mask))4477 return ''.join(packed)4478 @staticmethod4479 def unpack(reader):4480 obj = sctp_src_masked()4481 _type_len = reader.read("!L")[0]4482 assert(_type_len == 2147492612)4483 obj.value = reader.read("!H")[0]4484 obj.value_mask = reader.read("!H")[0]4485 return obj4486 def __eq__(self, other):4487 if type(self) != type(other): return False4488 if self.value != other.value: return False4489 if self.value_mask != other.value_mask: return False4490 return True4491 def pretty_print(self, q):4492 q.text("sctp_src_masked {")4493 with q.group():4494 with q.indent(2):4495 q.breakable()4496 q.text("value = ");4497 q.text("%#x" % self.value)4498 q.text(","); q.breakable()4499 q.text("value_mask = ");4500 q.text("%#x" % self.value_mask)4501 q.breakable()4502 q.text('}')4503oxm.subtypes[2147492612] = sctp_src_masked4504class tcp_dst(oxm):4505 type_len = 21474908184506 def __init__(self, value=None):4507 if value != None:4508 self.value = value4509 else:4510 self.value = 04511 return4512 def pack(self):4513 packed = []4514 packed.append(struct.pack("!L", self.type_len))4515 packed.append(struct.pack("!H", self.value))4516 return ''.join(packed)4517 @staticmethod4518 def unpack(reader):4519 obj = tcp_dst()4520 _type_len = reader.read("!L")[0]4521 assert(_type_len == 2147490818)4522 obj.value = reader.read("!H")[0]4523 return obj4524 def __eq__(self, other):4525 if type(self) != type(other): return False4526 if self.value != other.value: return False4527 return True4528 def pretty_print(self, q):4529 q.text("tcp_dst {")4530 with q.group():4531 with q.indent(2):4532 q.breakable()4533 q.text("value = ");4534 q.text("%#x" % self.value)4535 q.breakable()4536 q.text('}')4537oxm.subtypes[2147490818] = tcp_dst4538class tcp_dst_masked(oxm):4539 type_len = 21474910764540 def __init__(self, value=None, value_mask=None):4541 if value != None:4542 self.value = value4543 else:4544 self.value = 04545 if value_mask != None:4546 self.value_mask = value_mask4547 else:4548 self.value_mask = 04549 return4550 def pack(self):4551 packed = []4552 packed.append(struct.pack("!L", self.type_len))4553 packed.append(struct.pack("!H", self.value))4554 packed.append(struct.pack("!H", self.value_mask))4555 return ''.join(packed)4556 @staticmethod4557 def unpack(reader):4558 obj = tcp_dst_masked()4559 _type_len = reader.read("!L")[0]4560 assert(_type_len == 2147491076)4561 obj.value = reader.read("!H")[0]4562 obj.value_mask = reader.read("!H")[0]4563 return obj4564 def __eq__(self, other):4565 if type(self) != type(other): return False4566 if self.value != other.value: return False4567 if self.value_mask != other.value_mask: return False4568 return True4569 def pretty_print(self, q):4570 q.text("tcp_dst_masked {")4571 with q.group():4572 with q.indent(2):4573 q.breakable()4574 q.text("value = ");4575 q.text("%#x" % self.value)4576 q.text(","); q.breakable()4577 q.text("value_mask = ");4578 q.text("%#x" % self.value_mask)4579 q.breakable()4580 q.text('}')4581oxm.subtypes[2147491076] = tcp_dst_masked4582class tcp_src(oxm):4583 type_len = 21474903064584 def __init__(self, value=None):4585 if value != None:4586 self.value = value4587 else:4588 self.value = 04589 return4590 def pack(self):4591 packed = []4592 packed.append(struct.pack("!L", self.type_len))4593 packed.append(struct.pack("!H", self.value))4594 return ''.join(packed)4595 @staticmethod4596 def unpack(reader):4597 obj = tcp_src()4598 _type_len = reader.read("!L")[0]4599 assert(_type_len == 2147490306)4600 obj.value = reader.read("!H")[0]4601 return obj4602 def __eq__(self, other):4603 if type(self) != type(other): return False4604 if self.value != other.value: return False4605 return True4606 def pretty_print(self, q):4607 q.text("tcp_src {")4608 with q.group():4609 with q.indent(2):4610 q.breakable()4611 q.text("value = ");4612 q.text("%#x" % self.value)4613 q.breakable()4614 q.text('}')4615oxm.subtypes[2147490306] = tcp_src4616class tcp_src_masked(oxm):4617 type_len = 21474905644618 def __init__(self, value=None, value_mask=None):4619 if value != None:4620 self.value = value4621 else:4622 self.value = 04623 if value_mask != None:4624 self.value_mask = value_mask4625 else:4626 self.value_mask = 04627 return4628 def pack(self):4629 packed = []4630 packed.append(struct.pack("!L", self.type_len))4631 packed.append(struct.pack("!H", self.value))4632 packed.append(struct.pack("!H", self.value_mask))4633 return ''.join(packed)4634 @staticmethod4635 def unpack(reader):4636 obj = tcp_src_masked()4637 _type_len = reader.read("!L")[0]4638 assert(_type_len == 2147490564)4639 obj.value = reader.read("!H")[0]4640 obj.value_mask = reader.read("!H")[0]4641 return obj4642 def __eq__(self, other):4643 if type(self) != type(other): return False4644 if self.value != other.value: return False4645 if self.value_mask != other.value_mask: return False4646 return True4647 def pretty_print(self, q):4648 q.text("tcp_src_masked {")4649 with q.group():4650 with q.indent(2):4651 q.breakable()4652 q.text("value = ");4653 q.text("%#x" % self.value)4654 q.text(","); q.breakable()4655 q.text("value_mask = ");4656 q.text("%#x" % self.value_mask)4657 q.breakable()4658 q.text('}')4659oxm.subtypes[2147490564] = tcp_src_masked4660class tunnel_id(oxm):4661 type_len = 21475031124662 def __init__(self, value=None):4663 if value != None:4664 self.value = value4665 else:4666 self.value = 04667 return4668 def pack(self):4669 packed = []4670 packed.append(struct.pack("!L", self.type_len))4671 packed.append(struct.pack("!Q", self.value))4672 return ''.join(packed)4673 @staticmethod4674 def unpack(reader):4675 obj = tunnel_id()4676 _type_len = reader.read("!L")[0]4677 assert(_type_len == 2147503112)4678 obj.value = reader.read("!Q")[0]4679 return obj4680 def __eq__(self, other):4681 if type(self) != type(other): return False4682 if self.value != other.value: return False4683 return True4684 def pretty_print(self, q):4685 q.text("tunnel_id {")4686 with q.group():4687 with q.indent(2):4688 q.breakable()4689 q.text("value = ");4690 q.text("%#x" % self.value)4691 q.breakable()4692 q.text('}')4693oxm.subtypes[2147503112] = tunnel_id4694class tunnel_id_masked(oxm):4695 type_len = 21475033764696 def __init__(self, value=None, value_mask=None):4697 if value != None:4698 self.value = value4699 else:4700 self.value = 04701 if value_mask != None:4702 self.value_mask = value_mask4703 else:4704 self.value_mask = 04705 return4706 def pack(self):4707 packed = []4708 packed.append(struct.pack("!L", self.type_len))4709 packed.append(struct.pack("!Q", self.value))4710 packed.append(struct.pack("!Q", self.value_mask))4711 return ''.join(packed)4712 @staticmethod4713 def unpack(reader):4714 obj = tunnel_id_masked()4715 _type_len = reader.read("!L")[0]4716 assert(_type_len == 2147503376)4717 obj.value = reader.read("!Q")[0]4718 obj.value_mask = reader.read("!Q")[0]4719 return obj4720 def __eq__(self, other):4721 if type(self) != type(other): return False4722 if self.value != other.value: return False4723 if self.value_mask != other.value_mask: return False4724 return True4725 def pretty_print(self, q):4726 q.text("tunnel_id_masked {")4727 with q.group():4728 with q.indent(2):4729 q.breakable()4730 q.text("value = ");4731 q.text("%#x" % self.value)4732 q.text(","); q.breakable()4733 q.text("value_mask = ");4734 q.text("%#x" % self.value_mask)4735 q.breakable()4736 q.text('}')4737oxm.subtypes[2147503376] = tunnel_id_masked4738class tunnel_ipv4_dst(oxm):4739 type_len = 819244740 def __init__(self, value=None):4741 if value != None:4742 self.value = value4743 else:4744 self.value = 04745 return4746 def pack(self):4747 packed = []4748 packed.append(struct.pack("!L", self.type_len))4749 packed.append(struct.pack("!L", self.value))4750 return ''.join(packed)4751 @staticmethod4752 def unpack(reader):4753 obj = tunnel_ipv4_dst()4754 _type_len = reader.read("!L")[0]4755 assert(_type_len == 81924)4756 obj.value = reader.read("!L")[0]4757 return obj4758 def __eq__(self, other):4759 if type(self) != type(other): return False4760 if self.value != other.value: return False4761 return True4762 def pretty_print(self, q):4763 q.text("tunnel_ipv4_dst {")4764 with q.group():4765 with q.indent(2):4766 q.breakable()4767 q.text("value = ");4768 q.text(util.pretty_ipv4(self.value))4769 q.breakable()4770 q.text('}')4771oxm.subtypes[81924] = tunnel_ipv4_dst4772class tunnel_ipv4_dst_masked(oxm):4773 type_len = 821844774 def __init__(self, value=None, value_mask=None):4775 if value != None:4776 self.value = value4777 else:4778 self.value = 04779 if value_mask != None:4780 self.value_mask = value_mask4781 else:4782 self.value_mask = 04783 return4784 def pack(self):4785 packed = []4786 packed.append(struct.pack("!L", self.type_len))4787 packed.append(struct.pack("!L", self.value))4788 packed.append(struct.pack("!L", self.value_mask))4789 return ''.join(packed)4790 @staticmethod4791 def unpack(reader):4792 obj = tunnel_ipv4_dst_masked()4793 _type_len = reader.read("!L")[0]4794 assert(_type_len == 82184)4795 obj.value = reader.read("!L")[0]4796 obj.value_mask = reader.read("!L")[0]4797 return obj4798 def __eq__(self, other):4799 if type(self) != type(other): return False4800 if self.value != other.value: return False4801 if self.value_mask != other.value_mask: return False4802 return True4803 def pretty_print(self, q):4804 q.text("tunnel_ipv4_dst_masked {")4805 with q.group():4806 with q.indent(2):4807 q.breakable()4808 q.text("value = ");4809 q.text(util.pretty_ipv4(self.value))4810 q.text(","); q.breakable()4811 q.text("value_mask = ");4812 q.text(util.pretty_ipv4(self.value_mask))4813 q.breakable()4814 q.text('}')4815oxm.subtypes[82184] = tunnel_ipv4_dst_masked4816class tunnel_ipv4_src(oxm):4817 type_len = 814124818 def __init__(self, value=None):4819 if value != None:4820 self.value = value4821 else:4822 self.value = 04823 return4824 def pack(self):4825 packed = []4826 packed.append(struct.pack("!L", self.type_len))4827 packed.append(struct.pack("!L", self.value))4828 return ''.join(packed)4829 @staticmethod4830 def unpack(reader):4831 obj = tunnel_ipv4_src()4832 _type_len = reader.read("!L")[0]4833 assert(_type_len == 81412)4834 obj.value = reader.read("!L")[0]4835 return obj4836 def __eq__(self, other):4837 if type(self) != type(other): return False4838 if self.value != other.value: return False4839 return True4840 def pretty_print(self, q):4841 q.text("tunnel_ipv4_src {")4842 with q.group():4843 with q.indent(2):4844 q.breakable()4845 q.text("value = ");4846 q.text(util.pretty_ipv4(self.value))4847 q.breakable()4848 q.text('}')4849oxm.subtypes[81412] = tunnel_ipv4_src4850class tunnel_ipv4_src_masked(oxm):4851 type_len = 816724852 def __init__(self, value=None, value_mask=None):4853 if value != None:4854 self.value = value4855 else:4856 self.value = 04857 if value_mask != None:4858 self.value_mask = value_mask4859 else:4860 self.value_mask = 04861 return4862 def pack(self):4863 packed = []4864 packed.append(struct.pack("!L", self.type_len))4865 packed.append(struct.pack("!L", self.value))4866 packed.append(struct.pack("!L", self.value_mask))4867 return ''.join(packed)4868 @staticmethod4869 def unpack(reader):4870 obj = tunnel_ipv4_src_masked()4871 _type_len = reader.read("!L")[0]4872 assert(_type_len == 81672)4873 obj.value = reader.read("!L")[0]4874 obj.value_mask = reader.read("!L")[0]4875 return obj4876 def __eq__(self, other):4877 if type(self) != type(other): return False4878 if self.value != other.value: return False4879 if self.value_mask != other.value_mask: return False4880 return True4881 def pretty_print(self, q):4882 q.text("tunnel_ipv4_src_masked {")4883 with q.group():4884 with q.indent(2):4885 q.breakable()4886 q.text("value = ");4887 q.text(util.pretty_ipv4(self.value))4888 q.text(","); q.breakable()4889 q.text("value_mask = ");4890 q.text(util.pretty_ipv4(self.value_mask))4891 q.breakable()4892 q.text('}')4893oxm.subtypes[81672] = tunnel_ipv4_src_masked4894class udp_dst(oxm):4895 type_len = 21474918424896 def __init__(self, value=None):4897 if value != None:4898 self.value = value4899 else:4900 self.value = 04901 return4902 def pack(self):4903 packed = []4904 packed.append(struct.pack("!L", self.type_len))4905 packed.append(struct.pack("!H", self.value))4906 return ''.join(packed)4907 @staticmethod4908 def unpack(reader):4909 obj = udp_dst()4910 _type_len = reader.read("!L")[0]4911 assert(_type_len == 2147491842)4912 obj.value = reader.read("!H")[0]4913 return obj4914 def __eq__(self, other):4915 if type(self) != type(other): return False4916 if self.value != other.value: return False4917 return True4918 def pretty_print(self, q):4919 q.text("udp_dst {")4920 with q.group():4921 with q.indent(2):4922 q.breakable()4923 q.text("value = ");4924 q.text("%#x" % self.value)4925 q.breakable()4926 q.text('}')4927oxm.subtypes[2147491842] = udp_dst4928class udp_dst_masked(oxm):4929 type_len = 21474921004930 def __init__(self, value=None, value_mask=None):4931 if value != None:4932 self.value = value4933 else:4934 self.value = 04935 if value_mask != None:4936 self.value_mask = value_mask4937 else:4938 self.value_mask = 04939 return4940 def pack(self):4941 packed = []4942 packed.append(struct.pack("!L", self.type_len))4943 packed.append(struct.pack("!H", self.value))4944 packed.append(struct.pack("!H", self.value_mask))4945 return ''.join(packed)4946 @staticmethod4947 def unpack(reader):4948 obj = udp_dst_masked()4949 _type_len = reader.read("!L")[0]4950 assert(_type_len == 2147492100)4951 obj.value = reader.read("!H")[0]4952 obj.value_mask = reader.read("!H")[0]4953 return obj4954 def __eq__(self, other):4955 if type(self) != type(other): return False4956 if self.value != other.value: return False4957 if self.value_mask != other.value_mask: return False4958 return True4959 def pretty_print(self, q):4960 q.text("udp_dst_masked {")4961 with q.group():4962 with q.indent(2):4963 q.breakable()4964 q.text("value = ");4965 q.text("%#x" % self.value)4966 q.text(","); q.breakable()4967 q.text("value_mask = ");4968 q.text("%#x" % self.value_mask)4969 q.breakable()4970 q.text('}')4971oxm.subtypes[2147492100] = udp_dst_masked4972class udp_src(oxm):4973 type_len = 21474913304974 def __init__(self, value=None):4975 if value != None:4976 self.value = value4977 else:4978 self.value = 04979 return4980 def pack(self):4981 packed = []4982 packed.append(struct.pack("!L", self.type_len))4983 packed.append(struct.pack("!H", self.value))4984 return ''.join(packed)4985 @staticmethod4986 def unpack(reader):4987 obj = udp_src()4988 _type_len = reader.read("!L")[0]4989 assert(_type_len == 2147491330)4990 obj.value = reader.read("!H")[0]4991 return obj4992 def __eq__(self, other):4993 if type(self) != type(other): return False4994 if self.value != other.value: return False4995 return True4996 def pretty_print(self, q):4997 q.text("udp_src {")4998 with q.group():4999 with q.indent(2):5000 q.breakable()5001 q.text("value = ");5002 q.text("%#x" % self.value)5003 q.breakable()5004 q.text('}')5005oxm.subtypes[2147491330] = udp_src5006class udp_src_masked(oxm):5007 type_len = 21474915885008 def __init__(self, value=None, value_mask=None):5009 if value != None:5010 self.value = value5011 else:5012 self.value = 05013 if value_mask != None:5014 self.value_mask = value_mask5015 else:5016 self.value_mask = 05017 return5018 def pack(self):5019 packed = []5020 packed.append(struct.pack("!L", self.type_len))5021 packed.append(struct.pack("!H", self.value))5022 packed.append(struct.pack("!H", self.value_mask))5023 return ''.join(packed)5024 @staticmethod5025 def unpack(reader):5026 obj = udp_src_masked()5027 _type_len = reader.read("!L")[0]5028 assert(_type_len == 2147491588)5029 obj.value = reader.read("!H")[0]5030 obj.value_mask = reader.read("!H")[0]5031 return obj5032 def __eq__(self, other):5033 if type(self) != type(other): return False5034 if self.value != other.value: return False5035 if self.value_mask != other.value_mask: return False5036 return True5037 def pretty_print(self, q):5038 q.text("udp_src_masked {")5039 with q.group():5040 with q.indent(2):5041 q.breakable()5042 q.text("value = ");5043 q.text("%#x" % self.value)5044 q.text(","); q.breakable()5045 q.text("value_mask = ");5046 q.text("%#x" % self.value_mask)5047 q.breakable()5048 q.text('}')5049oxm.subtypes[2147491588] = udp_src_masked5050class vlan_pcp(oxm):5051 type_len = 21474872335052 def __init__(self, value=None):5053 if value != None:5054 self.value = value5055 else:5056 self.value = 05057 return5058 def pack(self):5059 packed = []5060 packed.append(struct.pack("!L", self.type_len))5061 packed.append(struct.pack("!B", self.value))5062 return ''.join(packed)5063 @staticmethod5064 def unpack(reader):5065 obj = vlan_pcp()5066 _type_len = reader.read("!L")[0]5067 assert(_type_len == 2147487233)5068 obj.value = reader.read("!B")[0]5069 return obj5070 def __eq__(self, other):5071 if type(self) != type(other): return False5072 if self.value != other.value: return False5073 return True5074 def pretty_print(self, q):5075 q.text("vlan_pcp {")5076 with q.group():5077 with q.indent(2):5078 q.breakable()5079 q.text("value = ");5080 q.text("%#x" % self.value)5081 q.breakable()5082 q.text('}')5083oxm.subtypes[2147487233] = vlan_pcp5084class vlan_pcp_masked(oxm):5085 type_len = 21474874905086 def __init__(self, value=None, value_mask=None):5087 if value != None:5088 self.value = value5089 else:5090 self.value = 05091 if value_mask != None:5092 self.value_mask = value_mask5093 else:5094 self.value_mask = 05095 return5096 def pack(self):5097 packed = []5098 packed.append(struct.pack("!L", self.type_len))5099 packed.append(struct.pack("!B", self.value))5100 packed.append(struct.pack("!B", self.value_mask))5101 return ''.join(packed)5102 @staticmethod5103 def unpack(reader):5104 obj = vlan_pcp_masked()5105 _type_len = reader.read("!L")[0]5106 assert(_type_len == 2147487490)5107 obj.value = reader.read("!B")[0]5108 obj.value_mask = reader.read("!B")[0]5109 return obj5110 def __eq__(self, other):5111 if type(self) != type(other): return False5112 if self.value != other.value: return False5113 if self.value_mask != other.value_mask: return False5114 return True5115 def pretty_print(self, q):5116 q.text("vlan_pcp_masked {")5117 with q.group():5118 with q.indent(2):5119 q.breakable()5120 q.text("value = ");5121 q.text("%#x" % self.value)5122 q.text(","); q.breakable()5123 q.text("value_mask = ");5124 q.text("%#x" % self.value_mask)5125 q.breakable()5126 q.text('}')5127oxm.subtypes[2147487490] = vlan_pcp_masked5128class vlan_vid(oxm):5129 type_len = 21474867225130 def __init__(self, value=None):5131 if value != None:5132 self.value = value5133 else:5134 self.value = 05135 return5136 def pack(self):5137 packed = []5138 packed.append(struct.pack("!L", self.type_len))5139 packed.append(struct.pack("!H", self.value))5140 return ''.join(packed)5141 @staticmethod5142 def unpack(reader):5143 obj = vlan_vid()5144 _type_len = reader.read("!L")[0]5145 assert(_type_len == 2147486722)5146 obj.value = reader.read("!H")[0]5147 return obj5148 def __eq__(self, other):5149 if type(self) != type(other): return False5150 if self.value != other.value: return False5151 return True5152 def pretty_print(self, q):5153 q.text("vlan_vid {")5154 with q.group():5155 with q.indent(2):5156 q.breakable()5157 q.text("value = ");5158 q.text("%#x" % self.value)5159 q.breakable()5160 q.text('}')5161oxm.subtypes[2147486722] = vlan_vid5162class vlan_vid_masked(oxm):5163 type_len = 21474869805164 def __init__(self, value=None, value_mask=None):5165 if value != None:5166 self.value = value5167 else:5168 self.value = 05169 if value_mask != None:5170 self.value_mask = value_mask5171 else:5172 self.value_mask = 05173 return5174 def pack(self):5175 packed = []5176 packed.append(struct.pack("!L", self.type_len))5177 packed.append(struct.pack("!H", self.value))5178 packed.append(struct.pack("!H", self.value_mask))5179 return ''.join(packed)5180 @staticmethod5181 def unpack(reader):5182 obj = vlan_vid_masked()5183 _type_len = reader.read("!L")[0]5184 assert(_type_len == 2147486980)5185 obj.value = reader.read("!H")[0]5186 obj.value_mask = reader.read("!H")[0]5187 return obj5188 def __eq__(self, other):5189 if type(self) != type(other): return False5190 if self.value != other.value: return False5191 if self.value_mask != other.value_mask: return False5192 return True5193 def pretty_print(self, q):5194 q.text("vlan_vid_masked {")5195 with q.group():5196 with q.indent(2):5197 q.breakable()5198 q.text("value = ");5199 q.text("%#x" % self.value)5200 q.text(","); q.breakable()5201 q.text("value_mask = ");5202 q.text("%#x" % self.value_mask)5203 q.breakable()5204 q.text('}')...

Full Screen

Full Screen

common.py

Source:common.py Github

copy

Full Screen

...69 def pretty_print(self, q):70 q.text("bsn_interface {")71 with q.group():72 with q.indent(2):73 q.breakable()74 q.text("hw_addr = ");75 q.text(util.pretty_mac(self.hw_addr))76 q.text(","); q.breakable()77 q.text("name = ");78 q.pp(self.name)79 q.text(","); q.breakable()80 q.text("ipv4_addr = ");81 q.text(util.pretty_ipv4(self.ipv4_addr))82 q.text(","); q.breakable()83 q.text("ipv4_netmask = ");84 q.text(util.pretty_ipv4(self.ipv4_netmask))85 q.breakable()86 q.text('}')87class bsn_vport(loxi.OFObject):88 subtypes = {}89 def __init__(self, type=None):90 if type != None:91 self.type = type92 else:93 self.type = 094 return95 def pack(self):96 packed = []97 packed.append(struct.pack("!H", self.type))98 packed.append(struct.pack("!H", 0)) # placeholder for length at index 199 length = sum([len(x) for x in packed])100 packed[1] = struct.pack("!H", length)101 return ''.join(packed)102 @staticmethod103 def unpack(reader):104 subtype, = reader.peek('!H', 0)105 subclass = bsn_vport.subtypes.get(subtype)106 if subclass:107 return subclass.unpack(reader)108 obj = bsn_vport()109 obj.type = reader.read("!H")[0]110 _length = reader.read("!H")[0]111 orig_reader = reader112 reader = orig_reader.slice(_length, 4)113 return obj114 def __eq__(self, other):115 if type(self) != type(other): return False116 if self.type != other.type: return False117 return True118 def pretty_print(self, q):119 q.text("bsn_vport {")120 with q.group():121 with q.indent(2):122 q.breakable()123 q.breakable()124 q.text('}')125class bsn_vport_l2gre(bsn_vport):126 type = 1127 def __init__(self, flags=None, port_no=None, loopback_port_no=None, local_mac=None, nh_mac=None, src_ip=None, dst_ip=None, dscp=None, ttl=None, vpn=None, rate_limit=None, if_name=None):128 if flags != None:129 self.flags = flags130 else:131 self.flags = 0132 if port_no != None:133 self.port_no = port_no134 else:135 self.port_no = 0136 if loopback_port_no != None:137 self.loopback_port_no = loopback_port_no138 else:139 self.loopback_port_no = 0140 if local_mac != None:141 self.local_mac = local_mac142 else:143 self.local_mac = [0,0,0,0,0,0]144 if nh_mac != None:145 self.nh_mac = nh_mac146 else:147 self.nh_mac = [0,0,0,0,0,0]148 if src_ip != None:149 self.src_ip = src_ip150 else:151 self.src_ip = 0152 if dst_ip != None:153 self.dst_ip = dst_ip154 else:155 self.dst_ip = 0156 if dscp != None:157 self.dscp = dscp158 else:159 self.dscp = 0160 if ttl != None:161 self.ttl = ttl162 else:163 self.ttl = 0164 if vpn != None:165 self.vpn = vpn166 else:167 self.vpn = 0168 if rate_limit != None:169 self.rate_limit = rate_limit170 else:171 self.rate_limit = 0172 if if_name != None:173 self.if_name = if_name174 else:175 self.if_name = ""176 return177 def pack(self):178 packed = []179 packed.append(struct.pack("!H", self.type))180 packed.append(struct.pack("!H", 0)) # placeholder for length at index 1181 packed.append(struct.pack("!L", self.flags))182 packed.append(util.pack_port_no(self.port_no))183 packed.append(util.pack_port_no(self.loopback_port_no))184 packed.append(struct.pack("!6B", *self.local_mac))185 packed.append(struct.pack("!6B", *self.nh_mac))186 packed.append(struct.pack("!L", self.src_ip))187 packed.append(struct.pack("!L", self.dst_ip))188 packed.append(struct.pack("!B", self.dscp))189 packed.append(struct.pack("!B", self.ttl))190 packed.append('\x00' * 2)191 packed.append(struct.pack("!L", self.vpn))192 packed.append(struct.pack("!L", self.rate_limit))193 packed.append(struct.pack("!16s", self.if_name))194 length = sum([len(x) for x in packed])195 packed[1] = struct.pack("!H", length)196 return ''.join(packed)197 @staticmethod198 def unpack(reader):199 obj = bsn_vport_l2gre()200 _type = reader.read("!H")[0]201 assert(_type == 1)202 _length = reader.read("!H")[0]203 orig_reader = reader204 reader = orig_reader.slice(_length, 4)205 obj.flags = reader.read("!L")[0]206 obj.port_no = util.unpack_port_no(reader)207 obj.loopback_port_no = util.unpack_port_no(reader)208 obj.local_mac = list(reader.read('!6B'))209 obj.nh_mac = list(reader.read('!6B'))210 obj.src_ip = reader.read("!L")[0]211 obj.dst_ip = reader.read("!L")[0]212 obj.dscp = reader.read("!B")[0]213 obj.ttl = reader.read("!B")[0]214 reader.skip(2)215 obj.vpn = reader.read("!L")[0]216 obj.rate_limit = reader.read("!L")[0]217 obj.if_name = reader.read("!16s")[0].rstrip("\x00")218 return obj219 def __eq__(self, other):220 if type(self) != type(other): return False221 if self.flags != other.flags: return False222 if self.port_no != other.port_no: return False223 if self.loopback_port_no != other.loopback_port_no: return False224 if self.local_mac != other.local_mac: return False225 if self.nh_mac != other.nh_mac: return False226 if self.src_ip != other.src_ip: return False227 if self.dst_ip != other.dst_ip: return False228 if self.dscp != other.dscp: return False229 if self.ttl != other.ttl: return False230 if self.vpn != other.vpn: return False231 if self.rate_limit != other.rate_limit: return False232 if self.if_name != other.if_name: return False233 return True234 def pretty_print(self, q):235 q.text("bsn_vport_l2gre {")236 with q.group():237 with q.indent(2):238 q.breakable()239 q.text("flags = ");240 q.text("%#x" % self.flags)241 q.text(","); q.breakable()242 q.text("port_no = ");243 q.text(util.pretty_port(self.port_no))244 q.text(","); q.breakable()245 q.text("loopback_port_no = ");246 q.text(util.pretty_port(self.loopback_port_no))247 q.text(","); q.breakable()248 q.text("local_mac = ");249 q.text(util.pretty_mac(self.local_mac))250 q.text(","); q.breakable()251 q.text("nh_mac = ");252 q.text(util.pretty_mac(self.nh_mac))253 q.text(","); q.breakable()254 q.text("src_ip = ");255 q.text(util.pretty_ipv4(self.src_ip))256 q.text(","); q.breakable()257 q.text("dst_ip = ");258 q.text(util.pretty_ipv4(self.dst_ip))259 q.text(","); q.breakable()260 q.text("dscp = ");261 q.text("%#x" % self.dscp)262 q.text(","); q.breakable()263 q.text("ttl = ");264 q.text("%#x" % self.ttl)265 q.text(","); q.breakable()266 q.text("vpn = ");267 q.text("%#x" % self.vpn)268 q.text(","); q.breakable()269 q.text("rate_limit = ");270 q.text("%#x" % self.rate_limit)271 q.text(","); q.breakable()272 q.text("if_name = ");273 q.pp(self.if_name)274 q.breakable()275 q.text('}')276bsn_vport.subtypes[1] = bsn_vport_l2gre277class bsn_vport_q_in_q(bsn_vport):278 type = 0279 def __init__(self, port_no=None, ingress_tpid=None, ingress_vlan_id=None, egress_tpid=None, egress_vlan_id=None, if_name=None):280 if port_no != None:281 self.port_no = port_no282 else:283 self.port_no = 0284 if ingress_tpid != None:285 self.ingress_tpid = ingress_tpid286 else:287 self.ingress_tpid = 0288 if ingress_vlan_id != None:289 self.ingress_vlan_id = ingress_vlan_id290 else:291 self.ingress_vlan_id = 0292 if egress_tpid != None:293 self.egress_tpid = egress_tpid294 else:295 self.egress_tpid = 0296 if egress_vlan_id != None:297 self.egress_vlan_id = egress_vlan_id298 else:299 self.egress_vlan_id = 0300 if if_name != None:301 self.if_name = if_name302 else:303 self.if_name = ""304 return305 def pack(self):306 packed = []307 packed.append(struct.pack("!H", self.type))308 packed.append(struct.pack("!H", 0)) # placeholder for length at index 1309 packed.append(struct.pack("!L", self.port_no))310 packed.append(struct.pack("!H", self.ingress_tpid))311 packed.append(struct.pack("!H", self.ingress_vlan_id))312 packed.append(struct.pack("!H", self.egress_tpid))313 packed.append(struct.pack("!H", self.egress_vlan_id))314 packed.append(struct.pack("!16s", self.if_name))315 length = sum([len(x) for x in packed])316 packed[1] = struct.pack("!H", length)317 return ''.join(packed)318 @staticmethod319 def unpack(reader):320 obj = bsn_vport_q_in_q()321 _type = reader.read("!H")[0]322 assert(_type == 0)323 _length = reader.read("!H")[0]324 orig_reader = reader325 reader = orig_reader.slice(_length, 4)326 obj.port_no = reader.read("!L")[0]327 obj.ingress_tpid = reader.read("!H")[0]328 obj.ingress_vlan_id = reader.read("!H")[0]329 obj.egress_tpid = reader.read("!H")[0]330 obj.egress_vlan_id = reader.read("!H")[0]331 obj.if_name = reader.read("!16s")[0].rstrip("\x00")332 return obj333 def __eq__(self, other):334 if type(self) != type(other): return False335 if self.port_no != other.port_no: return False336 if self.ingress_tpid != other.ingress_tpid: return False337 if self.ingress_vlan_id != other.ingress_vlan_id: return False338 if self.egress_tpid != other.egress_tpid: return False339 if self.egress_vlan_id != other.egress_vlan_id: return False340 if self.if_name != other.if_name: return False341 return True342 def pretty_print(self, q):343 q.text("bsn_vport_q_in_q {")344 with q.group():345 with q.indent(2):346 q.breakable()347 q.text("port_no = ");348 q.text("%#x" % self.port_no)349 q.text(","); q.breakable()350 q.text("ingress_tpid = ");351 q.text("%#x" % self.ingress_tpid)352 q.text(","); q.breakable()353 q.text("ingress_vlan_id = ");354 q.text("%#x" % self.ingress_vlan_id)355 q.text(","); q.breakable()356 q.text("egress_tpid = ");357 q.text("%#x" % self.egress_tpid)358 q.text(","); q.breakable()359 q.text("egress_vlan_id = ");360 q.text("%#x" % self.egress_vlan_id)361 q.text(","); q.breakable()362 q.text("if_name = ");363 q.pp(self.if_name)364 q.breakable()365 q.text('}')366bsn_vport.subtypes[0] = bsn_vport_q_in_q367class flow_stats_entry(loxi.OFObject):368 def __init__(self, table_id=None, match=None, duration_sec=None, duration_nsec=None, priority=None, idle_timeout=None, hard_timeout=None, cookie=None, packet_count=None, byte_count=None, actions=None):369 if table_id != None:370 self.table_id = table_id371 else:372 self.table_id = 0373 if match != None:374 self.match = match375 else:376 self.match = ofp.match()377 if duration_sec != None:378 self.duration_sec = duration_sec379 else:380 self.duration_sec = 0381 if duration_nsec != None:382 self.duration_nsec = duration_nsec383 else:384 self.duration_nsec = 0385 if priority != None:386 self.priority = priority387 else:388 self.priority = 0389 if idle_timeout != None:390 self.idle_timeout = idle_timeout391 else:392 self.idle_timeout = 0393 if hard_timeout != None:394 self.hard_timeout = hard_timeout395 else:396 self.hard_timeout = 0397 if cookie != None:398 self.cookie = cookie399 else:400 self.cookie = 0401 if packet_count != None:402 self.packet_count = packet_count403 else:404 self.packet_count = 0405 if byte_count != None:406 self.byte_count = byte_count407 else:408 self.byte_count = 0409 if actions != None:410 self.actions = actions411 else:412 self.actions = []413 return414 def pack(self):415 packed = []416 packed.append(struct.pack("!H", 0)) # placeholder for length at index 0417 packed.append(struct.pack("!B", self.table_id))418 packed.append('\x00' * 1)419 packed.append(self.match.pack())420 packed.append(struct.pack("!L", self.duration_sec))421 packed.append(struct.pack("!L", self.duration_nsec))422 packed.append(struct.pack("!H", self.priority))423 packed.append(struct.pack("!H", self.idle_timeout))424 packed.append(struct.pack("!H", self.hard_timeout))425 packed.append('\x00' * 6)426 packed.append(struct.pack("!Q", self.cookie))427 packed.append(struct.pack("!Q", self.packet_count))428 packed.append(struct.pack("!Q", self.byte_count))429 packed.append(loxi.generic_util.pack_list(self.actions))430 length = sum([len(x) for x in packed])431 packed[0] = struct.pack("!H", length)432 return ''.join(packed)433 @staticmethod434 def unpack(reader):435 obj = flow_stats_entry()436 _length = reader.read("!H")[0]437 orig_reader = reader438 reader = orig_reader.slice(_length, 2)439 obj.table_id = reader.read("!B")[0]440 reader.skip(1)441 obj.match = ofp.match.unpack(reader)442 obj.duration_sec = reader.read("!L")[0]443 obj.duration_nsec = reader.read("!L")[0]444 obj.priority = reader.read("!H")[0]445 obj.idle_timeout = reader.read("!H")[0]446 obj.hard_timeout = reader.read("!H")[0]447 reader.skip(6)448 obj.cookie = reader.read("!Q")[0]449 obj.packet_count = reader.read("!Q")[0]450 obj.byte_count = reader.read("!Q")[0]451 obj.actions = loxi.generic_util.unpack_list(reader, ofp.action.action.unpack)452 return obj453 def __eq__(self, other):454 if type(self) != type(other): return False455 if self.table_id != other.table_id: return False456 if self.match != other.match: return False457 if self.duration_sec != other.duration_sec: return False458 if self.duration_nsec != other.duration_nsec: return False459 if self.priority != other.priority: return False460 if self.idle_timeout != other.idle_timeout: return False461 if self.hard_timeout != other.hard_timeout: return False462 if self.cookie != other.cookie: return False463 if self.packet_count != other.packet_count: return False464 if self.byte_count != other.byte_count: return False465 if self.actions != other.actions: return False466 return True467 def pretty_print(self, q):468 q.text("flow_stats_entry {")469 with q.group():470 with q.indent(2):471 q.breakable()472 q.text("table_id = ");473 q.text("%#x" % self.table_id)474 q.text(","); q.breakable()475 q.text("match = ");476 q.pp(self.match)477 q.text(","); q.breakable()478 q.text("duration_sec = ");479 q.text("%#x" % self.duration_sec)480 q.text(","); q.breakable()481 q.text("duration_nsec = ");482 q.text("%#x" % self.duration_nsec)483 q.text(","); q.breakable()484 q.text("priority = ");485 q.text("%#x" % self.priority)486 q.text(","); q.breakable()487 q.text("idle_timeout = ");488 q.text("%#x" % self.idle_timeout)489 q.text(","); q.breakable()490 q.text("hard_timeout = ");491 q.text("%#x" % self.hard_timeout)492 q.text(","); q.breakable()493 q.text("cookie = ");494 q.text("%#x" % self.cookie)495 q.text(","); q.breakable()496 q.text("packet_count = ");497 q.text("%#x" % self.packet_count)498 q.text(","); q.breakable()499 q.text("byte_count = ");500 q.text("%#x" % self.byte_count)501 q.text(","); q.breakable()502 q.text("actions = ");503 q.pp(self.actions)504 q.breakable()505 q.text('}')506class match_v1(loxi.OFObject):507 def __init__(self, wildcards=None, in_port=None, eth_src=None, eth_dst=None, vlan_vid=None, vlan_pcp=None, eth_type=None, ip_dscp=None, ip_proto=None, ipv4_src=None, ipv4_dst=None, tcp_src=None, tcp_dst=None):508 if wildcards != None:509 self.wildcards = wildcards510 else:511 self.wildcards = util.init_wc_bmap()512 if in_port != None:513 self.in_port = in_port514 else:515 self.in_port = 0516 if eth_src != None:517 self.eth_src = eth_src518 else:519 self.eth_src = [0,0,0,0,0,0]520 if eth_dst != None:521 self.eth_dst = eth_dst522 else:523 self.eth_dst = [0,0,0,0,0,0]524 if vlan_vid != None:525 self.vlan_vid = vlan_vid526 else:527 self.vlan_vid = 0528 if vlan_pcp != None:529 self.vlan_pcp = vlan_pcp530 else:531 self.vlan_pcp = 0532 if eth_type != None:533 self.eth_type = eth_type534 else:535 self.eth_type = 0536 if ip_dscp != None:537 self.ip_dscp = ip_dscp538 else:539 self.ip_dscp = 0540 if ip_proto != None:541 self.ip_proto = ip_proto542 else:543 self.ip_proto = 0544 if ipv4_src != None:545 self.ipv4_src = ipv4_src546 else:547 self.ipv4_src = 0548 if ipv4_dst != None:549 self.ipv4_dst = ipv4_dst550 else:551 self.ipv4_dst = 0552 if tcp_src != None:553 self.tcp_src = tcp_src554 else:555 self.tcp_src = 0556 if tcp_dst != None:557 self.tcp_dst = tcp_dst558 else:559 self.tcp_dst = 0560 return561 def pack(self):562 packed = []563 packed.append(util.pack_wc_bmap(self.wildcards))564 packed.append(util.pack_port_no(self.in_port))565 packed.append(struct.pack("!6B", *self.eth_src))566 packed.append(struct.pack("!6B", *self.eth_dst))567 packed.append(struct.pack("!H", self.vlan_vid))568 packed.append(struct.pack("!B", self.vlan_pcp))569 packed.append('\x00' * 1)570 packed.append(struct.pack("!H", self.eth_type))571 packed.append(struct.pack("!B", self.ip_dscp))572 packed.append(struct.pack("!B", self.ip_proto))573 packed.append('\x00' * 2)574 packed.append(struct.pack("!L", self.ipv4_src))575 packed.append(struct.pack("!L", self.ipv4_dst))576 packed.append(struct.pack("!H", self.tcp_src))577 packed.append(struct.pack("!H", self.tcp_dst))578 return ''.join(packed)579 @staticmethod580 def unpack(reader):581 obj = match_v1()582 obj.wildcards = util.unpack_wc_bmap(reader)583 obj.in_port = util.unpack_port_no(reader)584 obj.eth_src = list(reader.read('!6B'))585 obj.eth_dst = list(reader.read('!6B'))586 obj.vlan_vid = reader.read("!H")[0]587 obj.vlan_pcp = reader.read("!B")[0]588 reader.skip(1)589 obj.eth_type = reader.read("!H")[0]590 obj.ip_dscp = reader.read("!B")[0]591 obj.ip_proto = reader.read("!B")[0]592 reader.skip(2)593 obj.ipv4_src = reader.read("!L")[0]594 obj.ipv4_dst = reader.read("!L")[0]595 obj.tcp_src = reader.read("!H")[0]596 obj.tcp_dst = reader.read("!H")[0]597 return obj598 def __eq__(self, other):599 if type(self) != type(other): return False600 if self.wildcards != other.wildcards: return False601 if self.in_port != other.in_port: return False602 if self.eth_src != other.eth_src: return False603 if self.eth_dst != other.eth_dst: return False604 if self.vlan_vid != other.vlan_vid: return False605 if self.vlan_pcp != other.vlan_pcp: return False606 if self.eth_type != other.eth_type: return False607 if self.ip_dscp != other.ip_dscp: return False608 if self.ip_proto != other.ip_proto: return False609 if self.ipv4_src != other.ipv4_src: return False610 if self.ipv4_dst != other.ipv4_dst: return False611 if self.tcp_src != other.tcp_src: return False612 if self.tcp_dst != other.tcp_dst: return False613 return True614 def pretty_print(self, q):615 q.text("match_v1 {")616 with q.group():617 with q.indent(2):618 q.breakable()619 q.text("wildcards = ");620 q.text(util.pretty_wildcards(self.wildcards))621 q.text(","); q.breakable()622 q.text("in_port = ");623 q.text(util.pretty_port(self.in_port))624 q.text(","); q.breakable()625 q.text("eth_src = ");626 q.text(util.pretty_mac(self.eth_src))627 q.text(","); q.breakable()628 q.text("eth_dst = ");629 q.text(util.pretty_mac(self.eth_dst))630 q.text(","); q.breakable()631 q.text("vlan_vid = ");632 q.text("%#x" % self.vlan_vid)633 q.text(","); q.breakable()634 q.text("vlan_pcp = ");635 q.text("%#x" % self.vlan_pcp)636 q.text(","); q.breakable()637 q.text("eth_type = ");638 q.text("%#x" % self.eth_type)639 q.text(","); q.breakable()640 q.text("ip_dscp = ");641 q.text("%#x" % self.ip_dscp)642 q.text(","); q.breakable()643 q.text("ip_proto = ");644 q.text("%#x" % self.ip_proto)645 q.text(","); q.breakable()646 q.text("ipv4_src = ");647 q.text(util.pretty_ipv4(self.ipv4_src))648 q.text(","); q.breakable()649 q.text("ipv4_dst = ");650 q.text(util.pretty_ipv4(self.ipv4_dst))651 q.text(","); q.breakable()652 q.text("tcp_src = ");653 q.text("%#x" % self.tcp_src)654 q.text(","); q.breakable()655 q.text("tcp_dst = ");656 q.text("%#x" % self.tcp_dst)657 q.breakable()658 q.text('}')659class packet_queue(loxi.OFObject):660 def __init__(self, queue_id=None, properties=None):661 if queue_id != None:662 self.queue_id = queue_id663 else:664 self.queue_id = 0665 if properties != None:666 self.properties = properties667 else:668 self.properties = []669 return670 def pack(self):671 packed = []672 packed.append(struct.pack("!L", self.queue_id))673 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1674 packed.append('\x00' * 2)675 packed.append(loxi.generic_util.pack_list(self.properties))676 length = sum([len(x) for x in packed])677 packed[1] = struct.pack("!H", length)678 return ''.join(packed)679 @staticmethod680 def unpack(reader):681 obj = packet_queue()682 obj.queue_id = reader.read("!L")[0]683 _len = reader.read("!H")[0]684 orig_reader = reader685 reader = orig_reader.slice(_len, 6)686 reader.skip(2)687 obj.properties = loxi.generic_util.unpack_list(reader, ofp.common.queue_prop.unpack)688 return obj689 def __eq__(self, other):690 if type(self) != type(other): return False691 if self.queue_id != other.queue_id: return False692 if self.properties != other.properties: return False693 return True694 def pretty_print(self, q):695 q.text("packet_queue {")696 with q.group():697 with q.indent(2):698 q.breakable()699 q.text("queue_id = ");700 q.text("%#x" % self.queue_id)701 q.text(","); q.breakable()702 q.text("properties = ");703 q.pp(self.properties)704 q.breakable()705 q.text('}')706class port_desc(loxi.OFObject):707 def __init__(self, port_no=None, hw_addr=None, name=None, config=None, state=None, curr=None, advertised=None, supported=None, peer=None):708 if port_no != None:709 self.port_no = port_no710 else:711 self.port_no = 0712 if hw_addr != None:713 self.hw_addr = hw_addr714 else:715 self.hw_addr = [0,0,0,0,0,0]716 if name != None:717 self.name = name718 else:719 self.name = ""720 if config != None:721 self.config = config722 else:723 self.config = 0724 if state != None:725 self.state = state726 else:727 self.state = 0728 if curr != None:729 self.curr = curr730 else:731 self.curr = 0732 if advertised != None:733 self.advertised = advertised734 else:735 self.advertised = 0736 if supported != None:737 self.supported = supported738 else:739 self.supported = 0740 if peer != None:741 self.peer = peer742 else:743 self.peer = 0744 return745 def pack(self):746 packed = []747 packed.append(util.pack_port_no(self.port_no))748 packed.append(struct.pack("!6B", *self.hw_addr))749 packed.append(struct.pack("!16s", self.name))750 packed.append(struct.pack("!L", self.config))751 packed.append(struct.pack("!L", self.state))752 packed.append(struct.pack("!L", self.curr))753 packed.append(struct.pack("!L", self.advertised))754 packed.append(struct.pack("!L", self.supported))755 packed.append(struct.pack("!L", self.peer))756 return ''.join(packed)757 @staticmethod758 def unpack(reader):759 obj = port_desc()760 obj.port_no = util.unpack_port_no(reader)761 obj.hw_addr = list(reader.read('!6B'))762 obj.name = reader.read("!16s")[0].rstrip("\x00")763 obj.config = reader.read("!L")[0]764 obj.state = reader.read("!L")[0]765 obj.curr = reader.read("!L")[0]766 obj.advertised = reader.read("!L")[0]767 obj.supported = reader.read("!L")[0]768 obj.peer = reader.read("!L")[0]769 return obj770 def __eq__(self, other):771 if type(self) != type(other): return False772 if self.port_no != other.port_no: return False773 if self.hw_addr != other.hw_addr: return False774 if self.name != other.name: return False775 if self.config != other.config: return False776 if self.state != other.state: return False777 if self.curr != other.curr: return False778 if self.advertised != other.advertised: return False779 if self.supported != other.supported: return False780 if self.peer != other.peer: return False781 return True782 def pretty_print(self, q):783 q.text("port_desc {")784 with q.group():785 with q.indent(2):786 q.breakable()787 q.text("port_no = ");788 q.text(util.pretty_port(self.port_no))789 q.text(","); q.breakable()790 q.text("hw_addr = ");791 q.text(util.pretty_mac(self.hw_addr))792 q.text(","); q.breakable()793 q.text("name = ");794 q.pp(self.name)795 q.text(","); q.breakable()796 q.text("config = ");797 q.text("%#x" % self.config)798 q.text(","); q.breakable()799 q.text("state = ");800 q.text("%#x" % self.state)801 q.text(","); q.breakable()802 q.text("curr = ");803 q.text("%#x" % self.curr)804 q.text(","); q.breakable()805 q.text("advertised = ");806 q.text("%#x" % self.advertised)807 q.text(","); q.breakable()808 q.text("supported = ");809 q.text("%#x" % self.supported)810 q.text(","); q.breakable()811 q.text("peer = ");812 q.text("%#x" % self.peer)813 q.breakable()814 q.text('}')815class port_stats_entry(loxi.OFObject):816 def __init__(self, port_no=None, rx_packets=None, tx_packets=None, rx_bytes=None, tx_bytes=None, rx_dropped=None, tx_dropped=None, rx_errors=None, tx_errors=None, rx_frame_err=None, rx_over_err=None, rx_crc_err=None, collisions=None):817 if port_no != None:818 self.port_no = port_no819 else:820 self.port_no = 0821 if rx_packets != None:822 self.rx_packets = rx_packets823 else:824 self.rx_packets = 0825 if tx_packets != None:826 self.tx_packets = tx_packets827 else:828 self.tx_packets = 0829 if rx_bytes != None:830 self.rx_bytes = rx_bytes831 else:832 self.rx_bytes = 0833 if tx_bytes != None:834 self.tx_bytes = tx_bytes835 else:836 self.tx_bytes = 0837 if rx_dropped != None:838 self.rx_dropped = rx_dropped839 else:840 self.rx_dropped = 0841 if tx_dropped != None:842 self.tx_dropped = tx_dropped843 else:844 self.tx_dropped = 0845 if rx_errors != None:846 self.rx_errors = rx_errors847 else:848 self.rx_errors = 0849 if tx_errors != None:850 self.tx_errors = tx_errors851 else:852 self.tx_errors = 0853 if rx_frame_err != None:854 self.rx_frame_err = rx_frame_err855 else:856 self.rx_frame_err = 0857 if rx_over_err != None:858 self.rx_over_err = rx_over_err859 else:860 self.rx_over_err = 0861 if rx_crc_err != None:862 self.rx_crc_err = rx_crc_err863 else:864 self.rx_crc_err = 0865 if collisions != None:866 self.collisions = collisions867 else:868 self.collisions = 0869 return870 def pack(self):871 packed = []872 packed.append(util.pack_port_no(self.port_no))873 packed.append('\x00' * 6)874 packed.append(struct.pack("!Q", self.rx_packets))875 packed.append(struct.pack("!Q", self.tx_packets))876 packed.append(struct.pack("!Q", self.rx_bytes))877 packed.append(struct.pack("!Q", self.tx_bytes))878 packed.append(struct.pack("!Q", self.rx_dropped))879 packed.append(struct.pack("!Q", self.tx_dropped))880 packed.append(struct.pack("!Q", self.rx_errors))881 packed.append(struct.pack("!Q", self.tx_errors))882 packed.append(struct.pack("!Q", self.rx_frame_err))883 packed.append(struct.pack("!Q", self.rx_over_err))884 packed.append(struct.pack("!Q", self.rx_crc_err))885 packed.append(struct.pack("!Q", self.collisions))886 return ''.join(packed)887 @staticmethod888 def unpack(reader):889 obj = port_stats_entry()890 obj.port_no = util.unpack_port_no(reader)891 reader.skip(6)892 obj.rx_packets = reader.read("!Q")[0]893 obj.tx_packets = reader.read("!Q")[0]894 obj.rx_bytes = reader.read("!Q")[0]895 obj.tx_bytes = reader.read("!Q")[0]896 obj.rx_dropped = reader.read("!Q")[0]897 obj.tx_dropped = reader.read("!Q")[0]898 obj.rx_errors = reader.read("!Q")[0]899 obj.tx_errors = reader.read("!Q")[0]900 obj.rx_frame_err = reader.read("!Q")[0]901 obj.rx_over_err = reader.read("!Q")[0]902 obj.rx_crc_err = reader.read("!Q")[0]903 obj.collisions = reader.read("!Q")[0]904 return obj905 def __eq__(self, other):906 if type(self) != type(other): return False907 if self.port_no != other.port_no: return False908 if self.rx_packets != other.rx_packets: return False909 if self.tx_packets != other.tx_packets: return False910 if self.rx_bytes != other.rx_bytes: return False911 if self.tx_bytes != other.tx_bytes: return False912 if self.rx_dropped != other.rx_dropped: return False913 if self.tx_dropped != other.tx_dropped: return False914 if self.rx_errors != other.rx_errors: return False915 if self.tx_errors != other.tx_errors: return False916 if self.rx_frame_err != other.rx_frame_err: return False917 if self.rx_over_err != other.rx_over_err: return False918 if self.rx_crc_err != other.rx_crc_err: return False919 if self.collisions != other.collisions: return False920 return True921 def pretty_print(self, q):922 q.text("port_stats_entry {")923 with q.group():924 with q.indent(2):925 q.breakable()926 q.text("port_no = ");927 q.text(util.pretty_port(self.port_no))928 q.text(","); q.breakable()929 q.text("rx_packets = ");930 q.text("%#x" % self.rx_packets)931 q.text(","); q.breakable()932 q.text("tx_packets = ");933 q.text("%#x" % self.tx_packets)934 q.text(","); q.breakable()935 q.text("rx_bytes = ");936 q.text("%#x" % self.rx_bytes)937 q.text(","); q.breakable()938 q.text("tx_bytes = ");939 q.text("%#x" % self.tx_bytes)940 q.text(","); q.breakable()941 q.text("rx_dropped = ");942 q.text("%#x" % self.rx_dropped)943 q.text(","); q.breakable()944 q.text("tx_dropped = ");945 q.text("%#x" % self.tx_dropped)946 q.text(","); q.breakable()947 q.text("rx_errors = ");948 q.text("%#x" % self.rx_errors)949 q.text(","); q.breakable()950 q.text("tx_errors = ");951 q.text("%#x" % self.tx_errors)952 q.text(","); q.breakable()953 q.text("rx_frame_err = ");954 q.text("%#x" % self.rx_frame_err)955 q.text(","); q.breakable()956 q.text("rx_over_err = ");957 q.text("%#x" % self.rx_over_err)958 q.text(","); q.breakable()959 q.text("rx_crc_err = ");960 q.text("%#x" % self.rx_crc_err)961 q.text(","); q.breakable()962 q.text("collisions = ");963 q.text("%#x" % self.collisions)964 q.breakable()965 q.text('}')966class queue_prop(loxi.OFObject):967 subtypes = {}968 def __init__(self, type=None):969 if type != None:970 self.type = type971 else:972 self.type = 0973 return974 def pack(self):975 packed = []976 packed.append(struct.pack("!H", self.type))977 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1978 packed.append('\x00' * 4)979 length = sum([len(x) for x in packed])980 packed[1] = struct.pack("!H", length)981 return ''.join(packed)982 @staticmethod983 def unpack(reader):984 subtype, = reader.peek('!H', 0)985 subclass = queue_prop.subtypes.get(subtype)986 if subclass:987 return subclass.unpack(reader)988 obj = queue_prop()989 obj.type = reader.read("!H")[0]990 _len = reader.read("!H")[0]991 orig_reader = reader992 reader = orig_reader.slice(_len, 4)993 reader.skip(4)994 return obj995 def __eq__(self, other):996 if type(self) != type(other): return False997 if self.type != other.type: return False998 return True999 def pretty_print(self, q):1000 q.text("queue_prop {")1001 with q.group():1002 with q.indent(2):1003 q.breakable()1004 q.breakable()1005 q.text('}')1006class queue_prop_min_rate(queue_prop):1007 type = 11008 def __init__(self, rate=None):1009 if rate != None:1010 self.rate = rate1011 else:1012 self.rate = 01013 return1014 def pack(self):1015 packed = []1016 packed.append(struct.pack("!H", self.type))1017 packed.append(struct.pack("!H", 0)) # placeholder for len at index 11018 packed.append('\x00' * 4)1019 packed.append(struct.pack("!H", self.rate))1020 packed.append('\x00' * 6)1021 length = sum([len(x) for x in packed])1022 packed[1] = struct.pack("!H", length)1023 return ''.join(packed)1024 @staticmethod1025 def unpack(reader):1026 obj = queue_prop_min_rate()1027 _type = reader.read("!H")[0]1028 assert(_type == 1)1029 _len = reader.read("!H")[0]1030 orig_reader = reader1031 reader = orig_reader.slice(_len, 4)1032 reader.skip(4)1033 obj.rate = reader.read("!H")[0]1034 reader.skip(6)1035 return obj1036 def __eq__(self, other):1037 if type(self) != type(other): return False1038 if self.rate != other.rate: return False1039 return True1040 def pretty_print(self, q):1041 q.text("queue_prop_min_rate {")1042 with q.group():1043 with q.indent(2):1044 q.breakable()1045 q.text("rate = ");1046 q.text("%#x" % self.rate)1047 q.breakable()1048 q.text('}')1049queue_prop.subtypes[1] = queue_prop_min_rate1050class queue_stats_entry(loxi.OFObject):1051 def __init__(self, port_no=None, queue_id=None, tx_bytes=None, tx_packets=None, tx_errors=None):1052 if port_no != None:1053 self.port_no = port_no1054 else:1055 self.port_no = 01056 if queue_id != None:1057 self.queue_id = queue_id1058 else:1059 self.queue_id = 01060 if tx_bytes != None:1061 self.tx_bytes = tx_bytes1062 else:1063 self.tx_bytes = 01064 if tx_packets != None:1065 self.tx_packets = tx_packets1066 else:1067 self.tx_packets = 01068 if tx_errors != None:1069 self.tx_errors = tx_errors1070 else:1071 self.tx_errors = 01072 return1073 def pack(self):1074 packed = []1075 packed.append(util.pack_port_no(self.port_no))1076 packed.append('\x00' * 2)1077 packed.append(struct.pack("!L", self.queue_id))1078 packed.append(struct.pack("!Q", self.tx_bytes))1079 packed.append(struct.pack("!Q", self.tx_packets))1080 packed.append(struct.pack("!Q", self.tx_errors))1081 return ''.join(packed)1082 @staticmethod1083 def unpack(reader):1084 obj = queue_stats_entry()1085 obj.port_no = util.unpack_port_no(reader)1086 reader.skip(2)1087 obj.queue_id = reader.read("!L")[0]1088 obj.tx_bytes = reader.read("!Q")[0]1089 obj.tx_packets = reader.read("!Q")[0]1090 obj.tx_errors = reader.read("!Q")[0]1091 return obj1092 def __eq__(self, other):1093 if type(self) != type(other): return False1094 if self.port_no != other.port_no: return False1095 if self.queue_id != other.queue_id: return False1096 if self.tx_bytes != other.tx_bytes: return False1097 if self.tx_packets != other.tx_packets: return False1098 if self.tx_errors != other.tx_errors: return False1099 return True1100 def pretty_print(self, q):1101 q.text("queue_stats_entry {")1102 with q.group():1103 with q.indent(2):1104 q.breakable()1105 q.text("port_no = ");1106 q.text(util.pretty_port(self.port_no))1107 q.text(","); q.breakable()1108 q.text("queue_id = ");1109 q.text("%#x" % self.queue_id)1110 q.text(","); q.breakable()1111 q.text("tx_bytes = ");1112 q.text("%#x" % self.tx_bytes)1113 q.text(","); q.breakable()1114 q.text("tx_packets = ");1115 q.text("%#x" % self.tx_packets)1116 q.text(","); q.breakable()1117 q.text("tx_errors = ");1118 q.text("%#x" % self.tx_errors)1119 q.breakable()1120 q.text('}')1121class table_stats_entry(loxi.OFObject):1122 def __init__(self, table_id=None, name=None, wildcards=None, max_entries=None, active_count=None, lookup_count=None, matched_count=None):1123 if table_id != None:1124 self.table_id = table_id1125 else:1126 self.table_id = 01127 if name != None:1128 self.name = name1129 else:1130 self.name = ""1131 if wildcards != None:1132 self.wildcards = wildcards1133 else:1134 self.wildcards = util.init_wc_bmap()1135 if max_entries != None:1136 self.max_entries = max_entries1137 else:1138 self.max_entries = 01139 if active_count != None:1140 self.active_count = active_count1141 else:1142 self.active_count = 01143 if lookup_count != None:1144 self.lookup_count = lookup_count1145 else:1146 self.lookup_count = 01147 if matched_count != None:1148 self.matched_count = matched_count1149 else:1150 self.matched_count = 01151 return1152 def pack(self):1153 packed = []1154 packed.append(struct.pack("!B", self.table_id))1155 packed.append('\x00' * 3)1156 packed.append(struct.pack("!32s", self.name))1157 packed.append(util.pack_wc_bmap(self.wildcards))1158 packed.append(struct.pack("!L", self.max_entries))1159 packed.append(struct.pack("!L", self.active_count))1160 packed.append(struct.pack("!Q", self.lookup_count))1161 packed.append(struct.pack("!Q", self.matched_count))1162 return ''.join(packed)1163 @staticmethod1164 def unpack(reader):1165 obj = table_stats_entry()1166 obj.table_id = reader.read("!B")[0]1167 reader.skip(3)1168 obj.name = reader.read("!32s")[0].rstrip("\x00")1169 obj.wildcards = util.unpack_wc_bmap(reader)1170 obj.max_entries = reader.read("!L")[0]1171 obj.active_count = reader.read("!L")[0]1172 obj.lookup_count = reader.read("!Q")[0]1173 obj.matched_count = reader.read("!Q")[0]1174 return obj1175 def __eq__(self, other):1176 if type(self) != type(other): return False1177 if self.table_id != other.table_id: return False1178 if self.name != other.name: return False1179 if self.wildcards != other.wildcards: return False1180 if self.max_entries != other.max_entries: return False1181 if self.active_count != other.active_count: return False1182 if self.lookup_count != other.lookup_count: return False1183 if self.matched_count != other.matched_count: return False1184 return True1185 def pretty_print(self, q):1186 q.text("table_stats_entry {")1187 with q.group():1188 with q.indent(2):1189 q.breakable()1190 q.text("table_id = ");1191 q.text("%#x" % self.table_id)1192 q.text(","); q.breakable()1193 q.text("name = ");1194 q.pp(self.name)1195 q.text(","); q.breakable()1196 q.text("wildcards = ");1197 q.text(util.pretty_wildcards(self.wildcards))1198 q.text(","); q.breakable()1199 q.text("max_entries = ");1200 q.text("%#x" % self.max_entries)1201 q.text(","); q.breakable()1202 q.text("active_count = ");1203 q.text("%#x" % self.active_count)1204 q.text(","); q.breakable()1205 q.text("lookup_count = ");1206 q.text("%#x" % self.lookup_count)1207 q.text(","); q.breakable()1208 q.text("matched_count = ");1209 q.text("%#x" % self.matched_count)1210 q.breakable()1211 q.text('}')...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run hypothesis automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful