blob: da9f84a222ec9dc4ae517e00e184e8eb825ea85d [file] [log] [blame]
Stephane Barbarie6e1bd502018-11-05 22:44:45 -05001# Copyright 2017-present Open Networking Foundation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
15# Copyright (c) 2011, 2012 Open Networking Foundation
16# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
17# See the file LICENSE.pyloxi which should have been included in the source distribution
18
19# Automatically generated by LOXI from template module.py
20# Do not modify
21
22import struct
23import loxi
24import util
25import loxi.generic_util
26
27import sys
28ofp = sys.modules['loxi.of14']
29
30class instruction_id(loxi.OFObject):
31 subtypes = {}
32
33
34 def __init__(self, type=None):
35 if type != None:
36 self.type = type
37 else:
38 self.type = 0
39 return
40
41 def pack(self):
42 packed = []
43 packed.append(struct.pack("!H", self.type))
44 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
45 length = sum([len(x) for x in packed])
46 packed[1] = struct.pack("!H", length)
47 return ''.join(packed)
48
49 @staticmethod
50 def unpack(reader):
51 subtype, = reader.peek('!H', 0)
52 subclass = instruction_id.subtypes.get(subtype)
53 if subclass:
54 return subclass.unpack(reader)
55
56 obj = instruction_id()
57 obj.type = reader.read("!H")[0]
58 _len = reader.read("!H")[0]
59 orig_reader = reader
60 reader = orig_reader.slice(_len, 4)
61 return obj
62
63 def __eq__(self, other):
64 if type(self) != type(other): return False
65 if self.type != other.type: return False
66 return True
67
68 def pretty_print(self, q):
69 q.text("instruction_id {")
70 with q.group():
71 with q.indent(2):
72 q.breakable()
73 q.breakable()
74 q.text('}')
75
76
77class apply_actions(instruction_id):
78 type = 4
79
80 def __init__(self):
81 return
82
83 def pack(self):
84 packed = []
85 packed.append(struct.pack("!H", self.type))
86 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
87 length = sum([len(x) for x in packed])
88 packed[1] = struct.pack("!H", length)
89 return ''.join(packed)
90
91 @staticmethod
92 def unpack(reader):
93 obj = apply_actions()
94 _type = reader.read("!H")[0]
95 assert(_type == 4)
96 _len = reader.read("!H")[0]
97 orig_reader = reader
98 reader = orig_reader.slice(_len, 4)
99 return obj
100
101 def __eq__(self, other):
102 if type(self) != type(other): return False
103 return True
104
105 def pretty_print(self, q):
106 q.text("apply_actions {")
107 with q.group():
108 with q.indent(2):
109 q.breakable()
110 q.breakable()
111 q.text('}')
112
113instruction_id.subtypes[4] = apply_actions
114
115class experimenter(instruction_id):
116 subtypes = {}
117
118 type = 65535
119
120 def __init__(self, experimenter=None):
121 if experimenter != None:
122 self.experimenter = experimenter
123 else:
124 self.experimenter = 0
125 return
126
127 def pack(self):
128 packed = []
129 packed.append(struct.pack("!H", self.type))
130 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
131 packed.append(struct.pack("!L", self.experimenter))
132 length = sum([len(x) for x in packed])
133 packed[1] = struct.pack("!H", length)
134 return ''.join(packed)
135
136 @staticmethod
137 def unpack(reader):
138 subtype, = reader.peek('!L', 4)
139 subclass = experimenter.subtypes.get(subtype)
140 if subclass:
141 return subclass.unpack(reader)
142
143 obj = experimenter()
144 _type = reader.read("!H")[0]
145 assert(_type == 65535)
146 _len = reader.read("!H")[0]
147 orig_reader = reader
148 reader = orig_reader.slice(_len, 4)
149 obj.experimenter = reader.read("!L")[0]
150 return obj
151
152 def __eq__(self, other):
153 if type(self) != type(other): return False
154 if self.experimenter != other.experimenter: return False
155 return True
156
157 def pretty_print(self, q):
158 q.text("experimenter {")
159 with q.group():
160 with q.indent(2):
161 q.breakable()
162 q.breakable()
163 q.text('}')
164
165instruction_id.subtypes[65535] = experimenter
166
167class bsn(experimenter):
168 subtypes = {}
169
170 type = 65535
171 experimenter = 6035143
172
173 def __init__(self, subtype=None):
174 if subtype != None:
175 self.subtype = subtype
176 else:
177 self.subtype = 0
178 return
179
180 def pack(self):
181 packed = []
182 packed.append(struct.pack("!H", self.type))
183 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
184 packed.append(struct.pack("!L", self.experimenter))
185 packed.append(struct.pack("!L", self.subtype))
186 length = sum([len(x) for x in packed])
187 packed[1] = struct.pack("!H", length)
188 return ''.join(packed)
189
190 @staticmethod
191 def unpack(reader):
192 subtype, = reader.peek('!L', 8)
193 subclass = bsn.subtypes.get(subtype)
194 if subclass:
195 return subclass.unpack(reader)
196
197 obj = bsn()
198 _type = reader.read("!H")[0]
199 assert(_type == 65535)
200 _len = reader.read("!H")[0]
201 orig_reader = reader
202 reader = orig_reader.slice(_len, 4)
203 _experimenter = reader.read("!L")[0]
204 assert(_experimenter == 6035143)
205 obj.subtype = reader.read("!L")[0]
206 return obj
207
208 def __eq__(self, other):
209 if type(self) != type(other): return False
210 if self.subtype != other.subtype: return False
211 return True
212
213 def pretty_print(self, q):
214 q.text("bsn {")
215 with q.group():
216 with q.indent(2):
217 q.breakable()
218 q.breakable()
219 q.text('}')
220
221experimenter.subtypes[6035143] = bsn
222
223class bsn_arp_offload(bsn):
224 type = 65535
225 experimenter = 6035143
226 subtype = 1
227
228 def __init__(self):
229 return
230
231 def pack(self):
232 packed = []
233 packed.append(struct.pack("!H", self.type))
234 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
235 packed.append(struct.pack("!L", self.experimenter))
236 packed.append(struct.pack("!L", self.subtype))
237 length = sum([len(x) for x in packed])
238 packed[1] = struct.pack("!H", length)
239 return ''.join(packed)
240
241 @staticmethod
242 def unpack(reader):
243 obj = bsn_arp_offload()
244 _type = reader.read("!H")[0]
245 assert(_type == 65535)
246 _len = reader.read("!H")[0]
247 orig_reader = reader
248 reader = orig_reader.slice(_len, 4)
249 _experimenter = reader.read("!L")[0]
250 assert(_experimenter == 6035143)
251 _subtype = reader.read("!L")[0]
252 assert(_subtype == 1)
253 return obj
254
255 def __eq__(self, other):
256 if type(self) != type(other): return False
257 return True
258
259 def pretty_print(self, q):
260 q.text("bsn_arp_offload {")
261 with q.group():
262 with q.indent(2):
263 q.breakable()
264 q.breakable()
265 q.text('}')
266
267bsn.subtypes[1] = bsn_arp_offload
268
269class bsn_auto_negotiation(bsn):
270 type = 65535
271 experimenter = 6035143
272 subtype = 11
273
274 def __init__(self):
275 return
276
277 def pack(self):
278 packed = []
279 packed.append(struct.pack("!H", self.type))
280 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
281 packed.append(struct.pack("!L", self.experimenter))
282 packed.append(struct.pack("!L", self.subtype))
283 length = sum([len(x) for x in packed])
284 packed[1] = struct.pack("!H", length)
285 return ''.join(packed)
286
287 @staticmethod
288 def unpack(reader):
289 obj = bsn_auto_negotiation()
290 _type = reader.read("!H")[0]
291 assert(_type == 65535)
292 _len = reader.read("!H")[0]
293 orig_reader = reader
294 reader = orig_reader.slice(_len, 4)
295 _experimenter = reader.read("!L")[0]
296 assert(_experimenter == 6035143)
297 _subtype = reader.read("!L")[0]
298 assert(_subtype == 11)
299 return obj
300
301 def __eq__(self, other):
302 if type(self) != type(other): return False
303 return True
304
305 def pretty_print(self, q):
306 q.text("bsn_auto_negotiation {")
307 with q.group():
308 with q.indent(2):
309 q.breakable()
310 q.breakable()
311 q.text('}')
312
313bsn.subtypes[11] = bsn_auto_negotiation
314
315class bsn_deny(bsn):
316 type = 65535
317 experimenter = 6035143
318 subtype = 5
319
320 def __init__(self):
321 return
322
323 def pack(self):
324 packed = []
325 packed.append(struct.pack("!H", self.type))
326 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
327 packed.append(struct.pack("!L", self.experimenter))
328 packed.append(struct.pack("!L", self.subtype))
329 length = sum([len(x) for x in packed])
330 packed[1] = struct.pack("!H", length)
331 return ''.join(packed)
332
333 @staticmethod
334 def unpack(reader):
335 obj = bsn_deny()
336 _type = reader.read("!H")[0]
337 assert(_type == 65535)
338 _len = reader.read("!H")[0]
339 orig_reader = reader
340 reader = orig_reader.slice(_len, 4)
341 _experimenter = reader.read("!L")[0]
342 assert(_experimenter == 6035143)
343 _subtype = reader.read("!L")[0]
344 assert(_subtype == 5)
345 return obj
346
347 def __eq__(self, other):
348 if type(self) != type(other): return False
349 return True
350
351 def pretty_print(self, q):
352 q.text("bsn_deny {")
353 with q.group():
354 with q.indent(2):
355 q.breakable()
356 q.breakable()
357 q.text('}')
358
359bsn.subtypes[5] = bsn_deny
360
361class bsn_dhcp_offload(bsn):
362 type = 65535
363 experimenter = 6035143
364 subtype = 2
365
366 def __init__(self):
367 return
368
369 def pack(self):
370 packed = []
371 packed.append(struct.pack("!H", self.type))
372 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
373 packed.append(struct.pack("!L", self.experimenter))
374 packed.append(struct.pack("!L", self.subtype))
375 length = sum([len(x) for x in packed])
376 packed[1] = struct.pack("!H", length)
377 return ''.join(packed)
378
379 @staticmethod
380 def unpack(reader):
381 obj = bsn_dhcp_offload()
382 _type = reader.read("!H")[0]
383 assert(_type == 65535)
384 _len = reader.read("!H")[0]
385 orig_reader = reader
386 reader = orig_reader.slice(_len, 4)
387 _experimenter = reader.read("!L")[0]
388 assert(_experimenter == 6035143)
389 _subtype = reader.read("!L")[0]
390 assert(_subtype == 2)
391 return obj
392
393 def __eq__(self, other):
394 if type(self) != type(other): return False
395 return True
396
397 def pretty_print(self, q):
398 q.text("bsn_dhcp_offload {")
399 with q.group():
400 with q.indent(2):
401 q.breakable()
402 q.breakable()
403 q.text('}')
404
405bsn.subtypes[2] = bsn_dhcp_offload
406
407class bsn_disable_l3(bsn):
408 type = 65535
409 experimenter = 6035143
410 subtype = 13
411
412 def __init__(self):
413 return
414
415 def pack(self):
416 packed = []
417 packed.append(struct.pack("!H", self.type))
418 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
419 packed.append(struct.pack("!L", self.experimenter))
420 packed.append(struct.pack("!L", self.subtype))
421 length = sum([len(x) for x in packed])
422 packed[1] = struct.pack("!H", length)
423 return ''.join(packed)
424
425 @staticmethod
426 def unpack(reader):
427 obj = bsn_disable_l3()
428 _type = reader.read("!H")[0]
429 assert(_type == 65535)
430 _len = reader.read("!H")[0]
431 orig_reader = reader
432 reader = orig_reader.slice(_len, 4)
433 _experimenter = reader.read("!L")[0]
434 assert(_experimenter == 6035143)
435 _subtype = reader.read("!L")[0]
436 assert(_subtype == 13)
437 return obj
438
439 def __eq__(self, other):
440 if type(self) != type(other): return False
441 return True
442
443 def pretty_print(self, q):
444 q.text("bsn_disable_l3 {")
445 with q.group():
446 with q.indent(2):
447 q.breakable()
448 q.breakable()
449 q.text('}')
450
451bsn.subtypes[13] = bsn_disable_l3
452
453class bsn_disable_src_mac_check(bsn):
454 type = 65535
455 experimenter = 6035143
456 subtype = 0
457
458 def __init__(self):
459 return
460
461 def pack(self):
462 packed = []
463 packed.append(struct.pack("!H", self.type))
464 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
465 packed.append(struct.pack("!L", self.experimenter))
466 packed.append(struct.pack("!L", self.subtype))
467 length = sum([len(x) for x in packed])
468 packed[1] = struct.pack("!H", length)
469 return ''.join(packed)
470
471 @staticmethod
472 def unpack(reader):
473 obj = bsn_disable_src_mac_check()
474 _type = reader.read("!H")[0]
475 assert(_type == 65535)
476 _len = reader.read("!H")[0]
477 orig_reader = reader
478 reader = orig_reader.slice(_len, 4)
479 _experimenter = reader.read("!L")[0]
480 assert(_experimenter == 6035143)
481 _subtype = reader.read("!L")[0]
482 assert(_subtype == 0)
483 return obj
484
485 def __eq__(self, other):
486 if type(self) != type(other): return False
487 return True
488
489 def pretty_print(self, q):
490 q.text("bsn_disable_src_mac_check {")
491 with q.group():
492 with q.indent(2):
493 q.breakable()
494 q.breakable()
495 q.text('}')
496
497bsn.subtypes[0] = bsn_disable_src_mac_check
498
499class bsn_disable_vlan_counters(bsn):
500 type = 65535
501 experimenter = 6035143
502 subtype = 9
503
504 def __init__(self):
505 return
506
507 def pack(self):
508 packed = []
509 packed.append(struct.pack("!H", self.type))
510 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
511 packed.append(struct.pack("!L", self.experimenter))
512 packed.append(struct.pack("!L", self.subtype))
513 length = sum([len(x) for x in packed])
514 packed[1] = struct.pack("!H", length)
515 return ''.join(packed)
516
517 @staticmethod
518 def unpack(reader):
519 obj = bsn_disable_vlan_counters()
520 _type = reader.read("!H")[0]
521 assert(_type == 65535)
522 _len = reader.read("!H")[0]
523 orig_reader = reader
524 reader = orig_reader.slice(_len, 4)
525 _experimenter = reader.read("!L")[0]
526 assert(_experimenter == 6035143)
527 _subtype = reader.read("!L")[0]
528 assert(_subtype == 9)
529 return obj
530
531 def __eq__(self, other):
532 if type(self) != type(other): return False
533 return True
534
535 def pretty_print(self, q):
536 q.text("bsn_disable_vlan_counters {")
537 with q.group():
538 with q.indent(2):
539 q.breakable()
540 q.breakable()
541 q.text('}')
542
543bsn.subtypes[9] = bsn_disable_vlan_counters
544
545class bsn_internal_priority(bsn):
546 type = 65535
547 experimenter = 6035143
548 subtype = 12
549
550 def __init__(self):
551 return
552
553 def pack(self):
554 packed = []
555 packed.append(struct.pack("!H", self.type))
556 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
557 packed.append(struct.pack("!L", self.experimenter))
558 packed.append(struct.pack("!L", self.subtype))
559 length = sum([len(x) for x in packed])
560 packed[1] = struct.pack("!H", length)
561 return ''.join(packed)
562
563 @staticmethod
564 def unpack(reader):
565 obj = bsn_internal_priority()
566 _type = reader.read("!H")[0]
567 assert(_type == 65535)
568 _len = reader.read("!H")[0]
569 orig_reader = reader
570 reader = orig_reader.slice(_len, 4)
571 _experimenter = reader.read("!L")[0]
572 assert(_experimenter == 6035143)
573 _subtype = reader.read("!L")[0]
574 assert(_subtype == 12)
575 return obj
576
577 def __eq__(self, other):
578 if type(self) != type(other): return False
579 return True
580
581 def pretty_print(self, q):
582 q.text("bsn_internal_priority {")
583 with q.group():
584 with q.indent(2):
585 q.breakable()
586 q.breakable()
587 q.text('}')
588
589bsn.subtypes[12] = bsn_internal_priority
590
591class bsn_packet_of_death(bsn):
592 type = 65535
593 experimenter = 6035143
594 subtype = 6
595
596 def __init__(self):
597 return
598
599 def pack(self):
600 packed = []
601 packed.append(struct.pack("!H", self.type))
602 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
603 packed.append(struct.pack("!L", self.experimenter))
604 packed.append(struct.pack("!L", self.subtype))
605 length = sum([len(x) for x in packed])
606 packed[1] = struct.pack("!H", length)
607 return ''.join(packed)
608
609 @staticmethod
610 def unpack(reader):
611 obj = bsn_packet_of_death()
612 _type = reader.read("!H")[0]
613 assert(_type == 65535)
614 _len = reader.read("!H")[0]
615 orig_reader = reader
616 reader = orig_reader.slice(_len, 4)
617 _experimenter = reader.read("!L")[0]
618 assert(_experimenter == 6035143)
619 _subtype = reader.read("!L")[0]
620 assert(_subtype == 6)
621 return obj
622
623 def __eq__(self, other):
624 if type(self) != type(other): return False
625 return True
626
627 def pretty_print(self, q):
628 q.text("bsn_packet_of_death {")
629 with q.group():
630 with q.indent(2):
631 q.breakable()
632 q.breakable()
633 q.text('}')
634
635bsn.subtypes[6] = bsn_packet_of_death
636
637class bsn_permit(bsn):
638 type = 65535
639 experimenter = 6035143
640 subtype = 4
641
642 def __init__(self):
643 return
644
645 def pack(self):
646 packed = []
647 packed.append(struct.pack("!H", self.type))
648 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
649 packed.append(struct.pack("!L", self.experimenter))
650 packed.append(struct.pack("!L", self.subtype))
651 length = sum([len(x) for x in packed])
652 packed[1] = struct.pack("!H", length)
653 return ''.join(packed)
654
655 @staticmethod
656 def unpack(reader):
657 obj = bsn_permit()
658 _type = reader.read("!H")[0]
659 assert(_type == 65535)
660 _len = reader.read("!H")[0]
661 orig_reader = reader
662 reader = orig_reader.slice(_len, 4)
663 _experimenter = reader.read("!L")[0]
664 assert(_experimenter == 6035143)
665 _subtype = reader.read("!L")[0]
666 assert(_subtype == 4)
667 return obj
668
669 def __eq__(self, other):
670 if type(self) != type(other): return False
671 return True
672
673 def pretty_print(self, q):
674 q.text("bsn_permit {")
675 with q.group():
676 with q.indent(2):
677 q.breakable()
678 q.breakable()
679 q.text('}')
680
681bsn.subtypes[4] = bsn_permit
682
683class bsn_prioritize_pdus(bsn):
684 type = 65535
685 experimenter = 6035143
686 subtype = 7
687
688 def __init__(self):
689 return
690
691 def pack(self):
692 packed = []
693 packed.append(struct.pack("!H", self.type))
694 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
695 packed.append(struct.pack("!L", self.experimenter))
696 packed.append(struct.pack("!L", self.subtype))
697 length = sum([len(x) for x in packed])
698 packed[1] = struct.pack("!H", length)
699 return ''.join(packed)
700
701 @staticmethod
702 def unpack(reader):
703 obj = bsn_prioritize_pdus()
704 _type = reader.read("!H")[0]
705 assert(_type == 65535)
706 _len = reader.read("!H")[0]
707 orig_reader = reader
708 reader = orig_reader.slice(_len, 4)
709 _experimenter = reader.read("!L")[0]
710 assert(_experimenter == 6035143)
711 _subtype = reader.read("!L")[0]
712 assert(_subtype == 7)
713 return obj
714
715 def __eq__(self, other):
716 if type(self) != type(other): return False
717 return True
718
719 def pretty_print(self, q):
720 q.text("bsn_prioritize_pdus {")
721 with q.group():
722 with q.indent(2):
723 q.breakable()
724 q.breakable()
725 q.text('}')
726
727bsn.subtypes[7] = bsn_prioritize_pdus
728
729class bsn_require_vlan_xlate(bsn):
730 type = 65535
731 experimenter = 6035143
732 subtype = 8
733
734 def __init__(self):
735 return
736
737 def pack(self):
738 packed = []
739 packed.append(struct.pack("!H", self.type))
740 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
741 packed.append(struct.pack("!L", self.experimenter))
742 packed.append(struct.pack("!L", self.subtype))
743 length = sum([len(x) for x in packed])
744 packed[1] = struct.pack("!H", length)
745 return ''.join(packed)
746
747 @staticmethod
748 def unpack(reader):
749 obj = bsn_require_vlan_xlate()
750 _type = reader.read("!H")[0]
751 assert(_type == 65535)
752 _len = reader.read("!H")[0]
753 orig_reader = reader
754 reader = orig_reader.slice(_len, 4)
755 _experimenter = reader.read("!L")[0]
756 assert(_experimenter == 6035143)
757 _subtype = reader.read("!L")[0]
758 assert(_subtype == 8)
759 return obj
760
761 def __eq__(self, other):
762 if type(self) != type(other): return False
763 return True
764
765 def pretty_print(self, q):
766 q.text("bsn_require_vlan_xlate {")
767 with q.group():
768 with q.indent(2):
769 q.breakable()
770 q.breakable()
771 q.text('}')
772
773bsn.subtypes[8] = bsn_require_vlan_xlate
774
775class bsn_span_destination(bsn):
776 type = 65535
777 experimenter = 6035143
778 subtype = 10
779
780 def __init__(self):
781 return
782
783 def pack(self):
784 packed = []
785 packed.append(struct.pack("!H", self.type))
786 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
787 packed.append(struct.pack("!L", self.experimenter))
788 packed.append(struct.pack("!L", self.subtype))
789 length = sum([len(x) for x in packed])
790 packed[1] = struct.pack("!H", length)
791 return ''.join(packed)
792
793 @staticmethod
794 def unpack(reader):
795 obj = bsn_span_destination()
796 _type = reader.read("!H")[0]
797 assert(_type == 65535)
798 _len = reader.read("!H")[0]
799 orig_reader = reader
800 reader = orig_reader.slice(_len, 4)
801 _experimenter = reader.read("!L")[0]
802 assert(_experimenter == 6035143)
803 _subtype = reader.read("!L")[0]
804 assert(_subtype == 10)
805 return obj
806
807 def __eq__(self, other):
808 if type(self) != type(other): return False
809 return True
810
811 def pretty_print(self, q):
812 q.text("bsn_span_destination {")
813 with q.group():
814 with q.indent(2):
815 q.breakable()
816 q.breakable()
817 q.text('}')
818
819bsn.subtypes[10] = bsn_span_destination
820
821class clear_actions(instruction_id):
822 type = 5
823
824 def __init__(self):
825 return
826
827 def pack(self):
828 packed = []
829 packed.append(struct.pack("!H", self.type))
830 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
831 length = sum([len(x) for x in packed])
832 packed[1] = struct.pack("!H", length)
833 return ''.join(packed)
834
835 @staticmethod
836 def unpack(reader):
837 obj = clear_actions()
838 _type = reader.read("!H")[0]
839 assert(_type == 5)
840 _len = reader.read("!H")[0]
841 orig_reader = reader
842 reader = orig_reader.slice(_len, 4)
843 return obj
844
845 def __eq__(self, other):
846 if type(self) != type(other): return False
847 return True
848
849 def pretty_print(self, q):
850 q.text("clear_actions {")
851 with q.group():
852 with q.indent(2):
853 q.breakable()
854 q.breakable()
855 q.text('}')
856
857instruction_id.subtypes[5] = clear_actions
858
859class goto_table(instruction_id):
860 type = 1
861
862 def __init__(self):
863 return
864
865 def pack(self):
866 packed = []
867 packed.append(struct.pack("!H", self.type))
868 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
869 length = sum([len(x) for x in packed])
870 packed[1] = struct.pack("!H", length)
871 return ''.join(packed)
872
873 @staticmethod
874 def unpack(reader):
875 obj = goto_table()
876 _type = reader.read("!H")[0]
877 assert(_type == 1)
878 _len = reader.read("!H")[0]
879 orig_reader = reader
880 reader = orig_reader.slice(_len, 4)
881 return obj
882
883 def __eq__(self, other):
884 if type(self) != type(other): return False
885 return True
886
887 def pretty_print(self, q):
888 q.text("goto_table {")
889 with q.group():
890 with q.indent(2):
891 q.breakable()
892 q.breakable()
893 q.text('}')
894
895instruction_id.subtypes[1] = goto_table
896
897class meter(instruction_id):
898 type = 6
899
900 def __init__(self):
901 return
902
903 def pack(self):
904 packed = []
905 packed.append(struct.pack("!H", self.type))
906 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
907 length = sum([len(x) for x in packed])
908 packed[1] = struct.pack("!H", length)
909 return ''.join(packed)
910
911 @staticmethod
912 def unpack(reader):
913 obj = meter()
914 _type = reader.read("!H")[0]
915 assert(_type == 6)
916 _len = reader.read("!H")[0]
917 orig_reader = reader
918 reader = orig_reader.slice(_len, 4)
919 return obj
920
921 def __eq__(self, other):
922 if type(self) != type(other): return False
923 return True
924
925 def pretty_print(self, q):
926 q.text("meter {")
927 with q.group():
928 with q.indent(2):
929 q.breakable()
930 q.breakable()
931 q.text('}')
932
933instruction_id.subtypes[6] = meter
934
935class write_actions(instruction_id):
936 type = 3
937
938 def __init__(self):
939 return
940
941 def pack(self):
942 packed = []
943 packed.append(struct.pack("!H", self.type))
944 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
945 length = sum([len(x) for x in packed])
946 packed[1] = struct.pack("!H", length)
947 return ''.join(packed)
948
949 @staticmethod
950 def unpack(reader):
951 obj = write_actions()
952 _type = reader.read("!H")[0]
953 assert(_type == 3)
954 _len = reader.read("!H")[0]
955 orig_reader = reader
956 reader = orig_reader.slice(_len, 4)
957 return obj
958
959 def __eq__(self, other):
960 if type(self) != type(other): return False
961 return True
962
963 def pretty_print(self, q):
964 q.text("write_actions {")
965 with q.group():
966 with q.indent(2):
967 q.breakable()
968 q.breakable()
969 q.text('}')
970
971instruction_id.subtypes[3] = write_actions
972
973class write_metadata(instruction_id):
974 type = 2
975
976 def __init__(self):
977 return
978
979 def pack(self):
980 packed = []
981 packed.append(struct.pack("!H", self.type))
982 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
983 length = sum([len(x) for x in packed])
984 packed[1] = struct.pack("!H", length)
985 return ''.join(packed)
986
987 @staticmethod
988 def unpack(reader):
989 obj = write_metadata()
990 _type = reader.read("!H")[0]
991 assert(_type == 2)
992 _len = reader.read("!H")[0]
993 orig_reader = reader
994 reader = orig_reader.slice(_len, 4)
995 return obj
996
997 def __eq__(self, other):
998 if type(self) != type(other): return False
999 return True
1000
1001 def pretty_print(self, q):
1002 q.text("write_metadata {")
1003 with q.group():
1004 with q.indent(2):
1005 q.breakable()
1006 q.breakable()
1007 q.text('}')
1008
1009instruction_id.subtypes[2] = write_metadata
1010
1011