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