blob: 1ff80ff126ff92be5df865c23be4c51882b39a59 [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.of14']
29
30class action_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 = action_id.subtypes.get(subtype)
53 if subclass:
54 return subclass.unpack(reader)
55
56 obj = action_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("action_id {")
70 with q.group():
71 with q.indent(2):
72 q.breakable()
73 q.breakable()
74 q.text('}')
75
76
77class experimenter(action_id):
78 subtypes = {}
79
80 type = 65535
81
82 def __init__(self, experimenter=None):
83 if experimenter != None:
84 self.experimenter = experimenter
85 else:
86 self.experimenter = 0
87 return
88
89 def pack(self):
90 packed = []
91 packed.append(struct.pack("!H", self.type))
92 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
93 packed.append(struct.pack("!L", self.experimenter))
94 length = sum([len(x) for x in packed])
95 packed[1] = struct.pack("!H", length)
96 return ''.join(packed)
97
98 @staticmethod
99 def unpack(reader):
100 subtype, = reader.peek('!L', 4)
101 subclass = experimenter.subtypes.get(subtype)
102 if subclass:
103 return subclass.unpack(reader)
104
105 obj = experimenter()
106 _type = reader.read("!H")[0]
107 assert(_type == 65535)
108 _len = reader.read("!H")[0]
109 orig_reader = reader
110 reader = orig_reader.slice(_len, 4)
111 obj.experimenter = reader.read("!L")[0]
112 return obj
113
114 def __eq__(self, other):
115 if type(self) != type(other): return False
116 if self.experimenter != other.experimenter: return False
117 return True
118
119 def pretty_print(self, q):
120 q.text("experimenter {")
121 with q.group():
122 with q.indent(2):
123 q.breakable()
124 q.breakable()
125 q.text('}')
126
127action_id.subtypes[65535] = experimenter
128
129class bsn(experimenter):
130 subtypes = {}
131
132 type = 65535
133 experimenter = 6035143
134
135 def __init__(self, subtype=None):
136 if subtype != None:
137 self.subtype = subtype
138 else:
139 self.subtype = 0
140 return
141
142 def pack(self):
143 packed = []
144 packed.append(struct.pack("!H", self.type))
145 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
146 packed.append(struct.pack("!L", self.experimenter))
147 packed.append(struct.pack("!L", self.subtype))
148 length = sum([len(x) for x in packed])
149 packed[1] = struct.pack("!H", length)
150 return ''.join(packed)
151
152 @staticmethod
153 def unpack(reader):
154 subtype, = reader.peek('!L', 8)
155 subclass = bsn.subtypes.get(subtype)
156 if subclass:
157 return subclass.unpack(reader)
158
159 obj = bsn()
160 _type = reader.read("!H")[0]
161 assert(_type == 65535)
162 _len = reader.read("!H")[0]
163 orig_reader = reader
164 reader = orig_reader.slice(_len, 4)
165 _experimenter = reader.read("!L")[0]
166 assert(_experimenter == 6035143)
167 obj.subtype = reader.read("!L")[0]
168 return obj
169
170 def __eq__(self, other):
171 if type(self) != type(other): return False
172 if self.subtype != other.subtype: return False
173 return True
174
175 def pretty_print(self, q):
176 q.text("bsn {")
177 with q.group():
178 with q.indent(2):
179 q.breakable()
180 q.breakable()
181 q.text('}')
182
183experimenter.subtypes[6035143] = bsn
184
185class bsn_checksum(bsn):
186 type = 65535
187 experimenter = 6035143
188 subtype = 4
189
190 def __init__(self):
191 return
192
193 def pack(self):
194 packed = []
195 packed.append(struct.pack("!H", self.type))
196 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
197 packed.append(struct.pack("!L", self.experimenter))
198 packed.append(struct.pack("!L", self.subtype))
199 length = sum([len(x) for x in packed])
200 packed[1] = struct.pack("!H", length)
201 return ''.join(packed)
202
203 @staticmethod
204 def unpack(reader):
205 obj = bsn_checksum()
206 _type = reader.read("!H")[0]
207 assert(_type == 65535)
208 _len = reader.read("!H")[0]
209 orig_reader = reader
210 reader = orig_reader.slice(_len, 4)
211 _experimenter = reader.read("!L")[0]
212 assert(_experimenter == 6035143)
213 _subtype = reader.read("!L")[0]
214 assert(_subtype == 4)
215 return obj
216
217 def __eq__(self, other):
218 if type(self) != type(other): return False
219 return True
220
221 def pretty_print(self, q):
222 q.text("bsn_checksum {")
223 with q.group():
224 with q.indent(2):
225 q.breakable()
226 q.breakable()
227 q.text('}')
228
229bsn.subtypes[4] = bsn_checksum
230
231class bsn_gentable(bsn):
232 type = 65535
233 experimenter = 6035143
234 subtype = 5
235
236 def __init__(self):
237 return
238
239 def pack(self):
240 packed = []
241 packed.append(struct.pack("!H", self.type))
242 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
243 packed.append(struct.pack("!L", self.experimenter))
244 packed.append(struct.pack("!L", self.subtype))
245 length = sum([len(x) for x in packed])
246 packed[1] = struct.pack("!H", length)
247 return ''.join(packed)
248
249 @staticmethod
250 def unpack(reader):
251 obj = bsn_gentable()
252 _type = reader.read("!H")[0]
253 assert(_type == 65535)
254 _len = reader.read("!H")[0]
255 orig_reader = reader
256 reader = orig_reader.slice(_len, 4)
257 _experimenter = reader.read("!L")[0]
258 assert(_experimenter == 6035143)
259 _subtype = reader.read("!L")[0]
260 assert(_subtype == 5)
261 return obj
262
263 def __eq__(self, other):
264 if type(self) != type(other): return False
265 return True
266
267 def pretty_print(self, q):
268 q.text("bsn_gentable {")
269 with q.group():
270 with q.indent(2):
271 q.breakable()
272 q.breakable()
273 q.text('}')
274
275bsn.subtypes[5] = bsn_gentable
276
277class bsn_mirror(bsn):
278 type = 65535
279 experimenter = 6035143
280 subtype = 1
281
282 def __init__(self):
283 return
284
285 def pack(self):
286 packed = []
287 packed.append(struct.pack("!H", self.type))
288 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
289 packed.append(struct.pack("!L", self.experimenter))
290 packed.append(struct.pack("!L", self.subtype))
291 length = sum([len(x) for x in packed])
292 packed[1] = struct.pack("!H", length)
293 return ''.join(packed)
294
295 @staticmethod
296 def unpack(reader):
297 obj = bsn_mirror()
298 _type = reader.read("!H")[0]
299 assert(_type == 65535)
300 _len = reader.read("!H")[0]
301 orig_reader = reader
302 reader = orig_reader.slice(_len, 4)
303 _experimenter = reader.read("!L")[0]
304 assert(_experimenter == 6035143)
305 _subtype = reader.read("!L")[0]
306 assert(_subtype == 1)
307 return obj
308
309 def __eq__(self, other):
310 if type(self) != type(other): return False
311 return True
312
313 def pretty_print(self, q):
314 q.text("bsn_mirror {")
315 with q.group():
316 with q.indent(2):
317 q.breakable()
318 q.breakable()
319 q.text('}')
320
321bsn.subtypes[1] = bsn_mirror
322
323class bsn_set_tunnel_dst(bsn):
324 type = 65535
325 experimenter = 6035143
326 subtype = 2
327
328 def __init__(self):
329 return
330
331 def pack(self):
332 packed = []
333 packed.append(struct.pack("!H", self.type))
334 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
335 packed.append(struct.pack("!L", self.experimenter))
336 packed.append(struct.pack("!L", self.subtype))
337 length = sum([len(x) for x in packed])
338 packed[1] = struct.pack("!H", length)
339 return ''.join(packed)
340
341 @staticmethod
342 def unpack(reader):
343 obj = bsn_set_tunnel_dst()
344 _type = reader.read("!H")[0]
345 assert(_type == 65535)
346 _len = reader.read("!H")[0]
347 orig_reader = reader
348 reader = orig_reader.slice(_len, 4)
349 _experimenter = reader.read("!L")[0]
350 assert(_experimenter == 6035143)
351 _subtype = reader.read("!L")[0]
352 assert(_subtype == 2)
353 return obj
354
355 def __eq__(self, other):
356 if type(self) != type(other): return False
357 return True
358
359 def pretty_print(self, q):
360 q.text("bsn_set_tunnel_dst {")
361 with q.group():
362 with q.indent(2):
363 q.breakable()
364 q.breakable()
365 q.text('}')
366
367bsn.subtypes[2] = bsn_set_tunnel_dst
368
369class copy_ttl_in(action_id):
370 type = 12
371
372 def __init__(self):
373 return
374
375 def pack(self):
376 packed = []
377 packed.append(struct.pack("!H", self.type))
378 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
379 length = sum([len(x) for x in packed])
380 packed[1] = struct.pack("!H", length)
381 return ''.join(packed)
382
383 @staticmethod
384 def unpack(reader):
385 obj = copy_ttl_in()
386 _type = reader.read("!H")[0]
387 assert(_type == 12)
388 _len = reader.read("!H")[0]
389 orig_reader = reader
390 reader = orig_reader.slice(_len, 4)
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("copy_ttl_in {")
399 with q.group():
400 with q.indent(2):
401 q.breakable()
402 q.breakable()
403 q.text('}')
404
405action_id.subtypes[12] = copy_ttl_in
406
407class copy_ttl_out(action_id):
408 type = 11
409
410 def __init__(self):
411 return
412
413 def pack(self):
414 packed = []
415 packed.append(struct.pack("!H", self.type))
416 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
417 length = sum([len(x) for x in packed])
418 packed[1] = struct.pack("!H", length)
419 return ''.join(packed)
420
421 @staticmethod
422 def unpack(reader):
423 obj = copy_ttl_out()
424 _type = reader.read("!H")[0]
425 assert(_type == 11)
426 _len = reader.read("!H")[0]
427 orig_reader = reader
428 reader = orig_reader.slice(_len, 4)
429 return obj
430
431 def __eq__(self, other):
432 if type(self) != type(other): return False
433 return True
434
435 def pretty_print(self, q):
436 q.text("copy_ttl_out {")
437 with q.group():
438 with q.indent(2):
439 q.breakable()
440 q.breakable()
441 q.text('}')
442
443action_id.subtypes[11] = copy_ttl_out
444
445class dec_mpls_ttl(action_id):
446 type = 16
447
448 def __init__(self):
449 return
450
451 def pack(self):
452 packed = []
453 packed.append(struct.pack("!H", self.type))
454 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
455 length = sum([len(x) for x in packed])
456 packed[1] = struct.pack("!H", length)
457 return ''.join(packed)
458
459 @staticmethod
460 def unpack(reader):
461 obj = dec_mpls_ttl()
462 _type = reader.read("!H")[0]
463 assert(_type == 16)
464 _len = reader.read("!H")[0]
465 orig_reader = reader
466 reader = orig_reader.slice(_len, 4)
467 return obj
468
469 def __eq__(self, other):
470 if type(self) != type(other): return False
471 return True
472
473 def pretty_print(self, q):
474 q.text("dec_mpls_ttl {")
475 with q.group():
476 with q.indent(2):
477 q.breakable()
478 q.breakable()
479 q.text('}')
480
481action_id.subtypes[16] = dec_mpls_ttl
482
483class dec_nw_ttl(action_id):
484 type = 24
485
486 def __init__(self):
487 return
488
489 def pack(self):
490 packed = []
491 packed.append(struct.pack("!H", self.type))
492 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
493 length = sum([len(x) for x in packed])
494 packed[1] = struct.pack("!H", length)
495 return ''.join(packed)
496
497 @staticmethod
498 def unpack(reader):
499 obj = dec_nw_ttl()
500 _type = reader.read("!H")[0]
501 assert(_type == 24)
502 _len = reader.read("!H")[0]
503 orig_reader = reader
504 reader = orig_reader.slice(_len, 4)
505 return obj
506
507 def __eq__(self, other):
508 if type(self) != type(other): return False
509 return True
510
511 def pretty_print(self, q):
512 q.text("dec_nw_ttl {")
513 with q.group():
514 with q.indent(2):
515 q.breakable()
516 q.breakable()
517 q.text('}')
518
519action_id.subtypes[24] = dec_nw_ttl
520
521class group(action_id):
522 type = 22
523
524 def __init__(self):
525 return
526
527 def pack(self):
528 packed = []
529 packed.append(struct.pack("!H", self.type))
530 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
531 length = sum([len(x) for x in packed])
532 packed[1] = struct.pack("!H", length)
533 return ''.join(packed)
534
535 @staticmethod
536 def unpack(reader):
537 obj = group()
538 _type = reader.read("!H")[0]
539 assert(_type == 22)
540 _len = reader.read("!H")[0]
541 orig_reader = reader
542 reader = orig_reader.slice(_len, 4)
543 return obj
544
545 def __eq__(self, other):
546 if type(self) != type(other): return False
547 return True
548
549 def pretty_print(self, q):
550 q.text("group {")
551 with q.group():
552 with q.indent(2):
553 q.breakable()
554 q.breakable()
555 q.text('}')
556
557action_id.subtypes[22] = group
558
559class nicira(experimenter):
560 subtypes = {}
561
562 type = 65535
563 experimenter = 8992
564
565 def __init__(self, subtype=None):
566 if subtype != None:
567 self.subtype = subtype
568 else:
569 self.subtype = 0
570 return
571
572 def pack(self):
573 packed = []
574 packed.append(struct.pack("!H", self.type))
575 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
576 packed.append(struct.pack("!L", self.experimenter))
577 packed.append(struct.pack("!H", self.subtype))
578 length = sum([len(x) for x in packed])
579 packed[1] = struct.pack("!H", length)
580 return ''.join(packed)
581
582 @staticmethod
583 def unpack(reader):
584 subtype, = reader.peek('!H', 8)
585 subclass = nicira.subtypes.get(subtype)
586 if subclass:
587 return subclass.unpack(reader)
588
589 obj = nicira()
590 _type = reader.read("!H")[0]
591 assert(_type == 65535)
592 _len = reader.read("!H")[0]
593 orig_reader = reader
594 reader = orig_reader.slice(_len, 4)
595 _experimenter = reader.read("!L")[0]
596 assert(_experimenter == 8992)
597 obj.subtype = reader.read("!H")[0]
598 return obj
599
600 def __eq__(self, other):
601 if type(self) != type(other): return False
602 if self.subtype != other.subtype: return False
603 return True
604
605 def pretty_print(self, q):
606 q.text("nicira {")
607 with q.group():
608 with q.indent(2):
609 q.breakable()
610 q.breakable()
611 q.text('}')
612
613experimenter.subtypes[8992] = nicira
614
615class nicira_dec_ttl(nicira):
616 type = 65535
617 experimenter = 8992
618 subtype = 18
619
620 def __init__(self):
621 return
622
623 def pack(self):
624 packed = []
625 packed.append(struct.pack("!H", self.type))
626 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
627 packed.append(struct.pack("!L", self.experimenter))
628 packed.append(struct.pack("!H", self.subtype))
629 length = sum([len(x) for x in packed])
630 packed[1] = struct.pack("!H", length)
631 return ''.join(packed)
632
633 @staticmethod
634 def unpack(reader):
635 obj = nicira_dec_ttl()
636 _type = reader.read("!H")[0]
637 assert(_type == 65535)
638 _len = reader.read("!H")[0]
639 orig_reader = reader
640 reader = orig_reader.slice(_len, 4)
641 _experimenter = reader.read("!L")[0]
642 assert(_experimenter == 8992)
643 _subtype = reader.read("!H")[0]
644 assert(_subtype == 18)
645 return obj
646
647 def __eq__(self, other):
648 if type(self) != type(other): return False
649 return True
650
651 def pretty_print(self, q):
652 q.text("nicira_dec_ttl {")
653 with q.group():
654 with q.indent(2):
655 q.breakable()
656 q.breakable()
657 q.text('}')
658
659nicira.subtypes[18] = nicira_dec_ttl
660
661class output(action_id):
662 type = 0
663
664 def __init__(self):
665 return
666
667 def pack(self):
668 packed = []
669 packed.append(struct.pack("!H", self.type))
670 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
671 length = sum([len(x) for x in packed])
672 packed[1] = struct.pack("!H", length)
673 return ''.join(packed)
674
675 @staticmethod
676 def unpack(reader):
677 obj = output()
678 _type = reader.read("!H")[0]
679 assert(_type == 0)
680 _len = reader.read("!H")[0]
681 orig_reader = reader
682 reader = orig_reader.slice(_len, 4)
683 return obj
684
685 def __eq__(self, other):
686 if type(self) != type(other): return False
687 return True
688
689 def pretty_print(self, q):
690 q.text("output {")
691 with q.group():
692 with q.indent(2):
693 q.breakable()
694 q.breakable()
695 q.text('}')
696
697action_id.subtypes[0] = output
698
699class pop_mpls(action_id):
700 type = 20
701
702 def __init__(self):
703 return
704
705 def pack(self):
706 packed = []
707 packed.append(struct.pack("!H", self.type))
708 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
709 length = sum([len(x) for x in packed])
710 packed[1] = struct.pack("!H", length)
711 return ''.join(packed)
712
713 @staticmethod
714 def unpack(reader):
715 obj = pop_mpls()
716 _type = reader.read("!H")[0]
717 assert(_type == 20)
718 _len = reader.read("!H")[0]
719 orig_reader = reader
720 reader = orig_reader.slice(_len, 4)
721 return obj
722
723 def __eq__(self, other):
724 if type(self) != type(other): return False
725 return True
726
727 def pretty_print(self, q):
728 q.text("pop_mpls {")
729 with q.group():
730 with q.indent(2):
731 q.breakable()
732 q.breakable()
733 q.text('}')
734
735action_id.subtypes[20] = pop_mpls
736
737class pop_pbb(action_id):
738 type = 27
739
740 def __init__(self):
741 return
742
743 def pack(self):
744 packed = []
745 packed.append(struct.pack("!H", self.type))
746 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
747 length = sum([len(x) for x in packed])
748 packed[1] = struct.pack("!H", length)
749 return ''.join(packed)
750
751 @staticmethod
752 def unpack(reader):
753 obj = pop_pbb()
754 _type = reader.read("!H")[0]
755 assert(_type == 27)
756 _len = reader.read("!H")[0]
757 orig_reader = reader
758 reader = orig_reader.slice(_len, 4)
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("pop_pbb {")
767 with q.group():
768 with q.indent(2):
769 q.breakable()
770 q.breakable()
771 q.text('}')
772
773action_id.subtypes[27] = pop_pbb
774
775class pop_vlan(action_id):
776 type = 18
777
778 def __init__(self):
779 return
780
781 def pack(self):
782 packed = []
783 packed.append(struct.pack("!H", self.type))
784 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
785 length = sum([len(x) for x in packed])
786 packed[1] = struct.pack("!H", length)
787 return ''.join(packed)
788
789 @staticmethod
790 def unpack(reader):
791 obj = pop_vlan()
792 _type = reader.read("!H")[0]
793 assert(_type == 18)
794 _len = reader.read("!H")[0]
795 orig_reader = reader
796 reader = orig_reader.slice(_len, 4)
797 return obj
798
799 def __eq__(self, other):
800 if type(self) != type(other): return False
801 return True
802
803 def pretty_print(self, q):
804 q.text("pop_vlan {")
805 with q.group():
806 with q.indent(2):
807 q.breakable()
808 q.breakable()
809 q.text('}')
810
811action_id.subtypes[18] = pop_vlan
812
813class push_mpls(action_id):
814 type = 19
815
816 def __init__(self):
817 return
818
819 def pack(self):
820 packed = []
821 packed.append(struct.pack("!H", self.type))
822 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
823 length = sum([len(x) for x in packed])
824 packed[1] = struct.pack("!H", length)
825 return ''.join(packed)
826
827 @staticmethod
828 def unpack(reader):
829 obj = push_mpls()
830 _type = reader.read("!H")[0]
831 assert(_type == 19)
832 _len = reader.read("!H")[0]
833 orig_reader = reader
834 reader = orig_reader.slice(_len, 4)
835 return obj
836
837 def __eq__(self, other):
838 if type(self) != type(other): return False
839 return True
840
841 def pretty_print(self, q):
842 q.text("push_mpls {")
843 with q.group():
844 with q.indent(2):
845 q.breakable()
846 q.breakable()
847 q.text('}')
848
849action_id.subtypes[19] = push_mpls
850
851class push_pbb(action_id):
852 type = 26
853
854 def __init__(self):
855 return
856
857 def pack(self):
858 packed = []
859 packed.append(struct.pack("!H", self.type))
860 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
861 length = sum([len(x) for x in packed])
862 packed[1] = struct.pack("!H", length)
863 return ''.join(packed)
864
865 @staticmethod
866 def unpack(reader):
867 obj = push_pbb()
868 _type = reader.read("!H")[0]
869 assert(_type == 26)
870 _len = reader.read("!H")[0]
871 orig_reader = reader
872 reader = orig_reader.slice(_len, 4)
873 return obj
874
875 def __eq__(self, other):
876 if type(self) != type(other): return False
877 return True
878
879 def pretty_print(self, q):
880 q.text("push_pbb {")
881 with q.group():
882 with q.indent(2):
883 q.breakable()
884 q.breakable()
885 q.text('}')
886
887action_id.subtypes[26] = push_pbb
888
889class push_vlan(action_id):
890 type = 17
891
892 def __init__(self):
893 return
894
895 def pack(self):
896 packed = []
897 packed.append(struct.pack("!H", self.type))
898 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
899 length = sum([len(x) for x in packed])
900 packed[1] = struct.pack("!H", length)
901 return ''.join(packed)
902
903 @staticmethod
904 def unpack(reader):
905 obj = push_vlan()
906 _type = reader.read("!H")[0]
907 assert(_type == 17)
908 _len = reader.read("!H")[0]
909 orig_reader = reader
910 reader = orig_reader.slice(_len, 4)
911 return obj
912
913 def __eq__(self, other):
914 if type(self) != type(other): return False
915 return True
916
917 def pretty_print(self, q):
918 q.text("push_vlan {")
919 with q.group():
920 with q.indent(2):
921 q.breakable()
922 q.breakable()
923 q.text('}')
924
925action_id.subtypes[17] = push_vlan
926
927class set_field(action_id):
928 type = 25
929
930 def __init__(self):
931 return
932
933 def pack(self):
934 packed = []
935 packed.append(struct.pack("!H", self.type))
936 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
937 length = sum([len(x) for x in packed])
938 packed[1] = struct.pack("!H", length)
939 return ''.join(packed)
940
941 @staticmethod
942 def unpack(reader):
943 obj = set_field()
944 _type = reader.read("!H")[0]
945 assert(_type == 25)
946 _len = reader.read("!H")[0]
947 orig_reader = reader
948 reader = orig_reader.slice(_len, 4)
949 return obj
950
951 def __eq__(self, other):
952 if type(self) != type(other): return False
953 return True
954
955 def pretty_print(self, q):
956 q.text("set_field {")
957 with q.group():
958 with q.indent(2):
959 q.breakable()
960 q.breakable()
961 q.text('}')
962
963action_id.subtypes[25] = set_field
964
965class set_mpls_ttl(action_id):
966 type = 15
967
968 def __init__(self):
969 return
970
971 def pack(self):
972 packed = []
973 packed.append(struct.pack("!H", self.type))
974 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
975 length = sum([len(x) for x in packed])
976 packed[1] = struct.pack("!H", length)
977 return ''.join(packed)
978
979 @staticmethod
980 def unpack(reader):
981 obj = set_mpls_ttl()
982 _type = reader.read("!H")[0]
983 assert(_type == 15)
984 _len = reader.read("!H")[0]
985 orig_reader = reader
986 reader = orig_reader.slice(_len, 4)
987 return obj
988
989 def __eq__(self, other):
990 if type(self) != type(other): return False
991 return True
992
993 def pretty_print(self, q):
994 q.text("set_mpls_ttl {")
995 with q.group():
996 with q.indent(2):
997 q.breakable()
998 q.breakable()
999 q.text('}')
1000
1001action_id.subtypes[15] = set_mpls_ttl
1002
1003class set_nw_ttl(action_id):
1004 type = 23
1005
1006 def __init__(self):
1007 return
1008
1009 def pack(self):
1010 packed = []
1011 packed.append(struct.pack("!H", self.type))
1012 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
1013 length = sum([len(x) for x in packed])
1014 packed[1] = struct.pack("!H", length)
1015 return ''.join(packed)
1016
1017 @staticmethod
1018 def unpack(reader):
1019 obj = set_nw_ttl()
1020 _type = reader.read("!H")[0]
1021 assert(_type == 23)
1022 _len = reader.read("!H")[0]
1023 orig_reader = reader
1024 reader = orig_reader.slice(_len, 4)
1025 return obj
1026
1027 def __eq__(self, other):
1028 if type(self) != type(other): return False
1029 return True
1030
1031 def pretty_print(self, q):
1032 q.text("set_nw_ttl {")
1033 with q.group():
1034 with q.indent(2):
1035 q.breakable()
1036 q.breakable()
1037 q.text('}')
1038
1039action_id.subtypes[23] = set_nw_ttl
1040
1041class set_queue(action_id):
1042 type = 21
1043
1044 def __init__(self):
1045 return
1046
1047 def pack(self):
1048 packed = []
1049 packed.append(struct.pack("!H", self.type))
1050 packed.append(struct.pack("!H", 0)) # placeholder for len at index 1
1051 length = sum([len(x) for x in packed])
1052 packed[1] = struct.pack("!H", length)
1053 return ''.join(packed)
1054
1055 @staticmethod
1056 def unpack(reader):
1057 obj = set_queue()
1058 _type = reader.read("!H")[0]
1059 assert(_type == 21)
1060 _len = reader.read("!H")[0]
1061 orig_reader = reader
1062 reader = orig_reader.slice(_len, 4)
1063 return obj
1064
1065 def __eq__(self, other):
1066 if type(self) != type(other): return False
1067 return True
1068
1069 def pretty_print(self, q):
1070 q.text("set_queue {")
1071 with q.group():
1072 with q.indent(2):
1073 q.breakable()
1074 q.breakable()
1075 q.text('}')
1076
1077action_id.subtypes[21] = set_queue
1078
1079