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