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