blob: 3df816279a9ba5415b1d78f2218fd9a528327132 [file] [log] [blame]
Don Newton98fd8812019-09-23 15:15:02 -04001/*
2 * Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
3 * Copyright (c) 2011, 2012 Open Networking Foundation
4 * Copyright 2013, Big Switch Networks, Inc. This library was generated by the LoxiGen Compiler.
5 * Copyright 2018, Red Hat, Inc.
6 */
7// Automatically generated by LOXI from template module.go
8// Do not modify
9
10package of13
11
12import (
13 "bytes"
14 "encoding/binary"
15 "fmt"
16 "net"
17
Don Newtone0d34a82019-11-14 10:58:06 -050018 "github.com/donNewtonAlpha/goloxi"
Don Newton98fd8812019-09-23 15:15:02 -040019)
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(4))
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 DecodeGroupMod(_header, decoder)
138 case 16:
139 return DecodePortMod(_header, decoder)
140 case 17:
141 return DecodeTableMod(_header, decoder)
142 case 18:
143 return DecodeStatsRequest(_header, decoder)
144 case 19:
145 return DecodeStatsReply(_header, decoder)
146 case 20:
147 return DecodeBarrierRequest(_header, decoder)
148 case 21:
149 return DecodeBarrierReply(_header, decoder)
150 case 22:
151 return DecodeQueueGetConfigRequest(_header, decoder)
152 case 23:
153 return DecodeQueueGetConfigReply(_header, decoder)
154 case 24:
155 return DecodeRoleRequest(_header, decoder)
156 case 25:
157 return DecodeRoleReply(_header, decoder)
158 case 26:
159 return DecodeAsyncGetRequest(_header, decoder)
160 case 27:
161 return DecodeAsyncGetReply(_header, decoder)
162 case 28:
163 return DecodeAsyncSet(_header, decoder)
164 case 29:
165 return DecodeMeterMod(_header, decoder)
166 default:
167 return nil, fmt.Errorf("Invalid type '%d' for 'Header'", _header.Type)
168 }
169}
170
171func NewHeader(_type uint8) *Header {
172 obj := &Header{}
173 obj.Type = _type
174 return obj
175}
176
177type StatsReply struct {
178 *Header
179 StatsType uint16
180 Flags StatsReplyFlags
181}
182
183type IStatsReply interface {
184 IHeader
185 GetStatsType() uint16
186 GetFlags() StatsReplyFlags
187}
188
189func (self *StatsReply) GetStatsType() uint16 {
190 return self.StatsType
191}
192
193func (self *StatsReply) SetStatsType(v uint16) {
194 self.StatsType = v
195}
196
197func (self *StatsReply) GetFlags() StatsReplyFlags {
198 return self.Flags
199}
200
201func (self *StatsReply) SetFlags(v StatsReplyFlags) {
202 self.Flags = v
203}
204
205func (self *StatsReply) Serialize(encoder *goloxi.Encoder) error {
206 if err := self.Header.Serialize(encoder); err != nil {
207 return err
208 }
209
210 encoder.PutUint16(uint16(self.StatsType))
211 encoder.PutUint16(uint16(self.Flags))
212
213 return nil
214}
215
216func DecodeStatsReply(parent *Header, decoder *goloxi.Decoder) (IStatsReply, error) {
217 _statsreply := &StatsReply{Header: parent}
218 if decoder.Length() < 4 {
219 return nil, fmt.Errorf("StatsReply packet too short: %d < 4", decoder.Length())
220 }
221 _statsreply.StatsType = uint16(decoder.ReadUint16())
222 _statsreply.Flags = StatsReplyFlags(decoder.ReadUint16())
223
224 switch _statsreply.StatsType {
225 case 0:
226 return DecodeDescStatsReply(_statsreply, decoder)
227 case 1:
228 return DecodeFlowStatsReply(_statsreply, decoder)
229 case 2:
230 return DecodeAggregateStatsReply(_statsreply, decoder)
231 case 3:
232 return DecodeTableStatsReply(_statsreply, decoder)
233 case 4:
234 return DecodePortStatsReply(_statsreply, decoder)
235 case 5:
236 return DecodeQueueStatsReply(_statsreply, decoder)
237 case 6:
238 return DecodeGroupStatsReply(_statsreply, decoder)
239 case 7:
240 return DecodeGroupDescStatsReply(_statsreply, decoder)
241 case 8:
242 return DecodeGroupFeaturesStatsReply(_statsreply, decoder)
243 case 9:
244 return DecodeMeterStatsReply(_statsreply, decoder)
245 case 10:
246 return DecodeMeterConfigStatsReply(_statsreply, decoder)
247 case 11:
248 return DecodeMeterFeaturesStatsReply(_statsreply, decoder)
249 case 12:
250 return DecodeTableFeaturesStatsReply(_statsreply, decoder)
251 case 13:
252 return DecodePortDescStatsReply(_statsreply, decoder)
253 case 65535:
254 return DecodeExperimenterStatsReply(_statsreply, decoder)
255 default:
256 return nil, fmt.Errorf("Invalid type '%d' for 'StatsReply'", _statsreply.StatsType)
257 }
258}
259
260func NewStatsReply(_stats_type uint16) *StatsReply {
261 obj := &StatsReply{
262 Header: NewHeader(19),
263 }
264 obj.StatsType = _stats_type
265 return obj
266}
267
268type AggregateStatsReply struct {
269 *StatsReply
270 PacketCount uint64
271 ByteCount uint64
272 FlowCount uint32
273}
274
275type IAggregateStatsReply interface {
276 IStatsReply
277 GetPacketCount() uint64
278 GetByteCount() uint64
279 GetFlowCount() uint32
280}
281
282func (self *AggregateStatsReply) GetPacketCount() uint64 {
283 return self.PacketCount
284}
285
286func (self *AggregateStatsReply) SetPacketCount(v uint64) {
287 self.PacketCount = v
288}
289
290func (self *AggregateStatsReply) GetByteCount() uint64 {
291 return self.ByteCount
292}
293
294func (self *AggregateStatsReply) SetByteCount(v uint64) {
295 self.ByteCount = v
296}
297
298func (self *AggregateStatsReply) GetFlowCount() uint32 {
299 return self.FlowCount
300}
301
302func (self *AggregateStatsReply) SetFlowCount(v uint32) {
303 self.FlowCount = v
304}
305
306func (self *AggregateStatsReply) Serialize(encoder *goloxi.Encoder) error {
307 if err := self.StatsReply.Serialize(encoder); err != nil {
308 return err
309 }
310
311 encoder.Write(bytes.Repeat([]byte{0}, 4))
312 encoder.PutUint64(uint64(self.PacketCount))
313 encoder.PutUint64(uint64(self.ByteCount))
314 encoder.PutUint32(uint32(self.FlowCount))
315 encoder.Write(bytes.Repeat([]byte{0}, 4))
316
317 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
318
319 return nil
320}
321
322func DecodeAggregateStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*AggregateStatsReply, error) {
323 _aggregatestatsreply := &AggregateStatsReply{StatsReply: parent}
324 if decoder.Length() < 4 {
325 return nil, fmt.Errorf("AggregateStatsReply packet too short: %d < 4", decoder.Length())
326 }
327 decoder.Skip(4)
328 _aggregatestatsreply.PacketCount = uint64(decoder.ReadUint64())
329 _aggregatestatsreply.ByteCount = uint64(decoder.ReadUint64())
330 _aggregatestatsreply.FlowCount = uint32(decoder.ReadUint32())
331 decoder.Skip(4)
332 return _aggregatestatsreply, nil
333}
334
335func NewAggregateStatsReply() *AggregateStatsReply {
336 obj := &AggregateStatsReply{
337 StatsReply: NewStatsReply(2),
338 }
339 return obj
340}
341
342type StatsRequest struct {
343 *Header
344 StatsType uint16
345 Flags StatsRequestFlags
346}
347
348type IStatsRequest interface {
349 IHeader
350 GetStatsType() uint16
351 GetFlags() StatsRequestFlags
352}
353
354func (self *StatsRequest) GetStatsType() uint16 {
355 return self.StatsType
356}
357
358func (self *StatsRequest) SetStatsType(v uint16) {
359 self.StatsType = v
360}
361
362func (self *StatsRequest) GetFlags() StatsRequestFlags {
363 return self.Flags
364}
365
366func (self *StatsRequest) SetFlags(v StatsRequestFlags) {
367 self.Flags = v
368}
369
370func (self *StatsRequest) Serialize(encoder *goloxi.Encoder) error {
371 if err := self.Header.Serialize(encoder); err != nil {
372 return err
373 }
374
375 encoder.PutUint16(uint16(self.StatsType))
376 encoder.PutUint16(uint16(self.Flags))
377
378 return nil
379}
380
381func DecodeStatsRequest(parent *Header, decoder *goloxi.Decoder) (IStatsRequest, error) {
382 _statsrequest := &StatsRequest{Header: parent}
383 if decoder.Length() < 4 {
384 return nil, fmt.Errorf("StatsRequest packet too short: %d < 4", decoder.Length())
385 }
386 _statsrequest.StatsType = uint16(decoder.ReadUint16())
387 _statsrequest.Flags = StatsRequestFlags(decoder.ReadUint16())
388
389 switch _statsrequest.StatsType {
390 case 0:
391 return DecodeDescStatsRequest(_statsrequest, decoder)
392 case 1:
393 return DecodeFlowStatsRequest(_statsrequest, decoder)
394 case 2:
395 return DecodeAggregateStatsRequest(_statsrequest, decoder)
396 case 3:
397 return DecodeTableStatsRequest(_statsrequest, decoder)
398 case 4:
399 return DecodePortStatsRequest(_statsrequest, decoder)
400 case 5:
401 return DecodeQueueStatsRequest(_statsrequest, decoder)
402 case 6:
403 return DecodeGroupStatsRequest(_statsrequest, decoder)
404 case 7:
405 return DecodeGroupDescStatsRequest(_statsrequest, decoder)
406 case 8:
407 return DecodeGroupFeaturesStatsRequest(_statsrequest, decoder)
408 case 9:
409 return DecodeMeterStatsRequest(_statsrequest, decoder)
410 case 10:
411 return DecodeMeterConfigStatsRequest(_statsrequest, decoder)
412 case 11:
413 return DecodeMeterFeaturesStatsRequest(_statsrequest, decoder)
414 case 12:
415 return DecodeTableFeaturesStatsRequest(_statsrequest, decoder)
416 case 13:
417 return DecodePortDescStatsRequest(_statsrequest, decoder)
418 case 65535:
419 return DecodeExperimenterStatsRequest(_statsrequest, decoder)
420 default:
421 return nil, fmt.Errorf("Invalid type '%d' for 'StatsRequest'", _statsrequest.StatsType)
422 }
423}
424
425func NewStatsRequest(_stats_type uint16) *StatsRequest {
426 obj := &StatsRequest{
427 Header: NewHeader(18),
428 }
429 obj.StatsType = _stats_type
430 return obj
431}
432
433type AggregateStatsRequest struct {
434 *StatsRequest
435 TableId uint8
436 OutPort Port
437 OutGroup uint32
438 Cookie uint64
439 CookieMask uint64
440 Match Match
441}
442
443type IAggregateStatsRequest interface {
444 IStatsRequest
445 GetTableId() uint8
446 GetOutPort() Port
447 GetOutGroup() uint32
448 GetCookie() uint64
449 GetCookieMask() uint64
450 GetMatch() Match
451}
452
453func (self *AggregateStatsRequest) GetTableId() uint8 {
454 return self.TableId
455}
456
457func (self *AggregateStatsRequest) SetTableId(v uint8) {
458 self.TableId = v
459}
460
461func (self *AggregateStatsRequest) GetOutPort() Port {
462 return self.OutPort
463}
464
465func (self *AggregateStatsRequest) SetOutPort(v Port) {
466 self.OutPort = v
467}
468
469func (self *AggregateStatsRequest) GetOutGroup() uint32 {
470 return self.OutGroup
471}
472
473func (self *AggregateStatsRequest) SetOutGroup(v uint32) {
474 self.OutGroup = v
475}
476
477func (self *AggregateStatsRequest) GetCookie() uint64 {
478 return self.Cookie
479}
480
481func (self *AggregateStatsRequest) SetCookie(v uint64) {
482 self.Cookie = v
483}
484
485func (self *AggregateStatsRequest) GetCookieMask() uint64 {
486 return self.CookieMask
487}
488
489func (self *AggregateStatsRequest) SetCookieMask(v uint64) {
490 self.CookieMask = v
491}
492
493func (self *AggregateStatsRequest) GetMatch() Match {
494 return self.Match
495}
496
497func (self *AggregateStatsRequest) SetMatch(v Match) {
498 self.Match = v
499}
500
501func (self *AggregateStatsRequest) Serialize(encoder *goloxi.Encoder) error {
502 if err := self.StatsRequest.Serialize(encoder); err != nil {
503 return err
504 }
505
506 encoder.Write(bytes.Repeat([]byte{0}, 4))
507 encoder.PutUint8(uint8(self.TableId))
508 encoder.Write(bytes.Repeat([]byte{0}, 3))
509 self.OutPort.Serialize(encoder)
510 encoder.PutUint32(uint32(self.OutGroup))
511 encoder.Write(bytes.Repeat([]byte{0}, 4))
512 encoder.PutUint64(uint64(self.Cookie))
513 encoder.PutUint64(uint64(self.CookieMask))
514 if err := self.Match.Serialize(encoder); err != nil {
515 return err
516 }
517
518 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
519
520 return nil
521}
522
523func DecodeAggregateStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*AggregateStatsRequest, error) {
524 _aggregatestatsrequest := &AggregateStatsRequest{StatsRequest: parent}
525 if decoder.Length() < 28 {
526 return nil, fmt.Errorf("AggregateStatsRequest packet too short: %d < 28", decoder.Length())
527 }
528 decoder.Skip(4)
529 _aggregatestatsrequest.TableId = uint8(decoder.ReadByte())
530 decoder.Skip(3)
531 _aggregatestatsrequest.OutPort.Decode(decoder)
532 _aggregatestatsrequest.OutGroup = uint32(decoder.ReadUint32())
533 decoder.Skip(4)
534 _aggregatestatsrequest.Cookie = uint64(decoder.ReadUint64())
535 _aggregatestatsrequest.CookieMask = uint64(decoder.ReadUint64())
536 if err := _aggregatestatsrequest.Match.Decode(decoder); err != nil {
537 return nil, err
538 }
539
540 decoder.SkipAlign()
541 return _aggregatestatsrequest, nil
542}
543
544func NewAggregateStatsRequest() *AggregateStatsRequest {
545 obj := &AggregateStatsRequest{
546 StatsRequest: NewStatsRequest(2),
547 }
548 return obj
549}
550
551type AsyncGetReply struct {
552 *Header
553 PacketInMaskEqualMaster uint32
554 PacketInMaskSlave uint32
555 PortStatusMaskEqualMaster uint32
556 PortStatusMaskSlave uint32
557 FlowRemovedMaskEqualMaster uint32
558 FlowRemovedMaskSlave uint32
559}
560
561type IAsyncGetReply interface {
562 IHeader
563 GetPacketInMaskEqualMaster() uint32
564 GetPacketInMaskSlave() uint32
565 GetPortStatusMaskEqualMaster() uint32
566 GetPortStatusMaskSlave() uint32
567 GetFlowRemovedMaskEqualMaster() uint32
568 GetFlowRemovedMaskSlave() uint32
569}
570
571func (self *AsyncGetReply) GetPacketInMaskEqualMaster() uint32 {
572 return self.PacketInMaskEqualMaster
573}
574
575func (self *AsyncGetReply) SetPacketInMaskEqualMaster(v uint32) {
576 self.PacketInMaskEqualMaster = v
577}
578
579func (self *AsyncGetReply) GetPacketInMaskSlave() uint32 {
580 return self.PacketInMaskSlave
581}
582
583func (self *AsyncGetReply) SetPacketInMaskSlave(v uint32) {
584 self.PacketInMaskSlave = v
585}
586
587func (self *AsyncGetReply) GetPortStatusMaskEqualMaster() uint32 {
588 return self.PortStatusMaskEqualMaster
589}
590
591func (self *AsyncGetReply) SetPortStatusMaskEqualMaster(v uint32) {
592 self.PortStatusMaskEqualMaster = v
593}
594
595func (self *AsyncGetReply) GetPortStatusMaskSlave() uint32 {
596 return self.PortStatusMaskSlave
597}
598
599func (self *AsyncGetReply) SetPortStatusMaskSlave(v uint32) {
600 self.PortStatusMaskSlave = v
601}
602
603func (self *AsyncGetReply) GetFlowRemovedMaskEqualMaster() uint32 {
604 return self.FlowRemovedMaskEqualMaster
605}
606
607func (self *AsyncGetReply) SetFlowRemovedMaskEqualMaster(v uint32) {
608 self.FlowRemovedMaskEqualMaster = v
609}
610
611func (self *AsyncGetReply) GetFlowRemovedMaskSlave() uint32 {
612 return self.FlowRemovedMaskSlave
613}
614
615func (self *AsyncGetReply) SetFlowRemovedMaskSlave(v uint32) {
616 self.FlowRemovedMaskSlave = v
617}
618
619func (self *AsyncGetReply) Serialize(encoder *goloxi.Encoder) error {
620 if err := self.Header.Serialize(encoder); err != nil {
621 return err
622 }
623
624 encoder.PutUint32(uint32(self.PacketInMaskEqualMaster))
625 encoder.PutUint32(uint32(self.PacketInMaskSlave))
626 encoder.PutUint32(uint32(self.PortStatusMaskEqualMaster))
627 encoder.PutUint32(uint32(self.PortStatusMaskSlave))
628 encoder.PutUint32(uint32(self.FlowRemovedMaskEqualMaster))
629 encoder.PutUint32(uint32(self.FlowRemovedMaskSlave))
630
631 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
632
633 return nil
634}
635
636func DecodeAsyncGetReply(parent *Header, decoder *goloxi.Decoder) (*AsyncGetReply, error) {
637 _asyncgetreply := &AsyncGetReply{Header: parent}
638 if decoder.Length() < 24 {
639 return nil, fmt.Errorf("AsyncGetReply packet too short: %d < 24", decoder.Length())
640 }
641 _asyncgetreply.PacketInMaskEqualMaster = uint32(decoder.ReadUint32())
642 _asyncgetreply.PacketInMaskSlave = uint32(decoder.ReadUint32())
643 _asyncgetreply.PortStatusMaskEqualMaster = uint32(decoder.ReadUint32())
644 _asyncgetreply.PortStatusMaskSlave = uint32(decoder.ReadUint32())
645 _asyncgetreply.FlowRemovedMaskEqualMaster = uint32(decoder.ReadUint32())
646 _asyncgetreply.FlowRemovedMaskSlave = uint32(decoder.ReadUint32())
647 return _asyncgetreply, nil
648}
649
650func NewAsyncGetReply() *AsyncGetReply {
651 obj := &AsyncGetReply{
652 Header: NewHeader(27),
653 }
654 return obj
655}
656
657type AsyncGetRequest struct {
658 *Header
659}
660
661type IAsyncGetRequest interface {
662 IHeader
663}
664
665func (self *AsyncGetRequest) Serialize(encoder *goloxi.Encoder) error {
666 if err := self.Header.Serialize(encoder); err != nil {
667 return err
668 }
669
670 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
671
672 return nil
673}
674
675func DecodeAsyncGetRequest(parent *Header, decoder *goloxi.Decoder) (*AsyncGetRequest, error) {
676 _asyncgetrequest := &AsyncGetRequest{Header: parent}
677 return _asyncgetrequest, nil
678}
679
680func NewAsyncGetRequest() *AsyncGetRequest {
681 obj := &AsyncGetRequest{
682 Header: NewHeader(26),
683 }
684 return obj
685}
686
687type AsyncSet struct {
688 *Header
689 PacketInMaskEqualMaster uint32
690 PacketInMaskSlave uint32
691 PortStatusMaskEqualMaster uint32
692 PortStatusMaskSlave uint32
693 FlowRemovedMaskEqualMaster uint32
694 FlowRemovedMaskSlave uint32
695}
696
697type IAsyncSet interface {
698 IHeader
699 GetPacketInMaskEqualMaster() uint32
700 GetPacketInMaskSlave() uint32
701 GetPortStatusMaskEqualMaster() uint32
702 GetPortStatusMaskSlave() uint32
703 GetFlowRemovedMaskEqualMaster() uint32
704 GetFlowRemovedMaskSlave() uint32
705}
706
707func (self *AsyncSet) GetPacketInMaskEqualMaster() uint32 {
708 return self.PacketInMaskEqualMaster
709}
710
711func (self *AsyncSet) SetPacketInMaskEqualMaster(v uint32) {
712 self.PacketInMaskEqualMaster = v
713}
714
715func (self *AsyncSet) GetPacketInMaskSlave() uint32 {
716 return self.PacketInMaskSlave
717}
718
719func (self *AsyncSet) SetPacketInMaskSlave(v uint32) {
720 self.PacketInMaskSlave = v
721}
722
723func (self *AsyncSet) GetPortStatusMaskEqualMaster() uint32 {
724 return self.PortStatusMaskEqualMaster
725}
726
727func (self *AsyncSet) SetPortStatusMaskEqualMaster(v uint32) {
728 self.PortStatusMaskEqualMaster = v
729}
730
731func (self *AsyncSet) GetPortStatusMaskSlave() uint32 {
732 return self.PortStatusMaskSlave
733}
734
735func (self *AsyncSet) SetPortStatusMaskSlave(v uint32) {
736 self.PortStatusMaskSlave = v
737}
738
739func (self *AsyncSet) GetFlowRemovedMaskEqualMaster() uint32 {
740 return self.FlowRemovedMaskEqualMaster
741}
742
743func (self *AsyncSet) SetFlowRemovedMaskEqualMaster(v uint32) {
744 self.FlowRemovedMaskEqualMaster = v
745}
746
747func (self *AsyncSet) GetFlowRemovedMaskSlave() uint32 {
748 return self.FlowRemovedMaskSlave
749}
750
751func (self *AsyncSet) SetFlowRemovedMaskSlave(v uint32) {
752 self.FlowRemovedMaskSlave = v
753}
754
755func (self *AsyncSet) Serialize(encoder *goloxi.Encoder) error {
756 if err := self.Header.Serialize(encoder); err != nil {
757 return err
758 }
759
760 encoder.PutUint32(uint32(self.PacketInMaskEqualMaster))
761 encoder.PutUint32(uint32(self.PacketInMaskSlave))
762 encoder.PutUint32(uint32(self.PortStatusMaskEqualMaster))
763 encoder.PutUint32(uint32(self.PortStatusMaskSlave))
764 encoder.PutUint32(uint32(self.FlowRemovedMaskEqualMaster))
765 encoder.PutUint32(uint32(self.FlowRemovedMaskSlave))
766
767 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
768
769 return nil
770}
771
772func DecodeAsyncSet(parent *Header, decoder *goloxi.Decoder) (*AsyncSet, error) {
773 _asyncset := &AsyncSet{Header: parent}
774 if decoder.Length() < 24 {
775 return nil, fmt.Errorf("AsyncSet packet too short: %d < 24", decoder.Length())
776 }
777 _asyncset.PacketInMaskEqualMaster = uint32(decoder.ReadUint32())
778 _asyncset.PacketInMaskSlave = uint32(decoder.ReadUint32())
779 _asyncset.PortStatusMaskEqualMaster = uint32(decoder.ReadUint32())
780 _asyncset.PortStatusMaskSlave = uint32(decoder.ReadUint32())
781 _asyncset.FlowRemovedMaskEqualMaster = uint32(decoder.ReadUint32())
782 _asyncset.FlowRemovedMaskSlave = uint32(decoder.ReadUint32())
783 return _asyncset, nil
784}
785
786func NewAsyncSet() *AsyncSet {
787 obj := &AsyncSet{
788 Header: NewHeader(28),
789 }
790 return obj
791}
792
793type ErrorMsg struct {
794 *Header
795 ErrType uint16
796}
797
798type IErrorMsg interface {
799 IHeader
800 GetErrType() uint16
801}
802
803func (self *ErrorMsg) GetErrType() uint16 {
804 return self.ErrType
805}
806
807func (self *ErrorMsg) SetErrType(v uint16) {
808 self.ErrType = v
809}
810
811func (self *ErrorMsg) Serialize(encoder *goloxi.Encoder) error {
812 if err := self.Header.Serialize(encoder); err != nil {
813 return err
814 }
815
816 encoder.PutUint16(uint16(self.ErrType))
817
818 return nil
819}
820
821func DecodeErrorMsg(parent *Header, decoder *goloxi.Decoder) (IErrorMsg, error) {
822 _errormsg := &ErrorMsg{Header: parent}
823 if decoder.Length() < 2 {
824 return nil, fmt.Errorf("ErrorMsg packet too short: %d < 2", decoder.Length())
825 }
826 _errormsg.ErrType = uint16(decoder.ReadUint16())
827
828 switch _errormsg.ErrType {
829 case 0:
830 return DecodeHelloFailedErrorMsg(_errormsg, decoder)
831 case 1:
832 return DecodeBadRequestErrorMsg(_errormsg, decoder)
833 case 2:
834 return DecodeBadActionErrorMsg(_errormsg, decoder)
835 case 3:
836 return DecodeBadInstructionErrorMsg(_errormsg, decoder)
837 case 4:
838 return DecodeBadMatchErrorMsg(_errormsg, decoder)
839 case 5:
840 return DecodeFlowModFailedErrorMsg(_errormsg, decoder)
841 case 6:
842 return DecodeGroupModFailedErrorMsg(_errormsg, decoder)
843 case 7:
844 return DecodePortModFailedErrorMsg(_errormsg, decoder)
845 case 8:
846 return DecodeTableModFailedErrorMsg(_errormsg, decoder)
847 case 9:
848 return DecodeQueueOpFailedErrorMsg(_errormsg, decoder)
849 case 10:
850 return DecodeSwitchConfigFailedErrorMsg(_errormsg, decoder)
851 case 11:
852 return DecodeRoleRequestFailedErrorMsg(_errormsg, decoder)
853 case 12:
854 return DecodeMeterModFailedErrorMsg(_errormsg, decoder)
855 case 13:
856 return DecodeTableFeaturesFailedErrorMsg(_errormsg, decoder)
857 case 65535:
858 return DecodeExperimenterErrorMsg(_errormsg, decoder)
859 default:
860 return nil, fmt.Errorf("Invalid type '%d' for 'ErrorMsg'", _errormsg.ErrType)
861 }
862}
863
864func NewErrorMsg(_err_type uint16) *ErrorMsg {
865 obj := &ErrorMsg{
866 Header: NewHeader(1),
867 }
868 obj.ErrType = _err_type
869 return obj
870}
871
872type BadActionErrorMsg struct {
873 *ErrorMsg
874 Code BadActionCode
875 Data []byte
876}
877
878type IBadActionErrorMsg interface {
879 IErrorMsg
880 GetCode() BadActionCode
881 GetData() []byte
882}
883
884func (self *BadActionErrorMsg) GetCode() BadActionCode {
885 return self.Code
886}
887
888func (self *BadActionErrorMsg) SetCode(v BadActionCode) {
889 self.Code = v
890}
891
892func (self *BadActionErrorMsg) GetData() []byte {
893 return self.Data
894}
895
896func (self *BadActionErrorMsg) SetData(v []byte) {
897 self.Data = v
898}
899
900func (self *BadActionErrorMsg) Serialize(encoder *goloxi.Encoder) error {
901 if err := self.ErrorMsg.Serialize(encoder); err != nil {
902 return err
903 }
904
905 encoder.PutUint16(uint16(self.Code))
906 encoder.Write(self.Data)
907
908 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
909
910 return nil
911}
912
913func DecodeBadActionErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*BadActionErrorMsg, error) {
914 _badactionerrormsg := &BadActionErrorMsg{ErrorMsg: parent}
915 if decoder.Length() < 2 {
916 return nil, fmt.Errorf("BadActionErrorMsg packet too short: %d < 2", decoder.Length())
917 }
918 _badactionerrormsg.Code = BadActionCode(decoder.ReadUint16())
919 _badactionerrormsg.Data = decoder.Read(int(decoder.Length()))
920 return _badactionerrormsg, nil
921}
922
923func NewBadActionErrorMsg() *BadActionErrorMsg {
924 obj := &BadActionErrorMsg{
925 ErrorMsg: NewErrorMsg(2),
926 }
927 return obj
928}
929
930type BadInstructionErrorMsg struct {
931 *ErrorMsg
932 Code BadInstructionCode
933 Data []byte
934}
935
936type IBadInstructionErrorMsg interface {
937 IErrorMsg
938 GetCode() BadInstructionCode
939 GetData() []byte
940}
941
942func (self *BadInstructionErrorMsg) GetCode() BadInstructionCode {
943 return self.Code
944}
945
946func (self *BadInstructionErrorMsg) SetCode(v BadInstructionCode) {
947 self.Code = v
948}
949
950func (self *BadInstructionErrorMsg) GetData() []byte {
951 return self.Data
952}
953
954func (self *BadInstructionErrorMsg) SetData(v []byte) {
955 self.Data = v
956}
957
958func (self *BadInstructionErrorMsg) Serialize(encoder *goloxi.Encoder) error {
959 if err := self.ErrorMsg.Serialize(encoder); err != nil {
960 return err
961 }
962
963 encoder.PutUint16(uint16(self.Code))
964 encoder.Write(self.Data)
965
966 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
967
968 return nil
969}
970
971func DecodeBadInstructionErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*BadInstructionErrorMsg, error) {
972 _badinstructionerrormsg := &BadInstructionErrorMsg{ErrorMsg: parent}
973 if decoder.Length() < 2 {
974 return nil, fmt.Errorf("BadInstructionErrorMsg packet too short: %d < 2", decoder.Length())
975 }
976 _badinstructionerrormsg.Code = BadInstructionCode(decoder.ReadUint16())
977 _badinstructionerrormsg.Data = decoder.Read(int(decoder.Length()))
978 return _badinstructionerrormsg, nil
979}
980
981func NewBadInstructionErrorMsg() *BadInstructionErrorMsg {
982 obj := &BadInstructionErrorMsg{
983 ErrorMsg: NewErrorMsg(3),
984 }
985 return obj
986}
987
988type BadMatchErrorMsg struct {
989 *ErrorMsg
990 Code BadMatchCode
991 Data []byte
992}
993
994type IBadMatchErrorMsg interface {
995 IErrorMsg
996 GetCode() BadMatchCode
997 GetData() []byte
998}
999
1000func (self *BadMatchErrorMsg) GetCode() BadMatchCode {
1001 return self.Code
1002}
1003
1004func (self *BadMatchErrorMsg) SetCode(v BadMatchCode) {
1005 self.Code = v
1006}
1007
1008func (self *BadMatchErrorMsg) GetData() []byte {
1009 return self.Data
1010}
1011
1012func (self *BadMatchErrorMsg) SetData(v []byte) {
1013 self.Data = v
1014}
1015
1016func (self *BadMatchErrorMsg) Serialize(encoder *goloxi.Encoder) error {
1017 if err := self.ErrorMsg.Serialize(encoder); err != nil {
1018 return err
1019 }
1020
1021 encoder.PutUint16(uint16(self.Code))
1022 encoder.Write(self.Data)
1023
1024 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
1025
1026 return nil
1027}
1028
1029func DecodeBadMatchErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*BadMatchErrorMsg, error) {
1030 _badmatcherrormsg := &BadMatchErrorMsg{ErrorMsg: parent}
1031 if decoder.Length() < 2 {
1032 return nil, fmt.Errorf("BadMatchErrorMsg packet too short: %d < 2", decoder.Length())
1033 }
1034 _badmatcherrormsg.Code = BadMatchCode(decoder.ReadUint16())
1035 _badmatcherrormsg.Data = decoder.Read(int(decoder.Length()))
1036 return _badmatcherrormsg, nil
1037}
1038
1039func NewBadMatchErrorMsg() *BadMatchErrorMsg {
1040 obj := &BadMatchErrorMsg{
1041 ErrorMsg: NewErrorMsg(4),
1042 }
1043 return obj
1044}
1045
1046type BadRequestErrorMsg struct {
1047 *ErrorMsg
1048 Code BadRequestCode
1049 Data []byte
1050}
1051
1052type IBadRequestErrorMsg interface {
1053 IErrorMsg
1054 GetCode() BadRequestCode
1055 GetData() []byte
1056}
1057
1058func (self *BadRequestErrorMsg) GetCode() BadRequestCode {
1059 return self.Code
1060}
1061
1062func (self *BadRequestErrorMsg) SetCode(v BadRequestCode) {
1063 self.Code = v
1064}
1065
1066func (self *BadRequestErrorMsg) GetData() []byte {
1067 return self.Data
1068}
1069
1070func (self *BadRequestErrorMsg) SetData(v []byte) {
1071 self.Data = v
1072}
1073
1074func (self *BadRequestErrorMsg) Serialize(encoder *goloxi.Encoder) error {
1075 if err := self.ErrorMsg.Serialize(encoder); err != nil {
1076 return err
1077 }
1078
1079 encoder.PutUint16(uint16(self.Code))
1080 encoder.Write(self.Data)
1081
1082 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
1083
1084 return nil
1085}
1086
1087func DecodeBadRequestErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*BadRequestErrorMsg, error) {
1088 _badrequesterrormsg := &BadRequestErrorMsg{ErrorMsg: parent}
1089 if decoder.Length() < 2 {
1090 return nil, fmt.Errorf("BadRequestErrorMsg packet too short: %d < 2", decoder.Length())
1091 }
1092 _badrequesterrormsg.Code = BadRequestCode(decoder.ReadUint16())
1093 _badrequesterrormsg.Data = decoder.Read(int(decoder.Length()))
1094 return _badrequesterrormsg, nil
1095}
1096
1097func NewBadRequestErrorMsg() *BadRequestErrorMsg {
1098 obj := &BadRequestErrorMsg{
1099 ErrorMsg: NewErrorMsg(1),
1100 }
1101 return obj
1102}
1103
1104type BarrierReply struct {
1105 *Header
1106}
1107
1108type IBarrierReply interface {
1109 IHeader
1110}
1111
1112func (self *BarrierReply) Serialize(encoder *goloxi.Encoder) error {
1113 if err := self.Header.Serialize(encoder); err != nil {
1114 return err
1115 }
1116
1117 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
1118
1119 return nil
1120}
1121
1122func DecodeBarrierReply(parent *Header, decoder *goloxi.Decoder) (*BarrierReply, error) {
1123 _barrierreply := &BarrierReply{Header: parent}
1124 return _barrierreply, nil
1125}
1126
1127func NewBarrierReply() *BarrierReply {
1128 obj := &BarrierReply{
1129 Header: NewHeader(21),
1130 }
1131 return obj
1132}
1133
1134type BarrierRequest struct {
1135 *Header
1136}
1137
1138type IBarrierRequest interface {
1139 IHeader
1140}
1141
1142func (self *BarrierRequest) Serialize(encoder *goloxi.Encoder) error {
1143 if err := self.Header.Serialize(encoder); err != nil {
1144 return err
1145 }
1146
1147 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
1148
1149 return nil
1150}
1151
1152func DecodeBarrierRequest(parent *Header, decoder *goloxi.Decoder) (*BarrierRequest, error) {
1153 _barrierrequest := &BarrierRequest{Header: parent}
1154 return _barrierrequest, nil
1155}
1156
1157func NewBarrierRequest() *BarrierRequest {
1158 obj := &BarrierRequest{
1159 Header: NewHeader(20),
1160 }
1161 return obj
1162}
1163
1164type Experimenter struct {
1165 *Header
1166 Experimenter uint32
1167 Subtype uint32
1168}
1169
1170type IExperimenter interface {
1171 IHeader
1172 GetExperimenter() uint32
1173 GetSubtype() uint32
1174}
1175
1176func (self *Experimenter) GetExperimenter() uint32 {
1177 return self.Experimenter
1178}
1179
1180func (self *Experimenter) SetExperimenter(v uint32) {
1181 self.Experimenter = v
1182}
1183
1184func (self *Experimenter) GetSubtype() uint32 {
1185 return self.Subtype
1186}
1187
1188func (self *Experimenter) SetSubtype(v uint32) {
1189 self.Subtype = v
1190}
1191
1192func (self *Experimenter) Serialize(encoder *goloxi.Encoder) error {
1193 if err := self.Header.Serialize(encoder); err != nil {
1194 return err
1195 }
1196
1197 encoder.PutUint32(uint32(self.Experimenter))
1198 encoder.PutUint32(uint32(self.Subtype))
1199
1200 return nil
1201}
1202
1203func DecodeExperimenter(parent *Header, decoder *goloxi.Decoder) (IExperimenter, error) {
1204 _experimenter := &Experimenter{Header: parent}
1205 if decoder.Length() < 8 {
1206 return nil, fmt.Errorf("Experimenter packet too short: %d < 8", decoder.Length())
1207 }
1208 _experimenter.Experimenter = uint32(decoder.ReadUint32())
1209 _experimenter.Subtype = uint32(decoder.ReadUint32())
1210
1211 switch _experimenter.Experimenter {
1212 case 8992:
1213 return DecodeNiciraHeader(_experimenter, decoder)
1214 case 6035143:
1215 return DecodeBsnHeader(_experimenter, decoder)
1216 default:
1217 return nil, fmt.Errorf("Invalid type '%d' for 'Experimenter'", _experimenter.Experimenter)
1218 }
1219}
1220
1221func NewExperimenter(_experimenter uint32) *Experimenter {
1222 obj := &Experimenter{
1223 Header: NewHeader(4),
1224 }
1225 obj.Experimenter = _experimenter
1226 return obj
1227}
1228
1229type BsnHeader struct {
1230 *Experimenter
1231}
1232
1233type IBsnHeader interface {
1234 IExperimenter
1235}
1236
1237func (self *BsnHeader) Serialize(encoder *goloxi.Encoder) error {
1238 if err := self.Experimenter.Serialize(encoder); err != nil {
1239 return err
1240 }
1241
1242 return nil
1243}
1244
1245func DecodeBsnHeader(parent *Experimenter, decoder *goloxi.Decoder) (IBsnHeader, error) {
1246 _bsnheader := &BsnHeader{Experimenter: parent}
1247
1248 switch _bsnheader.Subtype {
1249 case 3:
1250 return DecodeBsnSetMirroring(_bsnheader, decoder)
1251 case 4:
1252 return DecodeBsnGetMirroringRequest(_bsnheader, decoder)
1253 case 5:
1254 return DecodeBsnGetMirroringReply(_bsnheader, decoder)
1255 case 9:
1256 return DecodeBsnGetInterfacesRequest(_bsnheader, decoder)
1257 case 10:
1258 return DecodeBsnGetInterfacesReply(_bsnheader, decoder)
1259 case 11:
1260 return DecodeBsnSetPktinSuppressionRequest(_bsnheader, decoder)
1261 case 15:
1262 return DecodeBsnVirtualPortCreateRequest(_bsnheader, decoder)
1263 case 16:
1264 return DecodeBsnVirtualPortCreateReply(_bsnheader, decoder)
1265 case 17:
1266 return DecodeBsnVirtualPortRemoveRequest(_bsnheader, decoder)
1267 case 18:
1268 return DecodeBsnBwEnableSetRequest(_bsnheader, decoder)
1269 case 19:
1270 return DecodeBsnBwEnableGetRequest(_bsnheader, decoder)
1271 case 20:
1272 return DecodeBsnBwEnableGetReply(_bsnheader, decoder)
1273 case 21:
1274 return DecodeBsnBwClearDataRequest(_bsnheader, decoder)
1275 case 22:
1276 return DecodeBsnBwClearDataReply(_bsnheader, decoder)
1277 case 23:
1278 return DecodeBsnBwEnableSetReply(_bsnheader, decoder)
1279 case 25:
1280 return DecodeBsnSetPktinSuppressionReply(_bsnheader, decoder)
1281 case 26:
1282 return DecodeBsnVirtualPortRemoveReply(_bsnheader, decoder)
1283 case 31:
1284 return DecodeBsnPduTxRequest(_bsnheader, decoder)
1285 case 32:
1286 return DecodeBsnPduTxReply(_bsnheader, decoder)
1287 case 33:
1288 return DecodeBsnPduRxRequest(_bsnheader, decoder)
1289 case 34:
1290 return DecodeBsnPduRxReply(_bsnheader, decoder)
1291 case 35:
1292 return DecodeBsnPduRxTimeout(_bsnheader, decoder)
1293 case 36:
1294 return DecodeBsnFlowIdleEnableSetRequest(_bsnheader, decoder)
1295 case 37:
1296 return DecodeBsnFlowIdleEnableSetReply(_bsnheader, decoder)
1297 case 38:
1298 return DecodeBsnFlowIdleEnableGetRequest(_bsnheader, decoder)
1299 case 39:
1300 return DecodeBsnFlowIdleEnableGetReply(_bsnheader, decoder)
1301 case 40:
1302 return DecodeBsnFlowIdle(_bsnheader, decoder)
1303 case 41:
1304 return DecodeBsnSetLacpRequest(_bsnheader, decoder)
1305 case 42:
1306 return DecodeBsnSetLacpReply(_bsnheader, decoder)
1307 case 43:
1308 return DecodeBsnLacpConvergenceNotif(_bsnheader, decoder)
1309 case 44:
1310 return DecodeBsnTimeRequest(_bsnheader, decoder)
1311 case 45:
1312 return DecodeBsnTimeReply(_bsnheader, decoder)
1313 case 46:
1314 return DecodeBsnGentableEntryAdd(_bsnheader, decoder)
1315 case 47:
1316 return DecodeBsnGentableEntryDelete(_bsnheader, decoder)
1317 case 48:
1318 return DecodeBsnGentableClearRequest(_bsnheader, decoder)
1319 case 49:
1320 return DecodeBsnGentableClearReply(_bsnheader, decoder)
1321 case 50:
1322 return DecodeBsnGentableSetBucketsSize(_bsnheader, decoder)
1323 case 51:
1324 return DecodeBsnGetSwitchPipelineRequest(_bsnheader, decoder)
1325 case 52:
1326 return DecodeBsnGetSwitchPipelineReply(_bsnheader, decoder)
1327 case 53:
1328 return DecodeBsnSetSwitchPipelineRequest(_bsnheader, decoder)
1329 case 54:
1330 return DecodeBsnSetSwitchPipelineReply(_bsnheader, decoder)
1331 case 55:
1332 return DecodeBsnRoleStatus(_bsnheader, decoder)
1333 case 56:
1334 return DecodeBsnControllerConnectionsRequest(_bsnheader, decoder)
1335 case 57:
1336 return DecodeBsnControllerConnectionsReply(_bsnheader, decoder)
1337 case 58:
1338 return DecodeBsnSetAuxCxnsRequest(_bsnheader, decoder)
1339 case 59:
1340 return DecodeBsnSetAuxCxnsReply(_bsnheader, decoder)
1341 case 60:
1342 return DecodeBsnArpIdle(_bsnheader, decoder)
1343 case 61:
1344 return DecodeBsnTableSetBucketsSize(_bsnheader, decoder)
1345 case 63:
1346 return DecodeBsnLog(_bsnheader, decoder)
1347 case 64:
1348 return DecodeBsnLuaUpload(_bsnheader, decoder)
1349 case 65:
1350 return DecodeBsnLuaCommandRequest(_bsnheader, decoder)
1351 case 66:
1352 return DecodeBsnLuaCommandReply(_bsnheader, decoder)
1353 case 67:
1354 return DecodeBsnLuaNotification(_bsnheader, decoder)
1355 case 70:
1356 return DecodeBsnVlanCounterClear(_bsnheader, decoder)
1357 default:
1358 return nil, fmt.Errorf("Invalid type '%d' for 'BsnHeader'", _bsnheader.Subtype)
1359 }
1360}
1361
1362func NewBsnHeader(_subtype uint32) *BsnHeader {
1363 obj := &BsnHeader{
1364 Experimenter: NewExperimenter(6035143),
1365 }
1366 obj.Subtype = _subtype
1367 return obj
1368}
1369
1370type BsnArpIdle struct {
1371 *BsnHeader
1372 VlanVid uint16
1373 Ipv4Addr net.IP
1374}
1375
1376type IBsnArpIdle interface {
1377 IBsnHeader
1378 GetVlanVid() uint16
1379 GetIpv4Addr() net.IP
1380}
1381
1382func (self *BsnArpIdle) GetVlanVid() uint16 {
1383 return self.VlanVid
1384}
1385
1386func (self *BsnArpIdle) SetVlanVid(v uint16) {
1387 self.VlanVid = v
1388}
1389
1390func (self *BsnArpIdle) GetIpv4Addr() net.IP {
1391 return self.Ipv4Addr
1392}
1393
1394func (self *BsnArpIdle) SetIpv4Addr(v net.IP) {
1395 self.Ipv4Addr = v
1396}
1397
1398func (self *BsnArpIdle) Serialize(encoder *goloxi.Encoder) error {
1399 if err := self.BsnHeader.Serialize(encoder); err != nil {
1400 return err
1401 }
1402
1403 encoder.PutUint16(uint16(self.VlanVid))
1404 encoder.Write(bytes.Repeat([]byte{0}, 2))
1405 encoder.Write(self.Ipv4Addr.To4())
1406
1407 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
1408
1409 return nil
1410}
1411
1412func DecodeBsnArpIdle(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnArpIdle, error) {
1413 _bsnarpidle := &BsnArpIdle{BsnHeader: parent}
1414 if decoder.Length() < 8 {
1415 return nil, fmt.Errorf("BsnArpIdle packet too short: %d < 8", decoder.Length())
1416 }
1417 _bsnarpidle.VlanVid = uint16(decoder.ReadUint16())
1418 decoder.Skip(2)
1419 _bsnarpidle.Ipv4Addr = net.IP(decoder.Read(4))
1420 return _bsnarpidle, nil
1421}
1422
1423func NewBsnArpIdle() *BsnArpIdle {
1424 obj := &BsnArpIdle{
1425 BsnHeader: NewBsnHeader(60),
1426 }
1427 return obj
1428}
1429
1430type ExperimenterErrorMsg struct {
1431 *ErrorMsg
1432 Subtype uint16
1433 Experimenter uint32
1434}
1435
1436type IExperimenterErrorMsg interface {
1437 IErrorMsg
1438 GetSubtype() uint16
1439 GetExperimenter() uint32
1440}
1441
1442func (self *ExperimenterErrorMsg) GetSubtype() uint16 {
1443 return self.Subtype
1444}
1445
1446func (self *ExperimenterErrorMsg) SetSubtype(v uint16) {
1447 self.Subtype = v
1448}
1449
1450func (self *ExperimenterErrorMsg) GetExperimenter() uint32 {
1451 return self.Experimenter
1452}
1453
1454func (self *ExperimenterErrorMsg) SetExperimenter(v uint32) {
1455 self.Experimenter = v
1456}
1457
1458func (self *ExperimenterErrorMsg) Serialize(encoder *goloxi.Encoder) error {
1459 if err := self.ErrorMsg.Serialize(encoder); err != nil {
1460 return err
1461 }
1462
1463 encoder.PutUint16(uint16(self.Subtype))
1464 encoder.PutUint32(uint32(self.Experimenter))
1465
1466 return nil
1467}
1468
1469func DecodeExperimenterErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (IExperimenterErrorMsg, error) {
1470 _experimentererrormsg := &ExperimenterErrorMsg{ErrorMsg: parent}
1471 if decoder.Length() < 6 {
1472 return nil, fmt.Errorf("ExperimenterErrorMsg packet too short: %d < 6", decoder.Length())
1473 }
1474 _experimentererrormsg.Subtype = uint16(decoder.ReadUint16())
1475 _experimentererrormsg.Experimenter = uint32(decoder.ReadUint32())
1476
1477 switch _experimentererrormsg.Experimenter {
1478 case 6035143:
1479 return DecodeBsnBaseError(_experimentererrormsg, decoder)
1480 default:
1481 return nil, fmt.Errorf("Invalid type '%d' for 'ExperimenterErrorMsg'", _experimentererrormsg.Experimenter)
1482 }
1483}
1484
1485func NewExperimenterErrorMsg(_experimenter uint32) *ExperimenterErrorMsg {
1486 obj := &ExperimenterErrorMsg{
1487 ErrorMsg: NewErrorMsg(65535),
1488 }
1489 obj.Experimenter = _experimenter
1490 return obj
1491}
1492
1493type BsnBaseError struct {
1494 *ExperimenterErrorMsg
1495 ErrMsg string
1496}
1497
1498type IBsnBaseError interface {
1499 IExperimenterErrorMsg
1500 GetErrMsg() string
1501}
1502
1503func (self *BsnBaseError) GetErrMsg() string {
1504 return self.ErrMsg
1505}
1506
1507func (self *BsnBaseError) SetErrMsg(v string) {
1508 self.ErrMsg = v
1509}
1510
1511func (self *BsnBaseError) Serialize(encoder *goloxi.Encoder) error {
1512 if err := self.ExperimenterErrorMsg.Serialize(encoder); err != nil {
1513 return err
1514 }
1515
1516 encoder.Write([]byte(self.ErrMsg))
1517
1518 return nil
1519}
1520
1521func DecodeBsnBaseError(parent *ExperimenterErrorMsg, decoder *goloxi.Decoder) (IBsnBaseError, error) {
1522 _bsnbaseerror := &BsnBaseError{ExperimenterErrorMsg: parent}
1523 if decoder.Length() < 256 {
1524 return nil, fmt.Errorf("BsnBaseError packet too short: %d < 256", decoder.Length())
1525 }
1526 _bsnbaseerror.ErrMsg = string(bytes.Trim(decoder.Read(256), "\x00"))
1527
1528 switch _bsnbaseerror.Subtype {
1529 case 1:
1530 return DecodeBsnError(_bsnbaseerror, decoder)
1531 case 2:
1532 return DecodeBsnGentableError(_bsnbaseerror, decoder)
1533 default:
1534 return nil, fmt.Errorf("Invalid type '%d' for 'BsnBaseError'", _bsnbaseerror.Subtype)
1535 }
1536}
1537
1538func NewBsnBaseError(_subtype uint16) *BsnBaseError {
1539 obj := &BsnBaseError{
1540 ExperimenterErrorMsg: NewExperimenterErrorMsg(6035143),
1541 }
1542 obj.Subtype = _subtype
1543 return obj
1544}
1545
1546type BsnBwClearDataReply struct {
1547 *BsnHeader
1548 Status uint32
1549}
1550
1551type IBsnBwClearDataReply interface {
1552 IBsnHeader
1553 GetStatus() uint32
1554}
1555
1556func (self *BsnBwClearDataReply) GetStatus() uint32 {
1557 return self.Status
1558}
1559
1560func (self *BsnBwClearDataReply) SetStatus(v uint32) {
1561 self.Status = v
1562}
1563
1564func (self *BsnBwClearDataReply) Serialize(encoder *goloxi.Encoder) error {
1565 if err := self.BsnHeader.Serialize(encoder); err != nil {
1566 return err
1567 }
1568
1569 encoder.PutUint32(uint32(self.Status))
1570
1571 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
1572
1573 return nil
1574}
1575
1576func DecodeBsnBwClearDataReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnBwClearDataReply, error) {
1577 _bsnbwcleardatareply := &BsnBwClearDataReply{BsnHeader: parent}
1578 if decoder.Length() < 4 {
1579 return nil, fmt.Errorf("BsnBwClearDataReply packet too short: %d < 4", decoder.Length())
1580 }
1581 _bsnbwcleardatareply.Status = uint32(decoder.ReadUint32())
1582 return _bsnbwcleardatareply, nil
1583}
1584
1585func NewBsnBwClearDataReply() *BsnBwClearDataReply {
1586 obj := &BsnBwClearDataReply{
1587 BsnHeader: NewBsnHeader(22),
1588 }
1589 return obj
1590}
1591
1592type BsnBwClearDataRequest struct {
1593 *BsnHeader
1594}
1595
1596type IBsnBwClearDataRequest interface {
1597 IBsnHeader
1598}
1599
1600func (self *BsnBwClearDataRequest) Serialize(encoder *goloxi.Encoder) error {
1601 if err := self.BsnHeader.Serialize(encoder); err != nil {
1602 return err
1603 }
1604
1605 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
1606
1607 return nil
1608}
1609
1610func DecodeBsnBwClearDataRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnBwClearDataRequest, error) {
1611 _bsnbwcleardatarequest := &BsnBwClearDataRequest{BsnHeader: parent}
1612 return _bsnbwcleardatarequest, nil
1613}
1614
1615func NewBsnBwClearDataRequest() *BsnBwClearDataRequest {
1616 obj := &BsnBwClearDataRequest{
1617 BsnHeader: NewBsnHeader(21),
1618 }
1619 return obj
1620}
1621
1622type BsnBwEnableGetReply struct {
1623 *BsnHeader
1624 Enabled uint32
1625}
1626
1627type IBsnBwEnableGetReply interface {
1628 IBsnHeader
1629 GetEnabled() uint32
1630}
1631
1632func (self *BsnBwEnableGetReply) GetEnabled() uint32 {
1633 return self.Enabled
1634}
1635
1636func (self *BsnBwEnableGetReply) SetEnabled(v uint32) {
1637 self.Enabled = v
1638}
1639
1640func (self *BsnBwEnableGetReply) Serialize(encoder *goloxi.Encoder) error {
1641 if err := self.BsnHeader.Serialize(encoder); err != nil {
1642 return err
1643 }
1644
1645 encoder.PutUint32(uint32(self.Enabled))
1646
1647 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
1648
1649 return nil
1650}
1651
1652func DecodeBsnBwEnableGetReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnBwEnableGetReply, error) {
1653 _bsnbwenablegetreply := &BsnBwEnableGetReply{BsnHeader: parent}
1654 if decoder.Length() < 4 {
1655 return nil, fmt.Errorf("BsnBwEnableGetReply packet too short: %d < 4", decoder.Length())
1656 }
1657 _bsnbwenablegetreply.Enabled = uint32(decoder.ReadUint32())
1658 return _bsnbwenablegetreply, nil
1659}
1660
1661func NewBsnBwEnableGetReply() *BsnBwEnableGetReply {
1662 obj := &BsnBwEnableGetReply{
1663 BsnHeader: NewBsnHeader(20),
1664 }
1665 return obj
1666}
1667
1668type BsnBwEnableGetRequest struct {
1669 *BsnHeader
1670}
1671
1672type IBsnBwEnableGetRequest interface {
1673 IBsnHeader
1674}
1675
1676func (self *BsnBwEnableGetRequest) Serialize(encoder *goloxi.Encoder) error {
1677 if err := self.BsnHeader.Serialize(encoder); err != nil {
1678 return err
1679 }
1680
1681 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
1682
1683 return nil
1684}
1685
1686func DecodeBsnBwEnableGetRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnBwEnableGetRequest, error) {
1687 _bsnbwenablegetrequest := &BsnBwEnableGetRequest{BsnHeader: parent}
1688 return _bsnbwenablegetrequest, nil
1689}
1690
1691func NewBsnBwEnableGetRequest() *BsnBwEnableGetRequest {
1692 obj := &BsnBwEnableGetRequest{
1693 BsnHeader: NewBsnHeader(19),
1694 }
1695 return obj
1696}
1697
1698type BsnBwEnableSetReply struct {
1699 *BsnHeader
1700 Enable uint32
1701 Status uint32
1702}
1703
1704type IBsnBwEnableSetReply interface {
1705 IBsnHeader
1706 GetEnable() uint32
1707 GetStatus() uint32
1708}
1709
1710func (self *BsnBwEnableSetReply) GetEnable() uint32 {
1711 return self.Enable
1712}
1713
1714func (self *BsnBwEnableSetReply) SetEnable(v uint32) {
1715 self.Enable = v
1716}
1717
1718func (self *BsnBwEnableSetReply) GetStatus() uint32 {
1719 return self.Status
1720}
1721
1722func (self *BsnBwEnableSetReply) SetStatus(v uint32) {
1723 self.Status = v
1724}
1725
1726func (self *BsnBwEnableSetReply) Serialize(encoder *goloxi.Encoder) error {
1727 if err := self.BsnHeader.Serialize(encoder); err != nil {
1728 return err
1729 }
1730
1731 encoder.PutUint32(uint32(self.Enable))
1732 encoder.PutUint32(uint32(self.Status))
1733
1734 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
1735
1736 return nil
1737}
1738
1739func DecodeBsnBwEnableSetReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnBwEnableSetReply, error) {
1740 _bsnbwenablesetreply := &BsnBwEnableSetReply{BsnHeader: parent}
1741 if decoder.Length() < 8 {
1742 return nil, fmt.Errorf("BsnBwEnableSetReply packet too short: %d < 8", decoder.Length())
1743 }
1744 _bsnbwenablesetreply.Enable = uint32(decoder.ReadUint32())
1745 _bsnbwenablesetreply.Status = uint32(decoder.ReadUint32())
1746 return _bsnbwenablesetreply, nil
1747}
1748
1749func NewBsnBwEnableSetReply() *BsnBwEnableSetReply {
1750 obj := &BsnBwEnableSetReply{
1751 BsnHeader: NewBsnHeader(23),
1752 }
1753 return obj
1754}
1755
1756type BsnBwEnableSetRequest struct {
1757 *BsnHeader
1758 Enable uint32
1759}
1760
1761type IBsnBwEnableSetRequest interface {
1762 IBsnHeader
1763 GetEnable() uint32
1764}
1765
1766func (self *BsnBwEnableSetRequest) GetEnable() uint32 {
1767 return self.Enable
1768}
1769
1770func (self *BsnBwEnableSetRequest) SetEnable(v uint32) {
1771 self.Enable = v
1772}
1773
1774func (self *BsnBwEnableSetRequest) Serialize(encoder *goloxi.Encoder) error {
1775 if err := self.BsnHeader.Serialize(encoder); err != nil {
1776 return err
1777 }
1778
1779 encoder.PutUint32(uint32(self.Enable))
1780
1781 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
1782
1783 return nil
1784}
1785
1786func DecodeBsnBwEnableSetRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnBwEnableSetRequest, error) {
1787 _bsnbwenablesetrequest := &BsnBwEnableSetRequest{BsnHeader: parent}
1788 if decoder.Length() < 4 {
1789 return nil, fmt.Errorf("BsnBwEnableSetRequest packet too short: %d < 4", decoder.Length())
1790 }
1791 _bsnbwenablesetrequest.Enable = uint32(decoder.ReadUint32())
1792 return _bsnbwenablesetrequest, nil
1793}
1794
1795func NewBsnBwEnableSetRequest() *BsnBwEnableSetRequest {
1796 obj := &BsnBwEnableSetRequest{
1797 BsnHeader: NewBsnHeader(18),
1798 }
1799 return obj
1800}
1801
1802type BsnControllerConnectionsReply struct {
1803 *BsnHeader
1804 Connections []*BsnControllerConnection
1805}
1806
1807type IBsnControllerConnectionsReply interface {
1808 IBsnHeader
1809 GetConnections() []*BsnControllerConnection
1810}
1811
1812func (self *BsnControllerConnectionsReply) GetConnections() []*BsnControllerConnection {
1813 return self.Connections
1814}
1815
1816func (self *BsnControllerConnectionsReply) SetConnections(v []*BsnControllerConnection) {
1817 self.Connections = v
1818}
1819
1820func (self *BsnControllerConnectionsReply) Serialize(encoder *goloxi.Encoder) error {
1821 if err := self.BsnHeader.Serialize(encoder); err != nil {
1822 return err
1823 }
1824
1825 for _, obj := range self.Connections {
1826 if err := obj.Serialize(encoder); err != nil {
1827 return err
1828 }
1829 }
1830
1831 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
1832
1833 return nil
1834}
1835
1836func DecodeBsnControllerConnectionsReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnControllerConnectionsReply, error) {
1837 _bsncontrollerconnectionsreply := &BsnControllerConnectionsReply{BsnHeader: parent}
1838
1839 for decoder.Length() >= 264 {
1840 item, err := DecodeBsnControllerConnection(decoder)
1841 if err != nil {
1842 return nil, err
1843 }
1844 if item != nil {
1845 _bsncontrollerconnectionsreply.Connections = append(_bsncontrollerconnectionsreply.Connections, item)
1846 }
1847 }
1848 return _bsncontrollerconnectionsreply, nil
1849}
1850
1851func NewBsnControllerConnectionsReply() *BsnControllerConnectionsReply {
1852 obj := &BsnControllerConnectionsReply{
1853 BsnHeader: NewBsnHeader(57),
1854 }
1855 return obj
1856}
1857
1858type BsnControllerConnectionsRequest struct {
1859 *BsnHeader
1860}
1861
1862type IBsnControllerConnectionsRequest interface {
1863 IBsnHeader
1864}
1865
1866func (self *BsnControllerConnectionsRequest) Serialize(encoder *goloxi.Encoder) error {
1867 if err := self.BsnHeader.Serialize(encoder); err != nil {
1868 return err
1869 }
1870
1871 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
1872
1873 return nil
1874}
1875
1876func DecodeBsnControllerConnectionsRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnControllerConnectionsRequest, error) {
1877 _bsncontrollerconnectionsrequest := &BsnControllerConnectionsRequest{BsnHeader: parent}
1878 return _bsncontrollerconnectionsrequest, nil
1879}
1880
1881func NewBsnControllerConnectionsRequest() *BsnControllerConnectionsRequest {
1882 obj := &BsnControllerConnectionsRequest{
1883 BsnHeader: NewBsnHeader(56),
1884 }
1885 return obj
1886}
1887
1888type ExperimenterStatsReply struct {
1889 *StatsReply
1890 Experimenter uint32
1891 Subtype uint32
1892}
1893
1894type IExperimenterStatsReply interface {
1895 IStatsReply
1896 GetExperimenter() uint32
1897 GetSubtype() uint32
1898}
1899
1900func (self *ExperimenterStatsReply) GetExperimenter() uint32 {
1901 return self.Experimenter
1902}
1903
1904func (self *ExperimenterStatsReply) SetExperimenter(v uint32) {
1905 self.Experimenter = v
1906}
1907
1908func (self *ExperimenterStatsReply) GetSubtype() uint32 {
1909 return self.Subtype
1910}
1911
1912func (self *ExperimenterStatsReply) SetSubtype(v uint32) {
1913 self.Subtype = v
1914}
1915
1916func (self *ExperimenterStatsReply) Serialize(encoder *goloxi.Encoder) error {
1917 if err := self.StatsReply.Serialize(encoder); err != nil {
1918 return err
1919 }
1920
1921 encoder.Write(bytes.Repeat([]byte{0}, 4))
1922 encoder.PutUint32(uint32(self.Experimenter))
1923 encoder.PutUint32(uint32(self.Subtype))
1924
1925 return nil
1926}
1927
1928func DecodeExperimenterStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (IExperimenterStatsReply, error) {
1929 _experimenterstatsreply := &ExperimenterStatsReply{StatsReply: parent}
1930 if decoder.Length() < 12 {
1931 return nil, fmt.Errorf("ExperimenterStatsReply packet too short: %d < 12", decoder.Length())
1932 }
1933 decoder.Skip(4)
1934 _experimenterstatsreply.Experimenter = uint32(decoder.ReadUint32())
1935 _experimenterstatsreply.Subtype = uint32(decoder.ReadUint32())
1936
1937 switch _experimenterstatsreply.Experimenter {
1938 case 8992:
1939 return DecodeNiciraStatsReply(_experimenterstatsreply, decoder)
1940 case 6035143:
1941 return DecodeBsnStatsReply(_experimenterstatsreply, decoder)
1942 default:
1943 return nil, fmt.Errorf("Invalid type '%d' for 'ExperimenterStatsReply'", _experimenterstatsreply.Experimenter)
1944 }
1945}
1946
1947func NewExperimenterStatsReply(_experimenter uint32) *ExperimenterStatsReply {
1948 obj := &ExperimenterStatsReply{
1949 StatsReply: NewStatsReply(65535),
1950 }
1951 obj.Experimenter = _experimenter
1952 return obj
1953}
1954
1955type BsnStatsReply struct {
1956 *ExperimenterStatsReply
1957}
1958
1959type IBsnStatsReply interface {
1960 IExperimenterStatsReply
1961}
1962
1963func (self *BsnStatsReply) Serialize(encoder *goloxi.Encoder) error {
1964 if err := self.ExperimenterStatsReply.Serialize(encoder); err != nil {
1965 return err
1966 }
1967
1968 return nil
1969}
1970
1971func DecodeBsnStatsReply(parent *ExperimenterStatsReply, decoder *goloxi.Decoder) (IBsnStatsReply, error) {
1972 _bsnstatsreply := &BsnStatsReply{ExperimenterStatsReply: parent}
1973
1974 switch _bsnstatsreply.Subtype {
1975 case 1:
1976 return DecodeBsnLacpStatsReply(_bsnstatsreply, decoder)
1977 case 2:
1978 return DecodeBsnGentableEntryDescStatsReply(_bsnstatsreply, decoder)
1979 case 3:
1980 return DecodeBsnGentableEntryStatsReply(_bsnstatsreply, decoder)
1981 case 4:
1982 return DecodeBsnGentableDescStatsReply(_bsnstatsreply, decoder)
1983 case 5:
1984 return DecodeBsnGentableBucketStatsReply(_bsnstatsreply, decoder)
1985 case 6:
1986 return DecodeBsnSwitchPipelineStatsReply(_bsnstatsreply, decoder)
1987 case 7:
1988 return DecodeBsnGentableStatsReply(_bsnstatsreply, decoder)
1989 case 8:
1990 return DecodeBsnPortCounterStatsReply(_bsnstatsreply, decoder)
1991 case 9:
1992 return DecodeBsnVlanCounterStatsReply(_bsnstatsreply, decoder)
1993 case 10:
1994 return DecodeBsnFlowChecksumBucketStatsReply(_bsnstatsreply, decoder)
1995 case 11:
1996 return DecodeBsnTableChecksumStatsReply(_bsnstatsreply, decoder)
1997 case 12:
1998 return DecodeBsnDebugCounterStatsReply(_bsnstatsreply, decoder)
1999 case 13:
2000 return DecodeBsnDebugCounterDescStatsReply(_bsnstatsreply, decoder)
2001 case 14:
2002 return DecodeBsnImageDescStatsReply(_bsnstatsreply, decoder)
2003 case 15:
2004 return DecodeBsnVrfCounterStatsReply(_bsnstatsreply, decoder)
2005 case 16:
2006 return DecodeBsnGenericStatsReply(_bsnstatsreply, decoder)
2007 default:
2008 return nil, fmt.Errorf("Invalid type '%d' for 'BsnStatsReply'", _bsnstatsreply.Subtype)
2009 }
2010}
2011
2012func NewBsnStatsReply(_subtype uint32) *BsnStatsReply {
2013 obj := &BsnStatsReply{
2014 ExperimenterStatsReply: NewExperimenterStatsReply(6035143),
2015 }
2016 obj.Subtype = _subtype
2017 return obj
2018}
2019
2020type BsnDebugCounterDescStatsReply struct {
2021 *BsnStatsReply
2022 Entries []*BsnDebugCounterDescStatsEntry
2023}
2024
2025type IBsnDebugCounterDescStatsReply interface {
2026 IBsnStatsReply
2027 GetEntries() []*BsnDebugCounterDescStatsEntry
2028}
2029
2030func (self *BsnDebugCounterDescStatsReply) GetEntries() []*BsnDebugCounterDescStatsEntry {
2031 return self.Entries
2032}
2033
2034func (self *BsnDebugCounterDescStatsReply) SetEntries(v []*BsnDebugCounterDescStatsEntry) {
2035 self.Entries = v
2036}
2037
2038func (self *BsnDebugCounterDescStatsReply) Serialize(encoder *goloxi.Encoder) error {
2039 if err := self.BsnStatsReply.Serialize(encoder); err != nil {
2040 return err
2041 }
2042
2043 for _, obj := range self.Entries {
2044 if err := obj.Serialize(encoder); err != nil {
2045 return err
2046 }
2047 }
2048
2049 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
2050
2051 return nil
2052}
2053
2054func DecodeBsnDebugCounterDescStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnDebugCounterDescStatsReply, error) {
2055 _bsndebugcounterdescstatsreply := &BsnDebugCounterDescStatsReply{BsnStatsReply: parent}
2056
2057 for decoder.Length() >= 328 {
2058 item, err := DecodeBsnDebugCounterDescStatsEntry(decoder)
2059 if err != nil {
2060 return nil, err
2061 }
2062 if item != nil {
2063 _bsndebugcounterdescstatsreply.Entries = append(_bsndebugcounterdescstatsreply.Entries, item)
2064 }
2065 }
2066 return _bsndebugcounterdescstatsreply, nil
2067}
2068
2069func NewBsnDebugCounterDescStatsReply() *BsnDebugCounterDescStatsReply {
2070 obj := &BsnDebugCounterDescStatsReply{
2071 BsnStatsReply: NewBsnStatsReply(13),
2072 }
2073 return obj
2074}
2075
2076type ExperimenterStatsRequest struct {
2077 *StatsRequest
2078 Experimenter uint32
2079 Subtype uint32
2080}
2081
2082type IExperimenterStatsRequest interface {
2083 IStatsRequest
2084 GetExperimenter() uint32
2085 GetSubtype() uint32
2086}
2087
2088func (self *ExperimenterStatsRequest) GetExperimenter() uint32 {
2089 return self.Experimenter
2090}
2091
2092func (self *ExperimenterStatsRequest) SetExperimenter(v uint32) {
2093 self.Experimenter = v
2094}
2095
2096func (self *ExperimenterStatsRequest) GetSubtype() uint32 {
2097 return self.Subtype
2098}
2099
2100func (self *ExperimenterStatsRequest) SetSubtype(v uint32) {
2101 self.Subtype = v
2102}
2103
2104func (self *ExperimenterStatsRequest) Serialize(encoder *goloxi.Encoder) error {
2105 if err := self.StatsRequest.Serialize(encoder); err != nil {
2106 return err
2107 }
2108
2109 encoder.Write(bytes.Repeat([]byte{0}, 4))
2110 encoder.PutUint32(uint32(self.Experimenter))
2111 encoder.PutUint32(uint32(self.Subtype))
2112
2113 return nil
2114}
2115
2116func DecodeExperimenterStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (IExperimenterStatsRequest, error) {
2117 _experimenterstatsrequest := &ExperimenterStatsRequest{StatsRequest: parent}
2118 if decoder.Length() < 12 {
2119 return nil, fmt.Errorf("ExperimenterStatsRequest packet too short: %d < 12", decoder.Length())
2120 }
2121 decoder.Skip(4)
2122 _experimenterstatsrequest.Experimenter = uint32(decoder.ReadUint32())
2123 _experimenterstatsrequest.Subtype = uint32(decoder.ReadUint32())
2124
2125 switch _experimenterstatsrequest.Experimenter {
2126 case 8992:
2127 return DecodeNiciraFlowStatsRequest(_experimenterstatsrequest, decoder)
2128 case 6035143:
2129 return DecodeBsnStatsRequest(_experimenterstatsrequest, decoder)
2130 default:
2131 return nil, fmt.Errorf("Invalid type '%d' for 'ExperimenterStatsRequest'", _experimenterstatsrequest.Experimenter)
2132 }
2133}
2134
2135func NewExperimenterStatsRequest(_experimenter uint32) *ExperimenterStatsRequest {
2136 obj := &ExperimenterStatsRequest{
2137 StatsRequest: NewStatsRequest(65535),
2138 }
2139 obj.Experimenter = _experimenter
2140 return obj
2141}
2142
2143type BsnStatsRequest struct {
2144 *ExperimenterStatsRequest
2145}
2146
2147type IBsnStatsRequest interface {
2148 IExperimenterStatsRequest
2149}
2150
2151func (self *BsnStatsRequest) Serialize(encoder *goloxi.Encoder) error {
2152 if err := self.ExperimenterStatsRequest.Serialize(encoder); err != nil {
2153 return err
2154 }
2155
2156 return nil
2157}
2158
2159func DecodeBsnStatsRequest(parent *ExperimenterStatsRequest, decoder *goloxi.Decoder) (IBsnStatsRequest, error) {
2160 _bsnstatsrequest := &BsnStatsRequest{ExperimenterStatsRequest: parent}
2161
2162 switch _bsnstatsrequest.Subtype {
2163 case 1:
2164 return DecodeBsnLacpStatsRequest(_bsnstatsrequest, decoder)
2165 case 2:
2166 return DecodeBsnGentableEntryDescStatsRequest(_bsnstatsrequest, decoder)
2167 case 3:
2168 return DecodeBsnGentableEntryStatsRequest(_bsnstatsrequest, decoder)
2169 case 4:
2170 return DecodeBsnGentableDescStatsRequest(_bsnstatsrequest, decoder)
2171 case 5:
2172 return DecodeBsnGentableBucketStatsRequest(_bsnstatsrequest, decoder)
2173 case 6:
2174 return DecodeBsnSwitchPipelineStatsRequest(_bsnstatsrequest, decoder)
2175 case 7:
2176 return DecodeBsnGentableStatsRequest(_bsnstatsrequest, decoder)
2177 case 8:
2178 return DecodeBsnPortCounterStatsRequest(_bsnstatsrequest, decoder)
2179 case 9:
2180 return DecodeBsnVlanCounterStatsRequest(_bsnstatsrequest, decoder)
2181 case 10:
2182 return DecodeBsnFlowChecksumBucketStatsRequest(_bsnstatsrequest, decoder)
2183 case 11:
2184 return DecodeBsnTableChecksumStatsRequest(_bsnstatsrequest, decoder)
2185 case 12:
2186 return DecodeBsnDebugCounterStatsRequest(_bsnstatsrequest, decoder)
2187 case 13:
2188 return DecodeBsnDebugCounterDescStatsRequest(_bsnstatsrequest, decoder)
2189 case 14:
2190 return DecodeBsnImageDescStatsRequest(_bsnstatsrequest, decoder)
2191 case 15:
2192 return DecodeBsnVrfCounterStatsRequest(_bsnstatsrequest, decoder)
2193 case 16:
2194 return DecodeBsnGenericStatsRequest(_bsnstatsrequest, decoder)
2195 default:
2196 return nil, fmt.Errorf("Invalid type '%d' for 'BsnStatsRequest'", _bsnstatsrequest.Subtype)
2197 }
2198}
2199
2200func NewBsnStatsRequest(_subtype uint32) *BsnStatsRequest {
2201 obj := &BsnStatsRequest{
2202 ExperimenterStatsRequest: NewExperimenterStatsRequest(6035143),
2203 }
2204 obj.Subtype = _subtype
2205 return obj
2206}
2207
2208type BsnDebugCounterDescStatsRequest struct {
2209 *BsnStatsRequest
2210}
2211
2212type IBsnDebugCounterDescStatsRequest interface {
2213 IBsnStatsRequest
2214}
2215
2216func (self *BsnDebugCounterDescStatsRequest) Serialize(encoder *goloxi.Encoder) error {
2217 if err := self.BsnStatsRequest.Serialize(encoder); err != nil {
2218 return err
2219 }
2220
2221 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
2222
2223 return nil
2224}
2225
2226func DecodeBsnDebugCounterDescStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnDebugCounterDescStatsRequest, error) {
2227 _bsndebugcounterdescstatsrequest := &BsnDebugCounterDescStatsRequest{BsnStatsRequest: parent}
2228 return _bsndebugcounterdescstatsrequest, nil
2229}
2230
2231func NewBsnDebugCounterDescStatsRequest() *BsnDebugCounterDescStatsRequest {
2232 obj := &BsnDebugCounterDescStatsRequest{
2233 BsnStatsRequest: NewBsnStatsRequest(13),
2234 }
2235 return obj
2236}
2237
2238type BsnDebugCounterStatsReply struct {
2239 *BsnStatsReply
2240 Entries []*BsnDebugCounterStatsEntry
2241}
2242
2243type IBsnDebugCounterStatsReply interface {
2244 IBsnStatsReply
2245 GetEntries() []*BsnDebugCounterStatsEntry
2246}
2247
2248func (self *BsnDebugCounterStatsReply) GetEntries() []*BsnDebugCounterStatsEntry {
2249 return self.Entries
2250}
2251
2252func (self *BsnDebugCounterStatsReply) SetEntries(v []*BsnDebugCounterStatsEntry) {
2253 self.Entries = v
2254}
2255
2256func (self *BsnDebugCounterStatsReply) Serialize(encoder *goloxi.Encoder) error {
2257 if err := self.BsnStatsReply.Serialize(encoder); err != nil {
2258 return err
2259 }
2260
2261 for _, obj := range self.Entries {
2262 if err := obj.Serialize(encoder); err != nil {
2263 return err
2264 }
2265 }
2266
2267 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
2268
2269 return nil
2270}
2271
2272func DecodeBsnDebugCounterStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnDebugCounterStatsReply, error) {
2273 _bsndebugcounterstatsreply := &BsnDebugCounterStatsReply{BsnStatsReply: parent}
2274
2275 for decoder.Length() >= 16 {
2276 item, err := DecodeBsnDebugCounterStatsEntry(decoder)
2277 if err != nil {
2278 return nil, err
2279 }
2280 if item != nil {
2281 _bsndebugcounterstatsreply.Entries = append(_bsndebugcounterstatsreply.Entries, item)
2282 }
2283 }
2284 return _bsndebugcounterstatsreply, nil
2285}
2286
2287func NewBsnDebugCounterStatsReply() *BsnDebugCounterStatsReply {
2288 obj := &BsnDebugCounterStatsReply{
2289 BsnStatsReply: NewBsnStatsReply(12),
2290 }
2291 return obj
2292}
2293
2294type BsnDebugCounterStatsRequest struct {
2295 *BsnStatsRequest
2296}
2297
2298type IBsnDebugCounterStatsRequest interface {
2299 IBsnStatsRequest
2300}
2301
2302func (self *BsnDebugCounterStatsRequest) Serialize(encoder *goloxi.Encoder) error {
2303 if err := self.BsnStatsRequest.Serialize(encoder); err != nil {
2304 return err
2305 }
2306
2307 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
2308
2309 return nil
2310}
2311
2312func DecodeBsnDebugCounterStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnDebugCounterStatsRequest, error) {
2313 _bsndebugcounterstatsrequest := &BsnDebugCounterStatsRequest{BsnStatsRequest: parent}
2314 return _bsndebugcounterstatsrequest, nil
2315}
2316
2317func NewBsnDebugCounterStatsRequest() *BsnDebugCounterStatsRequest {
2318 obj := &BsnDebugCounterStatsRequest{
2319 BsnStatsRequest: NewBsnStatsRequest(12),
2320 }
2321 return obj
2322}
2323
2324type BsnError struct {
2325 *BsnBaseError
2326}
2327
2328type IBsnError interface {
2329 IBsnBaseError
2330}
2331
2332func (self *BsnError) Serialize(encoder *goloxi.Encoder) error {
2333 if err := self.BsnBaseError.Serialize(encoder); err != nil {
2334 return err
2335 }
2336
2337 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
2338
2339 return nil
2340}
2341
2342func DecodeBsnError(parent *BsnBaseError, decoder *goloxi.Decoder) (*BsnError, error) {
2343 _bsnerror := &BsnError{BsnBaseError: parent}
2344 return _bsnerror, nil
2345}
2346
2347func NewBsnError() *BsnError {
2348 obj := &BsnError{
2349 BsnBaseError: NewBsnBaseError(1),
2350 }
2351 return obj
2352}
2353
2354type BsnFlowChecksumBucketStatsReply struct {
2355 *BsnStatsReply
2356 Entries []*BsnFlowChecksumBucketStatsEntry
2357}
2358
2359type IBsnFlowChecksumBucketStatsReply interface {
2360 IBsnStatsReply
2361 GetEntries() []*BsnFlowChecksumBucketStatsEntry
2362}
2363
2364func (self *BsnFlowChecksumBucketStatsReply) GetEntries() []*BsnFlowChecksumBucketStatsEntry {
2365 return self.Entries
2366}
2367
2368func (self *BsnFlowChecksumBucketStatsReply) SetEntries(v []*BsnFlowChecksumBucketStatsEntry) {
2369 self.Entries = v
2370}
2371
2372func (self *BsnFlowChecksumBucketStatsReply) Serialize(encoder *goloxi.Encoder) error {
2373 if err := self.BsnStatsReply.Serialize(encoder); err != nil {
2374 return err
2375 }
2376
2377 for _, obj := range self.Entries {
2378 if err := obj.Serialize(encoder); err != nil {
2379 return err
2380 }
2381 }
2382
2383 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
2384
2385 return nil
2386}
2387
2388func DecodeBsnFlowChecksumBucketStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnFlowChecksumBucketStatsReply, error) {
2389 _bsnflowchecksumbucketstatsreply := &BsnFlowChecksumBucketStatsReply{BsnStatsReply: parent}
2390
2391 for decoder.Length() >= 8 {
2392 item, err := DecodeBsnFlowChecksumBucketStatsEntry(decoder)
2393 if err != nil {
2394 return nil, err
2395 }
2396 if item != nil {
2397 _bsnflowchecksumbucketstatsreply.Entries = append(_bsnflowchecksumbucketstatsreply.Entries, item)
2398 }
2399 }
2400 return _bsnflowchecksumbucketstatsreply, nil
2401}
2402
2403func NewBsnFlowChecksumBucketStatsReply() *BsnFlowChecksumBucketStatsReply {
2404 obj := &BsnFlowChecksumBucketStatsReply{
2405 BsnStatsReply: NewBsnStatsReply(10),
2406 }
2407 return obj
2408}
2409
2410type BsnFlowChecksumBucketStatsRequest struct {
2411 *BsnStatsRequest
2412 TableId uint8
2413}
2414
2415type IBsnFlowChecksumBucketStatsRequest interface {
2416 IBsnStatsRequest
2417 GetTableId() uint8
2418}
2419
2420func (self *BsnFlowChecksumBucketStatsRequest) GetTableId() uint8 {
2421 return self.TableId
2422}
2423
2424func (self *BsnFlowChecksumBucketStatsRequest) SetTableId(v uint8) {
2425 self.TableId = v
2426}
2427
2428func (self *BsnFlowChecksumBucketStatsRequest) Serialize(encoder *goloxi.Encoder) error {
2429 if err := self.BsnStatsRequest.Serialize(encoder); err != nil {
2430 return err
2431 }
2432
2433 encoder.PutUint8(uint8(self.TableId))
2434
2435 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
2436
2437 return nil
2438}
2439
2440func DecodeBsnFlowChecksumBucketStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnFlowChecksumBucketStatsRequest, error) {
2441 _bsnflowchecksumbucketstatsrequest := &BsnFlowChecksumBucketStatsRequest{BsnStatsRequest: parent}
2442 if decoder.Length() < 1 {
2443 return nil, fmt.Errorf("BsnFlowChecksumBucketStatsRequest packet too short: %d < 1", decoder.Length())
2444 }
2445 _bsnflowchecksumbucketstatsrequest.TableId = uint8(decoder.ReadByte())
2446 return _bsnflowchecksumbucketstatsrequest, nil
2447}
2448
2449func NewBsnFlowChecksumBucketStatsRequest() *BsnFlowChecksumBucketStatsRequest {
2450 obj := &BsnFlowChecksumBucketStatsRequest{
2451 BsnStatsRequest: NewBsnStatsRequest(10),
2452 }
2453 return obj
2454}
2455
2456type BsnFlowIdle struct {
2457 *BsnHeader
2458 Cookie uint64
2459 Priority uint16
2460 TableId uint8
2461 Match Match
2462}
2463
2464type IBsnFlowIdle interface {
2465 IBsnHeader
2466 GetCookie() uint64
2467 GetPriority() uint16
2468 GetTableId() uint8
2469 GetMatch() Match
2470}
2471
2472func (self *BsnFlowIdle) GetCookie() uint64 {
2473 return self.Cookie
2474}
2475
2476func (self *BsnFlowIdle) SetCookie(v uint64) {
2477 self.Cookie = v
2478}
2479
2480func (self *BsnFlowIdle) GetPriority() uint16 {
2481 return self.Priority
2482}
2483
2484func (self *BsnFlowIdle) SetPriority(v uint16) {
2485 self.Priority = v
2486}
2487
2488func (self *BsnFlowIdle) GetTableId() uint8 {
2489 return self.TableId
2490}
2491
2492func (self *BsnFlowIdle) SetTableId(v uint8) {
2493 self.TableId = v
2494}
2495
2496func (self *BsnFlowIdle) GetMatch() Match {
2497 return self.Match
2498}
2499
2500func (self *BsnFlowIdle) SetMatch(v Match) {
2501 self.Match = v
2502}
2503
2504func (self *BsnFlowIdle) Serialize(encoder *goloxi.Encoder) error {
2505 if err := self.BsnHeader.Serialize(encoder); err != nil {
2506 return err
2507 }
2508
2509 encoder.PutUint64(uint64(self.Cookie))
2510 encoder.PutUint16(uint16(self.Priority))
2511 encoder.PutUint8(uint8(self.TableId))
2512 encoder.Write(bytes.Repeat([]byte{0}, 5))
2513 if err := self.Match.Serialize(encoder); err != nil {
2514 return err
2515 }
2516
2517 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
2518
2519 return nil
2520}
2521
2522func DecodeBsnFlowIdle(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnFlowIdle, error) {
2523 _bsnflowidle := &BsnFlowIdle{BsnHeader: parent}
2524 if decoder.Length() < 24 {
2525 return nil, fmt.Errorf("BsnFlowIdle packet too short: %d < 24", decoder.Length())
2526 }
2527 _bsnflowidle.Cookie = uint64(decoder.ReadUint64())
2528 _bsnflowidle.Priority = uint16(decoder.ReadUint16())
2529 _bsnflowidle.TableId = uint8(decoder.ReadByte())
2530 decoder.Skip(5)
2531 if err := _bsnflowidle.Match.Decode(decoder); err != nil {
2532 return nil, err
2533 }
2534
2535 decoder.SkipAlign()
2536 return _bsnflowidle, nil
2537}
2538
2539func NewBsnFlowIdle() *BsnFlowIdle {
2540 obj := &BsnFlowIdle{
2541 BsnHeader: NewBsnHeader(40),
2542 }
2543 return obj
2544}
2545
2546type BsnFlowIdleEnableGetReply struct {
2547 *BsnHeader
2548 Enabled uint32
2549}
2550
2551type IBsnFlowIdleEnableGetReply interface {
2552 IBsnHeader
2553 GetEnabled() uint32
2554}
2555
2556func (self *BsnFlowIdleEnableGetReply) GetEnabled() uint32 {
2557 return self.Enabled
2558}
2559
2560func (self *BsnFlowIdleEnableGetReply) SetEnabled(v uint32) {
2561 self.Enabled = v
2562}
2563
2564func (self *BsnFlowIdleEnableGetReply) Serialize(encoder *goloxi.Encoder) error {
2565 if err := self.BsnHeader.Serialize(encoder); err != nil {
2566 return err
2567 }
2568
2569 encoder.PutUint32(uint32(self.Enabled))
2570
2571 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
2572
2573 return nil
2574}
2575
2576func DecodeBsnFlowIdleEnableGetReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnFlowIdleEnableGetReply, error) {
2577 _bsnflowidleenablegetreply := &BsnFlowIdleEnableGetReply{BsnHeader: parent}
2578 if decoder.Length() < 4 {
2579 return nil, fmt.Errorf("BsnFlowIdleEnableGetReply packet too short: %d < 4", decoder.Length())
2580 }
2581 _bsnflowidleenablegetreply.Enabled = uint32(decoder.ReadUint32())
2582 return _bsnflowidleenablegetreply, nil
2583}
2584
2585func NewBsnFlowIdleEnableGetReply() *BsnFlowIdleEnableGetReply {
2586 obj := &BsnFlowIdleEnableGetReply{
2587 BsnHeader: NewBsnHeader(39),
2588 }
2589 return obj
2590}
2591
2592type BsnFlowIdleEnableGetRequest struct {
2593 *BsnHeader
2594}
2595
2596type IBsnFlowIdleEnableGetRequest interface {
2597 IBsnHeader
2598}
2599
2600func (self *BsnFlowIdleEnableGetRequest) Serialize(encoder *goloxi.Encoder) error {
2601 if err := self.BsnHeader.Serialize(encoder); err != nil {
2602 return err
2603 }
2604
2605 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
2606
2607 return nil
2608}
2609
2610func DecodeBsnFlowIdleEnableGetRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnFlowIdleEnableGetRequest, error) {
2611 _bsnflowidleenablegetrequest := &BsnFlowIdleEnableGetRequest{BsnHeader: parent}
2612 return _bsnflowidleenablegetrequest, nil
2613}
2614
2615func NewBsnFlowIdleEnableGetRequest() *BsnFlowIdleEnableGetRequest {
2616 obj := &BsnFlowIdleEnableGetRequest{
2617 BsnHeader: NewBsnHeader(38),
2618 }
2619 return obj
2620}
2621
2622type BsnFlowIdleEnableSetReply struct {
2623 *BsnHeader
2624 Enable uint32
2625 Status uint32
2626}
2627
2628type IBsnFlowIdleEnableSetReply interface {
2629 IBsnHeader
2630 GetEnable() uint32
2631 GetStatus() uint32
2632}
2633
2634func (self *BsnFlowIdleEnableSetReply) GetEnable() uint32 {
2635 return self.Enable
2636}
2637
2638func (self *BsnFlowIdleEnableSetReply) SetEnable(v uint32) {
2639 self.Enable = v
2640}
2641
2642func (self *BsnFlowIdleEnableSetReply) GetStatus() uint32 {
2643 return self.Status
2644}
2645
2646func (self *BsnFlowIdleEnableSetReply) SetStatus(v uint32) {
2647 self.Status = v
2648}
2649
2650func (self *BsnFlowIdleEnableSetReply) Serialize(encoder *goloxi.Encoder) error {
2651 if err := self.BsnHeader.Serialize(encoder); err != nil {
2652 return err
2653 }
2654
2655 encoder.PutUint32(uint32(self.Enable))
2656 encoder.PutUint32(uint32(self.Status))
2657
2658 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
2659
2660 return nil
2661}
2662
2663func DecodeBsnFlowIdleEnableSetReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnFlowIdleEnableSetReply, error) {
2664 _bsnflowidleenablesetreply := &BsnFlowIdleEnableSetReply{BsnHeader: parent}
2665 if decoder.Length() < 8 {
2666 return nil, fmt.Errorf("BsnFlowIdleEnableSetReply packet too short: %d < 8", decoder.Length())
2667 }
2668 _bsnflowidleenablesetreply.Enable = uint32(decoder.ReadUint32())
2669 _bsnflowidleenablesetreply.Status = uint32(decoder.ReadUint32())
2670 return _bsnflowidleenablesetreply, nil
2671}
2672
2673func NewBsnFlowIdleEnableSetReply() *BsnFlowIdleEnableSetReply {
2674 obj := &BsnFlowIdleEnableSetReply{
2675 BsnHeader: NewBsnHeader(37),
2676 }
2677 return obj
2678}
2679
2680type BsnFlowIdleEnableSetRequest struct {
2681 *BsnHeader
2682 Enable uint32
2683}
2684
2685type IBsnFlowIdleEnableSetRequest interface {
2686 IBsnHeader
2687 GetEnable() uint32
2688}
2689
2690func (self *BsnFlowIdleEnableSetRequest) GetEnable() uint32 {
2691 return self.Enable
2692}
2693
2694func (self *BsnFlowIdleEnableSetRequest) SetEnable(v uint32) {
2695 self.Enable = v
2696}
2697
2698func (self *BsnFlowIdleEnableSetRequest) Serialize(encoder *goloxi.Encoder) error {
2699 if err := self.BsnHeader.Serialize(encoder); err != nil {
2700 return err
2701 }
2702
2703 encoder.PutUint32(uint32(self.Enable))
2704
2705 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
2706
2707 return nil
2708}
2709
2710func DecodeBsnFlowIdleEnableSetRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnFlowIdleEnableSetRequest, error) {
2711 _bsnflowidleenablesetrequest := &BsnFlowIdleEnableSetRequest{BsnHeader: parent}
2712 if decoder.Length() < 4 {
2713 return nil, fmt.Errorf("BsnFlowIdleEnableSetRequest packet too short: %d < 4", decoder.Length())
2714 }
2715 _bsnflowidleenablesetrequest.Enable = uint32(decoder.ReadUint32())
2716 return _bsnflowidleenablesetrequest, nil
2717}
2718
2719func NewBsnFlowIdleEnableSetRequest() *BsnFlowIdleEnableSetRequest {
2720 obj := &BsnFlowIdleEnableSetRequest{
2721 BsnHeader: NewBsnHeader(36),
2722 }
2723 return obj
2724}
2725
2726type BsnGenericStatsReply struct {
2727 *BsnStatsReply
2728 Entries []*BsnGenericStatsEntry
2729}
2730
2731type IBsnGenericStatsReply interface {
2732 IBsnStatsReply
2733 GetEntries() []*BsnGenericStatsEntry
2734}
2735
2736func (self *BsnGenericStatsReply) GetEntries() []*BsnGenericStatsEntry {
2737 return self.Entries
2738}
2739
2740func (self *BsnGenericStatsReply) SetEntries(v []*BsnGenericStatsEntry) {
2741 self.Entries = v
2742}
2743
2744func (self *BsnGenericStatsReply) Serialize(encoder *goloxi.Encoder) error {
2745 if err := self.BsnStatsReply.Serialize(encoder); err != nil {
2746 return err
2747 }
2748
2749 for _, obj := range self.Entries {
2750 if err := obj.Serialize(encoder); err != nil {
2751 return err
2752 }
2753 }
2754
2755 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
2756
2757 return nil
2758}
2759
2760func DecodeBsnGenericStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnGenericStatsReply, error) {
2761 _bsngenericstatsreply := &BsnGenericStatsReply{BsnStatsReply: parent}
2762
2763 for decoder.Length() >= 2 {
2764 item, err := DecodeBsnGenericStatsEntry(decoder)
2765 if err != nil {
2766 return nil, err
2767 }
2768 if item != nil {
2769 _bsngenericstatsreply.Entries = append(_bsngenericstatsreply.Entries, item)
2770 }
2771 }
2772 return _bsngenericstatsreply, nil
2773}
2774
2775func NewBsnGenericStatsReply() *BsnGenericStatsReply {
2776 obj := &BsnGenericStatsReply{
2777 BsnStatsReply: NewBsnStatsReply(16),
2778 }
2779 return obj
2780}
2781
2782type BsnGenericStatsRequest struct {
2783 *BsnStatsRequest
2784 Name string
2785 Tlvs []IBsnTlv
2786}
2787
2788type IBsnGenericStatsRequest interface {
2789 IBsnStatsRequest
2790 GetName() string
2791 GetTlvs() []IBsnTlv
2792}
2793
2794func (self *BsnGenericStatsRequest) GetName() string {
2795 return self.Name
2796}
2797
2798func (self *BsnGenericStatsRequest) SetName(v string) {
2799 self.Name = v
2800}
2801
2802func (self *BsnGenericStatsRequest) GetTlvs() []IBsnTlv {
2803 return self.Tlvs
2804}
2805
2806func (self *BsnGenericStatsRequest) SetTlvs(v []IBsnTlv) {
2807 self.Tlvs = v
2808}
2809
2810func (self *BsnGenericStatsRequest) Serialize(encoder *goloxi.Encoder) error {
2811 if err := self.BsnStatsRequest.Serialize(encoder); err != nil {
2812 return err
2813 }
2814
2815 encoder.Write([]byte(self.Name))
2816 for _, obj := range self.Tlvs {
2817 if err := obj.Serialize(encoder); err != nil {
2818 return err
2819 }
2820 }
2821
2822 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
2823
2824 return nil
2825}
2826
2827func DecodeBsnGenericStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnGenericStatsRequest, error) {
2828 _bsngenericstatsrequest := &BsnGenericStatsRequest{BsnStatsRequest: parent}
2829 if decoder.Length() < 64 {
2830 return nil, fmt.Errorf("BsnGenericStatsRequest packet too short: %d < 64", decoder.Length())
2831 }
2832 _bsngenericstatsrequest.Name = string(bytes.Trim(decoder.Read(64), "\x00"))
2833
2834 for decoder.Length() >= 4 {
2835 item, err := DecodeBsnTlv(decoder)
2836 if err != nil {
2837 return nil, err
2838 }
2839 if item != nil {
2840 _bsngenericstatsrequest.Tlvs = append(_bsngenericstatsrequest.Tlvs, item)
2841 }
2842 }
2843 return _bsngenericstatsrequest, nil
2844}
2845
2846func NewBsnGenericStatsRequest() *BsnGenericStatsRequest {
2847 obj := &BsnGenericStatsRequest{
2848 BsnStatsRequest: NewBsnStatsRequest(16),
2849 }
2850 return obj
2851}
2852
2853type BsnGentableBucketStatsReply struct {
2854 *BsnStatsReply
2855 Entries []*BsnGentableBucketStatsEntry
2856}
2857
2858type IBsnGentableBucketStatsReply interface {
2859 IBsnStatsReply
2860 GetEntries() []*BsnGentableBucketStatsEntry
2861}
2862
2863func (self *BsnGentableBucketStatsReply) GetEntries() []*BsnGentableBucketStatsEntry {
2864 return self.Entries
2865}
2866
2867func (self *BsnGentableBucketStatsReply) SetEntries(v []*BsnGentableBucketStatsEntry) {
2868 self.Entries = v
2869}
2870
2871func (self *BsnGentableBucketStatsReply) Serialize(encoder *goloxi.Encoder) error {
2872 if err := self.BsnStatsReply.Serialize(encoder); err != nil {
2873 return err
2874 }
2875
2876 for _, obj := range self.Entries {
2877 if err := obj.Serialize(encoder); err != nil {
2878 return err
2879 }
2880 }
2881
2882 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
2883
2884 return nil
2885}
2886
2887func DecodeBsnGentableBucketStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnGentableBucketStatsReply, error) {
2888 _bsngentablebucketstatsreply := &BsnGentableBucketStatsReply{BsnStatsReply: parent}
2889
2890 for decoder.Length() >= 16 {
2891 item, err := DecodeBsnGentableBucketStatsEntry(decoder)
2892 if err != nil {
2893 return nil, err
2894 }
2895 if item != nil {
2896 _bsngentablebucketstatsreply.Entries = append(_bsngentablebucketstatsreply.Entries, item)
2897 }
2898 }
2899 return _bsngentablebucketstatsreply, nil
2900}
2901
2902func NewBsnGentableBucketStatsReply() *BsnGentableBucketStatsReply {
2903 obj := &BsnGentableBucketStatsReply{
2904 BsnStatsReply: NewBsnStatsReply(5),
2905 }
2906 return obj
2907}
2908
2909type BsnGentableBucketStatsRequest struct {
2910 *BsnStatsRequest
2911 TableId uint16
2912}
2913
2914type IBsnGentableBucketStatsRequest interface {
2915 IBsnStatsRequest
2916 GetTableId() uint16
2917}
2918
2919func (self *BsnGentableBucketStatsRequest) GetTableId() uint16 {
2920 return self.TableId
2921}
2922
2923func (self *BsnGentableBucketStatsRequest) SetTableId(v uint16) {
2924 self.TableId = v
2925}
2926
2927func (self *BsnGentableBucketStatsRequest) Serialize(encoder *goloxi.Encoder) error {
2928 if err := self.BsnStatsRequest.Serialize(encoder); err != nil {
2929 return err
2930 }
2931
2932 encoder.PutUint16(uint16(self.TableId))
2933
2934 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
2935
2936 return nil
2937}
2938
2939func DecodeBsnGentableBucketStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnGentableBucketStatsRequest, error) {
2940 _bsngentablebucketstatsrequest := &BsnGentableBucketStatsRequest{BsnStatsRequest: parent}
2941 if decoder.Length() < 2 {
2942 return nil, fmt.Errorf("BsnGentableBucketStatsRequest packet too short: %d < 2", decoder.Length())
2943 }
2944 _bsngentablebucketstatsrequest.TableId = uint16(decoder.ReadUint16())
2945 return _bsngentablebucketstatsrequest, nil
2946}
2947
2948func NewBsnGentableBucketStatsRequest() *BsnGentableBucketStatsRequest {
2949 obj := &BsnGentableBucketStatsRequest{
2950 BsnStatsRequest: NewBsnStatsRequest(5),
2951 }
2952 return obj
2953}
2954
2955type BsnGentableClearReply struct {
2956 *BsnHeader
2957 TableId uint16
2958 DeletedCount uint32
2959 ErrorCount uint32
2960}
2961
2962type IBsnGentableClearReply interface {
2963 IBsnHeader
2964 GetTableId() uint16
2965 GetDeletedCount() uint32
2966 GetErrorCount() uint32
2967}
2968
2969func (self *BsnGentableClearReply) GetTableId() uint16 {
2970 return self.TableId
2971}
2972
2973func (self *BsnGentableClearReply) SetTableId(v uint16) {
2974 self.TableId = v
2975}
2976
2977func (self *BsnGentableClearReply) GetDeletedCount() uint32 {
2978 return self.DeletedCount
2979}
2980
2981func (self *BsnGentableClearReply) SetDeletedCount(v uint32) {
2982 self.DeletedCount = v
2983}
2984
2985func (self *BsnGentableClearReply) GetErrorCount() uint32 {
2986 return self.ErrorCount
2987}
2988
2989func (self *BsnGentableClearReply) SetErrorCount(v uint32) {
2990 self.ErrorCount = v
2991}
2992
2993func (self *BsnGentableClearReply) Serialize(encoder *goloxi.Encoder) error {
2994 if err := self.BsnHeader.Serialize(encoder); err != nil {
2995 return err
2996 }
2997
2998 encoder.PutUint16(uint16(self.TableId))
2999 encoder.Write(bytes.Repeat([]byte{0}, 2))
3000 encoder.PutUint32(uint32(self.DeletedCount))
3001 encoder.PutUint32(uint32(self.ErrorCount))
3002
3003 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
3004
3005 return nil
3006}
3007
3008func DecodeBsnGentableClearReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnGentableClearReply, error) {
3009 _bsngentableclearreply := &BsnGentableClearReply{BsnHeader: parent}
3010 if decoder.Length() < 12 {
3011 return nil, fmt.Errorf("BsnGentableClearReply packet too short: %d < 12", decoder.Length())
3012 }
3013 _bsngentableclearreply.TableId = uint16(decoder.ReadUint16())
3014 decoder.Skip(2)
3015 _bsngentableclearreply.DeletedCount = uint32(decoder.ReadUint32())
3016 _bsngentableclearreply.ErrorCount = uint32(decoder.ReadUint32())
3017 return _bsngentableclearreply, nil
3018}
3019
3020func NewBsnGentableClearReply() *BsnGentableClearReply {
3021 obj := &BsnGentableClearReply{
3022 BsnHeader: NewBsnHeader(49),
3023 }
3024 return obj
3025}
3026
3027type BsnGentableClearRequest struct {
3028 *BsnHeader
3029 TableId uint16
3030 Checksum Checksum128
3031 ChecksumMask Checksum128
3032}
3033
3034type IBsnGentableClearRequest interface {
3035 IBsnHeader
3036 GetTableId() uint16
3037 GetChecksum() Checksum128
3038 GetChecksumMask() Checksum128
3039}
3040
3041func (self *BsnGentableClearRequest) GetTableId() uint16 {
3042 return self.TableId
3043}
3044
3045func (self *BsnGentableClearRequest) SetTableId(v uint16) {
3046 self.TableId = v
3047}
3048
3049func (self *BsnGentableClearRequest) GetChecksum() Checksum128 {
3050 return self.Checksum
3051}
3052
3053func (self *BsnGentableClearRequest) SetChecksum(v Checksum128) {
3054 self.Checksum = v
3055}
3056
3057func (self *BsnGentableClearRequest) GetChecksumMask() Checksum128 {
3058 return self.ChecksumMask
3059}
3060
3061func (self *BsnGentableClearRequest) SetChecksumMask(v Checksum128) {
3062 self.ChecksumMask = v
3063}
3064
3065func (self *BsnGentableClearRequest) Serialize(encoder *goloxi.Encoder) error {
3066 if err := self.BsnHeader.Serialize(encoder); err != nil {
3067 return err
3068 }
3069
3070 encoder.PutUint16(uint16(self.TableId))
3071 encoder.Write(bytes.Repeat([]byte{0}, 2))
3072 self.Checksum.Serialize(encoder)
3073 self.ChecksumMask.Serialize(encoder)
3074
3075 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
3076
3077 return nil
3078}
3079
3080func DecodeBsnGentableClearRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnGentableClearRequest, error) {
3081 _bsngentableclearrequest := &BsnGentableClearRequest{BsnHeader: parent}
3082 if decoder.Length() < 36 {
3083 return nil, fmt.Errorf("BsnGentableClearRequest packet too short: %d < 36", decoder.Length())
3084 }
3085 _bsngentableclearrequest.TableId = uint16(decoder.ReadUint16())
3086 decoder.Skip(2)
3087 _bsngentableclearrequest.Checksum.Decode(decoder)
3088 _bsngentableclearrequest.ChecksumMask.Decode(decoder)
3089 return _bsngentableclearrequest, nil
3090}
3091
3092func NewBsnGentableClearRequest() *BsnGentableClearRequest {
3093 obj := &BsnGentableClearRequest{
3094 BsnHeader: NewBsnHeader(48),
3095 }
3096 return obj
3097}
3098
3099type BsnGentableDescStatsReply struct {
3100 *BsnStatsReply
3101 Entries []*BsnGentableDescStatsEntry
3102}
3103
3104type IBsnGentableDescStatsReply interface {
3105 IBsnStatsReply
3106 GetEntries() []*BsnGentableDescStatsEntry
3107}
3108
3109func (self *BsnGentableDescStatsReply) GetEntries() []*BsnGentableDescStatsEntry {
3110 return self.Entries
3111}
3112
3113func (self *BsnGentableDescStatsReply) SetEntries(v []*BsnGentableDescStatsEntry) {
3114 self.Entries = v
3115}
3116
3117func (self *BsnGentableDescStatsReply) Serialize(encoder *goloxi.Encoder) error {
3118 if err := self.BsnStatsReply.Serialize(encoder); err != nil {
3119 return err
3120 }
3121
3122 for _, obj := range self.Entries {
3123 if err := obj.Serialize(encoder); err != nil {
3124 return err
3125 }
3126 }
3127
3128 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
3129
3130 return nil
3131}
3132
3133func DecodeBsnGentableDescStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnGentableDescStatsReply, error) {
3134 _bsngentabledescstatsreply := &BsnGentableDescStatsReply{BsnStatsReply: parent}
3135
3136 for decoder.Length() >= 48 {
3137 item, err := DecodeBsnGentableDescStatsEntry(decoder)
3138 if err != nil {
3139 return nil, err
3140 }
3141 if item != nil {
3142 _bsngentabledescstatsreply.Entries = append(_bsngentabledescstatsreply.Entries, item)
3143 }
3144 }
3145 return _bsngentabledescstatsreply, nil
3146}
3147
3148func NewBsnGentableDescStatsReply() *BsnGentableDescStatsReply {
3149 obj := &BsnGentableDescStatsReply{
3150 BsnStatsReply: NewBsnStatsReply(4),
3151 }
3152 return obj
3153}
3154
3155type BsnGentableDescStatsRequest struct {
3156 *BsnStatsRequest
3157}
3158
3159type IBsnGentableDescStatsRequest interface {
3160 IBsnStatsRequest
3161}
3162
3163func (self *BsnGentableDescStatsRequest) Serialize(encoder *goloxi.Encoder) error {
3164 if err := self.BsnStatsRequest.Serialize(encoder); err != nil {
3165 return err
3166 }
3167
3168 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
3169
3170 return nil
3171}
3172
3173func DecodeBsnGentableDescStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnGentableDescStatsRequest, error) {
3174 _bsngentabledescstatsrequest := &BsnGentableDescStatsRequest{BsnStatsRequest: parent}
3175 return _bsngentabledescstatsrequest, nil
3176}
3177
3178func NewBsnGentableDescStatsRequest() *BsnGentableDescStatsRequest {
3179 obj := &BsnGentableDescStatsRequest{
3180 BsnStatsRequest: NewBsnStatsRequest(4),
3181 }
3182 return obj
3183}
3184
3185type BsnGentableEntryAdd struct {
3186 *BsnHeader
3187 TableId uint16
3188 KeyLength uint16
3189 Checksum Checksum128
3190 Key []IBsnTlv
3191 Value []IBsnTlv
3192}
3193
3194type IBsnGentableEntryAdd interface {
3195 IBsnHeader
3196 GetTableId() uint16
3197 GetKeyLength() uint16
3198 GetChecksum() Checksum128
3199 GetKey() []IBsnTlv
3200 GetValue() []IBsnTlv
3201}
3202
3203func (self *BsnGentableEntryAdd) GetTableId() uint16 {
3204 return self.TableId
3205}
3206
3207func (self *BsnGentableEntryAdd) SetTableId(v uint16) {
3208 self.TableId = v
3209}
3210
3211func (self *BsnGentableEntryAdd) GetKeyLength() uint16 {
3212 return self.KeyLength
3213}
3214
3215func (self *BsnGentableEntryAdd) SetKeyLength(v uint16) {
3216 self.KeyLength = v
3217}
3218
3219func (self *BsnGentableEntryAdd) GetChecksum() Checksum128 {
3220 return self.Checksum
3221}
3222
3223func (self *BsnGentableEntryAdd) SetChecksum(v Checksum128) {
3224 self.Checksum = v
3225}
3226
3227func (self *BsnGentableEntryAdd) GetKey() []IBsnTlv {
3228 return self.Key
3229}
3230
3231func (self *BsnGentableEntryAdd) SetKey(v []IBsnTlv) {
3232 self.Key = v
3233}
3234
3235func (self *BsnGentableEntryAdd) GetValue() []IBsnTlv {
3236 return self.Value
3237}
3238
3239func (self *BsnGentableEntryAdd) SetValue(v []IBsnTlv) {
3240 self.Value = v
3241}
3242
3243func (self *BsnGentableEntryAdd) Serialize(encoder *goloxi.Encoder) error {
3244 if err := self.BsnHeader.Serialize(encoder); err != nil {
3245 return err
3246 }
3247
3248 encoder.PutUint16(uint16(self.TableId))
3249 encoder.PutUint16(uint16(self.KeyLength))
3250 self.Checksum.Serialize(encoder)
3251 for _, obj := range self.Key {
3252 if err := obj.Serialize(encoder); err != nil {
3253 return err
3254 }
3255 }
3256 for _, obj := range self.Value {
3257 if err := obj.Serialize(encoder); err != nil {
3258 return err
3259 }
3260 }
3261
3262 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
3263
3264 return nil
3265}
3266
3267func DecodeBsnGentableEntryAdd(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnGentableEntryAdd, error) {
3268 _bsngentableentryadd := &BsnGentableEntryAdd{BsnHeader: parent}
3269 if decoder.Length() < 20 {
3270 return nil, fmt.Errorf("BsnGentableEntryAdd packet too short: %d < 20", decoder.Length())
3271 }
3272 _bsngentableentryadd.TableId = uint16(decoder.ReadUint16())
3273 _bsngentableentryadd.KeyLength = uint16(decoder.ReadUint16())
3274 _bsngentableentryadd.Checksum.Decode(decoder)
3275
3276 for i := 0; i < int(_bsngentableentryadd.KeyLength); i++ {
3277 item, err := DecodeBsnTlv(decoder)
3278 if err != nil {
3279 return nil, err
3280 }
3281 if item != nil {
3282 _bsngentableentryadd.Key = append(_bsngentableentryadd.Key, item)
3283 }
3284 }
3285
3286 for decoder.Length() >= 4 {
3287 item, err := DecodeBsnTlv(decoder)
3288 if err != nil {
3289 return nil, err
3290 }
3291 if item != nil {
3292 _bsngentableentryadd.Value = append(_bsngentableentryadd.Value, item)
3293 }
3294 }
3295 return _bsngentableentryadd, nil
3296}
3297
3298func NewBsnGentableEntryAdd() *BsnGentableEntryAdd {
3299 obj := &BsnGentableEntryAdd{
3300 BsnHeader: NewBsnHeader(46),
3301 }
3302 return obj
3303}
3304
3305type BsnGentableEntryDelete struct {
3306 *BsnHeader
3307 TableId uint16
3308 Key []IBsnTlv
3309}
3310
3311type IBsnGentableEntryDelete interface {
3312 IBsnHeader
3313 GetTableId() uint16
3314 GetKey() []IBsnTlv
3315}
3316
3317func (self *BsnGentableEntryDelete) GetTableId() uint16 {
3318 return self.TableId
3319}
3320
3321func (self *BsnGentableEntryDelete) SetTableId(v uint16) {
3322 self.TableId = v
3323}
3324
3325func (self *BsnGentableEntryDelete) GetKey() []IBsnTlv {
3326 return self.Key
3327}
3328
3329func (self *BsnGentableEntryDelete) SetKey(v []IBsnTlv) {
3330 self.Key = v
3331}
3332
3333func (self *BsnGentableEntryDelete) Serialize(encoder *goloxi.Encoder) error {
3334 if err := self.BsnHeader.Serialize(encoder); err != nil {
3335 return err
3336 }
3337
3338 encoder.PutUint16(uint16(self.TableId))
3339 for _, obj := range self.Key {
3340 if err := obj.Serialize(encoder); err != nil {
3341 return err
3342 }
3343 }
3344
3345 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
3346
3347 return nil
3348}
3349
3350func DecodeBsnGentableEntryDelete(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnGentableEntryDelete, error) {
3351 _bsngentableentrydelete := &BsnGentableEntryDelete{BsnHeader: parent}
3352 if decoder.Length() < 2 {
3353 return nil, fmt.Errorf("BsnGentableEntryDelete packet too short: %d < 2", decoder.Length())
3354 }
3355 _bsngentableentrydelete.TableId = uint16(decoder.ReadUint16())
3356
3357 for decoder.Length() >= 4 {
3358 item, err := DecodeBsnTlv(decoder)
3359 if err != nil {
3360 return nil, err
3361 }
3362 if item != nil {
3363 _bsngentableentrydelete.Key = append(_bsngentableentrydelete.Key, item)
3364 }
3365 }
3366 return _bsngentableentrydelete, nil
3367}
3368
3369func NewBsnGentableEntryDelete() *BsnGentableEntryDelete {
3370 obj := &BsnGentableEntryDelete{
3371 BsnHeader: NewBsnHeader(47),
3372 }
3373 return obj
3374}
3375
3376type BsnGentableEntryDescStatsReply struct {
3377 *BsnStatsReply
3378 Entries []*BsnGentableEntryDescStatsEntry
3379}
3380
3381type IBsnGentableEntryDescStatsReply interface {
3382 IBsnStatsReply
3383 GetEntries() []*BsnGentableEntryDescStatsEntry
3384}
3385
3386func (self *BsnGentableEntryDescStatsReply) GetEntries() []*BsnGentableEntryDescStatsEntry {
3387 return self.Entries
3388}
3389
3390func (self *BsnGentableEntryDescStatsReply) SetEntries(v []*BsnGentableEntryDescStatsEntry) {
3391 self.Entries = v
3392}
3393
3394func (self *BsnGentableEntryDescStatsReply) Serialize(encoder *goloxi.Encoder) error {
3395 if err := self.BsnStatsReply.Serialize(encoder); err != nil {
3396 return err
3397 }
3398
3399 for _, obj := range self.Entries {
3400 if err := obj.Serialize(encoder); err != nil {
3401 return err
3402 }
3403 }
3404
3405 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
3406
3407 return nil
3408}
3409
3410func DecodeBsnGentableEntryDescStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnGentableEntryDescStatsReply, error) {
3411 _bsngentableentrydescstatsreply := &BsnGentableEntryDescStatsReply{BsnStatsReply: parent}
3412
3413 for decoder.Length() >= 20 {
3414 item, err := DecodeBsnGentableEntryDescStatsEntry(decoder)
3415 if err != nil {
3416 return nil, err
3417 }
3418 if item != nil {
3419 _bsngentableentrydescstatsreply.Entries = append(_bsngentableentrydescstatsreply.Entries, item)
3420 }
3421 }
3422 return _bsngentableentrydescstatsreply, nil
3423}
3424
3425func NewBsnGentableEntryDescStatsReply() *BsnGentableEntryDescStatsReply {
3426 obj := &BsnGentableEntryDescStatsReply{
3427 BsnStatsReply: NewBsnStatsReply(2),
3428 }
3429 return obj
3430}
3431
3432type BsnGentableEntryDescStatsRequest struct {
3433 *BsnStatsRequest
3434 TableId uint16
3435 Checksum Checksum128
3436 ChecksumMask Checksum128
3437}
3438
3439type IBsnGentableEntryDescStatsRequest interface {
3440 IBsnStatsRequest
3441 GetTableId() uint16
3442 GetChecksum() Checksum128
3443 GetChecksumMask() Checksum128
3444}
3445
3446func (self *BsnGentableEntryDescStatsRequest) GetTableId() uint16 {
3447 return self.TableId
3448}
3449
3450func (self *BsnGentableEntryDescStatsRequest) SetTableId(v uint16) {
3451 self.TableId = v
3452}
3453
3454func (self *BsnGentableEntryDescStatsRequest) GetChecksum() Checksum128 {
3455 return self.Checksum
3456}
3457
3458func (self *BsnGentableEntryDescStatsRequest) SetChecksum(v Checksum128) {
3459 self.Checksum = v
3460}
3461
3462func (self *BsnGentableEntryDescStatsRequest) GetChecksumMask() Checksum128 {
3463 return self.ChecksumMask
3464}
3465
3466func (self *BsnGentableEntryDescStatsRequest) SetChecksumMask(v Checksum128) {
3467 self.ChecksumMask = v
3468}
3469
3470func (self *BsnGentableEntryDescStatsRequest) Serialize(encoder *goloxi.Encoder) error {
3471 if err := self.BsnStatsRequest.Serialize(encoder); err != nil {
3472 return err
3473 }
3474
3475 encoder.PutUint16(uint16(self.TableId))
3476 encoder.Write(bytes.Repeat([]byte{0}, 2))
3477 self.Checksum.Serialize(encoder)
3478 self.ChecksumMask.Serialize(encoder)
3479
3480 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
3481
3482 return nil
3483}
3484
3485func DecodeBsnGentableEntryDescStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnGentableEntryDescStatsRequest, error) {
3486 _bsngentableentrydescstatsrequest := &BsnGentableEntryDescStatsRequest{BsnStatsRequest: parent}
3487 if decoder.Length() < 36 {
3488 return nil, fmt.Errorf("BsnGentableEntryDescStatsRequest packet too short: %d < 36", decoder.Length())
3489 }
3490 _bsngentableentrydescstatsrequest.TableId = uint16(decoder.ReadUint16())
3491 decoder.Skip(2)
3492 _bsngentableentrydescstatsrequest.Checksum.Decode(decoder)
3493 _bsngentableentrydescstatsrequest.ChecksumMask.Decode(decoder)
3494 return _bsngentableentrydescstatsrequest, nil
3495}
3496
3497func NewBsnGentableEntryDescStatsRequest() *BsnGentableEntryDescStatsRequest {
3498 obj := &BsnGentableEntryDescStatsRequest{
3499 BsnStatsRequest: NewBsnStatsRequest(2),
3500 }
3501 return obj
3502}
3503
3504type BsnGentableEntryStatsReply struct {
3505 *BsnStatsReply
3506 Entries []*BsnGentableEntryStatsEntry
3507}
3508
3509type IBsnGentableEntryStatsReply interface {
3510 IBsnStatsReply
3511 GetEntries() []*BsnGentableEntryStatsEntry
3512}
3513
3514func (self *BsnGentableEntryStatsReply) GetEntries() []*BsnGentableEntryStatsEntry {
3515 return self.Entries
3516}
3517
3518func (self *BsnGentableEntryStatsReply) SetEntries(v []*BsnGentableEntryStatsEntry) {
3519 self.Entries = v
3520}
3521
3522func (self *BsnGentableEntryStatsReply) Serialize(encoder *goloxi.Encoder) error {
3523 if err := self.BsnStatsReply.Serialize(encoder); err != nil {
3524 return err
3525 }
3526
3527 for _, obj := range self.Entries {
3528 if err := obj.Serialize(encoder); err != nil {
3529 return err
3530 }
3531 }
3532
3533 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
3534
3535 return nil
3536}
3537
3538func DecodeBsnGentableEntryStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnGentableEntryStatsReply, error) {
3539 _bsngentableentrystatsreply := &BsnGentableEntryStatsReply{BsnStatsReply: parent}
3540
3541 for decoder.Length() >= 4 {
3542 item, err := DecodeBsnGentableEntryStatsEntry(decoder)
3543 if err != nil {
3544 return nil, err
3545 }
3546 if item != nil {
3547 _bsngentableentrystatsreply.Entries = append(_bsngentableentrystatsreply.Entries, item)
3548 }
3549 }
3550 return _bsngentableentrystatsreply, nil
3551}
3552
3553func NewBsnGentableEntryStatsReply() *BsnGentableEntryStatsReply {
3554 obj := &BsnGentableEntryStatsReply{
3555 BsnStatsReply: NewBsnStatsReply(3),
3556 }
3557 return obj
3558}
3559
3560type BsnGentableEntryStatsRequest struct {
3561 *BsnStatsRequest
3562 TableId uint16
3563 Checksum Checksum128
3564 ChecksumMask Checksum128
3565}
3566
3567type IBsnGentableEntryStatsRequest interface {
3568 IBsnStatsRequest
3569 GetTableId() uint16
3570 GetChecksum() Checksum128
3571 GetChecksumMask() Checksum128
3572}
3573
3574func (self *BsnGentableEntryStatsRequest) GetTableId() uint16 {
3575 return self.TableId
3576}
3577
3578func (self *BsnGentableEntryStatsRequest) SetTableId(v uint16) {
3579 self.TableId = v
3580}
3581
3582func (self *BsnGentableEntryStatsRequest) GetChecksum() Checksum128 {
3583 return self.Checksum
3584}
3585
3586func (self *BsnGentableEntryStatsRequest) SetChecksum(v Checksum128) {
3587 self.Checksum = v
3588}
3589
3590func (self *BsnGentableEntryStatsRequest) GetChecksumMask() Checksum128 {
3591 return self.ChecksumMask
3592}
3593
3594func (self *BsnGentableEntryStatsRequest) SetChecksumMask(v Checksum128) {
3595 self.ChecksumMask = v
3596}
3597
3598func (self *BsnGentableEntryStatsRequest) Serialize(encoder *goloxi.Encoder) error {
3599 if err := self.BsnStatsRequest.Serialize(encoder); err != nil {
3600 return err
3601 }
3602
3603 encoder.PutUint16(uint16(self.TableId))
3604 encoder.Write(bytes.Repeat([]byte{0}, 2))
3605 self.Checksum.Serialize(encoder)
3606 self.ChecksumMask.Serialize(encoder)
3607
3608 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
3609
3610 return nil
3611}
3612
3613func DecodeBsnGentableEntryStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnGentableEntryStatsRequest, error) {
3614 _bsngentableentrystatsrequest := &BsnGentableEntryStatsRequest{BsnStatsRequest: parent}
3615 if decoder.Length() < 36 {
3616 return nil, fmt.Errorf("BsnGentableEntryStatsRequest packet too short: %d < 36", decoder.Length())
3617 }
3618 _bsngentableentrystatsrequest.TableId = uint16(decoder.ReadUint16())
3619 decoder.Skip(2)
3620 _bsngentableentrystatsrequest.Checksum.Decode(decoder)
3621 _bsngentableentrystatsrequest.ChecksumMask.Decode(decoder)
3622 return _bsngentableentrystatsrequest, nil
3623}
3624
3625func NewBsnGentableEntryStatsRequest() *BsnGentableEntryStatsRequest {
3626 obj := &BsnGentableEntryStatsRequest{
3627 BsnStatsRequest: NewBsnStatsRequest(3),
3628 }
3629 return obj
3630}
3631
3632type BsnGentableError struct {
3633 *BsnBaseError
3634 ErrorCode BsnGentableErrorCode
3635 TableId uint16
3636}
3637
3638type IBsnGentableError interface {
3639 IBsnBaseError
3640 GetErrorCode() BsnGentableErrorCode
3641 GetTableId() uint16
3642}
3643
3644func (self *BsnGentableError) GetErrorCode() BsnGentableErrorCode {
3645 return self.ErrorCode
3646}
3647
3648func (self *BsnGentableError) SetErrorCode(v BsnGentableErrorCode) {
3649 self.ErrorCode = v
3650}
3651
3652func (self *BsnGentableError) GetTableId() uint16 {
3653 return self.TableId
3654}
3655
3656func (self *BsnGentableError) SetTableId(v uint16) {
3657 self.TableId = v
3658}
3659
3660func (self *BsnGentableError) Serialize(encoder *goloxi.Encoder) error {
3661 if err := self.BsnBaseError.Serialize(encoder); err != nil {
3662 return err
3663 }
3664
3665 encoder.PutUint16(uint16(self.ErrorCode))
3666 encoder.PutUint16(uint16(self.TableId))
3667
3668 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
3669
3670 return nil
3671}
3672
3673func DecodeBsnGentableError(parent *BsnBaseError, decoder *goloxi.Decoder) (*BsnGentableError, error) {
3674 _bsngentableerror := &BsnGentableError{BsnBaseError: parent}
3675 if decoder.Length() < 260 {
3676 return nil, fmt.Errorf("BsnGentableError packet too short: %d < 260", decoder.Length())
3677 }
3678 _bsngentableerror.ErrorCode = BsnGentableErrorCode(decoder.ReadUint16())
3679 _bsngentableerror.TableId = uint16(decoder.ReadUint16())
3680 return _bsngentableerror, nil
3681}
3682
3683func NewBsnGentableError() *BsnGentableError {
3684 obj := &BsnGentableError{
3685 BsnBaseError: NewBsnBaseError(2),
3686 }
3687 return obj
3688}
3689
3690type BsnGentableSetBucketsSize struct {
3691 *BsnHeader
3692 TableId uint16
3693 BucketsSize uint32
3694}
3695
3696type IBsnGentableSetBucketsSize interface {
3697 IBsnHeader
3698 GetTableId() uint16
3699 GetBucketsSize() uint32
3700}
3701
3702func (self *BsnGentableSetBucketsSize) GetTableId() uint16 {
3703 return self.TableId
3704}
3705
3706func (self *BsnGentableSetBucketsSize) SetTableId(v uint16) {
3707 self.TableId = v
3708}
3709
3710func (self *BsnGentableSetBucketsSize) GetBucketsSize() uint32 {
3711 return self.BucketsSize
3712}
3713
3714func (self *BsnGentableSetBucketsSize) SetBucketsSize(v uint32) {
3715 self.BucketsSize = v
3716}
3717
3718func (self *BsnGentableSetBucketsSize) Serialize(encoder *goloxi.Encoder) error {
3719 if err := self.BsnHeader.Serialize(encoder); err != nil {
3720 return err
3721 }
3722
3723 encoder.PutUint16(uint16(self.TableId))
3724 encoder.Write(bytes.Repeat([]byte{0}, 2))
3725 encoder.PutUint32(uint32(self.BucketsSize))
3726
3727 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
3728
3729 return nil
3730}
3731
3732func DecodeBsnGentableSetBucketsSize(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnGentableSetBucketsSize, error) {
3733 _bsngentablesetbucketssize := &BsnGentableSetBucketsSize{BsnHeader: parent}
3734 if decoder.Length() < 8 {
3735 return nil, fmt.Errorf("BsnGentableSetBucketsSize packet too short: %d < 8", decoder.Length())
3736 }
3737 _bsngentablesetbucketssize.TableId = uint16(decoder.ReadUint16())
3738 decoder.Skip(2)
3739 _bsngentablesetbucketssize.BucketsSize = uint32(decoder.ReadUint32())
3740 return _bsngentablesetbucketssize, nil
3741}
3742
3743func NewBsnGentableSetBucketsSize() *BsnGentableSetBucketsSize {
3744 obj := &BsnGentableSetBucketsSize{
3745 BsnHeader: NewBsnHeader(50),
3746 }
3747 return obj
3748}
3749
3750type BsnGentableStatsReply struct {
3751 *BsnStatsReply
3752 Entries []*BsnGentableStatsEntry
3753}
3754
3755type IBsnGentableStatsReply interface {
3756 IBsnStatsReply
3757 GetEntries() []*BsnGentableStatsEntry
3758}
3759
3760func (self *BsnGentableStatsReply) GetEntries() []*BsnGentableStatsEntry {
3761 return self.Entries
3762}
3763
3764func (self *BsnGentableStatsReply) SetEntries(v []*BsnGentableStatsEntry) {
3765 self.Entries = v
3766}
3767
3768func (self *BsnGentableStatsReply) Serialize(encoder *goloxi.Encoder) error {
3769 if err := self.BsnStatsReply.Serialize(encoder); err != nil {
3770 return err
3771 }
3772
3773 for _, obj := range self.Entries {
3774 if err := obj.Serialize(encoder); err != nil {
3775 return err
3776 }
3777 }
3778
3779 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
3780
3781 return nil
3782}
3783
3784func DecodeBsnGentableStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnGentableStatsReply, error) {
3785 _bsngentablestatsreply := &BsnGentableStatsReply{BsnStatsReply: parent}
3786
3787 for decoder.Length() >= 24 {
3788 item, err := DecodeBsnGentableStatsEntry(decoder)
3789 if err != nil {
3790 return nil, err
3791 }
3792 if item != nil {
3793 _bsngentablestatsreply.Entries = append(_bsngentablestatsreply.Entries, item)
3794 }
3795 }
3796 return _bsngentablestatsreply, nil
3797}
3798
3799func NewBsnGentableStatsReply() *BsnGentableStatsReply {
3800 obj := &BsnGentableStatsReply{
3801 BsnStatsReply: NewBsnStatsReply(7),
3802 }
3803 return obj
3804}
3805
3806type BsnGentableStatsRequest struct {
3807 *BsnStatsRequest
3808}
3809
3810type IBsnGentableStatsRequest interface {
3811 IBsnStatsRequest
3812}
3813
3814func (self *BsnGentableStatsRequest) Serialize(encoder *goloxi.Encoder) error {
3815 if err := self.BsnStatsRequest.Serialize(encoder); err != nil {
3816 return err
3817 }
3818
3819 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
3820
3821 return nil
3822}
3823
3824func DecodeBsnGentableStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnGentableStatsRequest, error) {
3825 _bsngentablestatsrequest := &BsnGentableStatsRequest{BsnStatsRequest: parent}
3826 return _bsngentablestatsrequest, nil
3827}
3828
3829func NewBsnGentableStatsRequest() *BsnGentableStatsRequest {
3830 obj := &BsnGentableStatsRequest{
3831 BsnStatsRequest: NewBsnStatsRequest(7),
3832 }
3833 return obj
3834}
3835
3836type BsnGetInterfacesReply struct {
3837 *BsnHeader
3838 Interfaces []*BsnInterface
3839}
3840
3841type IBsnGetInterfacesReply interface {
3842 IBsnHeader
3843 GetInterfaces() []*BsnInterface
3844}
3845
3846func (self *BsnGetInterfacesReply) GetInterfaces() []*BsnInterface {
3847 return self.Interfaces
3848}
3849
3850func (self *BsnGetInterfacesReply) SetInterfaces(v []*BsnInterface) {
3851 self.Interfaces = v
3852}
3853
3854func (self *BsnGetInterfacesReply) Serialize(encoder *goloxi.Encoder) error {
3855 if err := self.BsnHeader.Serialize(encoder); err != nil {
3856 return err
3857 }
3858
3859 for _, obj := range self.Interfaces {
3860 if err := obj.Serialize(encoder); err != nil {
3861 return err
3862 }
3863 }
3864
3865 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
3866
3867 return nil
3868}
3869
3870func DecodeBsnGetInterfacesReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnGetInterfacesReply, error) {
3871 _bsngetinterfacesreply := &BsnGetInterfacesReply{BsnHeader: parent}
3872
3873 for decoder.Length() >= 32 {
3874 item, err := DecodeBsnInterface(decoder)
3875 if err != nil {
3876 return nil, err
3877 }
3878 if item != nil {
3879 _bsngetinterfacesreply.Interfaces = append(_bsngetinterfacesreply.Interfaces, item)
3880 }
3881 }
3882 return _bsngetinterfacesreply, nil
3883}
3884
3885func NewBsnGetInterfacesReply() *BsnGetInterfacesReply {
3886 obj := &BsnGetInterfacesReply{
3887 BsnHeader: NewBsnHeader(10),
3888 }
3889 return obj
3890}
3891
3892type BsnGetInterfacesRequest struct {
3893 *BsnHeader
3894}
3895
3896type IBsnGetInterfacesRequest interface {
3897 IBsnHeader
3898}
3899
3900func (self *BsnGetInterfacesRequest) Serialize(encoder *goloxi.Encoder) error {
3901 if err := self.BsnHeader.Serialize(encoder); err != nil {
3902 return err
3903 }
3904
3905 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
3906
3907 return nil
3908}
3909
3910func DecodeBsnGetInterfacesRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnGetInterfacesRequest, error) {
3911 _bsngetinterfacesrequest := &BsnGetInterfacesRequest{BsnHeader: parent}
3912 return _bsngetinterfacesrequest, nil
3913}
3914
3915func NewBsnGetInterfacesRequest() *BsnGetInterfacesRequest {
3916 obj := &BsnGetInterfacesRequest{
3917 BsnHeader: NewBsnHeader(9),
3918 }
3919 return obj
3920}
3921
3922type BsnGetMirroringReply struct {
3923 *BsnHeader
3924 ReportMirrorPorts uint8
3925}
3926
3927type IBsnGetMirroringReply interface {
3928 IBsnHeader
3929 GetReportMirrorPorts() uint8
3930}
3931
3932func (self *BsnGetMirroringReply) GetReportMirrorPorts() uint8 {
3933 return self.ReportMirrorPorts
3934}
3935
3936func (self *BsnGetMirroringReply) SetReportMirrorPorts(v uint8) {
3937 self.ReportMirrorPorts = v
3938}
3939
3940func (self *BsnGetMirroringReply) Serialize(encoder *goloxi.Encoder) error {
3941 if err := self.BsnHeader.Serialize(encoder); err != nil {
3942 return err
3943 }
3944
3945 encoder.PutUint8(uint8(self.ReportMirrorPorts))
3946 encoder.Write(bytes.Repeat([]byte{0}, 3))
3947
3948 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
3949
3950 return nil
3951}
3952
3953func DecodeBsnGetMirroringReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnGetMirroringReply, error) {
3954 _bsngetmirroringreply := &BsnGetMirroringReply{BsnHeader: parent}
3955 if decoder.Length() < 4 {
3956 return nil, fmt.Errorf("BsnGetMirroringReply packet too short: %d < 4", decoder.Length())
3957 }
3958 _bsngetmirroringreply.ReportMirrorPorts = uint8(decoder.ReadByte())
3959 decoder.Skip(3)
3960 return _bsngetmirroringreply, nil
3961}
3962
3963func NewBsnGetMirroringReply() *BsnGetMirroringReply {
3964 obj := &BsnGetMirroringReply{
3965 BsnHeader: NewBsnHeader(5),
3966 }
3967 return obj
3968}
3969
3970type BsnGetMirroringRequest struct {
3971 *BsnHeader
3972 ReportMirrorPorts uint8
3973}
3974
3975type IBsnGetMirroringRequest interface {
3976 IBsnHeader
3977 GetReportMirrorPorts() uint8
3978}
3979
3980func (self *BsnGetMirroringRequest) GetReportMirrorPorts() uint8 {
3981 return self.ReportMirrorPorts
3982}
3983
3984func (self *BsnGetMirroringRequest) SetReportMirrorPorts(v uint8) {
3985 self.ReportMirrorPorts = v
3986}
3987
3988func (self *BsnGetMirroringRequest) Serialize(encoder *goloxi.Encoder) error {
3989 if err := self.BsnHeader.Serialize(encoder); err != nil {
3990 return err
3991 }
3992
3993 encoder.PutUint8(uint8(self.ReportMirrorPorts))
3994 encoder.Write(bytes.Repeat([]byte{0}, 3))
3995
3996 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
3997
3998 return nil
3999}
4000
4001func DecodeBsnGetMirroringRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnGetMirroringRequest, error) {
4002 _bsngetmirroringrequest := &BsnGetMirroringRequest{BsnHeader: parent}
4003 if decoder.Length() < 4 {
4004 return nil, fmt.Errorf("BsnGetMirroringRequest packet too short: %d < 4", decoder.Length())
4005 }
4006 _bsngetmirroringrequest.ReportMirrorPorts = uint8(decoder.ReadByte())
4007 decoder.Skip(3)
4008 return _bsngetmirroringrequest, nil
4009}
4010
4011func NewBsnGetMirroringRequest() *BsnGetMirroringRequest {
4012 obj := &BsnGetMirroringRequest{
4013 BsnHeader: NewBsnHeader(4),
4014 }
4015 return obj
4016}
4017
4018type BsnGetSwitchPipelineReply struct {
4019 *BsnHeader
4020 Pipeline string
4021}
4022
4023type IBsnGetSwitchPipelineReply interface {
4024 IBsnHeader
4025 GetPipeline() string
4026}
4027
4028func (self *BsnGetSwitchPipelineReply) GetPipeline() string {
4029 return self.Pipeline
4030}
4031
4032func (self *BsnGetSwitchPipelineReply) SetPipeline(v string) {
4033 self.Pipeline = v
4034}
4035
4036func (self *BsnGetSwitchPipelineReply) Serialize(encoder *goloxi.Encoder) error {
4037 if err := self.BsnHeader.Serialize(encoder); err != nil {
4038 return err
4039 }
4040
4041 encoder.Write([]byte(self.Pipeline))
4042
4043 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
4044
4045 return nil
4046}
4047
4048func DecodeBsnGetSwitchPipelineReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnGetSwitchPipelineReply, error) {
4049 _bsngetswitchpipelinereply := &BsnGetSwitchPipelineReply{BsnHeader: parent}
4050 if decoder.Length() < 256 {
4051 return nil, fmt.Errorf("BsnGetSwitchPipelineReply packet too short: %d < 256", decoder.Length())
4052 }
4053 _bsngetswitchpipelinereply.Pipeline = string(bytes.Trim(decoder.Read(256), "\x00"))
4054 return _bsngetswitchpipelinereply, nil
4055}
4056
4057func NewBsnGetSwitchPipelineReply() *BsnGetSwitchPipelineReply {
4058 obj := &BsnGetSwitchPipelineReply{
4059 BsnHeader: NewBsnHeader(52),
4060 }
4061 return obj
4062}
4063
4064type BsnGetSwitchPipelineRequest struct {
4065 *BsnHeader
4066}
4067
4068type IBsnGetSwitchPipelineRequest interface {
4069 IBsnHeader
4070}
4071
4072func (self *BsnGetSwitchPipelineRequest) Serialize(encoder *goloxi.Encoder) error {
4073 if err := self.BsnHeader.Serialize(encoder); err != nil {
4074 return err
4075 }
4076
4077 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
4078
4079 return nil
4080}
4081
4082func DecodeBsnGetSwitchPipelineRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnGetSwitchPipelineRequest, error) {
4083 _bsngetswitchpipelinerequest := &BsnGetSwitchPipelineRequest{BsnHeader: parent}
4084 return _bsngetswitchpipelinerequest, nil
4085}
4086
4087func NewBsnGetSwitchPipelineRequest() *BsnGetSwitchPipelineRequest {
4088 obj := &BsnGetSwitchPipelineRequest{
4089 BsnHeader: NewBsnHeader(51),
4090 }
4091 return obj
4092}
4093
4094type BsnImageDescStatsReply struct {
4095 *BsnStatsReply
4096 ImageChecksum string
4097 StartupConfigChecksum string
4098}
4099
4100type IBsnImageDescStatsReply interface {
4101 IBsnStatsReply
4102 GetImageChecksum() string
4103 GetStartupConfigChecksum() string
4104}
4105
4106func (self *BsnImageDescStatsReply) GetImageChecksum() string {
4107 return self.ImageChecksum
4108}
4109
4110func (self *BsnImageDescStatsReply) SetImageChecksum(v string) {
4111 self.ImageChecksum = v
4112}
4113
4114func (self *BsnImageDescStatsReply) GetStartupConfigChecksum() string {
4115 return self.StartupConfigChecksum
4116}
4117
4118func (self *BsnImageDescStatsReply) SetStartupConfigChecksum(v string) {
4119 self.StartupConfigChecksum = v
4120}
4121
4122func (self *BsnImageDescStatsReply) Serialize(encoder *goloxi.Encoder) error {
4123 if err := self.BsnStatsReply.Serialize(encoder); err != nil {
4124 return err
4125 }
4126
4127 encoder.Write([]byte(self.ImageChecksum))
4128 encoder.Write([]byte(self.StartupConfigChecksum))
4129
4130 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
4131
4132 return nil
4133}
4134
4135func DecodeBsnImageDescStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnImageDescStatsReply, error) {
4136 _bsnimagedescstatsreply := &BsnImageDescStatsReply{BsnStatsReply: parent}
4137 if decoder.Length() < 512 {
4138 return nil, fmt.Errorf("BsnImageDescStatsReply packet too short: %d < 512", decoder.Length())
4139 }
4140 _bsnimagedescstatsreply.ImageChecksum = string(bytes.Trim(decoder.Read(256), "\x00"))
4141 _bsnimagedescstatsreply.StartupConfigChecksum = string(bytes.Trim(decoder.Read(256), "\x00"))
4142 return _bsnimagedescstatsreply, nil
4143}
4144
4145func NewBsnImageDescStatsReply() *BsnImageDescStatsReply {
4146 obj := &BsnImageDescStatsReply{
4147 BsnStatsReply: NewBsnStatsReply(14),
4148 }
4149 return obj
4150}
4151
4152type BsnImageDescStatsRequest struct {
4153 *BsnStatsRequest
4154}
4155
4156type IBsnImageDescStatsRequest interface {
4157 IBsnStatsRequest
4158}
4159
4160func (self *BsnImageDescStatsRequest) Serialize(encoder *goloxi.Encoder) error {
4161 if err := self.BsnStatsRequest.Serialize(encoder); err != nil {
4162 return err
4163 }
4164
4165 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
4166
4167 return nil
4168}
4169
4170func DecodeBsnImageDescStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnImageDescStatsRequest, error) {
4171 _bsnimagedescstatsrequest := &BsnImageDescStatsRequest{BsnStatsRequest: parent}
4172 return _bsnimagedescstatsrequest, nil
4173}
4174
4175func NewBsnImageDescStatsRequest() *BsnImageDescStatsRequest {
4176 obj := &BsnImageDescStatsRequest{
4177 BsnStatsRequest: NewBsnStatsRequest(14),
4178 }
4179 return obj
4180}
4181
4182type BsnLacpConvergenceNotif struct {
4183 *BsnHeader
4184 ConvergenceStatus uint8
4185 PortNo Port
4186 ActorSysPriority uint16
4187 ActorSysMac net.HardwareAddr
4188 ActorPortPriority uint16
4189 ActorPortNum uint16
4190 ActorKey uint16
4191 PartnerSysPriority uint16
4192 PartnerSysMac net.HardwareAddr
4193 PartnerPortPriority uint16
4194 PartnerPortNum uint16
4195 PartnerKey uint16
4196}
4197
4198type IBsnLacpConvergenceNotif interface {
4199 IBsnHeader
4200 GetConvergenceStatus() uint8
4201 GetPortNo() Port
4202 GetActorSysPriority() uint16
4203 GetActorSysMac() net.HardwareAddr
4204 GetActorPortPriority() uint16
4205 GetActorPortNum() uint16
4206 GetActorKey() uint16
4207 GetPartnerSysPriority() uint16
4208 GetPartnerSysMac() net.HardwareAddr
4209 GetPartnerPortPriority() uint16
4210 GetPartnerPortNum() uint16
4211 GetPartnerKey() uint16
4212}
4213
4214func (self *BsnLacpConvergenceNotif) GetConvergenceStatus() uint8 {
4215 return self.ConvergenceStatus
4216}
4217
4218func (self *BsnLacpConvergenceNotif) SetConvergenceStatus(v uint8) {
4219 self.ConvergenceStatus = v
4220}
4221
4222func (self *BsnLacpConvergenceNotif) GetPortNo() Port {
4223 return self.PortNo
4224}
4225
4226func (self *BsnLacpConvergenceNotif) SetPortNo(v Port) {
4227 self.PortNo = v
4228}
4229
4230func (self *BsnLacpConvergenceNotif) GetActorSysPriority() uint16 {
4231 return self.ActorSysPriority
4232}
4233
4234func (self *BsnLacpConvergenceNotif) SetActorSysPriority(v uint16) {
4235 self.ActorSysPriority = v
4236}
4237
4238func (self *BsnLacpConvergenceNotif) GetActorSysMac() net.HardwareAddr {
4239 return self.ActorSysMac
4240}
4241
4242func (self *BsnLacpConvergenceNotif) SetActorSysMac(v net.HardwareAddr) {
4243 self.ActorSysMac = v
4244}
4245
4246func (self *BsnLacpConvergenceNotif) GetActorPortPriority() uint16 {
4247 return self.ActorPortPriority
4248}
4249
4250func (self *BsnLacpConvergenceNotif) SetActorPortPriority(v uint16) {
4251 self.ActorPortPriority = v
4252}
4253
4254func (self *BsnLacpConvergenceNotif) GetActorPortNum() uint16 {
4255 return self.ActorPortNum
4256}
4257
4258func (self *BsnLacpConvergenceNotif) SetActorPortNum(v uint16) {
4259 self.ActorPortNum = v
4260}
4261
4262func (self *BsnLacpConvergenceNotif) GetActorKey() uint16 {
4263 return self.ActorKey
4264}
4265
4266func (self *BsnLacpConvergenceNotif) SetActorKey(v uint16) {
4267 self.ActorKey = v
4268}
4269
4270func (self *BsnLacpConvergenceNotif) GetPartnerSysPriority() uint16 {
4271 return self.PartnerSysPriority
4272}
4273
4274func (self *BsnLacpConvergenceNotif) SetPartnerSysPriority(v uint16) {
4275 self.PartnerSysPriority = v
4276}
4277
4278func (self *BsnLacpConvergenceNotif) GetPartnerSysMac() net.HardwareAddr {
4279 return self.PartnerSysMac
4280}
4281
4282func (self *BsnLacpConvergenceNotif) SetPartnerSysMac(v net.HardwareAddr) {
4283 self.PartnerSysMac = v
4284}
4285
4286func (self *BsnLacpConvergenceNotif) GetPartnerPortPriority() uint16 {
4287 return self.PartnerPortPriority
4288}
4289
4290func (self *BsnLacpConvergenceNotif) SetPartnerPortPriority(v uint16) {
4291 self.PartnerPortPriority = v
4292}
4293
4294func (self *BsnLacpConvergenceNotif) GetPartnerPortNum() uint16 {
4295 return self.PartnerPortNum
4296}
4297
4298func (self *BsnLacpConvergenceNotif) SetPartnerPortNum(v uint16) {
4299 self.PartnerPortNum = v
4300}
4301
4302func (self *BsnLacpConvergenceNotif) GetPartnerKey() uint16 {
4303 return self.PartnerKey
4304}
4305
4306func (self *BsnLacpConvergenceNotif) SetPartnerKey(v uint16) {
4307 self.PartnerKey = v
4308}
4309
4310func (self *BsnLacpConvergenceNotif) Serialize(encoder *goloxi.Encoder) error {
4311 if err := self.BsnHeader.Serialize(encoder); err != nil {
4312 return err
4313 }
4314
4315 encoder.PutUint8(uint8(self.ConvergenceStatus))
4316 encoder.Write(bytes.Repeat([]byte{0}, 3))
4317 self.PortNo.Serialize(encoder)
4318 encoder.PutUint16(uint16(self.ActorSysPriority))
4319 encoder.Write(self.ActorSysMac)
4320 encoder.PutUint16(uint16(self.ActorPortPriority))
4321 encoder.PutUint16(uint16(self.ActorPortNum))
4322 encoder.PutUint16(uint16(self.ActorKey))
4323 encoder.PutUint16(uint16(self.PartnerSysPriority))
4324 encoder.Write(self.PartnerSysMac)
4325 encoder.PutUint16(uint16(self.PartnerPortPriority))
4326 encoder.PutUint16(uint16(self.PartnerPortNum))
4327 encoder.PutUint16(uint16(self.PartnerKey))
4328
4329 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
4330
4331 return nil
4332}
4333
4334func DecodeBsnLacpConvergenceNotif(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnLacpConvergenceNotif, error) {
4335 _bsnlacpconvergencenotif := &BsnLacpConvergenceNotif{BsnHeader: parent}
4336 if decoder.Length() < 36 {
4337 return nil, fmt.Errorf("BsnLacpConvergenceNotif packet too short: %d < 36", decoder.Length())
4338 }
4339 _bsnlacpconvergencenotif.ConvergenceStatus = uint8(decoder.ReadByte())
4340 decoder.Skip(3)
4341 _bsnlacpconvergencenotif.PortNo.Decode(decoder)
4342 _bsnlacpconvergencenotif.ActorSysPriority = uint16(decoder.ReadUint16())
4343 _bsnlacpconvergencenotif.ActorSysMac = net.HardwareAddr(decoder.Read(6))
4344 _bsnlacpconvergencenotif.ActorPortPriority = uint16(decoder.ReadUint16())
4345 _bsnlacpconvergencenotif.ActorPortNum = uint16(decoder.ReadUint16())
4346 _bsnlacpconvergencenotif.ActorKey = uint16(decoder.ReadUint16())
4347 _bsnlacpconvergencenotif.PartnerSysPriority = uint16(decoder.ReadUint16())
4348 _bsnlacpconvergencenotif.PartnerSysMac = net.HardwareAddr(decoder.Read(6))
4349 _bsnlacpconvergencenotif.PartnerPortPriority = uint16(decoder.ReadUint16())
4350 _bsnlacpconvergencenotif.PartnerPortNum = uint16(decoder.ReadUint16())
4351 _bsnlacpconvergencenotif.PartnerKey = uint16(decoder.ReadUint16())
4352 return _bsnlacpconvergencenotif, nil
4353}
4354
4355func NewBsnLacpConvergenceNotif() *BsnLacpConvergenceNotif {
4356 obj := &BsnLacpConvergenceNotif{
4357 BsnHeader: NewBsnHeader(43),
4358 }
4359 return obj
4360}
4361
4362type BsnLacpStatsReply struct {
4363 *BsnStatsReply
4364 Entries []*BsnLacpStatsEntry
4365}
4366
4367type IBsnLacpStatsReply interface {
4368 IBsnStatsReply
4369 GetEntries() []*BsnLacpStatsEntry
4370}
4371
4372func (self *BsnLacpStatsReply) GetEntries() []*BsnLacpStatsEntry {
4373 return self.Entries
4374}
4375
4376func (self *BsnLacpStatsReply) SetEntries(v []*BsnLacpStatsEntry) {
4377 self.Entries = v
4378}
4379
4380func (self *BsnLacpStatsReply) Serialize(encoder *goloxi.Encoder) error {
4381 if err := self.BsnStatsReply.Serialize(encoder); err != nil {
4382 return err
4383 }
4384
4385 for _, obj := range self.Entries {
4386 if err := obj.Serialize(encoder); err != nil {
4387 return err
4388 }
4389 }
4390
4391 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
4392
4393 return nil
4394}
4395
4396func DecodeBsnLacpStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnLacpStatsReply, error) {
4397 _bsnlacpstatsreply := &BsnLacpStatsReply{BsnStatsReply: parent}
4398
4399 for decoder.Length() >= 36 {
4400 item, err := DecodeBsnLacpStatsEntry(decoder)
4401 if err != nil {
4402 return nil, err
4403 }
4404 if item != nil {
4405 _bsnlacpstatsreply.Entries = append(_bsnlacpstatsreply.Entries, item)
4406 }
4407 }
4408 return _bsnlacpstatsreply, nil
4409}
4410
4411func NewBsnLacpStatsReply() *BsnLacpStatsReply {
4412 obj := &BsnLacpStatsReply{
4413 BsnStatsReply: NewBsnStatsReply(1),
4414 }
4415 return obj
4416}
4417
4418type BsnLacpStatsRequest struct {
4419 *BsnStatsRequest
4420}
4421
4422type IBsnLacpStatsRequest interface {
4423 IBsnStatsRequest
4424}
4425
4426func (self *BsnLacpStatsRequest) Serialize(encoder *goloxi.Encoder) error {
4427 if err := self.BsnStatsRequest.Serialize(encoder); err != nil {
4428 return err
4429 }
4430
4431 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
4432
4433 return nil
4434}
4435
4436func DecodeBsnLacpStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnLacpStatsRequest, error) {
4437 _bsnlacpstatsrequest := &BsnLacpStatsRequest{BsnStatsRequest: parent}
4438 return _bsnlacpstatsrequest, nil
4439}
4440
4441func NewBsnLacpStatsRequest() *BsnLacpStatsRequest {
4442 obj := &BsnLacpStatsRequest{
4443 BsnStatsRequest: NewBsnStatsRequest(1),
4444 }
4445 return obj
4446}
4447
4448type BsnLog struct {
4449 *BsnHeader
4450 Loglevel BsnLoglevel
4451 Data []byte
4452}
4453
4454type IBsnLog interface {
4455 IBsnHeader
4456 GetLoglevel() BsnLoglevel
4457 GetData() []byte
4458}
4459
4460func (self *BsnLog) GetLoglevel() BsnLoglevel {
4461 return self.Loglevel
4462}
4463
4464func (self *BsnLog) SetLoglevel(v BsnLoglevel) {
4465 self.Loglevel = v
4466}
4467
4468func (self *BsnLog) GetData() []byte {
4469 return self.Data
4470}
4471
4472func (self *BsnLog) SetData(v []byte) {
4473 self.Data = v
4474}
4475
4476func (self *BsnLog) Serialize(encoder *goloxi.Encoder) error {
4477 if err := self.BsnHeader.Serialize(encoder); err != nil {
4478 return err
4479 }
4480
4481 encoder.PutUint8(uint8(self.Loglevel))
4482 encoder.Write(self.Data)
4483
4484 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
4485
4486 return nil
4487}
4488
4489func DecodeBsnLog(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnLog, error) {
4490 _bsnlog := &BsnLog{BsnHeader: parent}
4491 if decoder.Length() < 1 {
4492 return nil, fmt.Errorf("BsnLog packet too short: %d < 1", decoder.Length())
4493 }
4494 _bsnlog.Loglevel = BsnLoglevel(decoder.ReadByte())
4495 _bsnlog.Data = decoder.Read(int(decoder.Length()))
4496 return _bsnlog, nil
4497}
4498
4499func NewBsnLog() *BsnLog {
4500 obj := &BsnLog{
4501 BsnHeader: NewBsnHeader(63),
4502 }
4503 return obj
4504}
4505
4506type BsnLuaCommandReply struct {
4507 *BsnHeader
4508 Data []byte
4509}
4510
4511type IBsnLuaCommandReply interface {
4512 IBsnHeader
4513 GetData() []byte
4514}
4515
4516func (self *BsnLuaCommandReply) GetData() []byte {
4517 return self.Data
4518}
4519
4520func (self *BsnLuaCommandReply) SetData(v []byte) {
4521 self.Data = v
4522}
4523
4524func (self *BsnLuaCommandReply) Serialize(encoder *goloxi.Encoder) error {
4525 if err := self.BsnHeader.Serialize(encoder); err != nil {
4526 return err
4527 }
4528
4529 encoder.Write(self.Data)
4530
4531 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
4532
4533 return nil
4534}
4535
4536func DecodeBsnLuaCommandReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnLuaCommandReply, error) {
4537 _bsnluacommandreply := &BsnLuaCommandReply{BsnHeader: parent}
4538 _bsnluacommandreply.Data = decoder.Read(int(decoder.Length()))
4539 return _bsnluacommandreply, nil
4540}
4541
4542func NewBsnLuaCommandReply() *BsnLuaCommandReply {
4543 obj := &BsnLuaCommandReply{
4544 BsnHeader: NewBsnHeader(66),
4545 }
4546 return obj
4547}
4548
4549type BsnLuaCommandRequest struct {
4550 *BsnHeader
4551 Data []byte
4552}
4553
4554type IBsnLuaCommandRequest interface {
4555 IBsnHeader
4556 GetData() []byte
4557}
4558
4559func (self *BsnLuaCommandRequest) GetData() []byte {
4560 return self.Data
4561}
4562
4563func (self *BsnLuaCommandRequest) SetData(v []byte) {
4564 self.Data = v
4565}
4566
4567func (self *BsnLuaCommandRequest) Serialize(encoder *goloxi.Encoder) error {
4568 if err := self.BsnHeader.Serialize(encoder); err != nil {
4569 return err
4570 }
4571
4572 encoder.Write(self.Data)
4573
4574 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
4575
4576 return nil
4577}
4578
4579func DecodeBsnLuaCommandRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnLuaCommandRequest, error) {
4580 _bsnluacommandrequest := &BsnLuaCommandRequest{BsnHeader: parent}
4581 _bsnluacommandrequest.Data = decoder.Read(int(decoder.Length()))
4582 return _bsnluacommandrequest, nil
4583}
4584
4585func NewBsnLuaCommandRequest() *BsnLuaCommandRequest {
4586 obj := &BsnLuaCommandRequest{
4587 BsnHeader: NewBsnHeader(65),
4588 }
4589 return obj
4590}
4591
4592type BsnLuaNotification struct {
4593 *BsnHeader
4594 Data []byte
4595}
4596
4597type IBsnLuaNotification interface {
4598 IBsnHeader
4599 GetData() []byte
4600}
4601
4602func (self *BsnLuaNotification) GetData() []byte {
4603 return self.Data
4604}
4605
4606func (self *BsnLuaNotification) SetData(v []byte) {
4607 self.Data = v
4608}
4609
4610func (self *BsnLuaNotification) Serialize(encoder *goloxi.Encoder) error {
4611 if err := self.BsnHeader.Serialize(encoder); err != nil {
4612 return err
4613 }
4614
4615 encoder.Write(self.Data)
4616
4617 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
4618
4619 return nil
4620}
4621
4622func DecodeBsnLuaNotification(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnLuaNotification, error) {
4623 _bsnluanotification := &BsnLuaNotification{BsnHeader: parent}
4624 _bsnluanotification.Data = decoder.Read(int(decoder.Length()))
4625 return _bsnluanotification, nil
4626}
4627
4628func NewBsnLuaNotification() *BsnLuaNotification {
4629 obj := &BsnLuaNotification{
4630 BsnHeader: NewBsnHeader(67),
4631 }
4632 return obj
4633}
4634
4635type BsnLuaUpload struct {
4636 *BsnHeader
4637 Flags BsnLuaUploadFlags
4638 Filename string
4639 Data []byte
4640}
4641
4642type IBsnLuaUpload interface {
4643 IBsnHeader
4644 GetFlags() BsnLuaUploadFlags
4645 GetFilename() string
4646 GetData() []byte
4647}
4648
4649func (self *BsnLuaUpload) GetFlags() BsnLuaUploadFlags {
4650 return self.Flags
4651}
4652
4653func (self *BsnLuaUpload) SetFlags(v BsnLuaUploadFlags) {
4654 self.Flags = v
4655}
4656
4657func (self *BsnLuaUpload) GetFilename() string {
4658 return self.Filename
4659}
4660
4661func (self *BsnLuaUpload) SetFilename(v string) {
4662 self.Filename = v
4663}
4664
4665func (self *BsnLuaUpload) GetData() []byte {
4666 return self.Data
4667}
4668
4669func (self *BsnLuaUpload) SetData(v []byte) {
4670 self.Data = v
4671}
4672
4673func (self *BsnLuaUpload) Serialize(encoder *goloxi.Encoder) error {
4674 if err := self.BsnHeader.Serialize(encoder); err != nil {
4675 return err
4676 }
4677
4678 encoder.PutUint16(uint16(self.Flags))
4679 encoder.Write([]byte(self.Filename))
4680 encoder.Write(self.Data)
4681
4682 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
4683
4684 return nil
4685}
4686
4687func DecodeBsnLuaUpload(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnLuaUpload, error) {
4688 _bsnluaupload := &BsnLuaUpload{BsnHeader: parent}
4689 if decoder.Length() < 66 {
4690 return nil, fmt.Errorf("BsnLuaUpload packet too short: %d < 66", decoder.Length())
4691 }
4692 _bsnluaupload.Flags = BsnLuaUploadFlags(decoder.ReadUint16())
4693 _bsnluaupload.Filename = string(bytes.Trim(decoder.Read(64), "\x00"))
4694 _bsnluaupload.Data = decoder.Read(int(decoder.Length()))
4695 return _bsnluaupload, nil
4696}
4697
4698func NewBsnLuaUpload() *BsnLuaUpload {
4699 obj := &BsnLuaUpload{
4700 BsnHeader: NewBsnHeader(64),
4701 }
4702 return obj
4703}
4704
4705type BsnPduRxReply struct {
4706 *BsnHeader
4707 Status uint32
4708 PortNo Port
4709 SlotNum uint8
4710}
4711
4712type IBsnPduRxReply interface {
4713 IBsnHeader
4714 GetStatus() uint32
4715 GetPortNo() Port
4716 GetSlotNum() uint8
4717}
4718
4719func (self *BsnPduRxReply) GetStatus() uint32 {
4720 return self.Status
4721}
4722
4723func (self *BsnPduRxReply) SetStatus(v uint32) {
4724 self.Status = v
4725}
4726
4727func (self *BsnPduRxReply) GetPortNo() Port {
4728 return self.PortNo
4729}
4730
4731func (self *BsnPduRxReply) SetPortNo(v Port) {
4732 self.PortNo = v
4733}
4734
4735func (self *BsnPduRxReply) GetSlotNum() uint8 {
4736 return self.SlotNum
4737}
4738
4739func (self *BsnPduRxReply) SetSlotNum(v uint8) {
4740 self.SlotNum = v
4741}
4742
4743func (self *BsnPduRxReply) Serialize(encoder *goloxi.Encoder) error {
4744 if err := self.BsnHeader.Serialize(encoder); err != nil {
4745 return err
4746 }
4747
4748 encoder.PutUint32(uint32(self.Status))
4749 self.PortNo.Serialize(encoder)
4750 encoder.PutUint8(uint8(self.SlotNum))
4751
4752 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
4753
4754 return nil
4755}
4756
4757func DecodeBsnPduRxReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnPduRxReply, error) {
4758 _bsnpdurxreply := &BsnPduRxReply{BsnHeader: parent}
4759 if decoder.Length() < 9 {
4760 return nil, fmt.Errorf("BsnPduRxReply packet too short: %d < 9", decoder.Length())
4761 }
4762 _bsnpdurxreply.Status = uint32(decoder.ReadUint32())
4763 _bsnpdurxreply.PortNo.Decode(decoder)
4764 _bsnpdurxreply.SlotNum = uint8(decoder.ReadByte())
4765 return _bsnpdurxreply, nil
4766}
4767
4768func NewBsnPduRxReply() *BsnPduRxReply {
4769 obj := &BsnPduRxReply{
4770 BsnHeader: NewBsnHeader(34),
4771 }
4772 return obj
4773}
4774
4775type BsnPduRxRequest struct {
4776 *BsnHeader
4777 TimeoutMs uint32
4778 PortNo Port
4779 SlotNum uint8
4780 Data []byte
4781}
4782
4783type IBsnPduRxRequest interface {
4784 IBsnHeader
4785 GetTimeoutMs() uint32
4786 GetPortNo() Port
4787 GetSlotNum() uint8
4788 GetData() []byte
4789}
4790
4791func (self *BsnPduRxRequest) GetTimeoutMs() uint32 {
4792 return self.TimeoutMs
4793}
4794
4795func (self *BsnPduRxRequest) SetTimeoutMs(v uint32) {
4796 self.TimeoutMs = v
4797}
4798
4799func (self *BsnPduRxRequest) GetPortNo() Port {
4800 return self.PortNo
4801}
4802
4803func (self *BsnPduRxRequest) SetPortNo(v Port) {
4804 self.PortNo = v
4805}
4806
4807func (self *BsnPduRxRequest) GetSlotNum() uint8 {
4808 return self.SlotNum
4809}
4810
4811func (self *BsnPduRxRequest) SetSlotNum(v uint8) {
4812 self.SlotNum = v
4813}
4814
4815func (self *BsnPduRxRequest) GetData() []byte {
4816 return self.Data
4817}
4818
4819func (self *BsnPduRxRequest) SetData(v []byte) {
4820 self.Data = v
4821}
4822
4823func (self *BsnPduRxRequest) Serialize(encoder *goloxi.Encoder) error {
4824 if err := self.BsnHeader.Serialize(encoder); err != nil {
4825 return err
4826 }
4827
4828 encoder.PutUint32(uint32(self.TimeoutMs))
4829 self.PortNo.Serialize(encoder)
4830 encoder.PutUint8(uint8(self.SlotNum))
4831 encoder.Write(bytes.Repeat([]byte{0}, 3))
4832 encoder.Write(self.Data)
4833
4834 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
4835
4836 return nil
4837}
4838
4839func DecodeBsnPduRxRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnPduRxRequest, error) {
4840 _bsnpdurxrequest := &BsnPduRxRequest{BsnHeader: parent}
4841 if decoder.Length() < 12 {
4842 return nil, fmt.Errorf("BsnPduRxRequest packet too short: %d < 12", decoder.Length())
4843 }
4844 _bsnpdurxrequest.TimeoutMs = uint32(decoder.ReadUint32())
4845 _bsnpdurxrequest.PortNo.Decode(decoder)
4846 _bsnpdurxrequest.SlotNum = uint8(decoder.ReadByte())
4847 decoder.Skip(3)
4848 _bsnpdurxrequest.Data = decoder.Read(int(decoder.Length()))
4849 return _bsnpdurxrequest, nil
4850}
4851
4852func NewBsnPduRxRequest() *BsnPduRxRequest {
4853 obj := &BsnPduRxRequest{
4854 BsnHeader: NewBsnHeader(33),
4855 }
4856 return obj
4857}
4858
4859type BsnPduRxTimeout struct {
4860 *BsnHeader
4861 PortNo Port
4862 SlotNum uint8
4863}
4864
4865type IBsnPduRxTimeout interface {
4866 IBsnHeader
4867 GetPortNo() Port
4868 GetSlotNum() uint8
4869}
4870
4871func (self *BsnPduRxTimeout) GetPortNo() Port {
4872 return self.PortNo
4873}
4874
4875func (self *BsnPduRxTimeout) SetPortNo(v Port) {
4876 self.PortNo = v
4877}
4878
4879func (self *BsnPduRxTimeout) GetSlotNum() uint8 {
4880 return self.SlotNum
4881}
4882
4883func (self *BsnPduRxTimeout) SetSlotNum(v uint8) {
4884 self.SlotNum = v
4885}
4886
4887func (self *BsnPduRxTimeout) Serialize(encoder *goloxi.Encoder) error {
4888 if err := self.BsnHeader.Serialize(encoder); err != nil {
4889 return err
4890 }
4891
4892 self.PortNo.Serialize(encoder)
4893 encoder.PutUint8(uint8(self.SlotNum))
4894
4895 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
4896
4897 return nil
4898}
4899
4900func DecodeBsnPduRxTimeout(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnPduRxTimeout, error) {
4901 _bsnpdurxtimeout := &BsnPduRxTimeout{BsnHeader: parent}
4902 if decoder.Length() < 5 {
4903 return nil, fmt.Errorf("BsnPduRxTimeout packet too short: %d < 5", decoder.Length())
4904 }
4905 _bsnpdurxtimeout.PortNo.Decode(decoder)
4906 _bsnpdurxtimeout.SlotNum = uint8(decoder.ReadByte())
4907 return _bsnpdurxtimeout, nil
4908}
4909
4910func NewBsnPduRxTimeout() *BsnPduRxTimeout {
4911 obj := &BsnPduRxTimeout{
4912 BsnHeader: NewBsnHeader(35),
4913 }
4914 return obj
4915}
4916
4917type BsnPduTxReply struct {
4918 *BsnHeader
4919 Status uint32
4920 PortNo Port
4921 SlotNum uint8
4922}
4923
4924type IBsnPduTxReply interface {
4925 IBsnHeader
4926 GetStatus() uint32
4927 GetPortNo() Port
4928 GetSlotNum() uint8
4929}
4930
4931func (self *BsnPduTxReply) GetStatus() uint32 {
4932 return self.Status
4933}
4934
4935func (self *BsnPduTxReply) SetStatus(v uint32) {
4936 self.Status = v
4937}
4938
4939func (self *BsnPduTxReply) GetPortNo() Port {
4940 return self.PortNo
4941}
4942
4943func (self *BsnPduTxReply) SetPortNo(v Port) {
4944 self.PortNo = v
4945}
4946
4947func (self *BsnPduTxReply) GetSlotNum() uint8 {
4948 return self.SlotNum
4949}
4950
4951func (self *BsnPduTxReply) SetSlotNum(v uint8) {
4952 self.SlotNum = v
4953}
4954
4955func (self *BsnPduTxReply) Serialize(encoder *goloxi.Encoder) error {
4956 if err := self.BsnHeader.Serialize(encoder); err != nil {
4957 return err
4958 }
4959
4960 encoder.PutUint32(uint32(self.Status))
4961 self.PortNo.Serialize(encoder)
4962 encoder.PutUint8(uint8(self.SlotNum))
4963
4964 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
4965
4966 return nil
4967}
4968
4969func DecodeBsnPduTxReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnPduTxReply, error) {
4970 _bsnpdutxreply := &BsnPduTxReply{BsnHeader: parent}
4971 if decoder.Length() < 9 {
4972 return nil, fmt.Errorf("BsnPduTxReply packet too short: %d < 9", decoder.Length())
4973 }
4974 _bsnpdutxreply.Status = uint32(decoder.ReadUint32())
4975 _bsnpdutxreply.PortNo.Decode(decoder)
4976 _bsnpdutxreply.SlotNum = uint8(decoder.ReadByte())
4977 return _bsnpdutxreply, nil
4978}
4979
4980func NewBsnPduTxReply() *BsnPduTxReply {
4981 obj := &BsnPduTxReply{
4982 BsnHeader: NewBsnHeader(32),
4983 }
4984 return obj
4985}
4986
4987type BsnPduTxRequest struct {
4988 *BsnHeader
4989 TxIntervalMs uint32
4990 PortNo Port
4991 SlotNum uint8
4992 Data []byte
4993}
4994
4995type IBsnPduTxRequest interface {
4996 IBsnHeader
4997 GetTxIntervalMs() uint32
4998 GetPortNo() Port
4999 GetSlotNum() uint8
5000 GetData() []byte
5001}
5002
5003func (self *BsnPduTxRequest) GetTxIntervalMs() uint32 {
5004 return self.TxIntervalMs
5005}
5006
5007func (self *BsnPduTxRequest) SetTxIntervalMs(v uint32) {
5008 self.TxIntervalMs = v
5009}
5010
5011func (self *BsnPduTxRequest) GetPortNo() Port {
5012 return self.PortNo
5013}
5014
5015func (self *BsnPduTxRequest) SetPortNo(v Port) {
5016 self.PortNo = v
5017}
5018
5019func (self *BsnPduTxRequest) GetSlotNum() uint8 {
5020 return self.SlotNum
5021}
5022
5023func (self *BsnPduTxRequest) SetSlotNum(v uint8) {
5024 self.SlotNum = v
5025}
5026
5027func (self *BsnPduTxRequest) GetData() []byte {
5028 return self.Data
5029}
5030
5031func (self *BsnPduTxRequest) SetData(v []byte) {
5032 self.Data = v
5033}
5034
5035func (self *BsnPduTxRequest) Serialize(encoder *goloxi.Encoder) error {
5036 if err := self.BsnHeader.Serialize(encoder); err != nil {
5037 return err
5038 }
5039
5040 encoder.PutUint32(uint32(self.TxIntervalMs))
5041 self.PortNo.Serialize(encoder)
5042 encoder.PutUint8(uint8(self.SlotNum))
5043 encoder.Write(bytes.Repeat([]byte{0}, 3))
5044 encoder.Write(self.Data)
5045
5046 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
5047
5048 return nil
5049}
5050
5051func DecodeBsnPduTxRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnPduTxRequest, error) {
5052 _bsnpdutxrequest := &BsnPduTxRequest{BsnHeader: parent}
5053 if decoder.Length() < 12 {
5054 return nil, fmt.Errorf("BsnPduTxRequest packet too short: %d < 12", decoder.Length())
5055 }
5056 _bsnpdutxrequest.TxIntervalMs = uint32(decoder.ReadUint32())
5057 _bsnpdutxrequest.PortNo.Decode(decoder)
5058 _bsnpdutxrequest.SlotNum = uint8(decoder.ReadByte())
5059 decoder.Skip(3)
5060 _bsnpdutxrequest.Data = decoder.Read(int(decoder.Length()))
5061 return _bsnpdutxrequest, nil
5062}
5063
5064func NewBsnPduTxRequest() *BsnPduTxRequest {
5065 obj := &BsnPduTxRequest{
5066 BsnHeader: NewBsnHeader(31),
5067 }
5068 return obj
5069}
5070
5071type BsnPortCounterStatsReply struct {
5072 *BsnStatsReply
5073 Entries []*BsnPortCounterStatsEntry
5074}
5075
5076type IBsnPortCounterStatsReply interface {
5077 IBsnStatsReply
5078 GetEntries() []*BsnPortCounterStatsEntry
5079}
5080
5081func (self *BsnPortCounterStatsReply) GetEntries() []*BsnPortCounterStatsEntry {
5082 return self.Entries
5083}
5084
5085func (self *BsnPortCounterStatsReply) SetEntries(v []*BsnPortCounterStatsEntry) {
5086 self.Entries = v
5087}
5088
5089func (self *BsnPortCounterStatsReply) Serialize(encoder *goloxi.Encoder) error {
5090 if err := self.BsnStatsReply.Serialize(encoder); err != nil {
5091 return err
5092 }
5093
5094 for _, obj := range self.Entries {
5095 if err := obj.Serialize(encoder); err != nil {
5096 return err
5097 }
5098 }
5099
5100 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
5101
5102 return nil
5103}
5104
5105func DecodeBsnPortCounterStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnPortCounterStatsReply, error) {
5106 _bsnportcounterstatsreply := &BsnPortCounterStatsReply{BsnStatsReply: parent}
5107
5108 for decoder.Length() >= 8 {
5109 item, err := DecodeBsnPortCounterStatsEntry(decoder)
5110 if err != nil {
5111 return nil, err
5112 }
5113 if item != nil {
5114 _bsnportcounterstatsreply.Entries = append(_bsnportcounterstatsreply.Entries, item)
5115 }
5116 }
5117 return _bsnportcounterstatsreply, nil
5118}
5119
5120func NewBsnPortCounterStatsReply() *BsnPortCounterStatsReply {
5121 obj := &BsnPortCounterStatsReply{
5122 BsnStatsReply: NewBsnStatsReply(8),
5123 }
5124 return obj
5125}
5126
5127type BsnPortCounterStatsRequest struct {
5128 *BsnStatsRequest
5129 PortNo Port
5130}
5131
5132type IBsnPortCounterStatsRequest interface {
5133 IBsnStatsRequest
5134 GetPortNo() Port
5135}
5136
5137func (self *BsnPortCounterStatsRequest) GetPortNo() Port {
5138 return self.PortNo
5139}
5140
5141func (self *BsnPortCounterStatsRequest) SetPortNo(v Port) {
5142 self.PortNo = v
5143}
5144
5145func (self *BsnPortCounterStatsRequest) Serialize(encoder *goloxi.Encoder) error {
5146 if err := self.BsnStatsRequest.Serialize(encoder); err != nil {
5147 return err
5148 }
5149
5150 self.PortNo.Serialize(encoder)
5151
5152 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
5153
5154 return nil
5155}
5156
5157func DecodeBsnPortCounterStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnPortCounterStatsRequest, error) {
5158 _bsnportcounterstatsrequest := &BsnPortCounterStatsRequest{BsnStatsRequest: parent}
5159 if decoder.Length() < 4 {
5160 return nil, fmt.Errorf("BsnPortCounterStatsRequest packet too short: %d < 4", decoder.Length())
5161 }
5162 _bsnportcounterstatsrequest.PortNo.Decode(decoder)
5163 return _bsnportcounterstatsrequest, nil
5164}
5165
5166func NewBsnPortCounterStatsRequest() *BsnPortCounterStatsRequest {
5167 obj := &BsnPortCounterStatsRequest{
5168 BsnStatsRequest: NewBsnStatsRequest(8),
5169 }
5170 return obj
5171}
5172
5173type BsnRoleStatus struct {
5174 *BsnHeader
5175 Role ControllerRole
5176 Reason BsnControllerRoleReason
5177 GenerationId uint64
5178}
5179
5180type IBsnRoleStatus interface {
5181 IBsnHeader
5182 GetRole() ControllerRole
5183 GetReason() BsnControllerRoleReason
5184 GetGenerationId() uint64
5185}
5186
5187func (self *BsnRoleStatus) GetRole() ControllerRole {
5188 return self.Role
5189}
5190
5191func (self *BsnRoleStatus) SetRole(v ControllerRole) {
5192 self.Role = v
5193}
5194
5195func (self *BsnRoleStatus) GetReason() BsnControllerRoleReason {
5196 return self.Reason
5197}
5198
5199func (self *BsnRoleStatus) SetReason(v BsnControllerRoleReason) {
5200 self.Reason = v
5201}
5202
5203func (self *BsnRoleStatus) GetGenerationId() uint64 {
5204 return self.GenerationId
5205}
5206
5207func (self *BsnRoleStatus) SetGenerationId(v uint64) {
5208 self.GenerationId = v
5209}
5210
5211func (self *BsnRoleStatus) Serialize(encoder *goloxi.Encoder) error {
5212 if err := self.BsnHeader.Serialize(encoder); err != nil {
5213 return err
5214 }
5215
5216 encoder.PutUint32(uint32(self.Role))
5217 encoder.PutUint8(uint8(self.Reason))
5218 encoder.Write(bytes.Repeat([]byte{0}, 3))
5219 encoder.PutUint64(uint64(self.GenerationId))
5220
5221 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
5222
5223 return nil
5224}
5225
5226func DecodeBsnRoleStatus(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnRoleStatus, error) {
5227 _bsnrolestatus := &BsnRoleStatus{BsnHeader: parent}
5228 if decoder.Length() < 16 {
5229 return nil, fmt.Errorf("BsnRoleStatus packet too short: %d < 16", decoder.Length())
5230 }
5231 _bsnrolestatus.Role = ControllerRole(decoder.ReadUint32())
5232 _bsnrolestatus.Reason = BsnControllerRoleReason(decoder.ReadByte())
5233 decoder.Skip(3)
5234 _bsnrolestatus.GenerationId = uint64(decoder.ReadUint64())
5235 return _bsnrolestatus, nil
5236}
5237
5238func NewBsnRoleStatus() *BsnRoleStatus {
5239 obj := &BsnRoleStatus{
5240 BsnHeader: NewBsnHeader(55),
5241 }
5242 return obj
5243}
5244
5245type BsnSetAuxCxnsReply struct {
5246 *BsnHeader
5247 NumAux uint32
5248 Status uint32
5249}
5250
5251type IBsnSetAuxCxnsReply interface {
5252 IBsnHeader
5253 GetNumAux() uint32
5254 GetStatus() uint32
5255}
5256
5257func (self *BsnSetAuxCxnsReply) GetNumAux() uint32 {
5258 return self.NumAux
5259}
5260
5261func (self *BsnSetAuxCxnsReply) SetNumAux(v uint32) {
5262 self.NumAux = v
5263}
5264
5265func (self *BsnSetAuxCxnsReply) GetStatus() uint32 {
5266 return self.Status
5267}
5268
5269func (self *BsnSetAuxCxnsReply) SetStatus(v uint32) {
5270 self.Status = v
5271}
5272
5273func (self *BsnSetAuxCxnsReply) Serialize(encoder *goloxi.Encoder) error {
5274 if err := self.BsnHeader.Serialize(encoder); err != nil {
5275 return err
5276 }
5277
5278 encoder.PutUint32(uint32(self.NumAux))
5279 encoder.PutUint32(uint32(self.Status))
5280
5281 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
5282
5283 return nil
5284}
5285
5286func DecodeBsnSetAuxCxnsReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnSetAuxCxnsReply, error) {
5287 _bsnsetauxcxnsreply := &BsnSetAuxCxnsReply{BsnHeader: parent}
5288 if decoder.Length() < 8 {
5289 return nil, fmt.Errorf("BsnSetAuxCxnsReply packet too short: %d < 8", decoder.Length())
5290 }
5291 _bsnsetauxcxnsreply.NumAux = uint32(decoder.ReadUint32())
5292 _bsnsetauxcxnsreply.Status = uint32(decoder.ReadUint32())
5293 return _bsnsetauxcxnsreply, nil
5294}
5295
5296func NewBsnSetAuxCxnsReply() *BsnSetAuxCxnsReply {
5297 obj := &BsnSetAuxCxnsReply{
5298 BsnHeader: NewBsnHeader(59),
5299 }
5300 return obj
5301}
5302
5303type BsnSetAuxCxnsRequest struct {
5304 *BsnHeader
5305 NumAux uint32
5306}
5307
5308type IBsnSetAuxCxnsRequest interface {
5309 IBsnHeader
5310 GetNumAux() uint32
5311}
5312
5313func (self *BsnSetAuxCxnsRequest) GetNumAux() uint32 {
5314 return self.NumAux
5315}
5316
5317func (self *BsnSetAuxCxnsRequest) SetNumAux(v uint32) {
5318 self.NumAux = v
5319}
5320
5321func (self *BsnSetAuxCxnsRequest) Serialize(encoder *goloxi.Encoder) error {
5322 if err := self.BsnHeader.Serialize(encoder); err != nil {
5323 return err
5324 }
5325
5326 encoder.PutUint32(uint32(self.NumAux))
5327
5328 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
5329
5330 return nil
5331}
5332
5333func DecodeBsnSetAuxCxnsRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnSetAuxCxnsRequest, error) {
5334 _bsnsetauxcxnsrequest := &BsnSetAuxCxnsRequest{BsnHeader: parent}
5335 if decoder.Length() < 4 {
5336 return nil, fmt.Errorf("BsnSetAuxCxnsRequest packet too short: %d < 4", decoder.Length())
5337 }
5338 _bsnsetauxcxnsrequest.NumAux = uint32(decoder.ReadUint32())
5339 return _bsnsetauxcxnsrequest, nil
5340}
5341
5342func NewBsnSetAuxCxnsRequest() *BsnSetAuxCxnsRequest {
5343 obj := &BsnSetAuxCxnsRequest{
5344 BsnHeader: NewBsnHeader(58),
5345 }
5346 return obj
5347}
5348
5349type BsnSetLacpReply struct {
5350 *BsnHeader
5351 Status uint32
5352 PortNo Port
5353}
5354
5355type IBsnSetLacpReply interface {
5356 IBsnHeader
5357 GetStatus() uint32
5358 GetPortNo() Port
5359}
5360
5361func (self *BsnSetLacpReply) GetStatus() uint32 {
5362 return self.Status
5363}
5364
5365func (self *BsnSetLacpReply) SetStatus(v uint32) {
5366 self.Status = v
5367}
5368
5369func (self *BsnSetLacpReply) GetPortNo() Port {
5370 return self.PortNo
5371}
5372
5373func (self *BsnSetLacpReply) SetPortNo(v Port) {
5374 self.PortNo = v
5375}
5376
5377func (self *BsnSetLacpReply) Serialize(encoder *goloxi.Encoder) error {
5378 if err := self.BsnHeader.Serialize(encoder); err != nil {
5379 return err
5380 }
5381
5382 encoder.PutUint32(uint32(self.Status))
5383 self.PortNo.Serialize(encoder)
5384
5385 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
5386
5387 return nil
5388}
5389
5390func DecodeBsnSetLacpReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnSetLacpReply, error) {
5391 _bsnsetlacpreply := &BsnSetLacpReply{BsnHeader: parent}
5392 if decoder.Length() < 8 {
5393 return nil, fmt.Errorf("BsnSetLacpReply packet too short: %d < 8", decoder.Length())
5394 }
5395 _bsnsetlacpreply.Status = uint32(decoder.ReadUint32())
5396 _bsnsetlacpreply.PortNo.Decode(decoder)
5397 return _bsnsetlacpreply, nil
5398}
5399
5400func NewBsnSetLacpReply() *BsnSetLacpReply {
5401 obj := &BsnSetLacpReply{
5402 BsnHeader: NewBsnHeader(42),
5403 }
5404 return obj
5405}
5406
5407type BsnSetLacpRequest struct {
5408 *BsnHeader
5409 Enabled uint8
5410 PortNo Port
5411 ActorSysPriority uint16
5412 ActorSysMac net.HardwareAddr
5413 ActorPortPriority uint16
5414 ActorPortNum uint16
5415 ActorKey uint16
5416}
5417
5418type IBsnSetLacpRequest interface {
5419 IBsnHeader
5420 GetEnabled() uint8
5421 GetPortNo() Port
5422 GetActorSysPriority() uint16
5423 GetActorSysMac() net.HardwareAddr
5424 GetActorPortPriority() uint16
5425 GetActorPortNum() uint16
5426 GetActorKey() uint16
5427}
5428
5429func (self *BsnSetLacpRequest) GetEnabled() uint8 {
5430 return self.Enabled
5431}
5432
5433func (self *BsnSetLacpRequest) SetEnabled(v uint8) {
5434 self.Enabled = v
5435}
5436
5437func (self *BsnSetLacpRequest) GetPortNo() Port {
5438 return self.PortNo
5439}
5440
5441func (self *BsnSetLacpRequest) SetPortNo(v Port) {
5442 self.PortNo = v
5443}
5444
5445func (self *BsnSetLacpRequest) GetActorSysPriority() uint16 {
5446 return self.ActorSysPriority
5447}
5448
5449func (self *BsnSetLacpRequest) SetActorSysPriority(v uint16) {
5450 self.ActorSysPriority = v
5451}
5452
5453func (self *BsnSetLacpRequest) GetActorSysMac() net.HardwareAddr {
5454 return self.ActorSysMac
5455}
5456
5457func (self *BsnSetLacpRequest) SetActorSysMac(v net.HardwareAddr) {
5458 self.ActorSysMac = v
5459}
5460
5461func (self *BsnSetLacpRequest) GetActorPortPriority() uint16 {
5462 return self.ActorPortPriority
5463}
5464
5465func (self *BsnSetLacpRequest) SetActorPortPriority(v uint16) {
5466 self.ActorPortPriority = v
5467}
5468
5469func (self *BsnSetLacpRequest) GetActorPortNum() uint16 {
5470 return self.ActorPortNum
5471}
5472
5473func (self *BsnSetLacpRequest) SetActorPortNum(v uint16) {
5474 self.ActorPortNum = v
5475}
5476
5477func (self *BsnSetLacpRequest) GetActorKey() uint16 {
5478 return self.ActorKey
5479}
5480
5481func (self *BsnSetLacpRequest) SetActorKey(v uint16) {
5482 self.ActorKey = v
5483}
5484
5485func (self *BsnSetLacpRequest) Serialize(encoder *goloxi.Encoder) error {
5486 if err := self.BsnHeader.Serialize(encoder); err != nil {
5487 return err
5488 }
5489
5490 encoder.PutUint8(uint8(self.Enabled))
5491 encoder.Write(bytes.Repeat([]byte{0}, 3))
5492 self.PortNo.Serialize(encoder)
5493 encoder.PutUint16(uint16(self.ActorSysPriority))
5494 encoder.Write(self.ActorSysMac)
5495 encoder.PutUint16(uint16(self.ActorPortPriority))
5496 encoder.PutUint16(uint16(self.ActorPortNum))
5497 encoder.PutUint16(uint16(self.ActorKey))
5498
5499 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
5500
5501 return nil
5502}
5503
5504func DecodeBsnSetLacpRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnSetLacpRequest, error) {
5505 _bsnsetlacprequest := &BsnSetLacpRequest{BsnHeader: parent}
5506 if decoder.Length() < 22 {
5507 return nil, fmt.Errorf("BsnSetLacpRequest packet too short: %d < 22", decoder.Length())
5508 }
5509 _bsnsetlacprequest.Enabled = uint8(decoder.ReadByte())
5510 decoder.Skip(3)
5511 _bsnsetlacprequest.PortNo.Decode(decoder)
5512 _bsnsetlacprequest.ActorSysPriority = uint16(decoder.ReadUint16())
5513 _bsnsetlacprequest.ActorSysMac = net.HardwareAddr(decoder.Read(6))
5514 _bsnsetlacprequest.ActorPortPriority = uint16(decoder.ReadUint16())
5515 _bsnsetlacprequest.ActorPortNum = uint16(decoder.ReadUint16())
5516 _bsnsetlacprequest.ActorKey = uint16(decoder.ReadUint16())
5517 return _bsnsetlacprequest, nil
5518}
5519
5520func NewBsnSetLacpRequest() *BsnSetLacpRequest {
5521 obj := &BsnSetLacpRequest{
5522 BsnHeader: NewBsnHeader(41),
5523 }
5524 return obj
5525}
5526
5527type BsnSetMirroring struct {
5528 *BsnHeader
5529 ReportMirrorPorts uint8
5530}
5531
5532type IBsnSetMirroring interface {
5533 IBsnHeader
5534 GetReportMirrorPorts() uint8
5535}
5536
5537func (self *BsnSetMirroring) GetReportMirrorPorts() uint8 {
5538 return self.ReportMirrorPorts
5539}
5540
5541func (self *BsnSetMirroring) SetReportMirrorPorts(v uint8) {
5542 self.ReportMirrorPorts = v
5543}
5544
5545func (self *BsnSetMirroring) Serialize(encoder *goloxi.Encoder) error {
5546 if err := self.BsnHeader.Serialize(encoder); err != nil {
5547 return err
5548 }
5549
5550 encoder.PutUint8(uint8(self.ReportMirrorPorts))
5551 encoder.Write(bytes.Repeat([]byte{0}, 3))
5552
5553 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
5554
5555 return nil
5556}
5557
5558func DecodeBsnSetMirroring(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnSetMirroring, error) {
5559 _bsnsetmirroring := &BsnSetMirroring{BsnHeader: parent}
5560 if decoder.Length() < 4 {
5561 return nil, fmt.Errorf("BsnSetMirroring packet too short: %d < 4", decoder.Length())
5562 }
5563 _bsnsetmirroring.ReportMirrorPorts = uint8(decoder.ReadByte())
5564 decoder.Skip(3)
5565 return _bsnsetmirroring, nil
5566}
5567
5568func NewBsnSetMirroring() *BsnSetMirroring {
5569 obj := &BsnSetMirroring{
5570 BsnHeader: NewBsnHeader(3),
5571 }
5572 return obj
5573}
5574
5575type BsnSetPktinSuppressionReply struct {
5576 *BsnHeader
5577 Status uint32
5578}
5579
5580type IBsnSetPktinSuppressionReply interface {
5581 IBsnHeader
5582 GetStatus() uint32
5583}
5584
5585func (self *BsnSetPktinSuppressionReply) GetStatus() uint32 {
5586 return self.Status
5587}
5588
5589func (self *BsnSetPktinSuppressionReply) SetStatus(v uint32) {
5590 self.Status = v
5591}
5592
5593func (self *BsnSetPktinSuppressionReply) Serialize(encoder *goloxi.Encoder) error {
5594 if err := self.BsnHeader.Serialize(encoder); err != nil {
5595 return err
5596 }
5597
5598 encoder.PutUint32(uint32(self.Status))
5599
5600 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
5601
5602 return nil
5603}
5604
5605func DecodeBsnSetPktinSuppressionReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnSetPktinSuppressionReply, error) {
5606 _bsnsetpktinsuppressionreply := &BsnSetPktinSuppressionReply{BsnHeader: parent}
5607 if decoder.Length() < 4 {
5608 return nil, fmt.Errorf("BsnSetPktinSuppressionReply packet too short: %d < 4", decoder.Length())
5609 }
5610 _bsnsetpktinsuppressionreply.Status = uint32(decoder.ReadUint32())
5611 return _bsnsetpktinsuppressionreply, nil
5612}
5613
5614func NewBsnSetPktinSuppressionReply() *BsnSetPktinSuppressionReply {
5615 obj := &BsnSetPktinSuppressionReply{
5616 BsnHeader: NewBsnHeader(25),
5617 }
5618 return obj
5619}
5620
5621type BsnSetPktinSuppressionRequest struct {
5622 *BsnHeader
5623 Enabled uint8
5624 IdleTimeout uint16
5625 HardTimeout uint16
5626 Priority uint16
5627 Cookie uint64
5628}
5629
5630type IBsnSetPktinSuppressionRequest interface {
5631 IBsnHeader
5632 GetEnabled() uint8
5633 GetIdleTimeout() uint16
5634 GetHardTimeout() uint16
5635 GetPriority() uint16
5636 GetCookie() uint64
5637}
5638
5639func (self *BsnSetPktinSuppressionRequest) GetEnabled() uint8 {
5640 return self.Enabled
5641}
5642
5643func (self *BsnSetPktinSuppressionRequest) SetEnabled(v uint8) {
5644 self.Enabled = v
5645}
5646
5647func (self *BsnSetPktinSuppressionRequest) GetIdleTimeout() uint16 {
5648 return self.IdleTimeout
5649}
5650
5651func (self *BsnSetPktinSuppressionRequest) SetIdleTimeout(v uint16) {
5652 self.IdleTimeout = v
5653}
5654
5655func (self *BsnSetPktinSuppressionRequest) GetHardTimeout() uint16 {
5656 return self.HardTimeout
5657}
5658
5659func (self *BsnSetPktinSuppressionRequest) SetHardTimeout(v uint16) {
5660 self.HardTimeout = v
5661}
5662
5663func (self *BsnSetPktinSuppressionRequest) GetPriority() uint16 {
5664 return self.Priority
5665}
5666
5667func (self *BsnSetPktinSuppressionRequest) SetPriority(v uint16) {
5668 self.Priority = v
5669}
5670
5671func (self *BsnSetPktinSuppressionRequest) GetCookie() uint64 {
5672 return self.Cookie
5673}
5674
5675func (self *BsnSetPktinSuppressionRequest) SetCookie(v uint64) {
5676 self.Cookie = v
5677}
5678
5679func (self *BsnSetPktinSuppressionRequest) Serialize(encoder *goloxi.Encoder) error {
5680 if err := self.BsnHeader.Serialize(encoder); err != nil {
5681 return err
5682 }
5683
5684 encoder.PutUint8(uint8(self.Enabled))
5685 encoder.Write(bytes.Repeat([]byte{0}, 1))
5686 encoder.PutUint16(uint16(self.IdleTimeout))
5687 encoder.PutUint16(uint16(self.HardTimeout))
5688 encoder.PutUint16(uint16(self.Priority))
5689 encoder.PutUint64(uint64(self.Cookie))
5690
5691 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
5692
5693 return nil
5694}
5695
5696func DecodeBsnSetPktinSuppressionRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnSetPktinSuppressionRequest, error) {
5697 _bsnsetpktinsuppressionrequest := &BsnSetPktinSuppressionRequest{BsnHeader: parent}
5698 if decoder.Length() < 16 {
5699 return nil, fmt.Errorf("BsnSetPktinSuppressionRequest packet too short: %d < 16", decoder.Length())
5700 }
5701 _bsnsetpktinsuppressionrequest.Enabled = uint8(decoder.ReadByte())
5702 decoder.Skip(1)
5703 _bsnsetpktinsuppressionrequest.IdleTimeout = uint16(decoder.ReadUint16())
5704 _bsnsetpktinsuppressionrequest.HardTimeout = uint16(decoder.ReadUint16())
5705 _bsnsetpktinsuppressionrequest.Priority = uint16(decoder.ReadUint16())
5706 _bsnsetpktinsuppressionrequest.Cookie = uint64(decoder.ReadUint64())
5707 return _bsnsetpktinsuppressionrequest, nil
5708}
5709
5710func NewBsnSetPktinSuppressionRequest() *BsnSetPktinSuppressionRequest {
5711 obj := &BsnSetPktinSuppressionRequest{
5712 BsnHeader: NewBsnHeader(11),
5713 }
5714 return obj
5715}
5716
5717type BsnSetSwitchPipelineReply struct {
5718 *BsnHeader
5719 Status uint32
5720}
5721
5722type IBsnSetSwitchPipelineReply interface {
5723 IBsnHeader
5724 GetStatus() uint32
5725}
5726
5727func (self *BsnSetSwitchPipelineReply) GetStatus() uint32 {
5728 return self.Status
5729}
5730
5731func (self *BsnSetSwitchPipelineReply) SetStatus(v uint32) {
5732 self.Status = v
5733}
5734
5735func (self *BsnSetSwitchPipelineReply) Serialize(encoder *goloxi.Encoder) error {
5736 if err := self.BsnHeader.Serialize(encoder); err != nil {
5737 return err
5738 }
5739
5740 encoder.PutUint32(uint32(self.Status))
5741
5742 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
5743
5744 return nil
5745}
5746
5747func DecodeBsnSetSwitchPipelineReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnSetSwitchPipelineReply, error) {
5748 _bsnsetswitchpipelinereply := &BsnSetSwitchPipelineReply{BsnHeader: parent}
5749 if decoder.Length() < 4 {
5750 return nil, fmt.Errorf("BsnSetSwitchPipelineReply packet too short: %d < 4", decoder.Length())
5751 }
5752 _bsnsetswitchpipelinereply.Status = uint32(decoder.ReadUint32())
5753 return _bsnsetswitchpipelinereply, nil
5754}
5755
5756func NewBsnSetSwitchPipelineReply() *BsnSetSwitchPipelineReply {
5757 obj := &BsnSetSwitchPipelineReply{
5758 BsnHeader: NewBsnHeader(54),
5759 }
5760 return obj
5761}
5762
5763type BsnSetSwitchPipelineRequest struct {
5764 *BsnHeader
5765 Pipeline string
5766}
5767
5768type IBsnSetSwitchPipelineRequest interface {
5769 IBsnHeader
5770 GetPipeline() string
5771}
5772
5773func (self *BsnSetSwitchPipelineRequest) GetPipeline() string {
5774 return self.Pipeline
5775}
5776
5777func (self *BsnSetSwitchPipelineRequest) SetPipeline(v string) {
5778 self.Pipeline = v
5779}
5780
5781func (self *BsnSetSwitchPipelineRequest) Serialize(encoder *goloxi.Encoder) error {
5782 if err := self.BsnHeader.Serialize(encoder); err != nil {
5783 return err
5784 }
5785
5786 encoder.Write([]byte(self.Pipeline))
5787
5788 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
5789
5790 return nil
5791}
5792
5793func DecodeBsnSetSwitchPipelineRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnSetSwitchPipelineRequest, error) {
5794 _bsnsetswitchpipelinerequest := &BsnSetSwitchPipelineRequest{BsnHeader: parent}
5795 if decoder.Length() < 256 {
5796 return nil, fmt.Errorf("BsnSetSwitchPipelineRequest packet too short: %d < 256", decoder.Length())
5797 }
5798 _bsnsetswitchpipelinerequest.Pipeline = string(bytes.Trim(decoder.Read(256), "\x00"))
5799 return _bsnsetswitchpipelinerequest, nil
5800}
5801
5802func NewBsnSetSwitchPipelineRequest() *BsnSetSwitchPipelineRequest {
5803 obj := &BsnSetSwitchPipelineRequest{
5804 BsnHeader: NewBsnHeader(53),
5805 }
5806 return obj
5807}
5808
5809type BsnSwitchPipelineStatsReply struct {
5810 *BsnStatsReply
5811 Entries []*BsnSwitchPipelineStatsEntry
5812}
5813
5814type IBsnSwitchPipelineStatsReply interface {
5815 IBsnStatsReply
5816 GetEntries() []*BsnSwitchPipelineStatsEntry
5817}
5818
5819func (self *BsnSwitchPipelineStatsReply) GetEntries() []*BsnSwitchPipelineStatsEntry {
5820 return self.Entries
5821}
5822
5823func (self *BsnSwitchPipelineStatsReply) SetEntries(v []*BsnSwitchPipelineStatsEntry) {
5824 self.Entries = v
5825}
5826
5827func (self *BsnSwitchPipelineStatsReply) Serialize(encoder *goloxi.Encoder) error {
5828 if err := self.BsnStatsReply.Serialize(encoder); err != nil {
5829 return err
5830 }
5831
5832 for _, obj := range self.Entries {
5833 if err := obj.Serialize(encoder); err != nil {
5834 return err
5835 }
5836 }
5837
5838 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
5839
5840 return nil
5841}
5842
5843func DecodeBsnSwitchPipelineStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnSwitchPipelineStatsReply, error) {
5844 _bsnswitchpipelinestatsreply := &BsnSwitchPipelineStatsReply{BsnStatsReply: parent}
5845
5846 for decoder.Length() >= 256 {
5847 item, err := DecodeBsnSwitchPipelineStatsEntry(decoder)
5848 if err != nil {
5849 return nil, err
5850 }
5851 if item != nil {
5852 _bsnswitchpipelinestatsreply.Entries = append(_bsnswitchpipelinestatsreply.Entries, item)
5853 }
5854 }
5855 return _bsnswitchpipelinestatsreply, nil
5856}
5857
5858func NewBsnSwitchPipelineStatsReply() *BsnSwitchPipelineStatsReply {
5859 obj := &BsnSwitchPipelineStatsReply{
5860 BsnStatsReply: NewBsnStatsReply(6),
5861 }
5862 return obj
5863}
5864
5865type BsnSwitchPipelineStatsRequest struct {
5866 *BsnStatsRequest
5867}
5868
5869type IBsnSwitchPipelineStatsRequest interface {
5870 IBsnStatsRequest
5871}
5872
5873func (self *BsnSwitchPipelineStatsRequest) Serialize(encoder *goloxi.Encoder) error {
5874 if err := self.BsnStatsRequest.Serialize(encoder); err != nil {
5875 return err
5876 }
5877
5878 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
5879
5880 return nil
5881}
5882
5883func DecodeBsnSwitchPipelineStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnSwitchPipelineStatsRequest, error) {
5884 _bsnswitchpipelinestatsrequest := &BsnSwitchPipelineStatsRequest{BsnStatsRequest: parent}
5885 return _bsnswitchpipelinestatsrequest, nil
5886}
5887
5888func NewBsnSwitchPipelineStatsRequest() *BsnSwitchPipelineStatsRequest {
5889 obj := &BsnSwitchPipelineStatsRequest{
5890 BsnStatsRequest: NewBsnStatsRequest(6),
5891 }
5892 return obj
5893}
5894
5895type BsnTableChecksumStatsReply struct {
5896 *BsnStatsReply
5897 Entries []*BsnTableChecksumStatsEntry
5898}
5899
5900type IBsnTableChecksumStatsReply interface {
5901 IBsnStatsReply
5902 GetEntries() []*BsnTableChecksumStatsEntry
5903}
5904
5905func (self *BsnTableChecksumStatsReply) GetEntries() []*BsnTableChecksumStatsEntry {
5906 return self.Entries
5907}
5908
5909func (self *BsnTableChecksumStatsReply) SetEntries(v []*BsnTableChecksumStatsEntry) {
5910 self.Entries = v
5911}
5912
5913func (self *BsnTableChecksumStatsReply) Serialize(encoder *goloxi.Encoder) error {
5914 if err := self.BsnStatsReply.Serialize(encoder); err != nil {
5915 return err
5916 }
5917
5918 for _, obj := range self.Entries {
5919 if err := obj.Serialize(encoder); err != nil {
5920 return err
5921 }
5922 }
5923
5924 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
5925
5926 return nil
5927}
5928
5929func DecodeBsnTableChecksumStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnTableChecksumStatsReply, error) {
5930 _bsntablechecksumstatsreply := &BsnTableChecksumStatsReply{BsnStatsReply: parent}
5931
5932 for decoder.Length() >= 9 {
5933 item, err := DecodeBsnTableChecksumStatsEntry(decoder)
5934 if err != nil {
5935 return nil, err
5936 }
5937 if item != nil {
5938 _bsntablechecksumstatsreply.Entries = append(_bsntablechecksumstatsreply.Entries, item)
5939 }
5940 }
5941 return _bsntablechecksumstatsreply, nil
5942}
5943
5944func NewBsnTableChecksumStatsReply() *BsnTableChecksumStatsReply {
5945 obj := &BsnTableChecksumStatsReply{
5946 BsnStatsReply: NewBsnStatsReply(11),
5947 }
5948 return obj
5949}
5950
5951type BsnTableChecksumStatsRequest struct {
5952 *BsnStatsRequest
5953}
5954
5955type IBsnTableChecksumStatsRequest interface {
5956 IBsnStatsRequest
5957}
5958
5959func (self *BsnTableChecksumStatsRequest) Serialize(encoder *goloxi.Encoder) error {
5960 if err := self.BsnStatsRequest.Serialize(encoder); err != nil {
5961 return err
5962 }
5963
5964 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
5965
5966 return nil
5967}
5968
5969func DecodeBsnTableChecksumStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnTableChecksumStatsRequest, error) {
5970 _bsntablechecksumstatsrequest := &BsnTableChecksumStatsRequest{BsnStatsRequest: parent}
5971 return _bsntablechecksumstatsrequest, nil
5972}
5973
5974func NewBsnTableChecksumStatsRequest() *BsnTableChecksumStatsRequest {
5975 obj := &BsnTableChecksumStatsRequest{
5976 BsnStatsRequest: NewBsnStatsRequest(11),
5977 }
5978 return obj
5979}
5980
5981type BsnTableSetBucketsSize struct {
5982 *BsnHeader
5983 TableId uint8
5984 BucketsSize uint32
5985}
5986
5987type IBsnTableSetBucketsSize interface {
5988 IBsnHeader
5989 GetTableId() uint8
5990 GetBucketsSize() uint32
5991}
5992
5993func (self *BsnTableSetBucketsSize) GetTableId() uint8 {
5994 return self.TableId
5995}
5996
5997func (self *BsnTableSetBucketsSize) SetTableId(v uint8) {
5998 self.TableId = v
5999}
6000
6001func (self *BsnTableSetBucketsSize) GetBucketsSize() uint32 {
6002 return self.BucketsSize
6003}
6004
6005func (self *BsnTableSetBucketsSize) SetBucketsSize(v uint32) {
6006 self.BucketsSize = v
6007}
6008
6009func (self *BsnTableSetBucketsSize) Serialize(encoder *goloxi.Encoder) error {
6010 if err := self.BsnHeader.Serialize(encoder); err != nil {
6011 return err
6012 }
6013
6014 encoder.Write(bytes.Repeat([]byte{0}, 1))
6015 encoder.PutUint8(uint8(self.TableId))
6016 encoder.Write(bytes.Repeat([]byte{0}, 2))
6017 encoder.PutUint32(uint32(self.BucketsSize))
6018
6019 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
6020
6021 return nil
6022}
6023
6024func DecodeBsnTableSetBucketsSize(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnTableSetBucketsSize, error) {
6025 _bsntablesetbucketssize := &BsnTableSetBucketsSize{BsnHeader: parent}
6026 if decoder.Length() < 8 {
6027 return nil, fmt.Errorf("BsnTableSetBucketsSize packet too short: %d < 8", decoder.Length())
6028 }
6029 decoder.Skip(1)
6030 _bsntablesetbucketssize.TableId = uint8(decoder.ReadByte())
6031 decoder.Skip(2)
6032 _bsntablesetbucketssize.BucketsSize = uint32(decoder.ReadUint32())
6033 return _bsntablesetbucketssize, nil
6034}
6035
6036func NewBsnTableSetBucketsSize() *BsnTableSetBucketsSize {
6037 obj := &BsnTableSetBucketsSize{
6038 BsnHeader: NewBsnHeader(61),
6039 }
6040 return obj
6041}
6042
6043type BsnTimeReply struct {
6044 *BsnHeader
6045 TimeMs uint64
6046}
6047
6048type IBsnTimeReply interface {
6049 IBsnHeader
6050 GetTimeMs() uint64
6051}
6052
6053func (self *BsnTimeReply) GetTimeMs() uint64 {
6054 return self.TimeMs
6055}
6056
6057func (self *BsnTimeReply) SetTimeMs(v uint64) {
6058 self.TimeMs = v
6059}
6060
6061func (self *BsnTimeReply) Serialize(encoder *goloxi.Encoder) error {
6062 if err := self.BsnHeader.Serialize(encoder); err != nil {
6063 return err
6064 }
6065
6066 encoder.PutUint64(uint64(self.TimeMs))
6067
6068 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
6069
6070 return nil
6071}
6072
6073func DecodeBsnTimeReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnTimeReply, error) {
6074 _bsntimereply := &BsnTimeReply{BsnHeader: parent}
6075 if decoder.Length() < 8 {
6076 return nil, fmt.Errorf("BsnTimeReply packet too short: %d < 8", decoder.Length())
6077 }
6078 _bsntimereply.TimeMs = uint64(decoder.ReadUint64())
6079 return _bsntimereply, nil
6080}
6081
6082func NewBsnTimeReply() *BsnTimeReply {
6083 obj := &BsnTimeReply{
6084 BsnHeader: NewBsnHeader(45),
6085 }
6086 return obj
6087}
6088
6089type BsnTimeRequest struct {
6090 *BsnHeader
6091}
6092
6093type IBsnTimeRequest interface {
6094 IBsnHeader
6095}
6096
6097func (self *BsnTimeRequest) Serialize(encoder *goloxi.Encoder) error {
6098 if err := self.BsnHeader.Serialize(encoder); err != nil {
6099 return err
6100 }
6101
6102 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
6103
6104 return nil
6105}
6106
6107func DecodeBsnTimeRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnTimeRequest, error) {
6108 _bsntimerequest := &BsnTimeRequest{BsnHeader: parent}
6109 return _bsntimerequest, nil
6110}
6111
6112func NewBsnTimeRequest() *BsnTimeRequest {
6113 obj := &BsnTimeRequest{
6114 BsnHeader: NewBsnHeader(44),
6115 }
6116 return obj
6117}
6118
6119type BsnVirtualPortCreateReply struct {
6120 *BsnHeader
6121 Status uint32
6122 VportNo uint32
6123}
6124
6125type IBsnVirtualPortCreateReply interface {
6126 IBsnHeader
6127 GetStatus() uint32
6128 GetVportNo() uint32
6129}
6130
6131func (self *BsnVirtualPortCreateReply) GetStatus() uint32 {
6132 return self.Status
6133}
6134
6135func (self *BsnVirtualPortCreateReply) SetStatus(v uint32) {
6136 self.Status = v
6137}
6138
6139func (self *BsnVirtualPortCreateReply) GetVportNo() uint32 {
6140 return self.VportNo
6141}
6142
6143func (self *BsnVirtualPortCreateReply) SetVportNo(v uint32) {
6144 self.VportNo = v
6145}
6146
6147func (self *BsnVirtualPortCreateReply) Serialize(encoder *goloxi.Encoder) error {
6148 if err := self.BsnHeader.Serialize(encoder); err != nil {
6149 return err
6150 }
6151
6152 encoder.PutUint32(uint32(self.Status))
6153 encoder.PutUint32(uint32(self.VportNo))
6154
6155 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
6156
6157 return nil
6158}
6159
6160func DecodeBsnVirtualPortCreateReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnVirtualPortCreateReply, error) {
6161 _bsnvirtualportcreatereply := &BsnVirtualPortCreateReply{BsnHeader: parent}
6162 if decoder.Length() < 8 {
6163 return nil, fmt.Errorf("BsnVirtualPortCreateReply packet too short: %d < 8", decoder.Length())
6164 }
6165 _bsnvirtualportcreatereply.Status = uint32(decoder.ReadUint32())
6166 _bsnvirtualportcreatereply.VportNo = uint32(decoder.ReadUint32())
6167 return _bsnvirtualportcreatereply, nil
6168}
6169
6170func NewBsnVirtualPortCreateReply() *BsnVirtualPortCreateReply {
6171 obj := &BsnVirtualPortCreateReply{
6172 BsnHeader: NewBsnHeader(16),
6173 }
6174 return obj
6175}
6176
6177type BsnVirtualPortCreateRequest struct {
6178 *BsnHeader
6179 Vport BSNVport
6180}
6181
6182type IBsnVirtualPortCreateRequest interface {
6183 IBsnHeader
6184 GetVport() BSNVport
6185}
6186
6187func (self *BsnVirtualPortCreateRequest) GetVport() BSNVport {
6188 return self.Vport
6189}
6190
6191func (self *BsnVirtualPortCreateRequest) SetVport(v BSNVport) {
6192 self.Vport = v
6193}
6194
6195func (self *BsnVirtualPortCreateRequest) Serialize(encoder *goloxi.Encoder) error {
6196 if err := self.BsnHeader.Serialize(encoder); err != nil {
6197 return err
6198 }
6199
6200 if err := self.Vport.Serialize(encoder); err != nil {
6201 return err
6202 }
6203
6204 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
6205
6206 return nil
6207}
6208
6209func DecodeBsnVirtualPortCreateRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnVirtualPortCreateRequest, error) {
6210 _bsnvirtualportcreaterequest := &BsnVirtualPortCreateRequest{BsnHeader: parent}
6211 if decoder.Length() < 4 {
6212 return nil, fmt.Errorf("BsnVirtualPortCreateRequest packet too short: %d < 4", decoder.Length())
6213 }
6214 if err := _bsnvirtualportcreaterequest.Vport.Decode(decoder); err != nil {
6215 return nil, err
6216 }
6217
6218 return _bsnvirtualportcreaterequest, nil
6219}
6220
6221func NewBsnVirtualPortCreateRequest() *BsnVirtualPortCreateRequest {
6222 obj := &BsnVirtualPortCreateRequest{
6223 BsnHeader: NewBsnHeader(15),
6224 }
6225 return obj
6226}
6227
6228type BsnVirtualPortRemoveReply struct {
6229 *BsnHeader
6230 Status uint32
6231}
6232
6233type IBsnVirtualPortRemoveReply interface {
6234 IBsnHeader
6235 GetStatus() uint32
6236}
6237
6238func (self *BsnVirtualPortRemoveReply) GetStatus() uint32 {
6239 return self.Status
6240}
6241
6242func (self *BsnVirtualPortRemoveReply) SetStatus(v uint32) {
6243 self.Status = v
6244}
6245
6246func (self *BsnVirtualPortRemoveReply) Serialize(encoder *goloxi.Encoder) error {
6247 if err := self.BsnHeader.Serialize(encoder); err != nil {
6248 return err
6249 }
6250
6251 encoder.PutUint32(uint32(self.Status))
6252
6253 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
6254
6255 return nil
6256}
6257
6258func DecodeBsnVirtualPortRemoveReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnVirtualPortRemoveReply, error) {
6259 _bsnvirtualportremovereply := &BsnVirtualPortRemoveReply{BsnHeader: parent}
6260 if decoder.Length() < 4 {
6261 return nil, fmt.Errorf("BsnVirtualPortRemoveReply packet too short: %d < 4", decoder.Length())
6262 }
6263 _bsnvirtualportremovereply.Status = uint32(decoder.ReadUint32())
6264 return _bsnvirtualportremovereply, nil
6265}
6266
6267func NewBsnVirtualPortRemoveReply() *BsnVirtualPortRemoveReply {
6268 obj := &BsnVirtualPortRemoveReply{
6269 BsnHeader: NewBsnHeader(26),
6270 }
6271 return obj
6272}
6273
6274type BsnVirtualPortRemoveRequest struct {
6275 *BsnHeader
6276 VportNo uint32
6277}
6278
6279type IBsnVirtualPortRemoveRequest interface {
6280 IBsnHeader
6281 GetVportNo() uint32
6282}
6283
6284func (self *BsnVirtualPortRemoveRequest) GetVportNo() uint32 {
6285 return self.VportNo
6286}
6287
6288func (self *BsnVirtualPortRemoveRequest) SetVportNo(v uint32) {
6289 self.VportNo = v
6290}
6291
6292func (self *BsnVirtualPortRemoveRequest) Serialize(encoder *goloxi.Encoder) error {
6293 if err := self.BsnHeader.Serialize(encoder); err != nil {
6294 return err
6295 }
6296
6297 encoder.PutUint32(uint32(self.VportNo))
6298
6299 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
6300
6301 return nil
6302}
6303
6304func DecodeBsnVirtualPortRemoveRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnVirtualPortRemoveRequest, error) {
6305 _bsnvirtualportremoverequest := &BsnVirtualPortRemoveRequest{BsnHeader: parent}
6306 if decoder.Length() < 4 {
6307 return nil, fmt.Errorf("BsnVirtualPortRemoveRequest packet too short: %d < 4", decoder.Length())
6308 }
6309 _bsnvirtualportremoverequest.VportNo = uint32(decoder.ReadUint32())
6310 return _bsnvirtualportremoverequest, nil
6311}
6312
6313func NewBsnVirtualPortRemoveRequest() *BsnVirtualPortRemoveRequest {
6314 obj := &BsnVirtualPortRemoveRequest{
6315 BsnHeader: NewBsnHeader(17),
6316 }
6317 return obj
6318}
6319
6320type BsnVlanCounterClear struct {
6321 *BsnHeader
6322 VlanVid uint16
6323}
6324
6325type IBsnVlanCounterClear interface {
6326 IBsnHeader
6327 GetVlanVid() uint16
6328}
6329
6330func (self *BsnVlanCounterClear) GetVlanVid() uint16 {
6331 return self.VlanVid
6332}
6333
6334func (self *BsnVlanCounterClear) SetVlanVid(v uint16) {
6335 self.VlanVid = v
6336}
6337
6338func (self *BsnVlanCounterClear) Serialize(encoder *goloxi.Encoder) error {
6339 if err := self.BsnHeader.Serialize(encoder); err != nil {
6340 return err
6341 }
6342
6343 encoder.PutUint16(uint16(self.VlanVid))
6344
6345 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
6346
6347 return nil
6348}
6349
6350func DecodeBsnVlanCounterClear(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnVlanCounterClear, error) {
6351 _bsnvlancounterclear := &BsnVlanCounterClear{BsnHeader: parent}
6352 if decoder.Length() < 2 {
6353 return nil, fmt.Errorf("BsnVlanCounterClear packet too short: %d < 2", decoder.Length())
6354 }
6355 _bsnvlancounterclear.VlanVid = uint16(decoder.ReadUint16())
6356 return _bsnvlancounterclear, nil
6357}
6358
6359func NewBsnVlanCounterClear() *BsnVlanCounterClear {
6360 obj := &BsnVlanCounterClear{
6361 BsnHeader: NewBsnHeader(70),
6362 }
6363 return obj
6364}
6365
6366type BsnVlanCounterStatsReply struct {
6367 *BsnStatsReply
6368 Entries []*BsnVlanCounterStatsEntry
6369}
6370
6371type IBsnVlanCounterStatsReply interface {
6372 IBsnStatsReply
6373 GetEntries() []*BsnVlanCounterStatsEntry
6374}
6375
6376func (self *BsnVlanCounterStatsReply) GetEntries() []*BsnVlanCounterStatsEntry {
6377 return self.Entries
6378}
6379
6380func (self *BsnVlanCounterStatsReply) SetEntries(v []*BsnVlanCounterStatsEntry) {
6381 self.Entries = v
6382}
6383
6384func (self *BsnVlanCounterStatsReply) Serialize(encoder *goloxi.Encoder) error {
6385 if err := self.BsnStatsReply.Serialize(encoder); err != nil {
6386 return err
6387 }
6388
6389 for _, obj := range self.Entries {
6390 if err := obj.Serialize(encoder); err != nil {
6391 return err
6392 }
6393 }
6394
6395 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
6396
6397 return nil
6398}
6399
6400func DecodeBsnVlanCounterStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnVlanCounterStatsReply, error) {
6401 _bsnvlancounterstatsreply := &BsnVlanCounterStatsReply{BsnStatsReply: parent}
6402
6403 for decoder.Length() >= 8 {
6404 item, err := DecodeBsnVlanCounterStatsEntry(decoder)
6405 if err != nil {
6406 return nil, err
6407 }
6408 if item != nil {
6409 _bsnvlancounterstatsreply.Entries = append(_bsnvlancounterstatsreply.Entries, item)
6410 }
6411 }
6412 return _bsnvlancounterstatsreply, nil
6413}
6414
6415func NewBsnVlanCounterStatsReply() *BsnVlanCounterStatsReply {
6416 obj := &BsnVlanCounterStatsReply{
6417 BsnStatsReply: NewBsnStatsReply(9),
6418 }
6419 return obj
6420}
6421
6422type BsnVlanCounterStatsRequest struct {
6423 *BsnStatsRequest
6424 VlanVid uint16
6425}
6426
6427type IBsnVlanCounterStatsRequest interface {
6428 IBsnStatsRequest
6429 GetVlanVid() uint16
6430}
6431
6432func (self *BsnVlanCounterStatsRequest) GetVlanVid() uint16 {
6433 return self.VlanVid
6434}
6435
6436func (self *BsnVlanCounterStatsRequest) SetVlanVid(v uint16) {
6437 self.VlanVid = v
6438}
6439
6440func (self *BsnVlanCounterStatsRequest) Serialize(encoder *goloxi.Encoder) error {
6441 if err := self.BsnStatsRequest.Serialize(encoder); err != nil {
6442 return err
6443 }
6444
6445 encoder.PutUint16(uint16(self.VlanVid))
6446
6447 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
6448
6449 return nil
6450}
6451
6452func DecodeBsnVlanCounterStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnVlanCounterStatsRequest, error) {
6453 _bsnvlancounterstatsrequest := &BsnVlanCounterStatsRequest{BsnStatsRequest: parent}
6454 if decoder.Length() < 2 {
6455 return nil, fmt.Errorf("BsnVlanCounterStatsRequest packet too short: %d < 2", decoder.Length())
6456 }
6457 _bsnvlancounterstatsrequest.VlanVid = uint16(decoder.ReadUint16())
6458 return _bsnvlancounterstatsrequest, nil
6459}
6460
6461func NewBsnVlanCounterStatsRequest() *BsnVlanCounterStatsRequest {
6462 obj := &BsnVlanCounterStatsRequest{
6463 BsnStatsRequest: NewBsnStatsRequest(9),
6464 }
6465 return obj
6466}
6467
6468type BsnVrfCounterStatsReply struct {
6469 *BsnStatsReply
6470 Entries []*BsnVrfCounterStatsEntry
6471}
6472
6473type IBsnVrfCounterStatsReply interface {
6474 IBsnStatsReply
6475 GetEntries() []*BsnVrfCounterStatsEntry
6476}
6477
6478func (self *BsnVrfCounterStatsReply) GetEntries() []*BsnVrfCounterStatsEntry {
6479 return self.Entries
6480}
6481
6482func (self *BsnVrfCounterStatsReply) SetEntries(v []*BsnVrfCounterStatsEntry) {
6483 self.Entries = v
6484}
6485
6486func (self *BsnVrfCounterStatsReply) Serialize(encoder *goloxi.Encoder) error {
6487 if err := self.BsnStatsReply.Serialize(encoder); err != nil {
6488 return err
6489 }
6490
6491 for _, obj := range self.Entries {
6492 if err := obj.Serialize(encoder); err != nil {
6493 return err
6494 }
6495 }
6496
6497 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
6498
6499 return nil
6500}
6501
6502func DecodeBsnVrfCounterStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnVrfCounterStatsReply, error) {
6503 _bsnvrfcounterstatsreply := &BsnVrfCounterStatsReply{BsnStatsReply: parent}
6504
6505 for decoder.Length() >= 8 {
6506 item, err := DecodeBsnVrfCounterStatsEntry(decoder)
6507 if err != nil {
6508 return nil, err
6509 }
6510 if item != nil {
6511 _bsnvrfcounterstatsreply.Entries = append(_bsnvrfcounterstatsreply.Entries, item)
6512 }
6513 }
6514 return _bsnvrfcounterstatsreply, nil
6515}
6516
6517func NewBsnVrfCounterStatsReply() *BsnVrfCounterStatsReply {
6518 obj := &BsnVrfCounterStatsReply{
6519 BsnStatsReply: NewBsnStatsReply(15),
6520 }
6521 return obj
6522}
6523
6524type BsnVrfCounterStatsRequest struct {
6525 *BsnStatsRequest
6526 Vrf uint32
6527}
6528
6529type IBsnVrfCounterStatsRequest interface {
6530 IBsnStatsRequest
6531 GetVrf() uint32
6532}
6533
6534func (self *BsnVrfCounterStatsRequest) GetVrf() uint32 {
6535 return self.Vrf
6536}
6537
6538func (self *BsnVrfCounterStatsRequest) SetVrf(v uint32) {
6539 self.Vrf = v
6540}
6541
6542func (self *BsnVrfCounterStatsRequest) Serialize(encoder *goloxi.Encoder) error {
6543 if err := self.BsnStatsRequest.Serialize(encoder); err != nil {
6544 return err
6545 }
6546
6547 encoder.PutUint32(uint32(self.Vrf))
6548
6549 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
6550
6551 return nil
6552}
6553
6554func DecodeBsnVrfCounterStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnVrfCounterStatsRequest, error) {
6555 _bsnvrfcounterstatsrequest := &BsnVrfCounterStatsRequest{BsnStatsRequest: parent}
6556 if decoder.Length() < 4 {
6557 return nil, fmt.Errorf("BsnVrfCounterStatsRequest packet too short: %d < 4", decoder.Length())
6558 }
6559 _bsnvrfcounterstatsrequest.Vrf = uint32(decoder.ReadUint32())
6560 return _bsnvrfcounterstatsrequest, nil
6561}
6562
6563func NewBsnVrfCounterStatsRequest() *BsnVrfCounterStatsRequest {
6564 obj := &BsnVrfCounterStatsRequest{
6565 BsnStatsRequest: NewBsnStatsRequest(15),
6566 }
6567 return obj
6568}
6569
6570type DescStatsReply struct {
6571 *StatsReply
6572 MfrDesc string
6573 HwDesc string
6574 SwDesc string
6575 SerialNum string
6576 DpDesc string
6577}
6578
6579type IDescStatsReply interface {
6580 IStatsReply
6581 GetMfrDesc() string
6582 GetHwDesc() string
6583 GetSwDesc() string
6584 GetSerialNum() string
6585 GetDpDesc() string
6586}
6587
6588func (self *DescStatsReply) GetMfrDesc() string {
6589 return self.MfrDesc
6590}
6591
6592func (self *DescStatsReply) SetMfrDesc(v string) {
6593 self.MfrDesc = v
6594}
6595
6596func (self *DescStatsReply) GetHwDesc() string {
6597 return self.HwDesc
6598}
6599
6600func (self *DescStatsReply) SetHwDesc(v string) {
6601 self.HwDesc = v
6602}
6603
6604func (self *DescStatsReply) GetSwDesc() string {
6605 return self.SwDesc
6606}
6607
6608func (self *DescStatsReply) SetSwDesc(v string) {
6609 self.SwDesc = v
6610}
6611
6612func (self *DescStatsReply) GetSerialNum() string {
6613 return self.SerialNum
6614}
6615
6616func (self *DescStatsReply) SetSerialNum(v string) {
6617 self.SerialNum = v
6618}
6619
6620func (self *DescStatsReply) GetDpDesc() string {
6621 return self.DpDesc
6622}
6623
6624func (self *DescStatsReply) SetDpDesc(v string) {
6625 self.DpDesc = v
6626}
6627
6628func (self *DescStatsReply) Serialize(encoder *goloxi.Encoder) error {
6629 if err := self.StatsReply.Serialize(encoder); err != nil {
6630 return err
6631 }
6632
6633 encoder.Write(bytes.Repeat([]byte{0}, 4))
6634 encoder.Write([]byte(self.MfrDesc))
6635 encoder.Write([]byte(self.HwDesc))
6636 encoder.Write([]byte(self.SwDesc))
6637 encoder.Write([]byte(self.SerialNum))
6638 encoder.Write([]byte(self.DpDesc))
6639
6640 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
6641
6642 return nil
6643}
6644
6645func DecodeDescStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*DescStatsReply, error) {
6646 _descstatsreply := &DescStatsReply{StatsReply: parent}
6647 if decoder.Length() < 1060 {
6648 return nil, fmt.Errorf("DescStatsReply packet too short: %d < 1060", decoder.Length())
6649 }
6650 decoder.Skip(4)
6651 _descstatsreply.MfrDesc = string(bytes.Trim(decoder.Read(256), "\x00"))
6652 _descstatsreply.HwDesc = string(bytes.Trim(decoder.Read(256), "\x00"))
6653 _descstatsreply.SwDesc = string(bytes.Trim(decoder.Read(256), "\x00"))
6654 _descstatsreply.SerialNum = string(bytes.Trim(decoder.Read(32), "\x00"))
6655 _descstatsreply.DpDesc = string(bytes.Trim(decoder.Read(256), "\x00"))
6656 return _descstatsreply, nil
6657}
6658
6659func NewDescStatsReply() *DescStatsReply {
6660 obj := &DescStatsReply{
6661 StatsReply: NewStatsReply(0),
6662 }
6663 return obj
6664}
6665
6666type DescStatsRequest struct {
6667 *StatsRequest
6668}
6669
6670type IDescStatsRequest interface {
6671 IStatsRequest
6672}
6673
6674func (self *DescStatsRequest) Serialize(encoder *goloxi.Encoder) error {
6675 if err := self.StatsRequest.Serialize(encoder); err != nil {
6676 return err
6677 }
6678
6679 encoder.Write(bytes.Repeat([]byte{0}, 4))
6680
6681 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
6682
6683 return nil
6684}
6685
6686func DecodeDescStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*DescStatsRequest, error) {
6687 _descstatsrequest := &DescStatsRequest{StatsRequest: parent}
6688 if decoder.Length() < 4 {
6689 return nil, fmt.Errorf("DescStatsRequest packet too short: %d < 4", decoder.Length())
6690 }
6691 decoder.Skip(4)
6692 return _descstatsrequest, nil
6693}
6694
6695func NewDescStatsRequest() *DescStatsRequest {
6696 obj := &DescStatsRequest{
6697 StatsRequest: NewStatsRequest(0),
6698 }
6699 return obj
6700}
6701
6702type EchoReply struct {
6703 *Header
6704 Data []byte
6705}
6706
6707type IEchoReply interface {
6708 IHeader
6709 GetData() []byte
6710}
6711
6712func (self *EchoReply) GetData() []byte {
6713 return self.Data
6714}
6715
6716func (self *EchoReply) SetData(v []byte) {
6717 self.Data = v
6718}
6719
6720func (self *EchoReply) Serialize(encoder *goloxi.Encoder) error {
6721 if err := self.Header.Serialize(encoder); err != nil {
6722 return err
6723 }
6724
6725 encoder.Write(self.Data)
6726
6727 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
6728
6729 return nil
6730}
6731
6732func DecodeEchoReply(parent *Header, decoder *goloxi.Decoder) (*EchoReply, error) {
6733 _echoreply := &EchoReply{Header: parent}
6734 _echoreply.Data = decoder.Read(int(decoder.Length()))
6735 return _echoreply, nil
6736}
6737
6738func NewEchoReply() *EchoReply {
6739 obj := &EchoReply{
6740 Header: NewHeader(3),
6741 }
6742 return obj
6743}
6744
6745type EchoRequest struct {
6746 *Header
6747 Data []byte
6748}
6749
6750type IEchoRequest interface {
6751 IHeader
6752 GetData() []byte
6753}
6754
6755func (self *EchoRequest) GetData() []byte {
6756 return self.Data
6757}
6758
6759func (self *EchoRequest) SetData(v []byte) {
6760 self.Data = v
6761}
6762
6763func (self *EchoRequest) Serialize(encoder *goloxi.Encoder) error {
6764 if err := self.Header.Serialize(encoder); err != nil {
6765 return err
6766 }
6767
6768 encoder.Write(self.Data)
6769
6770 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
6771
6772 return nil
6773}
6774
6775func DecodeEchoRequest(parent *Header, decoder *goloxi.Decoder) (*EchoRequest, error) {
6776 _echorequest := &EchoRequest{Header: parent}
6777 _echorequest.Data = decoder.Read(int(decoder.Length()))
6778 return _echorequest, nil
6779}
6780
6781func NewEchoRequest() *EchoRequest {
6782 obj := &EchoRequest{
6783 Header: NewHeader(2),
6784 }
6785 return obj
6786}
6787
6788type FeaturesReply struct {
6789 *Header
6790 DatapathId uint64
6791 NBuffers uint32
6792 NTables uint8
6793 AuxiliaryId uint8
6794 Capabilities Capabilities
6795 Reserved uint32
6796}
6797
6798type IFeaturesReply interface {
6799 IHeader
6800 GetDatapathId() uint64
6801 GetNBuffers() uint32
6802 GetNTables() uint8
6803 GetAuxiliaryId() uint8
6804 GetCapabilities() Capabilities
6805 GetReserved() uint32
6806}
6807
6808func (self *FeaturesReply) GetDatapathId() uint64 {
6809 return self.DatapathId
6810}
6811
6812func (self *FeaturesReply) SetDatapathId(v uint64) {
6813 self.DatapathId = v
6814}
6815
6816func (self *FeaturesReply) GetNBuffers() uint32 {
6817 return self.NBuffers
6818}
6819
6820func (self *FeaturesReply) SetNBuffers(v uint32) {
6821 self.NBuffers = v
6822}
6823
6824func (self *FeaturesReply) GetNTables() uint8 {
6825 return self.NTables
6826}
6827
6828func (self *FeaturesReply) SetNTables(v uint8) {
6829 self.NTables = v
6830}
6831
6832func (self *FeaturesReply) GetAuxiliaryId() uint8 {
6833 return self.AuxiliaryId
6834}
6835
6836func (self *FeaturesReply) SetAuxiliaryId(v uint8) {
6837 self.AuxiliaryId = v
6838}
6839
6840func (self *FeaturesReply) GetCapabilities() Capabilities {
6841 return self.Capabilities
6842}
6843
6844func (self *FeaturesReply) SetCapabilities(v Capabilities) {
6845 self.Capabilities = v
6846}
6847
6848func (self *FeaturesReply) GetReserved() uint32 {
6849 return self.Reserved
6850}
6851
6852func (self *FeaturesReply) SetReserved(v uint32) {
6853 self.Reserved = v
6854}
6855
6856func (self *FeaturesReply) Serialize(encoder *goloxi.Encoder) error {
6857 if err := self.Header.Serialize(encoder); err != nil {
6858 return err
6859 }
6860
6861 encoder.PutUint64(uint64(self.DatapathId))
6862 encoder.PutUint32(uint32(self.NBuffers))
6863 encoder.PutUint8(uint8(self.NTables))
6864 encoder.PutUint8(uint8(self.AuxiliaryId))
6865 encoder.Write(bytes.Repeat([]byte{0}, 2))
6866 encoder.PutUint32(uint32(self.Capabilities))
6867 encoder.PutUint32(uint32(self.Reserved))
6868
6869 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
6870
6871 return nil
6872}
6873
6874func DecodeFeaturesReply(parent *Header, decoder *goloxi.Decoder) (*FeaturesReply, error) {
6875 _featuresreply := &FeaturesReply{Header: parent}
6876 if decoder.Length() < 24 {
6877 return nil, fmt.Errorf("FeaturesReply packet too short: %d < 24", decoder.Length())
6878 }
6879 _featuresreply.DatapathId = uint64(decoder.ReadUint64())
6880 _featuresreply.NBuffers = uint32(decoder.ReadUint32())
6881 _featuresreply.NTables = uint8(decoder.ReadByte())
6882 _featuresreply.AuxiliaryId = uint8(decoder.ReadByte())
6883 decoder.Skip(2)
6884 _featuresreply.Capabilities = Capabilities(decoder.ReadUint32())
6885 _featuresreply.Reserved = uint32(decoder.ReadUint32())
6886 return _featuresreply, nil
6887}
6888
6889func NewFeaturesReply() *FeaturesReply {
6890 obj := &FeaturesReply{
6891 Header: NewHeader(6),
6892 }
6893 return obj
6894}
6895
6896type FeaturesRequest struct {
6897 *Header
6898}
6899
6900type IFeaturesRequest interface {
6901 IHeader
6902}
6903
6904func (self *FeaturesRequest) Serialize(encoder *goloxi.Encoder) error {
6905 if err := self.Header.Serialize(encoder); err != nil {
6906 return err
6907 }
6908
6909 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
6910
6911 return nil
6912}
6913
6914func DecodeFeaturesRequest(parent *Header, decoder *goloxi.Decoder) (*FeaturesRequest, error) {
6915 _featuresrequest := &FeaturesRequest{Header: parent}
6916 return _featuresrequest, nil
6917}
6918
6919func NewFeaturesRequest() *FeaturesRequest {
6920 obj := &FeaturesRequest{
6921 Header: NewHeader(5),
6922 }
6923 return obj
6924}
6925
6926type FlowMod struct {
6927 *Header
6928 Cookie uint64
6929 CookieMask uint64
6930 TableId uint8
6931 Command FmCmd
6932 IdleTimeout uint16
6933 HardTimeout uint16
6934 Priority uint16
6935 BufferId uint32
6936 OutPort Port
6937 OutGroup uint32
6938 Flags FlowModFlags
6939 Match Match
6940 Instructions []IInstruction
6941}
6942
6943type IFlowMod interface {
6944 IHeader
6945 GetCookie() uint64
6946 GetCookieMask() uint64
6947 GetTableId() uint8
6948 GetCommand() FmCmd
6949 GetIdleTimeout() uint16
6950 GetHardTimeout() uint16
6951 GetPriority() uint16
6952 GetBufferId() uint32
6953 GetOutPort() Port
6954 GetOutGroup() uint32
6955 GetFlags() FlowModFlags
6956 GetMatch() Match
6957 GetInstructions() []IInstruction
6958}
6959
6960func (self *FlowMod) GetCookie() uint64 {
6961 return self.Cookie
6962}
6963
6964func (self *FlowMod) SetCookie(v uint64) {
6965 self.Cookie = v
6966}
6967
6968func (self *FlowMod) GetCookieMask() uint64 {
6969 return self.CookieMask
6970}
6971
6972func (self *FlowMod) SetCookieMask(v uint64) {
6973 self.CookieMask = v
6974}
6975
6976func (self *FlowMod) GetTableId() uint8 {
6977 return self.TableId
6978}
6979
6980func (self *FlowMod) SetTableId(v uint8) {
6981 self.TableId = v
6982}
6983
6984func (self *FlowMod) GetCommand() FmCmd {
6985 return self.Command
6986}
6987
6988func (self *FlowMod) SetCommand(v FmCmd) {
6989 self.Command = v
6990}
6991
6992func (self *FlowMod) GetIdleTimeout() uint16 {
6993 return self.IdleTimeout
6994}
6995
6996func (self *FlowMod) SetIdleTimeout(v uint16) {
6997 self.IdleTimeout = v
6998}
6999
7000func (self *FlowMod) GetHardTimeout() uint16 {
7001 return self.HardTimeout
7002}
7003
7004func (self *FlowMod) SetHardTimeout(v uint16) {
7005 self.HardTimeout = v
7006}
7007
7008func (self *FlowMod) GetPriority() uint16 {
7009 return self.Priority
7010}
7011
7012func (self *FlowMod) SetPriority(v uint16) {
7013 self.Priority = v
7014}
7015
7016func (self *FlowMod) GetBufferId() uint32 {
7017 return self.BufferId
7018}
7019
7020func (self *FlowMod) SetBufferId(v uint32) {
7021 self.BufferId = v
7022}
7023
7024func (self *FlowMod) GetOutPort() Port {
7025 return self.OutPort
7026}
7027
7028func (self *FlowMod) SetOutPort(v Port) {
7029 self.OutPort = v
7030}
7031
7032func (self *FlowMod) GetOutGroup() uint32 {
7033 return self.OutGroup
7034}
7035
7036func (self *FlowMod) SetOutGroup(v uint32) {
7037 self.OutGroup = v
7038}
7039
7040func (self *FlowMod) GetFlags() FlowModFlags {
7041 return self.Flags
7042}
7043
7044func (self *FlowMod) SetFlags(v FlowModFlags) {
7045 self.Flags = v
7046}
7047
7048func (self *FlowMod) GetMatch() Match {
7049 return self.Match
7050}
7051
7052func (self *FlowMod) SetMatch(v Match) {
7053 self.Match = v
7054}
7055
7056func (self *FlowMod) GetInstructions() []IInstruction {
7057 return self.Instructions
7058}
7059
7060func (self *FlowMod) SetInstructions(v []IInstruction) {
7061 self.Instructions = v
7062}
7063
7064func (self *FlowMod) Serialize(encoder *goloxi.Encoder) error {
7065 if err := self.Header.Serialize(encoder); err != nil {
7066 return err
7067 }
7068
7069 encoder.PutUint64(uint64(self.Cookie))
7070 encoder.PutUint64(uint64(self.CookieMask))
7071 encoder.PutUint8(uint8(self.TableId))
7072 self.Command.Serialize(encoder)
7073 encoder.PutUint16(uint16(self.IdleTimeout))
7074 encoder.PutUint16(uint16(self.HardTimeout))
7075 encoder.PutUint16(uint16(self.Priority))
7076 encoder.PutUint32(uint32(self.BufferId))
7077 self.OutPort.Serialize(encoder)
7078 encoder.PutUint32(uint32(self.OutGroup))
7079 encoder.PutUint16(uint16(self.Flags))
7080 encoder.Write(bytes.Repeat([]byte{0}, 2))
7081 if err := self.Match.Serialize(encoder); err != nil {
7082 return err
7083 }
7084
7085 for _, obj := range self.Instructions {
7086 if err := obj.Serialize(encoder); err != nil {
7087 return err
7088 }
7089 }
7090
7091 return nil
7092}
7093
7094func DecodeFlowMod(parent *Header, decoder *goloxi.Decoder) (IFlowMod, error) {
7095 _flowmod := &FlowMod{Header: parent}
7096 if decoder.Length() < 48 {
7097 return nil, fmt.Errorf("FlowMod packet too short: %d < 48", decoder.Length())
7098 }
7099 _flowmod.Cookie = uint64(decoder.ReadUint64())
7100 _flowmod.CookieMask = uint64(decoder.ReadUint64())
7101 _flowmod.TableId = uint8(decoder.ReadByte())
7102 _flowmod.Command.Decode(decoder)
7103 _flowmod.IdleTimeout = uint16(decoder.ReadUint16())
7104 _flowmod.HardTimeout = uint16(decoder.ReadUint16())
7105 _flowmod.Priority = uint16(decoder.ReadUint16())
7106 _flowmod.BufferId = uint32(decoder.ReadUint32())
7107 _flowmod.OutPort.Decode(decoder)
7108 _flowmod.OutGroup = uint32(decoder.ReadUint32())
7109 _flowmod.Flags = FlowModFlags(decoder.ReadUint16())
7110 decoder.Skip(2)
7111 if err := _flowmod.Match.Decode(decoder); err != nil {
7112 return nil, err
7113 }
7114
7115 decoder.SkipAlign()
7116
7117 for decoder.Length() >= 4 {
7118 item, err := DecodeInstruction(decoder)
7119 if err != nil {
7120 return nil, err
7121 }
7122 if item != nil {
7123 _flowmod.Instructions = append(_flowmod.Instructions, item)
7124 }
7125 }
7126
7127 switch _flowmod.Command {
7128 case 0:
7129 return DecodeFlowAdd(_flowmod, decoder)
7130 case 1:
7131 return DecodeFlowModify(_flowmod, decoder)
7132 case 2:
7133 return DecodeFlowModifyStrict(_flowmod, decoder)
7134 case 3:
7135 return DecodeFlowDelete(_flowmod, decoder)
7136 case 4:
7137 return DecodeFlowDeleteStrict(_flowmod, decoder)
7138 default:
7139 return nil, fmt.Errorf("Invalid type '%d' for 'FlowMod'", _flowmod.Command)
7140 }
7141}
7142
7143func NewFlowMod(__command FmCmd) *FlowMod {
7144 obj := &FlowMod{
7145 Header: NewHeader(14),
7146 }
7147 obj.Command = __command
7148 return obj
7149}
7150
7151type FlowAdd struct {
7152 *FlowMod
7153}
7154
7155type IFlowAdd interface {
7156 IFlowMod
7157}
7158
7159func (self *FlowAdd) Serialize(encoder *goloxi.Encoder) error {
7160 if err := self.FlowMod.Serialize(encoder); err != nil {
7161 return err
7162 }
7163
7164 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
7165
7166 return nil
7167}
7168
7169func DecodeFlowAdd(parent *FlowMod, decoder *goloxi.Decoder) (*FlowAdd, error) {
7170 _flowadd := &FlowAdd{FlowMod: parent}
7171 return _flowadd, nil
7172}
7173
7174func NewFlowAdd() *FlowAdd {
7175 obj := &FlowAdd{
7176 FlowMod: NewFlowMod(0),
7177 }
7178 return obj
7179}
7180
7181type FlowDelete struct {
7182 *FlowMod
7183}
7184
7185type IFlowDelete interface {
7186 IFlowMod
7187}
7188
7189func (self *FlowDelete) Serialize(encoder *goloxi.Encoder) error {
7190 if err := self.FlowMod.Serialize(encoder); err != nil {
7191 return err
7192 }
7193
7194 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
7195
7196 return nil
7197}
7198
7199func DecodeFlowDelete(parent *FlowMod, decoder *goloxi.Decoder) (*FlowDelete, error) {
7200 _flowdelete := &FlowDelete{FlowMod: parent}
7201 return _flowdelete, nil
7202}
7203
7204func NewFlowDelete() *FlowDelete {
7205 obj := &FlowDelete{
7206 FlowMod: NewFlowMod(3),
7207 }
7208 return obj
7209}
7210
7211type FlowDeleteStrict struct {
7212 *FlowMod
7213}
7214
7215type IFlowDeleteStrict interface {
7216 IFlowMod
7217}
7218
7219func (self *FlowDeleteStrict) Serialize(encoder *goloxi.Encoder) error {
7220 if err := self.FlowMod.Serialize(encoder); err != nil {
7221 return err
7222 }
7223
7224 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
7225
7226 return nil
7227}
7228
7229func DecodeFlowDeleteStrict(parent *FlowMod, decoder *goloxi.Decoder) (*FlowDeleteStrict, error) {
7230 _flowdeletestrict := &FlowDeleteStrict{FlowMod: parent}
7231 return _flowdeletestrict, nil
7232}
7233
7234func NewFlowDeleteStrict() *FlowDeleteStrict {
7235 obj := &FlowDeleteStrict{
7236 FlowMod: NewFlowMod(4),
7237 }
7238 return obj
7239}
7240
7241type FlowModFailedErrorMsg struct {
7242 *ErrorMsg
7243 Code FlowModFailedCode
7244 Data []byte
7245}
7246
7247type IFlowModFailedErrorMsg interface {
7248 IErrorMsg
7249 GetCode() FlowModFailedCode
7250 GetData() []byte
7251}
7252
7253func (self *FlowModFailedErrorMsg) GetCode() FlowModFailedCode {
7254 return self.Code
7255}
7256
7257func (self *FlowModFailedErrorMsg) SetCode(v FlowModFailedCode) {
7258 self.Code = v
7259}
7260
7261func (self *FlowModFailedErrorMsg) GetData() []byte {
7262 return self.Data
7263}
7264
7265func (self *FlowModFailedErrorMsg) SetData(v []byte) {
7266 self.Data = v
7267}
7268
7269func (self *FlowModFailedErrorMsg) Serialize(encoder *goloxi.Encoder) error {
7270 if err := self.ErrorMsg.Serialize(encoder); err != nil {
7271 return err
7272 }
7273
7274 encoder.PutUint16(uint16(self.Code))
7275 encoder.Write(self.Data)
7276
7277 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
7278
7279 return nil
7280}
7281
7282func DecodeFlowModFailedErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*FlowModFailedErrorMsg, error) {
7283 _flowmodfailederrormsg := &FlowModFailedErrorMsg{ErrorMsg: parent}
7284 if decoder.Length() < 2 {
7285 return nil, fmt.Errorf("FlowModFailedErrorMsg packet too short: %d < 2", decoder.Length())
7286 }
7287 _flowmodfailederrormsg.Code = FlowModFailedCode(decoder.ReadUint16())
7288 _flowmodfailederrormsg.Data = decoder.Read(int(decoder.Length()))
7289 return _flowmodfailederrormsg, nil
7290}
7291
7292func NewFlowModFailedErrorMsg() *FlowModFailedErrorMsg {
7293 obj := &FlowModFailedErrorMsg{
7294 ErrorMsg: NewErrorMsg(5),
7295 }
7296 return obj
7297}
7298
7299type FlowModify struct {
7300 *FlowMod
7301}
7302
7303type IFlowModify interface {
7304 IFlowMod
7305}
7306
7307func (self *FlowModify) Serialize(encoder *goloxi.Encoder) error {
7308 if err := self.FlowMod.Serialize(encoder); err != nil {
7309 return err
7310 }
7311
7312 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
7313
7314 return nil
7315}
7316
7317func DecodeFlowModify(parent *FlowMod, decoder *goloxi.Decoder) (*FlowModify, error) {
7318 _flowmodify := &FlowModify{FlowMod: parent}
7319 return _flowmodify, nil
7320}
7321
7322func NewFlowModify() *FlowModify {
7323 obj := &FlowModify{
7324 FlowMod: NewFlowMod(1),
7325 }
7326 return obj
7327}
7328
7329type FlowModifyStrict struct {
7330 *FlowMod
7331}
7332
7333type IFlowModifyStrict interface {
7334 IFlowMod
7335}
7336
7337func (self *FlowModifyStrict) Serialize(encoder *goloxi.Encoder) error {
7338 if err := self.FlowMod.Serialize(encoder); err != nil {
7339 return err
7340 }
7341
7342 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
7343
7344 return nil
7345}
7346
7347func DecodeFlowModifyStrict(parent *FlowMod, decoder *goloxi.Decoder) (*FlowModifyStrict, error) {
7348 _flowmodifystrict := &FlowModifyStrict{FlowMod: parent}
7349 return _flowmodifystrict, nil
7350}
7351
7352func NewFlowModifyStrict() *FlowModifyStrict {
7353 obj := &FlowModifyStrict{
7354 FlowMod: NewFlowMod(2),
7355 }
7356 return obj
7357}
7358
7359type FlowRemoved struct {
7360 *Header
7361 Cookie uint64
7362 Priority uint16
7363 Reason FlowRemovedReason
7364 TableId uint8
7365 DurationSec uint32
7366 DurationNsec uint32
7367 IdleTimeout uint16
7368 HardTimeout uint16
7369 PacketCount uint64
7370 ByteCount uint64
7371 Match Match
7372}
7373
7374type IFlowRemoved interface {
7375 IHeader
7376 GetCookie() uint64
7377 GetPriority() uint16
7378 GetReason() FlowRemovedReason
7379 GetTableId() uint8
7380 GetDurationSec() uint32
7381 GetDurationNsec() uint32
7382 GetIdleTimeout() uint16
7383 GetHardTimeout() uint16
7384 GetPacketCount() uint64
7385 GetByteCount() uint64
7386 GetMatch() Match
7387}
7388
7389func (self *FlowRemoved) GetCookie() uint64 {
7390 return self.Cookie
7391}
7392
7393func (self *FlowRemoved) SetCookie(v uint64) {
7394 self.Cookie = v
7395}
7396
7397func (self *FlowRemoved) GetPriority() uint16 {
7398 return self.Priority
7399}
7400
7401func (self *FlowRemoved) SetPriority(v uint16) {
7402 self.Priority = v
7403}
7404
7405func (self *FlowRemoved) GetReason() FlowRemovedReason {
7406 return self.Reason
7407}
7408
7409func (self *FlowRemoved) SetReason(v FlowRemovedReason) {
7410 self.Reason = v
7411}
7412
7413func (self *FlowRemoved) GetTableId() uint8 {
7414 return self.TableId
7415}
7416
7417func (self *FlowRemoved) SetTableId(v uint8) {
7418 self.TableId = v
7419}
7420
7421func (self *FlowRemoved) GetDurationSec() uint32 {
7422 return self.DurationSec
7423}
7424
7425func (self *FlowRemoved) SetDurationSec(v uint32) {
7426 self.DurationSec = v
7427}
7428
7429func (self *FlowRemoved) GetDurationNsec() uint32 {
7430 return self.DurationNsec
7431}
7432
7433func (self *FlowRemoved) SetDurationNsec(v uint32) {
7434 self.DurationNsec = v
7435}
7436
7437func (self *FlowRemoved) GetIdleTimeout() uint16 {
7438 return self.IdleTimeout
7439}
7440
7441func (self *FlowRemoved) SetIdleTimeout(v uint16) {
7442 self.IdleTimeout = v
7443}
7444
7445func (self *FlowRemoved) GetHardTimeout() uint16 {
7446 return self.HardTimeout
7447}
7448
7449func (self *FlowRemoved) SetHardTimeout(v uint16) {
7450 self.HardTimeout = v
7451}
7452
7453func (self *FlowRemoved) GetPacketCount() uint64 {
7454 return self.PacketCount
7455}
7456
7457func (self *FlowRemoved) SetPacketCount(v uint64) {
7458 self.PacketCount = v
7459}
7460
7461func (self *FlowRemoved) GetByteCount() uint64 {
7462 return self.ByteCount
7463}
7464
7465func (self *FlowRemoved) SetByteCount(v uint64) {
7466 self.ByteCount = v
7467}
7468
7469func (self *FlowRemoved) GetMatch() Match {
7470 return self.Match
7471}
7472
7473func (self *FlowRemoved) SetMatch(v Match) {
7474 self.Match = v
7475}
7476
7477func (self *FlowRemoved) Serialize(encoder *goloxi.Encoder) error {
7478 if err := self.Header.Serialize(encoder); err != nil {
7479 return err
7480 }
7481
7482 encoder.PutUint64(uint64(self.Cookie))
7483 encoder.PutUint16(uint16(self.Priority))
7484 encoder.PutUint8(uint8(self.Reason))
7485 encoder.PutUint8(uint8(self.TableId))
7486 encoder.PutUint32(uint32(self.DurationSec))
7487 encoder.PutUint32(uint32(self.DurationNsec))
7488 encoder.PutUint16(uint16(self.IdleTimeout))
7489 encoder.PutUint16(uint16(self.HardTimeout))
7490 encoder.PutUint64(uint64(self.PacketCount))
7491 encoder.PutUint64(uint64(self.ByteCount))
7492 if err := self.Match.Serialize(encoder); err != nil {
7493 return err
7494 }
7495
7496 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
7497
7498 return nil
7499}
7500
7501func DecodeFlowRemoved(parent *Header, decoder *goloxi.Decoder) (*FlowRemoved, error) {
7502 _flowremoved := &FlowRemoved{Header: parent}
7503 if decoder.Length() < 48 {
7504 return nil, fmt.Errorf("FlowRemoved packet too short: %d < 48", decoder.Length())
7505 }
7506 _flowremoved.Cookie = uint64(decoder.ReadUint64())
7507 _flowremoved.Priority = uint16(decoder.ReadUint16())
7508 _flowremoved.Reason = FlowRemovedReason(decoder.ReadByte())
7509 _flowremoved.TableId = uint8(decoder.ReadByte())
7510 _flowremoved.DurationSec = uint32(decoder.ReadUint32())
7511 _flowremoved.DurationNsec = uint32(decoder.ReadUint32())
7512 _flowremoved.IdleTimeout = uint16(decoder.ReadUint16())
7513 _flowremoved.HardTimeout = uint16(decoder.ReadUint16())
7514 _flowremoved.PacketCount = uint64(decoder.ReadUint64())
7515 _flowremoved.ByteCount = uint64(decoder.ReadUint64())
7516 if err := _flowremoved.Match.Decode(decoder); err != nil {
7517 return nil, err
7518 }
7519
7520 decoder.SkipAlign()
7521 return _flowremoved, nil
7522}
7523
7524func NewFlowRemoved() *FlowRemoved {
7525 obj := &FlowRemoved{
7526 Header: NewHeader(11),
7527 }
7528 return obj
7529}
7530
7531type FlowStatsReply struct {
7532 *StatsReply
7533 Entries []*FlowStatsEntry
7534}
7535
7536type IFlowStatsReply interface {
7537 IStatsReply
7538 GetEntries() []*FlowStatsEntry
7539}
7540
7541func (self *FlowStatsReply) GetEntries() []*FlowStatsEntry {
7542 return self.Entries
7543}
7544
7545func (self *FlowStatsReply) SetEntries(v []*FlowStatsEntry) {
7546 self.Entries = v
7547}
7548
7549func (self *FlowStatsReply) Serialize(encoder *goloxi.Encoder) error {
7550 if err := self.StatsReply.Serialize(encoder); err != nil {
7551 return err
7552 }
7553
7554 encoder.Write(bytes.Repeat([]byte{0}, 4))
7555 for _, obj := range self.Entries {
7556 if err := obj.Serialize(encoder); err != nil {
7557 return err
7558 }
7559 }
7560
7561 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
7562
7563 return nil
7564}
7565
7566func DecodeFlowStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*FlowStatsReply, error) {
7567 _flowstatsreply := &FlowStatsReply{StatsReply: parent}
7568 if decoder.Length() < 4 {
7569 return nil, fmt.Errorf("FlowStatsReply packet too short: %d < 4", decoder.Length())
7570 }
7571 decoder.Skip(4)
7572
7573 for decoder.Length() >= 56 {
7574 item, err := DecodeFlowStatsEntry(decoder)
7575 if err != nil {
7576 return nil, err
7577 }
7578 if item != nil {
7579 _flowstatsreply.Entries = append(_flowstatsreply.Entries, item)
7580 }
7581 }
7582 return _flowstatsreply, nil
7583}
7584
7585func NewFlowStatsReply() *FlowStatsReply {
7586 obj := &FlowStatsReply{
7587 StatsReply: NewStatsReply(1),
7588 }
7589 return obj
7590}
7591
7592type FlowStatsRequest struct {
7593 *StatsRequest
7594 TableId uint8
7595 OutPort Port
7596 OutGroup uint32
7597 Cookie uint64
7598 CookieMask uint64
7599 Match Match
7600}
7601
7602type IFlowStatsRequest interface {
7603 IStatsRequest
7604 GetTableId() uint8
7605 GetOutPort() Port
7606 GetOutGroup() uint32
7607 GetCookie() uint64
7608 GetCookieMask() uint64
7609 GetMatch() Match
7610}
7611
7612func (self *FlowStatsRequest) GetTableId() uint8 {
7613 return self.TableId
7614}
7615
7616func (self *FlowStatsRequest) SetTableId(v uint8) {
7617 self.TableId = v
7618}
7619
7620func (self *FlowStatsRequest) GetOutPort() Port {
7621 return self.OutPort
7622}
7623
7624func (self *FlowStatsRequest) SetOutPort(v Port) {
7625 self.OutPort = v
7626}
7627
7628func (self *FlowStatsRequest) GetOutGroup() uint32 {
7629 return self.OutGroup
7630}
7631
7632func (self *FlowStatsRequest) SetOutGroup(v uint32) {
7633 self.OutGroup = v
7634}
7635
7636func (self *FlowStatsRequest) GetCookie() uint64 {
7637 return self.Cookie
7638}
7639
7640func (self *FlowStatsRequest) SetCookie(v uint64) {
7641 self.Cookie = v
7642}
7643
7644func (self *FlowStatsRequest) GetCookieMask() uint64 {
7645 return self.CookieMask
7646}
7647
7648func (self *FlowStatsRequest) SetCookieMask(v uint64) {
7649 self.CookieMask = v
7650}
7651
7652func (self *FlowStatsRequest) GetMatch() Match {
7653 return self.Match
7654}
7655
7656func (self *FlowStatsRequest) SetMatch(v Match) {
7657 self.Match = v
7658}
7659
7660func (self *FlowStatsRequest) Serialize(encoder *goloxi.Encoder) error {
7661 if err := self.StatsRequest.Serialize(encoder); err != nil {
7662 return err
7663 }
7664
7665 encoder.Write(bytes.Repeat([]byte{0}, 4))
7666 encoder.PutUint8(uint8(self.TableId))
7667 encoder.Write(bytes.Repeat([]byte{0}, 3))
7668 self.OutPort.Serialize(encoder)
7669 encoder.PutUint32(uint32(self.OutGroup))
7670 encoder.Write(bytes.Repeat([]byte{0}, 4))
7671 encoder.PutUint64(uint64(self.Cookie))
7672 encoder.PutUint64(uint64(self.CookieMask))
7673 if err := self.Match.Serialize(encoder); err != nil {
7674 return err
7675 }
7676
7677 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
7678
7679 return nil
7680}
7681
7682func DecodeFlowStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*FlowStatsRequest, error) {
7683 _flowstatsrequest := &FlowStatsRequest{StatsRequest: parent}
7684 if decoder.Length() < 28 {
7685 return nil, fmt.Errorf("FlowStatsRequest packet too short: %d < 28", decoder.Length())
7686 }
7687 decoder.Skip(4)
7688 _flowstatsrequest.TableId = uint8(decoder.ReadByte())
7689 decoder.Skip(3)
7690 _flowstatsrequest.OutPort.Decode(decoder)
7691 _flowstatsrequest.OutGroup = uint32(decoder.ReadUint32())
7692 decoder.Skip(4)
7693 _flowstatsrequest.Cookie = uint64(decoder.ReadUint64())
7694 _flowstatsrequest.CookieMask = uint64(decoder.ReadUint64())
7695 if err := _flowstatsrequest.Match.Decode(decoder); err != nil {
7696 return nil, err
7697 }
7698
7699 decoder.SkipAlign()
7700 return _flowstatsrequest, nil
7701}
7702
7703func NewFlowStatsRequest() *FlowStatsRequest {
7704 obj := &FlowStatsRequest{
7705 StatsRequest: NewStatsRequest(1),
7706 }
7707 return obj
7708}
7709
7710type GetConfigReply struct {
7711 *Header
7712 Flags ConfigFlags
7713 MissSendLen uint16
7714}
7715
7716type IGetConfigReply interface {
7717 IHeader
7718 GetFlags() ConfigFlags
7719 GetMissSendLen() uint16
7720}
7721
7722func (self *GetConfigReply) GetFlags() ConfigFlags {
7723 return self.Flags
7724}
7725
7726func (self *GetConfigReply) SetFlags(v ConfigFlags) {
7727 self.Flags = v
7728}
7729
7730func (self *GetConfigReply) GetMissSendLen() uint16 {
7731 return self.MissSendLen
7732}
7733
7734func (self *GetConfigReply) SetMissSendLen(v uint16) {
7735 self.MissSendLen = v
7736}
7737
7738func (self *GetConfigReply) Serialize(encoder *goloxi.Encoder) error {
7739 if err := self.Header.Serialize(encoder); err != nil {
7740 return err
7741 }
7742
7743 encoder.PutUint16(uint16(self.Flags))
7744 encoder.PutUint16(uint16(self.MissSendLen))
7745
7746 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
7747
7748 return nil
7749}
7750
7751func DecodeGetConfigReply(parent *Header, decoder *goloxi.Decoder) (*GetConfigReply, error) {
7752 _getconfigreply := &GetConfigReply{Header: parent}
7753 if decoder.Length() < 4 {
7754 return nil, fmt.Errorf("GetConfigReply packet too short: %d < 4", decoder.Length())
7755 }
7756 _getconfigreply.Flags = ConfigFlags(decoder.ReadUint16())
7757 _getconfigreply.MissSendLen = uint16(decoder.ReadUint16())
7758 return _getconfigreply, nil
7759}
7760
7761func NewGetConfigReply() *GetConfigReply {
7762 obj := &GetConfigReply{
7763 Header: NewHeader(8),
7764 }
7765 return obj
7766}
7767
7768type GetConfigRequest struct {
7769 *Header
7770}
7771
7772type IGetConfigRequest interface {
7773 IHeader
7774}
7775
7776func (self *GetConfigRequest) Serialize(encoder *goloxi.Encoder) error {
7777 if err := self.Header.Serialize(encoder); err != nil {
7778 return err
7779 }
7780
7781 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
7782
7783 return nil
7784}
7785
7786func DecodeGetConfigRequest(parent *Header, decoder *goloxi.Decoder) (*GetConfigRequest, error) {
7787 _getconfigrequest := &GetConfigRequest{Header: parent}
7788 return _getconfigrequest, nil
7789}
7790
7791func NewGetConfigRequest() *GetConfigRequest {
7792 obj := &GetConfigRequest{
7793 Header: NewHeader(7),
7794 }
7795 return obj
7796}
7797
7798type GroupMod struct {
7799 *Header
7800 Command GroupModCommand
7801 GroupType GroupType
7802 GroupId uint32
7803 Buckets []*Bucket
7804}
7805
7806type IGroupMod interface {
7807 IHeader
7808 GetCommand() GroupModCommand
7809 GetGroupType() GroupType
7810 GetGroupId() uint32
7811 GetBuckets() []*Bucket
7812}
7813
7814func (self *GroupMod) GetCommand() GroupModCommand {
7815 return self.Command
7816}
7817
7818func (self *GroupMod) SetCommand(v GroupModCommand) {
7819 self.Command = v
7820}
7821
7822func (self *GroupMod) GetGroupType() GroupType {
7823 return self.GroupType
7824}
7825
7826func (self *GroupMod) SetGroupType(v GroupType) {
7827 self.GroupType = v
7828}
7829
7830func (self *GroupMod) GetGroupId() uint32 {
7831 return self.GroupId
7832}
7833
7834func (self *GroupMod) SetGroupId(v uint32) {
7835 self.GroupId = v
7836}
7837
7838func (self *GroupMod) GetBuckets() []*Bucket {
7839 return self.Buckets
7840}
7841
7842func (self *GroupMod) SetBuckets(v []*Bucket) {
7843 self.Buckets = v
7844}
7845
7846func (self *GroupMod) Serialize(encoder *goloxi.Encoder) error {
7847 if err := self.Header.Serialize(encoder); err != nil {
7848 return err
7849 }
7850
7851 encoder.PutUint16(uint16(self.Command))
7852 encoder.PutUint8(uint8(self.GroupType))
7853 encoder.Write(bytes.Repeat([]byte{0}, 1))
7854 encoder.PutUint32(uint32(self.GroupId))
7855 for _, obj := range self.Buckets {
7856 if err := obj.Serialize(encoder); err != nil {
7857 return err
7858 }
7859 }
7860
7861 return nil
7862}
7863
7864func DecodeGroupMod(parent *Header, decoder *goloxi.Decoder) (IGroupMod, error) {
7865 _groupmod := &GroupMod{Header: parent}
7866 if decoder.Length() < 8 {
7867 return nil, fmt.Errorf("GroupMod packet too short: %d < 8", decoder.Length())
7868 }
7869 _groupmod.Command = GroupModCommand(decoder.ReadUint16())
7870 _groupmod.GroupType = GroupType(decoder.ReadByte())
7871 decoder.Skip(1)
7872 _groupmod.GroupId = uint32(decoder.ReadUint32())
7873
7874 for decoder.Length() >= 16 {
7875 item, err := DecodeBucket(decoder)
7876 if err != nil {
7877 return nil, err
7878 }
7879 if item != nil {
7880 _groupmod.Buckets = append(_groupmod.Buckets, item)
7881 }
7882 }
7883
7884 switch _groupmod.Command {
7885 case 0:
7886 return DecodeGroupAdd(_groupmod, decoder)
7887 case 1:
7888 return DecodeGroupModify(_groupmod, decoder)
7889 case 2:
7890 return DecodeGroupDelete(_groupmod, decoder)
7891 default:
7892 return nil, fmt.Errorf("Invalid type '%d' for 'GroupMod'", _groupmod.Command)
7893 }
7894}
7895
7896func NewGroupMod(_command GroupModCommand) *GroupMod {
7897 obj := &GroupMod{
7898 Header: NewHeader(15),
7899 }
7900 obj.Command = _command
7901 return obj
7902}
7903
7904type GroupAdd struct {
7905 *GroupMod
7906}
7907
7908type IGroupAdd interface {
7909 IGroupMod
7910}
7911
7912func (self *GroupAdd) Serialize(encoder *goloxi.Encoder) error {
7913 if err := self.GroupMod.Serialize(encoder); err != nil {
7914 return err
7915 }
7916
7917 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
7918
7919 return nil
7920}
7921
7922func DecodeGroupAdd(parent *GroupMod, decoder *goloxi.Decoder) (*GroupAdd, error) {
7923 _groupadd := &GroupAdd{GroupMod: parent}
7924 return _groupadd, nil
7925}
7926
7927func NewGroupAdd() *GroupAdd {
7928 obj := &GroupAdd{
7929 GroupMod: NewGroupMod(0),
7930 }
7931 return obj
7932}
7933
7934type GroupDelete struct {
7935 *GroupMod
7936}
7937
7938type IGroupDelete interface {
7939 IGroupMod
7940}
7941
7942func (self *GroupDelete) Serialize(encoder *goloxi.Encoder) error {
7943 if err := self.GroupMod.Serialize(encoder); err != nil {
7944 return err
7945 }
7946
7947 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
7948
7949 return nil
7950}
7951
7952func DecodeGroupDelete(parent *GroupMod, decoder *goloxi.Decoder) (*GroupDelete, error) {
7953 _groupdelete := &GroupDelete{GroupMod: parent}
7954 return _groupdelete, nil
7955}
7956
7957func NewGroupDelete() *GroupDelete {
7958 obj := &GroupDelete{
7959 GroupMod: NewGroupMod(2),
7960 }
7961 return obj
7962}
7963
7964type GroupDescStatsReply struct {
7965 *StatsReply
7966 Entries []*GroupDescStatsEntry
7967}
7968
7969type IGroupDescStatsReply interface {
7970 IStatsReply
7971 GetEntries() []*GroupDescStatsEntry
7972}
7973
7974func (self *GroupDescStatsReply) GetEntries() []*GroupDescStatsEntry {
7975 return self.Entries
7976}
7977
7978func (self *GroupDescStatsReply) SetEntries(v []*GroupDescStatsEntry) {
7979 self.Entries = v
7980}
7981
7982func (self *GroupDescStatsReply) Serialize(encoder *goloxi.Encoder) error {
7983 if err := self.StatsReply.Serialize(encoder); err != nil {
7984 return err
7985 }
7986
7987 encoder.Write(bytes.Repeat([]byte{0}, 4))
7988 for _, obj := range self.Entries {
7989 if err := obj.Serialize(encoder); err != nil {
7990 return err
7991 }
7992 }
7993
7994 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
7995
7996 return nil
7997}
7998
7999func DecodeGroupDescStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*GroupDescStatsReply, error) {
8000 _groupdescstatsreply := &GroupDescStatsReply{StatsReply: parent}
8001 if decoder.Length() < 4 {
8002 return nil, fmt.Errorf("GroupDescStatsReply packet too short: %d < 4", decoder.Length())
8003 }
8004 decoder.Skip(4)
8005
8006 for decoder.Length() >= 8 {
8007 item, err := DecodeGroupDescStatsEntry(decoder)
8008 if err != nil {
8009 return nil, err
8010 }
8011 if item != nil {
8012 _groupdescstatsreply.Entries = append(_groupdescstatsreply.Entries, item)
8013 }
8014 }
8015 return _groupdescstatsreply, nil
8016}
8017
8018func NewGroupDescStatsReply() *GroupDescStatsReply {
8019 obj := &GroupDescStatsReply{
8020 StatsReply: NewStatsReply(7),
8021 }
8022 return obj
8023}
8024
8025type GroupDescStatsRequest struct {
8026 *StatsRequest
8027}
8028
8029type IGroupDescStatsRequest interface {
8030 IStatsRequest
8031}
8032
8033func (self *GroupDescStatsRequest) Serialize(encoder *goloxi.Encoder) error {
8034 if err := self.StatsRequest.Serialize(encoder); err != nil {
8035 return err
8036 }
8037
8038 encoder.Write(bytes.Repeat([]byte{0}, 4))
8039
8040 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
8041
8042 return nil
8043}
8044
8045func DecodeGroupDescStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*GroupDescStatsRequest, error) {
8046 _groupdescstatsrequest := &GroupDescStatsRequest{StatsRequest: parent}
8047 if decoder.Length() < 4 {
8048 return nil, fmt.Errorf("GroupDescStatsRequest packet too short: %d < 4", decoder.Length())
8049 }
8050 decoder.Skip(4)
8051 return _groupdescstatsrequest, nil
8052}
8053
8054func NewGroupDescStatsRequest() *GroupDescStatsRequest {
8055 obj := &GroupDescStatsRequest{
8056 StatsRequest: NewStatsRequest(7),
8057 }
8058 return obj
8059}
8060
8061type GroupFeaturesStatsReply struct {
8062 *StatsReply
8063 Types uint32
8064 Capabilities GroupCapabilities
8065 MaxGroupsAll uint32
8066 MaxGroupsSelect uint32
8067 MaxGroupsIndirect uint32
8068 MaxGroupsFf uint32
8069 ActionsAll uint32
8070 ActionsSelect uint32
8071 ActionsIndirect uint32
8072 ActionsFf uint32
8073}
8074
8075type IGroupFeaturesStatsReply interface {
8076 IStatsReply
8077 GetTypes() uint32
8078 GetCapabilities() GroupCapabilities
8079 GetMaxGroupsAll() uint32
8080 GetMaxGroupsSelect() uint32
8081 GetMaxGroupsIndirect() uint32
8082 GetMaxGroupsFf() uint32
8083 GetActionsAll() uint32
8084 GetActionsSelect() uint32
8085 GetActionsIndirect() uint32
8086 GetActionsFf() uint32
8087}
8088
8089func (self *GroupFeaturesStatsReply) GetTypes() uint32 {
8090 return self.Types
8091}
8092
8093func (self *GroupFeaturesStatsReply) SetTypes(v uint32) {
8094 self.Types = v
8095}
8096
8097func (self *GroupFeaturesStatsReply) GetCapabilities() GroupCapabilities {
8098 return self.Capabilities
8099}
8100
8101func (self *GroupFeaturesStatsReply) SetCapabilities(v GroupCapabilities) {
8102 self.Capabilities = v
8103}
8104
8105func (self *GroupFeaturesStatsReply) GetMaxGroupsAll() uint32 {
8106 return self.MaxGroupsAll
8107}
8108
8109func (self *GroupFeaturesStatsReply) SetMaxGroupsAll(v uint32) {
8110 self.MaxGroupsAll = v
8111}
8112
8113func (self *GroupFeaturesStatsReply) GetMaxGroupsSelect() uint32 {
8114 return self.MaxGroupsSelect
8115}
8116
8117func (self *GroupFeaturesStatsReply) SetMaxGroupsSelect(v uint32) {
8118 self.MaxGroupsSelect = v
8119}
8120
8121func (self *GroupFeaturesStatsReply) GetMaxGroupsIndirect() uint32 {
8122 return self.MaxGroupsIndirect
8123}
8124
8125func (self *GroupFeaturesStatsReply) SetMaxGroupsIndirect(v uint32) {
8126 self.MaxGroupsIndirect = v
8127}
8128
8129func (self *GroupFeaturesStatsReply) GetMaxGroupsFf() uint32 {
8130 return self.MaxGroupsFf
8131}
8132
8133func (self *GroupFeaturesStatsReply) SetMaxGroupsFf(v uint32) {
8134 self.MaxGroupsFf = v
8135}
8136
8137func (self *GroupFeaturesStatsReply) GetActionsAll() uint32 {
8138 return self.ActionsAll
8139}
8140
8141func (self *GroupFeaturesStatsReply) SetActionsAll(v uint32) {
8142 self.ActionsAll = v
8143}
8144
8145func (self *GroupFeaturesStatsReply) GetActionsSelect() uint32 {
8146 return self.ActionsSelect
8147}
8148
8149func (self *GroupFeaturesStatsReply) SetActionsSelect(v uint32) {
8150 self.ActionsSelect = v
8151}
8152
8153func (self *GroupFeaturesStatsReply) GetActionsIndirect() uint32 {
8154 return self.ActionsIndirect
8155}
8156
8157func (self *GroupFeaturesStatsReply) SetActionsIndirect(v uint32) {
8158 self.ActionsIndirect = v
8159}
8160
8161func (self *GroupFeaturesStatsReply) GetActionsFf() uint32 {
8162 return self.ActionsFf
8163}
8164
8165func (self *GroupFeaturesStatsReply) SetActionsFf(v uint32) {
8166 self.ActionsFf = v
8167}
8168
8169func (self *GroupFeaturesStatsReply) Serialize(encoder *goloxi.Encoder) error {
8170 if err := self.StatsReply.Serialize(encoder); err != nil {
8171 return err
8172 }
8173
8174 encoder.Write(bytes.Repeat([]byte{0}, 4))
8175 encoder.PutUint32(uint32(self.Types))
8176 encoder.PutUint32(uint32(self.Capabilities))
8177 encoder.PutUint32(uint32(self.MaxGroupsAll))
8178 encoder.PutUint32(uint32(self.MaxGroupsSelect))
8179 encoder.PutUint32(uint32(self.MaxGroupsIndirect))
8180 encoder.PutUint32(uint32(self.MaxGroupsFf))
8181 encoder.PutUint32(uint32(self.ActionsAll))
8182 encoder.PutUint32(uint32(self.ActionsSelect))
8183 encoder.PutUint32(uint32(self.ActionsIndirect))
8184 encoder.PutUint32(uint32(self.ActionsFf))
8185
8186 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
8187
8188 return nil
8189}
8190
8191func DecodeGroupFeaturesStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*GroupFeaturesStatsReply, error) {
8192 _groupfeaturesstatsreply := &GroupFeaturesStatsReply{StatsReply: parent}
8193 if decoder.Length() < 44 {
8194 return nil, fmt.Errorf("GroupFeaturesStatsReply packet too short: %d < 44", decoder.Length())
8195 }
8196 decoder.Skip(4)
8197 _groupfeaturesstatsreply.Types = uint32(decoder.ReadUint32())
8198 _groupfeaturesstatsreply.Capabilities = GroupCapabilities(decoder.ReadUint32())
8199 _groupfeaturesstatsreply.MaxGroupsAll = uint32(decoder.ReadUint32())
8200 _groupfeaturesstatsreply.MaxGroupsSelect = uint32(decoder.ReadUint32())
8201 _groupfeaturesstatsreply.MaxGroupsIndirect = uint32(decoder.ReadUint32())
8202 _groupfeaturesstatsreply.MaxGroupsFf = uint32(decoder.ReadUint32())
8203 _groupfeaturesstatsreply.ActionsAll = uint32(decoder.ReadUint32())
8204 _groupfeaturesstatsreply.ActionsSelect = uint32(decoder.ReadUint32())
8205 _groupfeaturesstatsreply.ActionsIndirect = uint32(decoder.ReadUint32())
8206 _groupfeaturesstatsreply.ActionsFf = uint32(decoder.ReadUint32())
8207 return _groupfeaturesstatsreply, nil
8208}
8209
8210func NewGroupFeaturesStatsReply() *GroupFeaturesStatsReply {
8211 obj := &GroupFeaturesStatsReply{
8212 StatsReply: NewStatsReply(8),
8213 }
8214 return obj
8215}
8216
8217type GroupFeaturesStatsRequest struct {
8218 *StatsRequest
8219}
8220
8221type IGroupFeaturesStatsRequest interface {
8222 IStatsRequest
8223}
8224
8225func (self *GroupFeaturesStatsRequest) Serialize(encoder *goloxi.Encoder) error {
8226 if err := self.StatsRequest.Serialize(encoder); err != nil {
8227 return err
8228 }
8229
8230 encoder.Write(bytes.Repeat([]byte{0}, 4))
8231
8232 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
8233
8234 return nil
8235}
8236
8237func DecodeGroupFeaturesStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*GroupFeaturesStatsRequest, error) {
8238 _groupfeaturesstatsrequest := &GroupFeaturesStatsRequest{StatsRequest: parent}
8239 if decoder.Length() < 4 {
8240 return nil, fmt.Errorf("GroupFeaturesStatsRequest packet too short: %d < 4", decoder.Length())
8241 }
8242 decoder.Skip(4)
8243 return _groupfeaturesstatsrequest, nil
8244}
8245
8246func NewGroupFeaturesStatsRequest() *GroupFeaturesStatsRequest {
8247 obj := &GroupFeaturesStatsRequest{
8248 StatsRequest: NewStatsRequest(8),
8249 }
8250 return obj
8251}
8252
8253type GroupModFailedErrorMsg struct {
8254 *ErrorMsg
8255 Code GroupModFailedCode
8256 Data []byte
8257}
8258
8259type IGroupModFailedErrorMsg interface {
8260 IErrorMsg
8261 GetCode() GroupModFailedCode
8262 GetData() []byte
8263}
8264
8265func (self *GroupModFailedErrorMsg) GetCode() GroupModFailedCode {
8266 return self.Code
8267}
8268
8269func (self *GroupModFailedErrorMsg) SetCode(v GroupModFailedCode) {
8270 self.Code = v
8271}
8272
8273func (self *GroupModFailedErrorMsg) GetData() []byte {
8274 return self.Data
8275}
8276
8277func (self *GroupModFailedErrorMsg) SetData(v []byte) {
8278 self.Data = v
8279}
8280
8281func (self *GroupModFailedErrorMsg) Serialize(encoder *goloxi.Encoder) error {
8282 if err := self.ErrorMsg.Serialize(encoder); err != nil {
8283 return err
8284 }
8285
8286 encoder.PutUint16(uint16(self.Code))
8287 encoder.Write(self.Data)
8288
8289 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
8290
8291 return nil
8292}
8293
8294func DecodeGroupModFailedErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*GroupModFailedErrorMsg, error) {
8295 _groupmodfailederrormsg := &GroupModFailedErrorMsg{ErrorMsg: parent}
8296 if decoder.Length() < 2 {
8297 return nil, fmt.Errorf("GroupModFailedErrorMsg packet too short: %d < 2", decoder.Length())
8298 }
8299 _groupmodfailederrormsg.Code = GroupModFailedCode(decoder.ReadUint16())
8300 _groupmodfailederrormsg.Data = decoder.Read(int(decoder.Length()))
8301 return _groupmodfailederrormsg, nil
8302}
8303
8304func NewGroupModFailedErrorMsg() *GroupModFailedErrorMsg {
8305 obj := &GroupModFailedErrorMsg{
8306 ErrorMsg: NewErrorMsg(6),
8307 }
8308 return obj
8309}
8310
8311type GroupModify struct {
8312 *GroupMod
8313}
8314
8315type IGroupModify interface {
8316 IGroupMod
8317}
8318
8319func (self *GroupModify) Serialize(encoder *goloxi.Encoder) error {
8320 if err := self.GroupMod.Serialize(encoder); err != nil {
8321 return err
8322 }
8323
8324 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
8325
8326 return nil
8327}
8328
8329func DecodeGroupModify(parent *GroupMod, decoder *goloxi.Decoder) (*GroupModify, error) {
8330 _groupmodify := &GroupModify{GroupMod: parent}
8331 return _groupmodify, nil
8332}
8333
8334func NewGroupModify() *GroupModify {
8335 obj := &GroupModify{
8336 GroupMod: NewGroupMod(1),
8337 }
8338 return obj
8339}
8340
8341type GroupStatsReply struct {
8342 *StatsReply
8343 Entries []*GroupStatsEntry
8344}
8345
8346type IGroupStatsReply interface {
8347 IStatsReply
8348 GetEntries() []*GroupStatsEntry
8349}
8350
8351func (self *GroupStatsReply) GetEntries() []*GroupStatsEntry {
8352 return self.Entries
8353}
8354
8355func (self *GroupStatsReply) SetEntries(v []*GroupStatsEntry) {
8356 self.Entries = v
8357}
8358
8359func (self *GroupStatsReply) Serialize(encoder *goloxi.Encoder) error {
8360 if err := self.StatsReply.Serialize(encoder); err != nil {
8361 return err
8362 }
8363
8364 encoder.Write(bytes.Repeat([]byte{0}, 4))
8365 for _, obj := range self.Entries {
8366 if err := obj.Serialize(encoder); err != nil {
8367 return err
8368 }
8369 }
8370
8371 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
8372
8373 return nil
8374}
8375
8376func DecodeGroupStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*GroupStatsReply, error) {
8377 _groupstatsreply := &GroupStatsReply{StatsReply: parent}
8378 if decoder.Length() < 4 {
8379 return nil, fmt.Errorf("GroupStatsReply packet too short: %d < 4", decoder.Length())
8380 }
8381 decoder.Skip(4)
8382
8383 for decoder.Length() >= 40 {
8384 item, err := DecodeGroupStatsEntry(decoder)
8385 if err != nil {
8386 return nil, err
8387 }
8388 if item != nil {
8389 _groupstatsreply.Entries = append(_groupstatsreply.Entries, item)
8390 }
8391 }
8392 return _groupstatsreply, nil
8393}
8394
8395func NewGroupStatsReply() *GroupStatsReply {
8396 obj := &GroupStatsReply{
8397 StatsReply: NewStatsReply(6),
8398 }
8399 return obj
8400}
8401
8402type GroupStatsRequest struct {
8403 *StatsRequest
8404 GroupId uint32
8405}
8406
8407type IGroupStatsRequest interface {
8408 IStatsRequest
8409 GetGroupId() uint32
8410}
8411
8412func (self *GroupStatsRequest) GetGroupId() uint32 {
8413 return self.GroupId
8414}
8415
8416func (self *GroupStatsRequest) SetGroupId(v uint32) {
8417 self.GroupId = v
8418}
8419
8420func (self *GroupStatsRequest) Serialize(encoder *goloxi.Encoder) error {
8421 if err := self.StatsRequest.Serialize(encoder); err != nil {
8422 return err
8423 }
8424
8425 encoder.Write(bytes.Repeat([]byte{0}, 4))
8426 encoder.PutUint32(uint32(self.GroupId))
8427 encoder.Write(bytes.Repeat([]byte{0}, 4))
8428
8429 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
8430
8431 return nil
8432}
8433
8434func DecodeGroupStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*GroupStatsRequest, error) {
8435 _groupstatsrequest := &GroupStatsRequest{StatsRequest: parent}
8436 if decoder.Length() < 4 {
8437 return nil, fmt.Errorf("GroupStatsRequest packet too short: %d < 4", decoder.Length())
8438 }
8439 decoder.Skip(4)
8440 _groupstatsrequest.GroupId = uint32(decoder.ReadUint32())
8441 decoder.Skip(4)
8442 return _groupstatsrequest, nil
8443}
8444
8445func NewGroupStatsRequest() *GroupStatsRequest {
8446 obj := &GroupStatsRequest{
8447 StatsRequest: NewStatsRequest(6),
8448 }
8449 return obj
8450}
8451
8452type Hello struct {
8453 *Header
8454 Elements []IHelloElem
8455}
8456
8457type IHello interface {
8458 IHeader
8459 GetElements() []IHelloElem
8460}
8461
8462func (self *Hello) GetElements() []IHelloElem {
8463 return self.Elements
8464}
8465
8466func (self *Hello) SetElements(v []IHelloElem) {
8467 self.Elements = v
8468}
8469
8470func (self *Hello) Serialize(encoder *goloxi.Encoder) error {
8471 if err := self.Header.Serialize(encoder); err != nil {
8472 return err
8473 }
8474
8475 for _, obj := range self.Elements {
8476 if err := obj.Serialize(encoder); err != nil {
8477 return err
8478 }
8479 }
8480
8481 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
8482
8483 return nil
8484}
8485
8486func DecodeHello(parent *Header, decoder *goloxi.Decoder) (*Hello, error) {
8487 _hello := &Hello{Header: parent}
8488
8489 for decoder.Length() >= 4 {
8490 item, err := DecodeHelloElem(decoder)
8491 if err != nil {
8492 return nil, err
8493 }
8494 if item != nil {
8495 _hello.Elements = append(_hello.Elements, item)
8496 }
8497 }
8498 return _hello, nil
8499}
8500
8501func NewHello() *Hello {
8502 obj := &Hello{
8503 Header: NewHeader(0),
8504 }
8505 return obj
8506}
8507
8508type HelloFailedErrorMsg struct {
8509 *ErrorMsg
8510 Code HelloFailedCode
8511 Data []byte
8512}
8513
8514type IHelloFailedErrorMsg interface {
8515 IErrorMsg
8516 GetCode() HelloFailedCode
8517 GetData() []byte
8518}
8519
8520func (self *HelloFailedErrorMsg) GetCode() HelloFailedCode {
8521 return self.Code
8522}
8523
8524func (self *HelloFailedErrorMsg) SetCode(v HelloFailedCode) {
8525 self.Code = v
8526}
8527
8528func (self *HelloFailedErrorMsg) GetData() []byte {
8529 return self.Data
8530}
8531
8532func (self *HelloFailedErrorMsg) SetData(v []byte) {
8533 self.Data = v
8534}
8535
8536func (self *HelloFailedErrorMsg) Serialize(encoder *goloxi.Encoder) error {
8537 if err := self.ErrorMsg.Serialize(encoder); err != nil {
8538 return err
8539 }
8540
8541 encoder.PutUint16(uint16(self.Code))
8542 encoder.Write(self.Data)
8543
8544 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
8545
8546 return nil
8547}
8548
8549func DecodeHelloFailedErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*HelloFailedErrorMsg, error) {
8550 _hellofailederrormsg := &HelloFailedErrorMsg{ErrorMsg: parent}
8551 if decoder.Length() < 2 {
8552 return nil, fmt.Errorf("HelloFailedErrorMsg packet too short: %d < 2", decoder.Length())
8553 }
8554 _hellofailederrormsg.Code = HelloFailedCode(decoder.ReadUint16())
8555 _hellofailederrormsg.Data = decoder.Read(int(decoder.Length()))
8556 return _hellofailederrormsg, nil
8557}
8558
8559func NewHelloFailedErrorMsg() *HelloFailedErrorMsg {
8560 obj := &HelloFailedErrorMsg{
8561 ErrorMsg: NewErrorMsg(0),
8562 }
8563 return obj
8564}
8565
8566type MeterConfigStatsReply struct {
8567 *StatsReply
8568 Entries []*MeterConfig
8569}
8570
8571type IMeterConfigStatsReply interface {
8572 IStatsReply
8573 GetEntries() []*MeterConfig
8574}
8575
8576func (self *MeterConfigStatsReply) GetEntries() []*MeterConfig {
8577 return self.Entries
8578}
8579
8580func (self *MeterConfigStatsReply) SetEntries(v []*MeterConfig) {
8581 self.Entries = v
8582}
8583
8584func (self *MeterConfigStatsReply) Serialize(encoder *goloxi.Encoder) error {
8585 if err := self.StatsReply.Serialize(encoder); err != nil {
8586 return err
8587 }
8588
8589 encoder.Write(bytes.Repeat([]byte{0}, 4))
8590 for _, obj := range self.Entries {
8591 if err := obj.Serialize(encoder); err != nil {
8592 return err
8593 }
8594 }
8595
8596 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
8597
8598 return nil
8599}
8600
8601func DecodeMeterConfigStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*MeterConfigStatsReply, error) {
8602 _meterconfigstatsreply := &MeterConfigStatsReply{StatsReply: parent}
8603 if decoder.Length() < 4 {
8604 return nil, fmt.Errorf("MeterConfigStatsReply packet too short: %d < 4", decoder.Length())
8605 }
8606 decoder.Skip(4)
8607
8608 for decoder.Length() >= 8 {
8609 item, err := DecodeMeterConfig(decoder)
8610 if err != nil {
8611 return nil, err
8612 }
8613 if item != nil {
8614 _meterconfigstatsreply.Entries = append(_meterconfigstatsreply.Entries, item)
8615 }
8616 }
8617 return _meterconfigstatsreply, nil
8618}
8619
8620func NewMeterConfigStatsReply() *MeterConfigStatsReply {
8621 obj := &MeterConfigStatsReply{
8622 StatsReply: NewStatsReply(10),
8623 }
8624 return obj
8625}
8626
8627type MeterConfigStatsRequest struct {
8628 *StatsRequest
8629 MeterId uint32
8630}
8631
8632type IMeterConfigStatsRequest interface {
8633 IStatsRequest
8634 GetMeterId() uint32
8635}
8636
8637func (self *MeterConfigStatsRequest) GetMeterId() uint32 {
8638 return self.MeterId
8639}
8640
8641func (self *MeterConfigStatsRequest) SetMeterId(v uint32) {
8642 self.MeterId = v
8643}
8644
8645func (self *MeterConfigStatsRequest) Serialize(encoder *goloxi.Encoder) error {
8646 if err := self.StatsRequest.Serialize(encoder); err != nil {
8647 return err
8648 }
8649
8650 encoder.Write(bytes.Repeat([]byte{0}, 4))
8651 encoder.PutUint32(uint32(self.MeterId))
8652 encoder.Write(bytes.Repeat([]byte{0}, 4))
8653
8654 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
8655
8656 return nil
8657}
8658
8659func DecodeMeterConfigStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*MeterConfigStatsRequest, error) {
8660 _meterconfigstatsrequest := &MeterConfigStatsRequest{StatsRequest: parent}
8661 if decoder.Length() < 4 {
8662 return nil, fmt.Errorf("MeterConfigStatsRequest packet too short: %d < 4", decoder.Length())
8663 }
8664 decoder.Skip(4)
8665 _meterconfigstatsrequest.MeterId = uint32(decoder.ReadUint32())
8666 decoder.Skip(4)
8667 return _meterconfigstatsrequest, nil
8668}
8669
8670func NewMeterConfigStatsRequest() *MeterConfigStatsRequest {
8671 obj := &MeterConfigStatsRequest{
8672 StatsRequest: NewStatsRequest(10),
8673 }
8674 return obj
8675}
8676
8677type MeterFeaturesStatsReply struct {
8678 *StatsReply
8679 Features MeterFeatures
8680}
8681
8682type IMeterFeaturesStatsReply interface {
8683 IStatsReply
8684 GetFeatures() MeterFeatures
8685}
8686
8687func (self *MeterFeaturesStatsReply) GetFeatures() MeterFeatures {
8688 return self.Features
8689}
8690
8691func (self *MeterFeaturesStatsReply) SetFeatures(v MeterFeatures) {
8692 self.Features = v
8693}
8694
8695func (self *MeterFeaturesStatsReply) Serialize(encoder *goloxi.Encoder) error {
8696 if err := self.StatsReply.Serialize(encoder); err != nil {
8697 return err
8698 }
8699
8700 encoder.Write(bytes.Repeat([]byte{0}, 4))
8701 if err := self.Features.Serialize(encoder); err != nil {
8702 return err
8703 }
8704
8705 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
8706
8707 return nil
8708}
8709
8710func DecodeMeterFeaturesStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*MeterFeaturesStatsReply, error) {
8711 _meterfeaturesstatsreply := &MeterFeaturesStatsReply{StatsReply: parent}
8712 if decoder.Length() < 20 {
8713 return nil, fmt.Errorf("MeterFeaturesStatsReply packet too short: %d < 20", decoder.Length())
8714 }
8715 decoder.Skip(4)
8716 if err := _meterfeaturesstatsreply.Features.Decode(decoder); err != nil {
8717 return nil, err
8718 }
8719
8720 return _meterfeaturesstatsreply, nil
8721}
8722
8723func NewMeterFeaturesStatsReply() *MeterFeaturesStatsReply {
8724 obj := &MeterFeaturesStatsReply{
8725 StatsReply: NewStatsReply(11),
8726 }
8727 return obj
8728}
8729
8730type MeterFeaturesStatsRequest struct {
8731 *StatsRequest
8732}
8733
8734type IMeterFeaturesStatsRequest interface {
8735 IStatsRequest
8736}
8737
8738func (self *MeterFeaturesStatsRequest) Serialize(encoder *goloxi.Encoder) error {
8739 if err := self.StatsRequest.Serialize(encoder); err != nil {
8740 return err
8741 }
8742
8743 encoder.Write(bytes.Repeat([]byte{0}, 4))
8744
8745 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
8746
8747 return nil
8748}
8749
8750func DecodeMeterFeaturesStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*MeterFeaturesStatsRequest, error) {
8751 _meterfeaturesstatsrequest := &MeterFeaturesStatsRequest{StatsRequest: parent}
8752 if decoder.Length() < 4 {
8753 return nil, fmt.Errorf("MeterFeaturesStatsRequest packet too short: %d < 4", decoder.Length())
8754 }
8755 decoder.Skip(4)
8756 return _meterfeaturesstatsrequest, nil
8757}
8758
8759func NewMeterFeaturesStatsRequest() *MeterFeaturesStatsRequest {
8760 obj := &MeterFeaturesStatsRequest{
8761 StatsRequest: NewStatsRequest(11),
8762 }
8763 return obj
8764}
8765
8766type MeterMod struct {
8767 *Header
8768 Command MeterModCommand
8769 Flags MeterFlags
8770 MeterId uint32
8771 Meters []IMeterBand
8772}
8773
8774type IMeterMod interface {
8775 IHeader
8776 GetCommand() MeterModCommand
8777 GetFlags() MeterFlags
8778 GetMeterId() uint32
8779 GetMeters() []IMeterBand
8780}
8781
8782func (self *MeterMod) GetCommand() MeterModCommand {
8783 return self.Command
8784}
8785
8786func (self *MeterMod) SetCommand(v MeterModCommand) {
8787 self.Command = v
8788}
8789
8790func (self *MeterMod) GetFlags() MeterFlags {
8791 return self.Flags
8792}
8793
8794func (self *MeterMod) SetFlags(v MeterFlags) {
8795 self.Flags = v
8796}
8797
8798func (self *MeterMod) GetMeterId() uint32 {
8799 return self.MeterId
8800}
8801
8802func (self *MeterMod) SetMeterId(v uint32) {
8803 self.MeterId = v
8804}
8805
8806func (self *MeterMod) GetMeters() []IMeterBand {
8807 return self.Meters
8808}
8809
8810func (self *MeterMod) SetMeters(v []IMeterBand) {
8811 self.Meters = v
8812}
8813
8814func (self *MeterMod) Serialize(encoder *goloxi.Encoder) error {
8815 if err := self.Header.Serialize(encoder); err != nil {
8816 return err
8817 }
8818
8819 encoder.PutUint16(uint16(self.Command))
8820 encoder.PutUint16(uint16(self.Flags))
8821 encoder.PutUint32(uint32(self.MeterId))
8822 for _, obj := range self.Meters {
8823 if err := obj.Serialize(encoder); err != nil {
8824 return err
8825 }
8826 }
8827
8828 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
8829
8830 return nil
8831}
8832
8833func DecodeMeterMod(parent *Header, decoder *goloxi.Decoder) (*MeterMod, error) {
8834 _metermod := &MeterMod{Header: parent}
8835 if decoder.Length() < 8 {
8836 return nil, fmt.Errorf("MeterMod packet too short: %d < 8", decoder.Length())
8837 }
8838 _metermod.Command = MeterModCommand(decoder.ReadUint16())
8839 _metermod.Flags = MeterFlags(decoder.ReadUint16())
8840 _metermod.MeterId = uint32(decoder.ReadUint32())
8841
8842 for decoder.Length() >= 4 {
8843 item, err := DecodeMeterBand(decoder)
8844 if err != nil {
8845 return nil, err
8846 }
8847 if item != nil {
8848 _metermod.Meters = append(_metermod.Meters, item)
8849 }
8850 }
8851 return _metermod, nil
8852}
8853
8854func NewMeterMod() *MeterMod {
8855 obj := &MeterMod{
8856 Header: NewHeader(29),
8857 }
8858 return obj
8859}
8860
8861type MeterModFailedErrorMsg struct {
8862 *ErrorMsg
8863 Code MeterModFailedCode
8864 Data []byte
8865}
8866
8867type IMeterModFailedErrorMsg interface {
8868 IErrorMsg
8869 GetCode() MeterModFailedCode
8870 GetData() []byte
8871}
8872
8873func (self *MeterModFailedErrorMsg) GetCode() MeterModFailedCode {
8874 return self.Code
8875}
8876
8877func (self *MeterModFailedErrorMsg) SetCode(v MeterModFailedCode) {
8878 self.Code = v
8879}
8880
8881func (self *MeterModFailedErrorMsg) GetData() []byte {
8882 return self.Data
8883}
8884
8885func (self *MeterModFailedErrorMsg) SetData(v []byte) {
8886 self.Data = v
8887}
8888
8889func (self *MeterModFailedErrorMsg) Serialize(encoder *goloxi.Encoder) error {
8890 if err := self.ErrorMsg.Serialize(encoder); err != nil {
8891 return err
8892 }
8893
8894 encoder.PutUint16(uint16(self.Code))
8895 encoder.Write(self.Data)
8896
8897 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
8898
8899 return nil
8900}
8901
8902func DecodeMeterModFailedErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*MeterModFailedErrorMsg, error) {
8903 _metermodfailederrormsg := &MeterModFailedErrorMsg{ErrorMsg: parent}
8904 if decoder.Length() < 2 {
8905 return nil, fmt.Errorf("MeterModFailedErrorMsg packet too short: %d < 2", decoder.Length())
8906 }
8907 _metermodfailederrormsg.Code = MeterModFailedCode(decoder.ReadUint16())
8908 _metermodfailederrormsg.Data = decoder.Read(int(decoder.Length()))
8909 return _metermodfailederrormsg, nil
8910}
8911
8912func NewMeterModFailedErrorMsg() *MeterModFailedErrorMsg {
8913 obj := &MeterModFailedErrorMsg{
8914 ErrorMsg: NewErrorMsg(12),
8915 }
8916 return obj
8917}
8918
8919type MeterStatsReply struct {
8920 *StatsReply
8921 Entries []*MeterStats
8922}
8923
8924type IMeterStatsReply interface {
8925 IStatsReply
8926 GetEntries() []*MeterStats
8927}
8928
8929func (self *MeterStatsReply) GetEntries() []*MeterStats {
8930 return self.Entries
8931}
8932
8933func (self *MeterStatsReply) SetEntries(v []*MeterStats) {
8934 self.Entries = v
8935}
8936
8937func (self *MeterStatsReply) Serialize(encoder *goloxi.Encoder) error {
8938 if err := self.StatsReply.Serialize(encoder); err != nil {
8939 return err
8940 }
8941
8942 encoder.Write(bytes.Repeat([]byte{0}, 4))
8943 for _, obj := range self.Entries {
8944 if err := obj.Serialize(encoder); err != nil {
8945 return err
8946 }
8947 }
8948
8949 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
8950
8951 return nil
8952}
8953
8954func DecodeMeterStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*MeterStatsReply, error) {
8955 _meterstatsreply := &MeterStatsReply{StatsReply: parent}
8956 if decoder.Length() < 4 {
8957 return nil, fmt.Errorf("MeterStatsReply packet too short: %d < 4", decoder.Length())
8958 }
8959 decoder.Skip(4)
8960
8961 for decoder.Length() >= 40 {
8962 item, err := DecodeMeterStats(decoder)
8963 if err != nil {
8964 return nil, err
8965 }
8966 if item != nil {
8967 _meterstatsreply.Entries = append(_meterstatsreply.Entries, item)
8968 }
8969 }
8970 return _meterstatsreply, nil
8971}
8972
8973func NewMeterStatsReply() *MeterStatsReply {
8974 obj := &MeterStatsReply{
8975 StatsReply: NewStatsReply(9),
8976 }
8977 return obj
8978}
8979
8980type MeterStatsRequest struct {
8981 *StatsRequest
8982 MeterId uint32
8983}
8984
8985type IMeterStatsRequest interface {
8986 IStatsRequest
8987 GetMeterId() uint32
8988}
8989
8990func (self *MeterStatsRequest) GetMeterId() uint32 {
8991 return self.MeterId
8992}
8993
8994func (self *MeterStatsRequest) SetMeterId(v uint32) {
8995 self.MeterId = v
8996}
8997
8998func (self *MeterStatsRequest) Serialize(encoder *goloxi.Encoder) error {
8999 if err := self.StatsRequest.Serialize(encoder); err != nil {
9000 return err
9001 }
9002
9003 encoder.Write(bytes.Repeat([]byte{0}, 4))
9004 encoder.PutUint32(uint32(self.MeterId))
9005 encoder.Write(bytes.Repeat([]byte{0}, 4))
9006
9007 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
9008
9009 return nil
9010}
9011
9012func DecodeMeterStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*MeterStatsRequest, error) {
9013 _meterstatsrequest := &MeterStatsRequest{StatsRequest: parent}
9014 if decoder.Length() < 4 {
9015 return nil, fmt.Errorf("MeterStatsRequest packet too short: %d < 4", decoder.Length())
9016 }
9017 decoder.Skip(4)
9018 _meterstatsrequest.MeterId = uint32(decoder.ReadUint32())
9019 decoder.Skip(4)
9020 return _meterstatsrequest, nil
9021}
9022
9023func NewMeterStatsRequest() *MeterStatsRequest {
9024 obj := &MeterStatsRequest{
9025 StatsRequest: NewStatsRequest(9),
9026 }
9027 return obj
9028}
9029
9030type NiciraStatsReply struct {
9031 *ExperimenterStatsReply
9032}
9033
9034type INiciraStatsReply interface {
9035 IExperimenterStatsReply
9036}
9037
9038func (self *NiciraStatsReply) Serialize(encoder *goloxi.Encoder) error {
9039 if err := self.ExperimenterStatsReply.Serialize(encoder); err != nil {
9040 return err
9041 }
9042
9043 return nil
9044}
9045
9046func DecodeNiciraStatsReply(parent *ExperimenterStatsReply, decoder *goloxi.Decoder) (INiciraStatsReply, error) {
9047 _nicirastatsreply := &NiciraStatsReply{ExperimenterStatsReply: parent}
9048 if decoder.Length() < -4 {
9049 return nil, fmt.Errorf("NiciraStatsReply packet too short: %d < -4", decoder.Length())
9050 }
9051
9052 switch _nicirastatsreply.Subtype {
9053 case 0:
9054 return DecodeNiciraFlowStatsReply(_nicirastatsreply, decoder)
9055 case 2:
9056 return DecodeNiciraFlowMonitorReply(_nicirastatsreply, decoder)
9057 default:
9058 return nil, fmt.Errorf("Invalid type '%d' for 'NiciraStatsReply'", _nicirastatsreply.Subtype)
9059 }
9060}
9061
9062func NewNiciraStatsReply(_subtype uint32) *NiciraStatsReply {
9063 obj := &NiciraStatsReply{
9064 ExperimenterStatsReply: NewExperimenterStatsReply(8992),
9065 }
9066 obj.Subtype = _subtype
9067 return obj
9068}
9069
9070type NiciraFlowMonitorReply struct {
9071 *NiciraStatsReply
9072 Updates []INiciraFlowUpdateEvent
9073}
9074
9075type INiciraFlowMonitorReply interface {
9076 INiciraStatsReply
9077 GetUpdates() []INiciraFlowUpdateEvent
9078}
9079
9080func (self *NiciraFlowMonitorReply) GetUpdates() []INiciraFlowUpdateEvent {
9081 return self.Updates
9082}
9083
9084func (self *NiciraFlowMonitorReply) SetUpdates(v []INiciraFlowUpdateEvent) {
9085 self.Updates = v
9086}
9087
9088func (self *NiciraFlowMonitorReply) Serialize(encoder *goloxi.Encoder) error {
9089 if err := self.NiciraStatsReply.Serialize(encoder); err != nil {
9090 return err
9091 }
9092
9093 encoder.Write(bytes.Repeat([]byte{0}, 4))
9094 for _, obj := range self.Updates {
9095 if err := obj.Serialize(encoder); err != nil {
9096 return err
9097 }
9098 }
9099
9100 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
9101
9102 return nil
9103}
9104
9105func DecodeNiciraFlowMonitorReply(parent *NiciraStatsReply, decoder *goloxi.Decoder) (*NiciraFlowMonitorReply, error) {
9106 _niciraflowmonitorreply := &NiciraFlowMonitorReply{NiciraStatsReply: parent}
9107 if decoder.Length() < 4 {
9108 return nil, fmt.Errorf("NiciraFlowMonitorReply packet too short: %d < 4", decoder.Length())
9109 }
9110 decoder.Skip(4)
9111
9112 for decoder.Length() >= 4 {
9113 item, err := DecodeNiciraFlowUpdateEvent(decoder)
9114 if err != nil {
9115 return nil, err
9116 }
9117 if item != nil {
9118 _niciraflowmonitorreply.Updates = append(_niciraflowmonitorreply.Updates, item)
9119 }
9120 }
9121 return _niciraflowmonitorreply, nil
9122}
9123
9124func NewNiciraFlowMonitorReply() *NiciraFlowMonitorReply {
9125 obj := &NiciraFlowMonitorReply{
9126 NiciraStatsReply: NewNiciraStatsReply(2),
9127 }
9128 return obj
9129}
9130
9131type NiciraFlowMonitorRequest struct {
9132 *ExperimenterStatsRequest
9133 MonitorId uint32
9134 MonitorFlags NxFlowMonitorFlags
9135 OutPort Port
9136 MatchLen uint16
9137 TableId uint8
9138 Match NiciraMatch
9139}
9140
9141type INiciraFlowMonitorRequest interface {
9142 IExperimenterStatsRequest
9143 GetMonitorId() uint32
9144 GetMonitorFlags() NxFlowMonitorFlags
9145 GetOutPort() Port
9146 GetMatchLen() uint16
9147 GetTableId() uint8
9148 GetMatch() NiciraMatch
9149}
9150
9151func (self *NiciraFlowMonitorRequest) GetMonitorId() uint32 {
9152 return self.MonitorId
9153}
9154
9155func (self *NiciraFlowMonitorRequest) SetMonitorId(v uint32) {
9156 self.MonitorId = v
9157}
9158
9159func (self *NiciraFlowMonitorRequest) GetMonitorFlags() NxFlowMonitorFlags {
9160 return self.MonitorFlags
9161}
9162
9163func (self *NiciraFlowMonitorRequest) SetMonitorFlags(v NxFlowMonitorFlags) {
9164 self.MonitorFlags = v
9165}
9166
9167func (self *NiciraFlowMonitorRequest) GetOutPort() Port {
9168 return self.OutPort
9169}
9170
9171func (self *NiciraFlowMonitorRequest) SetOutPort(v Port) {
9172 self.OutPort = v
9173}
9174
9175func (self *NiciraFlowMonitorRequest) GetMatchLen() uint16 {
9176 return self.MatchLen
9177}
9178
9179func (self *NiciraFlowMonitorRequest) SetMatchLen(v uint16) {
9180 self.MatchLen = v
9181}
9182
9183func (self *NiciraFlowMonitorRequest) GetTableId() uint8 {
9184 return self.TableId
9185}
9186
9187func (self *NiciraFlowMonitorRequest) SetTableId(v uint8) {
9188 self.TableId = v
9189}
9190
9191func (self *NiciraFlowMonitorRequest) GetMatch() NiciraMatch {
9192 return self.Match
9193}
9194
9195func (self *NiciraFlowMonitorRequest) SetMatch(v NiciraMatch) {
9196 self.Match = v
9197}
9198
9199func (self *NiciraFlowMonitorRequest) Serialize(encoder *goloxi.Encoder) error {
9200 if err := self.ExperimenterStatsRequest.Serialize(encoder); err != nil {
9201 return err
9202 }
9203
9204 encoder.Write(bytes.Repeat([]byte{0}, 4))
9205 encoder.PutUint32(uint32(self.MonitorId))
9206 encoder.PutUint16(uint16(self.MonitorFlags))
9207 self.OutPort.Serialize(encoder)
9208 encoder.PutUint16(uint16(self.MatchLen))
9209 encoder.PutUint8(uint8(self.TableId))
9210 encoder.Write(bytes.Repeat([]byte{0}, 5))
9211 if err := self.Match.Serialize(encoder); err != nil {
9212 return err
9213 }
9214
9215 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
9216
9217 return nil
9218}
9219
9220func DecodeNiciraFlowMonitorRequest(parent *ExperimenterStatsRequest, decoder *goloxi.Decoder) (*NiciraFlowMonitorRequest, error) {
9221 _niciraflowmonitorrequest := &NiciraFlowMonitorRequest{ExperimenterStatsRequest: parent}
9222 if decoder.Length() < 22 {
9223 return nil, fmt.Errorf("NiciraFlowMonitorRequest packet too short: %d < 22", decoder.Length())
9224 }
9225 decoder.Skip(4)
9226 _niciraflowmonitorrequest.MonitorId = uint32(decoder.ReadUint32())
9227 _niciraflowmonitorrequest.MonitorFlags = NxFlowMonitorFlags(decoder.ReadUint16())
9228 _niciraflowmonitorrequest.OutPort.Decode(decoder)
9229 _niciraflowmonitorrequest.MatchLen = uint16(decoder.ReadUint16())
9230 _niciraflowmonitorrequest.TableId = uint8(decoder.ReadByte())
9231 decoder.Skip(5)
9232 if err := _niciraflowmonitorrequest.Match.Decode(decoder); err != nil {
9233 return nil, err
9234 }
9235
9236 decoder.SkipAlign()
9237 return _niciraflowmonitorrequest, nil
9238}
9239
9240func NewNiciraFlowMonitorRequest() *NiciraFlowMonitorRequest {
9241 obj := &NiciraFlowMonitorRequest{
9242 ExperimenterStatsRequest: NewExperimenterStatsRequest(8992),
9243 }
9244 return obj
9245}
9246
9247type NiciraFlowStatsReply struct {
9248 *NiciraStatsReply
9249 Stats []*NiciraFlowStats
9250}
9251
9252type INiciraFlowStatsReply interface {
9253 INiciraStatsReply
9254 GetStats() []*NiciraFlowStats
9255}
9256
9257func (self *NiciraFlowStatsReply) GetStats() []*NiciraFlowStats {
9258 return self.Stats
9259}
9260
9261func (self *NiciraFlowStatsReply) SetStats(v []*NiciraFlowStats) {
9262 self.Stats = v
9263}
9264
9265func (self *NiciraFlowStatsReply) Serialize(encoder *goloxi.Encoder) error {
9266 if err := self.NiciraStatsReply.Serialize(encoder); err != nil {
9267 return err
9268 }
9269
9270 encoder.Write(bytes.Repeat([]byte{0}, 4))
9271 for _, obj := range self.Stats {
9272 if err := obj.Serialize(encoder); err != nil {
9273 return err
9274 }
9275 }
9276
9277 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
9278
9279 return nil
9280}
9281
9282func DecodeNiciraFlowStatsReply(parent *NiciraStatsReply, decoder *goloxi.Decoder) (*NiciraFlowStatsReply, error) {
9283 _niciraflowstatsreply := &NiciraFlowStatsReply{NiciraStatsReply: parent}
9284 if decoder.Length() < 4 {
9285 return nil, fmt.Errorf("NiciraFlowStatsReply packet too short: %d < 4", decoder.Length())
9286 }
9287 decoder.Skip(4)
9288
9289 for decoder.Length() >= 48 {
9290 item, err := DecodeNiciraFlowStats(decoder)
9291 if err != nil {
9292 return nil, err
9293 }
9294 if item != nil {
9295 _niciraflowstatsreply.Stats = append(_niciraflowstatsreply.Stats, item)
9296 }
9297 }
9298 return _niciraflowstatsreply, nil
9299}
9300
9301func NewNiciraFlowStatsReply() *NiciraFlowStatsReply {
9302 obj := &NiciraFlowStatsReply{
9303 NiciraStatsReply: NewNiciraStatsReply(0),
9304 }
9305 return obj
9306}
9307
9308type NiciraFlowStatsRequest struct {
9309 *ExperimenterStatsRequest
9310 OutPort Port
9311 MatchLen uint16
9312 TableId uint8
9313}
9314
9315type INiciraFlowStatsRequest interface {
9316 IExperimenterStatsRequest
9317 GetOutPort() Port
9318 GetMatchLen() uint16
9319 GetTableId() uint8
9320}
9321
9322func (self *NiciraFlowStatsRequest) GetOutPort() Port {
9323 return self.OutPort
9324}
9325
9326func (self *NiciraFlowStatsRequest) SetOutPort(v Port) {
9327 self.OutPort = v
9328}
9329
9330func (self *NiciraFlowStatsRequest) GetMatchLen() uint16 {
9331 return self.MatchLen
9332}
9333
9334func (self *NiciraFlowStatsRequest) SetMatchLen(v uint16) {
9335 self.MatchLen = v
9336}
9337
9338func (self *NiciraFlowStatsRequest) GetTableId() uint8 {
9339 return self.TableId
9340}
9341
9342func (self *NiciraFlowStatsRequest) SetTableId(v uint8) {
9343 self.TableId = v
9344}
9345
9346func (self *NiciraFlowStatsRequest) Serialize(encoder *goloxi.Encoder) error {
9347 if err := self.ExperimenterStatsRequest.Serialize(encoder); err != nil {
9348 return err
9349 }
9350
9351 encoder.Write(bytes.Repeat([]byte{0}, 4))
9352 self.OutPort.Serialize(encoder)
9353 encoder.PutUint16(uint16(self.MatchLen))
9354 encoder.PutUint8(uint8(self.TableId))
9355 encoder.Write(bytes.Repeat([]byte{0}, 3))
9356
9357 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
9358
9359 return nil
9360}
9361
9362func DecodeNiciraFlowStatsRequest(parent *ExperimenterStatsRequest, decoder *goloxi.Decoder) (*NiciraFlowStatsRequest, error) {
9363 _niciraflowstatsrequest := &NiciraFlowStatsRequest{ExperimenterStatsRequest: parent}
9364 if decoder.Length() < 14 {
9365 return nil, fmt.Errorf("NiciraFlowStatsRequest packet too short: %d < 14", decoder.Length())
9366 }
9367 decoder.Skip(4)
9368 _niciraflowstatsrequest.OutPort.Decode(decoder)
9369 _niciraflowstatsrequest.MatchLen = uint16(decoder.ReadUint16())
9370 _niciraflowstatsrequest.TableId = uint8(decoder.ReadByte())
9371 decoder.Skip(3)
9372 return _niciraflowstatsrequest, nil
9373}
9374
9375func NewNiciraFlowStatsRequest() *NiciraFlowStatsRequest {
9376 obj := &NiciraFlowStatsRequest{
9377 ExperimenterStatsRequest: NewExperimenterStatsRequest(8992),
9378 }
9379 return obj
9380}
9381
9382type NiciraHeader struct {
9383 *Experimenter
9384}
9385
9386type INiciraHeader interface {
9387 IExperimenter
9388}
9389
9390func (self *NiciraHeader) Serialize(encoder *goloxi.Encoder) error {
9391 if err := self.Experimenter.Serialize(encoder); err != nil {
9392 return err
9393 }
9394
9395 return nil
9396}
9397
9398func DecodeNiciraHeader(parent *Experimenter, decoder *goloxi.Decoder) (INiciraHeader, error) {
9399 _niciraheader := &NiciraHeader{Experimenter: parent}
9400 return _niciraheader, nil
9401}
9402
9403func NewNiciraHeader(_subtype uint32) *NiciraHeader {
9404 obj := &NiciraHeader{
9405 Experimenter: NewExperimenter(8992),
9406 }
9407 obj.Subtype = _subtype
9408 return obj
9409}
9410
9411type PacketIn struct {
9412 *Header
9413 BufferId uint32
9414 TotalLen uint16
9415 Reason uint8
9416 TableId uint8
9417 Cookie uint64
9418 Match Match
9419 Data []byte
9420}
9421
9422type IPacketIn interface {
9423 IHeader
9424 GetBufferId() uint32
9425 GetTotalLen() uint16
9426 GetReason() uint8
9427 GetTableId() uint8
9428 GetCookie() uint64
9429 GetMatch() Match
9430 GetData() []byte
9431}
9432
9433func (self *PacketIn) GetBufferId() uint32 {
9434 return self.BufferId
9435}
9436
9437func (self *PacketIn) SetBufferId(v uint32) {
9438 self.BufferId = v
9439}
9440
9441func (self *PacketIn) GetTotalLen() uint16 {
9442 return self.TotalLen
9443}
9444
9445func (self *PacketIn) SetTotalLen(v uint16) {
9446 self.TotalLen = v
9447}
9448
9449func (self *PacketIn) GetReason() uint8 {
9450 return self.Reason
9451}
9452
9453func (self *PacketIn) SetReason(v uint8) {
9454 self.Reason = v
9455}
9456
9457func (self *PacketIn) GetTableId() uint8 {
9458 return self.TableId
9459}
9460
9461func (self *PacketIn) SetTableId(v uint8) {
9462 self.TableId = v
9463}
9464
9465func (self *PacketIn) GetCookie() uint64 {
9466 return self.Cookie
9467}
9468
9469func (self *PacketIn) SetCookie(v uint64) {
9470 self.Cookie = v
9471}
9472
9473func (self *PacketIn) GetMatch() Match {
9474 return self.Match
9475}
9476
9477func (self *PacketIn) SetMatch(v Match) {
9478 self.Match = v
9479}
9480
9481func (self *PacketIn) GetData() []byte {
9482 return self.Data
9483}
9484
9485func (self *PacketIn) SetData(v []byte) {
9486 self.Data = v
9487}
9488
9489func (self *PacketIn) Serialize(encoder *goloxi.Encoder) error {
9490 if err := self.Header.Serialize(encoder); err != nil {
9491 return err
9492 }
9493
9494 encoder.PutUint32(uint32(self.BufferId))
9495 encoder.PutUint16(uint16(self.TotalLen))
9496 encoder.PutUint8(uint8(self.Reason))
9497 encoder.PutUint8(uint8(self.TableId))
9498 encoder.PutUint64(uint64(self.Cookie))
9499 if err := self.Match.Serialize(encoder); err != nil {
9500 return err
9501 }
9502
9503 encoder.Write(bytes.Repeat([]byte{0}, 2))
9504 encoder.Write(self.Data)
9505
9506 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
9507
9508 return nil
9509}
9510
9511func DecodePacketIn(parent *Header, decoder *goloxi.Decoder) (*PacketIn, error) {
9512 _packetin := &PacketIn{Header: parent}
9513 if decoder.Length() < 26 {
9514 return nil, fmt.Errorf("PacketIn packet too short: %d < 26", decoder.Length())
9515 }
9516 _packetin.BufferId = uint32(decoder.ReadUint32())
9517 _packetin.TotalLen = uint16(decoder.ReadUint16())
9518 _packetin.Reason = uint8(decoder.ReadByte())
9519 _packetin.TableId = uint8(decoder.ReadByte())
9520 _packetin.Cookie = uint64(decoder.ReadUint64())
9521 if err := _packetin.Match.Decode(decoder); err != nil {
9522 return nil, err
9523 }
9524
9525 decoder.SkipAlign()
9526 decoder.Skip(2)
9527 _packetin.Data = decoder.Read(int(decoder.Length()))
9528 return _packetin, nil
9529}
9530
9531func NewPacketIn() *PacketIn {
9532 obj := &PacketIn{
9533 Header: NewHeader(10),
9534 }
9535 return obj
9536}
9537
9538type PacketOut struct {
9539 *Header
9540 BufferId uint32
9541 InPort Port
9542 ActionsLen uint16
9543 Actions []goloxi.IAction
9544 Data []byte
9545}
9546
9547type IPacketOut interface {
9548 IHeader
9549 GetBufferId() uint32
9550 GetInPort() Port
9551 GetActionsLen() uint16
9552 GetActions() []goloxi.IAction
9553 GetData() []byte
9554}
9555
9556func (self *PacketOut) GetBufferId() uint32 {
9557 return self.BufferId
9558}
9559
9560func (self *PacketOut) SetBufferId(v uint32) {
9561 self.BufferId = v
9562}
9563
9564func (self *PacketOut) GetInPort() Port {
9565 return self.InPort
9566}
9567
9568func (self *PacketOut) SetInPort(v Port) {
9569 self.InPort = v
9570}
9571
9572func (self *PacketOut) GetActionsLen() uint16 {
9573 return self.ActionsLen
9574}
9575
9576func (self *PacketOut) SetActionsLen(v uint16) {
9577 self.ActionsLen = v
9578}
9579
9580func (self *PacketOut) GetActions() []goloxi.IAction {
9581 return self.Actions
9582}
9583
9584func (self *PacketOut) SetActions(v []goloxi.IAction) {
9585 self.Actions = v
9586}
9587
9588func (self *PacketOut) GetData() []byte {
9589 return self.Data
9590}
9591
9592func (self *PacketOut) SetData(v []byte) {
9593 self.Data = v
9594}
9595
9596func (self *PacketOut) Serialize(encoder *goloxi.Encoder) error {
9597 if err := self.Header.Serialize(encoder); err != nil {
9598 return err
9599 }
9600
9601 encoder.PutUint32(uint32(self.BufferId))
9602 self.InPort.Serialize(encoder)
9603 encoder.PutUint16(uint16(self.ActionsLen))
9604 encoder.Write(bytes.Repeat([]byte{0}, 6))
9605 for _, obj := range self.Actions {
9606 if err := obj.Serialize(encoder); err != nil {
9607 return err
9608 }
9609 }
9610 encoder.Write(self.Data)
9611
9612 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
9613
9614 return nil
9615}
9616
9617func DecodePacketOut(parent *Header, decoder *goloxi.Decoder) (*PacketOut, error) {
9618 _packetout := &PacketOut{Header: parent}
9619 if decoder.Length() < 16 {
9620 return nil, fmt.Errorf("PacketOut packet too short: %d < 16", decoder.Length())
9621 }
9622 _packetout.BufferId = uint32(decoder.ReadUint32())
9623 _packetout.InPort.Decode(decoder)
9624 _packetout.ActionsLen = uint16(decoder.ReadUint16())
9625 decoder.Skip(6)
9626
9627 for i := 0; i < int(_packetout.ActionsLen); i++ {
9628 item, err := DecodeAction(decoder)
Don Newtone0d34a82019-11-14 10:58:06 -05009629 i += int(item.GetLen())
Don Newton98fd8812019-09-23 15:15:02 -04009630 if err != nil {
9631 return nil, err
9632 }
9633 if item != nil {
9634 _packetout.Actions = append(_packetout.Actions, item)
9635 }
9636 }
9637 _packetout.Data = decoder.Read(int(decoder.Length()))
9638 return _packetout, nil
9639}
9640
9641func NewPacketOut() *PacketOut {
9642 obj := &PacketOut{
9643 Header: NewHeader(13),
9644 }
9645 return obj
9646}
9647
9648type PortDescStatsReply struct {
9649 *StatsReply
9650 Entries []*PortDesc
9651}
9652
9653type IPortDescStatsReply interface {
9654 IStatsReply
9655 GetEntries() []*PortDesc
9656}
9657
9658func (self *PortDescStatsReply) GetEntries() []*PortDesc {
9659 return self.Entries
9660}
9661
9662func (self *PortDescStatsReply) SetEntries(v []*PortDesc) {
9663 self.Entries = v
9664}
9665
9666func (self *PortDescStatsReply) Serialize(encoder *goloxi.Encoder) error {
9667 if err := self.StatsReply.Serialize(encoder); err != nil {
9668 return err
9669 }
9670
9671 encoder.Write(bytes.Repeat([]byte{0}, 4))
9672 for _, obj := range self.Entries {
9673 if err := obj.Serialize(encoder); err != nil {
9674 return err
9675 }
9676 }
9677
9678 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
9679
9680 return nil
9681}
9682
9683func DecodePortDescStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*PortDescStatsReply, error) {
9684 _portdescstatsreply := &PortDescStatsReply{StatsReply: parent}
9685 if decoder.Length() < 4 {
9686 return nil, fmt.Errorf("PortDescStatsReply packet too short: %d < 4", decoder.Length())
9687 }
9688 decoder.Skip(4)
9689
9690 for decoder.Length() >= 64 {
9691 item := &PortDesc{}
9692 if err := item.Decode(decoder); err != nil {
9693 return nil, err
9694 }
9695 if item != nil {
9696 _portdescstatsreply.Entries = append(_portdescstatsreply.Entries, item)
9697 }
9698 }
9699 return _portdescstatsreply, nil
9700}
9701
9702func NewPortDescStatsReply() *PortDescStatsReply {
9703 obj := &PortDescStatsReply{
9704 StatsReply: NewStatsReply(13),
9705 }
9706 return obj
9707}
9708
9709type PortDescStatsRequest struct {
9710 *StatsRequest
9711}
9712
9713type IPortDescStatsRequest interface {
9714 IStatsRequest
9715}
9716
9717func (self *PortDescStatsRequest) Serialize(encoder *goloxi.Encoder) error {
9718 if err := self.StatsRequest.Serialize(encoder); err != nil {
9719 return err
9720 }
9721
9722 encoder.Write(bytes.Repeat([]byte{0}, 4))
9723
9724 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
9725
9726 return nil
9727}
9728
9729func DecodePortDescStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*PortDescStatsRequest, error) {
9730 _portdescstatsrequest := &PortDescStatsRequest{StatsRequest: parent}
9731 if decoder.Length() < 4 {
9732 return nil, fmt.Errorf("PortDescStatsRequest packet too short: %d < 4", decoder.Length())
9733 }
9734 decoder.Skip(4)
9735 return _portdescstatsrequest, nil
9736}
9737
9738func NewPortDescStatsRequest() *PortDescStatsRequest {
9739 obj := &PortDescStatsRequest{
9740 StatsRequest: NewStatsRequest(13),
9741 }
9742 return obj
9743}
9744
9745type PortMod struct {
9746 *Header
9747 PortNo Port
9748 HwAddr net.HardwareAddr
9749 Config PortConfig
9750 Mask PortConfig
9751 Advertise uint32
9752}
9753
9754type IPortMod interface {
9755 IHeader
9756 GetPortNo() Port
9757 GetHwAddr() net.HardwareAddr
9758 GetConfig() PortConfig
9759 GetMask() PortConfig
9760 GetAdvertise() uint32
9761}
9762
9763func (self *PortMod) GetPortNo() Port {
9764 return self.PortNo
9765}
9766
9767func (self *PortMod) SetPortNo(v Port) {
9768 self.PortNo = v
9769}
9770
9771func (self *PortMod) GetHwAddr() net.HardwareAddr {
9772 return self.HwAddr
9773}
9774
9775func (self *PortMod) SetHwAddr(v net.HardwareAddr) {
9776 self.HwAddr = v
9777}
9778
9779func (self *PortMod) GetConfig() PortConfig {
9780 return self.Config
9781}
9782
9783func (self *PortMod) SetConfig(v PortConfig) {
9784 self.Config = v
9785}
9786
9787func (self *PortMod) GetMask() PortConfig {
9788 return self.Mask
9789}
9790
9791func (self *PortMod) SetMask(v PortConfig) {
9792 self.Mask = v
9793}
9794
9795func (self *PortMod) GetAdvertise() uint32 {
9796 return self.Advertise
9797}
9798
9799func (self *PortMod) SetAdvertise(v uint32) {
9800 self.Advertise = v
9801}
9802
9803func (self *PortMod) Serialize(encoder *goloxi.Encoder) error {
9804 if err := self.Header.Serialize(encoder); err != nil {
9805 return err
9806 }
9807
9808 self.PortNo.Serialize(encoder)
9809 encoder.Write(bytes.Repeat([]byte{0}, 4))
9810 encoder.Write(self.HwAddr)
9811 encoder.Write(bytes.Repeat([]byte{0}, 2))
9812 encoder.PutUint32(uint32(self.Config))
9813 encoder.PutUint32(uint32(self.Mask))
9814 encoder.PutUint32(uint32(self.Advertise))
9815 encoder.Write(bytes.Repeat([]byte{0}, 4))
9816
9817 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
9818
9819 return nil
9820}
9821
9822func DecodePortMod(parent *Header, decoder *goloxi.Decoder) (*PortMod, error) {
9823 _portmod := &PortMod{Header: parent}
9824 if decoder.Length() < 32 {
9825 return nil, fmt.Errorf("PortMod packet too short: %d < 32", decoder.Length())
9826 }
9827 _portmod.PortNo.Decode(decoder)
9828 decoder.Skip(4)
9829 _portmod.HwAddr = net.HardwareAddr(decoder.Read(6))
9830 decoder.Skip(2)
9831 _portmod.Config = PortConfig(decoder.ReadUint32())
9832 _portmod.Mask = PortConfig(decoder.ReadUint32())
9833 _portmod.Advertise = uint32(decoder.ReadUint32())
9834 decoder.Skip(4)
9835 return _portmod, nil
9836}
9837
9838func NewPortMod() *PortMod {
9839 obj := &PortMod{
9840 Header: NewHeader(16),
9841 }
9842 return obj
9843}
9844
9845type PortModFailedErrorMsg struct {
9846 *ErrorMsg
9847 Code PortModFailedCode
9848 Data []byte
9849}
9850
9851type IPortModFailedErrorMsg interface {
9852 IErrorMsg
9853 GetCode() PortModFailedCode
9854 GetData() []byte
9855}
9856
9857func (self *PortModFailedErrorMsg) GetCode() PortModFailedCode {
9858 return self.Code
9859}
9860
9861func (self *PortModFailedErrorMsg) SetCode(v PortModFailedCode) {
9862 self.Code = v
9863}
9864
9865func (self *PortModFailedErrorMsg) GetData() []byte {
9866 return self.Data
9867}
9868
9869func (self *PortModFailedErrorMsg) SetData(v []byte) {
9870 self.Data = v
9871}
9872
9873func (self *PortModFailedErrorMsg) Serialize(encoder *goloxi.Encoder) error {
9874 if err := self.ErrorMsg.Serialize(encoder); err != nil {
9875 return err
9876 }
9877
9878 encoder.PutUint16(uint16(self.Code))
9879 encoder.Write(self.Data)
9880
9881 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
9882
9883 return nil
9884}
9885
9886func DecodePortModFailedErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*PortModFailedErrorMsg, error) {
9887 _portmodfailederrormsg := &PortModFailedErrorMsg{ErrorMsg: parent}
9888 if decoder.Length() < 2 {
9889 return nil, fmt.Errorf("PortModFailedErrorMsg packet too short: %d < 2", decoder.Length())
9890 }
9891 _portmodfailederrormsg.Code = PortModFailedCode(decoder.ReadUint16())
9892 _portmodfailederrormsg.Data = decoder.Read(int(decoder.Length()))
9893 return _portmodfailederrormsg, nil
9894}
9895
9896func NewPortModFailedErrorMsg() *PortModFailedErrorMsg {
9897 obj := &PortModFailedErrorMsg{
9898 ErrorMsg: NewErrorMsg(7),
9899 }
9900 return obj
9901}
9902
9903type PortStatsReply struct {
9904 *StatsReply
9905 Entries []*PortStatsEntry
9906}
9907
9908type IPortStatsReply interface {
9909 IStatsReply
9910 GetEntries() []*PortStatsEntry
9911}
9912
9913func (self *PortStatsReply) GetEntries() []*PortStatsEntry {
9914 return self.Entries
9915}
9916
9917func (self *PortStatsReply) SetEntries(v []*PortStatsEntry) {
9918 self.Entries = v
9919}
9920
9921func (self *PortStatsReply) Serialize(encoder *goloxi.Encoder) error {
9922 if err := self.StatsReply.Serialize(encoder); err != nil {
9923 return err
9924 }
9925
9926 encoder.Write(bytes.Repeat([]byte{0}, 4))
9927 for _, obj := range self.Entries {
9928 if err := obj.Serialize(encoder); err != nil {
9929 return err
9930 }
9931 }
9932
9933 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
9934
9935 return nil
9936}
9937
9938func DecodePortStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*PortStatsReply, error) {
9939 _portstatsreply := &PortStatsReply{StatsReply: parent}
9940 if decoder.Length() < 4 {
9941 return nil, fmt.Errorf("PortStatsReply packet too short: %d < 4", decoder.Length())
9942 }
9943 decoder.Skip(4)
9944
9945 for decoder.Length() >= 112 {
9946 item, err := DecodePortStatsEntry(decoder)
9947 if err != nil {
9948 return nil, err
9949 }
9950 if item != nil {
9951 _portstatsreply.Entries = append(_portstatsreply.Entries, item)
9952 }
9953 }
9954 return _portstatsreply, nil
9955}
9956
9957func NewPortStatsReply() *PortStatsReply {
9958 obj := &PortStatsReply{
9959 StatsReply: NewStatsReply(4),
9960 }
9961 return obj
9962}
9963
9964type PortStatsRequest struct {
9965 *StatsRequest
9966 PortNo Port
9967}
9968
9969type IPortStatsRequest interface {
9970 IStatsRequest
9971 GetPortNo() Port
9972}
9973
9974func (self *PortStatsRequest) GetPortNo() Port {
9975 return self.PortNo
9976}
9977
9978func (self *PortStatsRequest) SetPortNo(v Port) {
9979 self.PortNo = v
9980}
9981
9982func (self *PortStatsRequest) Serialize(encoder *goloxi.Encoder) error {
9983 if err := self.StatsRequest.Serialize(encoder); err != nil {
9984 return err
9985 }
9986
9987 encoder.Write(bytes.Repeat([]byte{0}, 4))
9988 self.PortNo.Serialize(encoder)
9989 encoder.Write(bytes.Repeat([]byte{0}, 4))
9990
9991 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
9992
9993 return nil
9994}
9995
9996func DecodePortStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*PortStatsRequest, error) {
9997 _portstatsrequest := &PortStatsRequest{StatsRequest: parent}
9998 if decoder.Length() < 4 {
9999 return nil, fmt.Errorf("PortStatsRequest packet too short: %d < 4", decoder.Length())
10000 }
10001 decoder.Skip(4)
10002 _portstatsrequest.PortNo.Decode(decoder)
10003 decoder.Skip(4)
10004 return _portstatsrequest, nil
10005}
10006
10007func NewPortStatsRequest() *PortStatsRequest {
10008 obj := &PortStatsRequest{
10009 StatsRequest: NewStatsRequest(4),
10010 }
10011 return obj
10012}
10013
10014type PortStatus struct {
10015 *Header
10016 Reason PortReason
10017 Desc PortDesc
10018}
10019
10020type IPortStatus interface {
10021 IHeader
10022 GetReason() PortReason
10023 GetDesc() PortDesc
10024}
10025
10026func (self *PortStatus) GetReason() PortReason {
10027 return self.Reason
10028}
10029
10030func (self *PortStatus) SetReason(v PortReason) {
10031 self.Reason = v
10032}
10033
10034func (self *PortStatus) GetDesc() PortDesc {
10035 return self.Desc
10036}
10037
10038func (self *PortStatus) SetDesc(v PortDesc) {
10039 self.Desc = v
10040}
10041
10042func (self *PortStatus) Serialize(encoder *goloxi.Encoder) error {
10043 if err := self.Header.Serialize(encoder); err != nil {
10044 return err
10045 }
10046
10047 encoder.PutUint8(uint8(self.Reason))
10048 encoder.Write(bytes.Repeat([]byte{0}, 7))
10049 if err := self.Desc.Serialize(encoder); err != nil {
10050 return err
10051 }
10052
10053 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
10054
10055 return nil
10056}
10057
10058func DecodePortStatus(parent *Header, decoder *goloxi.Decoder) (*PortStatus, error) {
10059 _portstatus := &PortStatus{Header: parent}
10060 if decoder.Length() < 72 {
10061 return nil, fmt.Errorf("PortStatus packet too short: %d < 72", decoder.Length())
10062 }
10063 _portstatus.Reason = PortReason(decoder.ReadByte())
10064 decoder.Skip(7)
10065 if err := _portstatus.Desc.Decode(decoder); err != nil {
10066 return nil, err
10067 }
10068
10069 return _portstatus, nil
10070}
10071
10072func NewPortStatus() *PortStatus {
10073 obj := &PortStatus{
10074 Header: NewHeader(12),
10075 }
10076 return obj
10077}
10078
10079type QueueGetConfigReply struct {
10080 *Header
10081 Port Port
10082 Queues []*PacketQueue
10083}
10084
10085type IQueueGetConfigReply interface {
10086 IHeader
10087 GetPort() Port
10088 GetQueues() []*PacketQueue
10089}
10090
10091func (self *QueueGetConfigReply) GetPort() Port {
10092 return self.Port
10093}
10094
10095func (self *QueueGetConfigReply) SetPort(v Port) {
10096 self.Port = v
10097}
10098
10099func (self *QueueGetConfigReply) GetQueues() []*PacketQueue {
10100 return self.Queues
10101}
10102
10103func (self *QueueGetConfigReply) SetQueues(v []*PacketQueue) {
10104 self.Queues = v
10105}
10106
10107func (self *QueueGetConfigReply) Serialize(encoder *goloxi.Encoder) error {
10108 if err := self.Header.Serialize(encoder); err != nil {
10109 return err
10110 }
10111
10112 self.Port.Serialize(encoder)
10113 encoder.Write(bytes.Repeat([]byte{0}, 4))
10114 for _, obj := range self.Queues {
10115 if err := obj.Serialize(encoder); err != nil {
10116 return err
10117 }
10118 }
10119
10120 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
10121
10122 return nil
10123}
10124
10125func DecodeQueueGetConfigReply(parent *Header, decoder *goloxi.Decoder) (*QueueGetConfigReply, error) {
10126 _queuegetconfigreply := &QueueGetConfigReply{Header: parent}
10127 if decoder.Length() < 8 {
10128 return nil, fmt.Errorf("QueueGetConfigReply packet too short: %d < 8", decoder.Length())
10129 }
10130 _queuegetconfigreply.Port.Decode(decoder)
10131 decoder.Skip(4)
10132
10133 for decoder.Length() >= 16 {
10134 item, err := DecodePacketQueue(decoder)
10135 if err != nil {
10136 return nil, err
10137 }
10138 if item != nil {
10139 _queuegetconfigreply.Queues = append(_queuegetconfigreply.Queues, item)
10140 }
10141 }
10142 return _queuegetconfigreply, nil
10143}
10144
10145func NewQueueGetConfigReply() *QueueGetConfigReply {
10146 obj := &QueueGetConfigReply{
10147 Header: NewHeader(23),
10148 }
10149 return obj
10150}
10151
10152type QueueGetConfigRequest struct {
10153 *Header
10154 Port Port
10155}
10156
10157type IQueueGetConfigRequest interface {
10158 IHeader
10159 GetPort() Port
10160}
10161
10162func (self *QueueGetConfigRequest) GetPort() Port {
10163 return self.Port
10164}
10165
10166func (self *QueueGetConfigRequest) SetPort(v Port) {
10167 self.Port = v
10168}
10169
10170func (self *QueueGetConfigRequest) Serialize(encoder *goloxi.Encoder) error {
10171 if err := self.Header.Serialize(encoder); err != nil {
10172 return err
10173 }
10174
10175 self.Port.Serialize(encoder)
10176 encoder.Write(bytes.Repeat([]byte{0}, 4))
10177
10178 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
10179
10180 return nil
10181}
10182
10183func DecodeQueueGetConfigRequest(parent *Header, decoder *goloxi.Decoder) (*QueueGetConfigRequest, error) {
10184 _queuegetconfigrequest := &QueueGetConfigRequest{Header: parent}
10185 if decoder.Length() < 8 {
10186 return nil, fmt.Errorf("QueueGetConfigRequest packet too short: %d < 8", decoder.Length())
10187 }
10188 _queuegetconfigrequest.Port.Decode(decoder)
10189 decoder.Skip(4)
10190 return _queuegetconfigrequest, nil
10191}
10192
10193func NewQueueGetConfigRequest() *QueueGetConfigRequest {
10194 obj := &QueueGetConfigRequest{
10195 Header: NewHeader(22),
10196 }
10197 return obj
10198}
10199
10200type QueueOpFailedErrorMsg struct {
10201 *ErrorMsg
10202 Code QueueOpFailedCode
10203 Data []byte
10204}
10205
10206type IQueueOpFailedErrorMsg interface {
10207 IErrorMsg
10208 GetCode() QueueOpFailedCode
10209 GetData() []byte
10210}
10211
10212func (self *QueueOpFailedErrorMsg) GetCode() QueueOpFailedCode {
10213 return self.Code
10214}
10215
10216func (self *QueueOpFailedErrorMsg) SetCode(v QueueOpFailedCode) {
10217 self.Code = v
10218}
10219
10220func (self *QueueOpFailedErrorMsg) GetData() []byte {
10221 return self.Data
10222}
10223
10224func (self *QueueOpFailedErrorMsg) SetData(v []byte) {
10225 self.Data = v
10226}
10227
10228func (self *QueueOpFailedErrorMsg) Serialize(encoder *goloxi.Encoder) error {
10229 if err := self.ErrorMsg.Serialize(encoder); err != nil {
10230 return err
10231 }
10232
10233 encoder.PutUint16(uint16(self.Code))
10234 encoder.Write(self.Data)
10235
10236 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
10237
10238 return nil
10239}
10240
10241func DecodeQueueOpFailedErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*QueueOpFailedErrorMsg, error) {
10242 _queueopfailederrormsg := &QueueOpFailedErrorMsg{ErrorMsg: parent}
10243 if decoder.Length() < 2 {
10244 return nil, fmt.Errorf("QueueOpFailedErrorMsg packet too short: %d < 2", decoder.Length())
10245 }
10246 _queueopfailederrormsg.Code = QueueOpFailedCode(decoder.ReadUint16())
10247 _queueopfailederrormsg.Data = decoder.Read(int(decoder.Length()))
10248 return _queueopfailederrormsg, nil
10249}
10250
10251func NewQueueOpFailedErrorMsg() *QueueOpFailedErrorMsg {
10252 obj := &QueueOpFailedErrorMsg{
10253 ErrorMsg: NewErrorMsg(9),
10254 }
10255 return obj
10256}
10257
10258type QueueStatsReply struct {
10259 *StatsReply
10260 Entries []*QueueStatsEntry
10261}
10262
10263type IQueueStatsReply interface {
10264 IStatsReply
10265 GetEntries() []*QueueStatsEntry
10266}
10267
10268func (self *QueueStatsReply) GetEntries() []*QueueStatsEntry {
10269 return self.Entries
10270}
10271
10272func (self *QueueStatsReply) SetEntries(v []*QueueStatsEntry) {
10273 self.Entries = v
10274}
10275
10276func (self *QueueStatsReply) Serialize(encoder *goloxi.Encoder) error {
10277 if err := self.StatsReply.Serialize(encoder); err != nil {
10278 return err
10279 }
10280
10281 encoder.Write(bytes.Repeat([]byte{0}, 4))
10282 for _, obj := range self.Entries {
10283 if err := obj.Serialize(encoder); err != nil {
10284 return err
10285 }
10286 }
10287
10288 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
10289
10290 return nil
10291}
10292
10293func DecodeQueueStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*QueueStatsReply, error) {
10294 _queuestatsreply := &QueueStatsReply{StatsReply: parent}
10295 if decoder.Length() < 4 {
10296 return nil, fmt.Errorf("QueueStatsReply packet too short: %d < 4", decoder.Length())
10297 }
10298 decoder.Skip(4)
10299
10300 for decoder.Length() >= 40 {
10301 item, err := DecodeQueueStatsEntry(decoder)
10302 if err != nil {
10303 return nil, err
10304 }
10305 if item != nil {
10306 _queuestatsreply.Entries = append(_queuestatsreply.Entries, item)
10307 }
10308 }
10309 return _queuestatsreply, nil
10310}
10311
10312func NewQueueStatsReply() *QueueStatsReply {
10313 obj := &QueueStatsReply{
10314 StatsReply: NewStatsReply(5),
10315 }
10316 return obj
10317}
10318
10319type QueueStatsRequest struct {
10320 *StatsRequest
10321 PortNo Port
10322 QueueId uint32
10323}
10324
10325type IQueueStatsRequest interface {
10326 IStatsRequest
10327 GetPortNo() Port
10328 GetQueueId() uint32
10329}
10330
10331func (self *QueueStatsRequest) GetPortNo() Port {
10332 return self.PortNo
10333}
10334
10335func (self *QueueStatsRequest) SetPortNo(v Port) {
10336 self.PortNo = v
10337}
10338
10339func (self *QueueStatsRequest) GetQueueId() uint32 {
10340 return self.QueueId
10341}
10342
10343func (self *QueueStatsRequest) SetQueueId(v uint32) {
10344 self.QueueId = v
10345}
10346
10347func (self *QueueStatsRequest) Serialize(encoder *goloxi.Encoder) error {
10348 if err := self.StatsRequest.Serialize(encoder); err != nil {
10349 return err
10350 }
10351
10352 encoder.Write(bytes.Repeat([]byte{0}, 4))
10353 self.PortNo.Serialize(encoder)
10354 encoder.PutUint32(uint32(self.QueueId))
10355
10356 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
10357
10358 return nil
10359}
10360
10361func DecodeQueueStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*QueueStatsRequest, error) {
10362 _queuestatsrequest := &QueueStatsRequest{StatsRequest: parent}
10363 if decoder.Length() < 12 {
10364 return nil, fmt.Errorf("QueueStatsRequest packet too short: %d < 12", decoder.Length())
10365 }
10366 decoder.Skip(4)
10367 _queuestatsrequest.PortNo.Decode(decoder)
10368 _queuestatsrequest.QueueId = uint32(decoder.ReadUint32())
10369 return _queuestatsrequest, nil
10370}
10371
10372func NewQueueStatsRequest() *QueueStatsRequest {
10373 obj := &QueueStatsRequest{
10374 StatsRequest: NewStatsRequest(5),
10375 }
10376 return obj
10377}
10378
10379type RoleReply struct {
10380 *Header
10381 Role ControllerRole
10382 GenerationId uint64
10383}
10384
10385type IRoleReply interface {
10386 IHeader
10387 GetRole() ControllerRole
10388 GetGenerationId() uint64
10389}
10390
10391func (self *RoleReply) GetRole() ControllerRole {
10392 return self.Role
10393}
10394
10395func (self *RoleReply) SetRole(v ControllerRole) {
10396 self.Role = v
10397}
10398
10399func (self *RoleReply) GetGenerationId() uint64 {
10400 return self.GenerationId
10401}
10402
10403func (self *RoleReply) SetGenerationId(v uint64) {
10404 self.GenerationId = v
10405}
10406
10407func (self *RoleReply) Serialize(encoder *goloxi.Encoder) error {
10408 if err := self.Header.Serialize(encoder); err != nil {
10409 return err
10410 }
10411
10412 encoder.PutUint32(uint32(self.Role))
10413 encoder.Write(bytes.Repeat([]byte{0}, 4))
10414 encoder.PutUint64(uint64(self.GenerationId))
10415
10416 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
10417
10418 return nil
10419}
10420
10421func DecodeRoleReply(parent *Header, decoder *goloxi.Decoder) (*RoleReply, error) {
10422 _rolereply := &RoleReply{Header: parent}
10423 if decoder.Length() < 16 {
10424 return nil, fmt.Errorf("RoleReply packet too short: %d < 16", decoder.Length())
10425 }
10426 _rolereply.Role = ControllerRole(decoder.ReadUint32())
10427 decoder.Skip(4)
10428 _rolereply.GenerationId = uint64(decoder.ReadUint64())
10429 return _rolereply, nil
10430}
10431
10432func NewRoleReply() *RoleReply {
10433 obj := &RoleReply{
10434 Header: NewHeader(25),
10435 }
10436 return obj
10437}
10438
10439type RoleRequest struct {
10440 *Header
10441 Role ControllerRole
10442 GenerationId uint64
10443}
10444
10445type IRoleRequest interface {
10446 IHeader
10447 GetRole() ControllerRole
10448 GetGenerationId() uint64
10449}
10450
10451func (self *RoleRequest) GetRole() ControllerRole {
10452 return self.Role
10453}
10454
10455func (self *RoleRequest) SetRole(v ControllerRole) {
10456 self.Role = v
10457}
10458
10459func (self *RoleRequest) GetGenerationId() uint64 {
10460 return self.GenerationId
10461}
10462
10463func (self *RoleRequest) SetGenerationId(v uint64) {
10464 self.GenerationId = v
10465}
10466
10467func (self *RoleRequest) Serialize(encoder *goloxi.Encoder) error {
10468 if err := self.Header.Serialize(encoder); err != nil {
10469 return err
10470 }
10471
10472 encoder.PutUint32(uint32(self.Role))
10473 encoder.Write(bytes.Repeat([]byte{0}, 4))
10474 encoder.PutUint64(uint64(self.GenerationId))
10475
10476 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
10477
10478 return nil
10479}
10480
10481func DecodeRoleRequest(parent *Header, decoder *goloxi.Decoder) (*RoleRequest, error) {
10482 _rolerequest := &RoleRequest{Header: parent}
10483 if decoder.Length() < 16 {
10484 return nil, fmt.Errorf("RoleRequest packet too short: %d < 16", decoder.Length())
10485 }
10486 _rolerequest.Role = ControllerRole(decoder.ReadUint32())
10487 decoder.Skip(4)
10488 _rolerequest.GenerationId = uint64(decoder.ReadUint64())
10489 return _rolerequest, nil
10490}
10491
10492func NewRoleRequest() *RoleRequest {
10493 obj := &RoleRequest{
10494 Header: NewHeader(24),
10495 }
10496 return obj
10497}
10498
10499type RoleRequestFailedErrorMsg struct {
10500 *ErrorMsg
10501 Code RoleRequestFailedCode
10502 Data []byte
10503}
10504
10505type IRoleRequestFailedErrorMsg interface {
10506 IErrorMsg
10507 GetCode() RoleRequestFailedCode
10508 GetData() []byte
10509}
10510
10511func (self *RoleRequestFailedErrorMsg) GetCode() RoleRequestFailedCode {
10512 return self.Code
10513}
10514
10515func (self *RoleRequestFailedErrorMsg) SetCode(v RoleRequestFailedCode) {
10516 self.Code = v
10517}
10518
10519func (self *RoleRequestFailedErrorMsg) GetData() []byte {
10520 return self.Data
10521}
10522
10523func (self *RoleRequestFailedErrorMsg) SetData(v []byte) {
10524 self.Data = v
10525}
10526
10527func (self *RoleRequestFailedErrorMsg) Serialize(encoder *goloxi.Encoder) error {
10528 if err := self.ErrorMsg.Serialize(encoder); err != nil {
10529 return err
10530 }
10531
10532 encoder.PutUint16(uint16(self.Code))
10533 encoder.Write(self.Data)
10534
10535 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
10536
10537 return nil
10538}
10539
10540func DecodeRoleRequestFailedErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*RoleRequestFailedErrorMsg, error) {
10541 _rolerequestfailederrormsg := &RoleRequestFailedErrorMsg{ErrorMsg: parent}
10542 if decoder.Length() < 2 {
10543 return nil, fmt.Errorf("RoleRequestFailedErrorMsg packet too short: %d < 2", decoder.Length())
10544 }
10545 _rolerequestfailederrormsg.Code = RoleRequestFailedCode(decoder.ReadUint16())
10546 _rolerequestfailederrormsg.Data = decoder.Read(int(decoder.Length()))
10547 return _rolerequestfailederrormsg, nil
10548}
10549
10550func NewRoleRequestFailedErrorMsg() *RoleRequestFailedErrorMsg {
10551 obj := &RoleRequestFailedErrorMsg{
10552 ErrorMsg: NewErrorMsg(11),
10553 }
10554 return obj
10555}
10556
10557type SetConfig struct {
10558 *Header
10559 Flags ConfigFlags
10560 MissSendLen uint16
10561}
10562
10563type ISetConfig interface {
10564 IHeader
10565 GetFlags() ConfigFlags
10566 GetMissSendLen() uint16
10567}
10568
10569func (self *SetConfig) GetFlags() ConfigFlags {
10570 return self.Flags
10571}
10572
10573func (self *SetConfig) SetFlags(v ConfigFlags) {
10574 self.Flags = v
10575}
10576
10577func (self *SetConfig) GetMissSendLen() uint16 {
10578 return self.MissSendLen
10579}
10580
10581func (self *SetConfig) SetMissSendLen(v uint16) {
10582 self.MissSendLen = v
10583}
10584
10585func (self *SetConfig) Serialize(encoder *goloxi.Encoder) error {
10586 if err := self.Header.Serialize(encoder); err != nil {
10587 return err
10588 }
10589
10590 encoder.PutUint16(uint16(self.Flags))
10591 encoder.PutUint16(uint16(self.MissSendLen))
10592
10593 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
10594
10595 return nil
10596}
10597
10598func DecodeSetConfig(parent *Header, decoder *goloxi.Decoder) (*SetConfig, error) {
10599 _setconfig := &SetConfig{Header: parent}
10600 if decoder.Length() < 4 {
10601 return nil, fmt.Errorf("SetConfig packet too short: %d < 4", decoder.Length())
10602 }
10603 _setconfig.Flags = ConfigFlags(decoder.ReadUint16())
10604 _setconfig.MissSendLen = uint16(decoder.ReadUint16())
10605 return _setconfig, nil
10606}
10607
10608func NewSetConfig() *SetConfig {
10609 obj := &SetConfig{
10610 Header: NewHeader(9),
10611 }
10612 return obj
10613}
10614
10615type SwitchConfigFailedErrorMsg struct {
10616 *ErrorMsg
10617 Code SwitchConfigFailedCode
10618 Data []byte
10619}
10620
10621type ISwitchConfigFailedErrorMsg interface {
10622 IErrorMsg
10623 GetCode() SwitchConfigFailedCode
10624 GetData() []byte
10625}
10626
10627func (self *SwitchConfigFailedErrorMsg) GetCode() SwitchConfigFailedCode {
10628 return self.Code
10629}
10630
10631func (self *SwitchConfigFailedErrorMsg) SetCode(v SwitchConfigFailedCode) {
10632 self.Code = v
10633}
10634
10635func (self *SwitchConfigFailedErrorMsg) GetData() []byte {
10636 return self.Data
10637}
10638
10639func (self *SwitchConfigFailedErrorMsg) SetData(v []byte) {
10640 self.Data = v
10641}
10642
10643func (self *SwitchConfigFailedErrorMsg) Serialize(encoder *goloxi.Encoder) error {
10644 if err := self.ErrorMsg.Serialize(encoder); err != nil {
10645 return err
10646 }
10647
10648 encoder.PutUint16(uint16(self.Code))
10649 encoder.Write(self.Data)
10650
10651 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
10652
10653 return nil
10654}
10655
10656func DecodeSwitchConfigFailedErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*SwitchConfigFailedErrorMsg, error) {
10657 _switchconfigfailederrormsg := &SwitchConfigFailedErrorMsg{ErrorMsg: parent}
10658 if decoder.Length() < 2 {
10659 return nil, fmt.Errorf("SwitchConfigFailedErrorMsg packet too short: %d < 2", decoder.Length())
10660 }
10661 _switchconfigfailederrormsg.Code = SwitchConfigFailedCode(decoder.ReadUint16())
10662 _switchconfigfailederrormsg.Data = decoder.Read(int(decoder.Length()))
10663 return _switchconfigfailederrormsg, nil
10664}
10665
10666func NewSwitchConfigFailedErrorMsg() *SwitchConfigFailedErrorMsg {
10667 obj := &SwitchConfigFailedErrorMsg{
10668 ErrorMsg: NewErrorMsg(10),
10669 }
10670 return obj
10671}
10672
10673type TableFeaturesFailedErrorMsg struct {
10674 *ErrorMsg
10675 Code TableFeaturesFailedCode
10676 Data []byte
10677}
10678
10679type ITableFeaturesFailedErrorMsg interface {
10680 IErrorMsg
10681 GetCode() TableFeaturesFailedCode
10682 GetData() []byte
10683}
10684
10685func (self *TableFeaturesFailedErrorMsg) GetCode() TableFeaturesFailedCode {
10686 return self.Code
10687}
10688
10689func (self *TableFeaturesFailedErrorMsg) SetCode(v TableFeaturesFailedCode) {
10690 self.Code = v
10691}
10692
10693func (self *TableFeaturesFailedErrorMsg) GetData() []byte {
10694 return self.Data
10695}
10696
10697func (self *TableFeaturesFailedErrorMsg) SetData(v []byte) {
10698 self.Data = v
10699}
10700
10701func (self *TableFeaturesFailedErrorMsg) Serialize(encoder *goloxi.Encoder) error {
10702 if err := self.ErrorMsg.Serialize(encoder); err != nil {
10703 return err
10704 }
10705
10706 encoder.PutUint16(uint16(self.Code))
10707 encoder.Write(self.Data)
10708
10709 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
10710
10711 return nil
10712}
10713
10714func DecodeTableFeaturesFailedErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*TableFeaturesFailedErrorMsg, error) {
10715 _tablefeaturesfailederrormsg := &TableFeaturesFailedErrorMsg{ErrorMsg: parent}
10716 if decoder.Length() < 2 {
10717 return nil, fmt.Errorf("TableFeaturesFailedErrorMsg packet too short: %d < 2", decoder.Length())
10718 }
10719 _tablefeaturesfailederrormsg.Code = TableFeaturesFailedCode(decoder.ReadUint16())
10720 _tablefeaturesfailederrormsg.Data = decoder.Read(int(decoder.Length()))
10721 return _tablefeaturesfailederrormsg, nil
10722}
10723
10724func NewTableFeaturesFailedErrorMsg() *TableFeaturesFailedErrorMsg {
10725 obj := &TableFeaturesFailedErrorMsg{
10726 ErrorMsg: NewErrorMsg(13),
10727 }
10728 return obj
10729}
10730
10731type TableFeaturesStatsReply struct {
10732 *StatsReply
10733 Entries []*TableFeatures
10734}
10735
10736type ITableFeaturesStatsReply interface {
10737 IStatsReply
10738 GetEntries() []*TableFeatures
10739}
10740
10741func (self *TableFeaturesStatsReply) GetEntries() []*TableFeatures {
10742 return self.Entries
10743}
10744
10745func (self *TableFeaturesStatsReply) SetEntries(v []*TableFeatures) {
10746 self.Entries = v
10747}
10748
10749func (self *TableFeaturesStatsReply) Serialize(encoder *goloxi.Encoder) error {
10750 if err := self.StatsReply.Serialize(encoder); err != nil {
10751 return err
10752 }
10753
10754 encoder.Write(bytes.Repeat([]byte{0}, 4))
10755 for _, obj := range self.Entries {
10756 if err := obj.Serialize(encoder); err != nil {
10757 return err
10758 }
10759 }
10760
10761 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
10762
10763 return nil
10764}
10765
10766func DecodeTableFeaturesStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*TableFeaturesStatsReply, error) {
10767 _tablefeaturesstatsreply := &TableFeaturesStatsReply{StatsReply: parent}
10768 if decoder.Length() < 4 {
10769 return nil, fmt.Errorf("TableFeaturesStatsReply packet too short: %d < 4", decoder.Length())
10770 }
10771 decoder.Skip(4)
10772
10773 for decoder.Length() >= 64 {
10774 item, err := DecodeTableFeatures(decoder)
10775 if err != nil {
10776 return nil, err
10777 }
10778 if item != nil {
10779 _tablefeaturesstatsreply.Entries = append(_tablefeaturesstatsreply.Entries, item)
10780 }
10781 }
10782 return _tablefeaturesstatsreply, nil
10783}
10784
10785func NewTableFeaturesStatsReply() *TableFeaturesStatsReply {
10786 obj := &TableFeaturesStatsReply{
10787 StatsReply: NewStatsReply(12),
10788 }
10789 return obj
10790}
10791
10792type TableFeaturesStatsRequest struct {
10793 *StatsRequest
10794 Entries []*TableFeatures
10795}
10796
10797type ITableFeaturesStatsRequest interface {
10798 IStatsRequest
10799 GetEntries() []*TableFeatures
10800}
10801
10802func (self *TableFeaturesStatsRequest) GetEntries() []*TableFeatures {
10803 return self.Entries
10804}
10805
10806func (self *TableFeaturesStatsRequest) SetEntries(v []*TableFeatures) {
10807 self.Entries = v
10808}
10809
10810func (self *TableFeaturesStatsRequest) Serialize(encoder *goloxi.Encoder) error {
10811 if err := self.StatsRequest.Serialize(encoder); err != nil {
10812 return err
10813 }
10814
10815 encoder.Write(bytes.Repeat([]byte{0}, 4))
10816 for _, obj := range self.Entries {
10817 if err := obj.Serialize(encoder); err != nil {
10818 return err
10819 }
10820 }
10821
10822 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
10823
10824 return nil
10825}
10826
10827func DecodeTableFeaturesStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*TableFeaturesStatsRequest, error) {
10828 _tablefeaturesstatsrequest := &TableFeaturesStatsRequest{StatsRequest: parent}
10829 if decoder.Length() < 4 {
10830 return nil, fmt.Errorf("TableFeaturesStatsRequest packet too short: %d < 4", decoder.Length())
10831 }
10832 decoder.Skip(4)
10833
10834 for decoder.Length() >= 64 {
10835 item, err := DecodeTableFeatures(decoder)
10836 if err != nil {
10837 return nil, err
10838 }
10839 if item != nil {
10840 _tablefeaturesstatsrequest.Entries = append(_tablefeaturesstatsrequest.Entries, item)
10841 }
10842 }
10843 return _tablefeaturesstatsrequest, nil
10844}
10845
10846func NewTableFeaturesStatsRequest() *TableFeaturesStatsRequest {
10847 obj := &TableFeaturesStatsRequest{
10848 StatsRequest: NewStatsRequest(12),
10849 }
10850 return obj
10851}
10852
10853type TableMod struct {
10854 *Header
10855 TableId uint8
10856 Config uint32
10857}
10858
10859type ITableMod interface {
10860 IHeader
10861 GetTableId() uint8
10862 GetConfig() uint32
10863}
10864
10865func (self *TableMod) GetTableId() uint8 {
10866 return self.TableId
10867}
10868
10869func (self *TableMod) SetTableId(v uint8) {
10870 self.TableId = v
10871}
10872
10873func (self *TableMod) GetConfig() uint32 {
10874 return self.Config
10875}
10876
10877func (self *TableMod) SetConfig(v uint32) {
10878 self.Config = v
10879}
10880
10881func (self *TableMod) Serialize(encoder *goloxi.Encoder) error {
10882 if err := self.Header.Serialize(encoder); err != nil {
10883 return err
10884 }
10885
10886 encoder.PutUint8(uint8(self.TableId))
10887 encoder.Write(bytes.Repeat([]byte{0}, 3))
10888 encoder.PutUint32(uint32(self.Config))
10889
10890 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
10891
10892 return nil
10893}
10894
10895func DecodeTableMod(parent *Header, decoder *goloxi.Decoder) (*TableMod, error) {
10896 _tablemod := &TableMod{Header: parent}
10897 if decoder.Length() < 8 {
10898 return nil, fmt.Errorf("TableMod packet too short: %d < 8", decoder.Length())
10899 }
10900 _tablemod.TableId = uint8(decoder.ReadByte())
10901 decoder.Skip(3)
10902 _tablemod.Config = uint32(decoder.ReadUint32())
10903 return _tablemod, nil
10904}
10905
10906func NewTableMod() *TableMod {
10907 obj := &TableMod{
10908 Header: NewHeader(17),
10909 }
10910 return obj
10911}
10912
10913type TableModFailedErrorMsg struct {
10914 *ErrorMsg
10915 Code TableModFailedCode
10916 Data []byte
10917}
10918
10919type ITableModFailedErrorMsg interface {
10920 IErrorMsg
10921 GetCode() TableModFailedCode
10922 GetData() []byte
10923}
10924
10925func (self *TableModFailedErrorMsg) GetCode() TableModFailedCode {
10926 return self.Code
10927}
10928
10929func (self *TableModFailedErrorMsg) SetCode(v TableModFailedCode) {
10930 self.Code = v
10931}
10932
10933func (self *TableModFailedErrorMsg) GetData() []byte {
10934 return self.Data
10935}
10936
10937func (self *TableModFailedErrorMsg) SetData(v []byte) {
10938 self.Data = v
10939}
10940
10941func (self *TableModFailedErrorMsg) Serialize(encoder *goloxi.Encoder) error {
10942 if err := self.ErrorMsg.Serialize(encoder); err != nil {
10943 return err
10944 }
10945
10946 encoder.PutUint16(uint16(self.Code))
10947 encoder.Write(self.Data)
10948
10949 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
10950
10951 return nil
10952}
10953
10954func DecodeTableModFailedErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*TableModFailedErrorMsg, error) {
10955 _tablemodfailederrormsg := &TableModFailedErrorMsg{ErrorMsg: parent}
10956 if decoder.Length() < 2 {
10957 return nil, fmt.Errorf("TableModFailedErrorMsg packet too short: %d < 2", decoder.Length())
10958 }
10959 _tablemodfailederrormsg.Code = TableModFailedCode(decoder.ReadUint16())
10960 _tablemodfailederrormsg.Data = decoder.Read(int(decoder.Length()))
10961 return _tablemodfailederrormsg, nil
10962}
10963
10964func NewTableModFailedErrorMsg() *TableModFailedErrorMsg {
10965 obj := &TableModFailedErrorMsg{
10966 ErrorMsg: NewErrorMsg(8),
10967 }
10968 return obj
10969}
10970
10971type TableStatsReply struct {
10972 *StatsReply
10973 Entries []*TableStatsEntry
10974}
10975
10976type ITableStatsReply interface {
10977 IStatsReply
10978 GetEntries() []*TableStatsEntry
10979}
10980
10981func (self *TableStatsReply) GetEntries() []*TableStatsEntry {
10982 return self.Entries
10983}
10984
10985func (self *TableStatsReply) SetEntries(v []*TableStatsEntry) {
10986 self.Entries = v
10987}
10988
10989func (self *TableStatsReply) Serialize(encoder *goloxi.Encoder) error {
10990 if err := self.StatsReply.Serialize(encoder); err != nil {
10991 return err
10992 }
10993
10994 encoder.Write(bytes.Repeat([]byte{0}, 4))
10995 for _, obj := range self.Entries {
10996 if err := obj.Serialize(encoder); err != nil {
10997 return err
10998 }
10999 }
11000
11001 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
11002
11003 return nil
11004}
11005
11006func DecodeTableStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*TableStatsReply, error) {
11007 _tablestatsreply := &TableStatsReply{StatsReply: parent}
11008 if decoder.Length() < 4 {
11009 return nil, fmt.Errorf("TableStatsReply packet too short: %d < 4", decoder.Length())
11010 }
11011 decoder.Skip(4)
11012
11013 for decoder.Length() >= 24 {
11014 item, err := DecodeTableStatsEntry(decoder)
11015 if err != nil {
11016 return nil, err
11017 }
11018 if item != nil {
11019 _tablestatsreply.Entries = append(_tablestatsreply.Entries, item)
11020 }
11021 }
11022 return _tablestatsreply, nil
11023}
11024
11025func NewTableStatsReply() *TableStatsReply {
11026 obj := &TableStatsReply{
11027 StatsReply: NewStatsReply(3),
11028 }
11029 return obj
11030}
11031
11032type TableStatsRequest struct {
11033 *StatsRequest
11034}
11035
11036type ITableStatsRequest interface {
11037 IStatsRequest
11038}
11039
11040func (self *TableStatsRequest) Serialize(encoder *goloxi.Encoder) error {
11041 if err := self.StatsRequest.Serialize(encoder); err != nil {
11042 return err
11043 }
11044
11045 encoder.Write(bytes.Repeat([]byte{0}, 4))
11046
11047 binary.BigEndian.PutUint16(encoder.Bytes()[2:4], uint16(len(encoder.Bytes())))
11048
11049 return nil
11050}
11051
11052func DecodeTableStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*TableStatsRequest, error) {
11053 _tablestatsrequest := &TableStatsRequest{StatsRequest: parent}
11054 if decoder.Length() < 4 {
11055 return nil, fmt.Errorf("TableStatsRequest packet too short: %d < 4", decoder.Length())
11056 }
11057 decoder.Skip(4)
11058 return _tablestatsrequest, nil
11059}
11060
11061func NewTableStatsRequest() *TableStatsRequest {
11062 obj := &TableStatsRequest{
11063 StatsRequest: NewStatsRequest(3),
11064 }
11065 return obj
11066}