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