blob: 9771c6e613f136dd043b1741dca405c16f5d8b62 [file] [log] [blame]
Jonathan Hart44bdbfc2020-04-14 17:45:47 -07001/*
2 * Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
3 * Copyright (c) 2011, 2012 Open Networking Foundation
4 * Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler.
5 * Copyright 2018, Red Hat, Inc.
6 */
7// Automatically generated by LOXI from template module.go
8// Do not modify
9
10package of15
11
12import (
13 "bytes"
14 "encoding/binary"
15 "encoding/json"
16 "fmt"
17 "net"
18
19 "github.com/opencord/goloxi"
20)
21
22type Action struct {
23 Type uint16
24 Len uint16
25}
26
27type IAction interface {
28 goloxi.Serializable
29 GetType() uint16
30 GetLen() uint16
31 GetActionName() string
32 GetActionFields() map[string]interface{}
33}
34
35func (self *Action) GetType() uint16 {
36 return self.Type
37}
38
39func (self *Action) SetType(v uint16) {
40 self.Type = v
41}
42
43func (self *Action) GetLen() uint16 {
44 return self.Len
45}
46
47func (self *Action) SetLen(v uint16) {
48 self.Len = v
49}
50
51func (self *Action) Serialize(encoder *goloxi.Encoder) error {
52
53 encoder.PutUint16(uint16(self.Type))
54 encoder.PutUint16(uint16(self.Len))
55
56 return nil
57}
58
59func DecodeAction(decoder *goloxi.Decoder) (goloxi.IAction, error) {
60 _action := &Action{}
61 if decoder.Length() < 4 {
62 return nil, fmt.Errorf("Action packet too short: %d < 4", decoder.Length())
63 }
64 _action.Type = uint16(decoder.ReadUint16())
65 _action.Len = uint16(decoder.ReadUint16())
66 oldDecoder := decoder
67 defer func() { decoder = oldDecoder }()
68 decoder = decoder.SliceDecoder(int(_action.Len), 2+2)
69
70 switch _action.Type {
71 case 0:
72 return DecodeActionOutput(_action, decoder)
73 case 11:
74 return DecodeActionCopyTtlOut(_action, decoder)
75 case 12:
76 return DecodeActionCopyTtlIn(_action, decoder)
77 case 15:
78 return DecodeActionSetMplsTtl(_action, decoder)
79 case 16:
80 return DecodeActionDecMplsTtl(_action, decoder)
81 case 17:
82 return DecodeActionPushVlan(_action, decoder)
83 case 18:
84 return DecodeActionPopVlan(_action, decoder)
85 case 19:
86 return DecodeActionPushMpls(_action, decoder)
87 case 20:
88 return DecodeActionPopMpls(_action, decoder)
89 case 21:
90 return DecodeActionSetQueue(_action, decoder)
91 case 22:
92 return DecodeActionGroup(_action, decoder)
93 case 23:
94 return DecodeActionSetNwTtl(_action, decoder)
95 case 24:
96 return DecodeActionDecNwTtl(_action, decoder)
97 case 25:
98 return DecodeActionSetField(_action, decoder)
99 case 26:
100 return DecodeActionPushPbb(_action, decoder)
101 case 27:
102 return DecodeActionPopPbb(_action, decoder)
103 case 29:
104 return DecodeActionMeter(_action, decoder)
105 case 65535:
106 return DecodeActionExperimenter(_action, decoder)
107 default:
108 return nil, fmt.Errorf("Invalid type '%d' for 'Action'", _action.Type)
109 }
110}
111
112func NewAction(_type uint16) *Action {
113 obj := &Action{}
114 obj.Type = _type
115 return obj
116}
117
118type ActionExperimenter struct {
119 *Action
120 Experimenter uint32
121}
122
123type IActionExperimenter interface {
124 goloxi.IAction
125 GetExperimenter() uint32
126}
127
128func (self *ActionExperimenter) GetExperimenter() uint32 {
129 return self.Experimenter
130}
131
132func (self *ActionExperimenter) SetExperimenter(v uint32) {
133 self.Experimenter = v
134}
135
136func (self *ActionExperimenter) Serialize(encoder *goloxi.Encoder) error {
137 if err := self.Action.Serialize(encoder); err != nil {
138 return err
139 }
140
141 encoder.PutUint32(uint32(self.Experimenter))
142
143 return nil
144}
145
146func DecodeActionExperimenter(parent *Action, decoder *goloxi.Decoder) (IActionExperimenter, error) {
147 _actionexperimenter := &ActionExperimenter{Action: parent}
148 if decoder.Length() < 4 {
149 return nil, fmt.Errorf("ActionExperimenter packet too short: %d < 4", decoder.Length())
150 }
151 _actionexperimenter.Experimenter = uint32(decoder.ReadUint32())
152
153 switch _actionexperimenter.Experimenter {
154 case 8992:
155 return DecodeActionNicira(_actionexperimenter, decoder)
156 case 6035143:
157 return DecodeActionBsn(_actionexperimenter, decoder)
158 default:
159 return nil, fmt.Errorf("Invalid type '%d' for 'ActionExperimenter'", _actionexperimenter.Experimenter)
160 }
161}
162
163func NewActionExperimenter(_experimenter uint32) *ActionExperimenter {
164 obj := &ActionExperimenter{
165 Action: NewAction(65535),
166 }
167 obj.Experimenter = _experimenter
168 return obj
169}
170func (self *ActionExperimenter) GetActionName() string {
171 return "experimenter"
172}
173
174func (self *ActionExperimenter) GetActionFields() map[string]interface{} {
175 return map[string]interface{}{
176 "Experimenter": self.Experimenter,
177 }
178}
179
180func (self *ActionExperimenter) MarshalJSON() ([]byte, error) {
181 jsonValue, err := json.Marshal(self.GetActionFields())
182 if err != nil {
183 return nil, err
184 }
185 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
186}
187
188type ActionBsn struct {
189 *ActionExperimenter
190 Subtype uint32
191}
192
193type IActionBsn interface {
194 IActionExperimenter
195 GetSubtype() uint32
196}
197
198func (self *ActionBsn) GetSubtype() uint32 {
199 return self.Subtype
200}
201
202func (self *ActionBsn) SetSubtype(v uint32) {
203 self.Subtype = v
204}
205
206func (self *ActionBsn) Serialize(encoder *goloxi.Encoder) error {
207 if err := self.ActionExperimenter.Serialize(encoder); err != nil {
208 return err
209 }
210
211 encoder.PutUint32(uint32(self.Subtype))
212
213 return nil
214}
215
216func DecodeActionBsn(parent *ActionExperimenter, decoder *goloxi.Decoder) (IActionBsn, error) {
217 _actionbsn := &ActionBsn{ActionExperimenter: parent}
218 if decoder.Length() < 4 {
219 return nil, fmt.Errorf("ActionBsn packet too short: %d < 4", decoder.Length())
220 }
221 _actionbsn.Subtype = uint32(decoder.ReadUint32())
222
223 switch _actionbsn.Subtype {
224 case 1:
225 return DecodeActionBsnMirror(_actionbsn, decoder)
226 case 2:
227 return DecodeActionBsnSetTunnelDst(_actionbsn, decoder)
228 case 4:
229 return DecodeActionBsnChecksum(_actionbsn, decoder)
230 case 5:
231 return DecodeActionBsnGentable(_actionbsn, decoder)
232 default:
233 return nil, fmt.Errorf("Invalid type '%d' for 'ActionBsn'", _actionbsn.Subtype)
234 }
235}
236
237func NewActionBsn(_subtype uint32) *ActionBsn {
238 obj := &ActionBsn{
239 ActionExperimenter: NewActionExperimenter(6035143),
240 }
241 obj.Subtype = _subtype
242 return obj
243}
244func (self *ActionBsn) GetActionName() string {
245 return "bsn"
246}
247
248func (self *ActionBsn) GetActionFields() map[string]interface{} {
249 return map[string]interface{}{
250 "Subtype": self.Subtype,
251 }
252}
253
254func (self *ActionBsn) MarshalJSON() ([]byte, error) {
255 jsonValue, err := json.Marshal(self.GetActionFields())
256 if err != nil {
257 return nil, err
258 }
259 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
260}
261
262type ActionBsnChecksum struct {
263 *ActionBsn
264 Checksum Checksum128
265}
266
267type IActionBsnChecksum interface {
268 IActionBsn
269 GetChecksum() Checksum128
270}
271
272func (self *ActionBsnChecksum) GetChecksum() Checksum128 {
273 return self.Checksum
274}
275
276func (self *ActionBsnChecksum) SetChecksum(v Checksum128) {
277 self.Checksum = v
278}
279
280func (self *ActionBsnChecksum) Serialize(encoder *goloxi.Encoder) error {
281 startIndex := len(encoder.Bytes())
282 if err := self.ActionBsn.Serialize(encoder); err != nil {
283 return err
284 }
285
286 self.Checksum.Serialize(encoder)
287 length := len(encoder.Bytes()) - startIndex
288
289 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
290
291 return nil
292}
293
294func DecodeActionBsnChecksum(parent *ActionBsn, decoder *goloxi.Decoder) (*ActionBsnChecksum, error) {
295 _actionbsnchecksum := &ActionBsnChecksum{ActionBsn: parent}
296 if decoder.Length() < 16 {
297 return nil, fmt.Errorf("ActionBsnChecksum packet too short: %d < 16", decoder.Length())
298 }
299 _actionbsnchecksum.Checksum.Decode(decoder)
300 return _actionbsnchecksum, nil
301}
302
303func NewActionBsnChecksum() *ActionBsnChecksum {
304 obj := &ActionBsnChecksum{
305 ActionBsn: NewActionBsn(4),
306 }
307 return obj
308}
309func (self *ActionBsnChecksum) GetActionName() string {
310 return "bsn_checksum"
311}
312
313func (self *ActionBsnChecksum) GetActionFields() map[string]interface{} {
314 return map[string]interface{}{
315 "Checksum": self.Checksum,
316 }
317}
318
319func (self *ActionBsnChecksum) MarshalJSON() ([]byte, error) {
320 jsonValue, err := json.Marshal(self.GetActionFields())
321 if err != nil {
322 return nil, err
323 }
324 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
325}
326
327type ActionBsnGentable struct {
328 *ActionBsn
329 TableId uint32
330 Key []IBsnTlv
331}
332
333type IActionBsnGentable interface {
334 IActionBsn
335 GetTableId() uint32
336 GetKey() []IBsnTlv
337}
338
339func (self *ActionBsnGentable) GetTableId() uint32 {
340 return self.TableId
341}
342
343func (self *ActionBsnGentable) SetTableId(v uint32) {
344 self.TableId = v
345}
346
347func (self *ActionBsnGentable) GetKey() []IBsnTlv {
348 return self.Key
349}
350
351func (self *ActionBsnGentable) SetKey(v []IBsnTlv) {
352 self.Key = v
353}
354
355func (self *ActionBsnGentable) Serialize(encoder *goloxi.Encoder) error {
356 startIndex := len(encoder.Bytes())
357 if err := self.ActionBsn.Serialize(encoder); err != nil {
358 return err
359 }
360
361 encoder.PutUint32(uint32(self.TableId))
362 for _, obj := range self.Key {
363 if err := obj.Serialize(encoder); err != nil {
364 return err
365 }
366 }
367 length := len(encoder.Bytes()) - startIndex
368
369 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
370
371 return nil
372}
373
374func DecodeActionBsnGentable(parent *ActionBsn, decoder *goloxi.Decoder) (*ActionBsnGentable, error) {
375 _actionbsngentable := &ActionBsnGentable{ActionBsn: parent}
376 if decoder.Length() < 4 {
377 return nil, fmt.Errorf("ActionBsnGentable packet too short: %d < 4", decoder.Length())
378 }
379 _actionbsngentable.TableId = uint32(decoder.ReadUint32())
380
381 for decoder.Length() >= 4 {
382 item, err := DecodeBsnTlv(decoder)
383 if err != nil {
384 return nil, err
385 }
386 if item != nil {
387 _actionbsngentable.Key = append(_actionbsngentable.Key, item)
388 }
389 }
390 return _actionbsngentable, nil
391}
392
393func NewActionBsnGentable() *ActionBsnGentable {
394 obj := &ActionBsnGentable{
395 ActionBsn: NewActionBsn(5),
396 }
397 return obj
398}
399func (self *ActionBsnGentable) GetActionName() string {
400 return "bsn_gentable"
401}
402
403func (self *ActionBsnGentable) GetActionFields() map[string]interface{} {
404 return map[string]interface{}{
405 "TableId": self.TableId,
406 "Key": self.Key,
407 }
408}
409
410func (self *ActionBsnGentable) MarshalJSON() ([]byte, error) {
411 jsonValue, err := json.Marshal(self.GetActionFields())
412 if err != nil {
413 return nil, err
414 }
415 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
416}
417
418type ActionBsnMirror struct {
419 *ActionBsn
420 DestPort uint32
421 VlanTag uint32
422 CopyStage uint8
423}
424
425type IActionBsnMirror interface {
426 IActionBsn
427 GetDestPort() uint32
428 GetVlanTag() uint32
429 GetCopyStage() uint8
430}
431
432func (self *ActionBsnMirror) GetDestPort() uint32 {
433 return self.DestPort
434}
435
436func (self *ActionBsnMirror) SetDestPort(v uint32) {
437 self.DestPort = v
438}
439
440func (self *ActionBsnMirror) GetVlanTag() uint32 {
441 return self.VlanTag
442}
443
444func (self *ActionBsnMirror) SetVlanTag(v uint32) {
445 self.VlanTag = v
446}
447
448func (self *ActionBsnMirror) GetCopyStage() uint8 {
449 return self.CopyStage
450}
451
452func (self *ActionBsnMirror) SetCopyStage(v uint8) {
453 self.CopyStage = v
454}
455
456func (self *ActionBsnMirror) Serialize(encoder *goloxi.Encoder) error {
457 startIndex := len(encoder.Bytes())
458 if err := self.ActionBsn.Serialize(encoder); err != nil {
459 return err
460 }
461
462 encoder.PutUint32(uint32(self.DestPort))
463 encoder.PutUint32(uint32(self.VlanTag))
464 encoder.PutUint8(uint8(self.CopyStage))
465 encoder.Write(bytes.Repeat([]byte{0}, 3))
466 length := len(encoder.Bytes()) - startIndex
467
468 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
469
470 return nil
471}
472
473func DecodeActionBsnMirror(parent *ActionBsn, decoder *goloxi.Decoder) (*ActionBsnMirror, error) {
474 _actionbsnmirror := &ActionBsnMirror{ActionBsn: parent}
475 if decoder.Length() < 12 {
476 return nil, fmt.Errorf("ActionBsnMirror packet too short: %d < 12", decoder.Length())
477 }
478 _actionbsnmirror.DestPort = uint32(decoder.ReadUint32())
479 _actionbsnmirror.VlanTag = uint32(decoder.ReadUint32())
480 _actionbsnmirror.CopyStage = uint8(decoder.ReadByte())
481 decoder.Skip(3)
482 return _actionbsnmirror, nil
483}
484
485func NewActionBsnMirror() *ActionBsnMirror {
486 obj := &ActionBsnMirror{
487 ActionBsn: NewActionBsn(1),
488 }
489 return obj
490}
491func (self *ActionBsnMirror) GetActionName() string {
492 return "bsn_mirror"
493}
494
495func (self *ActionBsnMirror) GetActionFields() map[string]interface{} {
496 return map[string]interface{}{
497 "DestPort": self.DestPort,
498 "VlanTag": self.VlanTag,
499 "CopyStage": self.CopyStage,
500 }
501}
502
503func (self *ActionBsnMirror) MarshalJSON() ([]byte, error) {
504 jsonValue, err := json.Marshal(self.GetActionFields())
505 if err != nil {
506 return nil, err
507 }
508 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
509}
510
511type ActionBsnSetTunnelDst struct {
512 *ActionBsn
513 Dst uint32
514}
515
516type IActionBsnSetTunnelDst interface {
517 IActionBsn
518 GetDst() uint32
519}
520
521func (self *ActionBsnSetTunnelDst) GetDst() uint32 {
522 return self.Dst
523}
524
525func (self *ActionBsnSetTunnelDst) SetDst(v uint32) {
526 self.Dst = v
527}
528
529func (self *ActionBsnSetTunnelDst) Serialize(encoder *goloxi.Encoder) error {
530 startIndex := len(encoder.Bytes())
531 if err := self.ActionBsn.Serialize(encoder); err != nil {
532 return err
533 }
534
535 encoder.PutUint32(uint32(self.Dst))
536 length := len(encoder.Bytes()) - startIndex
537
538 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
539
540 return nil
541}
542
543func DecodeActionBsnSetTunnelDst(parent *ActionBsn, decoder *goloxi.Decoder) (*ActionBsnSetTunnelDst, error) {
544 _actionbsnsettunneldst := &ActionBsnSetTunnelDst{ActionBsn: parent}
545 if decoder.Length() < 4 {
546 return nil, fmt.Errorf("ActionBsnSetTunnelDst packet too short: %d < 4", decoder.Length())
547 }
548 _actionbsnsettunneldst.Dst = uint32(decoder.ReadUint32())
549 return _actionbsnsettunneldst, nil
550}
551
552func NewActionBsnSetTunnelDst() *ActionBsnSetTunnelDst {
553 obj := &ActionBsnSetTunnelDst{
554 ActionBsn: NewActionBsn(2),
555 }
556 return obj
557}
558func (self *ActionBsnSetTunnelDst) GetActionName() string {
559 return "bsn_set_tunnel_dst"
560}
561
562func (self *ActionBsnSetTunnelDst) GetActionFields() map[string]interface{} {
563 return map[string]interface{}{
564 "Dst": self.Dst,
565 }
566}
567
568func (self *ActionBsnSetTunnelDst) MarshalJSON() ([]byte, error) {
569 jsonValue, err := json.Marshal(self.GetActionFields())
570 if err != nil {
571 return nil, err
572 }
573 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
574}
575
576type ActionCopyTtlIn struct {
577 *Action
578}
579
580type IActionCopyTtlIn interface {
581 goloxi.IAction
582}
583
584func (self *ActionCopyTtlIn) Serialize(encoder *goloxi.Encoder) error {
585 startIndex := len(encoder.Bytes())
586 if err := self.Action.Serialize(encoder); err != nil {
587 return err
588 }
589
590 encoder.Write(bytes.Repeat([]byte{0}, 4))
591 length := len(encoder.Bytes()) - startIndex
592
593 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
594
595 return nil
596}
597
598func DecodeActionCopyTtlIn(parent *Action, decoder *goloxi.Decoder) (*ActionCopyTtlIn, error) {
599 _actioncopyttlin := &ActionCopyTtlIn{Action: parent}
600 if decoder.Length() < 4 {
601 return nil, fmt.Errorf("ActionCopyTtlIn packet too short: %d < 4", decoder.Length())
602 }
603 decoder.Skip(4)
604 return _actioncopyttlin, nil
605}
606
607func NewActionCopyTtlIn() *ActionCopyTtlIn {
608 obj := &ActionCopyTtlIn{
609 Action: NewAction(12),
610 }
611 return obj
612}
613func (self *ActionCopyTtlIn) GetActionName() string {
614 return "copy_ttl_in"
615}
616
617func (self *ActionCopyTtlIn) GetActionFields() map[string]interface{} {
618 return map[string]interface{}{}
619}
620
621func (self *ActionCopyTtlIn) MarshalJSON() ([]byte, error) {
622 jsonValue, err := json.Marshal(self.GetActionFields())
623 if err != nil {
624 return nil, err
625 }
626 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
627}
628
629type ActionCopyTtlOut struct {
630 *Action
631}
632
633type IActionCopyTtlOut interface {
634 goloxi.IAction
635}
636
637func (self *ActionCopyTtlOut) Serialize(encoder *goloxi.Encoder) error {
638 startIndex := len(encoder.Bytes())
639 if err := self.Action.Serialize(encoder); err != nil {
640 return err
641 }
642
643 encoder.Write(bytes.Repeat([]byte{0}, 4))
644 length := len(encoder.Bytes()) - startIndex
645
646 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
647
648 return nil
649}
650
651func DecodeActionCopyTtlOut(parent *Action, decoder *goloxi.Decoder) (*ActionCopyTtlOut, error) {
652 _actioncopyttlout := &ActionCopyTtlOut{Action: parent}
653 if decoder.Length() < 4 {
654 return nil, fmt.Errorf("ActionCopyTtlOut packet too short: %d < 4", decoder.Length())
655 }
656 decoder.Skip(4)
657 return _actioncopyttlout, nil
658}
659
660func NewActionCopyTtlOut() *ActionCopyTtlOut {
661 obj := &ActionCopyTtlOut{
662 Action: NewAction(11),
663 }
664 return obj
665}
666func (self *ActionCopyTtlOut) GetActionName() string {
667 return "copy_ttl_out"
668}
669
670func (self *ActionCopyTtlOut) GetActionFields() map[string]interface{} {
671 return map[string]interface{}{}
672}
673
674func (self *ActionCopyTtlOut) MarshalJSON() ([]byte, error) {
675 jsonValue, err := json.Marshal(self.GetActionFields())
676 if err != nil {
677 return nil, err
678 }
679 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
680}
681
682type ActionDecMplsTtl struct {
683 *Action
684}
685
686type IActionDecMplsTtl interface {
687 goloxi.IAction
688}
689
690func (self *ActionDecMplsTtl) Serialize(encoder *goloxi.Encoder) error {
691 startIndex := len(encoder.Bytes())
692 if err := self.Action.Serialize(encoder); err != nil {
693 return err
694 }
695
696 encoder.Write(bytes.Repeat([]byte{0}, 4))
697 length := len(encoder.Bytes()) - startIndex
698
699 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
700
701 return nil
702}
703
704func DecodeActionDecMplsTtl(parent *Action, decoder *goloxi.Decoder) (*ActionDecMplsTtl, error) {
705 _actiondecmplsttl := &ActionDecMplsTtl{Action: parent}
706 if decoder.Length() < 4 {
707 return nil, fmt.Errorf("ActionDecMplsTtl packet too short: %d < 4", decoder.Length())
708 }
709 decoder.Skip(4)
710 return _actiondecmplsttl, nil
711}
712
713func NewActionDecMplsTtl() *ActionDecMplsTtl {
714 obj := &ActionDecMplsTtl{
715 Action: NewAction(16),
716 }
717 return obj
718}
719func (self *ActionDecMplsTtl) GetActionName() string {
720 return "dec_mpls_ttl"
721}
722
723func (self *ActionDecMplsTtl) GetActionFields() map[string]interface{} {
724 return map[string]interface{}{}
725}
726
727func (self *ActionDecMplsTtl) MarshalJSON() ([]byte, error) {
728 jsonValue, err := json.Marshal(self.GetActionFields())
729 if err != nil {
730 return nil, err
731 }
732 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
733}
734
735type ActionDecNwTtl struct {
736 *Action
737}
738
739type IActionDecNwTtl interface {
740 goloxi.IAction
741}
742
743func (self *ActionDecNwTtl) Serialize(encoder *goloxi.Encoder) error {
744 startIndex := len(encoder.Bytes())
745 if err := self.Action.Serialize(encoder); err != nil {
746 return err
747 }
748
749 encoder.Write(bytes.Repeat([]byte{0}, 4))
750 length := len(encoder.Bytes()) - startIndex
751
752 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
753
754 return nil
755}
756
757func DecodeActionDecNwTtl(parent *Action, decoder *goloxi.Decoder) (*ActionDecNwTtl, error) {
758 _actiondecnwttl := &ActionDecNwTtl{Action: parent}
759 if decoder.Length() < 4 {
760 return nil, fmt.Errorf("ActionDecNwTtl packet too short: %d < 4", decoder.Length())
761 }
762 decoder.Skip(4)
763 return _actiondecnwttl, nil
764}
765
766func NewActionDecNwTtl() *ActionDecNwTtl {
767 obj := &ActionDecNwTtl{
768 Action: NewAction(24),
769 }
770 return obj
771}
772func (self *ActionDecNwTtl) GetActionName() string {
773 return "dec_nw_ttl"
774}
775
776func (self *ActionDecNwTtl) GetActionFields() map[string]interface{} {
777 return map[string]interface{}{}
778}
779
780func (self *ActionDecNwTtl) MarshalJSON() ([]byte, error) {
781 jsonValue, err := json.Marshal(self.GetActionFields())
782 if err != nil {
783 return nil, err
784 }
785 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
786}
787
788type ActionGroup struct {
789 *Action
790 GroupId uint32
791}
792
793type IActionGroup interface {
794 goloxi.IAction
795 GetGroupId() uint32
796}
797
798func (self *ActionGroup) GetGroupId() uint32 {
799 return self.GroupId
800}
801
802func (self *ActionGroup) SetGroupId(v uint32) {
803 self.GroupId = v
804}
805
806func (self *ActionGroup) Serialize(encoder *goloxi.Encoder) error {
807 startIndex := len(encoder.Bytes())
808 if err := self.Action.Serialize(encoder); err != nil {
809 return err
810 }
811
812 encoder.PutUint32(uint32(self.GroupId))
813 length := len(encoder.Bytes()) - startIndex
814
815 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
816
817 return nil
818}
819
820func DecodeActionGroup(parent *Action, decoder *goloxi.Decoder) (*ActionGroup, error) {
821 _actiongroup := &ActionGroup{Action: parent}
822 if decoder.Length() < 4 {
823 return nil, fmt.Errorf("ActionGroup packet too short: %d < 4", decoder.Length())
824 }
825 _actiongroup.GroupId = uint32(decoder.ReadUint32())
826 return _actiongroup, nil
827}
828
829func NewActionGroup() *ActionGroup {
830 obj := &ActionGroup{
831 Action: NewAction(22),
832 }
833 return obj
834}
835func (self *ActionGroup) GetActionName() string {
836 return "group"
837}
838
839func (self *ActionGroup) GetActionFields() map[string]interface{} {
840 return map[string]interface{}{
841 "GroupId": self.GroupId,
842 }
843}
844
845func (self *ActionGroup) MarshalJSON() ([]byte, error) {
846 jsonValue, err := json.Marshal(self.GetActionFields())
847 if err != nil {
848 return nil, err
849 }
850 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
851}
852
853type ActionMeter struct {
854 *Action
855 MeterId uint32
856}
857
858type IActionMeter interface {
859 goloxi.IAction
860 GetMeterId() uint32
861}
862
863func (self *ActionMeter) GetMeterId() uint32 {
864 return self.MeterId
865}
866
867func (self *ActionMeter) SetMeterId(v uint32) {
868 self.MeterId = v
869}
870
871func (self *ActionMeter) Serialize(encoder *goloxi.Encoder) error {
872 startIndex := len(encoder.Bytes())
873 if err := self.Action.Serialize(encoder); err != nil {
874 return err
875 }
876
877 encoder.PutUint32(uint32(self.MeterId))
878 length := len(encoder.Bytes()) - startIndex
879
880 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
881
882 return nil
883}
884
885func DecodeActionMeter(parent *Action, decoder *goloxi.Decoder) (*ActionMeter, error) {
886 _actionmeter := &ActionMeter{Action: parent}
887 if decoder.Length() < 4 {
888 return nil, fmt.Errorf("ActionMeter packet too short: %d < 4", decoder.Length())
889 }
890 _actionmeter.MeterId = uint32(decoder.ReadUint32())
891 return _actionmeter, nil
892}
893
894func NewActionMeter() *ActionMeter {
895 obj := &ActionMeter{
896 Action: NewAction(29),
897 }
898 return obj
899}
900func (self *ActionMeter) GetActionName() string {
901 return "meter"
902}
903
904func (self *ActionMeter) GetActionFields() map[string]interface{} {
905 return map[string]interface{}{
906 "MeterId": self.MeterId,
907 }
908}
909
910func (self *ActionMeter) MarshalJSON() ([]byte, error) {
911 jsonValue, err := json.Marshal(self.GetActionFields())
912 if err != nil {
913 return nil, err
914 }
915 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
916}
917
918type ActionNicira struct {
919 *ActionExperimenter
920 Subtype uint16
921}
922
923type IActionNicira interface {
924 IActionExperimenter
925 GetSubtype() uint16
926}
927
928func (self *ActionNicira) GetSubtype() uint16 {
929 return self.Subtype
930}
931
932func (self *ActionNicira) SetSubtype(v uint16) {
933 self.Subtype = v
934}
935
936func (self *ActionNicira) Serialize(encoder *goloxi.Encoder) error {
937 if err := self.ActionExperimenter.Serialize(encoder); err != nil {
938 return err
939 }
940
941 encoder.PutUint16(uint16(self.Subtype))
942
943 return nil
944}
945
946func DecodeActionNicira(parent *ActionExperimenter, decoder *goloxi.Decoder) (IActionNicira, error) {
947 _actionnicira := &ActionNicira{ActionExperimenter: parent}
948 if decoder.Length() < 2 {
949 return nil, fmt.Errorf("ActionNicira packet too short: %d < 2", decoder.Length())
950 }
951 _actionnicira.Subtype = uint16(decoder.ReadUint16())
952
953 switch _actionnicira.Subtype {
954 case 1:
955 return DecodeActionNxResubmit(_actionnicira, decoder)
956 case 2:
957 return DecodeActionNxSetTunnel(_actionnicira, decoder)
958 case 4:
959 return DecodeActionNxSetQueue(_actionnicira, decoder)
960 case 5:
961 return DecodeActionNxPopQueue(_actionnicira, decoder)
962 case 6:
963 return DecodeActionNxRegMove(_actionnicira, decoder)
964 case 7:
965 return DecodeActionNxRegLoad(_actionnicira, decoder)
966 case 8:
967 return DecodeActionNxNote(_actionnicira, decoder)
968 case 9:
969 return DecodeActionNxSetTunnel64(_actionnicira, decoder)
970 case 10:
971 return DecodeActionNxMultipath(_actionnicira, decoder)
972 case 12:
973 return DecodeActionNxBundle(_actionnicira, decoder)
974 case 13:
975 return DecodeActionNxBundleLoadInPort(_actionnicira, decoder)
976 case 14:
977 return DecodeActionResubmit(_actionnicira, decoder)
978 case 15:
979 return DecodeActionNxOutputReg(_actionnicira, decoder)
980 case 16:
981 return DecodeActionNxLearn(_actionnicira, decoder)
982 case 17:
983 return DecodeActionNxExit(_actionnicira, decoder)
984 case 18:
985 return DecodeActionNiciraDecTtl(_actionnicira, decoder)
986 case 19:
987 return DecodeActionNxFinTimeout(_actionnicira, decoder)
988 case 20:
989 return DecodeActionNxController(_actionnicira, decoder)
990 case 21:
991 return DecodeActionNxDecTtlCntIds(_actionnicira, decoder)
992 case 22:
993 return DecodeActionNxWriteMetadata(_actionnicira, decoder)
994 case 23:
995 return DecodeActionNxPushMpls(_actionnicira, decoder)
996 case 24:
997 return DecodeActionNxPopMpls(_actionnicira, decoder)
998 case 25:
999 return DecodeActionNxSetMplsTtl(_actionnicira, decoder)
1000 case 26:
1001 return DecodeActionNxDecMplsTtl(_actionnicira, decoder)
1002 case 27:
1003 return DecodeActionNxStackPush(_actionnicira, decoder)
1004 case 28:
1005 return DecodeActionNxStackPop(_actionnicira, decoder)
1006 case 29:
1007 return DecodeActionNxSample(_actionnicira, decoder)
1008 case 30:
1009 return DecodeActionNxSetMplsLabel(_actionnicira, decoder)
1010 case 31:
1011 return DecodeActionNxSetMplsTc(_actionnicira, decoder)
1012 case 32:
1013 return DecodeActionNxOutputReg2(_actionnicira, decoder)
1014 case 33:
1015 return DecodeActionNxRegLoad2(_actionnicira, decoder)
1016 case 34:
1017 return DecodeActionNxConjunction(_actionnicira, decoder)
1018 case 35:
1019 return DecodeActionNxCt(_actionnicira, decoder)
1020 case 36:
1021 return DecodeActionNxNat(_actionnicira, decoder)
1022 case 37:
1023 return DecodeActionNxController2(_actionnicira, decoder)
1024 case 38:
1025 return DecodeActionNxSample2(_actionnicira, decoder)
1026 case 39:
1027 return DecodeActionNxOutputTrunc(_actionnicira, decoder)
1028 case 40:
1029 return DecodeActionNxGroup(_actionnicira, decoder)
1030 case 41:
1031 return DecodeActionNxSample3(_actionnicira, decoder)
1032 case 42:
1033 return DecodeActionNxClone(_actionnicira, decoder)
1034 case 43:
1035 return DecodeActionNxCtClear(_actionnicira, decoder)
1036 case 44:
1037 return DecodeActionNxResubmitTableCt(_actionnicira, decoder)
1038 case 45:
1039 return DecodeActionNxLearn2(_actionnicira, decoder)
1040 case 46:
1041 return DecodeActionNxEncap(_actionnicira, decoder)
1042 case 47:
1043 return DecodeActionNxDecap(_actionnicira, decoder)
1044 case 48:
1045 return DecodeActionNxDecNshTtl(_actionnicira, decoder)
1046 case 254:
1047 return DecodeActionNxDebugSlow(_actionnicira, decoder)
1048 case 255:
1049 return DecodeActionNxDebugRecirc(_actionnicira, decoder)
1050 default:
1051 return nil, fmt.Errorf("Invalid type '%d' for 'ActionNicira'", _actionnicira.Subtype)
1052 }
1053}
1054
1055func NewActionNicira(_subtype uint16) *ActionNicira {
1056 obj := &ActionNicira{
1057 ActionExperimenter: NewActionExperimenter(8992),
1058 }
1059 obj.Subtype = _subtype
1060 return obj
1061}
1062func (self *ActionNicira) GetActionName() string {
1063 return "nicira"
1064}
1065
1066func (self *ActionNicira) GetActionFields() map[string]interface{} {
1067 return map[string]interface{}{
1068 "Subtype": self.Subtype,
1069 }
1070}
1071
1072func (self *ActionNicira) MarshalJSON() ([]byte, error) {
1073 jsonValue, err := json.Marshal(self.GetActionFields())
1074 if err != nil {
1075 return nil, err
1076 }
1077 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
1078}
1079
1080type ActionNiciraDecTtl struct {
1081 *ActionNicira
1082}
1083
1084type IActionNiciraDecTtl interface {
1085 IActionNicira
1086}
1087
1088func (self *ActionNiciraDecTtl) Serialize(encoder *goloxi.Encoder) error {
1089 startIndex := len(encoder.Bytes())
1090 if err := self.ActionNicira.Serialize(encoder); err != nil {
1091 return err
1092 }
1093
1094 encoder.Write(bytes.Repeat([]byte{0}, 2))
1095 encoder.Write(bytes.Repeat([]byte{0}, 4))
1096 length := len(encoder.Bytes()) - startIndex
1097
1098 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
1099
1100 return nil
1101}
1102
1103func DecodeActionNiciraDecTtl(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNiciraDecTtl, error) {
1104 _actionniciradecttl := &ActionNiciraDecTtl{ActionNicira: parent}
1105 if decoder.Length() < 6 {
1106 return nil, fmt.Errorf("ActionNiciraDecTtl packet too short: %d < 6", decoder.Length())
1107 }
1108 decoder.Skip(2)
1109 decoder.Skip(4)
1110 return _actionniciradecttl, nil
1111}
1112
1113func NewActionNiciraDecTtl() *ActionNiciraDecTtl {
1114 obj := &ActionNiciraDecTtl{
1115 ActionNicira: NewActionNicira(18),
1116 }
1117 return obj
1118}
1119func (self *ActionNiciraDecTtl) GetActionName() string {
1120 return "nicira_dec_ttl"
1121}
1122
1123func (self *ActionNiciraDecTtl) GetActionFields() map[string]interface{} {
1124 return map[string]interface{}{}
1125}
1126
1127func (self *ActionNiciraDecTtl) MarshalJSON() ([]byte, error) {
1128 jsonValue, err := json.Marshal(self.GetActionFields())
1129 if err != nil {
1130 return nil, err
1131 }
1132 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
1133}
1134
1135type ActionNxBundle struct {
1136 *ActionNicira
1137 Algorithm uint16
1138 Fields NxHashFields
1139 Basis uint16
1140 SlaveType ActionNxBundleSlaveType
1141 NSlaves uint16
1142 OfsNbits uint16
1143 Dst goloxi.IOxmId
1144}
1145
1146type IActionNxBundle interface {
1147 IActionNicira
1148 GetAlgorithm() uint16
1149 GetFields() NxHashFields
1150 GetBasis() uint16
1151 GetSlaveType() ActionNxBundleSlaveType
1152 GetNSlaves() uint16
1153 GetOfsNbits() uint16
1154 GetDst() goloxi.IOxmId
1155}
1156
1157func (self *ActionNxBundle) GetAlgorithm() uint16 {
1158 return self.Algorithm
1159}
1160
1161func (self *ActionNxBundle) SetAlgorithm(v uint16) {
1162 self.Algorithm = v
1163}
1164
1165func (self *ActionNxBundle) GetFields() NxHashFields {
1166 return self.Fields
1167}
1168
1169func (self *ActionNxBundle) SetFields(v NxHashFields) {
1170 self.Fields = v
1171}
1172
1173func (self *ActionNxBundle) GetBasis() uint16 {
1174 return self.Basis
1175}
1176
1177func (self *ActionNxBundle) SetBasis(v uint16) {
1178 self.Basis = v
1179}
1180
1181func (self *ActionNxBundle) GetSlaveType() ActionNxBundleSlaveType {
1182 return self.SlaveType
1183}
1184
1185func (self *ActionNxBundle) SetSlaveType(v ActionNxBundleSlaveType) {
1186 self.SlaveType = v
1187}
1188
1189func (self *ActionNxBundle) GetNSlaves() uint16 {
1190 return self.NSlaves
1191}
1192
1193func (self *ActionNxBundle) SetNSlaves(v uint16) {
1194 self.NSlaves = v
1195}
1196
1197func (self *ActionNxBundle) GetOfsNbits() uint16 {
1198 return self.OfsNbits
1199}
1200
1201func (self *ActionNxBundle) SetOfsNbits(v uint16) {
1202 self.OfsNbits = v
1203}
1204
1205func (self *ActionNxBundle) GetDst() goloxi.IOxmId {
1206 return self.Dst
1207}
1208
1209func (self *ActionNxBundle) SetDst(v goloxi.IOxmId) {
1210 self.Dst = v
1211}
1212
1213func (self *ActionNxBundle) Serialize(encoder *goloxi.Encoder) error {
1214 startIndex := len(encoder.Bytes())
1215 if err := self.ActionNicira.Serialize(encoder); err != nil {
1216 return err
1217 }
1218
1219 encoder.PutUint16(uint16(self.Algorithm))
1220 encoder.PutUint16(uint16(self.Fields))
1221 encoder.PutUint16(uint16(self.Basis))
1222 encoder.PutUint32(uint32(self.SlaveType))
1223 encoder.PutUint16(uint16(self.NSlaves))
1224 encoder.PutUint16(uint16(self.OfsNbits))
1225 self.Dst.Serialize(encoder)
1226 encoder.Write(bytes.Repeat([]byte{0}, 4))
1227 length := len(encoder.Bytes()) - startIndex
1228
1229 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
1230
1231 return nil
1232}
1233
1234func DecodeActionNxBundle(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxBundle, error) {
1235 _actionnxbundle := &ActionNxBundle{ActionNicira: parent}
1236 if decoder.Length() < 22 {
1237 return nil, fmt.Errorf("ActionNxBundle packet too short: %d < 22", decoder.Length())
1238 }
1239 _actionnxbundle.Algorithm = uint16(decoder.ReadUint16())
1240 _actionnxbundle.Fields = NxHashFields(decoder.ReadUint16())
1241 _actionnxbundle.Basis = uint16(decoder.ReadUint16())
1242 _actionnxbundle.SlaveType = ActionNxBundleSlaveType(decoder.ReadUint32())
1243 _actionnxbundle.NSlaves = uint16(decoder.ReadUint16())
1244 _actionnxbundle.OfsNbits = uint16(decoder.ReadUint16())
1245 if obj, err := DecodeOxmId(decoder); err != nil {
1246 return nil, err
1247 } else {
1248 _actionnxbundle.Dst = obj
1249 }
1250
1251 decoder.Skip(4)
1252 return _actionnxbundle, nil
1253}
1254
1255func NewActionNxBundle() *ActionNxBundle {
1256 obj := &ActionNxBundle{
1257 ActionNicira: NewActionNicira(12),
1258 }
1259 return obj
1260}
1261func (self *ActionNxBundle) GetActionName() string {
1262 return "nx_bundle"
1263}
1264
1265func (self *ActionNxBundle) GetActionFields() map[string]interface{} {
1266 return map[string]interface{}{
1267 "Algorithm": self.Algorithm,
1268 "Fields": self.Fields,
1269 "Basis": self.Basis,
1270 "SlaveType": self.SlaveType,
1271 "NSlaves": self.NSlaves,
1272 "OfsNbits": self.OfsNbits,
1273 "Dst": self.Dst,
1274 }
1275}
1276
1277func (self *ActionNxBundle) MarshalJSON() ([]byte, error) {
1278 jsonValue, err := json.Marshal(self.GetActionFields())
1279 if err != nil {
1280 return nil, err
1281 }
1282 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
1283}
1284
1285type ActionNxBundleLoad struct {
1286 *ActionNicira
1287 Algorithm NxBdAlgorithms
1288 Fields NxHashFields
1289 Basis uint16
1290 SlaveType ActionNxBundleSlaveType
1291 NSlaves uint16
1292 OfsNbits uint16
1293 Dst goloxi.IOxmId
1294}
1295
1296type IActionNxBundleLoad interface {
1297 IActionNicira
1298 GetAlgorithm() NxBdAlgorithms
1299 GetFields() NxHashFields
1300 GetBasis() uint16
1301 GetSlaveType() ActionNxBundleSlaveType
1302 GetNSlaves() uint16
1303 GetOfsNbits() uint16
1304 GetDst() goloxi.IOxmId
1305}
1306
1307func (self *ActionNxBundleLoad) GetAlgorithm() NxBdAlgorithms {
1308 return self.Algorithm
1309}
1310
1311func (self *ActionNxBundleLoad) SetAlgorithm(v NxBdAlgorithms) {
1312 self.Algorithm = v
1313}
1314
1315func (self *ActionNxBundleLoad) GetFields() NxHashFields {
1316 return self.Fields
1317}
1318
1319func (self *ActionNxBundleLoad) SetFields(v NxHashFields) {
1320 self.Fields = v
1321}
1322
1323func (self *ActionNxBundleLoad) GetBasis() uint16 {
1324 return self.Basis
1325}
1326
1327func (self *ActionNxBundleLoad) SetBasis(v uint16) {
1328 self.Basis = v
1329}
1330
1331func (self *ActionNxBundleLoad) GetSlaveType() ActionNxBundleSlaveType {
1332 return self.SlaveType
1333}
1334
1335func (self *ActionNxBundleLoad) SetSlaveType(v ActionNxBundleSlaveType) {
1336 self.SlaveType = v
1337}
1338
1339func (self *ActionNxBundleLoad) GetNSlaves() uint16 {
1340 return self.NSlaves
1341}
1342
1343func (self *ActionNxBundleLoad) SetNSlaves(v uint16) {
1344 self.NSlaves = v
1345}
1346
1347func (self *ActionNxBundleLoad) GetOfsNbits() uint16 {
1348 return self.OfsNbits
1349}
1350
1351func (self *ActionNxBundleLoad) SetOfsNbits(v uint16) {
1352 self.OfsNbits = v
1353}
1354
1355func (self *ActionNxBundleLoad) GetDst() goloxi.IOxmId {
1356 return self.Dst
1357}
1358
1359func (self *ActionNxBundleLoad) SetDst(v goloxi.IOxmId) {
1360 self.Dst = v
1361}
1362
1363func (self *ActionNxBundleLoad) Serialize(encoder *goloxi.Encoder) error {
1364 if err := self.ActionNicira.Serialize(encoder); err != nil {
1365 return err
1366 }
1367
1368 encoder.PutUint16(uint16(self.Algorithm))
1369 encoder.PutUint16(uint16(self.Fields))
1370 encoder.PutUint16(uint16(self.Basis))
1371 encoder.PutUint32(uint32(self.SlaveType))
1372 encoder.PutUint16(uint16(self.NSlaves))
1373 encoder.PutUint16(uint16(self.OfsNbits))
1374 self.Dst.Serialize(encoder)
1375
1376 return nil
1377}
1378
1379func DecodeActionNxBundleLoad(parent *ActionNicira, decoder *goloxi.Decoder) (IActionNxBundleLoad, error) {
1380 _actionnxbundleload := &ActionNxBundleLoad{ActionNicira: parent}
1381 if decoder.Length() < 18 {
1382 return nil, fmt.Errorf("ActionNxBundleLoad packet too short: %d < 18", decoder.Length())
1383 }
1384 _actionnxbundleload.Algorithm = NxBdAlgorithms(decoder.ReadUint16())
1385 _actionnxbundleload.Fields = NxHashFields(decoder.ReadUint16())
1386 _actionnxbundleload.Basis = uint16(decoder.ReadUint16())
1387 _actionnxbundleload.SlaveType = ActionNxBundleSlaveType(decoder.ReadUint32())
1388 _actionnxbundleload.NSlaves = uint16(decoder.ReadUint16())
1389 _actionnxbundleload.OfsNbits = uint16(decoder.ReadUint16())
1390 if obj, err := DecodeOxmId(decoder); err != nil {
1391 return nil, err
1392 } else {
1393 _actionnxbundleload.Dst = obj
1394 }
1395
1396 return _actionnxbundleload, nil
1397}
1398
1399func NewActionNxBundleLoad(_slave_type ActionNxBundleSlaveType) *ActionNxBundleLoad {
1400 obj := &ActionNxBundleLoad{
1401 ActionNicira: NewActionNicira(13),
1402 }
1403 obj.SlaveType = _slave_type
1404 return obj
1405}
1406func (self *ActionNxBundleLoad) GetActionName() string {
1407 return "nx_bundle_load"
1408}
1409
1410func (self *ActionNxBundleLoad) GetActionFields() map[string]interface{} {
1411 return map[string]interface{}{
1412 "Algorithm": self.Algorithm,
1413 "Fields": self.Fields,
1414 "Basis": self.Basis,
1415 "SlaveType": self.SlaveType,
1416 "NSlaves": self.NSlaves,
1417 "OfsNbits": self.OfsNbits,
1418 "Dst": self.Dst,
1419 }
1420}
1421
1422func (self *ActionNxBundleLoad) MarshalJSON() ([]byte, error) {
1423 jsonValue, err := json.Marshal(self.GetActionFields())
1424 if err != nil {
1425 return nil, err
1426 }
1427 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
1428}
1429
1430type ActionNxBundleLoadInPort struct {
1431 *ActionNicira
1432 Algorithm NxBdAlgorithms
1433 Fields NxHashFields
1434 Basis uint16
1435 SlaveType ActionNxBundleSlaveType
1436 NSlaves uint16
1437 OfsNbits uint16
1438 Dst goloxi.IOxmId
1439 InPorts []*ActionNxBundleLoadSlave
1440}
1441
1442type IActionNxBundleLoadInPort interface {
1443 IActionNicira
1444 GetAlgorithm() NxBdAlgorithms
1445 GetFields() NxHashFields
1446 GetBasis() uint16
1447 GetSlaveType() ActionNxBundleSlaveType
1448 GetNSlaves() uint16
1449 GetOfsNbits() uint16
1450 GetDst() goloxi.IOxmId
1451 GetInPorts() []*ActionNxBundleLoadSlave
1452}
1453
1454func (self *ActionNxBundleLoadInPort) GetAlgorithm() NxBdAlgorithms {
1455 return self.Algorithm
1456}
1457
1458func (self *ActionNxBundleLoadInPort) SetAlgorithm(v NxBdAlgorithms) {
1459 self.Algorithm = v
1460}
1461
1462func (self *ActionNxBundleLoadInPort) GetFields() NxHashFields {
1463 return self.Fields
1464}
1465
1466func (self *ActionNxBundleLoadInPort) SetFields(v NxHashFields) {
1467 self.Fields = v
1468}
1469
1470func (self *ActionNxBundleLoadInPort) GetBasis() uint16 {
1471 return self.Basis
1472}
1473
1474func (self *ActionNxBundleLoadInPort) SetBasis(v uint16) {
1475 self.Basis = v
1476}
1477
1478func (self *ActionNxBundleLoadInPort) GetSlaveType() ActionNxBundleSlaveType {
1479 return self.SlaveType
1480}
1481
1482func (self *ActionNxBundleLoadInPort) SetSlaveType(v ActionNxBundleSlaveType) {
1483 self.SlaveType = v
1484}
1485
1486func (self *ActionNxBundleLoadInPort) GetNSlaves() uint16 {
1487 return self.NSlaves
1488}
1489
1490func (self *ActionNxBundleLoadInPort) SetNSlaves(v uint16) {
1491 self.NSlaves = v
1492}
1493
1494func (self *ActionNxBundleLoadInPort) GetOfsNbits() uint16 {
1495 return self.OfsNbits
1496}
1497
1498func (self *ActionNxBundleLoadInPort) SetOfsNbits(v uint16) {
1499 self.OfsNbits = v
1500}
1501
1502func (self *ActionNxBundleLoadInPort) GetDst() goloxi.IOxmId {
1503 return self.Dst
1504}
1505
1506func (self *ActionNxBundleLoadInPort) SetDst(v goloxi.IOxmId) {
1507 self.Dst = v
1508}
1509
1510func (self *ActionNxBundleLoadInPort) GetInPorts() []*ActionNxBundleLoadSlave {
1511 return self.InPorts
1512}
1513
1514func (self *ActionNxBundleLoadInPort) SetInPorts(v []*ActionNxBundleLoadSlave) {
1515 self.InPorts = v
1516}
1517
1518func (self *ActionNxBundleLoadInPort) Serialize(encoder *goloxi.Encoder) error {
1519 startIndex := len(encoder.Bytes())
1520 if err := self.ActionNicira.Serialize(encoder); err != nil {
1521 return err
1522 }
1523
1524 encoder.PutUint16(uint16(self.Algorithm))
1525 encoder.PutUint16(uint16(self.Fields))
1526 encoder.PutUint16(uint16(self.Basis))
1527 encoder.PutUint32(uint32(self.SlaveType))
1528 encoder.PutUint16(uint16(self.NSlaves))
1529 encoder.PutUint16(uint16(self.OfsNbits))
1530 self.Dst.Serialize(encoder)
1531 encoder.Write(bytes.Repeat([]byte{0}, 4))
1532 for _, obj := range self.InPorts {
1533 if err := obj.Serialize(encoder); err != nil {
1534 return err
1535 }
1536 }
1537 length := len(encoder.Bytes()) - startIndex
1538
1539 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
1540
1541 return nil
1542}
1543
1544func DecodeActionNxBundleLoadInPort(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxBundleLoadInPort, error) {
1545 _actionnxbundleloadinport := &ActionNxBundleLoadInPort{ActionNicira: parent}
1546 if decoder.Length() < 22 {
1547 return nil, fmt.Errorf("ActionNxBundleLoadInPort packet too short: %d < 22", decoder.Length())
1548 }
1549 _actionnxbundleloadinport.Algorithm = NxBdAlgorithms(decoder.ReadUint16())
1550 _actionnxbundleloadinport.Fields = NxHashFields(decoder.ReadUint16())
1551 _actionnxbundleloadinport.Basis = uint16(decoder.ReadUint16())
1552 _actionnxbundleloadinport.SlaveType = ActionNxBundleSlaveType(decoder.ReadUint32())
1553 _actionnxbundleloadinport.NSlaves = uint16(decoder.ReadUint16())
1554 _actionnxbundleloadinport.OfsNbits = uint16(decoder.ReadUint16())
1555 if obj, err := DecodeOxmId(decoder); err != nil {
1556 return nil, err
1557 } else {
1558 _actionnxbundleloadinport.Dst = obj
1559 }
1560
1561 decoder.Skip(4)
1562
1563 end := decoder.Offset() + int(_actionnxbundleloadinport.NSlaves)
1564 for decoder.Offset() < end {
1565 item, err := DecodeActionNxBundleLoadSlave(decoder)
1566 if err != nil {
1567 return nil, err
1568 }
1569 if item != nil {
1570 _actionnxbundleloadinport.InPorts = append(_actionnxbundleloadinport.InPorts, item)
1571 }
1572 }
1573 return _actionnxbundleloadinport, nil
1574}
1575
1576func NewActionNxBundleLoadInPort() *ActionNxBundleLoadInPort {
1577 obj := &ActionNxBundleLoadInPort{
1578 ActionNicira: NewActionNicira(13),
1579 }
1580 return obj
1581}
1582func (self *ActionNxBundleLoadInPort) GetActionName() string {
1583 return "nx_bundle_load_in_port"
1584}
1585
1586func (self *ActionNxBundleLoadInPort) GetActionFields() map[string]interface{} {
1587 return map[string]interface{}{
1588 "Algorithm": self.Algorithm,
1589 "Fields": self.Fields,
1590 "Basis": self.Basis,
1591 "SlaveType": self.SlaveType,
1592 "NSlaves": self.NSlaves,
1593 "OfsNbits": self.OfsNbits,
1594 "Dst": self.Dst,
1595 "InPorts": self.InPorts,
1596 }
1597}
1598
1599func (self *ActionNxBundleLoadInPort) MarshalJSON() ([]byte, error) {
1600 jsonValue, err := json.Marshal(self.GetActionFields())
1601 if err != nil {
1602 return nil, err
1603 }
1604 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
1605}
1606
1607type ActionNxClone struct {
1608 *ActionNicira
1609 Actions []goloxi.IAction
1610}
1611
1612type IActionNxClone interface {
1613 IActionNicira
1614 GetActions() []goloxi.IAction
1615}
1616
1617func (self *ActionNxClone) GetActions() []goloxi.IAction {
1618 return self.Actions
1619}
1620
1621func (self *ActionNxClone) SetActions(v []goloxi.IAction) {
1622 self.Actions = v
1623}
1624
1625func (self *ActionNxClone) Serialize(encoder *goloxi.Encoder) error {
1626 startIndex := len(encoder.Bytes())
1627 if err := self.ActionNicira.Serialize(encoder); err != nil {
1628 return err
1629 }
1630
1631 encoder.Write(bytes.Repeat([]byte{0}, 6))
1632 for _, obj := range self.Actions {
1633 if err := obj.Serialize(encoder); err != nil {
1634 return err
1635 }
1636 }
1637 length := len(encoder.Bytes()) - startIndex
1638
1639 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
1640
1641 return nil
1642}
1643
1644func DecodeActionNxClone(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxClone, error) {
1645 _actionnxclone := &ActionNxClone{ActionNicira: parent}
1646 if decoder.Length() < 6 {
1647 return nil, fmt.Errorf("ActionNxClone packet too short: %d < 6", decoder.Length())
1648 }
1649 decoder.Skip(6)
1650
1651 for decoder.Length() >= 4 {
1652 item, err := DecodeAction(decoder)
1653 if err != nil {
1654 return nil, err
1655 }
1656 if item != nil {
1657 _actionnxclone.Actions = append(_actionnxclone.Actions, item)
1658 }
1659 }
1660 return _actionnxclone, nil
1661}
1662
1663func NewActionNxClone() *ActionNxClone {
1664 obj := &ActionNxClone{
1665 ActionNicira: NewActionNicira(42),
1666 }
1667 return obj
1668}
1669func (self *ActionNxClone) GetActionName() string {
1670 return "nx_clone"
1671}
1672
1673func (self *ActionNxClone) GetActionFields() map[string]interface{} {
1674 return map[string]interface{}{
1675 "Actions": self.Actions,
1676 }
1677}
1678
1679func (self *ActionNxClone) MarshalJSON() ([]byte, error) {
1680 jsonValue, err := json.Marshal(self.GetActionFields())
1681 if err != nil {
1682 return nil, err
1683 }
1684 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
1685}
1686
1687type ActionNxConjunction struct {
1688 *ActionNicira
1689 Clause uint8
1690 NClauses uint8
1691 Id uint32
1692}
1693
1694type IActionNxConjunction interface {
1695 IActionNicira
1696 GetClause() uint8
1697 GetNClauses() uint8
1698 GetId() uint32
1699}
1700
1701func (self *ActionNxConjunction) GetClause() uint8 {
1702 return self.Clause
1703}
1704
1705func (self *ActionNxConjunction) SetClause(v uint8) {
1706 self.Clause = v
1707}
1708
1709func (self *ActionNxConjunction) GetNClauses() uint8 {
1710 return self.NClauses
1711}
1712
1713func (self *ActionNxConjunction) SetNClauses(v uint8) {
1714 self.NClauses = v
1715}
1716
1717func (self *ActionNxConjunction) GetId() uint32 {
1718 return self.Id
1719}
1720
1721func (self *ActionNxConjunction) SetId(v uint32) {
1722 self.Id = v
1723}
1724
1725func (self *ActionNxConjunction) Serialize(encoder *goloxi.Encoder) error {
1726 startIndex := len(encoder.Bytes())
1727 if err := self.ActionNicira.Serialize(encoder); err != nil {
1728 return err
1729 }
1730
1731 encoder.PutUint8(uint8(self.Clause))
1732 encoder.PutUint8(uint8(self.NClauses))
1733 encoder.PutUint32(uint32(self.Id))
1734 length := len(encoder.Bytes()) - startIndex
1735
1736 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
1737
1738 return nil
1739}
1740
1741func DecodeActionNxConjunction(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxConjunction, error) {
1742 _actionnxconjunction := &ActionNxConjunction{ActionNicira: parent}
1743 if decoder.Length() < 6 {
1744 return nil, fmt.Errorf("ActionNxConjunction packet too short: %d < 6", decoder.Length())
1745 }
1746 _actionnxconjunction.Clause = uint8(decoder.ReadByte())
1747 _actionnxconjunction.NClauses = uint8(decoder.ReadByte())
1748 _actionnxconjunction.Id = uint32(decoder.ReadUint32())
1749 return _actionnxconjunction, nil
1750}
1751
1752func NewActionNxConjunction() *ActionNxConjunction {
1753 obj := &ActionNxConjunction{
1754 ActionNicira: NewActionNicira(34),
1755 }
1756 return obj
1757}
1758func (self *ActionNxConjunction) GetActionName() string {
1759 return "nx_conjunction"
1760}
1761
1762func (self *ActionNxConjunction) GetActionFields() map[string]interface{} {
1763 return map[string]interface{}{
1764 "Clause": self.Clause,
1765 "NClauses": self.NClauses,
1766 "Id": self.Id,
1767 }
1768}
1769
1770func (self *ActionNxConjunction) MarshalJSON() ([]byte, error) {
1771 jsonValue, err := json.Marshal(self.GetActionFields())
1772 if err != nil {
1773 return nil, err
1774 }
1775 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
1776}
1777
1778type ActionNxController struct {
1779 *ActionNicira
1780 MaxLen uint16
1781 ControllerId uint16
1782 Reason uint8
1783}
1784
1785type IActionNxController interface {
1786 IActionNicira
1787 GetMaxLen() uint16
1788 GetControllerId() uint16
1789 GetReason() uint8
1790}
1791
1792func (self *ActionNxController) GetMaxLen() uint16 {
1793 return self.MaxLen
1794}
1795
1796func (self *ActionNxController) SetMaxLen(v uint16) {
1797 self.MaxLen = v
1798}
1799
1800func (self *ActionNxController) GetControllerId() uint16 {
1801 return self.ControllerId
1802}
1803
1804func (self *ActionNxController) SetControllerId(v uint16) {
1805 self.ControllerId = v
1806}
1807
1808func (self *ActionNxController) GetReason() uint8 {
1809 return self.Reason
1810}
1811
1812func (self *ActionNxController) SetReason(v uint8) {
1813 self.Reason = v
1814}
1815
1816func (self *ActionNxController) Serialize(encoder *goloxi.Encoder) error {
1817 startIndex := len(encoder.Bytes())
1818 if err := self.ActionNicira.Serialize(encoder); err != nil {
1819 return err
1820 }
1821
1822 encoder.PutUint16(uint16(self.MaxLen))
1823 encoder.PutUint16(uint16(self.ControllerId))
1824 encoder.PutUint8(uint8(self.Reason))
1825 encoder.Write(bytes.Repeat([]byte{0}, 1))
1826 length := len(encoder.Bytes()) - startIndex
1827
1828 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
1829
1830 return nil
1831}
1832
1833func DecodeActionNxController(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxController, error) {
1834 _actionnxcontroller := &ActionNxController{ActionNicira: parent}
1835 if decoder.Length() < 6 {
1836 return nil, fmt.Errorf("ActionNxController packet too short: %d < 6", decoder.Length())
1837 }
1838 _actionnxcontroller.MaxLen = uint16(decoder.ReadUint16())
1839 _actionnxcontroller.ControllerId = uint16(decoder.ReadUint16())
1840 _actionnxcontroller.Reason = uint8(decoder.ReadByte())
1841 decoder.Skip(1)
1842 return _actionnxcontroller, nil
1843}
1844
1845func NewActionNxController() *ActionNxController {
1846 obj := &ActionNxController{
1847 ActionNicira: NewActionNicira(20),
1848 }
1849 return obj
1850}
1851func (self *ActionNxController) GetActionName() string {
1852 return "nx_controller"
1853}
1854
1855func (self *ActionNxController) GetActionFields() map[string]interface{} {
1856 return map[string]interface{}{
1857 "MaxLen": self.MaxLen,
1858 "ControllerId": self.ControllerId,
1859 "Reason": self.Reason,
1860 }
1861}
1862
1863func (self *ActionNxController) MarshalJSON() ([]byte, error) {
1864 jsonValue, err := json.Marshal(self.GetActionFields())
1865 if err != nil {
1866 return nil, err
1867 }
1868 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
1869}
1870
1871type ActionNxController2 struct {
1872 *ActionNicira
1873 Properties []IActionNxController2Property
1874}
1875
1876type IActionNxController2 interface {
1877 IActionNicira
1878 GetProperties() []IActionNxController2Property
1879}
1880
1881func (self *ActionNxController2) GetProperties() []IActionNxController2Property {
1882 return self.Properties
1883}
1884
1885func (self *ActionNxController2) SetProperties(v []IActionNxController2Property) {
1886 self.Properties = v
1887}
1888
1889func (self *ActionNxController2) Serialize(encoder *goloxi.Encoder) error {
1890 startIndex := len(encoder.Bytes())
1891 if err := self.ActionNicira.Serialize(encoder); err != nil {
1892 return err
1893 }
1894
1895 encoder.Write(bytes.Repeat([]byte{0}, 6))
1896 for _, obj := range self.Properties {
1897 if err := obj.Serialize(encoder); err != nil {
1898 return err
1899 }
1900 }
1901 length := len(encoder.Bytes()) - startIndex
1902
1903 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
1904
1905 return nil
1906}
1907
1908func DecodeActionNxController2(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxController2, error) {
1909 _actionnxcontroller2 := &ActionNxController2{ActionNicira: parent}
1910 if decoder.Length() < 6 {
1911 return nil, fmt.Errorf("ActionNxController2 packet too short: %d < 6", decoder.Length())
1912 }
1913 decoder.Skip(6)
1914
1915 for decoder.Length() >= 2 {
1916 item, err := DecodeActionNxController2Property(decoder)
1917 if err != nil {
1918 return nil, err
1919 }
1920 if item != nil {
1921 _actionnxcontroller2.Properties = append(_actionnxcontroller2.Properties, item)
1922 }
1923 }
1924 return _actionnxcontroller2, nil
1925}
1926
1927func NewActionNxController2() *ActionNxController2 {
1928 obj := &ActionNxController2{
1929 ActionNicira: NewActionNicira(37),
1930 }
1931 return obj
1932}
1933func (self *ActionNxController2) GetActionName() string {
1934 return "nx_controller2"
1935}
1936
1937func (self *ActionNxController2) GetActionFields() map[string]interface{} {
1938 return map[string]interface{}{
1939 "Properties": self.Properties,
1940 }
1941}
1942
1943func (self *ActionNxController2) MarshalJSON() ([]byte, error) {
1944 jsonValue, err := json.Marshal(self.GetActionFields())
1945 if err != nil {
1946 return nil, err
1947 }
1948 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
1949}
1950
1951type ActionNxCt struct {
1952 *ActionNicira
1953 Flags NxConntrackFlags
1954 ZoneSrc goloxi.IOxmId
1955 Value uint16
1956 RecircTable uint8
1957 Alg uint16
1958 Actions []goloxi.IAction
1959}
1960
1961type IActionNxCt interface {
1962 IActionNicira
1963 GetFlags() NxConntrackFlags
1964 GetZoneSrc() goloxi.IOxmId
1965 GetValue() uint16
1966 GetRecircTable() uint8
1967 GetAlg() uint16
1968 GetActions() []goloxi.IAction
1969}
1970
1971func (self *ActionNxCt) GetFlags() NxConntrackFlags {
1972 return self.Flags
1973}
1974
1975func (self *ActionNxCt) SetFlags(v NxConntrackFlags) {
1976 self.Flags = v
1977}
1978
1979func (self *ActionNxCt) GetZoneSrc() goloxi.IOxmId {
1980 return self.ZoneSrc
1981}
1982
1983func (self *ActionNxCt) SetZoneSrc(v goloxi.IOxmId) {
1984 self.ZoneSrc = v
1985}
1986
1987func (self *ActionNxCt) GetValue() uint16 {
1988 return self.Value
1989}
1990
1991func (self *ActionNxCt) SetValue(v uint16) {
1992 self.Value = v
1993}
1994
1995func (self *ActionNxCt) GetRecircTable() uint8 {
1996 return self.RecircTable
1997}
1998
1999func (self *ActionNxCt) SetRecircTable(v uint8) {
2000 self.RecircTable = v
2001}
2002
2003func (self *ActionNxCt) GetAlg() uint16 {
2004 return self.Alg
2005}
2006
2007func (self *ActionNxCt) SetAlg(v uint16) {
2008 self.Alg = v
2009}
2010
2011func (self *ActionNxCt) GetActions() []goloxi.IAction {
2012 return self.Actions
2013}
2014
2015func (self *ActionNxCt) SetActions(v []goloxi.IAction) {
2016 self.Actions = v
2017}
2018
2019func (self *ActionNxCt) Serialize(encoder *goloxi.Encoder) error {
2020 startIndex := len(encoder.Bytes())
2021 if err := self.ActionNicira.Serialize(encoder); err != nil {
2022 return err
2023 }
2024
2025 encoder.PutUint16(uint16(self.Flags))
2026 self.ZoneSrc.Serialize(encoder)
2027 encoder.PutUint16(uint16(self.Value))
2028 encoder.PutUint8(uint8(self.RecircTable))
2029 encoder.Write(bytes.Repeat([]byte{0}, 3))
2030 encoder.PutUint16(uint16(self.Alg))
2031 for _, obj := range self.Actions {
2032 if err := obj.Serialize(encoder); err != nil {
2033 return err
2034 }
2035 }
2036 length := len(encoder.Bytes()) - startIndex
2037
2038 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
2039
2040 return nil
2041}
2042
2043func DecodeActionNxCt(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxCt, error) {
2044 _actionnxct := &ActionNxCt{ActionNicira: parent}
2045 if decoder.Length() < 14 {
2046 return nil, fmt.Errorf("ActionNxCt packet too short: %d < 14", decoder.Length())
2047 }
2048 _actionnxct.Flags = NxConntrackFlags(decoder.ReadUint16())
2049 if obj, err := DecodeOxmId(decoder); err != nil {
2050 return nil, err
2051 } else {
2052 _actionnxct.ZoneSrc = obj
2053 }
2054
2055 _actionnxct.Value = uint16(decoder.ReadUint16())
2056 _actionnxct.RecircTable = uint8(decoder.ReadByte())
2057 decoder.Skip(3)
2058 _actionnxct.Alg = uint16(decoder.ReadUint16())
2059
2060 for decoder.Length() >= 4 {
2061 item, err := DecodeAction(decoder)
2062 if err != nil {
2063 return nil, err
2064 }
2065 if item != nil {
2066 _actionnxct.Actions = append(_actionnxct.Actions, item)
2067 }
2068 }
2069 return _actionnxct, nil
2070}
2071
2072func NewActionNxCt() *ActionNxCt {
2073 obj := &ActionNxCt{
2074 ActionNicira: NewActionNicira(35),
2075 }
2076 return obj
2077}
2078func (self *ActionNxCt) GetActionName() string {
2079 return "nx_ct"
2080}
2081
2082func (self *ActionNxCt) GetActionFields() map[string]interface{} {
2083 return map[string]interface{}{
2084 "Flags": self.Flags,
2085 "ZoneSrc": self.ZoneSrc,
2086 "Value": self.Value,
2087 "RecircTable": self.RecircTable,
2088 "Alg": self.Alg,
2089 "Actions": self.Actions,
2090 }
2091}
2092
2093func (self *ActionNxCt) MarshalJSON() ([]byte, error) {
2094 jsonValue, err := json.Marshal(self.GetActionFields())
2095 if err != nil {
2096 return nil, err
2097 }
2098 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
2099}
2100
2101type ActionNxCtClear struct {
2102 *ActionNicira
2103}
2104
2105type IActionNxCtClear interface {
2106 IActionNicira
2107}
2108
2109func (self *ActionNxCtClear) Serialize(encoder *goloxi.Encoder) error {
2110 startIndex := len(encoder.Bytes())
2111 if err := self.ActionNicira.Serialize(encoder); err != nil {
2112 return err
2113 }
2114 length := len(encoder.Bytes()) - startIndex
2115
2116 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
2117
2118 return nil
2119}
2120
2121func DecodeActionNxCtClear(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxCtClear, error) {
2122 _actionnxctclear := &ActionNxCtClear{ActionNicira: parent}
2123 return _actionnxctclear, nil
2124}
2125
2126func NewActionNxCtClear() *ActionNxCtClear {
2127 obj := &ActionNxCtClear{
2128 ActionNicira: NewActionNicira(43),
2129 }
2130 return obj
2131}
2132func (self *ActionNxCtClear) GetActionName() string {
2133 return "nx_ct_clear"
2134}
2135
2136func (self *ActionNxCtClear) GetActionFields() map[string]interface{} {
2137 return map[string]interface{}{}
2138}
2139
2140func (self *ActionNxCtClear) MarshalJSON() ([]byte, error) {
2141 jsonValue, err := json.Marshal(self.GetActionFields())
2142 if err != nil {
2143 return nil, err
2144 }
2145 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
2146}
2147
2148type ActionNxDebugRecirc struct {
2149 *ActionNicira
2150}
2151
2152type IActionNxDebugRecirc interface {
2153 IActionNicira
2154}
2155
2156func (self *ActionNxDebugRecirc) Serialize(encoder *goloxi.Encoder) error {
2157 startIndex := len(encoder.Bytes())
2158 if err := self.ActionNicira.Serialize(encoder); err != nil {
2159 return err
2160 }
2161 length := len(encoder.Bytes()) - startIndex
2162
2163 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
2164
2165 return nil
2166}
2167
2168func DecodeActionNxDebugRecirc(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxDebugRecirc, error) {
2169 _actionnxdebugrecirc := &ActionNxDebugRecirc{ActionNicira: parent}
2170 return _actionnxdebugrecirc, nil
2171}
2172
2173func NewActionNxDebugRecirc() *ActionNxDebugRecirc {
2174 obj := &ActionNxDebugRecirc{
2175 ActionNicira: NewActionNicira(255),
2176 }
2177 return obj
2178}
2179func (self *ActionNxDebugRecirc) GetActionName() string {
2180 return "nx_debug_recirc"
2181}
2182
2183func (self *ActionNxDebugRecirc) GetActionFields() map[string]interface{} {
2184 return map[string]interface{}{}
2185}
2186
2187func (self *ActionNxDebugRecirc) MarshalJSON() ([]byte, error) {
2188 jsonValue, err := json.Marshal(self.GetActionFields())
2189 if err != nil {
2190 return nil, err
2191 }
2192 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
2193}
2194
2195type ActionNxDebugSlow struct {
2196 *ActionNicira
2197}
2198
2199type IActionNxDebugSlow interface {
2200 IActionNicira
2201}
2202
2203func (self *ActionNxDebugSlow) Serialize(encoder *goloxi.Encoder) error {
2204 startIndex := len(encoder.Bytes())
2205 if err := self.ActionNicira.Serialize(encoder); err != nil {
2206 return err
2207 }
2208 length := len(encoder.Bytes()) - startIndex
2209
2210 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
2211
2212 return nil
2213}
2214
2215func DecodeActionNxDebugSlow(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxDebugSlow, error) {
2216 _actionnxdebugslow := &ActionNxDebugSlow{ActionNicira: parent}
2217 return _actionnxdebugslow, nil
2218}
2219
2220func NewActionNxDebugSlow() *ActionNxDebugSlow {
2221 obj := &ActionNxDebugSlow{
2222 ActionNicira: NewActionNicira(254),
2223 }
2224 return obj
2225}
2226func (self *ActionNxDebugSlow) GetActionName() string {
2227 return "nx_debug_slow"
2228}
2229
2230func (self *ActionNxDebugSlow) GetActionFields() map[string]interface{} {
2231 return map[string]interface{}{}
2232}
2233
2234func (self *ActionNxDebugSlow) MarshalJSON() ([]byte, error) {
2235 jsonValue, err := json.Marshal(self.GetActionFields())
2236 if err != nil {
2237 return nil, err
2238 }
2239 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
2240}
2241
2242type ActionNxDecMplsTtl struct {
2243 *ActionNicira
2244}
2245
2246type IActionNxDecMplsTtl interface {
2247 IActionNicira
2248}
2249
2250func (self *ActionNxDecMplsTtl) Serialize(encoder *goloxi.Encoder) error {
2251 startIndex := len(encoder.Bytes())
2252 if err := self.ActionNicira.Serialize(encoder); err != nil {
2253 return err
2254 }
2255 length := len(encoder.Bytes()) - startIndex
2256
2257 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
2258
2259 return nil
2260}
2261
2262func DecodeActionNxDecMplsTtl(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxDecMplsTtl, error) {
2263 _actionnxdecmplsttl := &ActionNxDecMplsTtl{ActionNicira: parent}
2264 return _actionnxdecmplsttl, nil
2265}
2266
2267func NewActionNxDecMplsTtl() *ActionNxDecMplsTtl {
2268 obj := &ActionNxDecMplsTtl{
2269 ActionNicira: NewActionNicira(26),
2270 }
2271 return obj
2272}
2273func (self *ActionNxDecMplsTtl) GetActionName() string {
2274 return "nx_dec_mpls_ttl"
2275}
2276
2277func (self *ActionNxDecMplsTtl) GetActionFields() map[string]interface{} {
2278 return map[string]interface{}{}
2279}
2280
2281func (self *ActionNxDecMplsTtl) MarshalJSON() ([]byte, error) {
2282 jsonValue, err := json.Marshal(self.GetActionFields())
2283 if err != nil {
2284 return nil, err
2285 }
2286 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
2287}
2288
2289type ActionNxDecNshTtl struct {
2290 *ActionNicira
2291}
2292
2293type IActionNxDecNshTtl interface {
2294 IActionNicira
2295}
2296
2297func (self *ActionNxDecNshTtl) Serialize(encoder *goloxi.Encoder) error {
2298 startIndex := len(encoder.Bytes())
2299 if err := self.ActionNicira.Serialize(encoder); err != nil {
2300 return err
2301 }
2302 length := len(encoder.Bytes()) - startIndex
2303
2304 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
2305
2306 return nil
2307}
2308
2309func DecodeActionNxDecNshTtl(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxDecNshTtl, error) {
2310 _actionnxdecnshttl := &ActionNxDecNshTtl{ActionNicira: parent}
2311 return _actionnxdecnshttl, nil
2312}
2313
2314func NewActionNxDecNshTtl() *ActionNxDecNshTtl {
2315 obj := &ActionNxDecNshTtl{
2316 ActionNicira: NewActionNicira(48),
2317 }
2318 return obj
2319}
2320func (self *ActionNxDecNshTtl) GetActionName() string {
2321 return "nx_dec_nsh_ttl"
2322}
2323
2324func (self *ActionNxDecNshTtl) GetActionFields() map[string]interface{} {
2325 return map[string]interface{}{}
2326}
2327
2328func (self *ActionNxDecNshTtl) MarshalJSON() ([]byte, error) {
2329 jsonValue, err := json.Marshal(self.GetActionFields())
2330 if err != nil {
2331 return nil, err
2332 }
2333 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
2334}
2335
2336type ActionNxDecTtlCntIds struct {
2337 *ActionNicira
2338 NControllers uint16
2339}
2340
2341type IActionNxDecTtlCntIds interface {
2342 IActionNicira
2343 GetNControllers() uint16
2344}
2345
2346func (self *ActionNxDecTtlCntIds) GetNControllers() uint16 {
2347 return self.NControllers
2348}
2349
2350func (self *ActionNxDecTtlCntIds) SetNControllers(v uint16) {
2351 self.NControllers = v
2352}
2353
2354func (self *ActionNxDecTtlCntIds) Serialize(encoder *goloxi.Encoder) error {
2355 startIndex := len(encoder.Bytes())
2356 if err := self.ActionNicira.Serialize(encoder); err != nil {
2357 return err
2358 }
2359
2360 encoder.PutUint16(uint16(self.NControllers))
2361 encoder.Write(bytes.Repeat([]byte{0}, 4))
2362 length := len(encoder.Bytes()) - startIndex
2363
2364 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
2365
2366 return nil
2367}
2368
2369func DecodeActionNxDecTtlCntIds(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxDecTtlCntIds, error) {
2370 _actionnxdecttlcntids := &ActionNxDecTtlCntIds{ActionNicira: parent}
2371 if decoder.Length() < 6 {
2372 return nil, fmt.Errorf("ActionNxDecTtlCntIds packet too short: %d < 6", decoder.Length())
2373 }
2374 _actionnxdecttlcntids.NControllers = uint16(decoder.ReadUint16())
2375 decoder.Skip(4)
2376 return _actionnxdecttlcntids, nil
2377}
2378
2379func NewActionNxDecTtlCntIds() *ActionNxDecTtlCntIds {
2380 obj := &ActionNxDecTtlCntIds{
2381 ActionNicira: NewActionNicira(21),
2382 }
2383 return obj
2384}
2385func (self *ActionNxDecTtlCntIds) GetActionName() string {
2386 return "nx_dec_ttl_cnt_ids"
2387}
2388
2389func (self *ActionNxDecTtlCntIds) GetActionFields() map[string]interface{} {
2390 return map[string]interface{}{
2391 "NControllers": self.NControllers,
2392 }
2393}
2394
2395func (self *ActionNxDecTtlCntIds) MarshalJSON() ([]byte, error) {
2396 jsonValue, err := json.Marshal(self.GetActionFields())
2397 if err != nil {
2398 return nil, err
2399 }
2400 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
2401}
2402
2403type ActionNxDecap struct {
2404 *ActionNicira
2405 NewPktType uint32
2406}
2407
2408type IActionNxDecap interface {
2409 IActionNicira
2410 GetNewPktType() uint32
2411}
2412
2413func (self *ActionNxDecap) GetNewPktType() uint32 {
2414 return self.NewPktType
2415}
2416
2417func (self *ActionNxDecap) SetNewPktType(v uint32) {
2418 self.NewPktType = v
2419}
2420
2421func (self *ActionNxDecap) Serialize(encoder *goloxi.Encoder) error {
2422 startIndex := len(encoder.Bytes())
2423 if err := self.ActionNicira.Serialize(encoder); err != nil {
2424 return err
2425 }
2426
2427 encoder.Write(bytes.Repeat([]byte{0}, 2))
2428 encoder.PutUint32(uint32(self.NewPktType))
2429 length := len(encoder.Bytes()) - startIndex
2430
2431 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
2432
2433 return nil
2434}
2435
2436func DecodeActionNxDecap(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxDecap, error) {
2437 _actionnxdecap := &ActionNxDecap{ActionNicira: parent}
2438 if decoder.Length() < 6 {
2439 return nil, fmt.Errorf("ActionNxDecap packet too short: %d < 6", decoder.Length())
2440 }
2441 decoder.Skip(2)
2442 _actionnxdecap.NewPktType = uint32(decoder.ReadUint32())
2443 return _actionnxdecap, nil
2444}
2445
2446func NewActionNxDecap() *ActionNxDecap {
2447 obj := &ActionNxDecap{
2448 ActionNicira: NewActionNicira(47),
2449 }
2450 return obj
2451}
2452func (self *ActionNxDecap) GetActionName() string {
2453 return "nx_decap"
2454}
2455
2456func (self *ActionNxDecap) GetActionFields() map[string]interface{} {
2457 return map[string]interface{}{
2458 "NewPktType": self.NewPktType,
2459 }
2460}
2461
2462func (self *ActionNxDecap) MarshalJSON() ([]byte, error) {
2463 jsonValue, err := json.Marshal(self.GetActionFields())
2464 if err != nil {
2465 return nil, err
2466 }
2467 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
2468}
2469
2470type ActionNxEncap struct {
2471 *ActionNicira
2472 HdrSize uint16
2473 PacketType PacketType
2474 Props []IEdPropHeader
2475}
2476
2477type IActionNxEncap interface {
2478 IActionNicira
2479 GetHdrSize() uint16
2480 GetPacketType() PacketType
2481 GetProps() []IEdPropHeader
2482}
2483
2484func (self *ActionNxEncap) GetHdrSize() uint16 {
2485 return self.HdrSize
2486}
2487
2488func (self *ActionNxEncap) SetHdrSize(v uint16) {
2489 self.HdrSize = v
2490}
2491
2492func (self *ActionNxEncap) GetPacketType() PacketType {
2493 return self.PacketType
2494}
2495
2496func (self *ActionNxEncap) SetPacketType(v PacketType) {
2497 self.PacketType = v
2498}
2499
2500func (self *ActionNxEncap) GetProps() []IEdPropHeader {
2501 return self.Props
2502}
2503
2504func (self *ActionNxEncap) SetProps(v []IEdPropHeader) {
2505 self.Props = v
2506}
2507
2508func (self *ActionNxEncap) Serialize(encoder *goloxi.Encoder) error {
2509 startIndex := len(encoder.Bytes())
2510 if err := self.ActionNicira.Serialize(encoder); err != nil {
2511 return err
2512 }
2513
2514 encoder.PutUint16(uint16(self.HdrSize))
2515 encoder.PutUint32(uint32(self.PacketType))
2516 for _, obj := range self.Props {
2517 if err := obj.Serialize(encoder); err != nil {
2518 return err
2519 }
2520 }
2521 length := len(encoder.Bytes()) - startIndex
2522
2523 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
2524
2525 return nil
2526}
2527
2528func DecodeActionNxEncap(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxEncap, error) {
2529 _actionnxencap := &ActionNxEncap{ActionNicira: parent}
2530 if decoder.Length() < 6 {
2531 return nil, fmt.Errorf("ActionNxEncap packet too short: %d < 6", decoder.Length())
2532 }
2533 _actionnxencap.HdrSize = uint16(decoder.ReadUint16())
2534 _actionnxencap.PacketType = PacketType(decoder.ReadUint32())
2535
2536 for decoder.Length() >= 4 {
2537 item, err := DecodeEdPropHeader(decoder)
2538 if err != nil {
2539 return nil, err
2540 }
2541 if item != nil {
2542 _actionnxencap.Props = append(_actionnxencap.Props, item)
2543 }
2544 }
2545 return _actionnxencap, nil
2546}
2547
2548func NewActionNxEncap() *ActionNxEncap {
2549 obj := &ActionNxEncap{
2550 ActionNicira: NewActionNicira(46),
2551 }
2552 return obj
2553}
2554func (self *ActionNxEncap) GetActionName() string {
2555 return "nx_encap"
2556}
2557
2558func (self *ActionNxEncap) GetActionFields() map[string]interface{} {
2559 return map[string]interface{}{
2560 "HdrSize": self.HdrSize,
2561 "PacketType": self.PacketType,
2562 "Props": self.Props,
2563 }
2564}
2565
2566func (self *ActionNxEncap) MarshalJSON() ([]byte, error) {
2567 jsonValue, err := json.Marshal(self.GetActionFields())
2568 if err != nil {
2569 return nil, err
2570 }
2571 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
2572}
2573
2574type ActionNxExit struct {
2575 *ActionNicira
2576}
2577
2578type IActionNxExit interface {
2579 IActionNicira
2580}
2581
2582func (self *ActionNxExit) Serialize(encoder *goloxi.Encoder) error {
2583 startIndex := len(encoder.Bytes())
2584 if err := self.ActionNicira.Serialize(encoder); err != nil {
2585 return err
2586 }
2587 length := len(encoder.Bytes()) - startIndex
2588
2589 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
2590
2591 return nil
2592}
2593
2594func DecodeActionNxExit(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxExit, error) {
2595 _actionnxexit := &ActionNxExit{ActionNicira: parent}
2596 return _actionnxexit, nil
2597}
2598
2599func NewActionNxExit() *ActionNxExit {
2600 obj := &ActionNxExit{
2601 ActionNicira: NewActionNicira(17),
2602 }
2603 return obj
2604}
2605func (self *ActionNxExit) GetActionName() string {
2606 return "nx_exit"
2607}
2608
2609func (self *ActionNxExit) GetActionFields() map[string]interface{} {
2610 return map[string]interface{}{}
2611}
2612
2613func (self *ActionNxExit) MarshalJSON() ([]byte, error) {
2614 jsonValue, err := json.Marshal(self.GetActionFields())
2615 if err != nil {
2616 return nil, err
2617 }
2618 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
2619}
2620
2621type ActionNxFinTimeout struct {
2622 *ActionNicira
2623 FinIdleTimeout uint16
2624 FinHardTimeout uint16
2625}
2626
2627type IActionNxFinTimeout interface {
2628 IActionNicira
2629 GetFinIdleTimeout() uint16
2630 GetFinHardTimeout() uint16
2631}
2632
2633func (self *ActionNxFinTimeout) GetFinIdleTimeout() uint16 {
2634 return self.FinIdleTimeout
2635}
2636
2637func (self *ActionNxFinTimeout) SetFinIdleTimeout(v uint16) {
2638 self.FinIdleTimeout = v
2639}
2640
2641func (self *ActionNxFinTimeout) GetFinHardTimeout() uint16 {
2642 return self.FinHardTimeout
2643}
2644
2645func (self *ActionNxFinTimeout) SetFinHardTimeout(v uint16) {
2646 self.FinHardTimeout = v
2647}
2648
2649func (self *ActionNxFinTimeout) Serialize(encoder *goloxi.Encoder) error {
2650 startIndex := len(encoder.Bytes())
2651 if err := self.ActionNicira.Serialize(encoder); err != nil {
2652 return err
2653 }
2654
2655 encoder.PutUint16(uint16(self.FinIdleTimeout))
2656 encoder.PutUint16(uint16(self.FinHardTimeout))
2657 encoder.Write(bytes.Repeat([]byte{0}, 2))
2658 length := len(encoder.Bytes()) - startIndex
2659
2660 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
2661
2662 return nil
2663}
2664
2665func DecodeActionNxFinTimeout(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxFinTimeout, error) {
2666 _actionnxfintimeout := &ActionNxFinTimeout{ActionNicira: parent}
2667 if decoder.Length() < 6 {
2668 return nil, fmt.Errorf("ActionNxFinTimeout packet too short: %d < 6", decoder.Length())
2669 }
2670 _actionnxfintimeout.FinIdleTimeout = uint16(decoder.ReadUint16())
2671 _actionnxfintimeout.FinHardTimeout = uint16(decoder.ReadUint16())
2672 decoder.Skip(2)
2673 return _actionnxfintimeout, nil
2674}
2675
2676func NewActionNxFinTimeout() *ActionNxFinTimeout {
2677 obj := &ActionNxFinTimeout{
2678 ActionNicira: NewActionNicira(19),
2679 }
2680 return obj
2681}
2682func (self *ActionNxFinTimeout) GetActionName() string {
2683 return "nx_fin_timeout"
2684}
2685
2686func (self *ActionNxFinTimeout) GetActionFields() map[string]interface{} {
2687 return map[string]interface{}{
2688 "FinIdleTimeout": self.FinIdleTimeout,
2689 "FinHardTimeout": self.FinHardTimeout,
2690 }
2691}
2692
2693func (self *ActionNxFinTimeout) MarshalJSON() ([]byte, error) {
2694 jsonValue, err := json.Marshal(self.GetActionFields())
2695 if err != nil {
2696 return nil, err
2697 }
2698 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
2699}
2700
2701type ActionNxGroup struct {
2702 *ActionNicira
2703 Value uint32
2704}
2705
2706type IActionNxGroup interface {
2707 IActionNicira
2708 GetValue() uint32
2709}
2710
2711func (self *ActionNxGroup) GetValue() uint32 {
2712 return self.Value
2713}
2714
2715func (self *ActionNxGroup) SetValue(v uint32) {
2716 self.Value = v
2717}
2718
2719func (self *ActionNxGroup) Serialize(encoder *goloxi.Encoder) error {
2720 startIndex := len(encoder.Bytes())
2721 if err := self.ActionNicira.Serialize(encoder); err != nil {
2722 return err
2723 }
2724
2725 encoder.PutUint32(uint32(self.Value))
2726 length := len(encoder.Bytes()) - startIndex
2727
2728 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
2729
2730 return nil
2731}
2732
2733func DecodeActionNxGroup(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxGroup, error) {
2734 _actionnxgroup := &ActionNxGroup{ActionNicira: parent}
2735 if decoder.Length() < 4 {
2736 return nil, fmt.Errorf("ActionNxGroup packet too short: %d < 4", decoder.Length())
2737 }
2738 _actionnxgroup.Value = uint32(decoder.ReadUint32())
2739 return _actionnxgroup, nil
2740}
2741
2742func NewActionNxGroup() *ActionNxGroup {
2743 obj := &ActionNxGroup{
2744 ActionNicira: NewActionNicira(40),
2745 }
2746 return obj
2747}
2748func (self *ActionNxGroup) GetActionName() string {
2749 return "nx_group"
2750}
2751
2752func (self *ActionNxGroup) GetActionFields() map[string]interface{} {
2753 return map[string]interface{}{
2754 "Value": self.Value,
2755 }
2756}
2757
2758func (self *ActionNxGroup) MarshalJSON() ([]byte, error) {
2759 jsonValue, err := json.Marshal(self.GetActionFields())
2760 if err != nil {
2761 return nil, err
2762 }
2763 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
2764}
2765
2766type ActionNxLearn struct {
2767 *ActionNicira
2768 IdleTimeout uint16
2769 HardTimeout uint16
2770 Priority uint16
2771 Cookie uint64
2772 Flags uint16
2773 TableId uint8
2774 FinIdleTimeout uint16
2775 FinHardTimeout uint16
2776 FlowMods []IFlowModSpec
2777}
2778
2779type IActionNxLearn interface {
2780 IActionNicira
2781 GetIdleTimeout() uint16
2782 GetHardTimeout() uint16
2783 GetPriority() uint16
2784 GetCookie() uint64
2785 GetFlags() uint16
2786 GetTableId() uint8
2787 GetFinIdleTimeout() uint16
2788 GetFinHardTimeout() uint16
2789 GetFlowMods() []IFlowModSpec
2790}
2791
2792func (self *ActionNxLearn) GetIdleTimeout() uint16 {
2793 return self.IdleTimeout
2794}
2795
2796func (self *ActionNxLearn) SetIdleTimeout(v uint16) {
2797 self.IdleTimeout = v
2798}
2799
2800func (self *ActionNxLearn) GetHardTimeout() uint16 {
2801 return self.HardTimeout
2802}
2803
2804func (self *ActionNxLearn) SetHardTimeout(v uint16) {
2805 self.HardTimeout = v
2806}
2807
2808func (self *ActionNxLearn) GetPriority() uint16 {
2809 return self.Priority
2810}
2811
2812func (self *ActionNxLearn) SetPriority(v uint16) {
2813 self.Priority = v
2814}
2815
2816func (self *ActionNxLearn) GetCookie() uint64 {
2817 return self.Cookie
2818}
2819
2820func (self *ActionNxLearn) SetCookie(v uint64) {
2821 self.Cookie = v
2822}
2823
2824func (self *ActionNxLearn) GetFlags() uint16 {
2825 return self.Flags
2826}
2827
2828func (self *ActionNxLearn) SetFlags(v uint16) {
2829 self.Flags = v
2830}
2831
2832func (self *ActionNxLearn) GetTableId() uint8 {
2833 return self.TableId
2834}
2835
2836func (self *ActionNxLearn) SetTableId(v uint8) {
2837 self.TableId = v
2838}
2839
2840func (self *ActionNxLearn) GetFinIdleTimeout() uint16 {
2841 return self.FinIdleTimeout
2842}
2843
2844func (self *ActionNxLearn) SetFinIdleTimeout(v uint16) {
2845 self.FinIdleTimeout = v
2846}
2847
2848func (self *ActionNxLearn) GetFinHardTimeout() uint16 {
2849 return self.FinHardTimeout
2850}
2851
2852func (self *ActionNxLearn) SetFinHardTimeout(v uint16) {
2853 self.FinHardTimeout = v
2854}
2855
2856func (self *ActionNxLearn) GetFlowMods() []IFlowModSpec {
2857 return self.FlowMods
2858}
2859
2860func (self *ActionNxLearn) SetFlowMods(v []IFlowModSpec) {
2861 self.FlowMods = v
2862}
2863
2864func (self *ActionNxLearn) Serialize(encoder *goloxi.Encoder) error {
2865 startIndex := len(encoder.Bytes())
2866 if err := self.ActionNicira.Serialize(encoder); err != nil {
2867 return err
2868 }
2869
2870 encoder.PutUint16(uint16(self.IdleTimeout))
2871 encoder.PutUint16(uint16(self.HardTimeout))
2872 encoder.PutUint16(uint16(self.Priority))
2873 encoder.PutUint64(uint64(self.Cookie))
2874 encoder.PutUint16(uint16(self.Flags))
2875 encoder.PutUint8(uint8(self.TableId))
2876 encoder.Write(bytes.Repeat([]byte{0}, 1))
2877 encoder.PutUint16(uint16(self.FinIdleTimeout))
2878 encoder.PutUint16(uint16(self.FinHardTimeout))
2879 for _, obj := range self.FlowMods {
2880 if err := obj.Serialize(encoder); err != nil {
2881 return err
2882 }
2883 }
2884 length := len(encoder.Bytes()) - startIndex
2885
2886 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
2887
2888 return nil
2889}
2890
2891func DecodeActionNxLearn(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxLearn, error) {
2892 _actionnxlearn := &ActionNxLearn{ActionNicira: parent}
2893 if decoder.Length() < 22 {
2894 return nil, fmt.Errorf("ActionNxLearn packet too short: %d < 22", decoder.Length())
2895 }
2896 _actionnxlearn.IdleTimeout = uint16(decoder.ReadUint16())
2897 _actionnxlearn.HardTimeout = uint16(decoder.ReadUint16())
2898 _actionnxlearn.Priority = uint16(decoder.ReadUint16())
2899 _actionnxlearn.Cookie = uint64(decoder.ReadUint64())
2900 _actionnxlearn.Flags = uint16(decoder.ReadUint16())
2901 _actionnxlearn.TableId = uint8(decoder.ReadByte())
2902 decoder.Skip(1)
2903 _actionnxlearn.FinIdleTimeout = uint16(decoder.ReadUint16())
2904 _actionnxlearn.FinHardTimeout = uint16(decoder.ReadUint16())
2905
2906 for decoder.Length() >= 2 {
2907 item, err := DecodeFlowModSpec(decoder)
2908 if err != nil {
2909 return nil, err
2910 }
2911 if item != nil {
2912 _actionnxlearn.FlowMods = append(_actionnxlearn.FlowMods, item)
2913 }
2914 }
2915 return _actionnxlearn, nil
2916}
2917
2918func NewActionNxLearn() *ActionNxLearn {
2919 obj := &ActionNxLearn{
2920 ActionNicira: NewActionNicira(16),
2921 }
2922 return obj
2923}
2924func (self *ActionNxLearn) GetActionName() string {
2925 return "nx_learn"
2926}
2927
2928func (self *ActionNxLearn) GetActionFields() map[string]interface{} {
2929 return map[string]interface{}{
2930 "IdleTimeout": self.IdleTimeout,
2931 "HardTimeout": self.HardTimeout,
2932 "Priority": self.Priority,
2933 "Cookie": self.Cookie,
2934 "Flags": self.Flags,
2935 "TableId": self.TableId,
2936 "FinIdleTimeout": self.FinIdleTimeout,
2937 "FinHardTimeout": self.FinHardTimeout,
2938 "FlowMods": self.FlowMods,
2939 }
2940}
2941
2942func (self *ActionNxLearn) MarshalJSON() ([]byte, error) {
2943 jsonValue, err := json.Marshal(self.GetActionFields())
2944 if err != nil {
2945 return nil, err
2946 }
2947 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
2948}
2949
2950type ActionNxLearn2 struct {
2951 *ActionNicira
2952}
2953
2954type IActionNxLearn2 interface {
2955 IActionNicira
2956}
2957
2958func (self *ActionNxLearn2) Serialize(encoder *goloxi.Encoder) error {
2959 startIndex := len(encoder.Bytes())
2960 if err := self.ActionNicira.Serialize(encoder); err != nil {
2961 return err
2962 }
2963 length := len(encoder.Bytes()) - startIndex
2964
2965 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
2966
2967 return nil
2968}
2969
2970func DecodeActionNxLearn2(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxLearn2, error) {
2971 _actionnxlearn2 := &ActionNxLearn2{ActionNicira: parent}
2972 return _actionnxlearn2, nil
2973}
2974
2975func NewActionNxLearn2() *ActionNxLearn2 {
2976 obj := &ActionNxLearn2{
2977 ActionNicira: NewActionNicira(45),
2978 }
2979 return obj
2980}
2981func (self *ActionNxLearn2) GetActionName() string {
2982 return "nx_learn2"
2983}
2984
2985func (self *ActionNxLearn2) GetActionFields() map[string]interface{} {
2986 return map[string]interface{}{}
2987}
2988
2989func (self *ActionNxLearn2) MarshalJSON() ([]byte, error) {
2990 jsonValue, err := json.Marshal(self.GetActionFields())
2991 if err != nil {
2992 return nil, err
2993 }
2994 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
2995}
2996
2997type ActionNxMultipath struct {
2998 *ActionNicira
2999 Fields NxHashFields
3000 Basis uint16
3001 Algorithm NxMpAlgorithm
3002 MaxLink uint16
3003 Arg uint32
3004 OfsNbits uint16
3005 Dst goloxi.IOxmId
3006}
3007
3008type IActionNxMultipath interface {
3009 IActionNicira
3010 GetFields() NxHashFields
3011 GetBasis() uint16
3012 GetAlgorithm() NxMpAlgorithm
3013 GetMaxLink() uint16
3014 GetArg() uint32
3015 GetOfsNbits() uint16
3016 GetDst() goloxi.IOxmId
3017}
3018
3019func (self *ActionNxMultipath) GetFields() NxHashFields {
3020 return self.Fields
3021}
3022
3023func (self *ActionNxMultipath) SetFields(v NxHashFields) {
3024 self.Fields = v
3025}
3026
3027func (self *ActionNxMultipath) GetBasis() uint16 {
3028 return self.Basis
3029}
3030
3031func (self *ActionNxMultipath) SetBasis(v uint16) {
3032 self.Basis = v
3033}
3034
3035func (self *ActionNxMultipath) GetAlgorithm() NxMpAlgorithm {
3036 return self.Algorithm
3037}
3038
3039func (self *ActionNxMultipath) SetAlgorithm(v NxMpAlgorithm) {
3040 self.Algorithm = v
3041}
3042
3043func (self *ActionNxMultipath) GetMaxLink() uint16 {
3044 return self.MaxLink
3045}
3046
3047func (self *ActionNxMultipath) SetMaxLink(v uint16) {
3048 self.MaxLink = v
3049}
3050
3051func (self *ActionNxMultipath) GetArg() uint32 {
3052 return self.Arg
3053}
3054
3055func (self *ActionNxMultipath) SetArg(v uint32) {
3056 self.Arg = v
3057}
3058
3059func (self *ActionNxMultipath) GetOfsNbits() uint16 {
3060 return self.OfsNbits
3061}
3062
3063func (self *ActionNxMultipath) SetOfsNbits(v uint16) {
3064 self.OfsNbits = v
3065}
3066
3067func (self *ActionNxMultipath) GetDst() goloxi.IOxmId {
3068 return self.Dst
3069}
3070
3071func (self *ActionNxMultipath) SetDst(v goloxi.IOxmId) {
3072 self.Dst = v
3073}
3074
3075func (self *ActionNxMultipath) Serialize(encoder *goloxi.Encoder) error {
3076 startIndex := len(encoder.Bytes())
3077 if err := self.ActionNicira.Serialize(encoder); err != nil {
3078 return err
3079 }
3080
3081 encoder.PutUint16(uint16(self.Fields))
3082 encoder.PutUint16(uint16(self.Basis))
3083 encoder.Write(bytes.Repeat([]byte{0}, 2))
3084 encoder.PutUint16(uint16(self.Algorithm))
3085 encoder.PutUint16(uint16(self.MaxLink))
3086 encoder.PutUint32(uint32(self.Arg))
3087 encoder.Write(bytes.Repeat([]byte{0}, 2))
3088 encoder.PutUint16(uint16(self.OfsNbits))
3089 self.Dst.Serialize(encoder)
3090 length := len(encoder.Bytes()) - startIndex
3091
3092 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
3093
3094 return nil
3095}
3096
3097func DecodeActionNxMultipath(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxMultipath, error) {
3098 _actionnxmultipath := &ActionNxMultipath{ActionNicira: parent}
3099 if decoder.Length() < 22 {
3100 return nil, fmt.Errorf("ActionNxMultipath packet too short: %d < 22", decoder.Length())
3101 }
3102 _actionnxmultipath.Fields = NxHashFields(decoder.ReadUint16())
3103 _actionnxmultipath.Basis = uint16(decoder.ReadUint16())
3104 decoder.Skip(2)
3105 _actionnxmultipath.Algorithm = NxMpAlgorithm(decoder.ReadUint16())
3106 _actionnxmultipath.MaxLink = uint16(decoder.ReadUint16())
3107 _actionnxmultipath.Arg = uint32(decoder.ReadUint32())
3108 decoder.Skip(2)
3109 _actionnxmultipath.OfsNbits = uint16(decoder.ReadUint16())
3110 if obj, err := DecodeOxmId(decoder); err != nil {
3111 return nil, err
3112 } else {
3113 _actionnxmultipath.Dst = obj
3114 }
3115
3116 return _actionnxmultipath, nil
3117}
3118
3119func NewActionNxMultipath() *ActionNxMultipath {
3120 obj := &ActionNxMultipath{
3121 ActionNicira: NewActionNicira(10),
3122 }
3123 return obj
3124}
3125func (self *ActionNxMultipath) GetActionName() string {
3126 return "nx_multipath"
3127}
3128
3129func (self *ActionNxMultipath) GetActionFields() map[string]interface{} {
3130 return map[string]interface{}{
3131 "Fields": self.Fields,
3132 "Basis": self.Basis,
3133 "Algorithm": self.Algorithm,
3134 "MaxLink": self.MaxLink,
3135 "Arg": self.Arg,
3136 "OfsNbits": self.OfsNbits,
3137 "Dst": self.Dst,
3138 }
3139}
3140
3141func (self *ActionNxMultipath) MarshalJSON() ([]byte, error) {
3142 jsonValue, err := json.Marshal(self.GetActionFields())
3143 if err != nil {
3144 return nil, err
3145 }
3146 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
3147}
3148
3149type ActionNxNat struct {
3150 *ActionNicira
3151 Flags uint16
3152 RangePresent NxNatRange
3153 Ipv4Min net.IP
3154 Ipv4Max net.IP
3155 Ipv6Min net.IP
3156 Ipv6Max net.IP
3157 ProtoMin uint32
3158 ProtoMax uint32
3159}
3160
3161type IActionNxNat interface {
3162 IActionNicira
3163 GetFlags() uint16
3164 GetRangePresent() NxNatRange
3165 GetIpv4Min() net.IP
3166 GetIpv4Max() net.IP
3167 GetIpv6Min() net.IP
3168 GetIpv6Max() net.IP
3169 GetProtoMin() uint32
3170 GetProtoMax() uint32
3171}
3172
3173func (self *ActionNxNat) GetFlags() uint16 {
3174 return self.Flags
3175}
3176
3177func (self *ActionNxNat) SetFlags(v uint16) {
3178 self.Flags = v
3179}
3180
3181func (self *ActionNxNat) GetRangePresent() NxNatRange {
3182 return self.RangePresent
3183}
3184
3185func (self *ActionNxNat) SetRangePresent(v NxNatRange) {
3186 self.RangePresent = v
3187}
3188
3189func (self *ActionNxNat) GetIpv4Min() net.IP {
3190 return self.Ipv4Min
3191}
3192
3193func (self *ActionNxNat) SetIpv4Min(v net.IP) {
3194 self.Ipv4Min = v
3195}
3196
3197func (self *ActionNxNat) GetIpv4Max() net.IP {
3198 return self.Ipv4Max
3199}
3200
3201func (self *ActionNxNat) SetIpv4Max(v net.IP) {
3202 self.Ipv4Max = v
3203}
3204
3205func (self *ActionNxNat) GetIpv6Min() net.IP {
3206 return self.Ipv6Min
3207}
3208
3209func (self *ActionNxNat) SetIpv6Min(v net.IP) {
3210 self.Ipv6Min = v
3211}
3212
3213func (self *ActionNxNat) GetIpv6Max() net.IP {
3214 return self.Ipv6Max
3215}
3216
3217func (self *ActionNxNat) SetIpv6Max(v net.IP) {
3218 self.Ipv6Max = v
3219}
3220
3221func (self *ActionNxNat) GetProtoMin() uint32 {
3222 return self.ProtoMin
3223}
3224
3225func (self *ActionNxNat) SetProtoMin(v uint32) {
3226 self.ProtoMin = v
3227}
3228
3229func (self *ActionNxNat) GetProtoMax() uint32 {
3230 return self.ProtoMax
3231}
3232
3233func (self *ActionNxNat) SetProtoMax(v uint32) {
3234 self.ProtoMax = v
3235}
3236
3237func (self *ActionNxNat) Serialize(encoder *goloxi.Encoder) error {
3238 startIndex := len(encoder.Bytes())
3239 if err := self.ActionNicira.Serialize(encoder); err != nil {
3240 return err
3241 }
3242
3243 encoder.Write(bytes.Repeat([]byte{0}, 2))
3244 encoder.PutUint16(uint16(self.Flags))
3245 encoder.PutUint16(uint16(self.RangePresent))
3246 encoder.Write(self.Ipv4Min.To4())
3247 encoder.Write(self.Ipv4Max.To4())
3248 encoder.Write(self.Ipv6Min.To16())
3249 encoder.Write(self.Ipv6Max.To16())
3250 encoder.PutUint32(uint32(self.ProtoMin))
3251 encoder.PutUint32(uint32(self.ProtoMax))
3252 length := len(encoder.Bytes()) - startIndex
3253
3254 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
3255
3256 return nil
3257}
3258
3259func DecodeActionNxNat(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxNat, error) {
3260 _actionnxnat := &ActionNxNat{ActionNicira: parent}
3261 if decoder.Length() < 6 {
3262 return nil, fmt.Errorf("ActionNxNat packet too short: %d < 6", decoder.Length())
3263 }
3264 decoder.Skip(2)
3265 _actionnxnat.Flags = uint16(decoder.ReadUint16())
3266 _actionnxnat.RangePresent = NxNatRange(decoder.ReadUint16())
3267 if _actionnxnat.RangePresent&1 == 1 {
3268 _actionnxnat.Ipv4Min = net.IP(decoder.Read(4))
3269 }
3270 if _actionnxnat.RangePresent&2 == 2 {
3271 _actionnxnat.Ipv4Max = net.IP(decoder.Read(4))
3272 }
3273 if _actionnxnat.RangePresent&4 == 4 {
3274 _actionnxnat.Ipv6Min = net.IP(decoder.Read(16))
3275 }
3276 if _actionnxnat.RangePresent&8 == 8 {
3277 _actionnxnat.Ipv6Max = net.IP(decoder.Read(16))
3278 }
3279 if _actionnxnat.RangePresent&16 == 16 {
3280 _actionnxnat.ProtoMin = uint32(decoder.ReadUint32())
3281 }
3282 if _actionnxnat.RangePresent&32 == 32 {
3283 _actionnxnat.ProtoMax = uint32(decoder.ReadUint32())
3284 }
3285 return _actionnxnat, nil
3286}
3287
3288func NewActionNxNat() *ActionNxNat {
3289 obj := &ActionNxNat{
3290 ActionNicira: NewActionNicira(36),
3291 }
3292 return obj
3293}
3294func (self *ActionNxNat) GetActionName() string {
3295 return "nx_nat"
3296}
3297
3298func (self *ActionNxNat) GetActionFields() map[string]interface{} {
3299 return map[string]interface{}{
3300 "Flags": self.Flags,
3301 "RangePresent": self.RangePresent,
3302 "Ipv4Min": self.Ipv4Min,
3303 "Ipv4Max": self.Ipv4Max,
3304 "Ipv6Min": self.Ipv6Min,
3305 "Ipv6Max": self.Ipv6Max,
3306 "ProtoMin": self.ProtoMin,
3307 "ProtoMax": self.ProtoMax,
3308 }
3309}
3310
3311func (self *ActionNxNat) MarshalJSON() ([]byte, error) {
3312 jsonValue, err := json.Marshal(self.GetActionFields())
3313 if err != nil {
3314 return nil, err
3315 }
3316 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
3317}
3318
3319type ActionNxNote struct {
3320 *ActionNicira
3321 Note []byte
3322}
3323
3324type IActionNxNote interface {
3325 IActionNicira
3326 GetNote() []byte
3327}
3328
3329func (self *ActionNxNote) GetNote() []byte {
3330 return self.Note
3331}
3332
3333func (self *ActionNxNote) SetNote(v []byte) {
3334 self.Note = v
3335}
3336
3337func (self *ActionNxNote) Serialize(encoder *goloxi.Encoder) error {
3338 startIndex := len(encoder.Bytes())
3339 if err := self.ActionNicira.Serialize(encoder); err != nil {
3340 return err
3341 }
3342
3343 encoder.Write(self.Note)
3344 length := len(encoder.Bytes()) - startIndex
3345
3346 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
3347
3348 return nil
3349}
3350
3351func DecodeActionNxNote(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxNote, error) {
3352 _actionnxnote := &ActionNxNote{ActionNicira: parent}
3353 _actionnxnote.Note = decoder.Read(int(decoder.Length()))
3354 return _actionnxnote, nil
3355}
3356
3357func NewActionNxNote() *ActionNxNote {
3358 obj := &ActionNxNote{
3359 ActionNicira: NewActionNicira(8),
3360 }
3361 return obj
3362}
3363func (self *ActionNxNote) GetActionName() string {
3364 return "nx_note"
3365}
3366
3367func (self *ActionNxNote) GetActionFields() map[string]interface{} {
3368 return map[string]interface{}{
3369 "Note": self.Note,
3370 }
3371}
3372
3373func (self *ActionNxNote) MarshalJSON() ([]byte, error) {
3374 jsonValue, err := json.Marshal(self.GetActionFields())
3375 if err != nil {
3376 return nil, err
3377 }
3378 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
3379}
3380
3381type ActionNxOutputReg struct {
3382 *ActionNicira
3383 OfsNbits uint16
3384 Src uint32
3385 MaxLen uint16
3386}
3387
3388type IActionNxOutputReg interface {
3389 IActionNicira
3390 GetOfsNbits() uint16
3391 GetSrc() uint32
3392 GetMaxLen() uint16
3393}
3394
3395func (self *ActionNxOutputReg) GetOfsNbits() uint16 {
3396 return self.OfsNbits
3397}
3398
3399func (self *ActionNxOutputReg) SetOfsNbits(v uint16) {
3400 self.OfsNbits = v
3401}
3402
3403func (self *ActionNxOutputReg) GetSrc() uint32 {
3404 return self.Src
3405}
3406
3407func (self *ActionNxOutputReg) SetSrc(v uint32) {
3408 self.Src = v
3409}
3410
3411func (self *ActionNxOutputReg) GetMaxLen() uint16 {
3412 return self.MaxLen
3413}
3414
3415func (self *ActionNxOutputReg) SetMaxLen(v uint16) {
3416 self.MaxLen = v
3417}
3418
3419func (self *ActionNxOutputReg) Serialize(encoder *goloxi.Encoder) error {
3420 startIndex := len(encoder.Bytes())
3421 if err := self.ActionNicira.Serialize(encoder); err != nil {
3422 return err
3423 }
3424
3425 encoder.PutUint16(uint16(self.OfsNbits))
3426 encoder.PutUint32(uint32(self.Src))
3427 encoder.PutUint16(uint16(self.MaxLen))
3428 encoder.Write(bytes.Repeat([]byte{0}, 6))
3429 length := len(encoder.Bytes()) - startIndex
3430
3431 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
3432
3433 return nil
3434}
3435
3436func DecodeActionNxOutputReg(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxOutputReg, error) {
3437 _actionnxoutputreg := &ActionNxOutputReg{ActionNicira: parent}
3438 if decoder.Length() < 14 {
3439 return nil, fmt.Errorf("ActionNxOutputReg packet too short: %d < 14", decoder.Length())
3440 }
3441 _actionnxoutputreg.OfsNbits = uint16(decoder.ReadUint16())
3442 _actionnxoutputreg.Src = uint32(decoder.ReadUint32())
3443 _actionnxoutputreg.MaxLen = uint16(decoder.ReadUint16())
3444 decoder.Skip(6)
3445 return _actionnxoutputreg, nil
3446}
3447
3448func NewActionNxOutputReg() *ActionNxOutputReg {
3449 obj := &ActionNxOutputReg{
3450 ActionNicira: NewActionNicira(15),
3451 }
3452 return obj
3453}
3454func (self *ActionNxOutputReg) GetActionName() string {
3455 return "nx_output_reg"
3456}
3457
3458func (self *ActionNxOutputReg) GetActionFields() map[string]interface{} {
3459 return map[string]interface{}{
3460 "OfsNbits": self.OfsNbits,
3461 "Src": self.Src,
3462 "MaxLen": self.MaxLen,
3463 }
3464}
3465
3466func (self *ActionNxOutputReg) MarshalJSON() ([]byte, error) {
3467 jsonValue, err := json.Marshal(self.GetActionFields())
3468 if err != nil {
3469 return nil, err
3470 }
3471 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
3472}
3473
3474type ActionNxOutputReg2 struct {
3475 *ActionNicira
3476 OfsNbits uint16
3477 MaxLen uint16
3478}
3479
3480type IActionNxOutputReg2 interface {
3481 IActionNicira
3482 GetOfsNbits() uint16
3483 GetMaxLen() uint16
3484}
3485
3486func (self *ActionNxOutputReg2) GetOfsNbits() uint16 {
3487 return self.OfsNbits
3488}
3489
3490func (self *ActionNxOutputReg2) SetOfsNbits(v uint16) {
3491 self.OfsNbits = v
3492}
3493
3494func (self *ActionNxOutputReg2) GetMaxLen() uint16 {
3495 return self.MaxLen
3496}
3497
3498func (self *ActionNxOutputReg2) SetMaxLen(v uint16) {
3499 self.MaxLen = v
3500}
3501
3502func (self *ActionNxOutputReg2) Serialize(encoder *goloxi.Encoder) error {
3503 startIndex := len(encoder.Bytes())
3504 if err := self.ActionNicira.Serialize(encoder); err != nil {
3505 return err
3506 }
3507
3508 encoder.PutUint16(uint16(self.OfsNbits))
3509 encoder.PutUint16(uint16(self.MaxLen))
3510 encoder.Write(bytes.Repeat([]byte{0}, 10))
3511 length := len(encoder.Bytes()) - startIndex
3512
3513 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
3514
3515 return nil
3516}
3517
3518func DecodeActionNxOutputReg2(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxOutputReg2, error) {
3519 _actionnxoutputreg2 := &ActionNxOutputReg2{ActionNicira: parent}
3520 if decoder.Length() < 14 {
3521 return nil, fmt.Errorf("ActionNxOutputReg2 packet too short: %d < 14", decoder.Length())
3522 }
3523 _actionnxoutputreg2.OfsNbits = uint16(decoder.ReadUint16())
3524 _actionnxoutputreg2.MaxLen = uint16(decoder.ReadUint16())
3525 decoder.Skip(10)
3526 return _actionnxoutputreg2, nil
3527}
3528
3529func NewActionNxOutputReg2() *ActionNxOutputReg2 {
3530 obj := &ActionNxOutputReg2{
3531 ActionNicira: NewActionNicira(32),
3532 }
3533 return obj
3534}
3535func (self *ActionNxOutputReg2) GetActionName() string {
3536 return "nx_output_reg2"
3537}
3538
3539func (self *ActionNxOutputReg2) GetActionFields() map[string]interface{} {
3540 return map[string]interface{}{
3541 "OfsNbits": self.OfsNbits,
3542 "MaxLen": self.MaxLen,
3543 }
3544}
3545
3546func (self *ActionNxOutputReg2) MarshalJSON() ([]byte, error) {
3547 jsonValue, err := json.Marshal(self.GetActionFields())
3548 if err != nil {
3549 return nil, err
3550 }
3551 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
3552}
3553
3554type ActionNxOutputTrunc struct {
3555 *ActionNicira
3556 Port uint16
3557 MaxLen uint32
3558}
3559
3560type IActionNxOutputTrunc interface {
3561 IActionNicira
3562 GetPort() uint16
3563 GetMaxLen() uint32
3564}
3565
3566func (self *ActionNxOutputTrunc) GetPort() uint16 {
3567 return self.Port
3568}
3569
3570func (self *ActionNxOutputTrunc) SetPort(v uint16) {
3571 self.Port = v
3572}
3573
3574func (self *ActionNxOutputTrunc) GetMaxLen() uint32 {
3575 return self.MaxLen
3576}
3577
3578func (self *ActionNxOutputTrunc) SetMaxLen(v uint32) {
3579 self.MaxLen = v
3580}
3581
3582func (self *ActionNxOutputTrunc) Serialize(encoder *goloxi.Encoder) error {
3583 startIndex := len(encoder.Bytes())
3584 if err := self.ActionNicira.Serialize(encoder); err != nil {
3585 return err
3586 }
3587
3588 encoder.PutUint16(uint16(self.Port))
3589 encoder.PutUint32(uint32(self.MaxLen))
3590 length := len(encoder.Bytes()) - startIndex
3591
3592 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
3593
3594 return nil
3595}
3596
3597func DecodeActionNxOutputTrunc(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxOutputTrunc, error) {
3598 _actionnxoutputtrunc := &ActionNxOutputTrunc{ActionNicira: parent}
3599 if decoder.Length() < 6 {
3600 return nil, fmt.Errorf("ActionNxOutputTrunc packet too short: %d < 6", decoder.Length())
3601 }
3602 _actionnxoutputtrunc.Port = uint16(decoder.ReadUint16())
3603 _actionnxoutputtrunc.MaxLen = uint32(decoder.ReadUint32())
3604 return _actionnxoutputtrunc, nil
3605}
3606
3607func NewActionNxOutputTrunc() *ActionNxOutputTrunc {
3608 obj := &ActionNxOutputTrunc{
3609 ActionNicira: NewActionNicira(39),
3610 }
3611 return obj
3612}
3613func (self *ActionNxOutputTrunc) GetActionName() string {
3614 return "nx_output_trunc"
3615}
3616
3617func (self *ActionNxOutputTrunc) GetActionFields() map[string]interface{} {
3618 return map[string]interface{}{
3619 "Port": self.Port,
3620 "MaxLen": self.MaxLen,
3621 }
3622}
3623
3624func (self *ActionNxOutputTrunc) MarshalJSON() ([]byte, error) {
3625 jsonValue, err := json.Marshal(self.GetActionFields())
3626 if err != nil {
3627 return nil, err
3628 }
3629 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
3630}
3631
3632type ActionNxPopMpls struct {
3633 *ActionNicira
3634 Value uint16
3635}
3636
3637type IActionNxPopMpls interface {
3638 IActionNicira
3639 GetValue() uint16
3640}
3641
3642func (self *ActionNxPopMpls) GetValue() uint16 {
3643 return self.Value
3644}
3645
3646func (self *ActionNxPopMpls) SetValue(v uint16) {
3647 self.Value = v
3648}
3649
3650func (self *ActionNxPopMpls) Serialize(encoder *goloxi.Encoder) error {
3651 startIndex := len(encoder.Bytes())
3652 if err := self.ActionNicira.Serialize(encoder); err != nil {
3653 return err
3654 }
3655
3656 encoder.PutUint16(uint16(self.Value))
3657 length := len(encoder.Bytes()) - startIndex
3658
3659 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
3660
3661 return nil
3662}
3663
3664func DecodeActionNxPopMpls(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxPopMpls, error) {
3665 _actionnxpopmpls := &ActionNxPopMpls{ActionNicira: parent}
3666 if decoder.Length() < 2 {
3667 return nil, fmt.Errorf("ActionNxPopMpls packet too short: %d < 2", decoder.Length())
3668 }
3669 _actionnxpopmpls.Value = uint16(decoder.ReadUint16())
3670 return _actionnxpopmpls, nil
3671}
3672
3673func NewActionNxPopMpls() *ActionNxPopMpls {
3674 obj := &ActionNxPopMpls{
3675 ActionNicira: NewActionNicira(24),
3676 }
3677 return obj
3678}
3679func (self *ActionNxPopMpls) GetActionName() string {
3680 return "nx_pop_mpls"
3681}
3682
3683func (self *ActionNxPopMpls) GetActionFields() map[string]interface{} {
3684 return map[string]interface{}{
3685 "Value": self.Value,
3686 }
3687}
3688
3689func (self *ActionNxPopMpls) MarshalJSON() ([]byte, error) {
3690 jsonValue, err := json.Marshal(self.GetActionFields())
3691 if err != nil {
3692 return nil, err
3693 }
3694 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
3695}
3696
3697type ActionNxPopQueue struct {
3698 *ActionNicira
3699}
3700
3701type IActionNxPopQueue interface {
3702 IActionNicira
3703}
3704
3705func (self *ActionNxPopQueue) Serialize(encoder *goloxi.Encoder) error {
3706 startIndex := len(encoder.Bytes())
3707 if err := self.ActionNicira.Serialize(encoder); err != nil {
3708 return err
3709 }
3710 length := len(encoder.Bytes()) - startIndex
3711
3712 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
3713
3714 return nil
3715}
3716
3717func DecodeActionNxPopQueue(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxPopQueue, error) {
3718 _actionnxpopqueue := &ActionNxPopQueue{ActionNicira: parent}
3719 return _actionnxpopqueue, nil
3720}
3721
3722func NewActionNxPopQueue() *ActionNxPopQueue {
3723 obj := &ActionNxPopQueue{
3724 ActionNicira: NewActionNicira(5),
3725 }
3726 return obj
3727}
3728func (self *ActionNxPopQueue) GetActionName() string {
3729 return "nx_pop_queue"
3730}
3731
3732func (self *ActionNxPopQueue) GetActionFields() map[string]interface{} {
3733 return map[string]interface{}{}
3734}
3735
3736func (self *ActionNxPopQueue) MarshalJSON() ([]byte, error) {
3737 jsonValue, err := json.Marshal(self.GetActionFields())
3738 if err != nil {
3739 return nil, err
3740 }
3741 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
3742}
3743
3744type ActionNxPushMpls struct {
3745 *ActionNicira
3746 Value uint16
3747}
3748
3749type IActionNxPushMpls interface {
3750 IActionNicira
3751 GetValue() uint16
3752}
3753
3754func (self *ActionNxPushMpls) GetValue() uint16 {
3755 return self.Value
3756}
3757
3758func (self *ActionNxPushMpls) SetValue(v uint16) {
3759 self.Value = v
3760}
3761
3762func (self *ActionNxPushMpls) Serialize(encoder *goloxi.Encoder) error {
3763 startIndex := len(encoder.Bytes())
3764 if err := self.ActionNicira.Serialize(encoder); err != nil {
3765 return err
3766 }
3767
3768 encoder.PutUint16(uint16(self.Value))
3769 length := len(encoder.Bytes()) - startIndex
3770
3771 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
3772
3773 return nil
3774}
3775
3776func DecodeActionNxPushMpls(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxPushMpls, error) {
3777 _actionnxpushmpls := &ActionNxPushMpls{ActionNicira: parent}
3778 if decoder.Length() < 2 {
3779 return nil, fmt.Errorf("ActionNxPushMpls packet too short: %d < 2", decoder.Length())
3780 }
3781 _actionnxpushmpls.Value = uint16(decoder.ReadUint16())
3782 return _actionnxpushmpls, nil
3783}
3784
3785func NewActionNxPushMpls() *ActionNxPushMpls {
3786 obj := &ActionNxPushMpls{
3787 ActionNicira: NewActionNicira(23),
3788 }
3789 return obj
3790}
3791func (self *ActionNxPushMpls) GetActionName() string {
3792 return "nx_push_mpls"
3793}
3794
3795func (self *ActionNxPushMpls) GetActionFields() map[string]interface{} {
3796 return map[string]interface{}{
3797 "Value": self.Value,
3798 }
3799}
3800
3801func (self *ActionNxPushMpls) MarshalJSON() ([]byte, error) {
3802 jsonValue, err := json.Marshal(self.GetActionFields())
3803 if err != nil {
3804 return nil, err
3805 }
3806 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
3807}
3808
3809type ActionNxRegLoad struct {
3810 *ActionNicira
3811 OfsNbits uint16
3812 SrcField goloxi.IOxmId
3813 Value uint64
3814}
3815
3816type IActionNxRegLoad interface {
3817 IActionNicira
3818 GetOfsNbits() uint16
3819 GetSrcField() goloxi.IOxmId
3820 GetValue() uint64
3821}
3822
3823func (self *ActionNxRegLoad) GetOfsNbits() uint16 {
3824 return self.OfsNbits
3825}
3826
3827func (self *ActionNxRegLoad) SetOfsNbits(v uint16) {
3828 self.OfsNbits = v
3829}
3830
3831func (self *ActionNxRegLoad) GetSrcField() goloxi.IOxmId {
3832 return self.SrcField
3833}
3834
3835func (self *ActionNxRegLoad) SetSrcField(v goloxi.IOxmId) {
3836 self.SrcField = v
3837}
3838
3839func (self *ActionNxRegLoad) GetValue() uint64 {
3840 return self.Value
3841}
3842
3843func (self *ActionNxRegLoad) SetValue(v uint64) {
3844 self.Value = v
3845}
3846
3847func (self *ActionNxRegLoad) Serialize(encoder *goloxi.Encoder) error {
3848 startIndex := len(encoder.Bytes())
3849 if err := self.ActionNicira.Serialize(encoder); err != nil {
3850 return err
3851 }
3852
3853 encoder.PutUint16(uint16(self.OfsNbits))
3854 self.SrcField.Serialize(encoder)
3855 encoder.PutUint64(uint64(self.Value))
3856 length := len(encoder.Bytes()) - startIndex
3857
3858 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
3859
3860 return nil
3861}
3862
3863func DecodeActionNxRegLoad(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxRegLoad, error) {
3864 _actionnxregload := &ActionNxRegLoad{ActionNicira: parent}
3865 if decoder.Length() < 14 {
3866 return nil, fmt.Errorf("ActionNxRegLoad packet too short: %d < 14", decoder.Length())
3867 }
3868 _actionnxregload.OfsNbits = uint16(decoder.ReadUint16())
3869 if obj, err := DecodeOxmId(decoder); err != nil {
3870 return nil, err
3871 } else {
3872 _actionnxregload.SrcField = obj
3873 }
3874
3875 _actionnxregload.Value = uint64(decoder.ReadUint64())
3876 return _actionnxregload, nil
3877}
3878
3879func NewActionNxRegLoad() *ActionNxRegLoad {
3880 obj := &ActionNxRegLoad{
3881 ActionNicira: NewActionNicira(7),
3882 }
3883 return obj
3884}
3885func (self *ActionNxRegLoad) GetActionName() string {
3886 return "nx_reg_load"
3887}
3888
3889func (self *ActionNxRegLoad) GetActionFields() map[string]interface{} {
3890 return map[string]interface{}{
3891 "OfsNbits": self.OfsNbits,
3892 "SrcField": self.SrcField,
3893 "Value": self.Value,
3894 }
3895}
3896
3897func (self *ActionNxRegLoad) MarshalJSON() ([]byte, error) {
3898 jsonValue, err := json.Marshal(self.GetActionFields())
3899 if err != nil {
3900 return nil, err
3901 }
3902 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
3903}
3904
3905type ActionNxRegLoad2 struct {
3906 *ActionNicira
3907}
3908
3909type IActionNxRegLoad2 interface {
3910 IActionNicira
3911}
3912
3913func (self *ActionNxRegLoad2) Serialize(encoder *goloxi.Encoder) error {
3914 startIndex := len(encoder.Bytes())
3915 if err := self.ActionNicira.Serialize(encoder); err != nil {
3916 return err
3917 }
3918
3919 encoder.Write(bytes.Repeat([]byte{0}, 6))
3920 length := len(encoder.Bytes()) - startIndex
3921
3922 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
3923
3924 return nil
3925}
3926
3927func DecodeActionNxRegLoad2(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxRegLoad2, error) {
3928 _actionnxregload2 := &ActionNxRegLoad2{ActionNicira: parent}
3929 if decoder.Length() < 6 {
3930 return nil, fmt.Errorf("ActionNxRegLoad2 packet too short: %d < 6", decoder.Length())
3931 }
3932 decoder.Skip(6)
3933 return _actionnxregload2, nil
3934}
3935
3936func NewActionNxRegLoad2() *ActionNxRegLoad2 {
3937 obj := &ActionNxRegLoad2{
3938 ActionNicira: NewActionNicira(33),
3939 }
3940 return obj
3941}
3942func (self *ActionNxRegLoad2) GetActionName() string {
3943 return "nx_reg_load2"
3944}
3945
3946func (self *ActionNxRegLoad2) GetActionFields() map[string]interface{} {
3947 return map[string]interface{}{}
3948}
3949
3950func (self *ActionNxRegLoad2) MarshalJSON() ([]byte, error) {
3951 jsonValue, err := json.Marshal(self.GetActionFields())
3952 if err != nil {
3953 return nil, err
3954 }
3955 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
3956}
3957
3958type ActionNxRegMove struct {
3959 *ActionNicira
3960 NBits uint16
3961 SrcOfs uint16
3962 DstOfs uint16
3963 Src goloxi.IOxmId
3964 Dst goloxi.IOxmId
3965}
3966
3967type IActionNxRegMove interface {
3968 IActionNicira
3969 GetNBits() uint16
3970 GetSrcOfs() uint16
3971 GetDstOfs() uint16
3972 GetSrc() goloxi.IOxmId
3973 GetDst() goloxi.IOxmId
3974}
3975
3976func (self *ActionNxRegMove) GetNBits() uint16 {
3977 return self.NBits
3978}
3979
3980func (self *ActionNxRegMove) SetNBits(v uint16) {
3981 self.NBits = v
3982}
3983
3984func (self *ActionNxRegMove) GetSrcOfs() uint16 {
3985 return self.SrcOfs
3986}
3987
3988func (self *ActionNxRegMove) SetSrcOfs(v uint16) {
3989 self.SrcOfs = v
3990}
3991
3992func (self *ActionNxRegMove) GetDstOfs() uint16 {
3993 return self.DstOfs
3994}
3995
3996func (self *ActionNxRegMove) SetDstOfs(v uint16) {
3997 self.DstOfs = v
3998}
3999
4000func (self *ActionNxRegMove) GetSrc() goloxi.IOxmId {
4001 return self.Src
4002}
4003
4004func (self *ActionNxRegMove) SetSrc(v goloxi.IOxmId) {
4005 self.Src = v
4006}
4007
4008func (self *ActionNxRegMove) GetDst() goloxi.IOxmId {
4009 return self.Dst
4010}
4011
4012func (self *ActionNxRegMove) SetDst(v goloxi.IOxmId) {
4013 self.Dst = v
4014}
4015
4016func (self *ActionNxRegMove) Serialize(encoder *goloxi.Encoder) error {
4017 startIndex := len(encoder.Bytes())
4018 if err := self.ActionNicira.Serialize(encoder); err != nil {
4019 return err
4020 }
4021
4022 encoder.PutUint16(uint16(self.NBits))
4023 encoder.PutUint16(uint16(self.SrcOfs))
4024 encoder.PutUint16(uint16(self.DstOfs))
4025 self.Src.Serialize(encoder)
4026 self.Dst.Serialize(encoder)
4027 length := len(encoder.Bytes()) - startIndex
4028 alignedLength := ((length + 7) / 8 * 8)
4029
4030 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
4031
4032 encoder.Write(bytes.Repeat([]byte{0}, alignedLength-length))
4033
4034 return nil
4035}
4036
4037func DecodeActionNxRegMove(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxRegMove, error) {
4038 _actionnxregmove := &ActionNxRegMove{ActionNicira: parent}
4039 if decoder.Length() < 14 {
4040 return nil, fmt.Errorf("ActionNxRegMove packet too short: %d < 14", decoder.Length())
4041 }
4042 _actionnxregmove.NBits = uint16(decoder.ReadUint16())
4043 _actionnxregmove.SrcOfs = uint16(decoder.ReadUint16())
4044 _actionnxregmove.DstOfs = uint16(decoder.ReadUint16())
4045 if obj, err := DecodeOxmId(decoder); err != nil {
4046 return nil, err
4047 } else {
4048 _actionnxregmove.Src = obj
4049 }
4050
4051 if obj, err := DecodeOxmId(decoder); err != nil {
4052 return nil, err
4053 } else {
4054 _actionnxregmove.Dst = obj
4055 }
4056
4057 return _actionnxregmove, nil
4058}
4059
4060func NewActionNxRegMove() *ActionNxRegMove {
4061 obj := &ActionNxRegMove{
4062 ActionNicira: NewActionNicira(6),
4063 }
4064 return obj
4065}
4066func (self *ActionNxRegMove) GetActionName() string {
4067 return "nx_reg_move"
4068}
4069
4070func (self *ActionNxRegMove) GetActionFields() map[string]interface{} {
4071 return map[string]interface{}{
4072 "NBits": self.NBits,
4073 "SrcOfs": self.SrcOfs,
4074 "DstOfs": self.DstOfs,
4075 "Src": self.Src,
4076 "Dst": self.Dst,
4077 }
4078}
4079
4080func (self *ActionNxRegMove) MarshalJSON() ([]byte, error) {
4081 jsonValue, err := json.Marshal(self.GetActionFields())
4082 if err != nil {
4083 return nil, err
4084 }
4085 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
4086}
4087
4088type ActionNxResubmit struct {
4089 *ActionNicira
4090 Value uint16
4091}
4092
4093type IActionNxResubmit interface {
4094 IActionNicira
4095 GetValue() uint16
4096}
4097
4098func (self *ActionNxResubmit) GetValue() uint16 {
4099 return self.Value
4100}
4101
4102func (self *ActionNxResubmit) SetValue(v uint16) {
4103 self.Value = v
4104}
4105
4106func (self *ActionNxResubmit) Serialize(encoder *goloxi.Encoder) error {
4107 startIndex := len(encoder.Bytes())
4108 if err := self.ActionNicira.Serialize(encoder); err != nil {
4109 return err
4110 }
4111
4112 encoder.PutUint16(uint16(self.Value))
4113 length := len(encoder.Bytes()) - startIndex
4114
4115 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
4116
4117 return nil
4118}
4119
4120func DecodeActionNxResubmit(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxResubmit, error) {
4121 _actionnxresubmit := &ActionNxResubmit{ActionNicira: parent}
4122 if decoder.Length() < 2 {
4123 return nil, fmt.Errorf("ActionNxResubmit packet too short: %d < 2", decoder.Length())
4124 }
4125 _actionnxresubmit.Value = uint16(decoder.ReadUint16())
4126 return _actionnxresubmit, nil
4127}
4128
4129func NewActionNxResubmit() *ActionNxResubmit {
4130 obj := &ActionNxResubmit{
4131 ActionNicira: NewActionNicira(1),
4132 }
4133 return obj
4134}
4135func (self *ActionNxResubmit) GetActionName() string {
4136 return "nx_resubmit"
4137}
4138
4139func (self *ActionNxResubmit) GetActionFields() map[string]interface{} {
4140 return map[string]interface{}{
4141 "Value": self.Value,
4142 }
4143}
4144
4145func (self *ActionNxResubmit) MarshalJSON() ([]byte, error) {
4146 jsonValue, err := json.Marshal(self.GetActionFields())
4147 if err != nil {
4148 return nil, err
4149 }
4150 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
4151}
4152
4153type ActionNxResubmitTable struct {
4154 *ActionNicira
4155 InPort uint16
4156 Table uint8
4157}
4158
4159type IActionNxResubmitTable interface {
4160 IActionNicira
4161 GetInPort() uint16
4162 GetTable() uint8
4163}
4164
4165func (self *ActionNxResubmitTable) GetInPort() uint16 {
4166 return self.InPort
4167}
4168
4169func (self *ActionNxResubmitTable) SetInPort(v uint16) {
4170 self.InPort = v
4171}
4172
4173func (self *ActionNxResubmitTable) GetTable() uint8 {
4174 return self.Table
4175}
4176
4177func (self *ActionNxResubmitTable) SetTable(v uint8) {
4178 self.Table = v
4179}
4180
4181func (self *ActionNxResubmitTable) Serialize(encoder *goloxi.Encoder) error {
4182 startIndex := len(encoder.Bytes())
4183 if err := self.ActionNicira.Serialize(encoder); err != nil {
4184 return err
4185 }
4186
4187 encoder.PutUint16(uint16(self.InPort))
4188 encoder.PutUint8(uint8(self.Table))
4189 encoder.Write(bytes.Repeat([]byte{0}, 3))
4190 length := len(encoder.Bytes()) - startIndex
4191
4192 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
4193
4194 return nil
4195}
4196
4197func DecodeActionNxResubmitTable(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxResubmitTable, error) {
4198 _actionnxresubmittable := &ActionNxResubmitTable{ActionNicira: parent}
4199 if decoder.Length() < 6 {
4200 return nil, fmt.Errorf("ActionNxResubmitTable packet too short: %d < 6", decoder.Length())
4201 }
4202 _actionnxresubmittable.InPort = uint16(decoder.ReadUint16())
4203 _actionnxresubmittable.Table = uint8(decoder.ReadByte())
4204 decoder.Skip(3)
4205 return _actionnxresubmittable, nil
4206}
4207
4208func NewActionNxResubmitTable() *ActionNxResubmitTable {
4209 obj := &ActionNxResubmitTable{
4210 ActionNicira: NewActionNicira(14),
4211 }
4212 return obj
4213}
4214func (self *ActionNxResubmitTable) GetActionName() string {
4215 return "nx_resubmit_table"
4216}
4217
4218func (self *ActionNxResubmitTable) GetActionFields() map[string]interface{} {
4219 return map[string]interface{}{
4220 "InPort": self.InPort,
4221 "Table": self.Table,
4222 }
4223}
4224
4225func (self *ActionNxResubmitTable) MarshalJSON() ([]byte, error) {
4226 jsonValue, err := json.Marshal(self.GetActionFields())
4227 if err != nil {
4228 return nil, err
4229 }
4230 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
4231}
4232
4233type ActionNxResubmitTableCt struct {
4234 *ActionNicira
4235 InPort uint16
4236 Table uint8
4237}
4238
4239type IActionNxResubmitTableCt interface {
4240 IActionNicira
4241 GetInPort() uint16
4242 GetTable() uint8
4243}
4244
4245func (self *ActionNxResubmitTableCt) GetInPort() uint16 {
4246 return self.InPort
4247}
4248
4249func (self *ActionNxResubmitTableCt) SetInPort(v uint16) {
4250 self.InPort = v
4251}
4252
4253func (self *ActionNxResubmitTableCt) GetTable() uint8 {
4254 return self.Table
4255}
4256
4257func (self *ActionNxResubmitTableCt) SetTable(v uint8) {
4258 self.Table = v
4259}
4260
4261func (self *ActionNxResubmitTableCt) Serialize(encoder *goloxi.Encoder) error {
4262 startIndex := len(encoder.Bytes())
4263 if err := self.ActionNicira.Serialize(encoder); err != nil {
4264 return err
4265 }
4266
4267 encoder.PutUint16(uint16(self.InPort))
4268 encoder.PutUint8(uint8(self.Table))
4269 encoder.Write(bytes.Repeat([]byte{0}, 3))
4270 length := len(encoder.Bytes()) - startIndex
4271
4272 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
4273
4274 return nil
4275}
4276
4277func DecodeActionNxResubmitTableCt(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxResubmitTableCt, error) {
4278 _actionnxresubmittablect := &ActionNxResubmitTableCt{ActionNicira: parent}
4279 if decoder.Length() < 6 {
4280 return nil, fmt.Errorf("ActionNxResubmitTableCt packet too short: %d < 6", decoder.Length())
4281 }
4282 _actionnxresubmittablect.InPort = uint16(decoder.ReadUint16())
4283 _actionnxresubmittablect.Table = uint8(decoder.ReadByte())
4284 decoder.Skip(3)
4285 return _actionnxresubmittablect, nil
4286}
4287
4288func NewActionNxResubmitTableCt() *ActionNxResubmitTableCt {
4289 obj := &ActionNxResubmitTableCt{
4290 ActionNicira: NewActionNicira(44),
4291 }
4292 return obj
4293}
4294func (self *ActionNxResubmitTableCt) GetActionName() string {
4295 return "nx_resubmit_table_ct"
4296}
4297
4298func (self *ActionNxResubmitTableCt) GetActionFields() map[string]interface{} {
4299 return map[string]interface{}{
4300 "InPort": self.InPort,
4301 "Table": self.Table,
4302 }
4303}
4304
4305func (self *ActionNxResubmitTableCt) MarshalJSON() ([]byte, error) {
4306 jsonValue, err := json.Marshal(self.GetActionFields())
4307 if err != nil {
4308 return nil, err
4309 }
4310 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
4311}
4312
4313type ActionNxSample struct {
4314 *ActionNicira
4315 Probability uint16
4316 CollectorSetId uint32
4317 ObsDomainId uint32
4318 ObsPointId uint32
4319}
4320
4321type IActionNxSample interface {
4322 IActionNicira
4323 GetProbability() uint16
4324 GetCollectorSetId() uint32
4325 GetObsDomainId() uint32
4326 GetObsPointId() uint32
4327}
4328
4329func (self *ActionNxSample) GetProbability() uint16 {
4330 return self.Probability
4331}
4332
4333func (self *ActionNxSample) SetProbability(v uint16) {
4334 self.Probability = v
4335}
4336
4337func (self *ActionNxSample) GetCollectorSetId() uint32 {
4338 return self.CollectorSetId
4339}
4340
4341func (self *ActionNxSample) SetCollectorSetId(v uint32) {
4342 self.CollectorSetId = v
4343}
4344
4345func (self *ActionNxSample) GetObsDomainId() uint32 {
4346 return self.ObsDomainId
4347}
4348
4349func (self *ActionNxSample) SetObsDomainId(v uint32) {
4350 self.ObsDomainId = v
4351}
4352
4353func (self *ActionNxSample) GetObsPointId() uint32 {
4354 return self.ObsPointId
4355}
4356
4357func (self *ActionNxSample) SetObsPointId(v uint32) {
4358 self.ObsPointId = v
4359}
4360
4361func (self *ActionNxSample) Serialize(encoder *goloxi.Encoder) error {
4362 startIndex := len(encoder.Bytes())
4363 if err := self.ActionNicira.Serialize(encoder); err != nil {
4364 return err
4365 }
4366
4367 encoder.PutUint16(uint16(self.Probability))
4368 encoder.PutUint32(uint32(self.CollectorSetId))
4369 encoder.PutUint32(uint32(self.ObsDomainId))
4370 encoder.PutUint32(uint32(self.ObsPointId))
4371 length := len(encoder.Bytes()) - startIndex
4372
4373 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
4374
4375 return nil
4376}
4377
4378func DecodeActionNxSample(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxSample, error) {
4379 _actionnxsample := &ActionNxSample{ActionNicira: parent}
4380 if decoder.Length() < 14 {
4381 return nil, fmt.Errorf("ActionNxSample packet too short: %d < 14", decoder.Length())
4382 }
4383 _actionnxsample.Probability = uint16(decoder.ReadUint16())
4384 _actionnxsample.CollectorSetId = uint32(decoder.ReadUint32())
4385 _actionnxsample.ObsDomainId = uint32(decoder.ReadUint32())
4386 _actionnxsample.ObsPointId = uint32(decoder.ReadUint32())
4387 return _actionnxsample, nil
4388}
4389
4390func NewActionNxSample() *ActionNxSample {
4391 obj := &ActionNxSample{
4392 ActionNicira: NewActionNicira(29),
4393 }
4394 return obj
4395}
4396func (self *ActionNxSample) GetActionName() string {
4397 return "nx_sample"
4398}
4399
4400func (self *ActionNxSample) GetActionFields() map[string]interface{} {
4401 return map[string]interface{}{
4402 "Probability": self.Probability,
4403 "CollectorSetId": self.CollectorSetId,
4404 "ObsDomainId": self.ObsDomainId,
4405 "ObsPointId": self.ObsPointId,
4406 }
4407}
4408
4409func (self *ActionNxSample) MarshalJSON() ([]byte, error) {
4410 jsonValue, err := json.Marshal(self.GetActionFields())
4411 if err != nil {
4412 return nil, err
4413 }
4414 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
4415}
4416
4417type ActionNxSample2 struct {
4418 *ActionNicira
4419 Probability uint16
4420 CollectorSetId uint32
4421 ObsDomainId uint32
4422 ObsPointId uint32
4423 SamplingPort uint16
4424 Direction uint8
4425}
4426
4427type IActionNxSample2 interface {
4428 IActionNicira
4429 GetProbability() uint16
4430 GetCollectorSetId() uint32
4431 GetObsDomainId() uint32
4432 GetObsPointId() uint32
4433 GetSamplingPort() uint16
4434 GetDirection() uint8
4435}
4436
4437func (self *ActionNxSample2) GetProbability() uint16 {
4438 return self.Probability
4439}
4440
4441func (self *ActionNxSample2) SetProbability(v uint16) {
4442 self.Probability = v
4443}
4444
4445func (self *ActionNxSample2) GetCollectorSetId() uint32 {
4446 return self.CollectorSetId
4447}
4448
4449func (self *ActionNxSample2) SetCollectorSetId(v uint32) {
4450 self.CollectorSetId = v
4451}
4452
4453func (self *ActionNxSample2) GetObsDomainId() uint32 {
4454 return self.ObsDomainId
4455}
4456
4457func (self *ActionNxSample2) SetObsDomainId(v uint32) {
4458 self.ObsDomainId = v
4459}
4460
4461func (self *ActionNxSample2) GetObsPointId() uint32 {
4462 return self.ObsPointId
4463}
4464
4465func (self *ActionNxSample2) SetObsPointId(v uint32) {
4466 self.ObsPointId = v
4467}
4468
4469func (self *ActionNxSample2) GetSamplingPort() uint16 {
4470 return self.SamplingPort
4471}
4472
4473func (self *ActionNxSample2) SetSamplingPort(v uint16) {
4474 self.SamplingPort = v
4475}
4476
4477func (self *ActionNxSample2) GetDirection() uint8 {
4478 return self.Direction
4479}
4480
4481func (self *ActionNxSample2) SetDirection(v uint8) {
4482 self.Direction = v
4483}
4484
4485func (self *ActionNxSample2) Serialize(encoder *goloxi.Encoder) error {
4486 startIndex := len(encoder.Bytes())
4487 if err := self.ActionNicira.Serialize(encoder); err != nil {
4488 return err
4489 }
4490
4491 encoder.PutUint16(uint16(self.Probability))
4492 encoder.PutUint32(uint32(self.CollectorSetId))
4493 encoder.PutUint32(uint32(self.ObsDomainId))
4494 encoder.PutUint32(uint32(self.ObsPointId))
4495 encoder.PutUint16(uint16(self.SamplingPort))
4496 encoder.PutUint8(uint8(self.Direction))
4497 encoder.Write(bytes.Repeat([]byte{0}, 5))
4498 length := len(encoder.Bytes()) - startIndex
4499
4500 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
4501
4502 return nil
4503}
4504
4505func DecodeActionNxSample2(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxSample2, error) {
4506 _actionnxsample2 := &ActionNxSample2{ActionNicira: parent}
4507 if decoder.Length() < 22 {
4508 return nil, fmt.Errorf("ActionNxSample2 packet too short: %d < 22", decoder.Length())
4509 }
4510 _actionnxsample2.Probability = uint16(decoder.ReadUint16())
4511 _actionnxsample2.CollectorSetId = uint32(decoder.ReadUint32())
4512 _actionnxsample2.ObsDomainId = uint32(decoder.ReadUint32())
4513 _actionnxsample2.ObsPointId = uint32(decoder.ReadUint32())
4514 _actionnxsample2.SamplingPort = uint16(decoder.ReadUint16())
4515 _actionnxsample2.Direction = uint8(decoder.ReadByte())
4516 decoder.Skip(5)
4517 return _actionnxsample2, nil
4518}
4519
4520func NewActionNxSample2() *ActionNxSample2 {
4521 obj := &ActionNxSample2{
4522 ActionNicira: NewActionNicira(38),
4523 }
4524 return obj
4525}
4526func (self *ActionNxSample2) GetActionName() string {
4527 return "nx_sample2"
4528}
4529
4530func (self *ActionNxSample2) GetActionFields() map[string]interface{} {
4531 return map[string]interface{}{
4532 "Probability": self.Probability,
4533 "CollectorSetId": self.CollectorSetId,
4534 "ObsDomainId": self.ObsDomainId,
4535 "ObsPointId": self.ObsPointId,
4536 "SamplingPort": self.SamplingPort,
4537 "Direction": self.Direction,
4538 }
4539}
4540
4541func (self *ActionNxSample2) MarshalJSON() ([]byte, error) {
4542 jsonValue, err := json.Marshal(self.GetActionFields())
4543 if err != nil {
4544 return nil, err
4545 }
4546 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
4547}
4548
4549type ActionNxSample3 struct {
4550 *ActionNicira
4551 Probability uint16
4552 CollectorSetId uint32
4553 ObsDomainId uint32
4554 ObsPointId uint32
4555 SamplingPort uint16
4556 Direction uint8
4557}
4558
4559type IActionNxSample3 interface {
4560 IActionNicira
4561 GetProbability() uint16
4562 GetCollectorSetId() uint32
4563 GetObsDomainId() uint32
4564 GetObsPointId() uint32
4565 GetSamplingPort() uint16
4566 GetDirection() uint8
4567}
4568
4569func (self *ActionNxSample3) GetProbability() uint16 {
4570 return self.Probability
4571}
4572
4573func (self *ActionNxSample3) SetProbability(v uint16) {
4574 self.Probability = v
4575}
4576
4577func (self *ActionNxSample3) GetCollectorSetId() uint32 {
4578 return self.CollectorSetId
4579}
4580
4581func (self *ActionNxSample3) SetCollectorSetId(v uint32) {
4582 self.CollectorSetId = v
4583}
4584
4585func (self *ActionNxSample3) GetObsDomainId() uint32 {
4586 return self.ObsDomainId
4587}
4588
4589func (self *ActionNxSample3) SetObsDomainId(v uint32) {
4590 self.ObsDomainId = v
4591}
4592
4593func (self *ActionNxSample3) GetObsPointId() uint32 {
4594 return self.ObsPointId
4595}
4596
4597func (self *ActionNxSample3) SetObsPointId(v uint32) {
4598 self.ObsPointId = v
4599}
4600
4601func (self *ActionNxSample3) GetSamplingPort() uint16 {
4602 return self.SamplingPort
4603}
4604
4605func (self *ActionNxSample3) SetSamplingPort(v uint16) {
4606 self.SamplingPort = v
4607}
4608
4609func (self *ActionNxSample3) GetDirection() uint8 {
4610 return self.Direction
4611}
4612
4613func (self *ActionNxSample3) SetDirection(v uint8) {
4614 self.Direction = v
4615}
4616
4617func (self *ActionNxSample3) Serialize(encoder *goloxi.Encoder) error {
4618 startIndex := len(encoder.Bytes())
4619 if err := self.ActionNicira.Serialize(encoder); err != nil {
4620 return err
4621 }
4622
4623 encoder.PutUint16(uint16(self.Probability))
4624 encoder.PutUint32(uint32(self.CollectorSetId))
4625 encoder.PutUint32(uint32(self.ObsDomainId))
4626 encoder.PutUint32(uint32(self.ObsPointId))
4627 encoder.PutUint16(uint16(self.SamplingPort))
4628 encoder.PutUint8(uint8(self.Direction))
4629 encoder.Write(bytes.Repeat([]byte{0}, 5))
4630 length := len(encoder.Bytes()) - startIndex
4631
4632 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
4633
4634 return nil
4635}
4636
4637func DecodeActionNxSample3(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxSample3, error) {
4638 _actionnxsample3 := &ActionNxSample3{ActionNicira: parent}
4639 if decoder.Length() < 22 {
4640 return nil, fmt.Errorf("ActionNxSample3 packet too short: %d < 22", decoder.Length())
4641 }
4642 _actionnxsample3.Probability = uint16(decoder.ReadUint16())
4643 _actionnxsample3.CollectorSetId = uint32(decoder.ReadUint32())
4644 _actionnxsample3.ObsDomainId = uint32(decoder.ReadUint32())
4645 _actionnxsample3.ObsPointId = uint32(decoder.ReadUint32())
4646 _actionnxsample3.SamplingPort = uint16(decoder.ReadUint16())
4647 _actionnxsample3.Direction = uint8(decoder.ReadByte())
4648 decoder.Skip(5)
4649 return _actionnxsample3, nil
4650}
4651
4652func NewActionNxSample3() *ActionNxSample3 {
4653 obj := &ActionNxSample3{
4654 ActionNicira: NewActionNicira(41),
4655 }
4656 return obj
4657}
4658func (self *ActionNxSample3) GetActionName() string {
4659 return "nx_sample3"
4660}
4661
4662func (self *ActionNxSample3) GetActionFields() map[string]interface{} {
4663 return map[string]interface{}{
4664 "Probability": self.Probability,
4665 "CollectorSetId": self.CollectorSetId,
4666 "ObsDomainId": self.ObsDomainId,
4667 "ObsPointId": self.ObsPointId,
4668 "SamplingPort": self.SamplingPort,
4669 "Direction": self.Direction,
4670 }
4671}
4672
4673func (self *ActionNxSample3) MarshalJSON() ([]byte, error) {
4674 jsonValue, err := json.Marshal(self.GetActionFields())
4675 if err != nil {
4676 return nil, err
4677 }
4678 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
4679}
4680
4681type ActionNxSetMplsLabel struct {
4682 *ActionNicira
4683 Value uint32
4684}
4685
4686type IActionNxSetMplsLabel interface {
4687 IActionNicira
4688 GetValue() uint32
4689}
4690
4691func (self *ActionNxSetMplsLabel) GetValue() uint32 {
4692 return self.Value
4693}
4694
4695func (self *ActionNxSetMplsLabel) SetValue(v uint32) {
4696 self.Value = v
4697}
4698
4699func (self *ActionNxSetMplsLabel) Serialize(encoder *goloxi.Encoder) error {
4700 startIndex := len(encoder.Bytes())
4701 if err := self.ActionNicira.Serialize(encoder); err != nil {
4702 return err
4703 }
4704
4705 encoder.PutUint32(uint32(self.Value))
4706 length := len(encoder.Bytes()) - startIndex
4707
4708 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
4709
4710 return nil
4711}
4712
4713func DecodeActionNxSetMplsLabel(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxSetMplsLabel, error) {
4714 _actionnxsetmplslabel := &ActionNxSetMplsLabel{ActionNicira: parent}
4715 if decoder.Length() < 4 {
4716 return nil, fmt.Errorf("ActionNxSetMplsLabel packet too short: %d < 4", decoder.Length())
4717 }
4718 _actionnxsetmplslabel.Value = uint32(decoder.ReadUint32())
4719 return _actionnxsetmplslabel, nil
4720}
4721
4722func NewActionNxSetMplsLabel() *ActionNxSetMplsLabel {
4723 obj := &ActionNxSetMplsLabel{
4724 ActionNicira: NewActionNicira(30),
4725 }
4726 return obj
4727}
4728func (self *ActionNxSetMplsLabel) GetActionName() string {
4729 return "nx_set_mpls_label"
4730}
4731
4732func (self *ActionNxSetMplsLabel) GetActionFields() map[string]interface{} {
4733 return map[string]interface{}{
4734 "Value": self.Value,
4735 }
4736}
4737
4738func (self *ActionNxSetMplsLabel) MarshalJSON() ([]byte, error) {
4739 jsonValue, err := json.Marshal(self.GetActionFields())
4740 if err != nil {
4741 return nil, err
4742 }
4743 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
4744}
4745
4746type ActionNxSetMplsTc struct {
4747 *ActionNicira
4748 Value uint8
4749}
4750
4751type IActionNxSetMplsTc interface {
4752 IActionNicira
4753 GetValue() uint8
4754}
4755
4756func (self *ActionNxSetMplsTc) GetValue() uint8 {
4757 return self.Value
4758}
4759
4760func (self *ActionNxSetMplsTc) SetValue(v uint8) {
4761 self.Value = v
4762}
4763
4764func (self *ActionNxSetMplsTc) Serialize(encoder *goloxi.Encoder) error {
4765 startIndex := len(encoder.Bytes())
4766 if err := self.ActionNicira.Serialize(encoder); err != nil {
4767 return err
4768 }
4769
4770 encoder.PutUint8(uint8(self.Value))
4771 length := len(encoder.Bytes()) - startIndex
4772
4773 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
4774
4775 return nil
4776}
4777
4778func DecodeActionNxSetMplsTc(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxSetMplsTc, error) {
4779 _actionnxsetmplstc := &ActionNxSetMplsTc{ActionNicira: parent}
4780 if decoder.Length() < 1 {
4781 return nil, fmt.Errorf("ActionNxSetMplsTc packet too short: %d < 1", decoder.Length())
4782 }
4783 _actionnxsetmplstc.Value = uint8(decoder.ReadByte())
4784 return _actionnxsetmplstc, nil
4785}
4786
4787func NewActionNxSetMplsTc() *ActionNxSetMplsTc {
4788 obj := &ActionNxSetMplsTc{
4789 ActionNicira: NewActionNicira(31),
4790 }
4791 return obj
4792}
4793func (self *ActionNxSetMplsTc) GetActionName() string {
4794 return "nx_set_mpls_tc"
4795}
4796
4797func (self *ActionNxSetMplsTc) GetActionFields() map[string]interface{} {
4798 return map[string]interface{}{
4799 "Value": self.Value,
4800 }
4801}
4802
4803func (self *ActionNxSetMplsTc) MarshalJSON() ([]byte, error) {
4804 jsonValue, err := json.Marshal(self.GetActionFields())
4805 if err != nil {
4806 return nil, err
4807 }
4808 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
4809}
4810
4811type ActionNxSetMplsTtl struct {
4812 *ActionNicira
4813 Value uint8
4814}
4815
4816type IActionNxSetMplsTtl interface {
4817 IActionNicira
4818 GetValue() uint8
4819}
4820
4821func (self *ActionNxSetMplsTtl) GetValue() uint8 {
4822 return self.Value
4823}
4824
4825func (self *ActionNxSetMplsTtl) SetValue(v uint8) {
4826 self.Value = v
4827}
4828
4829func (self *ActionNxSetMplsTtl) Serialize(encoder *goloxi.Encoder) error {
4830 startIndex := len(encoder.Bytes())
4831 if err := self.ActionNicira.Serialize(encoder); err != nil {
4832 return err
4833 }
4834
4835 encoder.PutUint8(uint8(self.Value))
4836 length := len(encoder.Bytes()) - startIndex
4837
4838 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
4839
4840 return nil
4841}
4842
4843func DecodeActionNxSetMplsTtl(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxSetMplsTtl, error) {
4844 _actionnxsetmplsttl := &ActionNxSetMplsTtl{ActionNicira: parent}
4845 if decoder.Length() < 1 {
4846 return nil, fmt.Errorf("ActionNxSetMplsTtl packet too short: %d < 1", decoder.Length())
4847 }
4848 _actionnxsetmplsttl.Value = uint8(decoder.ReadByte())
4849 return _actionnxsetmplsttl, nil
4850}
4851
4852func NewActionNxSetMplsTtl() *ActionNxSetMplsTtl {
4853 obj := &ActionNxSetMplsTtl{
4854 ActionNicira: NewActionNicira(25),
4855 }
4856 return obj
4857}
4858func (self *ActionNxSetMplsTtl) GetActionName() string {
4859 return "nx_set_mpls_ttl"
4860}
4861
4862func (self *ActionNxSetMplsTtl) GetActionFields() map[string]interface{} {
4863 return map[string]interface{}{
4864 "Value": self.Value,
4865 }
4866}
4867
4868func (self *ActionNxSetMplsTtl) MarshalJSON() ([]byte, error) {
4869 jsonValue, err := json.Marshal(self.GetActionFields())
4870 if err != nil {
4871 return nil, err
4872 }
4873 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
4874}
4875
4876type ActionNxSetQueue struct {
4877 *ActionNicira
4878 Value uint32
4879}
4880
4881type IActionNxSetQueue interface {
4882 IActionNicira
4883 GetValue() uint32
4884}
4885
4886func (self *ActionNxSetQueue) GetValue() uint32 {
4887 return self.Value
4888}
4889
4890func (self *ActionNxSetQueue) SetValue(v uint32) {
4891 self.Value = v
4892}
4893
4894func (self *ActionNxSetQueue) Serialize(encoder *goloxi.Encoder) error {
4895 startIndex := len(encoder.Bytes())
4896 if err := self.ActionNicira.Serialize(encoder); err != nil {
4897 return err
4898 }
4899
4900 encoder.PutUint32(uint32(self.Value))
4901 length := len(encoder.Bytes()) - startIndex
4902
4903 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
4904
4905 return nil
4906}
4907
4908func DecodeActionNxSetQueue(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxSetQueue, error) {
4909 _actionnxsetqueue := &ActionNxSetQueue{ActionNicira: parent}
4910 if decoder.Length() < 4 {
4911 return nil, fmt.Errorf("ActionNxSetQueue packet too short: %d < 4", decoder.Length())
4912 }
4913 _actionnxsetqueue.Value = uint32(decoder.ReadUint32())
4914 return _actionnxsetqueue, nil
4915}
4916
4917func NewActionNxSetQueue() *ActionNxSetQueue {
4918 obj := &ActionNxSetQueue{
4919 ActionNicira: NewActionNicira(4),
4920 }
4921 return obj
4922}
4923func (self *ActionNxSetQueue) GetActionName() string {
4924 return "nx_set_queue"
4925}
4926
4927func (self *ActionNxSetQueue) GetActionFields() map[string]interface{} {
4928 return map[string]interface{}{
4929 "Value": self.Value,
4930 }
4931}
4932
4933func (self *ActionNxSetQueue) MarshalJSON() ([]byte, error) {
4934 jsonValue, err := json.Marshal(self.GetActionFields())
4935 if err != nil {
4936 return nil, err
4937 }
4938 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
4939}
4940
4941type ActionNxSetTunnel struct {
4942 *ActionNicira
4943 Value uint32
4944}
4945
4946type IActionNxSetTunnel interface {
4947 IActionNicira
4948 GetValue() uint32
4949}
4950
4951func (self *ActionNxSetTunnel) GetValue() uint32 {
4952 return self.Value
4953}
4954
4955func (self *ActionNxSetTunnel) SetValue(v uint32) {
4956 self.Value = v
4957}
4958
4959func (self *ActionNxSetTunnel) Serialize(encoder *goloxi.Encoder) error {
4960 startIndex := len(encoder.Bytes())
4961 if err := self.ActionNicira.Serialize(encoder); err != nil {
4962 return err
4963 }
4964
4965 encoder.PutUint32(uint32(self.Value))
4966 length := len(encoder.Bytes()) - startIndex
4967
4968 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
4969
4970 return nil
4971}
4972
4973func DecodeActionNxSetTunnel(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxSetTunnel, error) {
4974 _actionnxsettunnel := &ActionNxSetTunnel{ActionNicira: parent}
4975 if decoder.Length() < 4 {
4976 return nil, fmt.Errorf("ActionNxSetTunnel packet too short: %d < 4", decoder.Length())
4977 }
4978 _actionnxsettunnel.Value = uint32(decoder.ReadUint32())
4979 return _actionnxsettunnel, nil
4980}
4981
4982func NewActionNxSetTunnel() *ActionNxSetTunnel {
4983 obj := &ActionNxSetTunnel{
4984 ActionNicira: NewActionNicira(2),
4985 }
4986 return obj
4987}
4988func (self *ActionNxSetTunnel) GetActionName() string {
4989 return "nx_set_tunnel"
4990}
4991
4992func (self *ActionNxSetTunnel) GetActionFields() map[string]interface{} {
4993 return map[string]interface{}{
4994 "Value": self.Value,
4995 }
4996}
4997
4998func (self *ActionNxSetTunnel) MarshalJSON() ([]byte, error) {
4999 jsonValue, err := json.Marshal(self.GetActionFields())
5000 if err != nil {
5001 return nil, err
5002 }
5003 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
5004}
5005
5006type ActionNxSetTunnel64 struct {
5007 *ActionNicira
5008 Value uint64
5009}
5010
5011type IActionNxSetTunnel64 interface {
5012 IActionNicira
5013 GetValue() uint64
5014}
5015
5016func (self *ActionNxSetTunnel64) GetValue() uint64 {
5017 return self.Value
5018}
5019
5020func (self *ActionNxSetTunnel64) SetValue(v uint64) {
5021 self.Value = v
5022}
5023
5024func (self *ActionNxSetTunnel64) Serialize(encoder *goloxi.Encoder) error {
5025 startIndex := len(encoder.Bytes())
5026 if err := self.ActionNicira.Serialize(encoder); err != nil {
5027 return err
5028 }
5029
5030 encoder.PutUint64(uint64(self.Value))
5031 length := len(encoder.Bytes()) - startIndex
5032
5033 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
5034
5035 return nil
5036}
5037
5038func DecodeActionNxSetTunnel64(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxSetTunnel64, error) {
5039 _actionnxsettunnel64 := &ActionNxSetTunnel64{ActionNicira: parent}
5040 if decoder.Length() < 8 {
5041 return nil, fmt.Errorf("ActionNxSetTunnel64 packet too short: %d < 8", decoder.Length())
5042 }
5043 _actionnxsettunnel64.Value = uint64(decoder.ReadUint64())
5044 return _actionnxsettunnel64, nil
5045}
5046
5047func NewActionNxSetTunnel64() *ActionNxSetTunnel64 {
5048 obj := &ActionNxSetTunnel64{
5049 ActionNicira: NewActionNicira(9),
5050 }
5051 return obj
5052}
5053func (self *ActionNxSetTunnel64) GetActionName() string {
5054 return "nx_set_tunnel64"
5055}
5056
5057func (self *ActionNxSetTunnel64) GetActionFields() map[string]interface{} {
5058 return map[string]interface{}{
5059 "Value": self.Value,
5060 }
5061}
5062
5063func (self *ActionNxSetTunnel64) MarshalJSON() ([]byte, error) {
5064 jsonValue, err := json.Marshal(self.GetActionFields())
5065 if err != nil {
5066 return nil, err
5067 }
5068 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
5069}
5070
5071type ActionNxStackPop struct {
5072 *ActionNicira
5073 Offset uint16
5074 Field goloxi.IOxmId
5075 NBits uint16
5076}
5077
5078type IActionNxStackPop interface {
5079 IActionNicira
5080 GetOffset() uint16
5081 GetField() goloxi.IOxmId
5082 GetNBits() uint16
5083}
5084
5085func (self *ActionNxStackPop) GetOffset() uint16 {
5086 return self.Offset
5087}
5088
5089func (self *ActionNxStackPop) SetOffset(v uint16) {
5090 self.Offset = v
5091}
5092
5093func (self *ActionNxStackPop) GetField() goloxi.IOxmId {
5094 return self.Field
5095}
5096
5097func (self *ActionNxStackPop) SetField(v goloxi.IOxmId) {
5098 self.Field = v
5099}
5100
5101func (self *ActionNxStackPop) GetNBits() uint16 {
5102 return self.NBits
5103}
5104
5105func (self *ActionNxStackPop) SetNBits(v uint16) {
5106 self.NBits = v
5107}
5108
5109func (self *ActionNxStackPop) Serialize(encoder *goloxi.Encoder) error {
5110 startIndex := len(encoder.Bytes())
5111 if err := self.ActionNicira.Serialize(encoder); err != nil {
5112 return err
5113 }
5114
5115 encoder.PutUint16(uint16(self.Offset))
5116 self.Field.Serialize(encoder)
5117 encoder.PutUint16(uint16(self.NBits))
5118 length := len(encoder.Bytes()) - startIndex
5119
5120 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
5121
5122 return nil
5123}
5124
5125func DecodeActionNxStackPop(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxStackPop, error) {
5126 _actionnxstackpop := &ActionNxStackPop{ActionNicira: parent}
5127 if decoder.Length() < 8 {
5128 return nil, fmt.Errorf("ActionNxStackPop packet too short: %d < 8", decoder.Length())
5129 }
5130 _actionnxstackpop.Offset = uint16(decoder.ReadUint16())
5131 if obj, err := DecodeOxmId(decoder); err != nil {
5132 return nil, err
5133 } else {
5134 _actionnxstackpop.Field = obj
5135 }
5136
5137 _actionnxstackpop.NBits = uint16(decoder.ReadUint16())
5138 return _actionnxstackpop, nil
5139}
5140
5141func NewActionNxStackPop() *ActionNxStackPop {
5142 obj := &ActionNxStackPop{
5143 ActionNicira: NewActionNicira(28),
5144 }
5145 return obj
5146}
5147func (self *ActionNxStackPop) GetActionName() string {
5148 return "nx_stack_pop"
5149}
5150
5151func (self *ActionNxStackPop) GetActionFields() map[string]interface{} {
5152 return map[string]interface{}{
5153 "Offset": self.Offset,
5154 "Field": self.Field,
5155 "NBits": self.NBits,
5156 }
5157}
5158
5159func (self *ActionNxStackPop) MarshalJSON() ([]byte, error) {
5160 jsonValue, err := json.Marshal(self.GetActionFields())
5161 if err != nil {
5162 return nil, err
5163 }
5164 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
5165}
5166
5167type ActionNxStackPush struct {
5168 *ActionNicira
5169 Offset uint16
5170 Field goloxi.IOxmId
5171 NBits uint16
5172}
5173
5174type IActionNxStackPush interface {
5175 IActionNicira
5176 GetOffset() uint16
5177 GetField() goloxi.IOxmId
5178 GetNBits() uint16
5179}
5180
5181func (self *ActionNxStackPush) GetOffset() uint16 {
5182 return self.Offset
5183}
5184
5185func (self *ActionNxStackPush) SetOffset(v uint16) {
5186 self.Offset = v
5187}
5188
5189func (self *ActionNxStackPush) GetField() goloxi.IOxmId {
5190 return self.Field
5191}
5192
5193func (self *ActionNxStackPush) SetField(v goloxi.IOxmId) {
5194 self.Field = v
5195}
5196
5197func (self *ActionNxStackPush) GetNBits() uint16 {
5198 return self.NBits
5199}
5200
5201func (self *ActionNxStackPush) SetNBits(v uint16) {
5202 self.NBits = v
5203}
5204
5205func (self *ActionNxStackPush) Serialize(encoder *goloxi.Encoder) error {
5206 startIndex := len(encoder.Bytes())
5207 if err := self.ActionNicira.Serialize(encoder); err != nil {
5208 return err
5209 }
5210
5211 encoder.PutUint16(uint16(self.Offset))
5212 self.Field.Serialize(encoder)
5213 encoder.PutUint16(uint16(self.NBits))
5214 length := len(encoder.Bytes()) - startIndex
5215 alignedLength := ((length + 23) / 24 * 24)
5216
5217 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
5218
5219 encoder.Write(bytes.Repeat([]byte{0}, alignedLength-length))
5220
5221 return nil
5222}
5223
5224func DecodeActionNxStackPush(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxStackPush, error) {
5225 _actionnxstackpush := &ActionNxStackPush{ActionNicira: parent}
5226 if decoder.Length() < 8 {
5227 return nil, fmt.Errorf("ActionNxStackPush packet too short: %d < 8", decoder.Length())
5228 }
5229 _actionnxstackpush.Offset = uint16(decoder.ReadUint16())
5230 if obj, err := DecodeOxmId(decoder); err != nil {
5231 return nil, err
5232 } else {
5233 _actionnxstackpush.Field = obj
5234 }
5235
5236 _actionnxstackpush.NBits = uint16(decoder.ReadUint16())
5237 return _actionnxstackpush, nil
5238}
5239
5240func NewActionNxStackPush() *ActionNxStackPush {
5241 obj := &ActionNxStackPush{
5242 ActionNicira: NewActionNicira(27),
5243 }
5244 return obj
5245}
5246func (self *ActionNxStackPush) GetActionName() string {
5247 return "nx_stack_push"
5248}
5249
5250func (self *ActionNxStackPush) GetActionFields() map[string]interface{} {
5251 return map[string]interface{}{
5252 "Offset": self.Offset,
5253 "Field": self.Field,
5254 "NBits": self.NBits,
5255 }
5256}
5257
5258func (self *ActionNxStackPush) MarshalJSON() ([]byte, error) {
5259 jsonValue, err := json.Marshal(self.GetActionFields())
5260 if err != nil {
5261 return nil, err
5262 }
5263 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
5264}
5265
5266type ActionNxWriteMetadata struct {
5267 *ActionNicira
5268 Metadata uint64
5269 Mask uint64
5270}
5271
5272type IActionNxWriteMetadata interface {
5273 IActionNicira
5274 GetMetadata() uint64
5275 GetMask() uint64
5276}
5277
5278func (self *ActionNxWriteMetadata) GetMetadata() uint64 {
5279 return self.Metadata
5280}
5281
5282func (self *ActionNxWriteMetadata) SetMetadata(v uint64) {
5283 self.Metadata = v
5284}
5285
5286func (self *ActionNxWriteMetadata) GetMask() uint64 {
5287 return self.Mask
5288}
5289
5290func (self *ActionNxWriteMetadata) SetMask(v uint64) {
5291 self.Mask = v
5292}
5293
5294func (self *ActionNxWriteMetadata) Serialize(encoder *goloxi.Encoder) error {
5295 startIndex := len(encoder.Bytes())
5296 if err := self.ActionNicira.Serialize(encoder); err != nil {
5297 return err
5298 }
5299
5300 encoder.Write(bytes.Repeat([]byte{0}, 6))
5301 encoder.PutUint64(uint64(self.Metadata))
5302 encoder.PutUint64(uint64(self.Mask))
5303 length := len(encoder.Bytes()) - startIndex
5304
5305 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
5306
5307 return nil
5308}
5309
5310func DecodeActionNxWriteMetadata(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionNxWriteMetadata, error) {
5311 _actionnxwritemetadata := &ActionNxWriteMetadata{ActionNicira: parent}
5312 if decoder.Length() < 22 {
5313 return nil, fmt.Errorf("ActionNxWriteMetadata packet too short: %d < 22", decoder.Length())
5314 }
5315 decoder.Skip(6)
5316 _actionnxwritemetadata.Metadata = uint64(decoder.ReadUint64())
5317 _actionnxwritemetadata.Mask = uint64(decoder.ReadUint64())
5318 return _actionnxwritemetadata, nil
5319}
5320
5321func NewActionNxWriteMetadata() *ActionNxWriteMetadata {
5322 obj := &ActionNxWriteMetadata{
5323 ActionNicira: NewActionNicira(22),
5324 }
5325 return obj
5326}
5327func (self *ActionNxWriteMetadata) GetActionName() string {
5328 return "nx_write_metadata"
5329}
5330
5331func (self *ActionNxWriteMetadata) GetActionFields() map[string]interface{} {
5332 return map[string]interface{}{
5333 "Metadata": self.Metadata,
5334 "Mask": self.Mask,
5335 }
5336}
5337
5338func (self *ActionNxWriteMetadata) MarshalJSON() ([]byte, error) {
5339 jsonValue, err := json.Marshal(self.GetActionFields())
5340 if err != nil {
5341 return nil, err
5342 }
5343 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
5344}
5345
5346type ActionOutput struct {
5347 *Action
5348 Port Port
5349 MaxLen uint16
5350}
5351
5352type IActionOutput interface {
5353 goloxi.IAction
5354 GetPort() Port
5355 GetMaxLen() uint16
5356}
5357
5358func (self *ActionOutput) GetPort() Port {
5359 return self.Port
5360}
5361
5362func (self *ActionOutput) SetPort(v Port) {
5363 self.Port = v
5364}
5365
5366func (self *ActionOutput) GetMaxLen() uint16 {
5367 return self.MaxLen
5368}
5369
5370func (self *ActionOutput) SetMaxLen(v uint16) {
5371 self.MaxLen = v
5372}
5373
5374func (self *ActionOutput) Serialize(encoder *goloxi.Encoder) error {
5375 startIndex := len(encoder.Bytes())
5376 if err := self.Action.Serialize(encoder); err != nil {
5377 return err
5378 }
5379
5380 self.Port.Serialize(encoder)
5381 encoder.PutUint16(uint16(self.MaxLen))
5382 encoder.Write(bytes.Repeat([]byte{0}, 6))
5383 length := len(encoder.Bytes()) - startIndex
5384
5385 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
5386
5387 return nil
5388}
5389
5390func DecodeActionOutput(parent *Action, decoder *goloxi.Decoder) (*ActionOutput, error) {
5391 _actionoutput := &ActionOutput{Action: parent}
5392 if decoder.Length() < 12 {
5393 return nil, fmt.Errorf("ActionOutput packet too short: %d < 12", decoder.Length())
5394 }
5395 _actionoutput.Port.Decode(decoder)
5396 _actionoutput.MaxLen = uint16(decoder.ReadUint16())
5397 decoder.Skip(6)
5398 return _actionoutput, nil
5399}
5400
5401func NewActionOutput() *ActionOutput {
5402 obj := &ActionOutput{
5403 Action: NewAction(0),
5404 }
5405 return obj
5406}
5407func (self *ActionOutput) GetActionName() string {
5408 return "output"
5409}
5410
5411func (self *ActionOutput) GetActionFields() map[string]interface{} {
5412 return map[string]interface{}{
5413 "Port": self.Port,
5414 "MaxLen": self.MaxLen,
5415 }
5416}
5417
5418func (self *ActionOutput) MarshalJSON() ([]byte, error) {
5419 jsonValue, err := json.Marshal(self.GetActionFields())
5420 if err != nil {
5421 return nil, err
5422 }
5423 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
5424}
5425
5426type ActionPopMpls struct {
5427 *Action
5428 Ethertype uint16
5429}
5430
5431type IActionPopMpls interface {
5432 goloxi.IAction
5433 GetEthertype() uint16
5434}
5435
5436func (self *ActionPopMpls) GetEthertype() uint16 {
5437 return self.Ethertype
5438}
5439
5440func (self *ActionPopMpls) SetEthertype(v uint16) {
5441 self.Ethertype = v
5442}
5443
5444func (self *ActionPopMpls) Serialize(encoder *goloxi.Encoder) error {
5445 startIndex := len(encoder.Bytes())
5446 if err := self.Action.Serialize(encoder); err != nil {
5447 return err
5448 }
5449
5450 encoder.PutUint16(uint16(self.Ethertype))
5451 encoder.Write(bytes.Repeat([]byte{0}, 2))
5452 length := len(encoder.Bytes()) - startIndex
5453
5454 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
5455
5456 return nil
5457}
5458
5459func DecodeActionPopMpls(parent *Action, decoder *goloxi.Decoder) (*ActionPopMpls, error) {
5460 _actionpopmpls := &ActionPopMpls{Action: parent}
5461 if decoder.Length() < 4 {
5462 return nil, fmt.Errorf("ActionPopMpls packet too short: %d < 4", decoder.Length())
5463 }
5464 _actionpopmpls.Ethertype = uint16(decoder.ReadUint16())
5465 decoder.Skip(2)
5466 return _actionpopmpls, nil
5467}
5468
5469func NewActionPopMpls() *ActionPopMpls {
5470 obj := &ActionPopMpls{
5471 Action: NewAction(20),
5472 }
5473 return obj
5474}
5475func (self *ActionPopMpls) GetActionName() string {
5476 return "pop_mpls"
5477}
5478
5479func (self *ActionPopMpls) GetActionFields() map[string]interface{} {
5480 return map[string]interface{}{
5481 "Ethertype": self.Ethertype,
5482 }
5483}
5484
5485func (self *ActionPopMpls) MarshalJSON() ([]byte, error) {
5486 jsonValue, err := json.Marshal(self.GetActionFields())
5487 if err != nil {
5488 return nil, err
5489 }
5490 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
5491}
5492
5493type ActionPopPbb struct {
5494 *Action
5495}
5496
5497type IActionPopPbb interface {
5498 goloxi.IAction
5499}
5500
5501func (self *ActionPopPbb) Serialize(encoder *goloxi.Encoder) error {
5502 startIndex := len(encoder.Bytes())
5503 if err := self.Action.Serialize(encoder); err != nil {
5504 return err
5505 }
5506
5507 encoder.Write(bytes.Repeat([]byte{0}, 4))
5508 length := len(encoder.Bytes()) - startIndex
5509
5510 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
5511
5512 return nil
5513}
5514
5515func DecodeActionPopPbb(parent *Action, decoder *goloxi.Decoder) (*ActionPopPbb, error) {
5516 _actionpoppbb := &ActionPopPbb{Action: parent}
5517 if decoder.Length() < 4 {
5518 return nil, fmt.Errorf("ActionPopPbb packet too short: %d < 4", decoder.Length())
5519 }
5520 decoder.Skip(4)
5521 return _actionpoppbb, nil
5522}
5523
5524func NewActionPopPbb() *ActionPopPbb {
5525 obj := &ActionPopPbb{
5526 Action: NewAction(27),
5527 }
5528 return obj
5529}
5530func (self *ActionPopPbb) GetActionName() string {
5531 return "pop_pbb"
5532}
5533
5534func (self *ActionPopPbb) GetActionFields() map[string]interface{} {
5535 return map[string]interface{}{}
5536}
5537
5538func (self *ActionPopPbb) MarshalJSON() ([]byte, error) {
5539 jsonValue, err := json.Marshal(self.GetActionFields())
5540 if err != nil {
5541 return nil, err
5542 }
5543 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
5544}
5545
5546type ActionPopVlan struct {
5547 *Action
5548}
5549
5550type IActionPopVlan interface {
5551 goloxi.IAction
5552}
5553
5554func (self *ActionPopVlan) Serialize(encoder *goloxi.Encoder) error {
5555 startIndex := len(encoder.Bytes())
5556 if err := self.Action.Serialize(encoder); err != nil {
5557 return err
5558 }
5559
5560 encoder.Write(bytes.Repeat([]byte{0}, 4))
5561 length := len(encoder.Bytes()) - startIndex
5562
5563 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
5564
5565 return nil
5566}
5567
5568func DecodeActionPopVlan(parent *Action, decoder *goloxi.Decoder) (*ActionPopVlan, error) {
5569 _actionpopvlan := &ActionPopVlan{Action: parent}
5570 if decoder.Length() < 4 {
5571 return nil, fmt.Errorf("ActionPopVlan packet too short: %d < 4", decoder.Length())
5572 }
5573 decoder.Skip(4)
5574 return _actionpopvlan, nil
5575}
5576
5577func NewActionPopVlan() *ActionPopVlan {
5578 obj := &ActionPopVlan{
5579 Action: NewAction(18),
5580 }
5581 return obj
5582}
5583func (self *ActionPopVlan) GetActionName() string {
5584 return "pop_vlan"
5585}
5586
5587func (self *ActionPopVlan) GetActionFields() map[string]interface{} {
5588 return map[string]interface{}{}
5589}
5590
5591func (self *ActionPopVlan) MarshalJSON() ([]byte, error) {
5592 jsonValue, err := json.Marshal(self.GetActionFields())
5593 if err != nil {
5594 return nil, err
5595 }
5596 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
5597}
5598
5599type ActionPushMpls struct {
5600 *Action
5601 Ethertype uint16
5602}
5603
5604type IActionPushMpls interface {
5605 goloxi.IAction
5606 GetEthertype() uint16
5607}
5608
5609func (self *ActionPushMpls) GetEthertype() uint16 {
5610 return self.Ethertype
5611}
5612
5613func (self *ActionPushMpls) SetEthertype(v uint16) {
5614 self.Ethertype = v
5615}
5616
5617func (self *ActionPushMpls) Serialize(encoder *goloxi.Encoder) error {
5618 startIndex := len(encoder.Bytes())
5619 if err := self.Action.Serialize(encoder); err != nil {
5620 return err
5621 }
5622
5623 encoder.PutUint16(uint16(self.Ethertype))
5624 encoder.Write(bytes.Repeat([]byte{0}, 2))
5625 length := len(encoder.Bytes()) - startIndex
5626
5627 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
5628
5629 return nil
5630}
5631
5632func DecodeActionPushMpls(parent *Action, decoder *goloxi.Decoder) (*ActionPushMpls, error) {
5633 _actionpushmpls := &ActionPushMpls{Action: parent}
5634 if decoder.Length() < 4 {
5635 return nil, fmt.Errorf("ActionPushMpls packet too short: %d < 4", decoder.Length())
5636 }
5637 _actionpushmpls.Ethertype = uint16(decoder.ReadUint16())
5638 decoder.Skip(2)
5639 return _actionpushmpls, nil
5640}
5641
5642func NewActionPushMpls() *ActionPushMpls {
5643 obj := &ActionPushMpls{
5644 Action: NewAction(19),
5645 }
5646 return obj
5647}
5648func (self *ActionPushMpls) GetActionName() string {
5649 return "push_mpls"
5650}
5651
5652func (self *ActionPushMpls) GetActionFields() map[string]interface{} {
5653 return map[string]interface{}{
5654 "Ethertype": self.Ethertype,
5655 }
5656}
5657
5658func (self *ActionPushMpls) MarshalJSON() ([]byte, error) {
5659 jsonValue, err := json.Marshal(self.GetActionFields())
5660 if err != nil {
5661 return nil, err
5662 }
5663 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
5664}
5665
5666type ActionPushPbb struct {
5667 *Action
5668 Ethertype uint16
5669}
5670
5671type IActionPushPbb interface {
5672 goloxi.IAction
5673 GetEthertype() uint16
5674}
5675
5676func (self *ActionPushPbb) GetEthertype() uint16 {
5677 return self.Ethertype
5678}
5679
5680func (self *ActionPushPbb) SetEthertype(v uint16) {
5681 self.Ethertype = v
5682}
5683
5684func (self *ActionPushPbb) Serialize(encoder *goloxi.Encoder) error {
5685 startIndex := len(encoder.Bytes())
5686 if err := self.Action.Serialize(encoder); err != nil {
5687 return err
5688 }
5689
5690 encoder.PutUint16(uint16(self.Ethertype))
5691 encoder.Write(bytes.Repeat([]byte{0}, 2))
5692 length := len(encoder.Bytes()) - startIndex
5693
5694 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
5695
5696 return nil
5697}
5698
5699func DecodeActionPushPbb(parent *Action, decoder *goloxi.Decoder) (*ActionPushPbb, error) {
5700 _actionpushpbb := &ActionPushPbb{Action: parent}
5701 if decoder.Length() < 4 {
5702 return nil, fmt.Errorf("ActionPushPbb packet too short: %d < 4", decoder.Length())
5703 }
5704 _actionpushpbb.Ethertype = uint16(decoder.ReadUint16())
5705 decoder.Skip(2)
5706 return _actionpushpbb, nil
5707}
5708
5709func NewActionPushPbb() *ActionPushPbb {
5710 obj := &ActionPushPbb{
5711 Action: NewAction(26),
5712 }
5713 return obj
5714}
5715func (self *ActionPushPbb) GetActionName() string {
5716 return "push_pbb"
5717}
5718
5719func (self *ActionPushPbb) GetActionFields() map[string]interface{} {
5720 return map[string]interface{}{
5721 "Ethertype": self.Ethertype,
5722 }
5723}
5724
5725func (self *ActionPushPbb) MarshalJSON() ([]byte, error) {
5726 jsonValue, err := json.Marshal(self.GetActionFields())
5727 if err != nil {
5728 return nil, err
5729 }
5730 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
5731}
5732
5733type ActionPushVlan struct {
5734 *Action
5735 Ethertype uint16
5736}
5737
5738type IActionPushVlan interface {
5739 goloxi.IAction
5740 GetEthertype() uint16
5741}
5742
5743func (self *ActionPushVlan) GetEthertype() uint16 {
5744 return self.Ethertype
5745}
5746
5747func (self *ActionPushVlan) SetEthertype(v uint16) {
5748 self.Ethertype = v
5749}
5750
5751func (self *ActionPushVlan) Serialize(encoder *goloxi.Encoder) error {
5752 startIndex := len(encoder.Bytes())
5753 if err := self.Action.Serialize(encoder); err != nil {
5754 return err
5755 }
5756
5757 encoder.PutUint16(uint16(self.Ethertype))
5758 encoder.Write(bytes.Repeat([]byte{0}, 2))
5759 length := len(encoder.Bytes()) - startIndex
5760
5761 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
5762
5763 return nil
5764}
5765
5766func DecodeActionPushVlan(parent *Action, decoder *goloxi.Decoder) (*ActionPushVlan, error) {
5767 _actionpushvlan := &ActionPushVlan{Action: parent}
5768 if decoder.Length() < 4 {
5769 return nil, fmt.Errorf("ActionPushVlan packet too short: %d < 4", decoder.Length())
5770 }
5771 _actionpushvlan.Ethertype = uint16(decoder.ReadUint16())
5772 decoder.Skip(2)
5773 return _actionpushvlan, nil
5774}
5775
5776func NewActionPushVlan() *ActionPushVlan {
5777 obj := &ActionPushVlan{
5778 Action: NewAction(17),
5779 }
5780 return obj
5781}
5782func (self *ActionPushVlan) GetActionName() string {
5783 return "push_vlan"
5784}
5785
5786func (self *ActionPushVlan) GetActionFields() map[string]interface{} {
5787 return map[string]interface{}{
5788 "Ethertype": self.Ethertype,
5789 }
5790}
5791
5792func (self *ActionPushVlan) MarshalJSON() ([]byte, error) {
5793 jsonValue, err := json.Marshal(self.GetActionFields())
5794 if err != nil {
5795 return nil, err
5796 }
5797 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
5798}
5799
5800type ActionResubmit struct {
5801 *ActionNicira
5802 InPort uint16
5803 Table uint8
5804}
5805
5806type IActionResubmit interface {
5807 IActionNicira
5808 GetInPort() uint16
5809 GetTable() uint8
5810}
5811
5812func (self *ActionResubmit) GetInPort() uint16 {
5813 return self.InPort
5814}
5815
5816func (self *ActionResubmit) SetInPort(v uint16) {
5817 self.InPort = v
5818}
5819
5820func (self *ActionResubmit) GetTable() uint8 {
5821 return self.Table
5822}
5823
5824func (self *ActionResubmit) SetTable(v uint8) {
5825 self.Table = v
5826}
5827
5828func (self *ActionResubmit) Serialize(encoder *goloxi.Encoder) error {
5829 startIndex := len(encoder.Bytes())
5830 if err := self.ActionNicira.Serialize(encoder); err != nil {
5831 return err
5832 }
5833
5834 encoder.PutUint16(uint16(self.InPort))
5835 encoder.PutUint8(uint8(self.Table))
5836 encoder.Write(bytes.Repeat([]byte{0}, 3))
5837 length := len(encoder.Bytes()) - startIndex
5838
5839 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
5840
5841 return nil
5842}
5843
5844func DecodeActionResubmit(parent *ActionNicira, decoder *goloxi.Decoder) (*ActionResubmit, error) {
5845 _actionresubmit := &ActionResubmit{ActionNicira: parent}
5846 if decoder.Length() < 6 {
5847 return nil, fmt.Errorf("ActionResubmit packet too short: %d < 6", decoder.Length())
5848 }
5849 _actionresubmit.InPort = uint16(decoder.ReadUint16())
5850 _actionresubmit.Table = uint8(decoder.ReadByte())
5851 decoder.Skip(3)
5852 return _actionresubmit, nil
5853}
5854
5855func NewActionResubmit() *ActionResubmit {
5856 obj := &ActionResubmit{
5857 ActionNicira: NewActionNicira(14),
5858 }
5859 return obj
5860}
5861func (self *ActionResubmit) GetActionName() string {
5862 return "resubmit"
5863}
5864
5865func (self *ActionResubmit) GetActionFields() map[string]interface{} {
5866 return map[string]interface{}{
5867 "InPort": self.InPort,
5868 "Table": self.Table,
5869 }
5870}
5871
5872func (self *ActionResubmit) MarshalJSON() ([]byte, error) {
5873 jsonValue, err := json.Marshal(self.GetActionFields())
5874 if err != nil {
5875 return nil, err
5876 }
5877 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
5878}
5879
5880type ActionSetField struct {
5881 *Action
5882 Field goloxi.IOxm
5883}
5884
5885type IActionSetField interface {
5886 goloxi.IAction
5887 GetField() goloxi.IOxm
5888}
5889
5890func (self *ActionSetField) GetField() goloxi.IOxm {
5891 return self.Field
5892}
5893
5894func (self *ActionSetField) SetField(v goloxi.IOxm) {
5895 self.Field = v
5896}
5897
5898func (self *ActionSetField) Serialize(encoder *goloxi.Encoder) error {
5899 startIndex := len(encoder.Bytes())
5900 if err := self.Action.Serialize(encoder); err != nil {
5901 return err
5902 }
5903
5904 self.Field.Serialize(encoder)
5905 length := len(encoder.Bytes()) - startIndex
5906 alignedLength := ((length + 7) / 8 * 8)
5907
5908 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(alignedLength))
5909
5910 encoder.Write(bytes.Repeat([]byte{0}, alignedLength-length))
5911
5912 return nil
5913}
5914
5915func DecodeActionSetField(parent *Action, decoder *goloxi.Decoder) (*ActionSetField, error) {
5916 _actionsetfield := &ActionSetField{Action: parent}
5917 if decoder.Length() < 4 {
5918 return nil, fmt.Errorf("ActionSetField packet too short: %d < 4", decoder.Length())
5919 }
5920 if obj, err := DecodeOxm(decoder); err != nil {
5921 return nil, err
5922 } else {
5923 _actionsetfield.Field = obj
5924 }
5925
5926 return _actionsetfield, nil
5927}
5928
5929func NewActionSetField() *ActionSetField {
5930 obj := &ActionSetField{
5931 Action: NewAction(25),
5932 }
5933 return obj
5934}
5935func (self *ActionSetField) GetActionName() string {
5936 return "set_field"
5937}
5938
5939func (self *ActionSetField) GetActionFields() map[string]interface{} {
5940 return map[string]interface{}{
5941 "Field": self.Field,
5942 }
5943}
5944
5945func (self *ActionSetField) MarshalJSON() ([]byte, error) {
5946 jsonValue, err := json.Marshal(self.GetActionFields())
5947 if err != nil {
5948 return nil, err
5949 }
5950 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
5951}
5952
5953type ActionSetMplsTtl struct {
5954 *Action
5955 MplsTtl uint8
5956}
5957
5958type IActionSetMplsTtl interface {
5959 goloxi.IAction
5960 GetMplsTtl() uint8
5961}
5962
5963func (self *ActionSetMplsTtl) GetMplsTtl() uint8 {
5964 return self.MplsTtl
5965}
5966
5967func (self *ActionSetMplsTtl) SetMplsTtl(v uint8) {
5968 self.MplsTtl = v
5969}
5970
5971func (self *ActionSetMplsTtl) Serialize(encoder *goloxi.Encoder) error {
5972 startIndex := len(encoder.Bytes())
5973 if err := self.Action.Serialize(encoder); err != nil {
5974 return err
5975 }
5976
5977 encoder.PutUint8(uint8(self.MplsTtl))
5978 encoder.Write(bytes.Repeat([]byte{0}, 3))
5979 length := len(encoder.Bytes()) - startIndex
5980
5981 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
5982
5983 return nil
5984}
5985
5986func DecodeActionSetMplsTtl(parent *Action, decoder *goloxi.Decoder) (*ActionSetMplsTtl, error) {
5987 _actionsetmplsttl := &ActionSetMplsTtl{Action: parent}
5988 if decoder.Length() < 4 {
5989 return nil, fmt.Errorf("ActionSetMplsTtl packet too short: %d < 4", decoder.Length())
5990 }
5991 _actionsetmplsttl.MplsTtl = uint8(decoder.ReadByte())
5992 decoder.Skip(3)
5993 return _actionsetmplsttl, nil
5994}
5995
5996func NewActionSetMplsTtl() *ActionSetMplsTtl {
5997 obj := &ActionSetMplsTtl{
5998 Action: NewAction(15),
5999 }
6000 return obj
6001}
6002func (self *ActionSetMplsTtl) GetActionName() string {
6003 return "set_mpls_ttl"
6004}
6005
6006func (self *ActionSetMplsTtl) GetActionFields() map[string]interface{} {
6007 return map[string]interface{}{
6008 "MplsTtl": self.MplsTtl,
6009 }
6010}
6011
6012func (self *ActionSetMplsTtl) MarshalJSON() ([]byte, error) {
6013 jsonValue, err := json.Marshal(self.GetActionFields())
6014 if err != nil {
6015 return nil, err
6016 }
6017 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
6018}
6019
6020type ActionSetNwTtl struct {
6021 *Action
6022 NwTtl uint8
6023}
6024
6025type IActionSetNwTtl interface {
6026 goloxi.IAction
6027 GetNwTtl() uint8
6028}
6029
6030func (self *ActionSetNwTtl) GetNwTtl() uint8 {
6031 return self.NwTtl
6032}
6033
6034func (self *ActionSetNwTtl) SetNwTtl(v uint8) {
6035 self.NwTtl = v
6036}
6037
6038func (self *ActionSetNwTtl) Serialize(encoder *goloxi.Encoder) error {
6039 startIndex := len(encoder.Bytes())
6040 if err := self.Action.Serialize(encoder); err != nil {
6041 return err
6042 }
6043
6044 encoder.PutUint8(uint8(self.NwTtl))
6045 encoder.Write(bytes.Repeat([]byte{0}, 3))
6046 length := len(encoder.Bytes()) - startIndex
6047
6048 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
6049
6050 return nil
6051}
6052
6053func DecodeActionSetNwTtl(parent *Action, decoder *goloxi.Decoder) (*ActionSetNwTtl, error) {
6054 _actionsetnwttl := &ActionSetNwTtl{Action: parent}
6055 if decoder.Length() < 4 {
6056 return nil, fmt.Errorf("ActionSetNwTtl packet too short: %d < 4", decoder.Length())
6057 }
6058 _actionsetnwttl.NwTtl = uint8(decoder.ReadByte())
6059 decoder.Skip(3)
6060 return _actionsetnwttl, nil
6061}
6062
6063func NewActionSetNwTtl() *ActionSetNwTtl {
6064 obj := &ActionSetNwTtl{
6065 Action: NewAction(23),
6066 }
6067 return obj
6068}
6069func (self *ActionSetNwTtl) GetActionName() string {
6070 return "set_nw_ttl"
6071}
6072
6073func (self *ActionSetNwTtl) GetActionFields() map[string]interface{} {
6074 return map[string]interface{}{
6075 "NwTtl": self.NwTtl,
6076 }
6077}
6078
6079func (self *ActionSetNwTtl) MarshalJSON() ([]byte, error) {
6080 jsonValue, err := json.Marshal(self.GetActionFields())
6081 if err != nil {
6082 return nil, err
6083 }
6084 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
6085}
6086
6087type ActionSetQueue struct {
6088 *Action
6089 QueueId uint32
6090}
6091
6092type IActionSetQueue interface {
6093 goloxi.IAction
6094 GetQueueId() uint32
6095}
6096
6097func (self *ActionSetQueue) GetQueueId() uint32 {
6098 return self.QueueId
6099}
6100
6101func (self *ActionSetQueue) SetQueueId(v uint32) {
6102 self.QueueId = v
6103}
6104
6105func (self *ActionSetQueue) Serialize(encoder *goloxi.Encoder) error {
6106 startIndex := len(encoder.Bytes())
6107 if err := self.Action.Serialize(encoder); err != nil {
6108 return err
6109 }
6110
6111 encoder.PutUint32(uint32(self.QueueId))
6112 length := len(encoder.Bytes()) - startIndex
6113
6114 binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length))
6115
6116 return nil
6117}
6118
6119func DecodeActionSetQueue(parent *Action, decoder *goloxi.Decoder) (*ActionSetQueue, error) {
6120 _actionsetqueue := &ActionSetQueue{Action: parent}
6121 if decoder.Length() < 4 {
6122 return nil, fmt.Errorf("ActionSetQueue packet too short: %d < 4", decoder.Length())
6123 }
6124 _actionsetqueue.QueueId = uint32(decoder.ReadUint32())
6125 return _actionsetqueue, nil
6126}
6127
6128func NewActionSetQueue() *ActionSetQueue {
6129 obj := &ActionSetQueue{
6130 Action: NewAction(21),
6131 }
6132 return obj
6133}
6134func (self *ActionSetQueue) GetActionName() string {
6135 return "set_queue"
6136}
6137
6138func (self *ActionSetQueue) GetActionFields() map[string]interface{} {
6139 return map[string]interface{}{
6140 "QueueId": self.QueueId,
6141 }
6142}
6143
6144func (self *ActionSetQueue) MarshalJSON() ([]byte, error) {
6145 jsonValue, err := json.Marshal(self.GetActionFields())
6146 if err != nil {
6147 return nil, err
6148 }
6149 return []byte(fmt.Sprintf("{\"Type\":\"%s\",\"Arguments\":%s}", self.GetActionName(), string(jsonValue))), nil
6150}