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