blob: c5f0ca6df18cdf5b1b9064295b904ebd3f7f6ea0 [file] [log] [blame]
Zack Williams41513bf2018-07-07 20:08:35 -07001# 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.
Nathan Knuth418fdc82016-09-16 22:51:15 -070014# 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.of13']
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_split_horizon_check(bsn):
454 type = 65535
455 experimenter = 6035143
456 subtype = 3
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_split_horizon_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 == 3)
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_split_horizon_check {")
491 with q.group():
492 with q.indent(2):
493 q.breakable()
494 q.breakable()
495 q.text('}')
496
497bsn.subtypes[3] = bsn_disable_split_horizon_check
498
499class bsn_disable_src_mac_check(bsn):
500 type = 65535
501 experimenter = 6035143
502 subtype = 0
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_src_mac_check()
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 == 0)
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_src_mac_check {")
537 with q.group():
538 with q.indent(2):
539 q.breakable()
540 q.breakable()
541 q.text('}')
542
543bsn.subtypes[0] = bsn_disable_src_mac_check
544
545class bsn_disable_vlan_counters(bsn):
546 type = 65535
547 experimenter = 6035143
548 subtype = 9
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_disable_vlan_counters()
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 == 9)
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_disable_vlan_counters {")
583 with q.group():
584 with q.indent(2):
585 q.breakable()
586 q.breakable()
587 q.text('}')
588
589bsn.subtypes[9] = bsn_disable_vlan_counters
590
591class bsn_internal_priority(bsn):
592 type = 65535
593 experimenter = 6035143
594 subtype = 12
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_internal_priority()
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 == 12)
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_internal_priority {")
629 with q.group():
630 with q.indent(2):
631 q.breakable()
632 q.breakable()
633 q.text('}')
634
635bsn.subtypes[12] = bsn_internal_priority
636
637class bsn_packet_of_death(bsn):
638 type = 65535
639 experimenter = 6035143
640 subtype = 6
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_packet_of_death()
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 == 6)
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_packet_of_death {")
675 with q.group():
676 with q.indent(2):
677 q.breakable()
678 q.breakable()
679 q.text('}')
680
681bsn.subtypes[6] = bsn_packet_of_death
682
683class bsn_permit(bsn):
684 type = 65535
685 experimenter = 6035143
686 subtype = 4
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_permit()
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 == 4)
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_permit {")
721 with q.group():
722 with q.indent(2):
723 q.breakable()
724 q.breakable()
725 q.text('}')
726
727bsn.subtypes[4] = bsn_permit
728
729class bsn_prioritize_pdus(bsn):
730 type = 65535
731 experimenter = 6035143
732 subtype = 7
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_prioritize_pdus()
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 == 7)
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_prioritize_pdus {")
767 with q.group():
768 with q.indent(2):
769 q.breakable()
770 q.breakable()
771 q.text('}')
772
773bsn.subtypes[7] = bsn_prioritize_pdus
774
775class bsn_require_vlan_xlate(bsn):
776 type = 65535
777 experimenter = 6035143
778 subtype = 8
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_require_vlan_xlate()
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 == 8)
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_require_vlan_xlate {")
813 with q.group():
814 with q.indent(2):
815 q.breakable()
816 q.breakable()
817 q.text('}')
818
819bsn.subtypes[8] = bsn_require_vlan_xlate
820
821class bsn_span_destination(bsn):
822 type = 65535
823 experimenter = 6035143
824 subtype = 10
825
826 def __init__(self):
827 return
828
829 def pack(self):
830 packed = []
831 packed.append(struct.pack("!H", self.type))
832 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
833 packed.append(struct.pack("!L", self.experimenter))
834 packed.append(struct.pack("!L", self.subtype))
835 length = sum([len(x) for x in packed])
836 packed[1] = struct.pack("!H", length)
837 return ''.join(packed)
838
839 @staticmethod
840 def unpack(reader):
841 obj = bsn_span_destination()
842 _type = reader.read("!H")[0]
843 assert(_type == 65535)
844 _len = reader.read("!H")[0]
845 orig_reader = reader
846 reader = orig_reader.slice(_len, 4)
847 _experimenter = reader.read("!L")[0]
848 assert(_experimenter == 6035143)
849 _subtype = reader.read("!L")[0]
850 assert(_subtype == 10)
851 return obj
852
853 def __eq__(self, other):
854 if type(self) != type(other): return False
855 return True
856
857 def pretty_print(self, q):
858 q.text("bsn_span_destination {")
859 with q.group():
860 with q.indent(2):
861 q.breakable()
862 q.breakable()
863 q.text('}')
864
865bsn.subtypes[10] = bsn_span_destination
866
867class clear_actions(instruction_id):
868 type = 5
869
870 def __init__(self):
871 return
872
873 def pack(self):
874 packed = []
875 packed.append(struct.pack("!H", self.type))
876 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
877 length = sum([len(x) for x in packed])
878 packed[1] = struct.pack("!H", length)
879 return ''.join(packed)
880
881 @staticmethod
882 def unpack(reader):
883 obj = clear_actions()
884 _type = reader.read("!H")[0]
885 assert(_type == 5)
886 _len = reader.read("!H")[0]
887 orig_reader = reader
888 reader = orig_reader.slice(_len, 4)
889 return obj
890
891 def __eq__(self, other):
892 if type(self) != type(other): return False
893 return True
894
895 def pretty_print(self, q):
896 q.text("clear_actions {")
897 with q.group():
898 with q.indent(2):
899 q.breakable()
900 q.breakable()
901 q.text('}')
902
903instruction_id.subtypes[5] = clear_actions
904
905class goto_table(instruction_id):
906 type = 1
907
908 def __init__(self):
909 return
910
911 def pack(self):
912 packed = []
913 packed.append(struct.pack("!H", self.type))
914 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
915 length = sum([len(x) for x in packed])
916 packed[1] = struct.pack("!H", length)
917 return ''.join(packed)
918
919 @staticmethod
920 def unpack(reader):
921 obj = goto_table()
922 _type = reader.read("!H")[0]
923 assert(_type == 1)
924 _len = reader.read("!H")[0]
925 orig_reader = reader
926 reader = orig_reader.slice(_len, 4)
927 return obj
928
929 def __eq__(self, other):
930 if type(self) != type(other): return False
931 return True
932
933 def pretty_print(self, q):
934 q.text("goto_table {")
935 with q.group():
936 with q.indent(2):
937 q.breakable()
938 q.breakable()
939 q.text('}')
940
941instruction_id.subtypes[1] = goto_table
942
943class meter(instruction_id):
944 type = 6
945
946 def __init__(self):
947 return
948
949 def pack(self):
950 packed = []
951 packed.append(struct.pack("!H", self.type))
952 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
953 length = sum([len(x) for x in packed])
954 packed[1] = struct.pack("!H", length)
955 return ''.join(packed)
956
957 @staticmethod
958 def unpack(reader):
959 obj = meter()
960 _type = reader.read("!H")[0]
961 assert(_type == 6)
962 _len = reader.read("!H")[0]
963 orig_reader = reader
964 reader = orig_reader.slice(_len, 4)
965 return obj
966
967 def __eq__(self, other):
968 if type(self) != type(other): return False
969 return True
970
971 def pretty_print(self, q):
972 q.text("meter {")
973 with q.group():
974 with q.indent(2):
975 q.breakable()
976 q.breakable()
977 q.text('}')
978
979instruction_id.subtypes[6] = meter
980
981class write_actions(instruction_id):
982 type = 3
983
984 def __init__(self):
985 return
986
987 def pack(self):
988 packed = []
989 packed.append(struct.pack("!H", self.type))
990 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
991 length = sum([len(x) for x in packed])
992 packed[1] = struct.pack("!H", length)
993 return ''.join(packed)
994
995 @staticmethod
996 def unpack(reader):
997 obj = write_actions()
998 _type = reader.read("!H")[0]
999 assert(_type == 3)
1000 _len = reader.read("!H")[0]
1001 orig_reader = reader
1002 reader = orig_reader.slice(_len, 4)
1003 return obj
1004
1005 def __eq__(self, other):
1006 if type(self) != type(other): return False
1007 return True
1008
1009 def pretty_print(self, q):
1010 q.text("write_actions {")
1011 with q.group():
1012 with q.indent(2):
1013 q.breakable()
1014 q.breakable()
1015 q.text('}')
1016
1017instruction_id.subtypes[3] = write_actions
1018
1019class write_metadata(instruction_id):
1020 type = 2
1021
1022 def __init__(self):
1023 return
1024
1025 def pack(self):
1026 packed = []
1027 packed.append(struct.pack("!H", self.type))
1028 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
1029 length = sum([len(x) for x in packed])
1030 packed[1] = struct.pack("!H", length)
1031 return ''.join(packed)
1032
1033 @staticmethod
1034 def unpack(reader):
1035 obj = write_metadata()
1036 _type = reader.read("!H")[0]
1037 assert(_type == 2)
1038 _len = reader.read("!H")[0]
1039 orig_reader = reader
1040 reader = orig_reader.slice(_len, 4)
1041 return obj
1042
1043 def __eq__(self, other):
1044 if type(self) != type(other): return False
1045 return True
1046
1047 def pretty_print(self, q):
1048 q.text("write_metadata {")
1049 with q.group():
1050 with q.indent(2):
1051 q.breakable()
1052 q.breakable()
1053 q.text('}')
1054
1055instruction_id.subtypes[2] = write_metadata
1056
1057