Jonathan Hart | 44bdbfc | 2020-04-14 17:45:47 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 10 | package of14 |
| 11 | |
| 12 | import ( |
| 13 | "bytes" |
| 14 | "encoding/binary" |
| 15 | "fmt" |
| 16 | "net" |
| 17 | |
| 18 | "github.com/opencord/goloxi" |
| 19 | ) |
| 20 | |
| 21 | type Header struct { |
| 22 | Version uint8 |
| 23 | Type uint8 |
| 24 | Length uint16 |
| 25 | Xid uint32 |
| 26 | } |
| 27 | |
| 28 | type IHeader interface { |
| 29 | goloxi.Serializable |
| 30 | GetVersion() uint8 |
| 31 | GetType() uint8 |
| 32 | GetLength() uint16 |
| 33 | GetXid() uint32 |
| 34 | } |
| 35 | |
| 36 | func (self *Header) GetVersion() uint8 { |
| 37 | return self.Version |
| 38 | } |
| 39 | |
| 40 | func (self *Header) SetVersion(v uint8) { |
| 41 | self.Version = v |
| 42 | } |
| 43 | |
| 44 | func (self *Header) GetType() uint8 { |
| 45 | return self.Type |
| 46 | } |
| 47 | |
| 48 | func (self *Header) SetType(v uint8) { |
| 49 | self.Type = v |
| 50 | } |
| 51 | |
| 52 | func (self *Header) GetLength() uint16 { |
| 53 | return self.Length |
| 54 | } |
| 55 | |
| 56 | func (self *Header) SetLength(v uint16) { |
| 57 | self.Length = v |
| 58 | } |
| 59 | |
| 60 | func (self *Header) GetXid() uint32 { |
| 61 | return self.Xid |
| 62 | } |
| 63 | |
| 64 | func (self *Header) SetXid(v uint32) { |
| 65 | self.Xid = v |
| 66 | } |
| 67 | |
| 68 | func (self *Header) Serialize(encoder *goloxi.Encoder) error { |
| 69 | |
| 70 | encoder.PutUint8(uint8(5)) |
| 71 | encoder.PutUint8(uint8(self.Type)) |
| 72 | encoder.PutUint16(uint16(self.Length)) |
| 73 | encoder.PutUint32(uint32(self.Xid)) |
| 74 | |
| 75 | return nil |
| 76 | } |
| 77 | func (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 | } |
| 92 | func 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 24: |
| 151 | return DecodeRoleRequest(_header, decoder) |
| 152 | case 25: |
| 153 | return DecodeRoleReply(_header, decoder) |
| 154 | case 26: |
| 155 | return DecodeAsyncGetRequest(_header, decoder) |
| 156 | case 27: |
| 157 | return DecodeAsyncGetReply(_header, decoder) |
| 158 | case 28: |
| 159 | return DecodeAsyncSet(_header, decoder) |
| 160 | case 29: |
| 161 | return DecodeMeterMod(_header, decoder) |
| 162 | case 30: |
| 163 | return DecodeRoleStatus(_header, decoder) |
| 164 | case 31: |
| 165 | return DecodeTableStatus(_header, decoder) |
| 166 | case 32: |
| 167 | return DecodeRequestforward(_header, decoder) |
| 168 | case 33: |
| 169 | return DecodeBundleCtrlMsg(_header, decoder) |
| 170 | case 34: |
| 171 | return DecodeBundleAddMsg(_header, decoder) |
| 172 | default: |
| 173 | return nil, fmt.Errorf("Invalid type '%d' for 'Header'", _header.Type) |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | func NewHeader(_type uint8) *Header { |
| 178 | obj := &Header{} |
| 179 | obj.Type = _type |
| 180 | return obj |
| 181 | } |
| 182 | |
| 183 | type StatsReply struct { |
| 184 | *Header |
| 185 | StatsType uint16 |
| 186 | Flags StatsReplyFlags |
| 187 | } |
| 188 | |
| 189 | type IStatsReply interface { |
| 190 | IHeader |
| 191 | GetStatsType() uint16 |
| 192 | GetFlags() StatsReplyFlags |
| 193 | } |
| 194 | |
| 195 | func (self *StatsReply) GetStatsType() uint16 { |
| 196 | return self.StatsType |
| 197 | } |
| 198 | |
| 199 | func (self *StatsReply) SetStatsType(v uint16) { |
| 200 | self.StatsType = v |
| 201 | } |
| 202 | |
| 203 | func (self *StatsReply) GetFlags() StatsReplyFlags { |
| 204 | return self.Flags |
| 205 | } |
| 206 | |
| 207 | func (self *StatsReply) SetFlags(v StatsReplyFlags) { |
| 208 | self.Flags = v |
| 209 | } |
| 210 | |
| 211 | func (self *StatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 212 | if err := self.Header.Serialize(encoder); err != nil { |
| 213 | return err |
| 214 | } |
| 215 | |
| 216 | encoder.PutUint16(uint16(self.StatsType)) |
| 217 | encoder.PutUint16(uint16(self.Flags)) |
| 218 | |
| 219 | return nil |
| 220 | } |
| 221 | |
| 222 | func DecodeStatsReply(parent *Header, decoder *goloxi.Decoder) (IStatsReply, error) { |
| 223 | _statsreply := &StatsReply{Header: parent} |
| 224 | if decoder.Length() < 4 { |
| 225 | return nil, fmt.Errorf("StatsReply packet too short: %d < 4", decoder.Length()) |
| 226 | } |
| 227 | _statsreply.StatsType = uint16(decoder.ReadUint16()) |
| 228 | _statsreply.Flags = StatsReplyFlags(decoder.ReadUint16()) |
| 229 | |
| 230 | switch _statsreply.StatsType { |
| 231 | case 0: |
| 232 | return DecodeDescStatsReply(_statsreply, decoder) |
| 233 | case 1: |
| 234 | return DecodeFlowStatsReply(_statsreply, decoder) |
| 235 | case 2: |
| 236 | return DecodeAggregateStatsReply(_statsreply, decoder) |
| 237 | case 3: |
| 238 | return DecodeTableStatsReply(_statsreply, decoder) |
| 239 | case 4: |
| 240 | return DecodePortStatsReply(_statsreply, decoder) |
| 241 | case 5: |
| 242 | return DecodeQueueStatsReply(_statsreply, decoder) |
| 243 | case 6: |
| 244 | return DecodeGroupStatsReply(_statsreply, decoder) |
| 245 | case 7: |
| 246 | return DecodeGroupDescStatsReply(_statsreply, decoder) |
| 247 | case 8: |
| 248 | return DecodeGroupFeaturesStatsReply(_statsreply, decoder) |
| 249 | case 9: |
| 250 | return DecodeMeterStatsReply(_statsreply, decoder) |
| 251 | case 10: |
| 252 | return DecodeMeterConfigStatsReply(_statsreply, decoder) |
| 253 | case 11: |
| 254 | return DecodeMeterFeaturesStatsReply(_statsreply, decoder) |
| 255 | case 12: |
| 256 | return DecodeTableFeaturesStatsReply(_statsreply, decoder) |
| 257 | case 13: |
| 258 | return DecodePortDescStatsReply(_statsreply, decoder) |
| 259 | case 14: |
| 260 | return DecodeTableDescStatsReply(_statsreply, decoder) |
| 261 | case 15: |
| 262 | return DecodeQueueDescStatsReply(_statsreply, decoder) |
| 263 | case 16: |
| 264 | return DecodeFlowMonitorReply(_statsreply, decoder) |
| 265 | case 65535: |
| 266 | return DecodeExperimenterStatsReply(_statsreply, decoder) |
| 267 | default: |
| 268 | return nil, fmt.Errorf("Invalid type '%d' for 'StatsReply'", _statsreply.StatsType) |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | func NewStatsReply(_stats_type uint16) *StatsReply { |
| 273 | obj := &StatsReply{ |
| 274 | Header: NewHeader(19), |
| 275 | } |
| 276 | obj.StatsType = _stats_type |
| 277 | return obj |
| 278 | } |
| 279 | |
| 280 | type AggregateStatsReply struct { |
| 281 | *StatsReply |
| 282 | PacketCount uint64 |
| 283 | ByteCount uint64 |
| 284 | FlowCount uint32 |
| 285 | } |
| 286 | |
| 287 | type IAggregateStatsReply interface { |
| 288 | IStatsReply |
| 289 | GetPacketCount() uint64 |
| 290 | GetByteCount() uint64 |
| 291 | GetFlowCount() uint32 |
| 292 | } |
| 293 | |
| 294 | func (self *AggregateStatsReply) GetPacketCount() uint64 { |
| 295 | return self.PacketCount |
| 296 | } |
| 297 | |
| 298 | func (self *AggregateStatsReply) SetPacketCount(v uint64) { |
| 299 | self.PacketCount = v |
| 300 | } |
| 301 | |
| 302 | func (self *AggregateStatsReply) GetByteCount() uint64 { |
| 303 | return self.ByteCount |
| 304 | } |
| 305 | |
| 306 | func (self *AggregateStatsReply) SetByteCount(v uint64) { |
| 307 | self.ByteCount = v |
| 308 | } |
| 309 | |
| 310 | func (self *AggregateStatsReply) GetFlowCount() uint32 { |
| 311 | return self.FlowCount |
| 312 | } |
| 313 | |
| 314 | func (self *AggregateStatsReply) SetFlowCount(v uint32) { |
| 315 | self.FlowCount = v |
| 316 | } |
| 317 | |
| 318 | func (self *AggregateStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 319 | startIndex := len(encoder.Bytes()) |
| 320 | if err := self.StatsReply.Serialize(encoder); err != nil { |
| 321 | return err |
| 322 | } |
| 323 | |
| 324 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 325 | encoder.PutUint64(uint64(self.PacketCount)) |
| 326 | encoder.PutUint64(uint64(self.ByteCount)) |
| 327 | encoder.PutUint32(uint32(self.FlowCount)) |
| 328 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 329 | length := len(encoder.Bytes()) - startIndex |
| 330 | |
| 331 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 332 | |
| 333 | return nil |
| 334 | } |
| 335 | |
| 336 | func DecodeAggregateStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*AggregateStatsReply, error) { |
| 337 | _aggregatestatsreply := &AggregateStatsReply{StatsReply: parent} |
| 338 | if decoder.Length() < 4 { |
| 339 | return nil, fmt.Errorf("AggregateStatsReply packet too short: %d < 4", decoder.Length()) |
| 340 | } |
| 341 | decoder.Skip(4) |
| 342 | _aggregatestatsreply.PacketCount = uint64(decoder.ReadUint64()) |
| 343 | _aggregatestatsreply.ByteCount = uint64(decoder.ReadUint64()) |
| 344 | _aggregatestatsreply.FlowCount = uint32(decoder.ReadUint32()) |
| 345 | decoder.Skip(4) |
| 346 | return _aggregatestatsreply, nil |
| 347 | } |
| 348 | |
| 349 | func NewAggregateStatsReply() *AggregateStatsReply { |
| 350 | obj := &AggregateStatsReply{ |
| 351 | StatsReply: NewStatsReply(2), |
| 352 | } |
| 353 | return obj |
| 354 | } |
| 355 | |
| 356 | type StatsRequest struct { |
| 357 | *Header |
| 358 | StatsType uint16 |
| 359 | Flags StatsRequestFlags |
| 360 | } |
| 361 | |
| 362 | type IStatsRequest interface { |
| 363 | IHeader |
| 364 | GetStatsType() uint16 |
| 365 | GetFlags() StatsRequestFlags |
| 366 | } |
| 367 | |
| 368 | func (self *StatsRequest) GetStatsType() uint16 { |
| 369 | return self.StatsType |
| 370 | } |
| 371 | |
| 372 | func (self *StatsRequest) SetStatsType(v uint16) { |
| 373 | self.StatsType = v |
| 374 | } |
| 375 | |
| 376 | func (self *StatsRequest) GetFlags() StatsRequestFlags { |
| 377 | return self.Flags |
| 378 | } |
| 379 | |
| 380 | func (self *StatsRequest) SetFlags(v StatsRequestFlags) { |
| 381 | self.Flags = v |
| 382 | } |
| 383 | |
| 384 | func (self *StatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 385 | if err := self.Header.Serialize(encoder); err != nil { |
| 386 | return err |
| 387 | } |
| 388 | |
| 389 | encoder.PutUint16(uint16(self.StatsType)) |
| 390 | encoder.PutUint16(uint16(self.Flags)) |
| 391 | |
| 392 | return nil |
| 393 | } |
| 394 | |
| 395 | func DecodeStatsRequest(parent *Header, decoder *goloxi.Decoder) (IStatsRequest, error) { |
| 396 | _statsrequest := &StatsRequest{Header: parent} |
| 397 | if decoder.Length() < 4 { |
| 398 | return nil, fmt.Errorf("StatsRequest packet too short: %d < 4", decoder.Length()) |
| 399 | } |
| 400 | _statsrequest.StatsType = uint16(decoder.ReadUint16()) |
| 401 | _statsrequest.Flags = StatsRequestFlags(decoder.ReadUint16()) |
| 402 | |
| 403 | switch _statsrequest.StatsType { |
| 404 | case 0: |
| 405 | return DecodeDescStatsRequest(_statsrequest, decoder) |
| 406 | case 1: |
| 407 | return DecodeFlowStatsRequest(_statsrequest, decoder) |
| 408 | case 2: |
| 409 | return DecodeAggregateStatsRequest(_statsrequest, decoder) |
| 410 | case 3: |
| 411 | return DecodeTableStatsRequest(_statsrequest, decoder) |
| 412 | case 4: |
| 413 | return DecodePortStatsRequest(_statsrequest, decoder) |
| 414 | case 5: |
| 415 | return DecodeQueueStatsRequest(_statsrequest, decoder) |
| 416 | case 6: |
| 417 | return DecodeGroupStatsRequest(_statsrequest, decoder) |
| 418 | case 7: |
| 419 | return DecodeGroupDescStatsRequest(_statsrequest, decoder) |
| 420 | case 8: |
| 421 | return DecodeGroupFeaturesStatsRequest(_statsrequest, decoder) |
| 422 | case 9: |
| 423 | return DecodeMeterStatsRequest(_statsrequest, decoder) |
| 424 | case 10: |
| 425 | return DecodeMeterConfigStatsRequest(_statsrequest, decoder) |
| 426 | case 11: |
| 427 | return DecodeMeterFeaturesStatsRequest(_statsrequest, decoder) |
| 428 | case 12: |
| 429 | return DecodeTableFeaturesStatsRequest(_statsrequest, decoder) |
| 430 | case 13: |
| 431 | return DecodePortDescStatsRequest(_statsrequest, decoder) |
| 432 | case 14: |
| 433 | return DecodeTableDescStatsRequest(_statsrequest, decoder) |
| 434 | case 15: |
| 435 | return DecodeQueueDescStatsRequest(_statsrequest, decoder) |
| 436 | case 16: |
| 437 | return DecodeFlowMonitorRequest(_statsrequest, decoder) |
| 438 | case 65535: |
| 439 | return DecodeExperimenterStatsRequest(_statsrequest, decoder) |
| 440 | default: |
| 441 | return nil, fmt.Errorf("Invalid type '%d' for 'StatsRequest'", _statsrequest.StatsType) |
| 442 | } |
| 443 | } |
| 444 | |
| 445 | func NewStatsRequest(_stats_type uint16) *StatsRequest { |
| 446 | obj := &StatsRequest{ |
| 447 | Header: NewHeader(18), |
| 448 | } |
| 449 | obj.StatsType = _stats_type |
| 450 | return obj |
| 451 | } |
| 452 | |
| 453 | type AggregateStatsRequest struct { |
| 454 | *StatsRequest |
| 455 | TableId uint8 |
| 456 | OutPort Port |
| 457 | OutGroup uint32 |
| 458 | Cookie uint64 |
| 459 | CookieMask uint64 |
| 460 | Match Match |
| 461 | } |
| 462 | |
| 463 | type IAggregateStatsRequest interface { |
| 464 | IStatsRequest |
| 465 | GetTableId() uint8 |
| 466 | GetOutPort() Port |
| 467 | GetOutGroup() uint32 |
| 468 | GetCookie() uint64 |
| 469 | GetCookieMask() uint64 |
| 470 | GetMatch() Match |
| 471 | } |
| 472 | |
| 473 | func (self *AggregateStatsRequest) GetTableId() uint8 { |
| 474 | return self.TableId |
| 475 | } |
| 476 | |
| 477 | func (self *AggregateStatsRequest) SetTableId(v uint8) { |
| 478 | self.TableId = v |
| 479 | } |
| 480 | |
| 481 | func (self *AggregateStatsRequest) GetOutPort() Port { |
| 482 | return self.OutPort |
| 483 | } |
| 484 | |
| 485 | func (self *AggregateStatsRequest) SetOutPort(v Port) { |
| 486 | self.OutPort = v |
| 487 | } |
| 488 | |
| 489 | func (self *AggregateStatsRequest) GetOutGroup() uint32 { |
| 490 | return self.OutGroup |
| 491 | } |
| 492 | |
| 493 | func (self *AggregateStatsRequest) SetOutGroup(v uint32) { |
| 494 | self.OutGroup = v |
| 495 | } |
| 496 | |
| 497 | func (self *AggregateStatsRequest) GetCookie() uint64 { |
| 498 | return self.Cookie |
| 499 | } |
| 500 | |
| 501 | func (self *AggregateStatsRequest) SetCookie(v uint64) { |
| 502 | self.Cookie = v |
| 503 | } |
| 504 | |
| 505 | func (self *AggregateStatsRequest) GetCookieMask() uint64 { |
| 506 | return self.CookieMask |
| 507 | } |
| 508 | |
| 509 | func (self *AggregateStatsRequest) SetCookieMask(v uint64) { |
| 510 | self.CookieMask = v |
| 511 | } |
| 512 | |
| 513 | func (self *AggregateStatsRequest) GetMatch() Match { |
| 514 | return self.Match |
| 515 | } |
| 516 | |
| 517 | func (self *AggregateStatsRequest) SetMatch(v Match) { |
| 518 | self.Match = v |
| 519 | } |
| 520 | |
| 521 | func (self *AggregateStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 522 | startIndex := len(encoder.Bytes()) |
| 523 | if err := self.StatsRequest.Serialize(encoder); err != nil { |
| 524 | return err |
| 525 | } |
| 526 | |
| 527 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 528 | encoder.PutUint8(uint8(self.TableId)) |
| 529 | encoder.Write(bytes.Repeat([]byte{0}, 3)) |
| 530 | self.OutPort.Serialize(encoder) |
| 531 | encoder.PutUint32(uint32(self.OutGroup)) |
| 532 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 533 | encoder.PutUint64(uint64(self.Cookie)) |
| 534 | encoder.PutUint64(uint64(self.CookieMask)) |
| 535 | if err := self.Match.Serialize(encoder); err != nil { |
| 536 | return err |
| 537 | } |
| 538 | |
| 539 | length := len(encoder.Bytes()) - startIndex |
| 540 | |
| 541 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 542 | |
| 543 | return nil |
| 544 | } |
| 545 | |
| 546 | func DecodeAggregateStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*AggregateStatsRequest, error) { |
| 547 | _aggregatestatsrequest := &AggregateStatsRequest{StatsRequest: parent} |
| 548 | if decoder.Length() < 28 { |
| 549 | return nil, fmt.Errorf("AggregateStatsRequest packet too short: %d < 28", decoder.Length()) |
| 550 | } |
| 551 | decoder.Skip(4) |
| 552 | _aggregatestatsrequest.TableId = uint8(decoder.ReadByte()) |
| 553 | decoder.Skip(3) |
| 554 | _aggregatestatsrequest.OutPort.Decode(decoder) |
| 555 | _aggregatestatsrequest.OutGroup = uint32(decoder.ReadUint32()) |
| 556 | decoder.Skip(4) |
| 557 | _aggregatestatsrequest.Cookie = uint64(decoder.ReadUint64()) |
| 558 | _aggregatestatsrequest.CookieMask = uint64(decoder.ReadUint64()) |
| 559 | if err := _aggregatestatsrequest.Match.Decode(decoder); err != nil { |
| 560 | return nil, err |
| 561 | } |
| 562 | |
| 563 | decoder.SkipAlign() |
| 564 | return _aggregatestatsrequest, nil |
| 565 | } |
| 566 | |
| 567 | func NewAggregateStatsRequest() *AggregateStatsRequest { |
| 568 | obj := &AggregateStatsRequest{ |
| 569 | StatsRequest: NewStatsRequest(2), |
| 570 | } |
| 571 | return obj |
| 572 | } |
| 573 | |
| 574 | type ErrorMsg struct { |
| 575 | *Header |
| 576 | ErrType uint16 |
| 577 | } |
| 578 | |
| 579 | type IErrorMsg interface { |
| 580 | IHeader |
| 581 | GetErrType() uint16 |
| 582 | } |
| 583 | |
| 584 | func (self *ErrorMsg) GetErrType() uint16 { |
| 585 | return self.ErrType |
| 586 | } |
| 587 | |
| 588 | func (self *ErrorMsg) SetErrType(v uint16) { |
| 589 | self.ErrType = v |
| 590 | } |
| 591 | |
| 592 | func (self *ErrorMsg) Serialize(encoder *goloxi.Encoder) error { |
| 593 | if err := self.Header.Serialize(encoder); err != nil { |
| 594 | return err |
| 595 | } |
| 596 | |
| 597 | encoder.PutUint16(uint16(self.ErrType)) |
| 598 | |
| 599 | return nil |
| 600 | } |
| 601 | |
| 602 | func DecodeErrorMsg(parent *Header, decoder *goloxi.Decoder) (IErrorMsg, error) { |
| 603 | _errormsg := &ErrorMsg{Header: parent} |
| 604 | if decoder.Length() < 2 { |
| 605 | return nil, fmt.Errorf("ErrorMsg packet too short: %d < 2", decoder.Length()) |
| 606 | } |
| 607 | _errormsg.ErrType = uint16(decoder.ReadUint16()) |
| 608 | |
| 609 | switch _errormsg.ErrType { |
| 610 | case 0: |
| 611 | return DecodeHelloFailedErrorMsg(_errormsg, decoder) |
| 612 | case 1: |
| 613 | return DecodeBadRequestErrorMsg(_errormsg, decoder) |
| 614 | case 2: |
| 615 | return DecodeBadActionErrorMsg(_errormsg, decoder) |
| 616 | case 3: |
| 617 | return DecodeBadInstructionErrorMsg(_errormsg, decoder) |
| 618 | case 4: |
| 619 | return DecodeBadMatchErrorMsg(_errormsg, decoder) |
| 620 | case 5: |
| 621 | return DecodeFlowModFailedErrorMsg(_errormsg, decoder) |
| 622 | case 6: |
| 623 | return DecodeGroupModFailedErrorMsg(_errormsg, decoder) |
| 624 | case 7: |
| 625 | return DecodePortModFailedErrorMsg(_errormsg, decoder) |
| 626 | case 8: |
| 627 | return DecodeTableModFailedErrorMsg(_errormsg, decoder) |
| 628 | case 9: |
| 629 | return DecodeQueueOpFailedErrorMsg(_errormsg, decoder) |
| 630 | case 10: |
| 631 | return DecodeSwitchConfigFailedErrorMsg(_errormsg, decoder) |
| 632 | case 11: |
| 633 | return DecodeRoleRequestFailedErrorMsg(_errormsg, decoder) |
| 634 | case 12: |
| 635 | return DecodeMeterModFailedErrorMsg(_errormsg, decoder) |
| 636 | case 13: |
| 637 | return DecodeTableFeaturesFailedErrorMsg(_errormsg, decoder) |
| 638 | case 14: |
| 639 | return DecodeBadPropertyErrorMsg(_errormsg, decoder) |
| 640 | case 15: |
| 641 | return DecodeAsyncConfigFailedErrorMsg(_errormsg, decoder) |
| 642 | case 16: |
| 643 | return DecodeFlowMonitorFailedErrorMsg(_errormsg, decoder) |
| 644 | case 17: |
| 645 | return DecodeBundleFailedErrorMsg(_errormsg, decoder) |
| 646 | case 65535: |
| 647 | return DecodeExperimenterErrorMsg(_errormsg, decoder) |
| 648 | default: |
| 649 | return nil, fmt.Errorf("Invalid type '%d' for 'ErrorMsg'", _errormsg.ErrType) |
| 650 | } |
| 651 | } |
| 652 | |
| 653 | func NewErrorMsg(_err_type uint16) *ErrorMsg { |
| 654 | obj := &ErrorMsg{ |
| 655 | Header: NewHeader(1), |
| 656 | } |
| 657 | obj.ErrType = _err_type |
| 658 | return obj |
| 659 | } |
| 660 | |
| 661 | type AsyncConfigFailedErrorMsg struct { |
| 662 | *ErrorMsg |
| 663 | Code AsyncConfigFailedCode |
| 664 | Data []byte |
| 665 | } |
| 666 | |
| 667 | type IAsyncConfigFailedErrorMsg interface { |
| 668 | IErrorMsg |
| 669 | GetCode() AsyncConfigFailedCode |
| 670 | GetData() []byte |
| 671 | } |
| 672 | |
| 673 | func (self *AsyncConfigFailedErrorMsg) GetCode() AsyncConfigFailedCode { |
| 674 | return self.Code |
| 675 | } |
| 676 | |
| 677 | func (self *AsyncConfigFailedErrorMsg) SetCode(v AsyncConfigFailedCode) { |
| 678 | self.Code = v |
| 679 | } |
| 680 | |
| 681 | func (self *AsyncConfigFailedErrorMsg) GetData() []byte { |
| 682 | return self.Data |
| 683 | } |
| 684 | |
| 685 | func (self *AsyncConfigFailedErrorMsg) SetData(v []byte) { |
| 686 | self.Data = v |
| 687 | } |
| 688 | |
| 689 | func (self *AsyncConfigFailedErrorMsg) Serialize(encoder *goloxi.Encoder) error { |
| 690 | startIndex := len(encoder.Bytes()) |
| 691 | if err := self.ErrorMsg.Serialize(encoder); err != nil { |
| 692 | return err |
| 693 | } |
| 694 | |
| 695 | encoder.PutUint16(uint16(self.Code)) |
| 696 | encoder.Write(self.Data) |
| 697 | length := len(encoder.Bytes()) - startIndex |
| 698 | |
| 699 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 700 | |
| 701 | return nil |
| 702 | } |
| 703 | |
| 704 | func DecodeAsyncConfigFailedErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*AsyncConfigFailedErrorMsg, error) { |
| 705 | _asyncconfigfailederrormsg := &AsyncConfigFailedErrorMsg{ErrorMsg: parent} |
| 706 | if decoder.Length() < 2 { |
| 707 | return nil, fmt.Errorf("AsyncConfigFailedErrorMsg packet too short: %d < 2", decoder.Length()) |
| 708 | } |
| 709 | _asyncconfigfailederrormsg.Code = AsyncConfigFailedCode(decoder.ReadUint16()) |
| 710 | _asyncconfigfailederrormsg.Data = decoder.Read(int(decoder.Length())) |
| 711 | return _asyncconfigfailederrormsg, nil |
| 712 | } |
| 713 | |
| 714 | func NewAsyncConfigFailedErrorMsg() *AsyncConfigFailedErrorMsg { |
| 715 | obj := &AsyncConfigFailedErrorMsg{ |
| 716 | ErrorMsg: NewErrorMsg(15), |
| 717 | } |
| 718 | return obj |
| 719 | } |
| 720 | |
| 721 | type AsyncGetReply struct { |
| 722 | *Header |
| 723 | Properties []IAsyncConfigProp |
| 724 | } |
| 725 | |
| 726 | type IAsyncGetReply interface { |
| 727 | IHeader |
| 728 | GetProperties() []IAsyncConfigProp |
| 729 | } |
| 730 | |
| 731 | func (self *AsyncGetReply) GetProperties() []IAsyncConfigProp { |
| 732 | return self.Properties |
| 733 | } |
| 734 | |
| 735 | func (self *AsyncGetReply) SetProperties(v []IAsyncConfigProp) { |
| 736 | self.Properties = v |
| 737 | } |
| 738 | |
| 739 | func (self *AsyncGetReply) Serialize(encoder *goloxi.Encoder) error { |
| 740 | startIndex := len(encoder.Bytes()) |
| 741 | if err := self.Header.Serialize(encoder); err != nil { |
| 742 | return err |
| 743 | } |
| 744 | |
| 745 | for _, obj := range self.Properties { |
| 746 | if err := obj.Serialize(encoder); err != nil { |
| 747 | return err |
| 748 | } |
| 749 | } |
| 750 | length := len(encoder.Bytes()) - startIndex |
| 751 | |
| 752 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 753 | |
| 754 | return nil |
| 755 | } |
| 756 | |
| 757 | func DecodeAsyncGetReply(parent *Header, decoder *goloxi.Decoder) (*AsyncGetReply, error) { |
| 758 | _asyncgetreply := &AsyncGetReply{Header: parent} |
| 759 | |
| 760 | for decoder.Length() >= 4 { |
| 761 | item, err := DecodeAsyncConfigProp(decoder) |
| 762 | if err != nil { |
| 763 | return nil, err |
| 764 | } |
| 765 | if item != nil { |
| 766 | _asyncgetreply.Properties = append(_asyncgetreply.Properties, item) |
| 767 | } |
| 768 | } |
| 769 | return _asyncgetreply, nil |
| 770 | } |
| 771 | |
| 772 | func NewAsyncGetReply() *AsyncGetReply { |
| 773 | obj := &AsyncGetReply{ |
| 774 | Header: NewHeader(27), |
| 775 | } |
| 776 | return obj |
| 777 | } |
| 778 | |
| 779 | type AsyncGetRequest struct { |
| 780 | *Header |
| 781 | Properties []IAsyncConfigProp |
| 782 | } |
| 783 | |
| 784 | type IAsyncGetRequest interface { |
| 785 | IHeader |
| 786 | GetProperties() []IAsyncConfigProp |
| 787 | } |
| 788 | |
| 789 | func (self *AsyncGetRequest) GetProperties() []IAsyncConfigProp { |
| 790 | return self.Properties |
| 791 | } |
| 792 | |
| 793 | func (self *AsyncGetRequest) SetProperties(v []IAsyncConfigProp) { |
| 794 | self.Properties = v |
| 795 | } |
| 796 | |
| 797 | func (self *AsyncGetRequest) Serialize(encoder *goloxi.Encoder) error { |
| 798 | startIndex := len(encoder.Bytes()) |
| 799 | if err := self.Header.Serialize(encoder); err != nil { |
| 800 | return err |
| 801 | } |
| 802 | |
| 803 | for _, obj := range self.Properties { |
| 804 | if err := obj.Serialize(encoder); err != nil { |
| 805 | return err |
| 806 | } |
| 807 | } |
| 808 | length := len(encoder.Bytes()) - startIndex |
| 809 | |
| 810 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 811 | |
| 812 | return nil |
| 813 | } |
| 814 | |
| 815 | func DecodeAsyncGetRequest(parent *Header, decoder *goloxi.Decoder) (*AsyncGetRequest, error) { |
| 816 | _asyncgetrequest := &AsyncGetRequest{Header: parent} |
| 817 | |
| 818 | for decoder.Length() >= 4 { |
| 819 | item, err := DecodeAsyncConfigProp(decoder) |
| 820 | if err != nil { |
| 821 | return nil, err |
| 822 | } |
| 823 | if item != nil { |
| 824 | _asyncgetrequest.Properties = append(_asyncgetrequest.Properties, item) |
| 825 | } |
| 826 | } |
| 827 | return _asyncgetrequest, nil |
| 828 | } |
| 829 | |
| 830 | func NewAsyncGetRequest() *AsyncGetRequest { |
| 831 | obj := &AsyncGetRequest{ |
| 832 | Header: NewHeader(26), |
| 833 | } |
| 834 | return obj |
| 835 | } |
| 836 | |
| 837 | type AsyncSet struct { |
| 838 | *Header |
| 839 | Properties []IAsyncConfigProp |
| 840 | } |
| 841 | |
| 842 | type IAsyncSet interface { |
| 843 | IHeader |
| 844 | GetProperties() []IAsyncConfigProp |
| 845 | } |
| 846 | |
| 847 | func (self *AsyncSet) GetProperties() []IAsyncConfigProp { |
| 848 | return self.Properties |
| 849 | } |
| 850 | |
| 851 | func (self *AsyncSet) SetProperties(v []IAsyncConfigProp) { |
| 852 | self.Properties = v |
| 853 | } |
| 854 | |
| 855 | func (self *AsyncSet) Serialize(encoder *goloxi.Encoder) error { |
| 856 | startIndex := len(encoder.Bytes()) |
| 857 | if err := self.Header.Serialize(encoder); err != nil { |
| 858 | return err |
| 859 | } |
| 860 | |
| 861 | for _, obj := range self.Properties { |
| 862 | if err := obj.Serialize(encoder); err != nil { |
| 863 | return err |
| 864 | } |
| 865 | } |
| 866 | length := len(encoder.Bytes()) - startIndex |
| 867 | |
| 868 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 869 | |
| 870 | return nil |
| 871 | } |
| 872 | |
| 873 | func DecodeAsyncSet(parent *Header, decoder *goloxi.Decoder) (*AsyncSet, error) { |
| 874 | _asyncset := &AsyncSet{Header: parent} |
| 875 | |
| 876 | for decoder.Length() >= 4 { |
| 877 | item, err := DecodeAsyncConfigProp(decoder) |
| 878 | if err != nil { |
| 879 | return nil, err |
| 880 | } |
| 881 | if item != nil { |
| 882 | _asyncset.Properties = append(_asyncset.Properties, item) |
| 883 | } |
| 884 | } |
| 885 | return _asyncset, nil |
| 886 | } |
| 887 | |
| 888 | func NewAsyncSet() *AsyncSet { |
| 889 | obj := &AsyncSet{ |
| 890 | Header: NewHeader(28), |
| 891 | } |
| 892 | return obj |
| 893 | } |
| 894 | |
| 895 | type BadActionErrorMsg struct { |
| 896 | *ErrorMsg |
| 897 | Code BadActionCode |
| 898 | Data []byte |
| 899 | } |
| 900 | |
| 901 | type IBadActionErrorMsg interface { |
| 902 | IErrorMsg |
| 903 | GetCode() BadActionCode |
| 904 | GetData() []byte |
| 905 | } |
| 906 | |
| 907 | func (self *BadActionErrorMsg) GetCode() BadActionCode { |
| 908 | return self.Code |
| 909 | } |
| 910 | |
| 911 | func (self *BadActionErrorMsg) SetCode(v BadActionCode) { |
| 912 | self.Code = v |
| 913 | } |
| 914 | |
| 915 | func (self *BadActionErrorMsg) GetData() []byte { |
| 916 | return self.Data |
| 917 | } |
| 918 | |
| 919 | func (self *BadActionErrorMsg) SetData(v []byte) { |
| 920 | self.Data = v |
| 921 | } |
| 922 | |
| 923 | func (self *BadActionErrorMsg) Serialize(encoder *goloxi.Encoder) error { |
| 924 | startIndex := len(encoder.Bytes()) |
| 925 | if err := self.ErrorMsg.Serialize(encoder); err != nil { |
| 926 | return err |
| 927 | } |
| 928 | |
| 929 | encoder.PutUint16(uint16(self.Code)) |
| 930 | encoder.Write(self.Data) |
| 931 | length := len(encoder.Bytes()) - startIndex |
| 932 | |
| 933 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 934 | |
| 935 | return nil |
| 936 | } |
| 937 | |
| 938 | func DecodeBadActionErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*BadActionErrorMsg, error) { |
| 939 | _badactionerrormsg := &BadActionErrorMsg{ErrorMsg: parent} |
| 940 | if decoder.Length() < 2 { |
| 941 | return nil, fmt.Errorf("BadActionErrorMsg packet too short: %d < 2", decoder.Length()) |
| 942 | } |
| 943 | _badactionerrormsg.Code = BadActionCode(decoder.ReadUint16()) |
| 944 | _badactionerrormsg.Data = decoder.Read(int(decoder.Length())) |
| 945 | return _badactionerrormsg, nil |
| 946 | } |
| 947 | |
| 948 | func NewBadActionErrorMsg() *BadActionErrorMsg { |
| 949 | obj := &BadActionErrorMsg{ |
| 950 | ErrorMsg: NewErrorMsg(2), |
| 951 | } |
| 952 | return obj |
| 953 | } |
| 954 | |
| 955 | type BadInstructionErrorMsg struct { |
| 956 | *ErrorMsg |
| 957 | Code BadInstructionCode |
| 958 | Data []byte |
| 959 | } |
| 960 | |
| 961 | type IBadInstructionErrorMsg interface { |
| 962 | IErrorMsg |
| 963 | GetCode() BadInstructionCode |
| 964 | GetData() []byte |
| 965 | } |
| 966 | |
| 967 | func (self *BadInstructionErrorMsg) GetCode() BadInstructionCode { |
| 968 | return self.Code |
| 969 | } |
| 970 | |
| 971 | func (self *BadInstructionErrorMsg) SetCode(v BadInstructionCode) { |
| 972 | self.Code = v |
| 973 | } |
| 974 | |
| 975 | func (self *BadInstructionErrorMsg) GetData() []byte { |
| 976 | return self.Data |
| 977 | } |
| 978 | |
| 979 | func (self *BadInstructionErrorMsg) SetData(v []byte) { |
| 980 | self.Data = v |
| 981 | } |
| 982 | |
| 983 | func (self *BadInstructionErrorMsg) Serialize(encoder *goloxi.Encoder) error { |
| 984 | startIndex := len(encoder.Bytes()) |
| 985 | if err := self.ErrorMsg.Serialize(encoder); err != nil { |
| 986 | return err |
| 987 | } |
| 988 | |
| 989 | encoder.PutUint16(uint16(self.Code)) |
| 990 | encoder.Write(self.Data) |
| 991 | length := len(encoder.Bytes()) - startIndex |
| 992 | |
| 993 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 994 | |
| 995 | return nil |
| 996 | } |
| 997 | |
| 998 | func DecodeBadInstructionErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*BadInstructionErrorMsg, error) { |
| 999 | _badinstructionerrormsg := &BadInstructionErrorMsg{ErrorMsg: parent} |
| 1000 | if decoder.Length() < 2 { |
| 1001 | return nil, fmt.Errorf("BadInstructionErrorMsg packet too short: %d < 2", decoder.Length()) |
| 1002 | } |
| 1003 | _badinstructionerrormsg.Code = BadInstructionCode(decoder.ReadUint16()) |
| 1004 | _badinstructionerrormsg.Data = decoder.Read(int(decoder.Length())) |
| 1005 | return _badinstructionerrormsg, nil |
| 1006 | } |
| 1007 | |
| 1008 | func NewBadInstructionErrorMsg() *BadInstructionErrorMsg { |
| 1009 | obj := &BadInstructionErrorMsg{ |
| 1010 | ErrorMsg: NewErrorMsg(3), |
| 1011 | } |
| 1012 | return obj |
| 1013 | } |
| 1014 | |
| 1015 | type BadMatchErrorMsg struct { |
| 1016 | *ErrorMsg |
| 1017 | Code BadMatchCode |
| 1018 | Data []byte |
| 1019 | } |
| 1020 | |
| 1021 | type IBadMatchErrorMsg interface { |
| 1022 | IErrorMsg |
| 1023 | GetCode() BadMatchCode |
| 1024 | GetData() []byte |
| 1025 | } |
| 1026 | |
| 1027 | func (self *BadMatchErrorMsg) GetCode() BadMatchCode { |
| 1028 | return self.Code |
| 1029 | } |
| 1030 | |
| 1031 | func (self *BadMatchErrorMsg) SetCode(v BadMatchCode) { |
| 1032 | self.Code = v |
| 1033 | } |
| 1034 | |
| 1035 | func (self *BadMatchErrorMsg) GetData() []byte { |
| 1036 | return self.Data |
| 1037 | } |
| 1038 | |
| 1039 | func (self *BadMatchErrorMsg) SetData(v []byte) { |
| 1040 | self.Data = v |
| 1041 | } |
| 1042 | |
| 1043 | func (self *BadMatchErrorMsg) Serialize(encoder *goloxi.Encoder) error { |
| 1044 | startIndex := len(encoder.Bytes()) |
| 1045 | if err := self.ErrorMsg.Serialize(encoder); err != nil { |
| 1046 | return err |
| 1047 | } |
| 1048 | |
| 1049 | encoder.PutUint16(uint16(self.Code)) |
| 1050 | encoder.Write(self.Data) |
| 1051 | length := len(encoder.Bytes()) - startIndex |
| 1052 | |
| 1053 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 1054 | |
| 1055 | return nil |
| 1056 | } |
| 1057 | |
| 1058 | func DecodeBadMatchErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*BadMatchErrorMsg, error) { |
| 1059 | _badmatcherrormsg := &BadMatchErrorMsg{ErrorMsg: parent} |
| 1060 | if decoder.Length() < 2 { |
| 1061 | return nil, fmt.Errorf("BadMatchErrorMsg packet too short: %d < 2", decoder.Length()) |
| 1062 | } |
| 1063 | _badmatcherrormsg.Code = BadMatchCode(decoder.ReadUint16()) |
| 1064 | _badmatcherrormsg.Data = decoder.Read(int(decoder.Length())) |
| 1065 | return _badmatcherrormsg, nil |
| 1066 | } |
| 1067 | |
| 1068 | func NewBadMatchErrorMsg() *BadMatchErrorMsg { |
| 1069 | obj := &BadMatchErrorMsg{ |
| 1070 | ErrorMsg: NewErrorMsg(4), |
| 1071 | } |
| 1072 | return obj |
| 1073 | } |
| 1074 | |
| 1075 | type BadPropertyErrorMsg struct { |
| 1076 | *ErrorMsg |
| 1077 | Code BadPropertyCode |
| 1078 | Data []byte |
| 1079 | } |
| 1080 | |
| 1081 | type IBadPropertyErrorMsg interface { |
| 1082 | IErrorMsg |
| 1083 | GetCode() BadPropertyCode |
| 1084 | GetData() []byte |
| 1085 | } |
| 1086 | |
| 1087 | func (self *BadPropertyErrorMsg) GetCode() BadPropertyCode { |
| 1088 | return self.Code |
| 1089 | } |
| 1090 | |
| 1091 | func (self *BadPropertyErrorMsg) SetCode(v BadPropertyCode) { |
| 1092 | self.Code = v |
| 1093 | } |
| 1094 | |
| 1095 | func (self *BadPropertyErrorMsg) GetData() []byte { |
| 1096 | return self.Data |
| 1097 | } |
| 1098 | |
| 1099 | func (self *BadPropertyErrorMsg) SetData(v []byte) { |
| 1100 | self.Data = v |
| 1101 | } |
| 1102 | |
| 1103 | func (self *BadPropertyErrorMsg) Serialize(encoder *goloxi.Encoder) error { |
| 1104 | startIndex := len(encoder.Bytes()) |
| 1105 | if err := self.ErrorMsg.Serialize(encoder); err != nil { |
| 1106 | return err |
| 1107 | } |
| 1108 | |
| 1109 | encoder.PutUint16(uint16(self.Code)) |
| 1110 | encoder.Write(self.Data) |
| 1111 | length := len(encoder.Bytes()) - startIndex |
| 1112 | |
| 1113 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 1114 | |
| 1115 | return nil |
| 1116 | } |
| 1117 | |
| 1118 | func DecodeBadPropertyErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*BadPropertyErrorMsg, error) { |
| 1119 | _badpropertyerrormsg := &BadPropertyErrorMsg{ErrorMsg: parent} |
| 1120 | if decoder.Length() < 2 { |
| 1121 | return nil, fmt.Errorf("BadPropertyErrorMsg packet too short: %d < 2", decoder.Length()) |
| 1122 | } |
| 1123 | _badpropertyerrormsg.Code = BadPropertyCode(decoder.ReadUint16()) |
| 1124 | _badpropertyerrormsg.Data = decoder.Read(int(decoder.Length())) |
| 1125 | return _badpropertyerrormsg, nil |
| 1126 | } |
| 1127 | |
| 1128 | func NewBadPropertyErrorMsg() *BadPropertyErrorMsg { |
| 1129 | obj := &BadPropertyErrorMsg{ |
| 1130 | ErrorMsg: NewErrorMsg(14), |
| 1131 | } |
| 1132 | return obj |
| 1133 | } |
| 1134 | |
| 1135 | type BadRequestErrorMsg struct { |
| 1136 | *ErrorMsg |
| 1137 | Code BadRequestCode |
| 1138 | Data []byte |
| 1139 | } |
| 1140 | |
| 1141 | type IBadRequestErrorMsg interface { |
| 1142 | IErrorMsg |
| 1143 | GetCode() BadRequestCode |
| 1144 | GetData() []byte |
| 1145 | } |
| 1146 | |
| 1147 | func (self *BadRequestErrorMsg) GetCode() BadRequestCode { |
| 1148 | return self.Code |
| 1149 | } |
| 1150 | |
| 1151 | func (self *BadRequestErrorMsg) SetCode(v BadRequestCode) { |
| 1152 | self.Code = v |
| 1153 | } |
| 1154 | |
| 1155 | func (self *BadRequestErrorMsg) GetData() []byte { |
| 1156 | return self.Data |
| 1157 | } |
| 1158 | |
| 1159 | func (self *BadRequestErrorMsg) SetData(v []byte) { |
| 1160 | self.Data = v |
| 1161 | } |
| 1162 | |
| 1163 | func (self *BadRequestErrorMsg) Serialize(encoder *goloxi.Encoder) error { |
| 1164 | startIndex := len(encoder.Bytes()) |
| 1165 | if err := self.ErrorMsg.Serialize(encoder); err != nil { |
| 1166 | return err |
| 1167 | } |
| 1168 | |
| 1169 | encoder.PutUint16(uint16(self.Code)) |
| 1170 | encoder.Write(self.Data) |
| 1171 | length := len(encoder.Bytes()) - startIndex |
| 1172 | |
| 1173 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 1174 | |
| 1175 | return nil |
| 1176 | } |
| 1177 | |
| 1178 | func DecodeBadRequestErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*BadRequestErrorMsg, error) { |
| 1179 | _badrequesterrormsg := &BadRequestErrorMsg{ErrorMsg: parent} |
| 1180 | if decoder.Length() < 2 { |
| 1181 | return nil, fmt.Errorf("BadRequestErrorMsg packet too short: %d < 2", decoder.Length()) |
| 1182 | } |
| 1183 | _badrequesterrormsg.Code = BadRequestCode(decoder.ReadUint16()) |
| 1184 | _badrequesterrormsg.Data = decoder.Read(int(decoder.Length())) |
| 1185 | return _badrequesterrormsg, nil |
| 1186 | } |
| 1187 | |
| 1188 | func NewBadRequestErrorMsg() *BadRequestErrorMsg { |
| 1189 | obj := &BadRequestErrorMsg{ |
| 1190 | ErrorMsg: NewErrorMsg(1), |
| 1191 | } |
| 1192 | return obj |
| 1193 | } |
| 1194 | |
| 1195 | type BarrierReply struct { |
| 1196 | *Header |
| 1197 | } |
| 1198 | |
| 1199 | type IBarrierReply interface { |
| 1200 | IHeader |
| 1201 | } |
| 1202 | |
| 1203 | func (self *BarrierReply) Serialize(encoder *goloxi.Encoder) error { |
| 1204 | startIndex := len(encoder.Bytes()) |
| 1205 | if err := self.Header.Serialize(encoder); err != nil { |
| 1206 | return err |
| 1207 | } |
| 1208 | length := len(encoder.Bytes()) - startIndex |
| 1209 | |
| 1210 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 1211 | |
| 1212 | return nil |
| 1213 | } |
| 1214 | |
| 1215 | func DecodeBarrierReply(parent *Header, decoder *goloxi.Decoder) (*BarrierReply, error) { |
| 1216 | _barrierreply := &BarrierReply{Header: parent} |
| 1217 | return _barrierreply, nil |
| 1218 | } |
| 1219 | |
| 1220 | func NewBarrierReply() *BarrierReply { |
| 1221 | obj := &BarrierReply{ |
| 1222 | Header: NewHeader(21), |
| 1223 | } |
| 1224 | return obj |
| 1225 | } |
| 1226 | |
| 1227 | type BarrierRequest struct { |
| 1228 | *Header |
| 1229 | } |
| 1230 | |
| 1231 | type IBarrierRequest interface { |
| 1232 | IHeader |
| 1233 | } |
| 1234 | |
| 1235 | func (self *BarrierRequest) Serialize(encoder *goloxi.Encoder) error { |
| 1236 | startIndex := len(encoder.Bytes()) |
| 1237 | if err := self.Header.Serialize(encoder); err != nil { |
| 1238 | return err |
| 1239 | } |
| 1240 | length := len(encoder.Bytes()) - startIndex |
| 1241 | |
| 1242 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 1243 | |
| 1244 | return nil |
| 1245 | } |
| 1246 | |
| 1247 | func DecodeBarrierRequest(parent *Header, decoder *goloxi.Decoder) (*BarrierRequest, error) { |
| 1248 | _barrierrequest := &BarrierRequest{Header: parent} |
| 1249 | return _barrierrequest, nil |
| 1250 | } |
| 1251 | |
| 1252 | func NewBarrierRequest() *BarrierRequest { |
| 1253 | obj := &BarrierRequest{ |
| 1254 | Header: NewHeader(20), |
| 1255 | } |
| 1256 | return obj |
| 1257 | } |
| 1258 | |
| 1259 | type Experimenter struct { |
| 1260 | *Header |
| 1261 | Experimenter uint32 |
| 1262 | Subtype uint32 |
| 1263 | } |
| 1264 | |
| 1265 | type IExperimenter interface { |
| 1266 | IHeader |
| 1267 | GetExperimenter() uint32 |
| 1268 | GetSubtype() uint32 |
| 1269 | } |
| 1270 | |
| 1271 | func (self *Experimenter) GetExperimenter() uint32 { |
| 1272 | return self.Experimenter |
| 1273 | } |
| 1274 | |
| 1275 | func (self *Experimenter) SetExperimenter(v uint32) { |
| 1276 | self.Experimenter = v |
| 1277 | } |
| 1278 | |
| 1279 | func (self *Experimenter) GetSubtype() uint32 { |
| 1280 | return self.Subtype |
| 1281 | } |
| 1282 | |
| 1283 | func (self *Experimenter) SetSubtype(v uint32) { |
| 1284 | self.Subtype = v |
| 1285 | } |
| 1286 | |
| 1287 | func (self *Experimenter) Serialize(encoder *goloxi.Encoder) error { |
| 1288 | if err := self.Header.Serialize(encoder); err != nil { |
| 1289 | return err |
| 1290 | } |
| 1291 | |
| 1292 | encoder.PutUint32(uint32(self.Experimenter)) |
| 1293 | encoder.PutUint32(uint32(self.Subtype)) |
| 1294 | |
| 1295 | return nil |
| 1296 | } |
| 1297 | |
| 1298 | func DecodeExperimenter(parent *Header, decoder *goloxi.Decoder) (IExperimenter, error) { |
| 1299 | _experimenter := &Experimenter{Header: parent} |
| 1300 | if decoder.Length() < 8 { |
| 1301 | return nil, fmt.Errorf("Experimenter packet too short: %d < 8", decoder.Length()) |
| 1302 | } |
| 1303 | _experimenter.Experimenter = uint32(decoder.ReadUint32()) |
| 1304 | _experimenter.Subtype = uint32(decoder.ReadUint32()) |
| 1305 | |
| 1306 | switch _experimenter.Experimenter { |
| 1307 | case 8992: |
| 1308 | return DecodeNiciraHeader(_experimenter, decoder) |
| 1309 | case 6035143: |
| 1310 | return DecodeBsnHeader(_experimenter, decoder) |
| 1311 | default: |
| 1312 | return nil, fmt.Errorf("Invalid type '%d' for 'Experimenter'", _experimenter.Experimenter) |
| 1313 | } |
| 1314 | } |
| 1315 | |
| 1316 | func NewExperimenter(_experimenter uint32) *Experimenter { |
| 1317 | obj := &Experimenter{ |
| 1318 | Header: NewHeader(4), |
| 1319 | } |
| 1320 | obj.Experimenter = _experimenter |
| 1321 | return obj |
| 1322 | } |
| 1323 | |
| 1324 | type BsnHeader struct { |
| 1325 | *Experimenter |
| 1326 | } |
| 1327 | |
| 1328 | type IBsnHeader interface { |
| 1329 | IExperimenter |
| 1330 | } |
| 1331 | |
| 1332 | func (self *BsnHeader) Serialize(encoder *goloxi.Encoder) error { |
| 1333 | if err := self.Experimenter.Serialize(encoder); err != nil { |
| 1334 | return err |
| 1335 | } |
| 1336 | |
| 1337 | return nil |
| 1338 | } |
| 1339 | |
| 1340 | func DecodeBsnHeader(parent *Experimenter, decoder *goloxi.Decoder) (IBsnHeader, error) { |
| 1341 | _bsnheader := &BsnHeader{Experimenter: parent} |
| 1342 | |
| 1343 | switch _bsnheader.Subtype { |
| 1344 | case 3: |
| 1345 | return DecodeBsnSetMirroring(_bsnheader, decoder) |
| 1346 | case 4: |
| 1347 | return DecodeBsnGetMirroringRequest(_bsnheader, decoder) |
| 1348 | case 5: |
| 1349 | return DecodeBsnGetMirroringReply(_bsnheader, decoder) |
| 1350 | case 9: |
| 1351 | return DecodeBsnGetInterfacesRequest(_bsnheader, decoder) |
| 1352 | case 10: |
| 1353 | return DecodeBsnGetInterfacesReply(_bsnheader, decoder) |
| 1354 | case 11: |
| 1355 | return DecodeBsnSetPktinSuppressionRequest(_bsnheader, decoder) |
| 1356 | case 15: |
| 1357 | return DecodeBsnVirtualPortCreateRequest(_bsnheader, decoder) |
| 1358 | case 16: |
| 1359 | return DecodeBsnVirtualPortCreateReply(_bsnheader, decoder) |
| 1360 | case 17: |
| 1361 | return DecodeBsnVirtualPortRemoveRequest(_bsnheader, decoder) |
| 1362 | case 18: |
| 1363 | return DecodeBsnBwEnableSetRequest(_bsnheader, decoder) |
| 1364 | case 19: |
| 1365 | return DecodeBsnBwEnableGetRequest(_bsnheader, decoder) |
| 1366 | case 20: |
| 1367 | return DecodeBsnBwEnableGetReply(_bsnheader, decoder) |
| 1368 | case 21: |
| 1369 | return DecodeBsnBwClearDataRequest(_bsnheader, decoder) |
| 1370 | case 22: |
| 1371 | return DecodeBsnBwClearDataReply(_bsnheader, decoder) |
| 1372 | case 23: |
| 1373 | return DecodeBsnBwEnableSetReply(_bsnheader, decoder) |
| 1374 | case 25: |
| 1375 | return DecodeBsnSetPktinSuppressionReply(_bsnheader, decoder) |
| 1376 | case 26: |
| 1377 | return DecodeBsnVirtualPortRemoveReply(_bsnheader, decoder) |
| 1378 | case 31: |
| 1379 | return DecodeBsnPduTxRequest(_bsnheader, decoder) |
| 1380 | case 32: |
| 1381 | return DecodeBsnPduTxReply(_bsnheader, decoder) |
| 1382 | case 33: |
| 1383 | return DecodeBsnPduRxRequest(_bsnheader, decoder) |
| 1384 | case 34: |
| 1385 | return DecodeBsnPduRxReply(_bsnheader, decoder) |
| 1386 | case 35: |
| 1387 | return DecodeBsnPduRxTimeout(_bsnheader, decoder) |
| 1388 | case 36: |
| 1389 | return DecodeBsnFlowIdleEnableSetRequest(_bsnheader, decoder) |
| 1390 | case 37: |
| 1391 | return DecodeBsnFlowIdleEnableSetReply(_bsnheader, decoder) |
| 1392 | case 38: |
| 1393 | return DecodeBsnFlowIdleEnableGetRequest(_bsnheader, decoder) |
| 1394 | case 39: |
| 1395 | return DecodeBsnFlowIdleEnableGetReply(_bsnheader, decoder) |
| 1396 | case 40: |
| 1397 | return DecodeBsnFlowIdle(_bsnheader, decoder) |
| 1398 | case 41: |
| 1399 | return DecodeBsnSetLacpRequest(_bsnheader, decoder) |
| 1400 | case 42: |
| 1401 | return DecodeBsnSetLacpReply(_bsnheader, decoder) |
| 1402 | case 43: |
| 1403 | return DecodeBsnLacpConvergenceNotif(_bsnheader, decoder) |
| 1404 | case 44: |
| 1405 | return DecodeBsnTimeRequest(_bsnheader, decoder) |
| 1406 | case 45: |
| 1407 | return DecodeBsnTimeReply(_bsnheader, decoder) |
| 1408 | case 46: |
| 1409 | return DecodeBsnGentableEntryAdd(_bsnheader, decoder) |
| 1410 | case 47: |
| 1411 | return DecodeBsnGentableEntryDelete(_bsnheader, decoder) |
| 1412 | case 48: |
| 1413 | return DecodeBsnGentableClearRequest(_bsnheader, decoder) |
| 1414 | case 49: |
| 1415 | return DecodeBsnGentableClearReply(_bsnheader, decoder) |
| 1416 | case 50: |
| 1417 | return DecodeBsnGentableSetBucketsSize(_bsnheader, decoder) |
| 1418 | case 51: |
| 1419 | return DecodeBsnGetSwitchPipelineRequest(_bsnheader, decoder) |
| 1420 | case 52: |
| 1421 | return DecodeBsnGetSwitchPipelineReply(_bsnheader, decoder) |
| 1422 | case 53: |
| 1423 | return DecodeBsnSetSwitchPipelineRequest(_bsnheader, decoder) |
| 1424 | case 54: |
| 1425 | return DecodeBsnSetSwitchPipelineReply(_bsnheader, decoder) |
| 1426 | case 56: |
| 1427 | return DecodeBsnControllerConnectionsRequest(_bsnheader, decoder) |
| 1428 | case 57: |
| 1429 | return DecodeBsnControllerConnectionsReply(_bsnheader, decoder) |
| 1430 | case 58: |
| 1431 | return DecodeBsnSetAuxCxnsRequest(_bsnheader, decoder) |
| 1432 | case 59: |
| 1433 | return DecodeBsnSetAuxCxnsReply(_bsnheader, decoder) |
| 1434 | case 60: |
| 1435 | return DecodeBsnArpIdle(_bsnheader, decoder) |
| 1436 | case 61: |
| 1437 | return DecodeBsnTableSetBucketsSize(_bsnheader, decoder) |
| 1438 | case 63: |
| 1439 | return DecodeBsnLog(_bsnheader, decoder) |
| 1440 | case 64: |
| 1441 | return DecodeBsnLuaUpload(_bsnheader, decoder) |
| 1442 | case 65: |
| 1443 | return DecodeBsnLuaCommandRequest(_bsnheader, decoder) |
| 1444 | case 66: |
| 1445 | return DecodeBsnLuaCommandReply(_bsnheader, decoder) |
| 1446 | case 67: |
| 1447 | return DecodeBsnLuaNotification(_bsnheader, decoder) |
| 1448 | case 68: |
| 1449 | return DecodeBsnGenericAsync(_bsnheader, decoder) |
| 1450 | case 69: |
| 1451 | return DecodeBsnTakeover(_bsnheader, decoder) |
| 1452 | case 70: |
| 1453 | return DecodeBsnVlanCounterClear(_bsnheader, decoder) |
| 1454 | case 71: |
| 1455 | return DecodeBsnGenericCommand(_bsnheader, decoder) |
| 1456 | default: |
| 1457 | return nil, fmt.Errorf("Invalid type '%d' for 'BsnHeader'", _bsnheader.Subtype) |
| 1458 | } |
| 1459 | } |
| 1460 | |
| 1461 | func NewBsnHeader(_subtype uint32) *BsnHeader { |
| 1462 | obj := &BsnHeader{ |
| 1463 | Experimenter: NewExperimenter(6035143), |
| 1464 | } |
| 1465 | obj.Subtype = _subtype |
| 1466 | return obj |
| 1467 | } |
| 1468 | |
| 1469 | type BsnArpIdle struct { |
| 1470 | *BsnHeader |
| 1471 | VlanVid uint16 |
| 1472 | Ipv4Addr net.IP |
| 1473 | } |
| 1474 | |
| 1475 | type IBsnArpIdle interface { |
| 1476 | IBsnHeader |
| 1477 | GetVlanVid() uint16 |
| 1478 | GetIpv4Addr() net.IP |
| 1479 | } |
| 1480 | |
| 1481 | func (self *BsnArpIdle) GetVlanVid() uint16 { |
| 1482 | return self.VlanVid |
| 1483 | } |
| 1484 | |
| 1485 | func (self *BsnArpIdle) SetVlanVid(v uint16) { |
| 1486 | self.VlanVid = v |
| 1487 | } |
| 1488 | |
| 1489 | func (self *BsnArpIdle) GetIpv4Addr() net.IP { |
| 1490 | return self.Ipv4Addr |
| 1491 | } |
| 1492 | |
| 1493 | func (self *BsnArpIdle) SetIpv4Addr(v net.IP) { |
| 1494 | self.Ipv4Addr = v |
| 1495 | } |
| 1496 | |
| 1497 | func (self *BsnArpIdle) Serialize(encoder *goloxi.Encoder) error { |
| 1498 | startIndex := len(encoder.Bytes()) |
| 1499 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 1500 | return err |
| 1501 | } |
| 1502 | |
| 1503 | encoder.PutUint16(uint16(self.VlanVid)) |
| 1504 | encoder.Write(bytes.Repeat([]byte{0}, 2)) |
| 1505 | encoder.Write(self.Ipv4Addr.To4()) |
| 1506 | length := len(encoder.Bytes()) - startIndex |
| 1507 | |
| 1508 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 1509 | |
| 1510 | return nil |
| 1511 | } |
| 1512 | |
| 1513 | func DecodeBsnArpIdle(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnArpIdle, error) { |
| 1514 | _bsnarpidle := &BsnArpIdle{BsnHeader: parent} |
| 1515 | if decoder.Length() < 8 { |
| 1516 | return nil, fmt.Errorf("BsnArpIdle packet too short: %d < 8", decoder.Length()) |
| 1517 | } |
| 1518 | _bsnarpidle.VlanVid = uint16(decoder.ReadUint16()) |
| 1519 | decoder.Skip(2) |
| 1520 | _bsnarpidle.Ipv4Addr = net.IP(decoder.Read(4)) |
| 1521 | return _bsnarpidle, nil |
| 1522 | } |
| 1523 | |
| 1524 | func NewBsnArpIdle() *BsnArpIdle { |
| 1525 | obj := &BsnArpIdle{ |
| 1526 | BsnHeader: NewBsnHeader(60), |
| 1527 | } |
| 1528 | return obj |
| 1529 | } |
| 1530 | |
| 1531 | type ExperimenterErrorMsg struct { |
| 1532 | *ErrorMsg |
| 1533 | Subtype uint16 |
| 1534 | Experimenter uint32 |
| 1535 | } |
| 1536 | |
| 1537 | type IExperimenterErrorMsg interface { |
| 1538 | IErrorMsg |
| 1539 | GetSubtype() uint16 |
| 1540 | GetExperimenter() uint32 |
| 1541 | } |
| 1542 | |
| 1543 | func (self *ExperimenterErrorMsg) GetSubtype() uint16 { |
| 1544 | return self.Subtype |
| 1545 | } |
| 1546 | |
| 1547 | func (self *ExperimenterErrorMsg) SetSubtype(v uint16) { |
| 1548 | self.Subtype = v |
| 1549 | } |
| 1550 | |
| 1551 | func (self *ExperimenterErrorMsg) GetExperimenter() uint32 { |
| 1552 | return self.Experimenter |
| 1553 | } |
| 1554 | |
| 1555 | func (self *ExperimenterErrorMsg) SetExperimenter(v uint32) { |
| 1556 | self.Experimenter = v |
| 1557 | } |
| 1558 | |
| 1559 | func (self *ExperimenterErrorMsg) Serialize(encoder *goloxi.Encoder) error { |
| 1560 | if err := self.ErrorMsg.Serialize(encoder); err != nil { |
| 1561 | return err |
| 1562 | } |
| 1563 | |
| 1564 | encoder.PutUint16(uint16(self.Subtype)) |
| 1565 | encoder.PutUint32(uint32(self.Experimenter)) |
| 1566 | |
| 1567 | return nil |
| 1568 | } |
| 1569 | |
| 1570 | func DecodeExperimenterErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (IExperimenterErrorMsg, error) { |
| 1571 | _experimentererrormsg := &ExperimenterErrorMsg{ErrorMsg: parent} |
| 1572 | if decoder.Length() < 6 { |
| 1573 | return nil, fmt.Errorf("ExperimenterErrorMsg packet too short: %d < 6", decoder.Length()) |
| 1574 | } |
| 1575 | _experimentererrormsg.Subtype = uint16(decoder.ReadUint16()) |
| 1576 | _experimentererrormsg.Experimenter = uint32(decoder.ReadUint32()) |
| 1577 | |
| 1578 | switch _experimentererrormsg.Experimenter { |
| 1579 | case 6035143: |
| 1580 | return DecodeBsnBaseError(_experimentererrormsg, decoder) |
| 1581 | default: |
| 1582 | return nil, fmt.Errorf("Invalid type '%d' for 'ExperimenterErrorMsg'", _experimentererrormsg.Experimenter) |
| 1583 | } |
| 1584 | } |
| 1585 | |
| 1586 | func NewExperimenterErrorMsg(_experimenter uint32) *ExperimenterErrorMsg { |
| 1587 | obj := &ExperimenterErrorMsg{ |
| 1588 | ErrorMsg: NewErrorMsg(65535), |
| 1589 | } |
| 1590 | obj.Experimenter = _experimenter |
| 1591 | return obj |
| 1592 | } |
| 1593 | |
| 1594 | type BsnBaseError struct { |
| 1595 | *ExperimenterErrorMsg |
| 1596 | ErrMsg string |
| 1597 | } |
| 1598 | |
| 1599 | type IBsnBaseError interface { |
| 1600 | IExperimenterErrorMsg |
| 1601 | GetErrMsg() string |
| 1602 | } |
| 1603 | |
| 1604 | func (self *BsnBaseError) GetErrMsg() string { |
| 1605 | return self.ErrMsg |
| 1606 | } |
| 1607 | |
| 1608 | func (self *BsnBaseError) SetErrMsg(v string) { |
| 1609 | self.ErrMsg = v |
| 1610 | } |
| 1611 | |
| 1612 | func (self *BsnBaseError) Serialize(encoder *goloxi.Encoder) error { |
| 1613 | if err := self.ExperimenterErrorMsg.Serialize(encoder); err != nil { |
| 1614 | return err |
| 1615 | } |
| 1616 | |
| 1617 | encoder.Write([]byte(self.ErrMsg)) |
| 1618 | |
| 1619 | return nil |
| 1620 | } |
| 1621 | |
| 1622 | func DecodeBsnBaseError(parent *ExperimenterErrorMsg, decoder *goloxi.Decoder) (IBsnBaseError, error) { |
| 1623 | _bsnbaseerror := &BsnBaseError{ExperimenterErrorMsg: parent} |
| 1624 | if decoder.Length() < 256 { |
| 1625 | return nil, fmt.Errorf("BsnBaseError packet too short: %d < 256", decoder.Length()) |
| 1626 | } |
| 1627 | _bsnbaseerror.ErrMsg = string(bytes.Trim(decoder.Read(256), "\x00")) |
| 1628 | |
| 1629 | switch _bsnbaseerror.Subtype { |
| 1630 | case 1: |
| 1631 | return DecodeBsnError(_bsnbaseerror, decoder) |
| 1632 | case 2: |
| 1633 | return DecodeBsnGentableError(_bsnbaseerror, decoder) |
| 1634 | default: |
| 1635 | return nil, fmt.Errorf("Invalid type '%d' for 'BsnBaseError'", _bsnbaseerror.Subtype) |
| 1636 | } |
| 1637 | } |
| 1638 | |
| 1639 | func NewBsnBaseError(_subtype uint16) *BsnBaseError { |
| 1640 | obj := &BsnBaseError{ |
| 1641 | ExperimenterErrorMsg: NewExperimenterErrorMsg(6035143), |
| 1642 | } |
| 1643 | obj.Subtype = _subtype |
| 1644 | return obj |
| 1645 | } |
| 1646 | |
| 1647 | type BsnBwClearDataReply struct { |
| 1648 | *BsnHeader |
| 1649 | Status uint32 |
| 1650 | } |
| 1651 | |
| 1652 | type IBsnBwClearDataReply interface { |
| 1653 | IBsnHeader |
| 1654 | GetStatus() uint32 |
| 1655 | } |
| 1656 | |
| 1657 | func (self *BsnBwClearDataReply) GetStatus() uint32 { |
| 1658 | return self.Status |
| 1659 | } |
| 1660 | |
| 1661 | func (self *BsnBwClearDataReply) SetStatus(v uint32) { |
| 1662 | self.Status = v |
| 1663 | } |
| 1664 | |
| 1665 | func (self *BsnBwClearDataReply) Serialize(encoder *goloxi.Encoder) error { |
| 1666 | startIndex := len(encoder.Bytes()) |
| 1667 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 1668 | return err |
| 1669 | } |
| 1670 | |
| 1671 | encoder.PutUint32(uint32(self.Status)) |
| 1672 | length := len(encoder.Bytes()) - startIndex |
| 1673 | |
| 1674 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 1675 | |
| 1676 | return nil |
| 1677 | } |
| 1678 | |
| 1679 | func DecodeBsnBwClearDataReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnBwClearDataReply, error) { |
| 1680 | _bsnbwcleardatareply := &BsnBwClearDataReply{BsnHeader: parent} |
| 1681 | if decoder.Length() < 4 { |
| 1682 | return nil, fmt.Errorf("BsnBwClearDataReply packet too short: %d < 4", decoder.Length()) |
| 1683 | } |
| 1684 | _bsnbwcleardatareply.Status = uint32(decoder.ReadUint32()) |
| 1685 | return _bsnbwcleardatareply, nil |
| 1686 | } |
| 1687 | |
| 1688 | func NewBsnBwClearDataReply() *BsnBwClearDataReply { |
| 1689 | obj := &BsnBwClearDataReply{ |
| 1690 | BsnHeader: NewBsnHeader(22), |
| 1691 | } |
| 1692 | return obj |
| 1693 | } |
| 1694 | |
| 1695 | type BsnBwClearDataRequest struct { |
| 1696 | *BsnHeader |
| 1697 | } |
| 1698 | |
| 1699 | type IBsnBwClearDataRequest interface { |
| 1700 | IBsnHeader |
| 1701 | } |
| 1702 | |
| 1703 | func (self *BsnBwClearDataRequest) Serialize(encoder *goloxi.Encoder) error { |
| 1704 | startIndex := len(encoder.Bytes()) |
| 1705 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 1706 | return err |
| 1707 | } |
| 1708 | length := len(encoder.Bytes()) - startIndex |
| 1709 | |
| 1710 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 1711 | |
| 1712 | return nil |
| 1713 | } |
| 1714 | |
| 1715 | func DecodeBsnBwClearDataRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnBwClearDataRequest, error) { |
| 1716 | _bsnbwcleardatarequest := &BsnBwClearDataRequest{BsnHeader: parent} |
| 1717 | return _bsnbwcleardatarequest, nil |
| 1718 | } |
| 1719 | |
| 1720 | func NewBsnBwClearDataRequest() *BsnBwClearDataRequest { |
| 1721 | obj := &BsnBwClearDataRequest{ |
| 1722 | BsnHeader: NewBsnHeader(21), |
| 1723 | } |
| 1724 | return obj |
| 1725 | } |
| 1726 | |
| 1727 | type BsnBwEnableGetReply struct { |
| 1728 | *BsnHeader |
| 1729 | Enabled uint32 |
| 1730 | } |
| 1731 | |
| 1732 | type IBsnBwEnableGetReply interface { |
| 1733 | IBsnHeader |
| 1734 | GetEnabled() uint32 |
| 1735 | } |
| 1736 | |
| 1737 | func (self *BsnBwEnableGetReply) GetEnabled() uint32 { |
| 1738 | return self.Enabled |
| 1739 | } |
| 1740 | |
| 1741 | func (self *BsnBwEnableGetReply) SetEnabled(v uint32) { |
| 1742 | self.Enabled = v |
| 1743 | } |
| 1744 | |
| 1745 | func (self *BsnBwEnableGetReply) Serialize(encoder *goloxi.Encoder) error { |
| 1746 | startIndex := len(encoder.Bytes()) |
| 1747 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 1748 | return err |
| 1749 | } |
| 1750 | |
| 1751 | encoder.PutUint32(uint32(self.Enabled)) |
| 1752 | length := len(encoder.Bytes()) - startIndex |
| 1753 | |
| 1754 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 1755 | |
| 1756 | return nil |
| 1757 | } |
| 1758 | |
| 1759 | func DecodeBsnBwEnableGetReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnBwEnableGetReply, error) { |
| 1760 | _bsnbwenablegetreply := &BsnBwEnableGetReply{BsnHeader: parent} |
| 1761 | if decoder.Length() < 4 { |
| 1762 | return nil, fmt.Errorf("BsnBwEnableGetReply packet too short: %d < 4", decoder.Length()) |
| 1763 | } |
| 1764 | _bsnbwenablegetreply.Enabled = uint32(decoder.ReadUint32()) |
| 1765 | return _bsnbwenablegetreply, nil |
| 1766 | } |
| 1767 | |
| 1768 | func NewBsnBwEnableGetReply() *BsnBwEnableGetReply { |
| 1769 | obj := &BsnBwEnableGetReply{ |
| 1770 | BsnHeader: NewBsnHeader(20), |
| 1771 | } |
| 1772 | return obj |
| 1773 | } |
| 1774 | |
| 1775 | type BsnBwEnableGetRequest struct { |
| 1776 | *BsnHeader |
| 1777 | } |
| 1778 | |
| 1779 | type IBsnBwEnableGetRequest interface { |
| 1780 | IBsnHeader |
| 1781 | } |
| 1782 | |
| 1783 | func (self *BsnBwEnableGetRequest) Serialize(encoder *goloxi.Encoder) error { |
| 1784 | startIndex := len(encoder.Bytes()) |
| 1785 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 1786 | return err |
| 1787 | } |
| 1788 | length := len(encoder.Bytes()) - startIndex |
| 1789 | |
| 1790 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 1791 | |
| 1792 | return nil |
| 1793 | } |
| 1794 | |
| 1795 | func DecodeBsnBwEnableGetRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnBwEnableGetRequest, error) { |
| 1796 | _bsnbwenablegetrequest := &BsnBwEnableGetRequest{BsnHeader: parent} |
| 1797 | return _bsnbwenablegetrequest, nil |
| 1798 | } |
| 1799 | |
| 1800 | func NewBsnBwEnableGetRequest() *BsnBwEnableGetRequest { |
| 1801 | obj := &BsnBwEnableGetRequest{ |
| 1802 | BsnHeader: NewBsnHeader(19), |
| 1803 | } |
| 1804 | return obj |
| 1805 | } |
| 1806 | |
| 1807 | type BsnBwEnableSetReply struct { |
| 1808 | *BsnHeader |
| 1809 | Enable uint32 |
| 1810 | Status uint32 |
| 1811 | } |
| 1812 | |
| 1813 | type IBsnBwEnableSetReply interface { |
| 1814 | IBsnHeader |
| 1815 | GetEnable() uint32 |
| 1816 | GetStatus() uint32 |
| 1817 | } |
| 1818 | |
| 1819 | func (self *BsnBwEnableSetReply) GetEnable() uint32 { |
| 1820 | return self.Enable |
| 1821 | } |
| 1822 | |
| 1823 | func (self *BsnBwEnableSetReply) SetEnable(v uint32) { |
| 1824 | self.Enable = v |
| 1825 | } |
| 1826 | |
| 1827 | func (self *BsnBwEnableSetReply) GetStatus() uint32 { |
| 1828 | return self.Status |
| 1829 | } |
| 1830 | |
| 1831 | func (self *BsnBwEnableSetReply) SetStatus(v uint32) { |
| 1832 | self.Status = v |
| 1833 | } |
| 1834 | |
| 1835 | func (self *BsnBwEnableSetReply) Serialize(encoder *goloxi.Encoder) error { |
| 1836 | startIndex := len(encoder.Bytes()) |
| 1837 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 1838 | return err |
| 1839 | } |
| 1840 | |
| 1841 | encoder.PutUint32(uint32(self.Enable)) |
| 1842 | encoder.PutUint32(uint32(self.Status)) |
| 1843 | length := len(encoder.Bytes()) - startIndex |
| 1844 | |
| 1845 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 1846 | |
| 1847 | return nil |
| 1848 | } |
| 1849 | |
| 1850 | func DecodeBsnBwEnableSetReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnBwEnableSetReply, error) { |
| 1851 | _bsnbwenablesetreply := &BsnBwEnableSetReply{BsnHeader: parent} |
| 1852 | if decoder.Length() < 8 { |
| 1853 | return nil, fmt.Errorf("BsnBwEnableSetReply packet too short: %d < 8", decoder.Length()) |
| 1854 | } |
| 1855 | _bsnbwenablesetreply.Enable = uint32(decoder.ReadUint32()) |
| 1856 | _bsnbwenablesetreply.Status = uint32(decoder.ReadUint32()) |
| 1857 | return _bsnbwenablesetreply, nil |
| 1858 | } |
| 1859 | |
| 1860 | func NewBsnBwEnableSetReply() *BsnBwEnableSetReply { |
| 1861 | obj := &BsnBwEnableSetReply{ |
| 1862 | BsnHeader: NewBsnHeader(23), |
| 1863 | } |
| 1864 | return obj |
| 1865 | } |
| 1866 | |
| 1867 | type BsnBwEnableSetRequest struct { |
| 1868 | *BsnHeader |
| 1869 | Enable uint32 |
| 1870 | } |
| 1871 | |
| 1872 | type IBsnBwEnableSetRequest interface { |
| 1873 | IBsnHeader |
| 1874 | GetEnable() uint32 |
| 1875 | } |
| 1876 | |
| 1877 | func (self *BsnBwEnableSetRequest) GetEnable() uint32 { |
| 1878 | return self.Enable |
| 1879 | } |
| 1880 | |
| 1881 | func (self *BsnBwEnableSetRequest) SetEnable(v uint32) { |
| 1882 | self.Enable = v |
| 1883 | } |
| 1884 | |
| 1885 | func (self *BsnBwEnableSetRequest) Serialize(encoder *goloxi.Encoder) error { |
| 1886 | startIndex := len(encoder.Bytes()) |
| 1887 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 1888 | return err |
| 1889 | } |
| 1890 | |
| 1891 | encoder.PutUint32(uint32(self.Enable)) |
| 1892 | length := len(encoder.Bytes()) - startIndex |
| 1893 | |
| 1894 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 1895 | |
| 1896 | return nil |
| 1897 | } |
| 1898 | |
| 1899 | func DecodeBsnBwEnableSetRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnBwEnableSetRequest, error) { |
| 1900 | _bsnbwenablesetrequest := &BsnBwEnableSetRequest{BsnHeader: parent} |
| 1901 | if decoder.Length() < 4 { |
| 1902 | return nil, fmt.Errorf("BsnBwEnableSetRequest packet too short: %d < 4", decoder.Length()) |
| 1903 | } |
| 1904 | _bsnbwenablesetrequest.Enable = uint32(decoder.ReadUint32()) |
| 1905 | return _bsnbwenablesetrequest, nil |
| 1906 | } |
| 1907 | |
| 1908 | func NewBsnBwEnableSetRequest() *BsnBwEnableSetRequest { |
| 1909 | obj := &BsnBwEnableSetRequest{ |
| 1910 | BsnHeader: NewBsnHeader(18), |
| 1911 | } |
| 1912 | return obj |
| 1913 | } |
| 1914 | |
| 1915 | type BsnControllerConnectionsReply struct { |
| 1916 | *BsnHeader |
| 1917 | Connections []*BsnControllerConnection |
| 1918 | } |
| 1919 | |
| 1920 | type IBsnControllerConnectionsReply interface { |
| 1921 | IBsnHeader |
| 1922 | GetConnections() []*BsnControllerConnection |
| 1923 | } |
| 1924 | |
| 1925 | func (self *BsnControllerConnectionsReply) GetConnections() []*BsnControllerConnection { |
| 1926 | return self.Connections |
| 1927 | } |
| 1928 | |
| 1929 | func (self *BsnControllerConnectionsReply) SetConnections(v []*BsnControllerConnection) { |
| 1930 | self.Connections = v |
| 1931 | } |
| 1932 | |
| 1933 | func (self *BsnControllerConnectionsReply) Serialize(encoder *goloxi.Encoder) error { |
| 1934 | startIndex := len(encoder.Bytes()) |
| 1935 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 1936 | return err |
| 1937 | } |
| 1938 | |
| 1939 | for _, obj := range self.Connections { |
| 1940 | if err := obj.Serialize(encoder); err != nil { |
| 1941 | return err |
| 1942 | } |
| 1943 | } |
| 1944 | length := len(encoder.Bytes()) - startIndex |
| 1945 | |
| 1946 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 1947 | |
| 1948 | return nil |
| 1949 | } |
| 1950 | |
| 1951 | func DecodeBsnControllerConnectionsReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnControllerConnectionsReply, error) { |
| 1952 | _bsncontrollerconnectionsreply := &BsnControllerConnectionsReply{BsnHeader: parent} |
| 1953 | |
| 1954 | for decoder.Length() >= 264 { |
| 1955 | item, err := DecodeBsnControllerConnection(decoder) |
| 1956 | if err != nil { |
| 1957 | return nil, err |
| 1958 | } |
| 1959 | if item != nil { |
| 1960 | _bsncontrollerconnectionsreply.Connections = append(_bsncontrollerconnectionsreply.Connections, item) |
| 1961 | } |
| 1962 | } |
| 1963 | return _bsncontrollerconnectionsreply, nil |
| 1964 | } |
| 1965 | |
| 1966 | func NewBsnControllerConnectionsReply() *BsnControllerConnectionsReply { |
| 1967 | obj := &BsnControllerConnectionsReply{ |
| 1968 | BsnHeader: NewBsnHeader(57), |
| 1969 | } |
| 1970 | return obj |
| 1971 | } |
| 1972 | |
| 1973 | type BsnControllerConnectionsRequest struct { |
| 1974 | *BsnHeader |
| 1975 | } |
| 1976 | |
| 1977 | type IBsnControllerConnectionsRequest interface { |
| 1978 | IBsnHeader |
| 1979 | } |
| 1980 | |
| 1981 | func (self *BsnControllerConnectionsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 1982 | startIndex := len(encoder.Bytes()) |
| 1983 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 1984 | return err |
| 1985 | } |
| 1986 | length := len(encoder.Bytes()) - startIndex |
| 1987 | |
| 1988 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 1989 | |
| 1990 | return nil |
| 1991 | } |
| 1992 | |
| 1993 | func DecodeBsnControllerConnectionsRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnControllerConnectionsRequest, error) { |
| 1994 | _bsncontrollerconnectionsrequest := &BsnControllerConnectionsRequest{BsnHeader: parent} |
| 1995 | return _bsncontrollerconnectionsrequest, nil |
| 1996 | } |
| 1997 | |
| 1998 | func NewBsnControllerConnectionsRequest() *BsnControllerConnectionsRequest { |
| 1999 | obj := &BsnControllerConnectionsRequest{ |
| 2000 | BsnHeader: NewBsnHeader(56), |
| 2001 | } |
| 2002 | return obj |
| 2003 | } |
| 2004 | |
| 2005 | type ExperimenterStatsReply struct { |
| 2006 | *StatsReply |
| 2007 | Experimenter uint32 |
| 2008 | Subtype uint32 |
| 2009 | } |
| 2010 | |
| 2011 | type IExperimenterStatsReply interface { |
| 2012 | IStatsReply |
| 2013 | GetExperimenter() uint32 |
| 2014 | GetSubtype() uint32 |
| 2015 | } |
| 2016 | |
| 2017 | func (self *ExperimenterStatsReply) GetExperimenter() uint32 { |
| 2018 | return self.Experimenter |
| 2019 | } |
| 2020 | |
| 2021 | func (self *ExperimenterStatsReply) SetExperimenter(v uint32) { |
| 2022 | self.Experimenter = v |
| 2023 | } |
| 2024 | |
| 2025 | func (self *ExperimenterStatsReply) GetSubtype() uint32 { |
| 2026 | return self.Subtype |
| 2027 | } |
| 2028 | |
| 2029 | func (self *ExperimenterStatsReply) SetSubtype(v uint32) { |
| 2030 | self.Subtype = v |
| 2031 | } |
| 2032 | |
| 2033 | func (self *ExperimenterStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 2034 | if err := self.StatsReply.Serialize(encoder); err != nil { |
| 2035 | return err |
| 2036 | } |
| 2037 | |
| 2038 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 2039 | encoder.PutUint32(uint32(self.Experimenter)) |
| 2040 | encoder.PutUint32(uint32(self.Subtype)) |
| 2041 | |
| 2042 | return nil |
| 2043 | } |
| 2044 | |
| 2045 | func DecodeExperimenterStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (IExperimenterStatsReply, error) { |
| 2046 | _experimenterstatsreply := &ExperimenterStatsReply{StatsReply: parent} |
| 2047 | if decoder.Length() < 12 { |
| 2048 | return nil, fmt.Errorf("ExperimenterStatsReply packet too short: %d < 12", decoder.Length()) |
| 2049 | } |
| 2050 | decoder.Skip(4) |
| 2051 | _experimenterstatsreply.Experimenter = uint32(decoder.ReadUint32()) |
| 2052 | _experimenterstatsreply.Subtype = uint32(decoder.ReadUint32()) |
| 2053 | |
| 2054 | switch _experimenterstatsreply.Experimenter { |
| 2055 | case 8992: |
| 2056 | return DecodeNiciraStatsReply(_experimenterstatsreply, decoder) |
| 2057 | case 6035143: |
| 2058 | return DecodeBsnStatsReply(_experimenterstatsreply, decoder) |
| 2059 | default: |
| 2060 | return nil, fmt.Errorf("Invalid type '%d' for 'ExperimenterStatsReply'", _experimenterstatsreply.Experimenter) |
| 2061 | } |
| 2062 | } |
| 2063 | |
| 2064 | func NewExperimenterStatsReply(_experimenter uint32) *ExperimenterStatsReply { |
| 2065 | obj := &ExperimenterStatsReply{ |
| 2066 | StatsReply: NewStatsReply(65535), |
| 2067 | } |
| 2068 | obj.Experimenter = _experimenter |
| 2069 | return obj |
| 2070 | } |
| 2071 | |
| 2072 | type BsnStatsReply struct { |
| 2073 | *ExperimenterStatsReply |
| 2074 | } |
| 2075 | |
| 2076 | type IBsnStatsReply interface { |
| 2077 | IExperimenterStatsReply |
| 2078 | } |
| 2079 | |
| 2080 | func (self *BsnStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 2081 | if err := self.ExperimenterStatsReply.Serialize(encoder); err != nil { |
| 2082 | return err |
| 2083 | } |
| 2084 | |
| 2085 | return nil |
| 2086 | } |
| 2087 | |
| 2088 | func DecodeBsnStatsReply(parent *ExperimenterStatsReply, decoder *goloxi.Decoder) (IBsnStatsReply, error) { |
| 2089 | _bsnstatsreply := &BsnStatsReply{ExperimenterStatsReply: parent} |
| 2090 | |
| 2091 | switch _bsnstatsreply.Subtype { |
| 2092 | case 1: |
| 2093 | return DecodeBsnLacpStatsReply(_bsnstatsreply, decoder) |
| 2094 | case 2: |
| 2095 | return DecodeBsnGentableEntryDescStatsReply(_bsnstatsreply, decoder) |
| 2096 | case 3: |
| 2097 | return DecodeBsnGentableEntryStatsReply(_bsnstatsreply, decoder) |
| 2098 | case 4: |
| 2099 | return DecodeBsnGentableDescStatsReply(_bsnstatsreply, decoder) |
| 2100 | case 5: |
| 2101 | return DecodeBsnGentableBucketStatsReply(_bsnstatsreply, decoder) |
| 2102 | case 6: |
| 2103 | return DecodeBsnSwitchPipelineStatsReply(_bsnstatsreply, decoder) |
| 2104 | case 7: |
| 2105 | return DecodeBsnGentableStatsReply(_bsnstatsreply, decoder) |
| 2106 | case 8: |
| 2107 | return DecodeBsnPortCounterStatsReply(_bsnstatsreply, decoder) |
| 2108 | case 9: |
| 2109 | return DecodeBsnVlanCounterStatsReply(_bsnstatsreply, decoder) |
| 2110 | case 10: |
| 2111 | return DecodeBsnFlowChecksumBucketStatsReply(_bsnstatsreply, decoder) |
| 2112 | case 11: |
| 2113 | return DecodeBsnTableChecksumStatsReply(_bsnstatsreply, decoder) |
| 2114 | case 12: |
| 2115 | return DecodeBsnDebugCounterStatsReply(_bsnstatsreply, decoder) |
| 2116 | case 13: |
| 2117 | return DecodeBsnDebugCounterDescStatsReply(_bsnstatsreply, decoder) |
| 2118 | case 14: |
| 2119 | return DecodeBsnImageDescStatsReply(_bsnstatsreply, decoder) |
| 2120 | case 15: |
| 2121 | return DecodeBsnVrfCounterStatsReply(_bsnstatsreply, decoder) |
| 2122 | case 16: |
| 2123 | return DecodeBsnGenericStatsReply(_bsnstatsreply, decoder) |
| 2124 | default: |
| 2125 | return nil, fmt.Errorf("Invalid type '%d' for 'BsnStatsReply'", _bsnstatsreply.Subtype) |
| 2126 | } |
| 2127 | } |
| 2128 | |
| 2129 | func NewBsnStatsReply(_subtype uint32) *BsnStatsReply { |
| 2130 | obj := &BsnStatsReply{ |
| 2131 | ExperimenterStatsReply: NewExperimenterStatsReply(6035143), |
| 2132 | } |
| 2133 | obj.Subtype = _subtype |
| 2134 | return obj |
| 2135 | } |
| 2136 | |
| 2137 | type BsnDebugCounterDescStatsReply struct { |
| 2138 | *BsnStatsReply |
| 2139 | Entries []*BsnDebugCounterDescStatsEntry |
| 2140 | } |
| 2141 | |
| 2142 | type IBsnDebugCounterDescStatsReply interface { |
| 2143 | IBsnStatsReply |
| 2144 | GetEntries() []*BsnDebugCounterDescStatsEntry |
| 2145 | } |
| 2146 | |
| 2147 | func (self *BsnDebugCounterDescStatsReply) GetEntries() []*BsnDebugCounterDescStatsEntry { |
| 2148 | return self.Entries |
| 2149 | } |
| 2150 | |
| 2151 | func (self *BsnDebugCounterDescStatsReply) SetEntries(v []*BsnDebugCounterDescStatsEntry) { |
| 2152 | self.Entries = v |
| 2153 | } |
| 2154 | |
| 2155 | func (self *BsnDebugCounterDescStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 2156 | startIndex := len(encoder.Bytes()) |
| 2157 | if err := self.BsnStatsReply.Serialize(encoder); err != nil { |
| 2158 | return err |
| 2159 | } |
| 2160 | |
| 2161 | for _, obj := range self.Entries { |
| 2162 | if err := obj.Serialize(encoder); err != nil { |
| 2163 | return err |
| 2164 | } |
| 2165 | } |
| 2166 | length := len(encoder.Bytes()) - startIndex |
| 2167 | |
| 2168 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 2169 | |
| 2170 | return nil |
| 2171 | } |
| 2172 | |
| 2173 | func DecodeBsnDebugCounterDescStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnDebugCounterDescStatsReply, error) { |
| 2174 | _bsndebugcounterdescstatsreply := &BsnDebugCounterDescStatsReply{BsnStatsReply: parent} |
| 2175 | |
| 2176 | for decoder.Length() >= 328 { |
| 2177 | item, err := DecodeBsnDebugCounterDescStatsEntry(decoder) |
| 2178 | if err != nil { |
| 2179 | return nil, err |
| 2180 | } |
| 2181 | if item != nil { |
| 2182 | _bsndebugcounterdescstatsreply.Entries = append(_bsndebugcounterdescstatsreply.Entries, item) |
| 2183 | } |
| 2184 | } |
| 2185 | return _bsndebugcounterdescstatsreply, nil |
| 2186 | } |
| 2187 | |
| 2188 | func NewBsnDebugCounterDescStatsReply() *BsnDebugCounterDescStatsReply { |
| 2189 | obj := &BsnDebugCounterDescStatsReply{ |
| 2190 | BsnStatsReply: NewBsnStatsReply(13), |
| 2191 | } |
| 2192 | return obj |
| 2193 | } |
| 2194 | |
| 2195 | type ExperimenterStatsRequest struct { |
| 2196 | *StatsRequest |
| 2197 | Experimenter uint32 |
| 2198 | Subtype uint32 |
| 2199 | } |
| 2200 | |
| 2201 | type IExperimenterStatsRequest interface { |
| 2202 | IStatsRequest |
| 2203 | GetExperimenter() uint32 |
| 2204 | GetSubtype() uint32 |
| 2205 | } |
| 2206 | |
| 2207 | func (self *ExperimenterStatsRequest) GetExperimenter() uint32 { |
| 2208 | return self.Experimenter |
| 2209 | } |
| 2210 | |
| 2211 | func (self *ExperimenterStatsRequest) SetExperimenter(v uint32) { |
| 2212 | self.Experimenter = v |
| 2213 | } |
| 2214 | |
| 2215 | func (self *ExperimenterStatsRequest) GetSubtype() uint32 { |
| 2216 | return self.Subtype |
| 2217 | } |
| 2218 | |
| 2219 | func (self *ExperimenterStatsRequest) SetSubtype(v uint32) { |
| 2220 | self.Subtype = v |
| 2221 | } |
| 2222 | |
| 2223 | func (self *ExperimenterStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 2224 | if err := self.StatsRequest.Serialize(encoder); err != nil { |
| 2225 | return err |
| 2226 | } |
| 2227 | |
| 2228 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 2229 | encoder.PutUint32(uint32(self.Experimenter)) |
| 2230 | encoder.PutUint32(uint32(self.Subtype)) |
| 2231 | |
| 2232 | return nil |
| 2233 | } |
| 2234 | |
| 2235 | func DecodeExperimenterStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (IExperimenterStatsRequest, error) { |
| 2236 | _experimenterstatsrequest := &ExperimenterStatsRequest{StatsRequest: parent} |
| 2237 | if decoder.Length() < 12 { |
| 2238 | return nil, fmt.Errorf("ExperimenterStatsRequest packet too short: %d < 12", decoder.Length()) |
| 2239 | } |
| 2240 | decoder.Skip(4) |
| 2241 | _experimenterstatsrequest.Experimenter = uint32(decoder.ReadUint32()) |
| 2242 | _experimenterstatsrequest.Subtype = uint32(decoder.ReadUint32()) |
| 2243 | |
| 2244 | switch _experimenterstatsrequest.Experimenter { |
| 2245 | case 8992: |
| 2246 | return DecodeNiciraFlowStatsRequest(_experimenterstatsrequest, decoder) |
| 2247 | case 6035143: |
| 2248 | return DecodeBsnStatsRequest(_experimenterstatsrequest, decoder) |
| 2249 | default: |
| 2250 | return nil, fmt.Errorf("Invalid type '%d' for 'ExperimenterStatsRequest'", _experimenterstatsrequest.Experimenter) |
| 2251 | } |
| 2252 | } |
| 2253 | |
| 2254 | func NewExperimenterStatsRequest(_experimenter uint32) *ExperimenterStatsRequest { |
| 2255 | obj := &ExperimenterStatsRequest{ |
| 2256 | StatsRequest: NewStatsRequest(65535), |
| 2257 | } |
| 2258 | obj.Experimenter = _experimenter |
| 2259 | return obj |
| 2260 | } |
| 2261 | |
| 2262 | type BsnStatsRequest struct { |
| 2263 | *ExperimenterStatsRequest |
| 2264 | } |
| 2265 | |
| 2266 | type IBsnStatsRequest interface { |
| 2267 | IExperimenterStatsRequest |
| 2268 | } |
| 2269 | |
| 2270 | func (self *BsnStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 2271 | if err := self.ExperimenterStatsRequest.Serialize(encoder); err != nil { |
| 2272 | return err |
| 2273 | } |
| 2274 | |
| 2275 | return nil |
| 2276 | } |
| 2277 | |
| 2278 | func DecodeBsnStatsRequest(parent *ExperimenterStatsRequest, decoder *goloxi.Decoder) (IBsnStatsRequest, error) { |
| 2279 | _bsnstatsrequest := &BsnStatsRequest{ExperimenterStatsRequest: parent} |
| 2280 | |
| 2281 | switch _bsnstatsrequest.Subtype { |
| 2282 | case 1: |
| 2283 | return DecodeBsnLacpStatsRequest(_bsnstatsrequest, decoder) |
| 2284 | case 2: |
| 2285 | return DecodeBsnGentableEntryDescStatsRequest(_bsnstatsrequest, decoder) |
| 2286 | case 3: |
| 2287 | return DecodeBsnGentableEntryStatsRequest(_bsnstatsrequest, decoder) |
| 2288 | case 4: |
| 2289 | return DecodeBsnGentableDescStatsRequest(_bsnstatsrequest, decoder) |
| 2290 | case 5: |
| 2291 | return DecodeBsnGentableBucketStatsRequest(_bsnstatsrequest, decoder) |
| 2292 | case 6: |
| 2293 | return DecodeBsnSwitchPipelineStatsRequest(_bsnstatsrequest, decoder) |
| 2294 | case 7: |
| 2295 | return DecodeBsnGentableStatsRequest(_bsnstatsrequest, decoder) |
| 2296 | case 8: |
| 2297 | return DecodeBsnPortCounterStatsRequest(_bsnstatsrequest, decoder) |
| 2298 | case 9: |
| 2299 | return DecodeBsnVlanCounterStatsRequest(_bsnstatsrequest, decoder) |
| 2300 | case 10: |
| 2301 | return DecodeBsnFlowChecksumBucketStatsRequest(_bsnstatsrequest, decoder) |
| 2302 | case 11: |
| 2303 | return DecodeBsnTableChecksumStatsRequest(_bsnstatsrequest, decoder) |
| 2304 | case 12: |
| 2305 | return DecodeBsnDebugCounterStatsRequest(_bsnstatsrequest, decoder) |
| 2306 | case 13: |
| 2307 | return DecodeBsnDebugCounterDescStatsRequest(_bsnstatsrequest, decoder) |
| 2308 | case 14: |
| 2309 | return DecodeBsnImageDescStatsRequest(_bsnstatsrequest, decoder) |
| 2310 | case 15: |
| 2311 | return DecodeBsnVrfCounterStatsRequest(_bsnstatsrequest, decoder) |
| 2312 | case 16: |
| 2313 | return DecodeBsnGenericStatsRequest(_bsnstatsrequest, decoder) |
| 2314 | default: |
| 2315 | return nil, fmt.Errorf("Invalid type '%d' for 'BsnStatsRequest'", _bsnstatsrequest.Subtype) |
| 2316 | } |
| 2317 | } |
| 2318 | |
| 2319 | func NewBsnStatsRequest(_subtype uint32) *BsnStatsRequest { |
| 2320 | obj := &BsnStatsRequest{ |
| 2321 | ExperimenterStatsRequest: NewExperimenterStatsRequest(6035143), |
| 2322 | } |
| 2323 | obj.Subtype = _subtype |
| 2324 | return obj |
| 2325 | } |
| 2326 | |
| 2327 | type BsnDebugCounterDescStatsRequest struct { |
| 2328 | *BsnStatsRequest |
| 2329 | } |
| 2330 | |
| 2331 | type IBsnDebugCounterDescStatsRequest interface { |
| 2332 | IBsnStatsRequest |
| 2333 | } |
| 2334 | |
| 2335 | func (self *BsnDebugCounterDescStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 2336 | startIndex := len(encoder.Bytes()) |
| 2337 | if err := self.BsnStatsRequest.Serialize(encoder); err != nil { |
| 2338 | return err |
| 2339 | } |
| 2340 | length := len(encoder.Bytes()) - startIndex |
| 2341 | |
| 2342 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 2343 | |
| 2344 | return nil |
| 2345 | } |
| 2346 | |
| 2347 | func DecodeBsnDebugCounterDescStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnDebugCounterDescStatsRequest, error) { |
| 2348 | _bsndebugcounterdescstatsrequest := &BsnDebugCounterDescStatsRequest{BsnStatsRequest: parent} |
| 2349 | return _bsndebugcounterdescstatsrequest, nil |
| 2350 | } |
| 2351 | |
| 2352 | func NewBsnDebugCounterDescStatsRequest() *BsnDebugCounterDescStatsRequest { |
| 2353 | obj := &BsnDebugCounterDescStatsRequest{ |
| 2354 | BsnStatsRequest: NewBsnStatsRequest(13), |
| 2355 | } |
| 2356 | return obj |
| 2357 | } |
| 2358 | |
| 2359 | type BsnDebugCounterStatsReply struct { |
| 2360 | *BsnStatsReply |
| 2361 | Entries []*BsnDebugCounterStatsEntry |
| 2362 | } |
| 2363 | |
| 2364 | type IBsnDebugCounterStatsReply interface { |
| 2365 | IBsnStatsReply |
| 2366 | GetEntries() []*BsnDebugCounterStatsEntry |
| 2367 | } |
| 2368 | |
| 2369 | func (self *BsnDebugCounterStatsReply) GetEntries() []*BsnDebugCounterStatsEntry { |
| 2370 | return self.Entries |
| 2371 | } |
| 2372 | |
| 2373 | func (self *BsnDebugCounterStatsReply) SetEntries(v []*BsnDebugCounterStatsEntry) { |
| 2374 | self.Entries = v |
| 2375 | } |
| 2376 | |
| 2377 | func (self *BsnDebugCounterStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 2378 | startIndex := len(encoder.Bytes()) |
| 2379 | if err := self.BsnStatsReply.Serialize(encoder); err != nil { |
| 2380 | return err |
| 2381 | } |
| 2382 | |
| 2383 | for _, obj := range self.Entries { |
| 2384 | if err := obj.Serialize(encoder); err != nil { |
| 2385 | return err |
| 2386 | } |
| 2387 | } |
| 2388 | length := len(encoder.Bytes()) - startIndex |
| 2389 | |
| 2390 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 2391 | |
| 2392 | return nil |
| 2393 | } |
| 2394 | |
| 2395 | func DecodeBsnDebugCounterStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnDebugCounterStatsReply, error) { |
| 2396 | _bsndebugcounterstatsreply := &BsnDebugCounterStatsReply{BsnStatsReply: parent} |
| 2397 | |
| 2398 | for decoder.Length() >= 16 { |
| 2399 | item, err := DecodeBsnDebugCounterStatsEntry(decoder) |
| 2400 | if err != nil { |
| 2401 | return nil, err |
| 2402 | } |
| 2403 | if item != nil { |
| 2404 | _bsndebugcounterstatsreply.Entries = append(_bsndebugcounterstatsreply.Entries, item) |
| 2405 | } |
| 2406 | } |
| 2407 | return _bsndebugcounterstatsreply, nil |
| 2408 | } |
| 2409 | |
| 2410 | func NewBsnDebugCounterStatsReply() *BsnDebugCounterStatsReply { |
| 2411 | obj := &BsnDebugCounterStatsReply{ |
| 2412 | BsnStatsReply: NewBsnStatsReply(12), |
| 2413 | } |
| 2414 | return obj |
| 2415 | } |
| 2416 | |
| 2417 | type BsnDebugCounterStatsRequest struct { |
| 2418 | *BsnStatsRequest |
| 2419 | } |
| 2420 | |
| 2421 | type IBsnDebugCounterStatsRequest interface { |
| 2422 | IBsnStatsRequest |
| 2423 | } |
| 2424 | |
| 2425 | func (self *BsnDebugCounterStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 2426 | startIndex := len(encoder.Bytes()) |
| 2427 | if err := self.BsnStatsRequest.Serialize(encoder); err != nil { |
| 2428 | return err |
| 2429 | } |
| 2430 | length := len(encoder.Bytes()) - startIndex |
| 2431 | |
| 2432 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 2433 | |
| 2434 | return nil |
| 2435 | } |
| 2436 | |
| 2437 | func DecodeBsnDebugCounterStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnDebugCounterStatsRequest, error) { |
| 2438 | _bsndebugcounterstatsrequest := &BsnDebugCounterStatsRequest{BsnStatsRequest: parent} |
| 2439 | return _bsndebugcounterstatsrequest, nil |
| 2440 | } |
| 2441 | |
| 2442 | func NewBsnDebugCounterStatsRequest() *BsnDebugCounterStatsRequest { |
| 2443 | obj := &BsnDebugCounterStatsRequest{ |
| 2444 | BsnStatsRequest: NewBsnStatsRequest(12), |
| 2445 | } |
| 2446 | return obj |
| 2447 | } |
| 2448 | |
| 2449 | type BsnError struct { |
| 2450 | *BsnBaseError |
| 2451 | } |
| 2452 | |
| 2453 | type IBsnError interface { |
| 2454 | IBsnBaseError |
| 2455 | } |
| 2456 | |
| 2457 | func (self *BsnError) Serialize(encoder *goloxi.Encoder) error { |
| 2458 | startIndex := len(encoder.Bytes()) |
| 2459 | if err := self.BsnBaseError.Serialize(encoder); err != nil { |
| 2460 | return err |
| 2461 | } |
| 2462 | length := len(encoder.Bytes()) - startIndex |
| 2463 | |
| 2464 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 2465 | |
| 2466 | return nil |
| 2467 | } |
| 2468 | |
| 2469 | func DecodeBsnError(parent *BsnBaseError, decoder *goloxi.Decoder) (*BsnError, error) { |
| 2470 | _bsnerror := &BsnError{BsnBaseError: parent} |
| 2471 | return _bsnerror, nil |
| 2472 | } |
| 2473 | |
| 2474 | func NewBsnError() *BsnError { |
| 2475 | obj := &BsnError{ |
| 2476 | BsnBaseError: NewBsnBaseError(1), |
| 2477 | } |
| 2478 | return obj |
| 2479 | } |
| 2480 | |
| 2481 | type BsnFlowChecksumBucketStatsReply struct { |
| 2482 | *BsnStatsReply |
| 2483 | Entries []*BsnFlowChecksumBucketStatsEntry |
| 2484 | } |
| 2485 | |
| 2486 | type IBsnFlowChecksumBucketStatsReply interface { |
| 2487 | IBsnStatsReply |
| 2488 | GetEntries() []*BsnFlowChecksumBucketStatsEntry |
| 2489 | } |
| 2490 | |
| 2491 | func (self *BsnFlowChecksumBucketStatsReply) GetEntries() []*BsnFlowChecksumBucketStatsEntry { |
| 2492 | return self.Entries |
| 2493 | } |
| 2494 | |
| 2495 | func (self *BsnFlowChecksumBucketStatsReply) SetEntries(v []*BsnFlowChecksumBucketStatsEntry) { |
| 2496 | self.Entries = v |
| 2497 | } |
| 2498 | |
| 2499 | func (self *BsnFlowChecksumBucketStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 2500 | startIndex := len(encoder.Bytes()) |
| 2501 | if err := self.BsnStatsReply.Serialize(encoder); err != nil { |
| 2502 | return err |
| 2503 | } |
| 2504 | |
| 2505 | for _, obj := range self.Entries { |
| 2506 | if err := obj.Serialize(encoder); err != nil { |
| 2507 | return err |
| 2508 | } |
| 2509 | } |
| 2510 | length := len(encoder.Bytes()) - startIndex |
| 2511 | |
| 2512 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 2513 | |
| 2514 | return nil |
| 2515 | } |
| 2516 | |
| 2517 | func DecodeBsnFlowChecksumBucketStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnFlowChecksumBucketStatsReply, error) { |
| 2518 | _bsnflowchecksumbucketstatsreply := &BsnFlowChecksumBucketStatsReply{BsnStatsReply: parent} |
| 2519 | |
| 2520 | for decoder.Length() >= 8 { |
| 2521 | item, err := DecodeBsnFlowChecksumBucketStatsEntry(decoder) |
| 2522 | if err != nil { |
| 2523 | return nil, err |
| 2524 | } |
| 2525 | if item != nil { |
| 2526 | _bsnflowchecksumbucketstatsreply.Entries = append(_bsnflowchecksumbucketstatsreply.Entries, item) |
| 2527 | } |
| 2528 | } |
| 2529 | return _bsnflowchecksumbucketstatsreply, nil |
| 2530 | } |
| 2531 | |
| 2532 | func NewBsnFlowChecksumBucketStatsReply() *BsnFlowChecksumBucketStatsReply { |
| 2533 | obj := &BsnFlowChecksumBucketStatsReply{ |
| 2534 | BsnStatsReply: NewBsnStatsReply(10), |
| 2535 | } |
| 2536 | return obj |
| 2537 | } |
| 2538 | |
| 2539 | type BsnFlowChecksumBucketStatsRequest struct { |
| 2540 | *BsnStatsRequest |
| 2541 | TableId uint8 |
| 2542 | } |
| 2543 | |
| 2544 | type IBsnFlowChecksumBucketStatsRequest interface { |
| 2545 | IBsnStatsRequest |
| 2546 | GetTableId() uint8 |
| 2547 | } |
| 2548 | |
| 2549 | func (self *BsnFlowChecksumBucketStatsRequest) GetTableId() uint8 { |
| 2550 | return self.TableId |
| 2551 | } |
| 2552 | |
| 2553 | func (self *BsnFlowChecksumBucketStatsRequest) SetTableId(v uint8) { |
| 2554 | self.TableId = v |
| 2555 | } |
| 2556 | |
| 2557 | func (self *BsnFlowChecksumBucketStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 2558 | startIndex := len(encoder.Bytes()) |
| 2559 | if err := self.BsnStatsRequest.Serialize(encoder); err != nil { |
| 2560 | return err |
| 2561 | } |
| 2562 | |
| 2563 | encoder.PutUint8(uint8(self.TableId)) |
| 2564 | length := len(encoder.Bytes()) - startIndex |
| 2565 | |
| 2566 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 2567 | |
| 2568 | return nil |
| 2569 | } |
| 2570 | |
| 2571 | func DecodeBsnFlowChecksumBucketStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnFlowChecksumBucketStatsRequest, error) { |
| 2572 | _bsnflowchecksumbucketstatsrequest := &BsnFlowChecksumBucketStatsRequest{BsnStatsRequest: parent} |
| 2573 | if decoder.Length() < 1 { |
| 2574 | return nil, fmt.Errorf("BsnFlowChecksumBucketStatsRequest packet too short: %d < 1", decoder.Length()) |
| 2575 | } |
| 2576 | _bsnflowchecksumbucketstatsrequest.TableId = uint8(decoder.ReadByte()) |
| 2577 | return _bsnflowchecksumbucketstatsrequest, nil |
| 2578 | } |
| 2579 | |
| 2580 | func NewBsnFlowChecksumBucketStatsRequest() *BsnFlowChecksumBucketStatsRequest { |
| 2581 | obj := &BsnFlowChecksumBucketStatsRequest{ |
| 2582 | BsnStatsRequest: NewBsnStatsRequest(10), |
| 2583 | } |
| 2584 | return obj |
| 2585 | } |
| 2586 | |
| 2587 | type BsnFlowIdle struct { |
| 2588 | *BsnHeader |
| 2589 | Cookie uint64 |
| 2590 | Priority uint16 |
| 2591 | TableId uint8 |
| 2592 | Match Match |
| 2593 | } |
| 2594 | |
| 2595 | type IBsnFlowIdle interface { |
| 2596 | IBsnHeader |
| 2597 | GetCookie() uint64 |
| 2598 | GetPriority() uint16 |
| 2599 | GetTableId() uint8 |
| 2600 | GetMatch() Match |
| 2601 | } |
| 2602 | |
| 2603 | func (self *BsnFlowIdle) GetCookie() uint64 { |
| 2604 | return self.Cookie |
| 2605 | } |
| 2606 | |
| 2607 | func (self *BsnFlowIdle) SetCookie(v uint64) { |
| 2608 | self.Cookie = v |
| 2609 | } |
| 2610 | |
| 2611 | func (self *BsnFlowIdle) GetPriority() uint16 { |
| 2612 | return self.Priority |
| 2613 | } |
| 2614 | |
| 2615 | func (self *BsnFlowIdle) SetPriority(v uint16) { |
| 2616 | self.Priority = v |
| 2617 | } |
| 2618 | |
| 2619 | func (self *BsnFlowIdle) GetTableId() uint8 { |
| 2620 | return self.TableId |
| 2621 | } |
| 2622 | |
| 2623 | func (self *BsnFlowIdle) SetTableId(v uint8) { |
| 2624 | self.TableId = v |
| 2625 | } |
| 2626 | |
| 2627 | func (self *BsnFlowIdle) GetMatch() Match { |
| 2628 | return self.Match |
| 2629 | } |
| 2630 | |
| 2631 | func (self *BsnFlowIdle) SetMatch(v Match) { |
| 2632 | self.Match = v |
| 2633 | } |
| 2634 | |
| 2635 | func (self *BsnFlowIdle) Serialize(encoder *goloxi.Encoder) error { |
| 2636 | startIndex := len(encoder.Bytes()) |
| 2637 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 2638 | return err |
| 2639 | } |
| 2640 | |
| 2641 | encoder.PutUint64(uint64(self.Cookie)) |
| 2642 | encoder.PutUint16(uint16(self.Priority)) |
| 2643 | encoder.PutUint8(uint8(self.TableId)) |
| 2644 | encoder.Write(bytes.Repeat([]byte{0}, 5)) |
| 2645 | if err := self.Match.Serialize(encoder); err != nil { |
| 2646 | return err |
| 2647 | } |
| 2648 | |
| 2649 | length := len(encoder.Bytes()) - startIndex |
| 2650 | |
| 2651 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 2652 | |
| 2653 | return nil |
| 2654 | } |
| 2655 | |
| 2656 | func DecodeBsnFlowIdle(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnFlowIdle, error) { |
| 2657 | _bsnflowidle := &BsnFlowIdle{BsnHeader: parent} |
| 2658 | if decoder.Length() < 24 { |
| 2659 | return nil, fmt.Errorf("BsnFlowIdle packet too short: %d < 24", decoder.Length()) |
| 2660 | } |
| 2661 | _bsnflowidle.Cookie = uint64(decoder.ReadUint64()) |
| 2662 | _bsnflowidle.Priority = uint16(decoder.ReadUint16()) |
| 2663 | _bsnflowidle.TableId = uint8(decoder.ReadByte()) |
| 2664 | decoder.Skip(5) |
| 2665 | if err := _bsnflowidle.Match.Decode(decoder); err != nil { |
| 2666 | return nil, err |
| 2667 | } |
| 2668 | |
| 2669 | decoder.SkipAlign() |
| 2670 | return _bsnflowidle, nil |
| 2671 | } |
| 2672 | |
| 2673 | func NewBsnFlowIdle() *BsnFlowIdle { |
| 2674 | obj := &BsnFlowIdle{ |
| 2675 | BsnHeader: NewBsnHeader(40), |
| 2676 | } |
| 2677 | return obj |
| 2678 | } |
| 2679 | |
| 2680 | type BsnFlowIdleEnableGetReply struct { |
| 2681 | *BsnHeader |
| 2682 | Enabled uint32 |
| 2683 | } |
| 2684 | |
| 2685 | type IBsnFlowIdleEnableGetReply interface { |
| 2686 | IBsnHeader |
| 2687 | GetEnabled() uint32 |
| 2688 | } |
| 2689 | |
| 2690 | func (self *BsnFlowIdleEnableGetReply) GetEnabled() uint32 { |
| 2691 | return self.Enabled |
| 2692 | } |
| 2693 | |
| 2694 | func (self *BsnFlowIdleEnableGetReply) SetEnabled(v uint32) { |
| 2695 | self.Enabled = v |
| 2696 | } |
| 2697 | |
| 2698 | func (self *BsnFlowIdleEnableGetReply) Serialize(encoder *goloxi.Encoder) error { |
| 2699 | startIndex := len(encoder.Bytes()) |
| 2700 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 2701 | return err |
| 2702 | } |
| 2703 | |
| 2704 | encoder.PutUint32(uint32(self.Enabled)) |
| 2705 | length := len(encoder.Bytes()) - startIndex |
| 2706 | |
| 2707 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 2708 | |
| 2709 | return nil |
| 2710 | } |
| 2711 | |
| 2712 | func DecodeBsnFlowIdleEnableGetReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnFlowIdleEnableGetReply, error) { |
| 2713 | _bsnflowidleenablegetreply := &BsnFlowIdleEnableGetReply{BsnHeader: parent} |
| 2714 | if decoder.Length() < 4 { |
| 2715 | return nil, fmt.Errorf("BsnFlowIdleEnableGetReply packet too short: %d < 4", decoder.Length()) |
| 2716 | } |
| 2717 | _bsnflowidleenablegetreply.Enabled = uint32(decoder.ReadUint32()) |
| 2718 | return _bsnflowidleenablegetreply, nil |
| 2719 | } |
| 2720 | |
| 2721 | func NewBsnFlowIdleEnableGetReply() *BsnFlowIdleEnableGetReply { |
| 2722 | obj := &BsnFlowIdleEnableGetReply{ |
| 2723 | BsnHeader: NewBsnHeader(39), |
| 2724 | } |
| 2725 | return obj |
| 2726 | } |
| 2727 | |
| 2728 | type BsnFlowIdleEnableGetRequest struct { |
| 2729 | *BsnHeader |
| 2730 | } |
| 2731 | |
| 2732 | type IBsnFlowIdleEnableGetRequest interface { |
| 2733 | IBsnHeader |
| 2734 | } |
| 2735 | |
| 2736 | func (self *BsnFlowIdleEnableGetRequest) Serialize(encoder *goloxi.Encoder) error { |
| 2737 | startIndex := len(encoder.Bytes()) |
| 2738 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 2739 | return err |
| 2740 | } |
| 2741 | length := len(encoder.Bytes()) - startIndex |
| 2742 | |
| 2743 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 2744 | |
| 2745 | return nil |
| 2746 | } |
| 2747 | |
| 2748 | func DecodeBsnFlowIdleEnableGetRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnFlowIdleEnableGetRequest, error) { |
| 2749 | _bsnflowidleenablegetrequest := &BsnFlowIdleEnableGetRequest{BsnHeader: parent} |
| 2750 | return _bsnflowidleenablegetrequest, nil |
| 2751 | } |
| 2752 | |
| 2753 | func NewBsnFlowIdleEnableGetRequest() *BsnFlowIdleEnableGetRequest { |
| 2754 | obj := &BsnFlowIdleEnableGetRequest{ |
| 2755 | BsnHeader: NewBsnHeader(38), |
| 2756 | } |
| 2757 | return obj |
| 2758 | } |
| 2759 | |
| 2760 | type BsnFlowIdleEnableSetReply struct { |
| 2761 | *BsnHeader |
| 2762 | Enable uint32 |
| 2763 | Status uint32 |
| 2764 | } |
| 2765 | |
| 2766 | type IBsnFlowIdleEnableSetReply interface { |
| 2767 | IBsnHeader |
| 2768 | GetEnable() uint32 |
| 2769 | GetStatus() uint32 |
| 2770 | } |
| 2771 | |
| 2772 | func (self *BsnFlowIdleEnableSetReply) GetEnable() uint32 { |
| 2773 | return self.Enable |
| 2774 | } |
| 2775 | |
| 2776 | func (self *BsnFlowIdleEnableSetReply) SetEnable(v uint32) { |
| 2777 | self.Enable = v |
| 2778 | } |
| 2779 | |
| 2780 | func (self *BsnFlowIdleEnableSetReply) GetStatus() uint32 { |
| 2781 | return self.Status |
| 2782 | } |
| 2783 | |
| 2784 | func (self *BsnFlowIdleEnableSetReply) SetStatus(v uint32) { |
| 2785 | self.Status = v |
| 2786 | } |
| 2787 | |
| 2788 | func (self *BsnFlowIdleEnableSetReply) Serialize(encoder *goloxi.Encoder) error { |
| 2789 | startIndex := len(encoder.Bytes()) |
| 2790 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 2791 | return err |
| 2792 | } |
| 2793 | |
| 2794 | encoder.PutUint32(uint32(self.Enable)) |
| 2795 | encoder.PutUint32(uint32(self.Status)) |
| 2796 | length := len(encoder.Bytes()) - startIndex |
| 2797 | |
| 2798 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 2799 | |
| 2800 | return nil |
| 2801 | } |
| 2802 | |
| 2803 | func DecodeBsnFlowIdleEnableSetReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnFlowIdleEnableSetReply, error) { |
| 2804 | _bsnflowidleenablesetreply := &BsnFlowIdleEnableSetReply{BsnHeader: parent} |
| 2805 | if decoder.Length() < 8 { |
| 2806 | return nil, fmt.Errorf("BsnFlowIdleEnableSetReply packet too short: %d < 8", decoder.Length()) |
| 2807 | } |
| 2808 | _bsnflowidleenablesetreply.Enable = uint32(decoder.ReadUint32()) |
| 2809 | _bsnflowidleenablesetreply.Status = uint32(decoder.ReadUint32()) |
| 2810 | return _bsnflowidleenablesetreply, nil |
| 2811 | } |
| 2812 | |
| 2813 | func NewBsnFlowIdleEnableSetReply() *BsnFlowIdleEnableSetReply { |
| 2814 | obj := &BsnFlowIdleEnableSetReply{ |
| 2815 | BsnHeader: NewBsnHeader(37), |
| 2816 | } |
| 2817 | return obj |
| 2818 | } |
| 2819 | |
| 2820 | type BsnFlowIdleEnableSetRequest struct { |
| 2821 | *BsnHeader |
| 2822 | Enable uint32 |
| 2823 | } |
| 2824 | |
| 2825 | type IBsnFlowIdleEnableSetRequest interface { |
| 2826 | IBsnHeader |
| 2827 | GetEnable() uint32 |
| 2828 | } |
| 2829 | |
| 2830 | func (self *BsnFlowIdleEnableSetRequest) GetEnable() uint32 { |
| 2831 | return self.Enable |
| 2832 | } |
| 2833 | |
| 2834 | func (self *BsnFlowIdleEnableSetRequest) SetEnable(v uint32) { |
| 2835 | self.Enable = v |
| 2836 | } |
| 2837 | |
| 2838 | func (self *BsnFlowIdleEnableSetRequest) Serialize(encoder *goloxi.Encoder) error { |
| 2839 | startIndex := len(encoder.Bytes()) |
| 2840 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 2841 | return err |
| 2842 | } |
| 2843 | |
| 2844 | encoder.PutUint32(uint32(self.Enable)) |
| 2845 | length := len(encoder.Bytes()) - startIndex |
| 2846 | |
| 2847 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 2848 | |
| 2849 | return nil |
| 2850 | } |
| 2851 | |
| 2852 | func DecodeBsnFlowIdleEnableSetRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnFlowIdleEnableSetRequest, error) { |
| 2853 | _bsnflowidleenablesetrequest := &BsnFlowIdleEnableSetRequest{BsnHeader: parent} |
| 2854 | if decoder.Length() < 4 { |
| 2855 | return nil, fmt.Errorf("BsnFlowIdleEnableSetRequest packet too short: %d < 4", decoder.Length()) |
| 2856 | } |
| 2857 | _bsnflowidleenablesetrequest.Enable = uint32(decoder.ReadUint32()) |
| 2858 | return _bsnflowidleenablesetrequest, nil |
| 2859 | } |
| 2860 | |
| 2861 | func NewBsnFlowIdleEnableSetRequest() *BsnFlowIdleEnableSetRequest { |
| 2862 | obj := &BsnFlowIdleEnableSetRequest{ |
| 2863 | BsnHeader: NewBsnHeader(36), |
| 2864 | } |
| 2865 | return obj |
| 2866 | } |
| 2867 | |
| 2868 | type BsnGenericAsync struct { |
| 2869 | *BsnHeader |
| 2870 | Name string |
| 2871 | Tlvs []IBsnTlv |
| 2872 | } |
| 2873 | |
| 2874 | type IBsnGenericAsync interface { |
| 2875 | IBsnHeader |
| 2876 | GetName() string |
| 2877 | GetTlvs() []IBsnTlv |
| 2878 | } |
| 2879 | |
| 2880 | func (self *BsnGenericAsync) GetName() string { |
| 2881 | return self.Name |
| 2882 | } |
| 2883 | |
| 2884 | func (self *BsnGenericAsync) SetName(v string) { |
| 2885 | self.Name = v |
| 2886 | } |
| 2887 | |
| 2888 | func (self *BsnGenericAsync) GetTlvs() []IBsnTlv { |
| 2889 | return self.Tlvs |
| 2890 | } |
| 2891 | |
| 2892 | func (self *BsnGenericAsync) SetTlvs(v []IBsnTlv) { |
| 2893 | self.Tlvs = v |
| 2894 | } |
| 2895 | |
| 2896 | func (self *BsnGenericAsync) Serialize(encoder *goloxi.Encoder) error { |
| 2897 | startIndex := len(encoder.Bytes()) |
| 2898 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 2899 | return err |
| 2900 | } |
| 2901 | |
| 2902 | encoder.Write([]byte(self.Name)) |
| 2903 | for _, obj := range self.Tlvs { |
| 2904 | if err := obj.Serialize(encoder); err != nil { |
| 2905 | return err |
| 2906 | } |
| 2907 | } |
| 2908 | length := len(encoder.Bytes()) - startIndex |
| 2909 | |
| 2910 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 2911 | |
| 2912 | return nil |
| 2913 | } |
| 2914 | |
| 2915 | func DecodeBsnGenericAsync(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnGenericAsync, error) { |
| 2916 | _bsngenericasync := &BsnGenericAsync{BsnHeader: parent} |
| 2917 | if decoder.Length() < 64 { |
| 2918 | return nil, fmt.Errorf("BsnGenericAsync packet too short: %d < 64", decoder.Length()) |
| 2919 | } |
| 2920 | _bsngenericasync.Name = string(bytes.Trim(decoder.Read(64), "\x00")) |
| 2921 | |
| 2922 | for decoder.Length() >= 4 { |
| 2923 | item, err := DecodeBsnTlv(decoder) |
| 2924 | if err != nil { |
| 2925 | return nil, err |
| 2926 | } |
| 2927 | if item != nil { |
| 2928 | _bsngenericasync.Tlvs = append(_bsngenericasync.Tlvs, item) |
| 2929 | } |
| 2930 | } |
| 2931 | return _bsngenericasync, nil |
| 2932 | } |
| 2933 | |
| 2934 | func NewBsnGenericAsync() *BsnGenericAsync { |
| 2935 | obj := &BsnGenericAsync{ |
| 2936 | BsnHeader: NewBsnHeader(68), |
| 2937 | } |
| 2938 | return obj |
| 2939 | } |
| 2940 | |
| 2941 | type BsnGenericCommand struct { |
| 2942 | *BsnHeader |
| 2943 | Name string |
| 2944 | Tlvs []IBsnTlv |
| 2945 | } |
| 2946 | |
| 2947 | type IBsnGenericCommand interface { |
| 2948 | IBsnHeader |
| 2949 | GetName() string |
| 2950 | GetTlvs() []IBsnTlv |
| 2951 | } |
| 2952 | |
| 2953 | func (self *BsnGenericCommand) GetName() string { |
| 2954 | return self.Name |
| 2955 | } |
| 2956 | |
| 2957 | func (self *BsnGenericCommand) SetName(v string) { |
| 2958 | self.Name = v |
| 2959 | } |
| 2960 | |
| 2961 | func (self *BsnGenericCommand) GetTlvs() []IBsnTlv { |
| 2962 | return self.Tlvs |
| 2963 | } |
| 2964 | |
| 2965 | func (self *BsnGenericCommand) SetTlvs(v []IBsnTlv) { |
| 2966 | self.Tlvs = v |
| 2967 | } |
| 2968 | |
| 2969 | func (self *BsnGenericCommand) Serialize(encoder *goloxi.Encoder) error { |
| 2970 | startIndex := len(encoder.Bytes()) |
| 2971 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 2972 | return err |
| 2973 | } |
| 2974 | |
| 2975 | encoder.Write([]byte(self.Name)) |
| 2976 | for _, obj := range self.Tlvs { |
| 2977 | if err := obj.Serialize(encoder); err != nil { |
| 2978 | return err |
| 2979 | } |
| 2980 | } |
| 2981 | length := len(encoder.Bytes()) - startIndex |
| 2982 | |
| 2983 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 2984 | |
| 2985 | return nil |
| 2986 | } |
| 2987 | |
| 2988 | func DecodeBsnGenericCommand(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnGenericCommand, error) { |
| 2989 | _bsngenericcommand := &BsnGenericCommand{BsnHeader: parent} |
| 2990 | if decoder.Length() < 64 { |
| 2991 | return nil, fmt.Errorf("BsnGenericCommand packet too short: %d < 64", decoder.Length()) |
| 2992 | } |
| 2993 | _bsngenericcommand.Name = string(bytes.Trim(decoder.Read(64), "\x00")) |
| 2994 | |
| 2995 | for decoder.Length() >= 4 { |
| 2996 | item, err := DecodeBsnTlv(decoder) |
| 2997 | if err != nil { |
| 2998 | return nil, err |
| 2999 | } |
| 3000 | if item != nil { |
| 3001 | _bsngenericcommand.Tlvs = append(_bsngenericcommand.Tlvs, item) |
| 3002 | } |
| 3003 | } |
| 3004 | return _bsngenericcommand, nil |
| 3005 | } |
| 3006 | |
| 3007 | func NewBsnGenericCommand() *BsnGenericCommand { |
| 3008 | obj := &BsnGenericCommand{ |
| 3009 | BsnHeader: NewBsnHeader(71), |
| 3010 | } |
| 3011 | return obj |
| 3012 | } |
| 3013 | |
| 3014 | type BsnGenericStatsReply struct { |
| 3015 | *BsnStatsReply |
| 3016 | Entries []*BsnGenericStatsEntry |
| 3017 | } |
| 3018 | |
| 3019 | type IBsnGenericStatsReply interface { |
| 3020 | IBsnStatsReply |
| 3021 | GetEntries() []*BsnGenericStatsEntry |
| 3022 | } |
| 3023 | |
| 3024 | func (self *BsnGenericStatsReply) GetEntries() []*BsnGenericStatsEntry { |
| 3025 | return self.Entries |
| 3026 | } |
| 3027 | |
| 3028 | func (self *BsnGenericStatsReply) SetEntries(v []*BsnGenericStatsEntry) { |
| 3029 | self.Entries = v |
| 3030 | } |
| 3031 | |
| 3032 | func (self *BsnGenericStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 3033 | startIndex := len(encoder.Bytes()) |
| 3034 | if err := self.BsnStatsReply.Serialize(encoder); err != nil { |
| 3035 | return err |
| 3036 | } |
| 3037 | |
| 3038 | for _, obj := range self.Entries { |
| 3039 | if err := obj.Serialize(encoder); err != nil { |
| 3040 | return err |
| 3041 | } |
| 3042 | } |
| 3043 | length := len(encoder.Bytes()) - startIndex |
| 3044 | |
| 3045 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 3046 | |
| 3047 | return nil |
| 3048 | } |
| 3049 | |
| 3050 | func DecodeBsnGenericStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnGenericStatsReply, error) { |
| 3051 | _bsngenericstatsreply := &BsnGenericStatsReply{BsnStatsReply: parent} |
| 3052 | |
| 3053 | for decoder.Length() >= 2 { |
| 3054 | item, err := DecodeBsnGenericStatsEntry(decoder) |
| 3055 | if err != nil { |
| 3056 | return nil, err |
| 3057 | } |
| 3058 | if item != nil { |
| 3059 | _bsngenericstatsreply.Entries = append(_bsngenericstatsreply.Entries, item) |
| 3060 | } |
| 3061 | } |
| 3062 | return _bsngenericstatsreply, nil |
| 3063 | } |
| 3064 | |
| 3065 | func NewBsnGenericStatsReply() *BsnGenericStatsReply { |
| 3066 | obj := &BsnGenericStatsReply{ |
| 3067 | BsnStatsReply: NewBsnStatsReply(16), |
| 3068 | } |
| 3069 | return obj |
| 3070 | } |
| 3071 | |
| 3072 | type BsnGenericStatsRequest struct { |
| 3073 | *BsnStatsRequest |
| 3074 | Name string |
| 3075 | Tlvs []IBsnTlv |
| 3076 | } |
| 3077 | |
| 3078 | type IBsnGenericStatsRequest interface { |
| 3079 | IBsnStatsRequest |
| 3080 | GetName() string |
| 3081 | GetTlvs() []IBsnTlv |
| 3082 | } |
| 3083 | |
| 3084 | func (self *BsnGenericStatsRequest) GetName() string { |
| 3085 | return self.Name |
| 3086 | } |
| 3087 | |
| 3088 | func (self *BsnGenericStatsRequest) SetName(v string) { |
| 3089 | self.Name = v |
| 3090 | } |
| 3091 | |
| 3092 | func (self *BsnGenericStatsRequest) GetTlvs() []IBsnTlv { |
| 3093 | return self.Tlvs |
| 3094 | } |
| 3095 | |
| 3096 | func (self *BsnGenericStatsRequest) SetTlvs(v []IBsnTlv) { |
| 3097 | self.Tlvs = v |
| 3098 | } |
| 3099 | |
| 3100 | func (self *BsnGenericStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 3101 | startIndex := len(encoder.Bytes()) |
| 3102 | if err := self.BsnStatsRequest.Serialize(encoder); err != nil { |
| 3103 | return err |
| 3104 | } |
| 3105 | |
| 3106 | encoder.Write([]byte(self.Name)) |
| 3107 | for _, obj := range self.Tlvs { |
| 3108 | if err := obj.Serialize(encoder); err != nil { |
| 3109 | return err |
| 3110 | } |
| 3111 | } |
| 3112 | length := len(encoder.Bytes()) - startIndex |
| 3113 | |
| 3114 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 3115 | |
| 3116 | return nil |
| 3117 | } |
| 3118 | |
| 3119 | func DecodeBsnGenericStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnGenericStatsRequest, error) { |
| 3120 | _bsngenericstatsrequest := &BsnGenericStatsRequest{BsnStatsRequest: parent} |
| 3121 | if decoder.Length() < 64 { |
| 3122 | return nil, fmt.Errorf("BsnGenericStatsRequest packet too short: %d < 64", decoder.Length()) |
| 3123 | } |
| 3124 | _bsngenericstatsrequest.Name = string(bytes.Trim(decoder.Read(64), "\x00")) |
| 3125 | |
| 3126 | for decoder.Length() >= 4 { |
| 3127 | item, err := DecodeBsnTlv(decoder) |
| 3128 | if err != nil { |
| 3129 | return nil, err |
| 3130 | } |
| 3131 | if item != nil { |
| 3132 | _bsngenericstatsrequest.Tlvs = append(_bsngenericstatsrequest.Tlvs, item) |
| 3133 | } |
| 3134 | } |
| 3135 | return _bsngenericstatsrequest, nil |
| 3136 | } |
| 3137 | |
| 3138 | func NewBsnGenericStatsRequest() *BsnGenericStatsRequest { |
| 3139 | obj := &BsnGenericStatsRequest{ |
| 3140 | BsnStatsRequest: NewBsnStatsRequest(16), |
| 3141 | } |
| 3142 | return obj |
| 3143 | } |
| 3144 | |
| 3145 | type BsnGentableBucketStatsReply struct { |
| 3146 | *BsnStatsReply |
| 3147 | Entries []*BsnGentableBucketStatsEntry |
| 3148 | } |
| 3149 | |
| 3150 | type IBsnGentableBucketStatsReply interface { |
| 3151 | IBsnStatsReply |
| 3152 | GetEntries() []*BsnGentableBucketStatsEntry |
| 3153 | } |
| 3154 | |
| 3155 | func (self *BsnGentableBucketStatsReply) GetEntries() []*BsnGentableBucketStatsEntry { |
| 3156 | return self.Entries |
| 3157 | } |
| 3158 | |
| 3159 | func (self *BsnGentableBucketStatsReply) SetEntries(v []*BsnGentableBucketStatsEntry) { |
| 3160 | self.Entries = v |
| 3161 | } |
| 3162 | |
| 3163 | func (self *BsnGentableBucketStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 3164 | startIndex := len(encoder.Bytes()) |
| 3165 | if err := self.BsnStatsReply.Serialize(encoder); err != nil { |
| 3166 | return err |
| 3167 | } |
| 3168 | |
| 3169 | for _, obj := range self.Entries { |
| 3170 | if err := obj.Serialize(encoder); err != nil { |
| 3171 | return err |
| 3172 | } |
| 3173 | } |
| 3174 | length := len(encoder.Bytes()) - startIndex |
| 3175 | |
| 3176 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 3177 | |
| 3178 | return nil |
| 3179 | } |
| 3180 | |
| 3181 | func DecodeBsnGentableBucketStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnGentableBucketStatsReply, error) { |
| 3182 | _bsngentablebucketstatsreply := &BsnGentableBucketStatsReply{BsnStatsReply: parent} |
| 3183 | |
| 3184 | for decoder.Length() >= 16 { |
| 3185 | item, err := DecodeBsnGentableBucketStatsEntry(decoder) |
| 3186 | if err != nil { |
| 3187 | return nil, err |
| 3188 | } |
| 3189 | if item != nil { |
| 3190 | _bsngentablebucketstatsreply.Entries = append(_bsngentablebucketstatsreply.Entries, item) |
| 3191 | } |
| 3192 | } |
| 3193 | return _bsngentablebucketstatsreply, nil |
| 3194 | } |
| 3195 | |
| 3196 | func NewBsnGentableBucketStatsReply() *BsnGentableBucketStatsReply { |
| 3197 | obj := &BsnGentableBucketStatsReply{ |
| 3198 | BsnStatsReply: NewBsnStatsReply(5), |
| 3199 | } |
| 3200 | return obj |
| 3201 | } |
| 3202 | |
| 3203 | type BsnGentableBucketStatsRequest struct { |
| 3204 | *BsnStatsRequest |
| 3205 | TableId uint16 |
| 3206 | } |
| 3207 | |
| 3208 | type IBsnGentableBucketStatsRequest interface { |
| 3209 | IBsnStatsRequest |
| 3210 | GetTableId() uint16 |
| 3211 | } |
| 3212 | |
| 3213 | func (self *BsnGentableBucketStatsRequest) GetTableId() uint16 { |
| 3214 | return self.TableId |
| 3215 | } |
| 3216 | |
| 3217 | func (self *BsnGentableBucketStatsRequest) SetTableId(v uint16) { |
| 3218 | self.TableId = v |
| 3219 | } |
| 3220 | |
| 3221 | func (self *BsnGentableBucketStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 3222 | startIndex := len(encoder.Bytes()) |
| 3223 | if err := self.BsnStatsRequest.Serialize(encoder); err != nil { |
| 3224 | return err |
| 3225 | } |
| 3226 | |
| 3227 | encoder.PutUint16(uint16(self.TableId)) |
| 3228 | length := len(encoder.Bytes()) - startIndex |
| 3229 | |
| 3230 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 3231 | |
| 3232 | return nil |
| 3233 | } |
| 3234 | |
| 3235 | func DecodeBsnGentableBucketStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnGentableBucketStatsRequest, error) { |
| 3236 | _bsngentablebucketstatsrequest := &BsnGentableBucketStatsRequest{BsnStatsRequest: parent} |
| 3237 | if decoder.Length() < 2 { |
| 3238 | return nil, fmt.Errorf("BsnGentableBucketStatsRequest packet too short: %d < 2", decoder.Length()) |
| 3239 | } |
| 3240 | _bsngentablebucketstatsrequest.TableId = uint16(decoder.ReadUint16()) |
| 3241 | return _bsngentablebucketstatsrequest, nil |
| 3242 | } |
| 3243 | |
| 3244 | func NewBsnGentableBucketStatsRequest() *BsnGentableBucketStatsRequest { |
| 3245 | obj := &BsnGentableBucketStatsRequest{ |
| 3246 | BsnStatsRequest: NewBsnStatsRequest(5), |
| 3247 | } |
| 3248 | return obj |
| 3249 | } |
| 3250 | |
| 3251 | type BsnGentableClearReply struct { |
| 3252 | *BsnHeader |
| 3253 | TableId uint16 |
| 3254 | DeletedCount uint32 |
| 3255 | ErrorCount uint32 |
| 3256 | } |
| 3257 | |
| 3258 | type IBsnGentableClearReply interface { |
| 3259 | IBsnHeader |
| 3260 | GetTableId() uint16 |
| 3261 | GetDeletedCount() uint32 |
| 3262 | GetErrorCount() uint32 |
| 3263 | } |
| 3264 | |
| 3265 | func (self *BsnGentableClearReply) GetTableId() uint16 { |
| 3266 | return self.TableId |
| 3267 | } |
| 3268 | |
| 3269 | func (self *BsnGentableClearReply) SetTableId(v uint16) { |
| 3270 | self.TableId = v |
| 3271 | } |
| 3272 | |
| 3273 | func (self *BsnGentableClearReply) GetDeletedCount() uint32 { |
| 3274 | return self.DeletedCount |
| 3275 | } |
| 3276 | |
| 3277 | func (self *BsnGentableClearReply) SetDeletedCount(v uint32) { |
| 3278 | self.DeletedCount = v |
| 3279 | } |
| 3280 | |
| 3281 | func (self *BsnGentableClearReply) GetErrorCount() uint32 { |
| 3282 | return self.ErrorCount |
| 3283 | } |
| 3284 | |
| 3285 | func (self *BsnGentableClearReply) SetErrorCount(v uint32) { |
| 3286 | self.ErrorCount = v |
| 3287 | } |
| 3288 | |
| 3289 | func (self *BsnGentableClearReply) Serialize(encoder *goloxi.Encoder) error { |
| 3290 | startIndex := len(encoder.Bytes()) |
| 3291 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 3292 | return err |
| 3293 | } |
| 3294 | |
| 3295 | encoder.PutUint16(uint16(self.TableId)) |
| 3296 | encoder.Write(bytes.Repeat([]byte{0}, 2)) |
| 3297 | encoder.PutUint32(uint32(self.DeletedCount)) |
| 3298 | encoder.PutUint32(uint32(self.ErrorCount)) |
| 3299 | length := len(encoder.Bytes()) - startIndex |
| 3300 | |
| 3301 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 3302 | |
| 3303 | return nil |
| 3304 | } |
| 3305 | |
| 3306 | func DecodeBsnGentableClearReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnGentableClearReply, error) { |
| 3307 | _bsngentableclearreply := &BsnGentableClearReply{BsnHeader: parent} |
| 3308 | if decoder.Length() < 12 { |
| 3309 | return nil, fmt.Errorf("BsnGentableClearReply packet too short: %d < 12", decoder.Length()) |
| 3310 | } |
| 3311 | _bsngentableclearreply.TableId = uint16(decoder.ReadUint16()) |
| 3312 | decoder.Skip(2) |
| 3313 | _bsngentableclearreply.DeletedCount = uint32(decoder.ReadUint32()) |
| 3314 | _bsngentableclearreply.ErrorCount = uint32(decoder.ReadUint32()) |
| 3315 | return _bsngentableclearreply, nil |
| 3316 | } |
| 3317 | |
| 3318 | func NewBsnGentableClearReply() *BsnGentableClearReply { |
| 3319 | obj := &BsnGentableClearReply{ |
| 3320 | BsnHeader: NewBsnHeader(49), |
| 3321 | } |
| 3322 | return obj |
| 3323 | } |
| 3324 | |
| 3325 | type BsnGentableClearRequest struct { |
| 3326 | *BsnHeader |
| 3327 | TableId uint16 |
| 3328 | Checksum Checksum128 |
| 3329 | ChecksumMask Checksum128 |
| 3330 | } |
| 3331 | |
| 3332 | type IBsnGentableClearRequest interface { |
| 3333 | IBsnHeader |
| 3334 | GetTableId() uint16 |
| 3335 | GetChecksum() Checksum128 |
| 3336 | GetChecksumMask() Checksum128 |
| 3337 | } |
| 3338 | |
| 3339 | func (self *BsnGentableClearRequest) GetTableId() uint16 { |
| 3340 | return self.TableId |
| 3341 | } |
| 3342 | |
| 3343 | func (self *BsnGentableClearRequest) SetTableId(v uint16) { |
| 3344 | self.TableId = v |
| 3345 | } |
| 3346 | |
| 3347 | func (self *BsnGentableClearRequest) GetChecksum() Checksum128 { |
| 3348 | return self.Checksum |
| 3349 | } |
| 3350 | |
| 3351 | func (self *BsnGentableClearRequest) SetChecksum(v Checksum128) { |
| 3352 | self.Checksum = v |
| 3353 | } |
| 3354 | |
| 3355 | func (self *BsnGentableClearRequest) GetChecksumMask() Checksum128 { |
| 3356 | return self.ChecksumMask |
| 3357 | } |
| 3358 | |
| 3359 | func (self *BsnGentableClearRequest) SetChecksumMask(v Checksum128) { |
| 3360 | self.ChecksumMask = v |
| 3361 | } |
| 3362 | |
| 3363 | func (self *BsnGentableClearRequest) Serialize(encoder *goloxi.Encoder) error { |
| 3364 | startIndex := len(encoder.Bytes()) |
| 3365 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 3366 | return err |
| 3367 | } |
| 3368 | |
| 3369 | encoder.PutUint16(uint16(self.TableId)) |
| 3370 | encoder.Write(bytes.Repeat([]byte{0}, 2)) |
| 3371 | self.Checksum.Serialize(encoder) |
| 3372 | self.ChecksumMask.Serialize(encoder) |
| 3373 | length := len(encoder.Bytes()) - startIndex |
| 3374 | |
| 3375 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 3376 | |
| 3377 | return nil |
| 3378 | } |
| 3379 | |
| 3380 | func DecodeBsnGentableClearRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnGentableClearRequest, error) { |
| 3381 | _bsngentableclearrequest := &BsnGentableClearRequest{BsnHeader: parent} |
| 3382 | if decoder.Length() < 36 { |
| 3383 | return nil, fmt.Errorf("BsnGentableClearRequest packet too short: %d < 36", decoder.Length()) |
| 3384 | } |
| 3385 | _bsngentableclearrequest.TableId = uint16(decoder.ReadUint16()) |
| 3386 | decoder.Skip(2) |
| 3387 | _bsngentableclearrequest.Checksum.Decode(decoder) |
| 3388 | _bsngentableclearrequest.ChecksumMask.Decode(decoder) |
| 3389 | return _bsngentableclearrequest, nil |
| 3390 | } |
| 3391 | |
| 3392 | func NewBsnGentableClearRequest() *BsnGentableClearRequest { |
| 3393 | obj := &BsnGentableClearRequest{ |
| 3394 | BsnHeader: NewBsnHeader(48), |
| 3395 | } |
| 3396 | return obj |
| 3397 | } |
| 3398 | |
| 3399 | type BsnGentableDescStatsReply struct { |
| 3400 | *BsnStatsReply |
| 3401 | Entries []*BsnGentableDescStatsEntry |
| 3402 | } |
| 3403 | |
| 3404 | type IBsnGentableDescStatsReply interface { |
| 3405 | IBsnStatsReply |
| 3406 | GetEntries() []*BsnGentableDescStatsEntry |
| 3407 | } |
| 3408 | |
| 3409 | func (self *BsnGentableDescStatsReply) GetEntries() []*BsnGentableDescStatsEntry { |
| 3410 | return self.Entries |
| 3411 | } |
| 3412 | |
| 3413 | func (self *BsnGentableDescStatsReply) SetEntries(v []*BsnGentableDescStatsEntry) { |
| 3414 | self.Entries = v |
| 3415 | } |
| 3416 | |
| 3417 | func (self *BsnGentableDescStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 3418 | startIndex := len(encoder.Bytes()) |
| 3419 | if err := self.BsnStatsReply.Serialize(encoder); err != nil { |
| 3420 | return err |
| 3421 | } |
| 3422 | |
| 3423 | for _, obj := range self.Entries { |
| 3424 | if err := obj.Serialize(encoder); err != nil { |
| 3425 | return err |
| 3426 | } |
| 3427 | } |
| 3428 | length := len(encoder.Bytes()) - startIndex |
| 3429 | |
| 3430 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 3431 | |
| 3432 | return nil |
| 3433 | } |
| 3434 | |
| 3435 | func DecodeBsnGentableDescStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnGentableDescStatsReply, error) { |
| 3436 | _bsngentabledescstatsreply := &BsnGentableDescStatsReply{BsnStatsReply: parent} |
| 3437 | |
| 3438 | for decoder.Length() >= 48 { |
| 3439 | item, err := DecodeBsnGentableDescStatsEntry(decoder) |
| 3440 | if err != nil { |
| 3441 | return nil, err |
| 3442 | } |
| 3443 | if item != nil { |
| 3444 | _bsngentabledescstatsreply.Entries = append(_bsngentabledescstatsreply.Entries, item) |
| 3445 | } |
| 3446 | } |
| 3447 | return _bsngentabledescstatsreply, nil |
| 3448 | } |
| 3449 | |
| 3450 | func NewBsnGentableDescStatsReply() *BsnGentableDescStatsReply { |
| 3451 | obj := &BsnGentableDescStatsReply{ |
| 3452 | BsnStatsReply: NewBsnStatsReply(4), |
| 3453 | } |
| 3454 | return obj |
| 3455 | } |
| 3456 | |
| 3457 | type BsnGentableDescStatsRequest struct { |
| 3458 | *BsnStatsRequest |
| 3459 | } |
| 3460 | |
| 3461 | type IBsnGentableDescStatsRequest interface { |
| 3462 | IBsnStatsRequest |
| 3463 | } |
| 3464 | |
| 3465 | func (self *BsnGentableDescStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 3466 | startIndex := len(encoder.Bytes()) |
| 3467 | if err := self.BsnStatsRequest.Serialize(encoder); err != nil { |
| 3468 | return err |
| 3469 | } |
| 3470 | length := len(encoder.Bytes()) - startIndex |
| 3471 | |
| 3472 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 3473 | |
| 3474 | return nil |
| 3475 | } |
| 3476 | |
| 3477 | func DecodeBsnGentableDescStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnGentableDescStatsRequest, error) { |
| 3478 | _bsngentabledescstatsrequest := &BsnGentableDescStatsRequest{BsnStatsRequest: parent} |
| 3479 | return _bsngentabledescstatsrequest, nil |
| 3480 | } |
| 3481 | |
| 3482 | func NewBsnGentableDescStatsRequest() *BsnGentableDescStatsRequest { |
| 3483 | obj := &BsnGentableDescStatsRequest{ |
| 3484 | BsnStatsRequest: NewBsnStatsRequest(4), |
| 3485 | } |
| 3486 | return obj |
| 3487 | } |
| 3488 | |
| 3489 | type BsnGentableEntryAdd struct { |
| 3490 | *BsnHeader |
| 3491 | TableId uint16 |
| 3492 | KeyLength uint16 |
| 3493 | Checksum Checksum128 |
| 3494 | Key []IBsnTlv |
| 3495 | Value []IBsnTlv |
| 3496 | } |
| 3497 | |
| 3498 | type IBsnGentableEntryAdd interface { |
| 3499 | IBsnHeader |
| 3500 | GetTableId() uint16 |
| 3501 | GetKeyLength() uint16 |
| 3502 | GetChecksum() Checksum128 |
| 3503 | GetKey() []IBsnTlv |
| 3504 | GetValue() []IBsnTlv |
| 3505 | } |
| 3506 | |
| 3507 | func (self *BsnGentableEntryAdd) GetTableId() uint16 { |
| 3508 | return self.TableId |
| 3509 | } |
| 3510 | |
| 3511 | func (self *BsnGentableEntryAdd) SetTableId(v uint16) { |
| 3512 | self.TableId = v |
| 3513 | } |
| 3514 | |
| 3515 | func (self *BsnGentableEntryAdd) GetKeyLength() uint16 { |
| 3516 | return self.KeyLength |
| 3517 | } |
| 3518 | |
| 3519 | func (self *BsnGentableEntryAdd) SetKeyLength(v uint16) { |
| 3520 | self.KeyLength = v |
| 3521 | } |
| 3522 | |
| 3523 | func (self *BsnGentableEntryAdd) GetChecksum() Checksum128 { |
| 3524 | return self.Checksum |
| 3525 | } |
| 3526 | |
| 3527 | func (self *BsnGentableEntryAdd) SetChecksum(v Checksum128) { |
| 3528 | self.Checksum = v |
| 3529 | } |
| 3530 | |
| 3531 | func (self *BsnGentableEntryAdd) GetKey() []IBsnTlv { |
| 3532 | return self.Key |
| 3533 | } |
| 3534 | |
| 3535 | func (self *BsnGentableEntryAdd) SetKey(v []IBsnTlv) { |
| 3536 | self.Key = v |
| 3537 | } |
| 3538 | |
| 3539 | func (self *BsnGentableEntryAdd) GetValue() []IBsnTlv { |
| 3540 | return self.Value |
| 3541 | } |
| 3542 | |
| 3543 | func (self *BsnGentableEntryAdd) SetValue(v []IBsnTlv) { |
| 3544 | self.Value = v |
| 3545 | } |
| 3546 | |
| 3547 | func (self *BsnGentableEntryAdd) Serialize(encoder *goloxi.Encoder) error { |
| 3548 | startIndex := len(encoder.Bytes()) |
| 3549 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 3550 | return err |
| 3551 | } |
| 3552 | |
| 3553 | encoder.PutUint16(uint16(self.TableId)) |
| 3554 | encoder.PutUint16(uint16(self.KeyLength)) |
| 3555 | self.Checksum.Serialize(encoder) |
| 3556 | for _, obj := range self.Key { |
| 3557 | if err := obj.Serialize(encoder); err != nil { |
| 3558 | return err |
| 3559 | } |
| 3560 | } |
| 3561 | for _, obj := range self.Value { |
| 3562 | if err := obj.Serialize(encoder); err != nil { |
| 3563 | return err |
| 3564 | } |
| 3565 | } |
| 3566 | length := len(encoder.Bytes()) - startIndex |
| 3567 | |
| 3568 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 3569 | |
| 3570 | return nil |
| 3571 | } |
| 3572 | |
| 3573 | func DecodeBsnGentableEntryAdd(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnGentableEntryAdd, error) { |
| 3574 | _bsngentableentryadd := &BsnGentableEntryAdd{BsnHeader: parent} |
| 3575 | if decoder.Length() < 20 { |
| 3576 | return nil, fmt.Errorf("BsnGentableEntryAdd packet too short: %d < 20", decoder.Length()) |
| 3577 | } |
| 3578 | _bsngentableentryadd.TableId = uint16(decoder.ReadUint16()) |
| 3579 | _bsngentableentryadd.KeyLength = uint16(decoder.ReadUint16()) |
| 3580 | _bsngentableentryadd.Checksum.Decode(decoder) |
| 3581 | |
| 3582 | end := decoder.Offset() + int(_bsngentableentryadd.KeyLength) |
| 3583 | for decoder.Offset() < end { |
| 3584 | item, err := DecodeBsnTlv(decoder) |
| 3585 | if err != nil { |
| 3586 | return nil, err |
| 3587 | } |
| 3588 | if item != nil { |
| 3589 | _bsngentableentryadd.Key = append(_bsngentableentryadd.Key, item) |
| 3590 | } |
| 3591 | } |
| 3592 | |
| 3593 | for decoder.Length() >= 4 { |
| 3594 | item, err := DecodeBsnTlv(decoder) |
| 3595 | if err != nil { |
| 3596 | return nil, err |
| 3597 | } |
| 3598 | if item != nil { |
| 3599 | _bsngentableentryadd.Value = append(_bsngentableentryadd.Value, item) |
| 3600 | } |
| 3601 | } |
| 3602 | return _bsngentableentryadd, nil |
| 3603 | } |
| 3604 | |
| 3605 | func NewBsnGentableEntryAdd() *BsnGentableEntryAdd { |
| 3606 | obj := &BsnGentableEntryAdd{ |
| 3607 | BsnHeader: NewBsnHeader(46), |
| 3608 | } |
| 3609 | return obj |
| 3610 | } |
| 3611 | |
| 3612 | type BsnGentableEntryDelete struct { |
| 3613 | *BsnHeader |
| 3614 | TableId uint16 |
| 3615 | Key []IBsnTlv |
| 3616 | } |
| 3617 | |
| 3618 | type IBsnGentableEntryDelete interface { |
| 3619 | IBsnHeader |
| 3620 | GetTableId() uint16 |
| 3621 | GetKey() []IBsnTlv |
| 3622 | } |
| 3623 | |
| 3624 | func (self *BsnGentableEntryDelete) GetTableId() uint16 { |
| 3625 | return self.TableId |
| 3626 | } |
| 3627 | |
| 3628 | func (self *BsnGentableEntryDelete) SetTableId(v uint16) { |
| 3629 | self.TableId = v |
| 3630 | } |
| 3631 | |
| 3632 | func (self *BsnGentableEntryDelete) GetKey() []IBsnTlv { |
| 3633 | return self.Key |
| 3634 | } |
| 3635 | |
| 3636 | func (self *BsnGentableEntryDelete) SetKey(v []IBsnTlv) { |
| 3637 | self.Key = v |
| 3638 | } |
| 3639 | |
| 3640 | func (self *BsnGentableEntryDelete) Serialize(encoder *goloxi.Encoder) error { |
| 3641 | startIndex := len(encoder.Bytes()) |
| 3642 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 3643 | return err |
| 3644 | } |
| 3645 | |
| 3646 | encoder.PutUint16(uint16(self.TableId)) |
| 3647 | for _, obj := range self.Key { |
| 3648 | if err := obj.Serialize(encoder); err != nil { |
| 3649 | return err |
| 3650 | } |
| 3651 | } |
| 3652 | length := len(encoder.Bytes()) - startIndex |
| 3653 | |
| 3654 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 3655 | |
| 3656 | return nil |
| 3657 | } |
| 3658 | |
| 3659 | func DecodeBsnGentableEntryDelete(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnGentableEntryDelete, error) { |
| 3660 | _bsngentableentrydelete := &BsnGentableEntryDelete{BsnHeader: parent} |
| 3661 | if decoder.Length() < 2 { |
| 3662 | return nil, fmt.Errorf("BsnGentableEntryDelete packet too short: %d < 2", decoder.Length()) |
| 3663 | } |
| 3664 | _bsngentableentrydelete.TableId = uint16(decoder.ReadUint16()) |
| 3665 | |
| 3666 | for decoder.Length() >= 4 { |
| 3667 | item, err := DecodeBsnTlv(decoder) |
| 3668 | if err != nil { |
| 3669 | return nil, err |
| 3670 | } |
| 3671 | if item != nil { |
| 3672 | _bsngentableentrydelete.Key = append(_bsngentableentrydelete.Key, item) |
| 3673 | } |
| 3674 | } |
| 3675 | return _bsngentableentrydelete, nil |
| 3676 | } |
| 3677 | |
| 3678 | func NewBsnGentableEntryDelete() *BsnGentableEntryDelete { |
| 3679 | obj := &BsnGentableEntryDelete{ |
| 3680 | BsnHeader: NewBsnHeader(47), |
| 3681 | } |
| 3682 | return obj |
| 3683 | } |
| 3684 | |
| 3685 | type BsnGentableEntryDescStatsReply struct { |
| 3686 | *BsnStatsReply |
| 3687 | Entries []*BsnGentableEntryDescStatsEntry |
| 3688 | } |
| 3689 | |
| 3690 | type IBsnGentableEntryDescStatsReply interface { |
| 3691 | IBsnStatsReply |
| 3692 | GetEntries() []*BsnGentableEntryDescStatsEntry |
| 3693 | } |
| 3694 | |
| 3695 | func (self *BsnGentableEntryDescStatsReply) GetEntries() []*BsnGentableEntryDescStatsEntry { |
| 3696 | return self.Entries |
| 3697 | } |
| 3698 | |
| 3699 | func (self *BsnGentableEntryDescStatsReply) SetEntries(v []*BsnGentableEntryDescStatsEntry) { |
| 3700 | self.Entries = v |
| 3701 | } |
| 3702 | |
| 3703 | func (self *BsnGentableEntryDescStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 3704 | startIndex := len(encoder.Bytes()) |
| 3705 | if err := self.BsnStatsReply.Serialize(encoder); err != nil { |
| 3706 | return err |
| 3707 | } |
| 3708 | |
| 3709 | for _, obj := range self.Entries { |
| 3710 | if err := obj.Serialize(encoder); err != nil { |
| 3711 | return err |
| 3712 | } |
| 3713 | } |
| 3714 | length := len(encoder.Bytes()) - startIndex |
| 3715 | |
| 3716 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 3717 | |
| 3718 | return nil |
| 3719 | } |
| 3720 | |
| 3721 | func DecodeBsnGentableEntryDescStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnGentableEntryDescStatsReply, error) { |
| 3722 | _bsngentableentrydescstatsreply := &BsnGentableEntryDescStatsReply{BsnStatsReply: parent} |
| 3723 | |
| 3724 | for decoder.Length() >= 20 { |
| 3725 | item, err := DecodeBsnGentableEntryDescStatsEntry(decoder) |
| 3726 | if err != nil { |
| 3727 | return nil, err |
| 3728 | } |
| 3729 | if item != nil { |
| 3730 | _bsngentableentrydescstatsreply.Entries = append(_bsngentableentrydescstatsreply.Entries, item) |
| 3731 | } |
| 3732 | } |
| 3733 | return _bsngentableentrydescstatsreply, nil |
| 3734 | } |
| 3735 | |
| 3736 | func NewBsnGentableEntryDescStatsReply() *BsnGentableEntryDescStatsReply { |
| 3737 | obj := &BsnGentableEntryDescStatsReply{ |
| 3738 | BsnStatsReply: NewBsnStatsReply(2), |
| 3739 | } |
| 3740 | return obj |
| 3741 | } |
| 3742 | |
| 3743 | type BsnGentableEntryDescStatsRequest struct { |
| 3744 | *BsnStatsRequest |
| 3745 | TableId uint16 |
| 3746 | Checksum Checksum128 |
| 3747 | ChecksumMask Checksum128 |
| 3748 | } |
| 3749 | |
| 3750 | type IBsnGentableEntryDescStatsRequest interface { |
| 3751 | IBsnStatsRequest |
| 3752 | GetTableId() uint16 |
| 3753 | GetChecksum() Checksum128 |
| 3754 | GetChecksumMask() Checksum128 |
| 3755 | } |
| 3756 | |
| 3757 | func (self *BsnGentableEntryDescStatsRequest) GetTableId() uint16 { |
| 3758 | return self.TableId |
| 3759 | } |
| 3760 | |
| 3761 | func (self *BsnGentableEntryDescStatsRequest) SetTableId(v uint16) { |
| 3762 | self.TableId = v |
| 3763 | } |
| 3764 | |
| 3765 | func (self *BsnGentableEntryDescStatsRequest) GetChecksum() Checksum128 { |
| 3766 | return self.Checksum |
| 3767 | } |
| 3768 | |
| 3769 | func (self *BsnGentableEntryDescStatsRequest) SetChecksum(v Checksum128) { |
| 3770 | self.Checksum = v |
| 3771 | } |
| 3772 | |
| 3773 | func (self *BsnGentableEntryDescStatsRequest) GetChecksumMask() Checksum128 { |
| 3774 | return self.ChecksumMask |
| 3775 | } |
| 3776 | |
| 3777 | func (self *BsnGentableEntryDescStatsRequest) SetChecksumMask(v Checksum128) { |
| 3778 | self.ChecksumMask = v |
| 3779 | } |
| 3780 | |
| 3781 | func (self *BsnGentableEntryDescStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 3782 | startIndex := len(encoder.Bytes()) |
| 3783 | if err := self.BsnStatsRequest.Serialize(encoder); err != nil { |
| 3784 | return err |
| 3785 | } |
| 3786 | |
| 3787 | encoder.PutUint16(uint16(self.TableId)) |
| 3788 | encoder.Write(bytes.Repeat([]byte{0}, 2)) |
| 3789 | self.Checksum.Serialize(encoder) |
| 3790 | self.ChecksumMask.Serialize(encoder) |
| 3791 | length := len(encoder.Bytes()) - startIndex |
| 3792 | |
| 3793 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 3794 | |
| 3795 | return nil |
| 3796 | } |
| 3797 | |
| 3798 | func DecodeBsnGentableEntryDescStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnGentableEntryDescStatsRequest, error) { |
| 3799 | _bsngentableentrydescstatsrequest := &BsnGentableEntryDescStatsRequest{BsnStatsRequest: parent} |
| 3800 | if decoder.Length() < 36 { |
| 3801 | return nil, fmt.Errorf("BsnGentableEntryDescStatsRequest packet too short: %d < 36", decoder.Length()) |
| 3802 | } |
| 3803 | _bsngentableentrydescstatsrequest.TableId = uint16(decoder.ReadUint16()) |
| 3804 | decoder.Skip(2) |
| 3805 | _bsngentableentrydescstatsrequest.Checksum.Decode(decoder) |
| 3806 | _bsngentableentrydescstatsrequest.ChecksumMask.Decode(decoder) |
| 3807 | return _bsngentableentrydescstatsrequest, nil |
| 3808 | } |
| 3809 | |
| 3810 | func NewBsnGentableEntryDescStatsRequest() *BsnGentableEntryDescStatsRequest { |
| 3811 | obj := &BsnGentableEntryDescStatsRequest{ |
| 3812 | BsnStatsRequest: NewBsnStatsRequest(2), |
| 3813 | } |
| 3814 | return obj |
| 3815 | } |
| 3816 | |
| 3817 | type BsnGentableEntryStatsReply struct { |
| 3818 | *BsnStatsReply |
| 3819 | Entries []*BsnGentableEntryStatsEntry |
| 3820 | } |
| 3821 | |
| 3822 | type IBsnGentableEntryStatsReply interface { |
| 3823 | IBsnStatsReply |
| 3824 | GetEntries() []*BsnGentableEntryStatsEntry |
| 3825 | } |
| 3826 | |
| 3827 | func (self *BsnGentableEntryStatsReply) GetEntries() []*BsnGentableEntryStatsEntry { |
| 3828 | return self.Entries |
| 3829 | } |
| 3830 | |
| 3831 | func (self *BsnGentableEntryStatsReply) SetEntries(v []*BsnGentableEntryStatsEntry) { |
| 3832 | self.Entries = v |
| 3833 | } |
| 3834 | |
| 3835 | func (self *BsnGentableEntryStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 3836 | startIndex := len(encoder.Bytes()) |
| 3837 | if err := self.BsnStatsReply.Serialize(encoder); err != nil { |
| 3838 | return err |
| 3839 | } |
| 3840 | |
| 3841 | for _, obj := range self.Entries { |
| 3842 | if err := obj.Serialize(encoder); err != nil { |
| 3843 | return err |
| 3844 | } |
| 3845 | } |
| 3846 | length := len(encoder.Bytes()) - startIndex |
| 3847 | |
| 3848 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 3849 | |
| 3850 | return nil |
| 3851 | } |
| 3852 | |
| 3853 | func DecodeBsnGentableEntryStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnGentableEntryStatsReply, error) { |
| 3854 | _bsngentableentrystatsreply := &BsnGentableEntryStatsReply{BsnStatsReply: parent} |
| 3855 | |
| 3856 | for decoder.Length() >= 4 { |
| 3857 | item, err := DecodeBsnGentableEntryStatsEntry(decoder) |
| 3858 | if err != nil { |
| 3859 | return nil, err |
| 3860 | } |
| 3861 | if item != nil { |
| 3862 | _bsngentableentrystatsreply.Entries = append(_bsngentableentrystatsreply.Entries, item) |
| 3863 | } |
| 3864 | } |
| 3865 | return _bsngentableentrystatsreply, nil |
| 3866 | } |
| 3867 | |
| 3868 | func NewBsnGentableEntryStatsReply() *BsnGentableEntryStatsReply { |
| 3869 | obj := &BsnGentableEntryStatsReply{ |
| 3870 | BsnStatsReply: NewBsnStatsReply(3), |
| 3871 | } |
| 3872 | return obj |
| 3873 | } |
| 3874 | |
| 3875 | type BsnGentableEntryStatsRequest struct { |
| 3876 | *BsnStatsRequest |
| 3877 | TableId uint16 |
| 3878 | Checksum Checksum128 |
| 3879 | ChecksumMask Checksum128 |
| 3880 | } |
| 3881 | |
| 3882 | type IBsnGentableEntryStatsRequest interface { |
| 3883 | IBsnStatsRequest |
| 3884 | GetTableId() uint16 |
| 3885 | GetChecksum() Checksum128 |
| 3886 | GetChecksumMask() Checksum128 |
| 3887 | } |
| 3888 | |
| 3889 | func (self *BsnGentableEntryStatsRequest) GetTableId() uint16 { |
| 3890 | return self.TableId |
| 3891 | } |
| 3892 | |
| 3893 | func (self *BsnGentableEntryStatsRequest) SetTableId(v uint16) { |
| 3894 | self.TableId = v |
| 3895 | } |
| 3896 | |
| 3897 | func (self *BsnGentableEntryStatsRequest) GetChecksum() Checksum128 { |
| 3898 | return self.Checksum |
| 3899 | } |
| 3900 | |
| 3901 | func (self *BsnGentableEntryStatsRequest) SetChecksum(v Checksum128) { |
| 3902 | self.Checksum = v |
| 3903 | } |
| 3904 | |
| 3905 | func (self *BsnGentableEntryStatsRequest) GetChecksumMask() Checksum128 { |
| 3906 | return self.ChecksumMask |
| 3907 | } |
| 3908 | |
| 3909 | func (self *BsnGentableEntryStatsRequest) SetChecksumMask(v Checksum128) { |
| 3910 | self.ChecksumMask = v |
| 3911 | } |
| 3912 | |
| 3913 | func (self *BsnGentableEntryStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 3914 | startIndex := len(encoder.Bytes()) |
| 3915 | if err := self.BsnStatsRequest.Serialize(encoder); err != nil { |
| 3916 | return err |
| 3917 | } |
| 3918 | |
| 3919 | encoder.PutUint16(uint16(self.TableId)) |
| 3920 | encoder.Write(bytes.Repeat([]byte{0}, 2)) |
| 3921 | self.Checksum.Serialize(encoder) |
| 3922 | self.ChecksumMask.Serialize(encoder) |
| 3923 | length := len(encoder.Bytes()) - startIndex |
| 3924 | |
| 3925 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 3926 | |
| 3927 | return nil |
| 3928 | } |
| 3929 | |
| 3930 | func DecodeBsnGentableEntryStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnGentableEntryStatsRequest, error) { |
| 3931 | _bsngentableentrystatsrequest := &BsnGentableEntryStatsRequest{BsnStatsRequest: parent} |
| 3932 | if decoder.Length() < 36 { |
| 3933 | return nil, fmt.Errorf("BsnGentableEntryStatsRequest packet too short: %d < 36", decoder.Length()) |
| 3934 | } |
| 3935 | _bsngentableentrystatsrequest.TableId = uint16(decoder.ReadUint16()) |
| 3936 | decoder.Skip(2) |
| 3937 | _bsngentableentrystatsrequest.Checksum.Decode(decoder) |
| 3938 | _bsngentableentrystatsrequest.ChecksumMask.Decode(decoder) |
| 3939 | return _bsngentableentrystatsrequest, nil |
| 3940 | } |
| 3941 | |
| 3942 | func NewBsnGentableEntryStatsRequest() *BsnGentableEntryStatsRequest { |
| 3943 | obj := &BsnGentableEntryStatsRequest{ |
| 3944 | BsnStatsRequest: NewBsnStatsRequest(3), |
| 3945 | } |
| 3946 | return obj |
| 3947 | } |
| 3948 | |
| 3949 | type BsnGentableError struct { |
| 3950 | *BsnBaseError |
| 3951 | ErrorCode BsnGentableErrorCode |
| 3952 | TableId uint16 |
| 3953 | } |
| 3954 | |
| 3955 | type IBsnGentableError interface { |
| 3956 | IBsnBaseError |
| 3957 | GetErrorCode() BsnGentableErrorCode |
| 3958 | GetTableId() uint16 |
| 3959 | } |
| 3960 | |
| 3961 | func (self *BsnGentableError) GetErrorCode() BsnGentableErrorCode { |
| 3962 | return self.ErrorCode |
| 3963 | } |
| 3964 | |
| 3965 | func (self *BsnGentableError) SetErrorCode(v BsnGentableErrorCode) { |
| 3966 | self.ErrorCode = v |
| 3967 | } |
| 3968 | |
| 3969 | func (self *BsnGentableError) GetTableId() uint16 { |
| 3970 | return self.TableId |
| 3971 | } |
| 3972 | |
| 3973 | func (self *BsnGentableError) SetTableId(v uint16) { |
| 3974 | self.TableId = v |
| 3975 | } |
| 3976 | |
| 3977 | func (self *BsnGentableError) Serialize(encoder *goloxi.Encoder) error { |
| 3978 | startIndex := len(encoder.Bytes()) |
| 3979 | if err := self.BsnBaseError.Serialize(encoder); err != nil { |
| 3980 | return err |
| 3981 | } |
| 3982 | |
| 3983 | encoder.PutUint16(uint16(self.ErrorCode)) |
| 3984 | encoder.PutUint16(uint16(self.TableId)) |
| 3985 | length := len(encoder.Bytes()) - startIndex |
| 3986 | |
| 3987 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 3988 | |
| 3989 | return nil |
| 3990 | } |
| 3991 | |
| 3992 | func DecodeBsnGentableError(parent *BsnBaseError, decoder *goloxi.Decoder) (*BsnGentableError, error) { |
| 3993 | _bsngentableerror := &BsnGentableError{BsnBaseError: parent} |
| 3994 | if decoder.Length() < 260 { |
| 3995 | return nil, fmt.Errorf("BsnGentableError packet too short: %d < 260", decoder.Length()) |
| 3996 | } |
| 3997 | _bsngentableerror.ErrorCode = BsnGentableErrorCode(decoder.ReadUint16()) |
| 3998 | _bsngentableerror.TableId = uint16(decoder.ReadUint16()) |
| 3999 | return _bsngentableerror, nil |
| 4000 | } |
| 4001 | |
| 4002 | func NewBsnGentableError() *BsnGentableError { |
| 4003 | obj := &BsnGentableError{ |
| 4004 | BsnBaseError: NewBsnBaseError(2), |
| 4005 | } |
| 4006 | return obj |
| 4007 | } |
| 4008 | |
| 4009 | type BsnGentableSetBucketsSize struct { |
| 4010 | *BsnHeader |
| 4011 | TableId uint16 |
| 4012 | BucketsSize uint32 |
| 4013 | } |
| 4014 | |
| 4015 | type IBsnGentableSetBucketsSize interface { |
| 4016 | IBsnHeader |
| 4017 | GetTableId() uint16 |
| 4018 | GetBucketsSize() uint32 |
| 4019 | } |
| 4020 | |
| 4021 | func (self *BsnGentableSetBucketsSize) GetTableId() uint16 { |
| 4022 | return self.TableId |
| 4023 | } |
| 4024 | |
| 4025 | func (self *BsnGentableSetBucketsSize) SetTableId(v uint16) { |
| 4026 | self.TableId = v |
| 4027 | } |
| 4028 | |
| 4029 | func (self *BsnGentableSetBucketsSize) GetBucketsSize() uint32 { |
| 4030 | return self.BucketsSize |
| 4031 | } |
| 4032 | |
| 4033 | func (self *BsnGentableSetBucketsSize) SetBucketsSize(v uint32) { |
| 4034 | self.BucketsSize = v |
| 4035 | } |
| 4036 | |
| 4037 | func (self *BsnGentableSetBucketsSize) Serialize(encoder *goloxi.Encoder) error { |
| 4038 | startIndex := len(encoder.Bytes()) |
| 4039 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 4040 | return err |
| 4041 | } |
| 4042 | |
| 4043 | encoder.PutUint16(uint16(self.TableId)) |
| 4044 | encoder.Write(bytes.Repeat([]byte{0}, 2)) |
| 4045 | encoder.PutUint32(uint32(self.BucketsSize)) |
| 4046 | length := len(encoder.Bytes()) - startIndex |
| 4047 | |
| 4048 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4049 | |
| 4050 | return nil |
| 4051 | } |
| 4052 | |
| 4053 | func DecodeBsnGentableSetBucketsSize(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnGentableSetBucketsSize, error) { |
| 4054 | _bsngentablesetbucketssize := &BsnGentableSetBucketsSize{BsnHeader: parent} |
| 4055 | if decoder.Length() < 8 { |
| 4056 | return nil, fmt.Errorf("BsnGentableSetBucketsSize packet too short: %d < 8", decoder.Length()) |
| 4057 | } |
| 4058 | _bsngentablesetbucketssize.TableId = uint16(decoder.ReadUint16()) |
| 4059 | decoder.Skip(2) |
| 4060 | _bsngentablesetbucketssize.BucketsSize = uint32(decoder.ReadUint32()) |
| 4061 | return _bsngentablesetbucketssize, nil |
| 4062 | } |
| 4063 | |
| 4064 | func NewBsnGentableSetBucketsSize() *BsnGentableSetBucketsSize { |
| 4065 | obj := &BsnGentableSetBucketsSize{ |
| 4066 | BsnHeader: NewBsnHeader(50), |
| 4067 | } |
| 4068 | return obj |
| 4069 | } |
| 4070 | |
| 4071 | type BsnGentableStatsReply struct { |
| 4072 | *BsnStatsReply |
| 4073 | Entries []*BsnGentableStatsEntry |
| 4074 | } |
| 4075 | |
| 4076 | type IBsnGentableStatsReply interface { |
| 4077 | IBsnStatsReply |
| 4078 | GetEntries() []*BsnGentableStatsEntry |
| 4079 | } |
| 4080 | |
| 4081 | func (self *BsnGentableStatsReply) GetEntries() []*BsnGentableStatsEntry { |
| 4082 | return self.Entries |
| 4083 | } |
| 4084 | |
| 4085 | func (self *BsnGentableStatsReply) SetEntries(v []*BsnGentableStatsEntry) { |
| 4086 | self.Entries = v |
| 4087 | } |
| 4088 | |
| 4089 | func (self *BsnGentableStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 4090 | startIndex := len(encoder.Bytes()) |
| 4091 | if err := self.BsnStatsReply.Serialize(encoder); err != nil { |
| 4092 | return err |
| 4093 | } |
| 4094 | |
| 4095 | for _, obj := range self.Entries { |
| 4096 | if err := obj.Serialize(encoder); err != nil { |
| 4097 | return err |
| 4098 | } |
| 4099 | } |
| 4100 | length := len(encoder.Bytes()) - startIndex |
| 4101 | |
| 4102 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4103 | |
| 4104 | return nil |
| 4105 | } |
| 4106 | |
| 4107 | func DecodeBsnGentableStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnGentableStatsReply, error) { |
| 4108 | _bsngentablestatsreply := &BsnGentableStatsReply{BsnStatsReply: parent} |
| 4109 | |
| 4110 | for decoder.Length() >= 24 { |
| 4111 | item, err := DecodeBsnGentableStatsEntry(decoder) |
| 4112 | if err != nil { |
| 4113 | return nil, err |
| 4114 | } |
| 4115 | if item != nil { |
| 4116 | _bsngentablestatsreply.Entries = append(_bsngentablestatsreply.Entries, item) |
| 4117 | } |
| 4118 | } |
| 4119 | return _bsngentablestatsreply, nil |
| 4120 | } |
| 4121 | |
| 4122 | func NewBsnGentableStatsReply() *BsnGentableStatsReply { |
| 4123 | obj := &BsnGentableStatsReply{ |
| 4124 | BsnStatsReply: NewBsnStatsReply(7), |
| 4125 | } |
| 4126 | return obj |
| 4127 | } |
| 4128 | |
| 4129 | type BsnGentableStatsRequest struct { |
| 4130 | *BsnStatsRequest |
| 4131 | } |
| 4132 | |
| 4133 | type IBsnGentableStatsRequest interface { |
| 4134 | IBsnStatsRequest |
| 4135 | } |
| 4136 | |
| 4137 | func (self *BsnGentableStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 4138 | startIndex := len(encoder.Bytes()) |
| 4139 | if err := self.BsnStatsRequest.Serialize(encoder); err != nil { |
| 4140 | return err |
| 4141 | } |
| 4142 | length := len(encoder.Bytes()) - startIndex |
| 4143 | |
| 4144 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4145 | |
| 4146 | return nil |
| 4147 | } |
| 4148 | |
| 4149 | func DecodeBsnGentableStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnGentableStatsRequest, error) { |
| 4150 | _bsngentablestatsrequest := &BsnGentableStatsRequest{BsnStatsRequest: parent} |
| 4151 | return _bsngentablestatsrequest, nil |
| 4152 | } |
| 4153 | |
| 4154 | func NewBsnGentableStatsRequest() *BsnGentableStatsRequest { |
| 4155 | obj := &BsnGentableStatsRequest{ |
| 4156 | BsnStatsRequest: NewBsnStatsRequest(7), |
| 4157 | } |
| 4158 | return obj |
| 4159 | } |
| 4160 | |
| 4161 | type BsnGetInterfacesReply struct { |
| 4162 | *BsnHeader |
| 4163 | Interfaces []*BsnInterface |
| 4164 | } |
| 4165 | |
| 4166 | type IBsnGetInterfacesReply interface { |
| 4167 | IBsnHeader |
| 4168 | GetInterfaces() []*BsnInterface |
| 4169 | } |
| 4170 | |
| 4171 | func (self *BsnGetInterfacesReply) GetInterfaces() []*BsnInterface { |
| 4172 | return self.Interfaces |
| 4173 | } |
| 4174 | |
| 4175 | func (self *BsnGetInterfacesReply) SetInterfaces(v []*BsnInterface) { |
| 4176 | self.Interfaces = v |
| 4177 | } |
| 4178 | |
| 4179 | func (self *BsnGetInterfacesReply) Serialize(encoder *goloxi.Encoder) error { |
| 4180 | startIndex := len(encoder.Bytes()) |
| 4181 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 4182 | return err |
| 4183 | } |
| 4184 | |
| 4185 | for _, obj := range self.Interfaces { |
| 4186 | if err := obj.Serialize(encoder); err != nil { |
| 4187 | return err |
| 4188 | } |
| 4189 | } |
| 4190 | length := len(encoder.Bytes()) - startIndex |
| 4191 | |
| 4192 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4193 | |
| 4194 | return nil |
| 4195 | } |
| 4196 | |
| 4197 | func DecodeBsnGetInterfacesReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnGetInterfacesReply, error) { |
| 4198 | _bsngetinterfacesreply := &BsnGetInterfacesReply{BsnHeader: parent} |
| 4199 | |
| 4200 | for decoder.Length() >= 32 { |
| 4201 | item, err := DecodeBsnInterface(decoder) |
| 4202 | if err != nil { |
| 4203 | return nil, err |
| 4204 | } |
| 4205 | if item != nil { |
| 4206 | _bsngetinterfacesreply.Interfaces = append(_bsngetinterfacesreply.Interfaces, item) |
| 4207 | } |
| 4208 | } |
| 4209 | return _bsngetinterfacesreply, nil |
| 4210 | } |
| 4211 | |
| 4212 | func NewBsnGetInterfacesReply() *BsnGetInterfacesReply { |
| 4213 | obj := &BsnGetInterfacesReply{ |
| 4214 | BsnHeader: NewBsnHeader(10), |
| 4215 | } |
| 4216 | return obj |
| 4217 | } |
| 4218 | |
| 4219 | type BsnGetInterfacesRequest struct { |
| 4220 | *BsnHeader |
| 4221 | } |
| 4222 | |
| 4223 | type IBsnGetInterfacesRequest interface { |
| 4224 | IBsnHeader |
| 4225 | } |
| 4226 | |
| 4227 | func (self *BsnGetInterfacesRequest) Serialize(encoder *goloxi.Encoder) error { |
| 4228 | startIndex := len(encoder.Bytes()) |
| 4229 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 4230 | return err |
| 4231 | } |
| 4232 | length := len(encoder.Bytes()) - startIndex |
| 4233 | |
| 4234 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4235 | |
| 4236 | return nil |
| 4237 | } |
| 4238 | |
| 4239 | func DecodeBsnGetInterfacesRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnGetInterfacesRequest, error) { |
| 4240 | _bsngetinterfacesrequest := &BsnGetInterfacesRequest{BsnHeader: parent} |
| 4241 | return _bsngetinterfacesrequest, nil |
| 4242 | } |
| 4243 | |
| 4244 | func NewBsnGetInterfacesRequest() *BsnGetInterfacesRequest { |
| 4245 | obj := &BsnGetInterfacesRequest{ |
| 4246 | BsnHeader: NewBsnHeader(9), |
| 4247 | } |
| 4248 | return obj |
| 4249 | } |
| 4250 | |
| 4251 | type BsnGetMirroringReply struct { |
| 4252 | *BsnHeader |
| 4253 | ReportMirrorPorts uint8 |
| 4254 | } |
| 4255 | |
| 4256 | type IBsnGetMirroringReply interface { |
| 4257 | IBsnHeader |
| 4258 | GetReportMirrorPorts() uint8 |
| 4259 | } |
| 4260 | |
| 4261 | func (self *BsnGetMirroringReply) GetReportMirrorPorts() uint8 { |
| 4262 | return self.ReportMirrorPorts |
| 4263 | } |
| 4264 | |
| 4265 | func (self *BsnGetMirroringReply) SetReportMirrorPorts(v uint8) { |
| 4266 | self.ReportMirrorPorts = v |
| 4267 | } |
| 4268 | |
| 4269 | func (self *BsnGetMirroringReply) Serialize(encoder *goloxi.Encoder) error { |
| 4270 | startIndex := len(encoder.Bytes()) |
| 4271 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 4272 | return err |
| 4273 | } |
| 4274 | |
| 4275 | encoder.PutUint8(uint8(self.ReportMirrorPorts)) |
| 4276 | encoder.Write(bytes.Repeat([]byte{0}, 3)) |
| 4277 | length := len(encoder.Bytes()) - startIndex |
| 4278 | |
| 4279 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4280 | |
| 4281 | return nil |
| 4282 | } |
| 4283 | |
| 4284 | func DecodeBsnGetMirroringReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnGetMirroringReply, error) { |
| 4285 | _bsngetmirroringreply := &BsnGetMirroringReply{BsnHeader: parent} |
| 4286 | if decoder.Length() < 4 { |
| 4287 | return nil, fmt.Errorf("BsnGetMirroringReply packet too short: %d < 4", decoder.Length()) |
| 4288 | } |
| 4289 | _bsngetmirroringreply.ReportMirrorPorts = uint8(decoder.ReadByte()) |
| 4290 | decoder.Skip(3) |
| 4291 | return _bsngetmirroringreply, nil |
| 4292 | } |
| 4293 | |
| 4294 | func NewBsnGetMirroringReply() *BsnGetMirroringReply { |
| 4295 | obj := &BsnGetMirroringReply{ |
| 4296 | BsnHeader: NewBsnHeader(5), |
| 4297 | } |
| 4298 | return obj |
| 4299 | } |
| 4300 | |
| 4301 | type BsnGetMirroringRequest struct { |
| 4302 | *BsnHeader |
| 4303 | ReportMirrorPorts uint8 |
| 4304 | } |
| 4305 | |
| 4306 | type IBsnGetMirroringRequest interface { |
| 4307 | IBsnHeader |
| 4308 | GetReportMirrorPorts() uint8 |
| 4309 | } |
| 4310 | |
| 4311 | func (self *BsnGetMirroringRequest) GetReportMirrorPorts() uint8 { |
| 4312 | return self.ReportMirrorPorts |
| 4313 | } |
| 4314 | |
| 4315 | func (self *BsnGetMirroringRequest) SetReportMirrorPorts(v uint8) { |
| 4316 | self.ReportMirrorPorts = v |
| 4317 | } |
| 4318 | |
| 4319 | func (self *BsnGetMirroringRequest) Serialize(encoder *goloxi.Encoder) error { |
| 4320 | startIndex := len(encoder.Bytes()) |
| 4321 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 4322 | return err |
| 4323 | } |
| 4324 | |
| 4325 | encoder.PutUint8(uint8(self.ReportMirrorPorts)) |
| 4326 | encoder.Write(bytes.Repeat([]byte{0}, 3)) |
| 4327 | length := len(encoder.Bytes()) - startIndex |
| 4328 | |
| 4329 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4330 | |
| 4331 | return nil |
| 4332 | } |
| 4333 | |
| 4334 | func DecodeBsnGetMirroringRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnGetMirroringRequest, error) { |
| 4335 | _bsngetmirroringrequest := &BsnGetMirroringRequest{BsnHeader: parent} |
| 4336 | if decoder.Length() < 4 { |
| 4337 | return nil, fmt.Errorf("BsnGetMirroringRequest packet too short: %d < 4", decoder.Length()) |
| 4338 | } |
| 4339 | _bsngetmirroringrequest.ReportMirrorPorts = uint8(decoder.ReadByte()) |
| 4340 | decoder.Skip(3) |
| 4341 | return _bsngetmirroringrequest, nil |
| 4342 | } |
| 4343 | |
| 4344 | func NewBsnGetMirroringRequest() *BsnGetMirroringRequest { |
| 4345 | obj := &BsnGetMirroringRequest{ |
| 4346 | BsnHeader: NewBsnHeader(4), |
| 4347 | } |
| 4348 | return obj |
| 4349 | } |
| 4350 | |
| 4351 | type BsnGetSwitchPipelineReply struct { |
| 4352 | *BsnHeader |
| 4353 | Pipeline string |
| 4354 | } |
| 4355 | |
| 4356 | type IBsnGetSwitchPipelineReply interface { |
| 4357 | IBsnHeader |
| 4358 | GetPipeline() string |
| 4359 | } |
| 4360 | |
| 4361 | func (self *BsnGetSwitchPipelineReply) GetPipeline() string { |
| 4362 | return self.Pipeline |
| 4363 | } |
| 4364 | |
| 4365 | func (self *BsnGetSwitchPipelineReply) SetPipeline(v string) { |
| 4366 | self.Pipeline = v |
| 4367 | } |
| 4368 | |
| 4369 | func (self *BsnGetSwitchPipelineReply) Serialize(encoder *goloxi.Encoder) error { |
| 4370 | startIndex := len(encoder.Bytes()) |
| 4371 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 4372 | return err |
| 4373 | } |
| 4374 | |
| 4375 | encoder.Write([]byte(self.Pipeline)) |
| 4376 | length := len(encoder.Bytes()) - startIndex |
| 4377 | |
| 4378 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4379 | |
| 4380 | return nil |
| 4381 | } |
| 4382 | |
| 4383 | func DecodeBsnGetSwitchPipelineReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnGetSwitchPipelineReply, error) { |
| 4384 | _bsngetswitchpipelinereply := &BsnGetSwitchPipelineReply{BsnHeader: parent} |
| 4385 | if decoder.Length() < 256 { |
| 4386 | return nil, fmt.Errorf("BsnGetSwitchPipelineReply packet too short: %d < 256", decoder.Length()) |
| 4387 | } |
| 4388 | _bsngetswitchpipelinereply.Pipeline = string(bytes.Trim(decoder.Read(256), "\x00")) |
| 4389 | return _bsngetswitchpipelinereply, nil |
| 4390 | } |
| 4391 | |
| 4392 | func NewBsnGetSwitchPipelineReply() *BsnGetSwitchPipelineReply { |
| 4393 | obj := &BsnGetSwitchPipelineReply{ |
| 4394 | BsnHeader: NewBsnHeader(52), |
| 4395 | } |
| 4396 | return obj |
| 4397 | } |
| 4398 | |
| 4399 | type BsnGetSwitchPipelineRequest struct { |
| 4400 | *BsnHeader |
| 4401 | } |
| 4402 | |
| 4403 | type IBsnGetSwitchPipelineRequest interface { |
| 4404 | IBsnHeader |
| 4405 | } |
| 4406 | |
| 4407 | func (self *BsnGetSwitchPipelineRequest) Serialize(encoder *goloxi.Encoder) error { |
| 4408 | startIndex := len(encoder.Bytes()) |
| 4409 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 4410 | return err |
| 4411 | } |
| 4412 | length := len(encoder.Bytes()) - startIndex |
| 4413 | |
| 4414 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4415 | |
| 4416 | return nil |
| 4417 | } |
| 4418 | |
| 4419 | func DecodeBsnGetSwitchPipelineRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnGetSwitchPipelineRequest, error) { |
| 4420 | _bsngetswitchpipelinerequest := &BsnGetSwitchPipelineRequest{BsnHeader: parent} |
| 4421 | return _bsngetswitchpipelinerequest, nil |
| 4422 | } |
| 4423 | |
| 4424 | func NewBsnGetSwitchPipelineRequest() *BsnGetSwitchPipelineRequest { |
| 4425 | obj := &BsnGetSwitchPipelineRequest{ |
| 4426 | BsnHeader: NewBsnHeader(51), |
| 4427 | } |
| 4428 | return obj |
| 4429 | } |
| 4430 | |
| 4431 | type BsnImageDescStatsReply struct { |
| 4432 | *BsnStatsReply |
| 4433 | ImageChecksum string |
| 4434 | StartupConfigChecksum string |
| 4435 | } |
| 4436 | |
| 4437 | type IBsnImageDescStatsReply interface { |
| 4438 | IBsnStatsReply |
| 4439 | GetImageChecksum() string |
| 4440 | GetStartupConfigChecksum() string |
| 4441 | } |
| 4442 | |
| 4443 | func (self *BsnImageDescStatsReply) GetImageChecksum() string { |
| 4444 | return self.ImageChecksum |
| 4445 | } |
| 4446 | |
| 4447 | func (self *BsnImageDescStatsReply) SetImageChecksum(v string) { |
| 4448 | self.ImageChecksum = v |
| 4449 | } |
| 4450 | |
| 4451 | func (self *BsnImageDescStatsReply) GetStartupConfigChecksum() string { |
| 4452 | return self.StartupConfigChecksum |
| 4453 | } |
| 4454 | |
| 4455 | func (self *BsnImageDescStatsReply) SetStartupConfigChecksum(v string) { |
| 4456 | self.StartupConfigChecksum = v |
| 4457 | } |
| 4458 | |
| 4459 | func (self *BsnImageDescStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 4460 | startIndex := len(encoder.Bytes()) |
| 4461 | if err := self.BsnStatsReply.Serialize(encoder); err != nil { |
| 4462 | return err |
| 4463 | } |
| 4464 | |
| 4465 | encoder.Write([]byte(self.ImageChecksum)) |
| 4466 | encoder.Write([]byte(self.StartupConfigChecksum)) |
| 4467 | length := len(encoder.Bytes()) - startIndex |
| 4468 | |
| 4469 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4470 | |
| 4471 | return nil |
| 4472 | } |
| 4473 | |
| 4474 | func DecodeBsnImageDescStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnImageDescStatsReply, error) { |
| 4475 | _bsnimagedescstatsreply := &BsnImageDescStatsReply{BsnStatsReply: parent} |
| 4476 | if decoder.Length() < 512 { |
| 4477 | return nil, fmt.Errorf("BsnImageDescStatsReply packet too short: %d < 512", decoder.Length()) |
| 4478 | } |
| 4479 | _bsnimagedescstatsreply.ImageChecksum = string(bytes.Trim(decoder.Read(256), "\x00")) |
| 4480 | _bsnimagedescstatsreply.StartupConfigChecksum = string(bytes.Trim(decoder.Read(256), "\x00")) |
| 4481 | return _bsnimagedescstatsreply, nil |
| 4482 | } |
| 4483 | |
| 4484 | func NewBsnImageDescStatsReply() *BsnImageDescStatsReply { |
| 4485 | obj := &BsnImageDescStatsReply{ |
| 4486 | BsnStatsReply: NewBsnStatsReply(14), |
| 4487 | } |
| 4488 | return obj |
| 4489 | } |
| 4490 | |
| 4491 | type BsnImageDescStatsRequest struct { |
| 4492 | *BsnStatsRequest |
| 4493 | } |
| 4494 | |
| 4495 | type IBsnImageDescStatsRequest interface { |
| 4496 | IBsnStatsRequest |
| 4497 | } |
| 4498 | |
| 4499 | func (self *BsnImageDescStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 4500 | startIndex := len(encoder.Bytes()) |
| 4501 | if err := self.BsnStatsRequest.Serialize(encoder); err != nil { |
| 4502 | return err |
| 4503 | } |
| 4504 | length := len(encoder.Bytes()) - startIndex |
| 4505 | |
| 4506 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4507 | |
| 4508 | return nil |
| 4509 | } |
| 4510 | |
| 4511 | func DecodeBsnImageDescStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnImageDescStatsRequest, error) { |
| 4512 | _bsnimagedescstatsrequest := &BsnImageDescStatsRequest{BsnStatsRequest: parent} |
| 4513 | return _bsnimagedescstatsrequest, nil |
| 4514 | } |
| 4515 | |
| 4516 | func NewBsnImageDescStatsRequest() *BsnImageDescStatsRequest { |
| 4517 | obj := &BsnImageDescStatsRequest{ |
| 4518 | BsnStatsRequest: NewBsnStatsRequest(14), |
| 4519 | } |
| 4520 | return obj |
| 4521 | } |
| 4522 | |
| 4523 | type BsnLacpConvergenceNotif struct { |
| 4524 | *BsnHeader |
| 4525 | ConvergenceStatus uint8 |
| 4526 | PortNo Port |
| 4527 | ActorSysPriority uint16 |
| 4528 | ActorSysMac net.HardwareAddr |
| 4529 | ActorPortPriority uint16 |
| 4530 | ActorPortNum uint16 |
| 4531 | ActorKey uint16 |
| 4532 | PartnerSysPriority uint16 |
| 4533 | PartnerSysMac net.HardwareAddr |
| 4534 | PartnerPortPriority uint16 |
| 4535 | PartnerPortNum uint16 |
| 4536 | PartnerKey uint16 |
| 4537 | } |
| 4538 | |
| 4539 | type IBsnLacpConvergenceNotif interface { |
| 4540 | IBsnHeader |
| 4541 | GetConvergenceStatus() uint8 |
| 4542 | GetPortNo() Port |
| 4543 | GetActorSysPriority() uint16 |
| 4544 | GetActorSysMac() net.HardwareAddr |
| 4545 | GetActorPortPriority() uint16 |
| 4546 | GetActorPortNum() uint16 |
| 4547 | GetActorKey() uint16 |
| 4548 | GetPartnerSysPriority() uint16 |
| 4549 | GetPartnerSysMac() net.HardwareAddr |
| 4550 | GetPartnerPortPriority() uint16 |
| 4551 | GetPartnerPortNum() uint16 |
| 4552 | GetPartnerKey() uint16 |
| 4553 | } |
| 4554 | |
| 4555 | func (self *BsnLacpConvergenceNotif) GetConvergenceStatus() uint8 { |
| 4556 | return self.ConvergenceStatus |
| 4557 | } |
| 4558 | |
| 4559 | func (self *BsnLacpConvergenceNotif) SetConvergenceStatus(v uint8) { |
| 4560 | self.ConvergenceStatus = v |
| 4561 | } |
| 4562 | |
| 4563 | func (self *BsnLacpConvergenceNotif) GetPortNo() Port { |
| 4564 | return self.PortNo |
| 4565 | } |
| 4566 | |
| 4567 | func (self *BsnLacpConvergenceNotif) SetPortNo(v Port) { |
| 4568 | self.PortNo = v |
| 4569 | } |
| 4570 | |
| 4571 | func (self *BsnLacpConvergenceNotif) GetActorSysPriority() uint16 { |
| 4572 | return self.ActorSysPriority |
| 4573 | } |
| 4574 | |
| 4575 | func (self *BsnLacpConvergenceNotif) SetActorSysPriority(v uint16) { |
| 4576 | self.ActorSysPriority = v |
| 4577 | } |
| 4578 | |
| 4579 | func (self *BsnLacpConvergenceNotif) GetActorSysMac() net.HardwareAddr { |
| 4580 | return self.ActorSysMac |
| 4581 | } |
| 4582 | |
| 4583 | func (self *BsnLacpConvergenceNotif) SetActorSysMac(v net.HardwareAddr) { |
| 4584 | self.ActorSysMac = v |
| 4585 | } |
| 4586 | |
| 4587 | func (self *BsnLacpConvergenceNotif) GetActorPortPriority() uint16 { |
| 4588 | return self.ActorPortPriority |
| 4589 | } |
| 4590 | |
| 4591 | func (self *BsnLacpConvergenceNotif) SetActorPortPriority(v uint16) { |
| 4592 | self.ActorPortPriority = v |
| 4593 | } |
| 4594 | |
| 4595 | func (self *BsnLacpConvergenceNotif) GetActorPortNum() uint16 { |
| 4596 | return self.ActorPortNum |
| 4597 | } |
| 4598 | |
| 4599 | func (self *BsnLacpConvergenceNotif) SetActorPortNum(v uint16) { |
| 4600 | self.ActorPortNum = v |
| 4601 | } |
| 4602 | |
| 4603 | func (self *BsnLacpConvergenceNotif) GetActorKey() uint16 { |
| 4604 | return self.ActorKey |
| 4605 | } |
| 4606 | |
| 4607 | func (self *BsnLacpConvergenceNotif) SetActorKey(v uint16) { |
| 4608 | self.ActorKey = v |
| 4609 | } |
| 4610 | |
| 4611 | func (self *BsnLacpConvergenceNotif) GetPartnerSysPriority() uint16 { |
| 4612 | return self.PartnerSysPriority |
| 4613 | } |
| 4614 | |
| 4615 | func (self *BsnLacpConvergenceNotif) SetPartnerSysPriority(v uint16) { |
| 4616 | self.PartnerSysPriority = v |
| 4617 | } |
| 4618 | |
| 4619 | func (self *BsnLacpConvergenceNotif) GetPartnerSysMac() net.HardwareAddr { |
| 4620 | return self.PartnerSysMac |
| 4621 | } |
| 4622 | |
| 4623 | func (self *BsnLacpConvergenceNotif) SetPartnerSysMac(v net.HardwareAddr) { |
| 4624 | self.PartnerSysMac = v |
| 4625 | } |
| 4626 | |
| 4627 | func (self *BsnLacpConvergenceNotif) GetPartnerPortPriority() uint16 { |
| 4628 | return self.PartnerPortPriority |
| 4629 | } |
| 4630 | |
| 4631 | func (self *BsnLacpConvergenceNotif) SetPartnerPortPriority(v uint16) { |
| 4632 | self.PartnerPortPriority = v |
| 4633 | } |
| 4634 | |
| 4635 | func (self *BsnLacpConvergenceNotif) GetPartnerPortNum() uint16 { |
| 4636 | return self.PartnerPortNum |
| 4637 | } |
| 4638 | |
| 4639 | func (self *BsnLacpConvergenceNotif) SetPartnerPortNum(v uint16) { |
| 4640 | self.PartnerPortNum = v |
| 4641 | } |
| 4642 | |
| 4643 | func (self *BsnLacpConvergenceNotif) GetPartnerKey() uint16 { |
| 4644 | return self.PartnerKey |
| 4645 | } |
| 4646 | |
| 4647 | func (self *BsnLacpConvergenceNotif) SetPartnerKey(v uint16) { |
| 4648 | self.PartnerKey = v |
| 4649 | } |
| 4650 | |
| 4651 | func (self *BsnLacpConvergenceNotif) Serialize(encoder *goloxi.Encoder) error { |
| 4652 | startIndex := len(encoder.Bytes()) |
| 4653 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 4654 | return err |
| 4655 | } |
| 4656 | |
| 4657 | encoder.PutUint8(uint8(self.ConvergenceStatus)) |
| 4658 | encoder.Write(bytes.Repeat([]byte{0}, 3)) |
| 4659 | self.PortNo.Serialize(encoder) |
| 4660 | encoder.PutUint16(uint16(self.ActorSysPriority)) |
| 4661 | encoder.Write(self.ActorSysMac) |
| 4662 | encoder.PutUint16(uint16(self.ActorPortPriority)) |
| 4663 | encoder.PutUint16(uint16(self.ActorPortNum)) |
| 4664 | encoder.PutUint16(uint16(self.ActorKey)) |
| 4665 | encoder.PutUint16(uint16(self.PartnerSysPriority)) |
| 4666 | encoder.Write(self.PartnerSysMac) |
| 4667 | encoder.PutUint16(uint16(self.PartnerPortPriority)) |
| 4668 | encoder.PutUint16(uint16(self.PartnerPortNum)) |
| 4669 | encoder.PutUint16(uint16(self.PartnerKey)) |
| 4670 | length := len(encoder.Bytes()) - startIndex |
| 4671 | |
| 4672 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4673 | |
| 4674 | return nil |
| 4675 | } |
| 4676 | |
| 4677 | func DecodeBsnLacpConvergenceNotif(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnLacpConvergenceNotif, error) { |
| 4678 | _bsnlacpconvergencenotif := &BsnLacpConvergenceNotif{BsnHeader: parent} |
| 4679 | if decoder.Length() < 36 { |
| 4680 | return nil, fmt.Errorf("BsnLacpConvergenceNotif packet too short: %d < 36", decoder.Length()) |
| 4681 | } |
| 4682 | _bsnlacpconvergencenotif.ConvergenceStatus = uint8(decoder.ReadByte()) |
| 4683 | decoder.Skip(3) |
| 4684 | _bsnlacpconvergencenotif.PortNo.Decode(decoder) |
| 4685 | _bsnlacpconvergencenotif.ActorSysPriority = uint16(decoder.ReadUint16()) |
| 4686 | _bsnlacpconvergencenotif.ActorSysMac = net.HardwareAddr(decoder.Read(6)) |
| 4687 | _bsnlacpconvergencenotif.ActorPortPriority = uint16(decoder.ReadUint16()) |
| 4688 | _bsnlacpconvergencenotif.ActorPortNum = uint16(decoder.ReadUint16()) |
| 4689 | _bsnlacpconvergencenotif.ActorKey = uint16(decoder.ReadUint16()) |
| 4690 | _bsnlacpconvergencenotif.PartnerSysPriority = uint16(decoder.ReadUint16()) |
| 4691 | _bsnlacpconvergencenotif.PartnerSysMac = net.HardwareAddr(decoder.Read(6)) |
| 4692 | _bsnlacpconvergencenotif.PartnerPortPriority = uint16(decoder.ReadUint16()) |
| 4693 | _bsnlacpconvergencenotif.PartnerPortNum = uint16(decoder.ReadUint16()) |
| 4694 | _bsnlacpconvergencenotif.PartnerKey = uint16(decoder.ReadUint16()) |
| 4695 | return _bsnlacpconvergencenotif, nil |
| 4696 | } |
| 4697 | |
| 4698 | func NewBsnLacpConvergenceNotif() *BsnLacpConvergenceNotif { |
| 4699 | obj := &BsnLacpConvergenceNotif{ |
| 4700 | BsnHeader: NewBsnHeader(43), |
| 4701 | } |
| 4702 | return obj |
| 4703 | } |
| 4704 | |
| 4705 | type BsnLacpStatsReply struct { |
| 4706 | *BsnStatsReply |
| 4707 | Entries []*BsnLacpStatsEntry |
| 4708 | } |
| 4709 | |
| 4710 | type IBsnLacpStatsReply interface { |
| 4711 | IBsnStatsReply |
| 4712 | GetEntries() []*BsnLacpStatsEntry |
| 4713 | } |
| 4714 | |
| 4715 | func (self *BsnLacpStatsReply) GetEntries() []*BsnLacpStatsEntry { |
| 4716 | return self.Entries |
| 4717 | } |
| 4718 | |
| 4719 | func (self *BsnLacpStatsReply) SetEntries(v []*BsnLacpStatsEntry) { |
| 4720 | self.Entries = v |
| 4721 | } |
| 4722 | |
| 4723 | func (self *BsnLacpStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 4724 | startIndex := len(encoder.Bytes()) |
| 4725 | if err := self.BsnStatsReply.Serialize(encoder); err != nil { |
| 4726 | return err |
| 4727 | } |
| 4728 | |
| 4729 | for _, obj := range self.Entries { |
| 4730 | if err := obj.Serialize(encoder); err != nil { |
| 4731 | return err |
| 4732 | } |
| 4733 | } |
| 4734 | length := len(encoder.Bytes()) - startIndex |
| 4735 | |
| 4736 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4737 | |
| 4738 | return nil |
| 4739 | } |
| 4740 | |
| 4741 | func DecodeBsnLacpStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnLacpStatsReply, error) { |
| 4742 | _bsnlacpstatsreply := &BsnLacpStatsReply{BsnStatsReply: parent} |
| 4743 | |
| 4744 | for decoder.Length() >= 36 { |
| 4745 | item, err := DecodeBsnLacpStatsEntry(decoder) |
| 4746 | if err != nil { |
| 4747 | return nil, err |
| 4748 | } |
| 4749 | if item != nil { |
| 4750 | _bsnlacpstatsreply.Entries = append(_bsnlacpstatsreply.Entries, item) |
| 4751 | } |
| 4752 | } |
| 4753 | return _bsnlacpstatsreply, nil |
| 4754 | } |
| 4755 | |
| 4756 | func NewBsnLacpStatsReply() *BsnLacpStatsReply { |
| 4757 | obj := &BsnLacpStatsReply{ |
| 4758 | BsnStatsReply: NewBsnStatsReply(1), |
| 4759 | } |
| 4760 | return obj |
| 4761 | } |
| 4762 | |
| 4763 | type BsnLacpStatsRequest struct { |
| 4764 | *BsnStatsRequest |
| 4765 | } |
| 4766 | |
| 4767 | type IBsnLacpStatsRequest interface { |
| 4768 | IBsnStatsRequest |
| 4769 | } |
| 4770 | |
| 4771 | func (self *BsnLacpStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 4772 | startIndex := len(encoder.Bytes()) |
| 4773 | if err := self.BsnStatsRequest.Serialize(encoder); err != nil { |
| 4774 | return err |
| 4775 | } |
| 4776 | length := len(encoder.Bytes()) - startIndex |
| 4777 | |
| 4778 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4779 | |
| 4780 | return nil |
| 4781 | } |
| 4782 | |
| 4783 | func DecodeBsnLacpStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnLacpStatsRequest, error) { |
| 4784 | _bsnlacpstatsrequest := &BsnLacpStatsRequest{BsnStatsRequest: parent} |
| 4785 | return _bsnlacpstatsrequest, nil |
| 4786 | } |
| 4787 | |
| 4788 | func NewBsnLacpStatsRequest() *BsnLacpStatsRequest { |
| 4789 | obj := &BsnLacpStatsRequest{ |
| 4790 | BsnStatsRequest: NewBsnStatsRequest(1), |
| 4791 | } |
| 4792 | return obj |
| 4793 | } |
| 4794 | |
| 4795 | type BsnLog struct { |
| 4796 | *BsnHeader |
| 4797 | Loglevel BsnLoglevel |
| 4798 | Data []byte |
| 4799 | } |
| 4800 | |
| 4801 | type IBsnLog interface { |
| 4802 | IBsnHeader |
| 4803 | GetLoglevel() BsnLoglevel |
| 4804 | GetData() []byte |
| 4805 | } |
| 4806 | |
| 4807 | func (self *BsnLog) GetLoglevel() BsnLoglevel { |
| 4808 | return self.Loglevel |
| 4809 | } |
| 4810 | |
| 4811 | func (self *BsnLog) SetLoglevel(v BsnLoglevel) { |
| 4812 | self.Loglevel = v |
| 4813 | } |
| 4814 | |
| 4815 | func (self *BsnLog) GetData() []byte { |
| 4816 | return self.Data |
| 4817 | } |
| 4818 | |
| 4819 | func (self *BsnLog) SetData(v []byte) { |
| 4820 | self.Data = v |
| 4821 | } |
| 4822 | |
| 4823 | func (self *BsnLog) Serialize(encoder *goloxi.Encoder) error { |
| 4824 | startIndex := len(encoder.Bytes()) |
| 4825 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 4826 | return err |
| 4827 | } |
| 4828 | |
| 4829 | encoder.PutUint8(uint8(self.Loglevel)) |
| 4830 | encoder.Write(self.Data) |
| 4831 | length := len(encoder.Bytes()) - startIndex |
| 4832 | |
| 4833 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4834 | |
| 4835 | return nil |
| 4836 | } |
| 4837 | |
| 4838 | func DecodeBsnLog(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnLog, error) { |
| 4839 | _bsnlog := &BsnLog{BsnHeader: parent} |
| 4840 | if decoder.Length() < 1 { |
| 4841 | return nil, fmt.Errorf("BsnLog packet too short: %d < 1", decoder.Length()) |
| 4842 | } |
| 4843 | _bsnlog.Loglevel = BsnLoglevel(decoder.ReadByte()) |
| 4844 | _bsnlog.Data = decoder.Read(int(decoder.Length())) |
| 4845 | return _bsnlog, nil |
| 4846 | } |
| 4847 | |
| 4848 | func NewBsnLog() *BsnLog { |
| 4849 | obj := &BsnLog{ |
| 4850 | BsnHeader: NewBsnHeader(63), |
| 4851 | } |
| 4852 | return obj |
| 4853 | } |
| 4854 | |
| 4855 | type BsnLuaCommandReply struct { |
| 4856 | *BsnHeader |
| 4857 | Data []byte |
| 4858 | } |
| 4859 | |
| 4860 | type IBsnLuaCommandReply interface { |
| 4861 | IBsnHeader |
| 4862 | GetData() []byte |
| 4863 | } |
| 4864 | |
| 4865 | func (self *BsnLuaCommandReply) GetData() []byte { |
| 4866 | return self.Data |
| 4867 | } |
| 4868 | |
| 4869 | func (self *BsnLuaCommandReply) SetData(v []byte) { |
| 4870 | self.Data = v |
| 4871 | } |
| 4872 | |
| 4873 | func (self *BsnLuaCommandReply) Serialize(encoder *goloxi.Encoder) error { |
| 4874 | startIndex := len(encoder.Bytes()) |
| 4875 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 4876 | return err |
| 4877 | } |
| 4878 | |
| 4879 | encoder.Write(self.Data) |
| 4880 | length := len(encoder.Bytes()) - startIndex |
| 4881 | |
| 4882 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4883 | |
| 4884 | return nil |
| 4885 | } |
| 4886 | |
| 4887 | func DecodeBsnLuaCommandReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnLuaCommandReply, error) { |
| 4888 | _bsnluacommandreply := &BsnLuaCommandReply{BsnHeader: parent} |
| 4889 | _bsnluacommandreply.Data = decoder.Read(int(decoder.Length())) |
| 4890 | return _bsnluacommandreply, nil |
| 4891 | } |
| 4892 | |
| 4893 | func NewBsnLuaCommandReply() *BsnLuaCommandReply { |
| 4894 | obj := &BsnLuaCommandReply{ |
| 4895 | BsnHeader: NewBsnHeader(66), |
| 4896 | } |
| 4897 | return obj |
| 4898 | } |
| 4899 | |
| 4900 | type BsnLuaCommandRequest struct { |
| 4901 | *BsnHeader |
| 4902 | Data []byte |
| 4903 | } |
| 4904 | |
| 4905 | type IBsnLuaCommandRequest interface { |
| 4906 | IBsnHeader |
| 4907 | GetData() []byte |
| 4908 | } |
| 4909 | |
| 4910 | func (self *BsnLuaCommandRequest) GetData() []byte { |
| 4911 | return self.Data |
| 4912 | } |
| 4913 | |
| 4914 | func (self *BsnLuaCommandRequest) SetData(v []byte) { |
| 4915 | self.Data = v |
| 4916 | } |
| 4917 | |
| 4918 | func (self *BsnLuaCommandRequest) Serialize(encoder *goloxi.Encoder) error { |
| 4919 | startIndex := len(encoder.Bytes()) |
| 4920 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 4921 | return err |
| 4922 | } |
| 4923 | |
| 4924 | encoder.Write(self.Data) |
| 4925 | length := len(encoder.Bytes()) - startIndex |
| 4926 | |
| 4927 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4928 | |
| 4929 | return nil |
| 4930 | } |
| 4931 | |
| 4932 | func DecodeBsnLuaCommandRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnLuaCommandRequest, error) { |
| 4933 | _bsnluacommandrequest := &BsnLuaCommandRequest{BsnHeader: parent} |
| 4934 | _bsnluacommandrequest.Data = decoder.Read(int(decoder.Length())) |
| 4935 | return _bsnluacommandrequest, nil |
| 4936 | } |
| 4937 | |
| 4938 | func NewBsnLuaCommandRequest() *BsnLuaCommandRequest { |
| 4939 | obj := &BsnLuaCommandRequest{ |
| 4940 | BsnHeader: NewBsnHeader(65), |
| 4941 | } |
| 4942 | return obj |
| 4943 | } |
| 4944 | |
| 4945 | type BsnLuaNotification struct { |
| 4946 | *BsnHeader |
| 4947 | Data []byte |
| 4948 | } |
| 4949 | |
| 4950 | type IBsnLuaNotification interface { |
| 4951 | IBsnHeader |
| 4952 | GetData() []byte |
| 4953 | } |
| 4954 | |
| 4955 | func (self *BsnLuaNotification) GetData() []byte { |
| 4956 | return self.Data |
| 4957 | } |
| 4958 | |
| 4959 | func (self *BsnLuaNotification) SetData(v []byte) { |
| 4960 | self.Data = v |
| 4961 | } |
| 4962 | |
| 4963 | func (self *BsnLuaNotification) Serialize(encoder *goloxi.Encoder) error { |
| 4964 | startIndex := len(encoder.Bytes()) |
| 4965 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 4966 | return err |
| 4967 | } |
| 4968 | |
| 4969 | encoder.Write(self.Data) |
| 4970 | length := len(encoder.Bytes()) - startIndex |
| 4971 | |
| 4972 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 4973 | |
| 4974 | return nil |
| 4975 | } |
| 4976 | |
| 4977 | func DecodeBsnLuaNotification(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnLuaNotification, error) { |
| 4978 | _bsnluanotification := &BsnLuaNotification{BsnHeader: parent} |
| 4979 | _bsnluanotification.Data = decoder.Read(int(decoder.Length())) |
| 4980 | return _bsnluanotification, nil |
| 4981 | } |
| 4982 | |
| 4983 | func NewBsnLuaNotification() *BsnLuaNotification { |
| 4984 | obj := &BsnLuaNotification{ |
| 4985 | BsnHeader: NewBsnHeader(67), |
| 4986 | } |
| 4987 | return obj |
| 4988 | } |
| 4989 | |
| 4990 | type BsnLuaUpload struct { |
| 4991 | *BsnHeader |
| 4992 | Flags BsnLuaUploadFlags |
| 4993 | Filename string |
| 4994 | Data []byte |
| 4995 | } |
| 4996 | |
| 4997 | type IBsnLuaUpload interface { |
| 4998 | IBsnHeader |
| 4999 | GetFlags() BsnLuaUploadFlags |
| 5000 | GetFilename() string |
| 5001 | GetData() []byte |
| 5002 | } |
| 5003 | |
| 5004 | func (self *BsnLuaUpload) GetFlags() BsnLuaUploadFlags { |
| 5005 | return self.Flags |
| 5006 | } |
| 5007 | |
| 5008 | func (self *BsnLuaUpload) SetFlags(v BsnLuaUploadFlags) { |
| 5009 | self.Flags = v |
| 5010 | } |
| 5011 | |
| 5012 | func (self *BsnLuaUpload) GetFilename() string { |
| 5013 | return self.Filename |
| 5014 | } |
| 5015 | |
| 5016 | func (self *BsnLuaUpload) SetFilename(v string) { |
| 5017 | self.Filename = v |
| 5018 | } |
| 5019 | |
| 5020 | func (self *BsnLuaUpload) GetData() []byte { |
| 5021 | return self.Data |
| 5022 | } |
| 5023 | |
| 5024 | func (self *BsnLuaUpload) SetData(v []byte) { |
| 5025 | self.Data = v |
| 5026 | } |
| 5027 | |
| 5028 | func (self *BsnLuaUpload) Serialize(encoder *goloxi.Encoder) error { |
| 5029 | startIndex := len(encoder.Bytes()) |
| 5030 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 5031 | return err |
| 5032 | } |
| 5033 | |
| 5034 | encoder.PutUint16(uint16(self.Flags)) |
| 5035 | encoder.Write([]byte(self.Filename)) |
| 5036 | encoder.Write(self.Data) |
| 5037 | length := len(encoder.Bytes()) - startIndex |
| 5038 | |
| 5039 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 5040 | |
| 5041 | return nil |
| 5042 | } |
| 5043 | |
| 5044 | func DecodeBsnLuaUpload(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnLuaUpload, error) { |
| 5045 | _bsnluaupload := &BsnLuaUpload{BsnHeader: parent} |
| 5046 | if decoder.Length() < 66 { |
| 5047 | return nil, fmt.Errorf("BsnLuaUpload packet too short: %d < 66", decoder.Length()) |
| 5048 | } |
| 5049 | _bsnluaupload.Flags = BsnLuaUploadFlags(decoder.ReadUint16()) |
| 5050 | _bsnluaupload.Filename = string(bytes.Trim(decoder.Read(64), "\x00")) |
| 5051 | _bsnluaupload.Data = decoder.Read(int(decoder.Length())) |
| 5052 | return _bsnluaupload, nil |
| 5053 | } |
| 5054 | |
| 5055 | func NewBsnLuaUpload() *BsnLuaUpload { |
| 5056 | obj := &BsnLuaUpload{ |
| 5057 | BsnHeader: NewBsnHeader(64), |
| 5058 | } |
| 5059 | return obj |
| 5060 | } |
| 5061 | |
| 5062 | type BsnPduRxReply struct { |
| 5063 | *BsnHeader |
| 5064 | Status uint32 |
| 5065 | PortNo Port |
| 5066 | SlotNum uint8 |
| 5067 | } |
| 5068 | |
| 5069 | type IBsnPduRxReply interface { |
| 5070 | IBsnHeader |
| 5071 | GetStatus() uint32 |
| 5072 | GetPortNo() Port |
| 5073 | GetSlotNum() uint8 |
| 5074 | } |
| 5075 | |
| 5076 | func (self *BsnPduRxReply) GetStatus() uint32 { |
| 5077 | return self.Status |
| 5078 | } |
| 5079 | |
| 5080 | func (self *BsnPduRxReply) SetStatus(v uint32) { |
| 5081 | self.Status = v |
| 5082 | } |
| 5083 | |
| 5084 | func (self *BsnPduRxReply) GetPortNo() Port { |
| 5085 | return self.PortNo |
| 5086 | } |
| 5087 | |
| 5088 | func (self *BsnPduRxReply) SetPortNo(v Port) { |
| 5089 | self.PortNo = v |
| 5090 | } |
| 5091 | |
| 5092 | func (self *BsnPduRxReply) GetSlotNum() uint8 { |
| 5093 | return self.SlotNum |
| 5094 | } |
| 5095 | |
| 5096 | func (self *BsnPduRxReply) SetSlotNum(v uint8) { |
| 5097 | self.SlotNum = v |
| 5098 | } |
| 5099 | |
| 5100 | func (self *BsnPduRxReply) Serialize(encoder *goloxi.Encoder) error { |
| 5101 | startIndex := len(encoder.Bytes()) |
| 5102 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 5103 | return err |
| 5104 | } |
| 5105 | |
| 5106 | encoder.PutUint32(uint32(self.Status)) |
| 5107 | self.PortNo.Serialize(encoder) |
| 5108 | encoder.PutUint8(uint8(self.SlotNum)) |
| 5109 | length := len(encoder.Bytes()) - startIndex |
| 5110 | |
| 5111 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 5112 | |
| 5113 | return nil |
| 5114 | } |
| 5115 | |
| 5116 | func DecodeBsnPduRxReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnPduRxReply, error) { |
| 5117 | _bsnpdurxreply := &BsnPduRxReply{BsnHeader: parent} |
| 5118 | if decoder.Length() < 9 { |
| 5119 | return nil, fmt.Errorf("BsnPduRxReply packet too short: %d < 9", decoder.Length()) |
| 5120 | } |
| 5121 | _bsnpdurxreply.Status = uint32(decoder.ReadUint32()) |
| 5122 | _bsnpdurxreply.PortNo.Decode(decoder) |
| 5123 | _bsnpdurxreply.SlotNum = uint8(decoder.ReadByte()) |
| 5124 | return _bsnpdurxreply, nil |
| 5125 | } |
| 5126 | |
| 5127 | func NewBsnPduRxReply() *BsnPduRxReply { |
| 5128 | obj := &BsnPduRxReply{ |
| 5129 | BsnHeader: NewBsnHeader(34), |
| 5130 | } |
| 5131 | return obj |
| 5132 | } |
| 5133 | |
| 5134 | type BsnPduRxRequest struct { |
| 5135 | *BsnHeader |
| 5136 | TimeoutMs uint32 |
| 5137 | PortNo Port |
| 5138 | SlotNum uint8 |
| 5139 | Data []byte |
| 5140 | } |
| 5141 | |
| 5142 | type IBsnPduRxRequest interface { |
| 5143 | IBsnHeader |
| 5144 | GetTimeoutMs() uint32 |
| 5145 | GetPortNo() Port |
| 5146 | GetSlotNum() uint8 |
| 5147 | GetData() []byte |
| 5148 | } |
| 5149 | |
| 5150 | func (self *BsnPduRxRequest) GetTimeoutMs() uint32 { |
| 5151 | return self.TimeoutMs |
| 5152 | } |
| 5153 | |
| 5154 | func (self *BsnPduRxRequest) SetTimeoutMs(v uint32) { |
| 5155 | self.TimeoutMs = v |
| 5156 | } |
| 5157 | |
| 5158 | func (self *BsnPduRxRequest) GetPortNo() Port { |
| 5159 | return self.PortNo |
| 5160 | } |
| 5161 | |
| 5162 | func (self *BsnPduRxRequest) SetPortNo(v Port) { |
| 5163 | self.PortNo = v |
| 5164 | } |
| 5165 | |
| 5166 | func (self *BsnPduRxRequest) GetSlotNum() uint8 { |
| 5167 | return self.SlotNum |
| 5168 | } |
| 5169 | |
| 5170 | func (self *BsnPduRxRequest) SetSlotNum(v uint8) { |
| 5171 | self.SlotNum = v |
| 5172 | } |
| 5173 | |
| 5174 | func (self *BsnPduRxRequest) GetData() []byte { |
| 5175 | return self.Data |
| 5176 | } |
| 5177 | |
| 5178 | func (self *BsnPduRxRequest) SetData(v []byte) { |
| 5179 | self.Data = v |
| 5180 | } |
| 5181 | |
| 5182 | func (self *BsnPduRxRequest) Serialize(encoder *goloxi.Encoder) error { |
| 5183 | startIndex := len(encoder.Bytes()) |
| 5184 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 5185 | return err |
| 5186 | } |
| 5187 | |
| 5188 | encoder.PutUint32(uint32(self.TimeoutMs)) |
| 5189 | self.PortNo.Serialize(encoder) |
| 5190 | encoder.PutUint8(uint8(self.SlotNum)) |
| 5191 | encoder.Write(bytes.Repeat([]byte{0}, 3)) |
| 5192 | encoder.Write(self.Data) |
| 5193 | length := len(encoder.Bytes()) - startIndex |
| 5194 | |
| 5195 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 5196 | |
| 5197 | return nil |
| 5198 | } |
| 5199 | |
| 5200 | func DecodeBsnPduRxRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnPduRxRequest, error) { |
| 5201 | _bsnpdurxrequest := &BsnPduRxRequest{BsnHeader: parent} |
| 5202 | if decoder.Length() < 12 { |
| 5203 | return nil, fmt.Errorf("BsnPduRxRequest packet too short: %d < 12", decoder.Length()) |
| 5204 | } |
| 5205 | _bsnpdurxrequest.TimeoutMs = uint32(decoder.ReadUint32()) |
| 5206 | _bsnpdurxrequest.PortNo.Decode(decoder) |
| 5207 | _bsnpdurxrequest.SlotNum = uint8(decoder.ReadByte()) |
| 5208 | decoder.Skip(3) |
| 5209 | _bsnpdurxrequest.Data = decoder.Read(int(decoder.Length())) |
| 5210 | return _bsnpdurxrequest, nil |
| 5211 | } |
| 5212 | |
| 5213 | func NewBsnPduRxRequest() *BsnPduRxRequest { |
| 5214 | obj := &BsnPduRxRequest{ |
| 5215 | BsnHeader: NewBsnHeader(33), |
| 5216 | } |
| 5217 | return obj |
| 5218 | } |
| 5219 | |
| 5220 | type BsnPduRxTimeout struct { |
| 5221 | *BsnHeader |
| 5222 | PortNo Port |
| 5223 | SlotNum uint8 |
| 5224 | } |
| 5225 | |
| 5226 | type IBsnPduRxTimeout interface { |
| 5227 | IBsnHeader |
| 5228 | GetPortNo() Port |
| 5229 | GetSlotNum() uint8 |
| 5230 | } |
| 5231 | |
| 5232 | func (self *BsnPduRxTimeout) GetPortNo() Port { |
| 5233 | return self.PortNo |
| 5234 | } |
| 5235 | |
| 5236 | func (self *BsnPduRxTimeout) SetPortNo(v Port) { |
| 5237 | self.PortNo = v |
| 5238 | } |
| 5239 | |
| 5240 | func (self *BsnPduRxTimeout) GetSlotNum() uint8 { |
| 5241 | return self.SlotNum |
| 5242 | } |
| 5243 | |
| 5244 | func (self *BsnPduRxTimeout) SetSlotNum(v uint8) { |
| 5245 | self.SlotNum = v |
| 5246 | } |
| 5247 | |
| 5248 | func (self *BsnPduRxTimeout) Serialize(encoder *goloxi.Encoder) error { |
| 5249 | startIndex := len(encoder.Bytes()) |
| 5250 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 5251 | return err |
| 5252 | } |
| 5253 | |
| 5254 | self.PortNo.Serialize(encoder) |
| 5255 | encoder.PutUint8(uint8(self.SlotNum)) |
| 5256 | length := len(encoder.Bytes()) - startIndex |
| 5257 | |
| 5258 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 5259 | |
| 5260 | return nil |
| 5261 | } |
| 5262 | |
| 5263 | func DecodeBsnPduRxTimeout(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnPduRxTimeout, error) { |
| 5264 | _bsnpdurxtimeout := &BsnPduRxTimeout{BsnHeader: parent} |
| 5265 | if decoder.Length() < 5 { |
| 5266 | return nil, fmt.Errorf("BsnPduRxTimeout packet too short: %d < 5", decoder.Length()) |
| 5267 | } |
| 5268 | _bsnpdurxtimeout.PortNo.Decode(decoder) |
| 5269 | _bsnpdurxtimeout.SlotNum = uint8(decoder.ReadByte()) |
| 5270 | return _bsnpdurxtimeout, nil |
| 5271 | } |
| 5272 | |
| 5273 | func NewBsnPduRxTimeout() *BsnPduRxTimeout { |
| 5274 | obj := &BsnPduRxTimeout{ |
| 5275 | BsnHeader: NewBsnHeader(35), |
| 5276 | } |
| 5277 | return obj |
| 5278 | } |
| 5279 | |
| 5280 | type BsnPduTxReply struct { |
| 5281 | *BsnHeader |
| 5282 | Status uint32 |
| 5283 | PortNo Port |
| 5284 | SlotNum uint8 |
| 5285 | } |
| 5286 | |
| 5287 | type IBsnPduTxReply interface { |
| 5288 | IBsnHeader |
| 5289 | GetStatus() uint32 |
| 5290 | GetPortNo() Port |
| 5291 | GetSlotNum() uint8 |
| 5292 | } |
| 5293 | |
| 5294 | func (self *BsnPduTxReply) GetStatus() uint32 { |
| 5295 | return self.Status |
| 5296 | } |
| 5297 | |
| 5298 | func (self *BsnPduTxReply) SetStatus(v uint32) { |
| 5299 | self.Status = v |
| 5300 | } |
| 5301 | |
| 5302 | func (self *BsnPduTxReply) GetPortNo() Port { |
| 5303 | return self.PortNo |
| 5304 | } |
| 5305 | |
| 5306 | func (self *BsnPduTxReply) SetPortNo(v Port) { |
| 5307 | self.PortNo = v |
| 5308 | } |
| 5309 | |
| 5310 | func (self *BsnPduTxReply) GetSlotNum() uint8 { |
| 5311 | return self.SlotNum |
| 5312 | } |
| 5313 | |
| 5314 | func (self *BsnPduTxReply) SetSlotNum(v uint8) { |
| 5315 | self.SlotNum = v |
| 5316 | } |
| 5317 | |
| 5318 | func (self *BsnPduTxReply) Serialize(encoder *goloxi.Encoder) error { |
| 5319 | startIndex := len(encoder.Bytes()) |
| 5320 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 5321 | return err |
| 5322 | } |
| 5323 | |
| 5324 | encoder.PutUint32(uint32(self.Status)) |
| 5325 | self.PortNo.Serialize(encoder) |
| 5326 | encoder.PutUint8(uint8(self.SlotNum)) |
| 5327 | length := len(encoder.Bytes()) - startIndex |
| 5328 | |
| 5329 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 5330 | |
| 5331 | return nil |
| 5332 | } |
| 5333 | |
| 5334 | func DecodeBsnPduTxReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnPduTxReply, error) { |
| 5335 | _bsnpdutxreply := &BsnPduTxReply{BsnHeader: parent} |
| 5336 | if decoder.Length() < 9 { |
| 5337 | return nil, fmt.Errorf("BsnPduTxReply packet too short: %d < 9", decoder.Length()) |
| 5338 | } |
| 5339 | _bsnpdutxreply.Status = uint32(decoder.ReadUint32()) |
| 5340 | _bsnpdutxreply.PortNo.Decode(decoder) |
| 5341 | _bsnpdutxreply.SlotNum = uint8(decoder.ReadByte()) |
| 5342 | return _bsnpdutxreply, nil |
| 5343 | } |
| 5344 | |
| 5345 | func NewBsnPduTxReply() *BsnPduTxReply { |
| 5346 | obj := &BsnPduTxReply{ |
| 5347 | BsnHeader: NewBsnHeader(32), |
| 5348 | } |
| 5349 | return obj |
| 5350 | } |
| 5351 | |
| 5352 | type BsnPduTxRequest struct { |
| 5353 | *BsnHeader |
| 5354 | TxIntervalMs uint32 |
| 5355 | PortNo Port |
| 5356 | SlotNum uint8 |
| 5357 | Data []byte |
| 5358 | } |
| 5359 | |
| 5360 | type IBsnPduTxRequest interface { |
| 5361 | IBsnHeader |
| 5362 | GetTxIntervalMs() uint32 |
| 5363 | GetPortNo() Port |
| 5364 | GetSlotNum() uint8 |
| 5365 | GetData() []byte |
| 5366 | } |
| 5367 | |
| 5368 | func (self *BsnPduTxRequest) GetTxIntervalMs() uint32 { |
| 5369 | return self.TxIntervalMs |
| 5370 | } |
| 5371 | |
| 5372 | func (self *BsnPduTxRequest) SetTxIntervalMs(v uint32) { |
| 5373 | self.TxIntervalMs = v |
| 5374 | } |
| 5375 | |
| 5376 | func (self *BsnPduTxRequest) GetPortNo() Port { |
| 5377 | return self.PortNo |
| 5378 | } |
| 5379 | |
| 5380 | func (self *BsnPduTxRequest) SetPortNo(v Port) { |
| 5381 | self.PortNo = v |
| 5382 | } |
| 5383 | |
| 5384 | func (self *BsnPduTxRequest) GetSlotNum() uint8 { |
| 5385 | return self.SlotNum |
| 5386 | } |
| 5387 | |
| 5388 | func (self *BsnPduTxRequest) SetSlotNum(v uint8) { |
| 5389 | self.SlotNum = v |
| 5390 | } |
| 5391 | |
| 5392 | func (self *BsnPduTxRequest) GetData() []byte { |
| 5393 | return self.Data |
| 5394 | } |
| 5395 | |
| 5396 | func (self *BsnPduTxRequest) SetData(v []byte) { |
| 5397 | self.Data = v |
| 5398 | } |
| 5399 | |
| 5400 | func (self *BsnPduTxRequest) Serialize(encoder *goloxi.Encoder) error { |
| 5401 | startIndex := len(encoder.Bytes()) |
| 5402 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 5403 | return err |
| 5404 | } |
| 5405 | |
| 5406 | encoder.PutUint32(uint32(self.TxIntervalMs)) |
| 5407 | self.PortNo.Serialize(encoder) |
| 5408 | encoder.PutUint8(uint8(self.SlotNum)) |
| 5409 | encoder.Write(bytes.Repeat([]byte{0}, 3)) |
| 5410 | encoder.Write(self.Data) |
| 5411 | length := len(encoder.Bytes()) - startIndex |
| 5412 | |
| 5413 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 5414 | |
| 5415 | return nil |
| 5416 | } |
| 5417 | |
| 5418 | func DecodeBsnPduTxRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnPduTxRequest, error) { |
| 5419 | _bsnpdutxrequest := &BsnPduTxRequest{BsnHeader: parent} |
| 5420 | if decoder.Length() < 12 { |
| 5421 | return nil, fmt.Errorf("BsnPduTxRequest packet too short: %d < 12", decoder.Length()) |
| 5422 | } |
| 5423 | _bsnpdutxrequest.TxIntervalMs = uint32(decoder.ReadUint32()) |
| 5424 | _bsnpdutxrequest.PortNo.Decode(decoder) |
| 5425 | _bsnpdutxrequest.SlotNum = uint8(decoder.ReadByte()) |
| 5426 | decoder.Skip(3) |
| 5427 | _bsnpdutxrequest.Data = decoder.Read(int(decoder.Length())) |
| 5428 | return _bsnpdutxrequest, nil |
| 5429 | } |
| 5430 | |
| 5431 | func NewBsnPduTxRequest() *BsnPduTxRequest { |
| 5432 | obj := &BsnPduTxRequest{ |
| 5433 | BsnHeader: NewBsnHeader(31), |
| 5434 | } |
| 5435 | return obj |
| 5436 | } |
| 5437 | |
| 5438 | type BsnPortCounterStatsReply struct { |
| 5439 | *BsnStatsReply |
| 5440 | Entries []*BsnPortCounterStatsEntry |
| 5441 | } |
| 5442 | |
| 5443 | type IBsnPortCounterStatsReply interface { |
| 5444 | IBsnStatsReply |
| 5445 | GetEntries() []*BsnPortCounterStatsEntry |
| 5446 | } |
| 5447 | |
| 5448 | func (self *BsnPortCounterStatsReply) GetEntries() []*BsnPortCounterStatsEntry { |
| 5449 | return self.Entries |
| 5450 | } |
| 5451 | |
| 5452 | func (self *BsnPortCounterStatsReply) SetEntries(v []*BsnPortCounterStatsEntry) { |
| 5453 | self.Entries = v |
| 5454 | } |
| 5455 | |
| 5456 | func (self *BsnPortCounterStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 5457 | startIndex := len(encoder.Bytes()) |
| 5458 | if err := self.BsnStatsReply.Serialize(encoder); err != nil { |
| 5459 | return err |
| 5460 | } |
| 5461 | |
| 5462 | for _, obj := range self.Entries { |
| 5463 | if err := obj.Serialize(encoder); err != nil { |
| 5464 | return err |
| 5465 | } |
| 5466 | } |
| 5467 | length := len(encoder.Bytes()) - startIndex |
| 5468 | |
| 5469 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 5470 | |
| 5471 | return nil |
| 5472 | } |
| 5473 | |
| 5474 | func DecodeBsnPortCounterStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnPortCounterStatsReply, error) { |
| 5475 | _bsnportcounterstatsreply := &BsnPortCounterStatsReply{BsnStatsReply: parent} |
| 5476 | |
| 5477 | for decoder.Length() >= 8 { |
| 5478 | item, err := DecodeBsnPortCounterStatsEntry(decoder) |
| 5479 | if err != nil { |
| 5480 | return nil, err |
| 5481 | } |
| 5482 | if item != nil { |
| 5483 | _bsnportcounterstatsreply.Entries = append(_bsnportcounterstatsreply.Entries, item) |
| 5484 | } |
| 5485 | } |
| 5486 | return _bsnportcounterstatsreply, nil |
| 5487 | } |
| 5488 | |
| 5489 | func NewBsnPortCounterStatsReply() *BsnPortCounterStatsReply { |
| 5490 | obj := &BsnPortCounterStatsReply{ |
| 5491 | BsnStatsReply: NewBsnStatsReply(8), |
| 5492 | } |
| 5493 | return obj |
| 5494 | } |
| 5495 | |
| 5496 | type BsnPortCounterStatsRequest struct { |
| 5497 | *BsnStatsRequest |
| 5498 | PortNo Port |
| 5499 | } |
| 5500 | |
| 5501 | type IBsnPortCounterStatsRequest interface { |
| 5502 | IBsnStatsRequest |
| 5503 | GetPortNo() Port |
| 5504 | } |
| 5505 | |
| 5506 | func (self *BsnPortCounterStatsRequest) GetPortNo() Port { |
| 5507 | return self.PortNo |
| 5508 | } |
| 5509 | |
| 5510 | func (self *BsnPortCounterStatsRequest) SetPortNo(v Port) { |
| 5511 | self.PortNo = v |
| 5512 | } |
| 5513 | |
| 5514 | func (self *BsnPortCounterStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 5515 | startIndex := len(encoder.Bytes()) |
| 5516 | if err := self.BsnStatsRequest.Serialize(encoder); err != nil { |
| 5517 | return err |
| 5518 | } |
| 5519 | |
| 5520 | self.PortNo.Serialize(encoder) |
| 5521 | length := len(encoder.Bytes()) - startIndex |
| 5522 | |
| 5523 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 5524 | |
| 5525 | return nil |
| 5526 | } |
| 5527 | |
| 5528 | func DecodeBsnPortCounterStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnPortCounterStatsRequest, error) { |
| 5529 | _bsnportcounterstatsrequest := &BsnPortCounterStatsRequest{BsnStatsRequest: parent} |
| 5530 | if decoder.Length() < 4 { |
| 5531 | return nil, fmt.Errorf("BsnPortCounterStatsRequest packet too short: %d < 4", decoder.Length()) |
| 5532 | } |
| 5533 | _bsnportcounterstatsrequest.PortNo.Decode(decoder) |
| 5534 | return _bsnportcounterstatsrequest, nil |
| 5535 | } |
| 5536 | |
| 5537 | func NewBsnPortCounterStatsRequest() *BsnPortCounterStatsRequest { |
| 5538 | obj := &BsnPortCounterStatsRequest{ |
| 5539 | BsnStatsRequest: NewBsnStatsRequest(8), |
| 5540 | } |
| 5541 | return obj |
| 5542 | } |
| 5543 | |
| 5544 | type BsnSetAuxCxnsReply struct { |
| 5545 | *BsnHeader |
| 5546 | NumAux uint32 |
| 5547 | Status uint32 |
| 5548 | } |
| 5549 | |
| 5550 | type IBsnSetAuxCxnsReply interface { |
| 5551 | IBsnHeader |
| 5552 | GetNumAux() uint32 |
| 5553 | GetStatus() uint32 |
| 5554 | } |
| 5555 | |
| 5556 | func (self *BsnSetAuxCxnsReply) GetNumAux() uint32 { |
| 5557 | return self.NumAux |
| 5558 | } |
| 5559 | |
| 5560 | func (self *BsnSetAuxCxnsReply) SetNumAux(v uint32) { |
| 5561 | self.NumAux = v |
| 5562 | } |
| 5563 | |
| 5564 | func (self *BsnSetAuxCxnsReply) GetStatus() uint32 { |
| 5565 | return self.Status |
| 5566 | } |
| 5567 | |
| 5568 | func (self *BsnSetAuxCxnsReply) SetStatus(v uint32) { |
| 5569 | self.Status = v |
| 5570 | } |
| 5571 | |
| 5572 | func (self *BsnSetAuxCxnsReply) Serialize(encoder *goloxi.Encoder) error { |
| 5573 | startIndex := len(encoder.Bytes()) |
| 5574 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 5575 | return err |
| 5576 | } |
| 5577 | |
| 5578 | encoder.PutUint32(uint32(self.NumAux)) |
| 5579 | encoder.PutUint32(uint32(self.Status)) |
| 5580 | length := len(encoder.Bytes()) - startIndex |
| 5581 | |
| 5582 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 5583 | |
| 5584 | return nil |
| 5585 | } |
| 5586 | |
| 5587 | func DecodeBsnSetAuxCxnsReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnSetAuxCxnsReply, error) { |
| 5588 | _bsnsetauxcxnsreply := &BsnSetAuxCxnsReply{BsnHeader: parent} |
| 5589 | if decoder.Length() < 8 { |
| 5590 | return nil, fmt.Errorf("BsnSetAuxCxnsReply packet too short: %d < 8", decoder.Length()) |
| 5591 | } |
| 5592 | _bsnsetauxcxnsreply.NumAux = uint32(decoder.ReadUint32()) |
| 5593 | _bsnsetauxcxnsreply.Status = uint32(decoder.ReadUint32()) |
| 5594 | return _bsnsetauxcxnsreply, nil |
| 5595 | } |
| 5596 | |
| 5597 | func NewBsnSetAuxCxnsReply() *BsnSetAuxCxnsReply { |
| 5598 | obj := &BsnSetAuxCxnsReply{ |
| 5599 | BsnHeader: NewBsnHeader(59), |
| 5600 | } |
| 5601 | return obj |
| 5602 | } |
| 5603 | |
| 5604 | type BsnSetAuxCxnsRequest struct { |
| 5605 | *BsnHeader |
| 5606 | NumAux uint32 |
| 5607 | } |
| 5608 | |
| 5609 | type IBsnSetAuxCxnsRequest interface { |
| 5610 | IBsnHeader |
| 5611 | GetNumAux() uint32 |
| 5612 | } |
| 5613 | |
| 5614 | func (self *BsnSetAuxCxnsRequest) GetNumAux() uint32 { |
| 5615 | return self.NumAux |
| 5616 | } |
| 5617 | |
| 5618 | func (self *BsnSetAuxCxnsRequest) SetNumAux(v uint32) { |
| 5619 | self.NumAux = v |
| 5620 | } |
| 5621 | |
| 5622 | func (self *BsnSetAuxCxnsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 5623 | startIndex := len(encoder.Bytes()) |
| 5624 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 5625 | return err |
| 5626 | } |
| 5627 | |
| 5628 | encoder.PutUint32(uint32(self.NumAux)) |
| 5629 | length := len(encoder.Bytes()) - startIndex |
| 5630 | |
| 5631 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 5632 | |
| 5633 | return nil |
| 5634 | } |
| 5635 | |
| 5636 | func DecodeBsnSetAuxCxnsRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnSetAuxCxnsRequest, error) { |
| 5637 | _bsnsetauxcxnsrequest := &BsnSetAuxCxnsRequest{BsnHeader: parent} |
| 5638 | if decoder.Length() < 4 { |
| 5639 | return nil, fmt.Errorf("BsnSetAuxCxnsRequest packet too short: %d < 4", decoder.Length()) |
| 5640 | } |
| 5641 | _bsnsetauxcxnsrequest.NumAux = uint32(decoder.ReadUint32()) |
| 5642 | return _bsnsetauxcxnsrequest, nil |
| 5643 | } |
| 5644 | |
| 5645 | func NewBsnSetAuxCxnsRequest() *BsnSetAuxCxnsRequest { |
| 5646 | obj := &BsnSetAuxCxnsRequest{ |
| 5647 | BsnHeader: NewBsnHeader(58), |
| 5648 | } |
| 5649 | return obj |
| 5650 | } |
| 5651 | |
| 5652 | type BsnSetLacpReply struct { |
| 5653 | *BsnHeader |
| 5654 | Status uint32 |
| 5655 | PortNo Port |
| 5656 | } |
| 5657 | |
| 5658 | type IBsnSetLacpReply interface { |
| 5659 | IBsnHeader |
| 5660 | GetStatus() uint32 |
| 5661 | GetPortNo() Port |
| 5662 | } |
| 5663 | |
| 5664 | func (self *BsnSetLacpReply) GetStatus() uint32 { |
| 5665 | return self.Status |
| 5666 | } |
| 5667 | |
| 5668 | func (self *BsnSetLacpReply) SetStatus(v uint32) { |
| 5669 | self.Status = v |
| 5670 | } |
| 5671 | |
| 5672 | func (self *BsnSetLacpReply) GetPortNo() Port { |
| 5673 | return self.PortNo |
| 5674 | } |
| 5675 | |
| 5676 | func (self *BsnSetLacpReply) SetPortNo(v Port) { |
| 5677 | self.PortNo = v |
| 5678 | } |
| 5679 | |
| 5680 | func (self *BsnSetLacpReply) Serialize(encoder *goloxi.Encoder) error { |
| 5681 | startIndex := len(encoder.Bytes()) |
| 5682 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 5683 | return err |
| 5684 | } |
| 5685 | |
| 5686 | encoder.PutUint32(uint32(self.Status)) |
| 5687 | self.PortNo.Serialize(encoder) |
| 5688 | length := len(encoder.Bytes()) - startIndex |
| 5689 | |
| 5690 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 5691 | |
| 5692 | return nil |
| 5693 | } |
| 5694 | |
| 5695 | func DecodeBsnSetLacpReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnSetLacpReply, error) { |
| 5696 | _bsnsetlacpreply := &BsnSetLacpReply{BsnHeader: parent} |
| 5697 | if decoder.Length() < 8 { |
| 5698 | return nil, fmt.Errorf("BsnSetLacpReply packet too short: %d < 8", decoder.Length()) |
| 5699 | } |
| 5700 | _bsnsetlacpreply.Status = uint32(decoder.ReadUint32()) |
| 5701 | _bsnsetlacpreply.PortNo.Decode(decoder) |
| 5702 | return _bsnsetlacpreply, nil |
| 5703 | } |
| 5704 | |
| 5705 | func NewBsnSetLacpReply() *BsnSetLacpReply { |
| 5706 | obj := &BsnSetLacpReply{ |
| 5707 | BsnHeader: NewBsnHeader(42), |
| 5708 | } |
| 5709 | return obj |
| 5710 | } |
| 5711 | |
| 5712 | type BsnSetLacpRequest struct { |
| 5713 | *BsnHeader |
| 5714 | Enabled uint8 |
| 5715 | PortNo Port |
| 5716 | ActorSysPriority uint16 |
| 5717 | ActorSysMac net.HardwareAddr |
| 5718 | ActorPortPriority uint16 |
| 5719 | ActorPortNum uint16 |
| 5720 | ActorKey uint16 |
| 5721 | } |
| 5722 | |
| 5723 | type IBsnSetLacpRequest interface { |
| 5724 | IBsnHeader |
| 5725 | GetEnabled() uint8 |
| 5726 | GetPortNo() Port |
| 5727 | GetActorSysPriority() uint16 |
| 5728 | GetActorSysMac() net.HardwareAddr |
| 5729 | GetActorPortPriority() uint16 |
| 5730 | GetActorPortNum() uint16 |
| 5731 | GetActorKey() uint16 |
| 5732 | } |
| 5733 | |
| 5734 | func (self *BsnSetLacpRequest) GetEnabled() uint8 { |
| 5735 | return self.Enabled |
| 5736 | } |
| 5737 | |
| 5738 | func (self *BsnSetLacpRequest) SetEnabled(v uint8) { |
| 5739 | self.Enabled = v |
| 5740 | } |
| 5741 | |
| 5742 | func (self *BsnSetLacpRequest) GetPortNo() Port { |
| 5743 | return self.PortNo |
| 5744 | } |
| 5745 | |
| 5746 | func (self *BsnSetLacpRequest) SetPortNo(v Port) { |
| 5747 | self.PortNo = v |
| 5748 | } |
| 5749 | |
| 5750 | func (self *BsnSetLacpRequest) GetActorSysPriority() uint16 { |
| 5751 | return self.ActorSysPriority |
| 5752 | } |
| 5753 | |
| 5754 | func (self *BsnSetLacpRequest) SetActorSysPriority(v uint16) { |
| 5755 | self.ActorSysPriority = v |
| 5756 | } |
| 5757 | |
| 5758 | func (self *BsnSetLacpRequest) GetActorSysMac() net.HardwareAddr { |
| 5759 | return self.ActorSysMac |
| 5760 | } |
| 5761 | |
| 5762 | func (self *BsnSetLacpRequest) SetActorSysMac(v net.HardwareAddr) { |
| 5763 | self.ActorSysMac = v |
| 5764 | } |
| 5765 | |
| 5766 | func (self *BsnSetLacpRequest) GetActorPortPriority() uint16 { |
| 5767 | return self.ActorPortPriority |
| 5768 | } |
| 5769 | |
| 5770 | func (self *BsnSetLacpRequest) SetActorPortPriority(v uint16) { |
| 5771 | self.ActorPortPriority = v |
| 5772 | } |
| 5773 | |
| 5774 | func (self *BsnSetLacpRequest) GetActorPortNum() uint16 { |
| 5775 | return self.ActorPortNum |
| 5776 | } |
| 5777 | |
| 5778 | func (self *BsnSetLacpRequest) SetActorPortNum(v uint16) { |
| 5779 | self.ActorPortNum = v |
| 5780 | } |
| 5781 | |
| 5782 | func (self *BsnSetLacpRequest) GetActorKey() uint16 { |
| 5783 | return self.ActorKey |
| 5784 | } |
| 5785 | |
| 5786 | func (self *BsnSetLacpRequest) SetActorKey(v uint16) { |
| 5787 | self.ActorKey = v |
| 5788 | } |
| 5789 | |
| 5790 | func (self *BsnSetLacpRequest) Serialize(encoder *goloxi.Encoder) error { |
| 5791 | startIndex := len(encoder.Bytes()) |
| 5792 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 5793 | return err |
| 5794 | } |
| 5795 | |
| 5796 | encoder.PutUint8(uint8(self.Enabled)) |
| 5797 | encoder.Write(bytes.Repeat([]byte{0}, 3)) |
| 5798 | self.PortNo.Serialize(encoder) |
| 5799 | encoder.PutUint16(uint16(self.ActorSysPriority)) |
| 5800 | encoder.Write(self.ActorSysMac) |
| 5801 | encoder.PutUint16(uint16(self.ActorPortPriority)) |
| 5802 | encoder.PutUint16(uint16(self.ActorPortNum)) |
| 5803 | encoder.PutUint16(uint16(self.ActorKey)) |
| 5804 | length := len(encoder.Bytes()) - startIndex |
| 5805 | |
| 5806 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 5807 | |
| 5808 | return nil |
| 5809 | } |
| 5810 | |
| 5811 | func DecodeBsnSetLacpRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnSetLacpRequest, error) { |
| 5812 | _bsnsetlacprequest := &BsnSetLacpRequest{BsnHeader: parent} |
| 5813 | if decoder.Length() < 22 { |
| 5814 | return nil, fmt.Errorf("BsnSetLacpRequest packet too short: %d < 22", decoder.Length()) |
| 5815 | } |
| 5816 | _bsnsetlacprequest.Enabled = uint8(decoder.ReadByte()) |
| 5817 | decoder.Skip(3) |
| 5818 | _bsnsetlacprequest.PortNo.Decode(decoder) |
| 5819 | _bsnsetlacprequest.ActorSysPriority = uint16(decoder.ReadUint16()) |
| 5820 | _bsnsetlacprequest.ActorSysMac = net.HardwareAddr(decoder.Read(6)) |
| 5821 | _bsnsetlacprequest.ActorPortPriority = uint16(decoder.ReadUint16()) |
| 5822 | _bsnsetlacprequest.ActorPortNum = uint16(decoder.ReadUint16()) |
| 5823 | _bsnsetlacprequest.ActorKey = uint16(decoder.ReadUint16()) |
| 5824 | return _bsnsetlacprequest, nil |
| 5825 | } |
| 5826 | |
| 5827 | func NewBsnSetLacpRequest() *BsnSetLacpRequest { |
| 5828 | obj := &BsnSetLacpRequest{ |
| 5829 | BsnHeader: NewBsnHeader(41), |
| 5830 | } |
| 5831 | return obj |
| 5832 | } |
| 5833 | |
| 5834 | type BsnSetMirroring struct { |
| 5835 | *BsnHeader |
| 5836 | ReportMirrorPorts uint8 |
| 5837 | } |
| 5838 | |
| 5839 | type IBsnSetMirroring interface { |
| 5840 | IBsnHeader |
| 5841 | GetReportMirrorPorts() uint8 |
| 5842 | } |
| 5843 | |
| 5844 | func (self *BsnSetMirroring) GetReportMirrorPorts() uint8 { |
| 5845 | return self.ReportMirrorPorts |
| 5846 | } |
| 5847 | |
| 5848 | func (self *BsnSetMirroring) SetReportMirrorPorts(v uint8) { |
| 5849 | self.ReportMirrorPorts = v |
| 5850 | } |
| 5851 | |
| 5852 | func (self *BsnSetMirroring) Serialize(encoder *goloxi.Encoder) error { |
| 5853 | startIndex := len(encoder.Bytes()) |
| 5854 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 5855 | return err |
| 5856 | } |
| 5857 | |
| 5858 | encoder.PutUint8(uint8(self.ReportMirrorPorts)) |
| 5859 | encoder.Write(bytes.Repeat([]byte{0}, 3)) |
| 5860 | length := len(encoder.Bytes()) - startIndex |
| 5861 | |
| 5862 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 5863 | |
| 5864 | return nil |
| 5865 | } |
| 5866 | |
| 5867 | func DecodeBsnSetMirroring(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnSetMirroring, error) { |
| 5868 | _bsnsetmirroring := &BsnSetMirroring{BsnHeader: parent} |
| 5869 | if decoder.Length() < 4 { |
| 5870 | return nil, fmt.Errorf("BsnSetMirroring packet too short: %d < 4", decoder.Length()) |
| 5871 | } |
| 5872 | _bsnsetmirroring.ReportMirrorPorts = uint8(decoder.ReadByte()) |
| 5873 | decoder.Skip(3) |
| 5874 | return _bsnsetmirroring, nil |
| 5875 | } |
| 5876 | |
| 5877 | func NewBsnSetMirroring() *BsnSetMirroring { |
| 5878 | obj := &BsnSetMirroring{ |
| 5879 | BsnHeader: NewBsnHeader(3), |
| 5880 | } |
| 5881 | return obj |
| 5882 | } |
| 5883 | |
| 5884 | type BsnSetPktinSuppressionReply struct { |
| 5885 | *BsnHeader |
| 5886 | Status uint32 |
| 5887 | } |
| 5888 | |
| 5889 | type IBsnSetPktinSuppressionReply interface { |
| 5890 | IBsnHeader |
| 5891 | GetStatus() uint32 |
| 5892 | } |
| 5893 | |
| 5894 | func (self *BsnSetPktinSuppressionReply) GetStatus() uint32 { |
| 5895 | return self.Status |
| 5896 | } |
| 5897 | |
| 5898 | func (self *BsnSetPktinSuppressionReply) SetStatus(v uint32) { |
| 5899 | self.Status = v |
| 5900 | } |
| 5901 | |
| 5902 | func (self *BsnSetPktinSuppressionReply) Serialize(encoder *goloxi.Encoder) error { |
| 5903 | startIndex := len(encoder.Bytes()) |
| 5904 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 5905 | return err |
| 5906 | } |
| 5907 | |
| 5908 | encoder.PutUint32(uint32(self.Status)) |
| 5909 | length := len(encoder.Bytes()) - startIndex |
| 5910 | |
| 5911 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 5912 | |
| 5913 | return nil |
| 5914 | } |
| 5915 | |
| 5916 | func DecodeBsnSetPktinSuppressionReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnSetPktinSuppressionReply, error) { |
| 5917 | _bsnsetpktinsuppressionreply := &BsnSetPktinSuppressionReply{BsnHeader: parent} |
| 5918 | if decoder.Length() < 4 { |
| 5919 | return nil, fmt.Errorf("BsnSetPktinSuppressionReply packet too short: %d < 4", decoder.Length()) |
| 5920 | } |
| 5921 | _bsnsetpktinsuppressionreply.Status = uint32(decoder.ReadUint32()) |
| 5922 | return _bsnsetpktinsuppressionreply, nil |
| 5923 | } |
| 5924 | |
| 5925 | func NewBsnSetPktinSuppressionReply() *BsnSetPktinSuppressionReply { |
| 5926 | obj := &BsnSetPktinSuppressionReply{ |
| 5927 | BsnHeader: NewBsnHeader(25), |
| 5928 | } |
| 5929 | return obj |
| 5930 | } |
| 5931 | |
| 5932 | type BsnSetPktinSuppressionRequest struct { |
| 5933 | *BsnHeader |
| 5934 | Enabled uint8 |
| 5935 | IdleTimeout uint16 |
| 5936 | HardTimeout uint16 |
| 5937 | Priority uint16 |
| 5938 | Cookie uint64 |
| 5939 | } |
| 5940 | |
| 5941 | type IBsnSetPktinSuppressionRequest interface { |
| 5942 | IBsnHeader |
| 5943 | GetEnabled() uint8 |
| 5944 | GetIdleTimeout() uint16 |
| 5945 | GetHardTimeout() uint16 |
| 5946 | GetPriority() uint16 |
| 5947 | GetCookie() uint64 |
| 5948 | } |
| 5949 | |
| 5950 | func (self *BsnSetPktinSuppressionRequest) GetEnabled() uint8 { |
| 5951 | return self.Enabled |
| 5952 | } |
| 5953 | |
| 5954 | func (self *BsnSetPktinSuppressionRequest) SetEnabled(v uint8) { |
| 5955 | self.Enabled = v |
| 5956 | } |
| 5957 | |
| 5958 | func (self *BsnSetPktinSuppressionRequest) GetIdleTimeout() uint16 { |
| 5959 | return self.IdleTimeout |
| 5960 | } |
| 5961 | |
| 5962 | func (self *BsnSetPktinSuppressionRequest) SetIdleTimeout(v uint16) { |
| 5963 | self.IdleTimeout = v |
| 5964 | } |
| 5965 | |
| 5966 | func (self *BsnSetPktinSuppressionRequest) GetHardTimeout() uint16 { |
| 5967 | return self.HardTimeout |
| 5968 | } |
| 5969 | |
| 5970 | func (self *BsnSetPktinSuppressionRequest) SetHardTimeout(v uint16) { |
| 5971 | self.HardTimeout = v |
| 5972 | } |
| 5973 | |
| 5974 | func (self *BsnSetPktinSuppressionRequest) GetPriority() uint16 { |
| 5975 | return self.Priority |
| 5976 | } |
| 5977 | |
| 5978 | func (self *BsnSetPktinSuppressionRequest) SetPriority(v uint16) { |
| 5979 | self.Priority = v |
| 5980 | } |
| 5981 | |
| 5982 | func (self *BsnSetPktinSuppressionRequest) GetCookie() uint64 { |
| 5983 | return self.Cookie |
| 5984 | } |
| 5985 | |
| 5986 | func (self *BsnSetPktinSuppressionRequest) SetCookie(v uint64) { |
| 5987 | self.Cookie = v |
| 5988 | } |
| 5989 | |
| 5990 | func (self *BsnSetPktinSuppressionRequest) Serialize(encoder *goloxi.Encoder) error { |
| 5991 | startIndex := len(encoder.Bytes()) |
| 5992 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 5993 | return err |
| 5994 | } |
| 5995 | |
| 5996 | encoder.PutUint8(uint8(self.Enabled)) |
| 5997 | encoder.Write(bytes.Repeat([]byte{0}, 1)) |
| 5998 | encoder.PutUint16(uint16(self.IdleTimeout)) |
| 5999 | encoder.PutUint16(uint16(self.HardTimeout)) |
| 6000 | encoder.PutUint16(uint16(self.Priority)) |
| 6001 | encoder.PutUint64(uint64(self.Cookie)) |
| 6002 | length := len(encoder.Bytes()) - startIndex |
| 6003 | |
| 6004 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 6005 | |
| 6006 | return nil |
| 6007 | } |
| 6008 | |
| 6009 | func DecodeBsnSetPktinSuppressionRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnSetPktinSuppressionRequest, error) { |
| 6010 | _bsnsetpktinsuppressionrequest := &BsnSetPktinSuppressionRequest{BsnHeader: parent} |
| 6011 | if decoder.Length() < 16 { |
| 6012 | return nil, fmt.Errorf("BsnSetPktinSuppressionRequest packet too short: %d < 16", decoder.Length()) |
| 6013 | } |
| 6014 | _bsnsetpktinsuppressionrequest.Enabled = uint8(decoder.ReadByte()) |
| 6015 | decoder.Skip(1) |
| 6016 | _bsnsetpktinsuppressionrequest.IdleTimeout = uint16(decoder.ReadUint16()) |
| 6017 | _bsnsetpktinsuppressionrequest.HardTimeout = uint16(decoder.ReadUint16()) |
| 6018 | _bsnsetpktinsuppressionrequest.Priority = uint16(decoder.ReadUint16()) |
| 6019 | _bsnsetpktinsuppressionrequest.Cookie = uint64(decoder.ReadUint64()) |
| 6020 | return _bsnsetpktinsuppressionrequest, nil |
| 6021 | } |
| 6022 | |
| 6023 | func NewBsnSetPktinSuppressionRequest() *BsnSetPktinSuppressionRequest { |
| 6024 | obj := &BsnSetPktinSuppressionRequest{ |
| 6025 | BsnHeader: NewBsnHeader(11), |
| 6026 | } |
| 6027 | return obj |
| 6028 | } |
| 6029 | |
| 6030 | type BsnSetSwitchPipelineReply struct { |
| 6031 | *BsnHeader |
| 6032 | Status uint32 |
| 6033 | } |
| 6034 | |
| 6035 | type IBsnSetSwitchPipelineReply interface { |
| 6036 | IBsnHeader |
| 6037 | GetStatus() uint32 |
| 6038 | } |
| 6039 | |
| 6040 | func (self *BsnSetSwitchPipelineReply) GetStatus() uint32 { |
| 6041 | return self.Status |
| 6042 | } |
| 6043 | |
| 6044 | func (self *BsnSetSwitchPipelineReply) SetStatus(v uint32) { |
| 6045 | self.Status = v |
| 6046 | } |
| 6047 | |
| 6048 | func (self *BsnSetSwitchPipelineReply) Serialize(encoder *goloxi.Encoder) error { |
| 6049 | startIndex := len(encoder.Bytes()) |
| 6050 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 6051 | return err |
| 6052 | } |
| 6053 | |
| 6054 | encoder.PutUint32(uint32(self.Status)) |
| 6055 | length := len(encoder.Bytes()) - startIndex |
| 6056 | |
| 6057 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 6058 | |
| 6059 | return nil |
| 6060 | } |
| 6061 | |
| 6062 | func DecodeBsnSetSwitchPipelineReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnSetSwitchPipelineReply, error) { |
| 6063 | _bsnsetswitchpipelinereply := &BsnSetSwitchPipelineReply{BsnHeader: parent} |
| 6064 | if decoder.Length() < 4 { |
| 6065 | return nil, fmt.Errorf("BsnSetSwitchPipelineReply packet too short: %d < 4", decoder.Length()) |
| 6066 | } |
| 6067 | _bsnsetswitchpipelinereply.Status = uint32(decoder.ReadUint32()) |
| 6068 | return _bsnsetswitchpipelinereply, nil |
| 6069 | } |
| 6070 | |
| 6071 | func NewBsnSetSwitchPipelineReply() *BsnSetSwitchPipelineReply { |
| 6072 | obj := &BsnSetSwitchPipelineReply{ |
| 6073 | BsnHeader: NewBsnHeader(54), |
| 6074 | } |
| 6075 | return obj |
| 6076 | } |
| 6077 | |
| 6078 | type BsnSetSwitchPipelineRequest struct { |
| 6079 | *BsnHeader |
| 6080 | Pipeline string |
| 6081 | } |
| 6082 | |
| 6083 | type IBsnSetSwitchPipelineRequest interface { |
| 6084 | IBsnHeader |
| 6085 | GetPipeline() string |
| 6086 | } |
| 6087 | |
| 6088 | func (self *BsnSetSwitchPipelineRequest) GetPipeline() string { |
| 6089 | return self.Pipeline |
| 6090 | } |
| 6091 | |
| 6092 | func (self *BsnSetSwitchPipelineRequest) SetPipeline(v string) { |
| 6093 | self.Pipeline = v |
| 6094 | } |
| 6095 | |
| 6096 | func (self *BsnSetSwitchPipelineRequest) Serialize(encoder *goloxi.Encoder) error { |
| 6097 | startIndex := len(encoder.Bytes()) |
| 6098 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 6099 | return err |
| 6100 | } |
| 6101 | |
| 6102 | encoder.Write([]byte(self.Pipeline)) |
| 6103 | length := len(encoder.Bytes()) - startIndex |
| 6104 | |
| 6105 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 6106 | |
| 6107 | return nil |
| 6108 | } |
| 6109 | |
| 6110 | func DecodeBsnSetSwitchPipelineRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnSetSwitchPipelineRequest, error) { |
| 6111 | _bsnsetswitchpipelinerequest := &BsnSetSwitchPipelineRequest{BsnHeader: parent} |
| 6112 | if decoder.Length() < 256 { |
| 6113 | return nil, fmt.Errorf("BsnSetSwitchPipelineRequest packet too short: %d < 256", decoder.Length()) |
| 6114 | } |
| 6115 | _bsnsetswitchpipelinerequest.Pipeline = string(bytes.Trim(decoder.Read(256), "\x00")) |
| 6116 | return _bsnsetswitchpipelinerequest, nil |
| 6117 | } |
| 6118 | |
| 6119 | func NewBsnSetSwitchPipelineRequest() *BsnSetSwitchPipelineRequest { |
| 6120 | obj := &BsnSetSwitchPipelineRequest{ |
| 6121 | BsnHeader: NewBsnHeader(53), |
| 6122 | } |
| 6123 | return obj |
| 6124 | } |
| 6125 | |
| 6126 | type BsnSwitchPipelineStatsReply struct { |
| 6127 | *BsnStatsReply |
| 6128 | Entries []*BsnSwitchPipelineStatsEntry |
| 6129 | } |
| 6130 | |
| 6131 | type IBsnSwitchPipelineStatsReply interface { |
| 6132 | IBsnStatsReply |
| 6133 | GetEntries() []*BsnSwitchPipelineStatsEntry |
| 6134 | } |
| 6135 | |
| 6136 | func (self *BsnSwitchPipelineStatsReply) GetEntries() []*BsnSwitchPipelineStatsEntry { |
| 6137 | return self.Entries |
| 6138 | } |
| 6139 | |
| 6140 | func (self *BsnSwitchPipelineStatsReply) SetEntries(v []*BsnSwitchPipelineStatsEntry) { |
| 6141 | self.Entries = v |
| 6142 | } |
| 6143 | |
| 6144 | func (self *BsnSwitchPipelineStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 6145 | startIndex := len(encoder.Bytes()) |
| 6146 | if err := self.BsnStatsReply.Serialize(encoder); err != nil { |
| 6147 | return err |
| 6148 | } |
| 6149 | |
| 6150 | for _, obj := range self.Entries { |
| 6151 | if err := obj.Serialize(encoder); err != nil { |
| 6152 | return err |
| 6153 | } |
| 6154 | } |
| 6155 | length := len(encoder.Bytes()) - startIndex |
| 6156 | |
| 6157 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 6158 | |
| 6159 | return nil |
| 6160 | } |
| 6161 | |
| 6162 | func DecodeBsnSwitchPipelineStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnSwitchPipelineStatsReply, error) { |
| 6163 | _bsnswitchpipelinestatsreply := &BsnSwitchPipelineStatsReply{BsnStatsReply: parent} |
| 6164 | |
| 6165 | for decoder.Length() >= 256 { |
| 6166 | item, err := DecodeBsnSwitchPipelineStatsEntry(decoder) |
| 6167 | if err != nil { |
| 6168 | return nil, err |
| 6169 | } |
| 6170 | if item != nil { |
| 6171 | _bsnswitchpipelinestatsreply.Entries = append(_bsnswitchpipelinestatsreply.Entries, item) |
| 6172 | } |
| 6173 | } |
| 6174 | return _bsnswitchpipelinestatsreply, nil |
| 6175 | } |
| 6176 | |
| 6177 | func NewBsnSwitchPipelineStatsReply() *BsnSwitchPipelineStatsReply { |
| 6178 | obj := &BsnSwitchPipelineStatsReply{ |
| 6179 | BsnStatsReply: NewBsnStatsReply(6), |
| 6180 | } |
| 6181 | return obj |
| 6182 | } |
| 6183 | |
| 6184 | type BsnSwitchPipelineStatsRequest struct { |
| 6185 | *BsnStatsRequest |
| 6186 | } |
| 6187 | |
| 6188 | type IBsnSwitchPipelineStatsRequest interface { |
| 6189 | IBsnStatsRequest |
| 6190 | } |
| 6191 | |
| 6192 | func (self *BsnSwitchPipelineStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 6193 | startIndex := len(encoder.Bytes()) |
| 6194 | if err := self.BsnStatsRequest.Serialize(encoder); err != nil { |
| 6195 | return err |
| 6196 | } |
| 6197 | length := len(encoder.Bytes()) - startIndex |
| 6198 | |
| 6199 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 6200 | |
| 6201 | return nil |
| 6202 | } |
| 6203 | |
| 6204 | func DecodeBsnSwitchPipelineStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnSwitchPipelineStatsRequest, error) { |
| 6205 | _bsnswitchpipelinestatsrequest := &BsnSwitchPipelineStatsRequest{BsnStatsRequest: parent} |
| 6206 | return _bsnswitchpipelinestatsrequest, nil |
| 6207 | } |
| 6208 | |
| 6209 | func NewBsnSwitchPipelineStatsRequest() *BsnSwitchPipelineStatsRequest { |
| 6210 | obj := &BsnSwitchPipelineStatsRequest{ |
| 6211 | BsnStatsRequest: NewBsnStatsRequest(6), |
| 6212 | } |
| 6213 | return obj |
| 6214 | } |
| 6215 | |
| 6216 | type BsnTableChecksumStatsReply struct { |
| 6217 | *BsnStatsReply |
| 6218 | Entries []*BsnTableChecksumStatsEntry |
| 6219 | } |
| 6220 | |
| 6221 | type IBsnTableChecksumStatsReply interface { |
| 6222 | IBsnStatsReply |
| 6223 | GetEntries() []*BsnTableChecksumStatsEntry |
| 6224 | } |
| 6225 | |
| 6226 | func (self *BsnTableChecksumStatsReply) GetEntries() []*BsnTableChecksumStatsEntry { |
| 6227 | return self.Entries |
| 6228 | } |
| 6229 | |
| 6230 | func (self *BsnTableChecksumStatsReply) SetEntries(v []*BsnTableChecksumStatsEntry) { |
| 6231 | self.Entries = v |
| 6232 | } |
| 6233 | |
| 6234 | func (self *BsnTableChecksumStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 6235 | startIndex := len(encoder.Bytes()) |
| 6236 | if err := self.BsnStatsReply.Serialize(encoder); err != nil { |
| 6237 | return err |
| 6238 | } |
| 6239 | |
| 6240 | for _, obj := range self.Entries { |
| 6241 | if err := obj.Serialize(encoder); err != nil { |
| 6242 | return err |
| 6243 | } |
| 6244 | } |
| 6245 | length := len(encoder.Bytes()) - startIndex |
| 6246 | |
| 6247 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 6248 | |
| 6249 | return nil |
| 6250 | } |
| 6251 | |
| 6252 | func DecodeBsnTableChecksumStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnTableChecksumStatsReply, error) { |
| 6253 | _bsntablechecksumstatsreply := &BsnTableChecksumStatsReply{BsnStatsReply: parent} |
| 6254 | |
| 6255 | for decoder.Length() >= 9 { |
| 6256 | item, err := DecodeBsnTableChecksumStatsEntry(decoder) |
| 6257 | if err != nil { |
| 6258 | return nil, err |
| 6259 | } |
| 6260 | if item != nil { |
| 6261 | _bsntablechecksumstatsreply.Entries = append(_bsntablechecksumstatsreply.Entries, item) |
| 6262 | } |
| 6263 | } |
| 6264 | return _bsntablechecksumstatsreply, nil |
| 6265 | } |
| 6266 | |
| 6267 | func NewBsnTableChecksumStatsReply() *BsnTableChecksumStatsReply { |
| 6268 | obj := &BsnTableChecksumStatsReply{ |
| 6269 | BsnStatsReply: NewBsnStatsReply(11), |
| 6270 | } |
| 6271 | return obj |
| 6272 | } |
| 6273 | |
| 6274 | type BsnTableChecksumStatsRequest struct { |
| 6275 | *BsnStatsRequest |
| 6276 | } |
| 6277 | |
| 6278 | type IBsnTableChecksumStatsRequest interface { |
| 6279 | IBsnStatsRequest |
| 6280 | } |
| 6281 | |
| 6282 | func (self *BsnTableChecksumStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 6283 | startIndex := len(encoder.Bytes()) |
| 6284 | if err := self.BsnStatsRequest.Serialize(encoder); err != nil { |
| 6285 | return err |
| 6286 | } |
| 6287 | length := len(encoder.Bytes()) - startIndex |
| 6288 | |
| 6289 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 6290 | |
| 6291 | return nil |
| 6292 | } |
| 6293 | |
| 6294 | func DecodeBsnTableChecksumStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnTableChecksumStatsRequest, error) { |
| 6295 | _bsntablechecksumstatsrequest := &BsnTableChecksumStatsRequest{BsnStatsRequest: parent} |
| 6296 | return _bsntablechecksumstatsrequest, nil |
| 6297 | } |
| 6298 | |
| 6299 | func NewBsnTableChecksumStatsRequest() *BsnTableChecksumStatsRequest { |
| 6300 | obj := &BsnTableChecksumStatsRequest{ |
| 6301 | BsnStatsRequest: NewBsnStatsRequest(11), |
| 6302 | } |
| 6303 | return obj |
| 6304 | } |
| 6305 | |
| 6306 | type BsnTableSetBucketsSize struct { |
| 6307 | *BsnHeader |
| 6308 | TableId uint8 |
| 6309 | BucketsSize uint32 |
| 6310 | } |
| 6311 | |
| 6312 | type IBsnTableSetBucketsSize interface { |
| 6313 | IBsnHeader |
| 6314 | GetTableId() uint8 |
| 6315 | GetBucketsSize() uint32 |
| 6316 | } |
| 6317 | |
| 6318 | func (self *BsnTableSetBucketsSize) GetTableId() uint8 { |
| 6319 | return self.TableId |
| 6320 | } |
| 6321 | |
| 6322 | func (self *BsnTableSetBucketsSize) SetTableId(v uint8) { |
| 6323 | self.TableId = v |
| 6324 | } |
| 6325 | |
| 6326 | func (self *BsnTableSetBucketsSize) GetBucketsSize() uint32 { |
| 6327 | return self.BucketsSize |
| 6328 | } |
| 6329 | |
| 6330 | func (self *BsnTableSetBucketsSize) SetBucketsSize(v uint32) { |
| 6331 | self.BucketsSize = v |
| 6332 | } |
| 6333 | |
| 6334 | func (self *BsnTableSetBucketsSize) Serialize(encoder *goloxi.Encoder) error { |
| 6335 | startIndex := len(encoder.Bytes()) |
| 6336 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 6337 | return err |
| 6338 | } |
| 6339 | |
| 6340 | encoder.Write(bytes.Repeat([]byte{0}, 1)) |
| 6341 | encoder.PutUint8(uint8(self.TableId)) |
| 6342 | encoder.Write(bytes.Repeat([]byte{0}, 2)) |
| 6343 | encoder.PutUint32(uint32(self.BucketsSize)) |
| 6344 | length := len(encoder.Bytes()) - startIndex |
| 6345 | |
| 6346 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 6347 | |
| 6348 | return nil |
| 6349 | } |
| 6350 | |
| 6351 | func DecodeBsnTableSetBucketsSize(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnTableSetBucketsSize, error) { |
| 6352 | _bsntablesetbucketssize := &BsnTableSetBucketsSize{BsnHeader: parent} |
| 6353 | if decoder.Length() < 8 { |
| 6354 | return nil, fmt.Errorf("BsnTableSetBucketsSize packet too short: %d < 8", decoder.Length()) |
| 6355 | } |
| 6356 | decoder.Skip(1) |
| 6357 | _bsntablesetbucketssize.TableId = uint8(decoder.ReadByte()) |
| 6358 | decoder.Skip(2) |
| 6359 | _bsntablesetbucketssize.BucketsSize = uint32(decoder.ReadUint32()) |
| 6360 | return _bsntablesetbucketssize, nil |
| 6361 | } |
| 6362 | |
| 6363 | func NewBsnTableSetBucketsSize() *BsnTableSetBucketsSize { |
| 6364 | obj := &BsnTableSetBucketsSize{ |
| 6365 | BsnHeader: NewBsnHeader(61), |
| 6366 | } |
| 6367 | return obj |
| 6368 | } |
| 6369 | |
| 6370 | type BsnTakeover struct { |
| 6371 | *BsnHeader |
| 6372 | } |
| 6373 | |
| 6374 | type IBsnTakeover interface { |
| 6375 | IBsnHeader |
| 6376 | } |
| 6377 | |
| 6378 | func (self *BsnTakeover) Serialize(encoder *goloxi.Encoder) error { |
| 6379 | startIndex := len(encoder.Bytes()) |
| 6380 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 6381 | return err |
| 6382 | } |
| 6383 | length := len(encoder.Bytes()) - startIndex |
| 6384 | |
| 6385 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 6386 | |
| 6387 | return nil |
| 6388 | } |
| 6389 | |
| 6390 | func DecodeBsnTakeover(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnTakeover, error) { |
| 6391 | _bsntakeover := &BsnTakeover{BsnHeader: parent} |
| 6392 | return _bsntakeover, nil |
| 6393 | } |
| 6394 | |
| 6395 | func NewBsnTakeover() *BsnTakeover { |
| 6396 | obj := &BsnTakeover{ |
| 6397 | BsnHeader: NewBsnHeader(69), |
| 6398 | } |
| 6399 | return obj |
| 6400 | } |
| 6401 | |
| 6402 | type BsnTimeReply struct { |
| 6403 | *BsnHeader |
| 6404 | TimeMs uint64 |
| 6405 | } |
| 6406 | |
| 6407 | type IBsnTimeReply interface { |
| 6408 | IBsnHeader |
| 6409 | GetTimeMs() uint64 |
| 6410 | } |
| 6411 | |
| 6412 | func (self *BsnTimeReply) GetTimeMs() uint64 { |
| 6413 | return self.TimeMs |
| 6414 | } |
| 6415 | |
| 6416 | func (self *BsnTimeReply) SetTimeMs(v uint64) { |
| 6417 | self.TimeMs = v |
| 6418 | } |
| 6419 | |
| 6420 | func (self *BsnTimeReply) Serialize(encoder *goloxi.Encoder) error { |
| 6421 | startIndex := len(encoder.Bytes()) |
| 6422 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 6423 | return err |
| 6424 | } |
| 6425 | |
| 6426 | encoder.PutUint64(uint64(self.TimeMs)) |
| 6427 | length := len(encoder.Bytes()) - startIndex |
| 6428 | |
| 6429 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 6430 | |
| 6431 | return nil |
| 6432 | } |
| 6433 | |
| 6434 | func DecodeBsnTimeReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnTimeReply, error) { |
| 6435 | _bsntimereply := &BsnTimeReply{BsnHeader: parent} |
| 6436 | if decoder.Length() < 8 { |
| 6437 | return nil, fmt.Errorf("BsnTimeReply packet too short: %d < 8", decoder.Length()) |
| 6438 | } |
| 6439 | _bsntimereply.TimeMs = uint64(decoder.ReadUint64()) |
| 6440 | return _bsntimereply, nil |
| 6441 | } |
| 6442 | |
| 6443 | func NewBsnTimeReply() *BsnTimeReply { |
| 6444 | obj := &BsnTimeReply{ |
| 6445 | BsnHeader: NewBsnHeader(45), |
| 6446 | } |
| 6447 | return obj |
| 6448 | } |
| 6449 | |
| 6450 | type BsnTimeRequest struct { |
| 6451 | *BsnHeader |
| 6452 | } |
| 6453 | |
| 6454 | type IBsnTimeRequest interface { |
| 6455 | IBsnHeader |
| 6456 | } |
| 6457 | |
| 6458 | func (self *BsnTimeRequest) Serialize(encoder *goloxi.Encoder) error { |
| 6459 | startIndex := len(encoder.Bytes()) |
| 6460 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 6461 | return err |
| 6462 | } |
| 6463 | length := len(encoder.Bytes()) - startIndex |
| 6464 | |
| 6465 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 6466 | |
| 6467 | return nil |
| 6468 | } |
| 6469 | |
| 6470 | func DecodeBsnTimeRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnTimeRequest, error) { |
| 6471 | _bsntimerequest := &BsnTimeRequest{BsnHeader: parent} |
| 6472 | return _bsntimerequest, nil |
| 6473 | } |
| 6474 | |
| 6475 | func NewBsnTimeRequest() *BsnTimeRequest { |
| 6476 | obj := &BsnTimeRequest{ |
| 6477 | BsnHeader: NewBsnHeader(44), |
| 6478 | } |
| 6479 | return obj |
| 6480 | } |
| 6481 | |
| 6482 | type BsnVirtualPortCreateReply struct { |
| 6483 | *BsnHeader |
| 6484 | Status uint32 |
| 6485 | VportNo uint32 |
| 6486 | } |
| 6487 | |
| 6488 | type IBsnVirtualPortCreateReply interface { |
| 6489 | IBsnHeader |
| 6490 | GetStatus() uint32 |
| 6491 | GetVportNo() uint32 |
| 6492 | } |
| 6493 | |
| 6494 | func (self *BsnVirtualPortCreateReply) GetStatus() uint32 { |
| 6495 | return self.Status |
| 6496 | } |
| 6497 | |
| 6498 | func (self *BsnVirtualPortCreateReply) SetStatus(v uint32) { |
| 6499 | self.Status = v |
| 6500 | } |
| 6501 | |
| 6502 | func (self *BsnVirtualPortCreateReply) GetVportNo() uint32 { |
| 6503 | return self.VportNo |
| 6504 | } |
| 6505 | |
| 6506 | func (self *BsnVirtualPortCreateReply) SetVportNo(v uint32) { |
| 6507 | self.VportNo = v |
| 6508 | } |
| 6509 | |
| 6510 | func (self *BsnVirtualPortCreateReply) Serialize(encoder *goloxi.Encoder) error { |
| 6511 | startIndex := len(encoder.Bytes()) |
| 6512 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 6513 | return err |
| 6514 | } |
| 6515 | |
| 6516 | encoder.PutUint32(uint32(self.Status)) |
| 6517 | encoder.PutUint32(uint32(self.VportNo)) |
| 6518 | length := len(encoder.Bytes()) - startIndex |
| 6519 | |
| 6520 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 6521 | |
| 6522 | return nil |
| 6523 | } |
| 6524 | |
| 6525 | func DecodeBsnVirtualPortCreateReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnVirtualPortCreateReply, error) { |
| 6526 | _bsnvirtualportcreatereply := &BsnVirtualPortCreateReply{BsnHeader: parent} |
| 6527 | if decoder.Length() < 8 { |
| 6528 | return nil, fmt.Errorf("BsnVirtualPortCreateReply packet too short: %d < 8", decoder.Length()) |
| 6529 | } |
| 6530 | _bsnvirtualportcreatereply.Status = uint32(decoder.ReadUint32()) |
| 6531 | _bsnvirtualportcreatereply.VportNo = uint32(decoder.ReadUint32()) |
| 6532 | return _bsnvirtualportcreatereply, nil |
| 6533 | } |
| 6534 | |
| 6535 | func NewBsnVirtualPortCreateReply() *BsnVirtualPortCreateReply { |
| 6536 | obj := &BsnVirtualPortCreateReply{ |
| 6537 | BsnHeader: NewBsnHeader(16), |
| 6538 | } |
| 6539 | return obj |
| 6540 | } |
| 6541 | |
| 6542 | type BsnVirtualPortCreateRequest struct { |
| 6543 | *BsnHeader |
| 6544 | Vport BSNVport |
| 6545 | } |
| 6546 | |
| 6547 | type IBsnVirtualPortCreateRequest interface { |
| 6548 | IBsnHeader |
| 6549 | GetVport() BSNVport |
| 6550 | } |
| 6551 | |
| 6552 | func (self *BsnVirtualPortCreateRequest) GetVport() BSNVport { |
| 6553 | return self.Vport |
| 6554 | } |
| 6555 | |
| 6556 | func (self *BsnVirtualPortCreateRequest) SetVport(v BSNVport) { |
| 6557 | self.Vport = v |
| 6558 | } |
| 6559 | |
| 6560 | func (self *BsnVirtualPortCreateRequest) Serialize(encoder *goloxi.Encoder) error { |
| 6561 | startIndex := len(encoder.Bytes()) |
| 6562 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 6563 | return err |
| 6564 | } |
| 6565 | |
| 6566 | if err := self.Vport.Serialize(encoder); err != nil { |
| 6567 | return err |
| 6568 | } |
| 6569 | |
| 6570 | length := len(encoder.Bytes()) - startIndex |
| 6571 | |
| 6572 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 6573 | |
| 6574 | return nil |
| 6575 | } |
| 6576 | |
| 6577 | func DecodeBsnVirtualPortCreateRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnVirtualPortCreateRequest, error) { |
| 6578 | _bsnvirtualportcreaterequest := &BsnVirtualPortCreateRequest{BsnHeader: parent} |
| 6579 | if decoder.Length() < 4 { |
| 6580 | return nil, fmt.Errorf("BsnVirtualPortCreateRequest packet too short: %d < 4", decoder.Length()) |
| 6581 | } |
| 6582 | if err := _bsnvirtualportcreaterequest.Vport.Decode(decoder); err != nil { |
| 6583 | return nil, err |
| 6584 | } |
| 6585 | |
| 6586 | return _bsnvirtualportcreaterequest, nil |
| 6587 | } |
| 6588 | |
| 6589 | func NewBsnVirtualPortCreateRequest() *BsnVirtualPortCreateRequest { |
| 6590 | obj := &BsnVirtualPortCreateRequest{ |
| 6591 | BsnHeader: NewBsnHeader(15), |
| 6592 | } |
| 6593 | return obj |
| 6594 | } |
| 6595 | |
| 6596 | type BsnVirtualPortRemoveReply struct { |
| 6597 | *BsnHeader |
| 6598 | Status uint32 |
| 6599 | } |
| 6600 | |
| 6601 | type IBsnVirtualPortRemoveReply interface { |
| 6602 | IBsnHeader |
| 6603 | GetStatus() uint32 |
| 6604 | } |
| 6605 | |
| 6606 | func (self *BsnVirtualPortRemoveReply) GetStatus() uint32 { |
| 6607 | return self.Status |
| 6608 | } |
| 6609 | |
| 6610 | func (self *BsnVirtualPortRemoveReply) SetStatus(v uint32) { |
| 6611 | self.Status = v |
| 6612 | } |
| 6613 | |
| 6614 | func (self *BsnVirtualPortRemoveReply) Serialize(encoder *goloxi.Encoder) error { |
| 6615 | startIndex := len(encoder.Bytes()) |
| 6616 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 6617 | return err |
| 6618 | } |
| 6619 | |
| 6620 | encoder.PutUint32(uint32(self.Status)) |
| 6621 | length := len(encoder.Bytes()) - startIndex |
| 6622 | |
| 6623 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 6624 | |
| 6625 | return nil |
| 6626 | } |
| 6627 | |
| 6628 | func DecodeBsnVirtualPortRemoveReply(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnVirtualPortRemoveReply, error) { |
| 6629 | _bsnvirtualportremovereply := &BsnVirtualPortRemoveReply{BsnHeader: parent} |
| 6630 | if decoder.Length() < 4 { |
| 6631 | return nil, fmt.Errorf("BsnVirtualPortRemoveReply packet too short: %d < 4", decoder.Length()) |
| 6632 | } |
| 6633 | _bsnvirtualportremovereply.Status = uint32(decoder.ReadUint32()) |
| 6634 | return _bsnvirtualportremovereply, nil |
| 6635 | } |
| 6636 | |
| 6637 | func NewBsnVirtualPortRemoveReply() *BsnVirtualPortRemoveReply { |
| 6638 | obj := &BsnVirtualPortRemoveReply{ |
| 6639 | BsnHeader: NewBsnHeader(26), |
| 6640 | } |
| 6641 | return obj |
| 6642 | } |
| 6643 | |
| 6644 | type BsnVirtualPortRemoveRequest struct { |
| 6645 | *BsnHeader |
| 6646 | VportNo uint32 |
| 6647 | } |
| 6648 | |
| 6649 | type IBsnVirtualPortRemoveRequest interface { |
| 6650 | IBsnHeader |
| 6651 | GetVportNo() uint32 |
| 6652 | } |
| 6653 | |
| 6654 | func (self *BsnVirtualPortRemoveRequest) GetVportNo() uint32 { |
| 6655 | return self.VportNo |
| 6656 | } |
| 6657 | |
| 6658 | func (self *BsnVirtualPortRemoveRequest) SetVportNo(v uint32) { |
| 6659 | self.VportNo = v |
| 6660 | } |
| 6661 | |
| 6662 | func (self *BsnVirtualPortRemoveRequest) Serialize(encoder *goloxi.Encoder) error { |
| 6663 | startIndex := len(encoder.Bytes()) |
| 6664 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 6665 | return err |
| 6666 | } |
| 6667 | |
| 6668 | encoder.PutUint32(uint32(self.VportNo)) |
| 6669 | length := len(encoder.Bytes()) - startIndex |
| 6670 | |
| 6671 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 6672 | |
| 6673 | return nil |
| 6674 | } |
| 6675 | |
| 6676 | func DecodeBsnVirtualPortRemoveRequest(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnVirtualPortRemoveRequest, error) { |
| 6677 | _bsnvirtualportremoverequest := &BsnVirtualPortRemoveRequest{BsnHeader: parent} |
| 6678 | if decoder.Length() < 4 { |
| 6679 | return nil, fmt.Errorf("BsnVirtualPortRemoveRequest packet too short: %d < 4", decoder.Length()) |
| 6680 | } |
| 6681 | _bsnvirtualportremoverequest.VportNo = uint32(decoder.ReadUint32()) |
| 6682 | return _bsnvirtualportremoverequest, nil |
| 6683 | } |
| 6684 | |
| 6685 | func NewBsnVirtualPortRemoveRequest() *BsnVirtualPortRemoveRequest { |
| 6686 | obj := &BsnVirtualPortRemoveRequest{ |
| 6687 | BsnHeader: NewBsnHeader(17), |
| 6688 | } |
| 6689 | return obj |
| 6690 | } |
| 6691 | |
| 6692 | type BsnVlanCounterClear struct { |
| 6693 | *BsnHeader |
| 6694 | VlanVid uint16 |
| 6695 | } |
| 6696 | |
| 6697 | type IBsnVlanCounterClear interface { |
| 6698 | IBsnHeader |
| 6699 | GetVlanVid() uint16 |
| 6700 | } |
| 6701 | |
| 6702 | func (self *BsnVlanCounterClear) GetVlanVid() uint16 { |
| 6703 | return self.VlanVid |
| 6704 | } |
| 6705 | |
| 6706 | func (self *BsnVlanCounterClear) SetVlanVid(v uint16) { |
| 6707 | self.VlanVid = v |
| 6708 | } |
| 6709 | |
| 6710 | func (self *BsnVlanCounterClear) Serialize(encoder *goloxi.Encoder) error { |
| 6711 | startIndex := len(encoder.Bytes()) |
| 6712 | if err := self.BsnHeader.Serialize(encoder); err != nil { |
| 6713 | return err |
| 6714 | } |
| 6715 | |
| 6716 | encoder.PutUint16(uint16(self.VlanVid)) |
| 6717 | length := len(encoder.Bytes()) - startIndex |
| 6718 | |
| 6719 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 6720 | |
| 6721 | return nil |
| 6722 | } |
| 6723 | |
| 6724 | func DecodeBsnVlanCounterClear(parent *BsnHeader, decoder *goloxi.Decoder) (*BsnVlanCounterClear, error) { |
| 6725 | _bsnvlancounterclear := &BsnVlanCounterClear{BsnHeader: parent} |
| 6726 | if decoder.Length() < 2 { |
| 6727 | return nil, fmt.Errorf("BsnVlanCounterClear packet too short: %d < 2", decoder.Length()) |
| 6728 | } |
| 6729 | _bsnvlancounterclear.VlanVid = uint16(decoder.ReadUint16()) |
| 6730 | return _bsnvlancounterclear, nil |
| 6731 | } |
| 6732 | |
| 6733 | func NewBsnVlanCounterClear() *BsnVlanCounterClear { |
| 6734 | obj := &BsnVlanCounterClear{ |
| 6735 | BsnHeader: NewBsnHeader(70), |
| 6736 | } |
| 6737 | return obj |
| 6738 | } |
| 6739 | |
| 6740 | type BsnVlanCounterStatsReply struct { |
| 6741 | *BsnStatsReply |
| 6742 | Entries []*BsnVlanCounterStatsEntry |
| 6743 | } |
| 6744 | |
| 6745 | type IBsnVlanCounterStatsReply interface { |
| 6746 | IBsnStatsReply |
| 6747 | GetEntries() []*BsnVlanCounterStatsEntry |
| 6748 | } |
| 6749 | |
| 6750 | func (self *BsnVlanCounterStatsReply) GetEntries() []*BsnVlanCounterStatsEntry { |
| 6751 | return self.Entries |
| 6752 | } |
| 6753 | |
| 6754 | func (self *BsnVlanCounterStatsReply) SetEntries(v []*BsnVlanCounterStatsEntry) { |
| 6755 | self.Entries = v |
| 6756 | } |
| 6757 | |
| 6758 | func (self *BsnVlanCounterStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 6759 | startIndex := len(encoder.Bytes()) |
| 6760 | if err := self.BsnStatsReply.Serialize(encoder); err != nil { |
| 6761 | return err |
| 6762 | } |
| 6763 | |
| 6764 | for _, obj := range self.Entries { |
| 6765 | if err := obj.Serialize(encoder); err != nil { |
| 6766 | return err |
| 6767 | } |
| 6768 | } |
| 6769 | length := len(encoder.Bytes()) - startIndex |
| 6770 | |
| 6771 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 6772 | |
| 6773 | return nil |
| 6774 | } |
| 6775 | |
| 6776 | func DecodeBsnVlanCounterStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnVlanCounterStatsReply, error) { |
| 6777 | _bsnvlancounterstatsreply := &BsnVlanCounterStatsReply{BsnStatsReply: parent} |
| 6778 | |
| 6779 | for decoder.Length() >= 8 { |
| 6780 | item, err := DecodeBsnVlanCounterStatsEntry(decoder) |
| 6781 | if err != nil { |
| 6782 | return nil, err |
| 6783 | } |
| 6784 | if item != nil { |
| 6785 | _bsnvlancounterstatsreply.Entries = append(_bsnvlancounterstatsreply.Entries, item) |
| 6786 | } |
| 6787 | } |
| 6788 | return _bsnvlancounterstatsreply, nil |
| 6789 | } |
| 6790 | |
| 6791 | func NewBsnVlanCounterStatsReply() *BsnVlanCounterStatsReply { |
| 6792 | obj := &BsnVlanCounterStatsReply{ |
| 6793 | BsnStatsReply: NewBsnStatsReply(9), |
| 6794 | } |
| 6795 | return obj |
| 6796 | } |
| 6797 | |
| 6798 | type BsnVlanCounterStatsRequest struct { |
| 6799 | *BsnStatsRequest |
| 6800 | VlanVid uint16 |
| 6801 | } |
| 6802 | |
| 6803 | type IBsnVlanCounterStatsRequest interface { |
| 6804 | IBsnStatsRequest |
| 6805 | GetVlanVid() uint16 |
| 6806 | } |
| 6807 | |
| 6808 | func (self *BsnVlanCounterStatsRequest) GetVlanVid() uint16 { |
| 6809 | return self.VlanVid |
| 6810 | } |
| 6811 | |
| 6812 | func (self *BsnVlanCounterStatsRequest) SetVlanVid(v uint16) { |
| 6813 | self.VlanVid = v |
| 6814 | } |
| 6815 | |
| 6816 | func (self *BsnVlanCounterStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 6817 | startIndex := len(encoder.Bytes()) |
| 6818 | if err := self.BsnStatsRequest.Serialize(encoder); err != nil { |
| 6819 | return err |
| 6820 | } |
| 6821 | |
| 6822 | encoder.PutUint16(uint16(self.VlanVid)) |
| 6823 | length := len(encoder.Bytes()) - startIndex |
| 6824 | |
| 6825 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 6826 | |
| 6827 | return nil |
| 6828 | } |
| 6829 | |
| 6830 | func DecodeBsnVlanCounterStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnVlanCounterStatsRequest, error) { |
| 6831 | _bsnvlancounterstatsrequest := &BsnVlanCounterStatsRequest{BsnStatsRequest: parent} |
| 6832 | if decoder.Length() < 2 { |
| 6833 | return nil, fmt.Errorf("BsnVlanCounterStatsRequest packet too short: %d < 2", decoder.Length()) |
| 6834 | } |
| 6835 | _bsnvlancounterstatsrequest.VlanVid = uint16(decoder.ReadUint16()) |
| 6836 | return _bsnvlancounterstatsrequest, nil |
| 6837 | } |
| 6838 | |
| 6839 | func NewBsnVlanCounterStatsRequest() *BsnVlanCounterStatsRequest { |
| 6840 | obj := &BsnVlanCounterStatsRequest{ |
| 6841 | BsnStatsRequest: NewBsnStatsRequest(9), |
| 6842 | } |
| 6843 | return obj |
| 6844 | } |
| 6845 | |
| 6846 | type BsnVrfCounterStatsReply struct { |
| 6847 | *BsnStatsReply |
| 6848 | Entries []*BsnVrfCounterStatsEntry |
| 6849 | } |
| 6850 | |
| 6851 | type IBsnVrfCounterStatsReply interface { |
| 6852 | IBsnStatsReply |
| 6853 | GetEntries() []*BsnVrfCounterStatsEntry |
| 6854 | } |
| 6855 | |
| 6856 | func (self *BsnVrfCounterStatsReply) GetEntries() []*BsnVrfCounterStatsEntry { |
| 6857 | return self.Entries |
| 6858 | } |
| 6859 | |
| 6860 | func (self *BsnVrfCounterStatsReply) SetEntries(v []*BsnVrfCounterStatsEntry) { |
| 6861 | self.Entries = v |
| 6862 | } |
| 6863 | |
| 6864 | func (self *BsnVrfCounterStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 6865 | startIndex := len(encoder.Bytes()) |
| 6866 | if err := self.BsnStatsReply.Serialize(encoder); err != nil { |
| 6867 | return err |
| 6868 | } |
| 6869 | |
| 6870 | for _, obj := range self.Entries { |
| 6871 | if err := obj.Serialize(encoder); err != nil { |
| 6872 | return err |
| 6873 | } |
| 6874 | } |
| 6875 | length := len(encoder.Bytes()) - startIndex |
| 6876 | |
| 6877 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 6878 | |
| 6879 | return nil |
| 6880 | } |
| 6881 | |
| 6882 | func DecodeBsnVrfCounterStatsReply(parent *BsnStatsReply, decoder *goloxi.Decoder) (*BsnVrfCounterStatsReply, error) { |
| 6883 | _bsnvrfcounterstatsreply := &BsnVrfCounterStatsReply{BsnStatsReply: parent} |
| 6884 | |
| 6885 | for decoder.Length() >= 8 { |
| 6886 | item, err := DecodeBsnVrfCounterStatsEntry(decoder) |
| 6887 | if err != nil { |
| 6888 | return nil, err |
| 6889 | } |
| 6890 | if item != nil { |
| 6891 | _bsnvrfcounterstatsreply.Entries = append(_bsnvrfcounterstatsreply.Entries, item) |
| 6892 | } |
| 6893 | } |
| 6894 | return _bsnvrfcounterstatsreply, nil |
| 6895 | } |
| 6896 | |
| 6897 | func NewBsnVrfCounterStatsReply() *BsnVrfCounterStatsReply { |
| 6898 | obj := &BsnVrfCounterStatsReply{ |
| 6899 | BsnStatsReply: NewBsnStatsReply(15), |
| 6900 | } |
| 6901 | return obj |
| 6902 | } |
| 6903 | |
| 6904 | type BsnVrfCounterStatsRequest struct { |
| 6905 | *BsnStatsRequest |
| 6906 | Vrf uint32 |
| 6907 | } |
| 6908 | |
| 6909 | type IBsnVrfCounterStatsRequest interface { |
| 6910 | IBsnStatsRequest |
| 6911 | GetVrf() uint32 |
| 6912 | } |
| 6913 | |
| 6914 | func (self *BsnVrfCounterStatsRequest) GetVrf() uint32 { |
| 6915 | return self.Vrf |
| 6916 | } |
| 6917 | |
| 6918 | func (self *BsnVrfCounterStatsRequest) SetVrf(v uint32) { |
| 6919 | self.Vrf = v |
| 6920 | } |
| 6921 | |
| 6922 | func (self *BsnVrfCounterStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 6923 | startIndex := len(encoder.Bytes()) |
| 6924 | if err := self.BsnStatsRequest.Serialize(encoder); err != nil { |
| 6925 | return err |
| 6926 | } |
| 6927 | |
| 6928 | encoder.PutUint32(uint32(self.Vrf)) |
| 6929 | length := len(encoder.Bytes()) - startIndex |
| 6930 | |
| 6931 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 6932 | |
| 6933 | return nil |
| 6934 | } |
| 6935 | |
| 6936 | func DecodeBsnVrfCounterStatsRequest(parent *BsnStatsRequest, decoder *goloxi.Decoder) (*BsnVrfCounterStatsRequest, error) { |
| 6937 | _bsnvrfcounterstatsrequest := &BsnVrfCounterStatsRequest{BsnStatsRequest: parent} |
| 6938 | if decoder.Length() < 4 { |
| 6939 | return nil, fmt.Errorf("BsnVrfCounterStatsRequest packet too short: %d < 4", decoder.Length()) |
| 6940 | } |
| 6941 | _bsnvrfcounterstatsrequest.Vrf = uint32(decoder.ReadUint32()) |
| 6942 | return _bsnvrfcounterstatsrequest, nil |
| 6943 | } |
| 6944 | |
| 6945 | func NewBsnVrfCounterStatsRequest() *BsnVrfCounterStatsRequest { |
| 6946 | obj := &BsnVrfCounterStatsRequest{ |
| 6947 | BsnStatsRequest: NewBsnStatsRequest(15), |
| 6948 | } |
| 6949 | return obj |
| 6950 | } |
| 6951 | |
| 6952 | type BundleAddMsg struct { |
| 6953 | *Header |
| 6954 | BundleId uint32 |
| 6955 | Flags BundleFlags |
| 6956 | Data []byte |
| 6957 | } |
| 6958 | |
| 6959 | type IBundleAddMsg interface { |
| 6960 | IHeader |
| 6961 | GetBundleId() uint32 |
| 6962 | GetFlags() BundleFlags |
| 6963 | GetData() []byte |
| 6964 | } |
| 6965 | |
| 6966 | func (self *BundleAddMsg) GetBundleId() uint32 { |
| 6967 | return self.BundleId |
| 6968 | } |
| 6969 | |
| 6970 | func (self *BundleAddMsg) SetBundleId(v uint32) { |
| 6971 | self.BundleId = v |
| 6972 | } |
| 6973 | |
| 6974 | func (self *BundleAddMsg) GetFlags() BundleFlags { |
| 6975 | return self.Flags |
| 6976 | } |
| 6977 | |
| 6978 | func (self *BundleAddMsg) SetFlags(v BundleFlags) { |
| 6979 | self.Flags = v |
| 6980 | } |
| 6981 | |
| 6982 | func (self *BundleAddMsg) GetData() []byte { |
| 6983 | return self.Data |
| 6984 | } |
| 6985 | |
| 6986 | func (self *BundleAddMsg) SetData(v []byte) { |
| 6987 | self.Data = v |
| 6988 | } |
| 6989 | |
| 6990 | func (self *BundleAddMsg) Serialize(encoder *goloxi.Encoder) error { |
| 6991 | startIndex := len(encoder.Bytes()) |
| 6992 | if err := self.Header.Serialize(encoder); err != nil { |
| 6993 | return err |
| 6994 | } |
| 6995 | |
| 6996 | encoder.PutUint32(uint32(self.BundleId)) |
| 6997 | encoder.Write(bytes.Repeat([]byte{0}, 2)) |
| 6998 | encoder.PutUint16(uint16(self.Flags)) |
| 6999 | encoder.Write(self.Data) |
| 7000 | length := len(encoder.Bytes()) - startIndex |
| 7001 | |
| 7002 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 7003 | |
| 7004 | return nil |
| 7005 | } |
| 7006 | |
| 7007 | func DecodeBundleAddMsg(parent *Header, decoder *goloxi.Decoder) (*BundleAddMsg, error) { |
| 7008 | _bundleaddmsg := &BundleAddMsg{Header: parent} |
| 7009 | if decoder.Length() < 8 { |
| 7010 | return nil, fmt.Errorf("BundleAddMsg packet too short: %d < 8", decoder.Length()) |
| 7011 | } |
| 7012 | _bundleaddmsg.BundleId = uint32(decoder.ReadUint32()) |
| 7013 | decoder.Skip(2) |
| 7014 | _bundleaddmsg.Flags = BundleFlags(decoder.ReadUint16()) |
| 7015 | _bundleaddmsg.Data = decoder.Read(int(decoder.Length())) |
| 7016 | return _bundleaddmsg, nil |
| 7017 | } |
| 7018 | |
| 7019 | func NewBundleAddMsg() *BundleAddMsg { |
| 7020 | obj := &BundleAddMsg{ |
| 7021 | Header: NewHeader(34), |
| 7022 | } |
| 7023 | return obj |
| 7024 | } |
| 7025 | |
| 7026 | type BundleCtrlMsg struct { |
| 7027 | *Header |
| 7028 | BundleId uint32 |
| 7029 | BundleCtrlType BundleCtrlType |
| 7030 | Flags BundleFlags |
| 7031 | Properties []IBundleProp |
| 7032 | } |
| 7033 | |
| 7034 | type IBundleCtrlMsg interface { |
| 7035 | IHeader |
| 7036 | GetBundleId() uint32 |
| 7037 | GetBundleCtrlType() BundleCtrlType |
| 7038 | GetFlags() BundleFlags |
| 7039 | GetProperties() []IBundleProp |
| 7040 | } |
| 7041 | |
| 7042 | func (self *BundleCtrlMsg) GetBundleId() uint32 { |
| 7043 | return self.BundleId |
| 7044 | } |
| 7045 | |
| 7046 | func (self *BundleCtrlMsg) SetBundleId(v uint32) { |
| 7047 | self.BundleId = v |
| 7048 | } |
| 7049 | |
| 7050 | func (self *BundleCtrlMsg) GetBundleCtrlType() BundleCtrlType { |
| 7051 | return self.BundleCtrlType |
| 7052 | } |
| 7053 | |
| 7054 | func (self *BundleCtrlMsg) SetBundleCtrlType(v BundleCtrlType) { |
| 7055 | self.BundleCtrlType = v |
| 7056 | } |
| 7057 | |
| 7058 | func (self *BundleCtrlMsg) GetFlags() BundleFlags { |
| 7059 | return self.Flags |
| 7060 | } |
| 7061 | |
| 7062 | func (self *BundleCtrlMsg) SetFlags(v BundleFlags) { |
| 7063 | self.Flags = v |
| 7064 | } |
| 7065 | |
| 7066 | func (self *BundleCtrlMsg) GetProperties() []IBundleProp { |
| 7067 | return self.Properties |
| 7068 | } |
| 7069 | |
| 7070 | func (self *BundleCtrlMsg) SetProperties(v []IBundleProp) { |
| 7071 | self.Properties = v |
| 7072 | } |
| 7073 | |
| 7074 | func (self *BundleCtrlMsg) Serialize(encoder *goloxi.Encoder) error { |
| 7075 | startIndex := len(encoder.Bytes()) |
| 7076 | if err := self.Header.Serialize(encoder); err != nil { |
| 7077 | return err |
| 7078 | } |
| 7079 | |
| 7080 | encoder.PutUint32(uint32(self.BundleId)) |
| 7081 | encoder.PutUint16(uint16(self.BundleCtrlType)) |
| 7082 | encoder.PutUint16(uint16(self.Flags)) |
| 7083 | for _, obj := range self.Properties { |
| 7084 | if err := obj.Serialize(encoder); err != nil { |
| 7085 | return err |
| 7086 | } |
| 7087 | } |
| 7088 | length := len(encoder.Bytes()) - startIndex |
| 7089 | |
| 7090 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 7091 | |
| 7092 | return nil |
| 7093 | } |
| 7094 | |
| 7095 | func DecodeBundleCtrlMsg(parent *Header, decoder *goloxi.Decoder) (*BundleCtrlMsg, error) { |
| 7096 | _bundlectrlmsg := &BundleCtrlMsg{Header: parent} |
| 7097 | if decoder.Length() < 8 { |
| 7098 | return nil, fmt.Errorf("BundleCtrlMsg packet too short: %d < 8", decoder.Length()) |
| 7099 | } |
| 7100 | _bundlectrlmsg.BundleId = uint32(decoder.ReadUint32()) |
| 7101 | _bundlectrlmsg.BundleCtrlType = BundleCtrlType(decoder.ReadUint16()) |
| 7102 | _bundlectrlmsg.Flags = BundleFlags(decoder.ReadUint16()) |
| 7103 | |
| 7104 | for decoder.Length() >= 4 { |
| 7105 | item, err := DecodeBundleProp(decoder) |
| 7106 | if err != nil { |
| 7107 | return nil, err |
| 7108 | } |
| 7109 | if item != nil { |
| 7110 | _bundlectrlmsg.Properties = append(_bundlectrlmsg.Properties, item) |
| 7111 | } |
| 7112 | } |
| 7113 | return _bundlectrlmsg, nil |
| 7114 | } |
| 7115 | |
| 7116 | func NewBundleCtrlMsg() *BundleCtrlMsg { |
| 7117 | obj := &BundleCtrlMsg{ |
| 7118 | Header: NewHeader(33), |
| 7119 | } |
| 7120 | return obj |
| 7121 | } |
| 7122 | |
| 7123 | type BundleFailedErrorMsg struct { |
| 7124 | *ErrorMsg |
| 7125 | Code BundleFailedCode |
| 7126 | Data []byte |
| 7127 | } |
| 7128 | |
| 7129 | type IBundleFailedErrorMsg interface { |
| 7130 | IErrorMsg |
| 7131 | GetCode() BundleFailedCode |
| 7132 | GetData() []byte |
| 7133 | } |
| 7134 | |
| 7135 | func (self *BundleFailedErrorMsg) GetCode() BundleFailedCode { |
| 7136 | return self.Code |
| 7137 | } |
| 7138 | |
| 7139 | func (self *BundleFailedErrorMsg) SetCode(v BundleFailedCode) { |
| 7140 | self.Code = v |
| 7141 | } |
| 7142 | |
| 7143 | func (self *BundleFailedErrorMsg) GetData() []byte { |
| 7144 | return self.Data |
| 7145 | } |
| 7146 | |
| 7147 | func (self *BundleFailedErrorMsg) SetData(v []byte) { |
| 7148 | self.Data = v |
| 7149 | } |
| 7150 | |
| 7151 | func (self *BundleFailedErrorMsg) Serialize(encoder *goloxi.Encoder) error { |
| 7152 | startIndex := len(encoder.Bytes()) |
| 7153 | if err := self.ErrorMsg.Serialize(encoder); err != nil { |
| 7154 | return err |
| 7155 | } |
| 7156 | |
| 7157 | encoder.PutUint16(uint16(self.Code)) |
| 7158 | encoder.Write(self.Data) |
| 7159 | length := len(encoder.Bytes()) - startIndex |
| 7160 | |
| 7161 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 7162 | |
| 7163 | return nil |
| 7164 | } |
| 7165 | |
| 7166 | func DecodeBundleFailedErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*BundleFailedErrorMsg, error) { |
| 7167 | _bundlefailederrormsg := &BundleFailedErrorMsg{ErrorMsg: parent} |
| 7168 | if decoder.Length() < 2 { |
| 7169 | return nil, fmt.Errorf("BundleFailedErrorMsg packet too short: %d < 2", decoder.Length()) |
| 7170 | } |
| 7171 | _bundlefailederrormsg.Code = BundleFailedCode(decoder.ReadUint16()) |
| 7172 | _bundlefailederrormsg.Data = decoder.Read(int(decoder.Length())) |
| 7173 | return _bundlefailederrormsg, nil |
| 7174 | } |
| 7175 | |
| 7176 | func NewBundleFailedErrorMsg() *BundleFailedErrorMsg { |
| 7177 | obj := &BundleFailedErrorMsg{ |
| 7178 | ErrorMsg: NewErrorMsg(17), |
| 7179 | } |
| 7180 | return obj |
| 7181 | } |
| 7182 | |
| 7183 | type DescStatsReply struct { |
| 7184 | *StatsReply |
| 7185 | MfrDesc string |
| 7186 | HwDesc string |
| 7187 | SwDesc string |
| 7188 | SerialNum string |
| 7189 | DpDesc string |
| 7190 | } |
| 7191 | |
| 7192 | type IDescStatsReply interface { |
| 7193 | IStatsReply |
| 7194 | GetMfrDesc() string |
| 7195 | GetHwDesc() string |
| 7196 | GetSwDesc() string |
| 7197 | GetSerialNum() string |
| 7198 | GetDpDesc() string |
| 7199 | } |
| 7200 | |
| 7201 | func (self *DescStatsReply) GetMfrDesc() string { |
| 7202 | return self.MfrDesc |
| 7203 | } |
| 7204 | |
| 7205 | func (self *DescStatsReply) SetMfrDesc(v string) { |
| 7206 | self.MfrDesc = v |
| 7207 | } |
| 7208 | |
| 7209 | func (self *DescStatsReply) GetHwDesc() string { |
| 7210 | return self.HwDesc |
| 7211 | } |
| 7212 | |
| 7213 | func (self *DescStatsReply) SetHwDesc(v string) { |
| 7214 | self.HwDesc = v |
| 7215 | } |
| 7216 | |
| 7217 | func (self *DescStatsReply) GetSwDesc() string { |
| 7218 | return self.SwDesc |
| 7219 | } |
| 7220 | |
| 7221 | func (self *DescStatsReply) SetSwDesc(v string) { |
| 7222 | self.SwDesc = v |
| 7223 | } |
| 7224 | |
| 7225 | func (self *DescStatsReply) GetSerialNum() string { |
| 7226 | return self.SerialNum |
| 7227 | } |
| 7228 | |
| 7229 | func (self *DescStatsReply) SetSerialNum(v string) { |
| 7230 | self.SerialNum = v |
| 7231 | } |
| 7232 | |
| 7233 | func (self *DescStatsReply) GetDpDesc() string { |
| 7234 | return self.DpDesc |
| 7235 | } |
| 7236 | |
| 7237 | func (self *DescStatsReply) SetDpDesc(v string) { |
| 7238 | self.DpDesc = v |
| 7239 | } |
| 7240 | |
| 7241 | func (self *DescStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 7242 | startIndex := len(encoder.Bytes()) |
| 7243 | if err := self.StatsReply.Serialize(encoder); err != nil { |
| 7244 | return err |
| 7245 | } |
| 7246 | |
| 7247 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 7248 | encoder.Write([]byte(self.MfrDesc)) |
| 7249 | encoder.Write([]byte(self.HwDesc)) |
| 7250 | encoder.Write([]byte(self.SwDesc)) |
| 7251 | encoder.Write([]byte(self.SerialNum)) |
| 7252 | encoder.Write([]byte(self.DpDesc)) |
| 7253 | length := len(encoder.Bytes()) - startIndex |
| 7254 | |
| 7255 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 7256 | |
| 7257 | return nil |
| 7258 | } |
| 7259 | |
| 7260 | func DecodeDescStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*DescStatsReply, error) { |
| 7261 | _descstatsreply := &DescStatsReply{StatsReply: parent} |
| 7262 | if decoder.Length() < 1060 { |
| 7263 | return nil, fmt.Errorf("DescStatsReply packet too short: %d < 1060", decoder.Length()) |
| 7264 | } |
| 7265 | decoder.Skip(4) |
| 7266 | _descstatsreply.MfrDesc = string(bytes.Trim(decoder.Read(256), "\x00")) |
| 7267 | _descstatsreply.HwDesc = string(bytes.Trim(decoder.Read(256), "\x00")) |
| 7268 | _descstatsreply.SwDesc = string(bytes.Trim(decoder.Read(256), "\x00")) |
| 7269 | _descstatsreply.SerialNum = string(bytes.Trim(decoder.Read(32), "\x00")) |
| 7270 | _descstatsreply.DpDesc = string(bytes.Trim(decoder.Read(256), "\x00")) |
| 7271 | return _descstatsreply, nil |
| 7272 | } |
| 7273 | |
| 7274 | func NewDescStatsReply() *DescStatsReply { |
| 7275 | obj := &DescStatsReply{ |
| 7276 | StatsReply: NewStatsReply(0), |
| 7277 | } |
| 7278 | return obj |
| 7279 | } |
| 7280 | |
| 7281 | type DescStatsRequest struct { |
| 7282 | *StatsRequest |
| 7283 | } |
| 7284 | |
| 7285 | type IDescStatsRequest interface { |
| 7286 | IStatsRequest |
| 7287 | } |
| 7288 | |
| 7289 | func (self *DescStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 7290 | startIndex := len(encoder.Bytes()) |
| 7291 | if err := self.StatsRequest.Serialize(encoder); err != nil { |
| 7292 | return err |
| 7293 | } |
| 7294 | |
| 7295 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 7296 | length := len(encoder.Bytes()) - startIndex |
| 7297 | |
| 7298 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 7299 | |
| 7300 | return nil |
| 7301 | } |
| 7302 | |
| 7303 | func DecodeDescStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*DescStatsRequest, error) { |
| 7304 | _descstatsrequest := &DescStatsRequest{StatsRequest: parent} |
| 7305 | if decoder.Length() < 4 { |
| 7306 | return nil, fmt.Errorf("DescStatsRequest packet too short: %d < 4", decoder.Length()) |
| 7307 | } |
| 7308 | decoder.Skip(4) |
| 7309 | return _descstatsrequest, nil |
| 7310 | } |
| 7311 | |
| 7312 | func NewDescStatsRequest() *DescStatsRequest { |
| 7313 | obj := &DescStatsRequest{ |
| 7314 | StatsRequest: NewStatsRequest(0), |
| 7315 | } |
| 7316 | return obj |
| 7317 | } |
| 7318 | |
| 7319 | type EchoReply struct { |
| 7320 | *Header |
| 7321 | Data []byte |
| 7322 | } |
| 7323 | |
| 7324 | type IEchoReply interface { |
| 7325 | IHeader |
| 7326 | GetData() []byte |
| 7327 | } |
| 7328 | |
| 7329 | func (self *EchoReply) GetData() []byte { |
| 7330 | return self.Data |
| 7331 | } |
| 7332 | |
| 7333 | func (self *EchoReply) SetData(v []byte) { |
| 7334 | self.Data = v |
| 7335 | } |
| 7336 | |
| 7337 | func (self *EchoReply) Serialize(encoder *goloxi.Encoder) error { |
| 7338 | startIndex := len(encoder.Bytes()) |
| 7339 | if err := self.Header.Serialize(encoder); err != nil { |
| 7340 | return err |
| 7341 | } |
| 7342 | |
| 7343 | encoder.Write(self.Data) |
| 7344 | length := len(encoder.Bytes()) - startIndex |
| 7345 | |
| 7346 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 7347 | |
| 7348 | return nil |
| 7349 | } |
| 7350 | |
| 7351 | func DecodeEchoReply(parent *Header, decoder *goloxi.Decoder) (*EchoReply, error) { |
| 7352 | _echoreply := &EchoReply{Header: parent} |
| 7353 | _echoreply.Data = decoder.Read(int(decoder.Length())) |
| 7354 | return _echoreply, nil |
| 7355 | } |
| 7356 | |
| 7357 | func NewEchoReply() *EchoReply { |
| 7358 | obj := &EchoReply{ |
| 7359 | Header: NewHeader(3), |
| 7360 | } |
| 7361 | return obj |
| 7362 | } |
| 7363 | |
| 7364 | type EchoRequest struct { |
| 7365 | *Header |
| 7366 | Data []byte |
| 7367 | } |
| 7368 | |
| 7369 | type IEchoRequest interface { |
| 7370 | IHeader |
| 7371 | GetData() []byte |
| 7372 | } |
| 7373 | |
| 7374 | func (self *EchoRequest) GetData() []byte { |
| 7375 | return self.Data |
| 7376 | } |
| 7377 | |
| 7378 | func (self *EchoRequest) SetData(v []byte) { |
| 7379 | self.Data = v |
| 7380 | } |
| 7381 | |
| 7382 | func (self *EchoRequest) Serialize(encoder *goloxi.Encoder) error { |
| 7383 | startIndex := len(encoder.Bytes()) |
| 7384 | if err := self.Header.Serialize(encoder); err != nil { |
| 7385 | return err |
| 7386 | } |
| 7387 | |
| 7388 | encoder.Write(self.Data) |
| 7389 | length := len(encoder.Bytes()) - startIndex |
| 7390 | |
| 7391 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 7392 | |
| 7393 | return nil |
| 7394 | } |
| 7395 | |
| 7396 | func DecodeEchoRequest(parent *Header, decoder *goloxi.Decoder) (*EchoRequest, error) { |
| 7397 | _echorequest := &EchoRequest{Header: parent} |
| 7398 | _echorequest.Data = decoder.Read(int(decoder.Length())) |
| 7399 | return _echorequest, nil |
| 7400 | } |
| 7401 | |
| 7402 | func NewEchoRequest() *EchoRequest { |
| 7403 | obj := &EchoRequest{ |
| 7404 | Header: NewHeader(2), |
| 7405 | } |
| 7406 | return obj |
| 7407 | } |
| 7408 | |
| 7409 | type FeaturesReply struct { |
| 7410 | *Header |
| 7411 | DatapathId uint64 |
| 7412 | NBuffers uint32 |
| 7413 | NTables uint8 |
| 7414 | AuxiliaryId uint8 |
| 7415 | Capabilities Capabilities |
| 7416 | Reserved uint32 |
| 7417 | } |
| 7418 | |
| 7419 | type IFeaturesReply interface { |
| 7420 | IHeader |
| 7421 | GetDatapathId() uint64 |
| 7422 | GetNBuffers() uint32 |
| 7423 | GetNTables() uint8 |
| 7424 | GetAuxiliaryId() uint8 |
| 7425 | GetCapabilities() Capabilities |
| 7426 | GetReserved() uint32 |
| 7427 | } |
| 7428 | |
| 7429 | func (self *FeaturesReply) GetDatapathId() uint64 { |
| 7430 | return self.DatapathId |
| 7431 | } |
| 7432 | |
| 7433 | func (self *FeaturesReply) SetDatapathId(v uint64) { |
| 7434 | self.DatapathId = v |
| 7435 | } |
| 7436 | |
| 7437 | func (self *FeaturesReply) GetNBuffers() uint32 { |
| 7438 | return self.NBuffers |
| 7439 | } |
| 7440 | |
| 7441 | func (self *FeaturesReply) SetNBuffers(v uint32) { |
| 7442 | self.NBuffers = v |
| 7443 | } |
| 7444 | |
| 7445 | func (self *FeaturesReply) GetNTables() uint8 { |
| 7446 | return self.NTables |
| 7447 | } |
| 7448 | |
| 7449 | func (self *FeaturesReply) SetNTables(v uint8) { |
| 7450 | self.NTables = v |
| 7451 | } |
| 7452 | |
| 7453 | func (self *FeaturesReply) GetAuxiliaryId() uint8 { |
| 7454 | return self.AuxiliaryId |
| 7455 | } |
| 7456 | |
| 7457 | func (self *FeaturesReply) SetAuxiliaryId(v uint8) { |
| 7458 | self.AuxiliaryId = v |
| 7459 | } |
| 7460 | |
| 7461 | func (self *FeaturesReply) GetCapabilities() Capabilities { |
| 7462 | return self.Capabilities |
| 7463 | } |
| 7464 | |
| 7465 | func (self *FeaturesReply) SetCapabilities(v Capabilities) { |
| 7466 | self.Capabilities = v |
| 7467 | } |
| 7468 | |
| 7469 | func (self *FeaturesReply) GetReserved() uint32 { |
| 7470 | return self.Reserved |
| 7471 | } |
| 7472 | |
| 7473 | func (self *FeaturesReply) SetReserved(v uint32) { |
| 7474 | self.Reserved = v |
| 7475 | } |
| 7476 | |
| 7477 | func (self *FeaturesReply) Serialize(encoder *goloxi.Encoder) error { |
| 7478 | startIndex := len(encoder.Bytes()) |
| 7479 | if err := self.Header.Serialize(encoder); err != nil { |
| 7480 | return err |
| 7481 | } |
| 7482 | |
| 7483 | encoder.PutUint64(uint64(self.DatapathId)) |
| 7484 | encoder.PutUint32(uint32(self.NBuffers)) |
| 7485 | encoder.PutUint8(uint8(self.NTables)) |
| 7486 | encoder.PutUint8(uint8(self.AuxiliaryId)) |
| 7487 | encoder.Write(bytes.Repeat([]byte{0}, 2)) |
| 7488 | encoder.PutUint32(uint32(self.Capabilities)) |
| 7489 | encoder.PutUint32(uint32(self.Reserved)) |
| 7490 | length := len(encoder.Bytes()) - startIndex |
| 7491 | |
| 7492 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 7493 | |
| 7494 | return nil |
| 7495 | } |
| 7496 | |
| 7497 | func DecodeFeaturesReply(parent *Header, decoder *goloxi.Decoder) (*FeaturesReply, error) { |
| 7498 | _featuresreply := &FeaturesReply{Header: parent} |
| 7499 | if decoder.Length() < 24 { |
| 7500 | return nil, fmt.Errorf("FeaturesReply packet too short: %d < 24", decoder.Length()) |
| 7501 | } |
| 7502 | _featuresreply.DatapathId = uint64(decoder.ReadUint64()) |
| 7503 | _featuresreply.NBuffers = uint32(decoder.ReadUint32()) |
| 7504 | _featuresreply.NTables = uint8(decoder.ReadByte()) |
| 7505 | _featuresreply.AuxiliaryId = uint8(decoder.ReadByte()) |
| 7506 | decoder.Skip(2) |
| 7507 | _featuresreply.Capabilities = Capabilities(decoder.ReadUint32()) |
| 7508 | _featuresreply.Reserved = uint32(decoder.ReadUint32()) |
| 7509 | return _featuresreply, nil |
| 7510 | } |
| 7511 | |
| 7512 | func NewFeaturesReply() *FeaturesReply { |
| 7513 | obj := &FeaturesReply{ |
| 7514 | Header: NewHeader(6), |
| 7515 | } |
| 7516 | return obj |
| 7517 | } |
| 7518 | |
| 7519 | type FeaturesRequest struct { |
| 7520 | *Header |
| 7521 | } |
| 7522 | |
| 7523 | type IFeaturesRequest interface { |
| 7524 | IHeader |
| 7525 | } |
| 7526 | |
| 7527 | func (self *FeaturesRequest) Serialize(encoder *goloxi.Encoder) error { |
| 7528 | startIndex := len(encoder.Bytes()) |
| 7529 | if err := self.Header.Serialize(encoder); err != nil { |
| 7530 | return err |
| 7531 | } |
| 7532 | length := len(encoder.Bytes()) - startIndex |
| 7533 | |
| 7534 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 7535 | |
| 7536 | return nil |
| 7537 | } |
| 7538 | |
| 7539 | func DecodeFeaturesRequest(parent *Header, decoder *goloxi.Decoder) (*FeaturesRequest, error) { |
| 7540 | _featuresrequest := &FeaturesRequest{Header: parent} |
| 7541 | return _featuresrequest, nil |
| 7542 | } |
| 7543 | |
| 7544 | func NewFeaturesRequest() *FeaturesRequest { |
| 7545 | obj := &FeaturesRequest{ |
| 7546 | Header: NewHeader(5), |
| 7547 | } |
| 7548 | return obj |
| 7549 | } |
| 7550 | |
| 7551 | type FlowMod struct { |
| 7552 | *Header |
| 7553 | Cookie uint64 |
| 7554 | CookieMask uint64 |
| 7555 | TableId uint8 |
| 7556 | Command FmCmd |
| 7557 | IdleTimeout uint16 |
| 7558 | HardTimeout uint16 |
| 7559 | Priority uint16 |
| 7560 | BufferId uint32 |
| 7561 | OutPort Port |
| 7562 | OutGroup uint32 |
| 7563 | Flags FlowModFlags |
| 7564 | Match Match |
| 7565 | Instructions []IInstruction |
| 7566 | } |
| 7567 | |
| 7568 | type IFlowMod interface { |
| 7569 | IHeader |
| 7570 | GetCookie() uint64 |
| 7571 | GetCookieMask() uint64 |
| 7572 | GetTableId() uint8 |
| 7573 | GetCommand() FmCmd |
| 7574 | GetIdleTimeout() uint16 |
| 7575 | GetHardTimeout() uint16 |
| 7576 | GetPriority() uint16 |
| 7577 | GetBufferId() uint32 |
| 7578 | GetOutPort() Port |
| 7579 | GetOutGroup() uint32 |
| 7580 | GetFlags() FlowModFlags |
| 7581 | GetMatch() Match |
| 7582 | GetInstructions() []IInstruction |
| 7583 | } |
| 7584 | |
| 7585 | func (self *FlowMod) GetCookie() uint64 { |
| 7586 | return self.Cookie |
| 7587 | } |
| 7588 | |
| 7589 | func (self *FlowMod) SetCookie(v uint64) { |
| 7590 | self.Cookie = v |
| 7591 | } |
| 7592 | |
| 7593 | func (self *FlowMod) GetCookieMask() uint64 { |
| 7594 | return self.CookieMask |
| 7595 | } |
| 7596 | |
| 7597 | func (self *FlowMod) SetCookieMask(v uint64) { |
| 7598 | self.CookieMask = v |
| 7599 | } |
| 7600 | |
| 7601 | func (self *FlowMod) GetTableId() uint8 { |
| 7602 | return self.TableId |
| 7603 | } |
| 7604 | |
| 7605 | func (self *FlowMod) SetTableId(v uint8) { |
| 7606 | self.TableId = v |
| 7607 | } |
| 7608 | |
| 7609 | func (self *FlowMod) GetCommand() FmCmd { |
| 7610 | return self.Command |
| 7611 | } |
| 7612 | |
| 7613 | func (self *FlowMod) SetCommand(v FmCmd) { |
| 7614 | self.Command = v |
| 7615 | } |
| 7616 | |
| 7617 | func (self *FlowMod) GetIdleTimeout() uint16 { |
| 7618 | return self.IdleTimeout |
| 7619 | } |
| 7620 | |
| 7621 | func (self *FlowMod) SetIdleTimeout(v uint16) { |
| 7622 | self.IdleTimeout = v |
| 7623 | } |
| 7624 | |
| 7625 | func (self *FlowMod) GetHardTimeout() uint16 { |
| 7626 | return self.HardTimeout |
| 7627 | } |
| 7628 | |
| 7629 | func (self *FlowMod) SetHardTimeout(v uint16) { |
| 7630 | self.HardTimeout = v |
| 7631 | } |
| 7632 | |
| 7633 | func (self *FlowMod) GetPriority() uint16 { |
| 7634 | return self.Priority |
| 7635 | } |
| 7636 | |
| 7637 | func (self *FlowMod) SetPriority(v uint16) { |
| 7638 | self.Priority = v |
| 7639 | } |
| 7640 | |
| 7641 | func (self *FlowMod) GetBufferId() uint32 { |
| 7642 | return self.BufferId |
| 7643 | } |
| 7644 | |
| 7645 | func (self *FlowMod) SetBufferId(v uint32) { |
| 7646 | self.BufferId = v |
| 7647 | } |
| 7648 | |
| 7649 | func (self *FlowMod) GetOutPort() Port { |
| 7650 | return self.OutPort |
| 7651 | } |
| 7652 | |
| 7653 | func (self *FlowMod) SetOutPort(v Port) { |
| 7654 | self.OutPort = v |
| 7655 | } |
| 7656 | |
| 7657 | func (self *FlowMod) GetOutGroup() uint32 { |
| 7658 | return self.OutGroup |
| 7659 | } |
| 7660 | |
| 7661 | func (self *FlowMod) SetOutGroup(v uint32) { |
| 7662 | self.OutGroup = v |
| 7663 | } |
| 7664 | |
| 7665 | func (self *FlowMod) GetFlags() FlowModFlags { |
| 7666 | return self.Flags |
| 7667 | } |
| 7668 | |
| 7669 | func (self *FlowMod) SetFlags(v FlowModFlags) { |
| 7670 | self.Flags = v |
| 7671 | } |
| 7672 | |
| 7673 | func (self *FlowMod) GetMatch() Match { |
| 7674 | return self.Match |
| 7675 | } |
| 7676 | |
| 7677 | func (self *FlowMod) SetMatch(v Match) { |
| 7678 | self.Match = v |
| 7679 | } |
| 7680 | |
| 7681 | func (self *FlowMod) GetInstructions() []IInstruction { |
| 7682 | return self.Instructions |
| 7683 | } |
| 7684 | |
| 7685 | func (self *FlowMod) SetInstructions(v []IInstruction) { |
| 7686 | self.Instructions = v |
| 7687 | } |
| 7688 | |
| 7689 | func (self *FlowMod) Serialize(encoder *goloxi.Encoder) error { |
| 7690 | if err := self.Header.Serialize(encoder); err != nil { |
| 7691 | return err |
| 7692 | } |
| 7693 | |
| 7694 | encoder.PutUint64(uint64(self.Cookie)) |
| 7695 | encoder.PutUint64(uint64(self.CookieMask)) |
| 7696 | encoder.PutUint8(uint8(self.TableId)) |
| 7697 | self.Command.Serialize(encoder) |
| 7698 | encoder.PutUint16(uint16(self.IdleTimeout)) |
| 7699 | encoder.PutUint16(uint16(self.HardTimeout)) |
| 7700 | encoder.PutUint16(uint16(self.Priority)) |
| 7701 | encoder.PutUint32(uint32(self.BufferId)) |
| 7702 | self.OutPort.Serialize(encoder) |
| 7703 | encoder.PutUint32(uint32(self.OutGroup)) |
| 7704 | encoder.PutUint16(uint16(self.Flags)) |
| 7705 | encoder.Write(bytes.Repeat([]byte{0}, 2)) |
| 7706 | if err := self.Match.Serialize(encoder); err != nil { |
| 7707 | return err |
| 7708 | } |
| 7709 | |
| 7710 | for _, obj := range self.Instructions { |
| 7711 | if err := obj.Serialize(encoder); err != nil { |
| 7712 | return err |
| 7713 | } |
| 7714 | } |
| 7715 | |
| 7716 | return nil |
| 7717 | } |
| 7718 | |
| 7719 | func DecodeFlowMod(parent *Header, decoder *goloxi.Decoder) (IFlowMod, error) { |
| 7720 | _flowmod := &FlowMod{Header: parent} |
| 7721 | if decoder.Length() < 48 { |
| 7722 | return nil, fmt.Errorf("FlowMod packet too short: %d < 48", decoder.Length()) |
| 7723 | } |
| 7724 | _flowmod.Cookie = uint64(decoder.ReadUint64()) |
| 7725 | _flowmod.CookieMask = uint64(decoder.ReadUint64()) |
| 7726 | _flowmod.TableId = uint8(decoder.ReadByte()) |
| 7727 | _flowmod.Command.Decode(decoder) |
| 7728 | _flowmod.IdleTimeout = uint16(decoder.ReadUint16()) |
| 7729 | _flowmod.HardTimeout = uint16(decoder.ReadUint16()) |
| 7730 | _flowmod.Priority = uint16(decoder.ReadUint16()) |
| 7731 | _flowmod.BufferId = uint32(decoder.ReadUint32()) |
| 7732 | _flowmod.OutPort.Decode(decoder) |
| 7733 | _flowmod.OutGroup = uint32(decoder.ReadUint32()) |
| 7734 | _flowmod.Flags = FlowModFlags(decoder.ReadUint16()) |
| 7735 | decoder.Skip(2) |
| 7736 | if err := _flowmod.Match.Decode(decoder); err != nil { |
| 7737 | return nil, err |
| 7738 | } |
| 7739 | |
| 7740 | decoder.SkipAlign() |
| 7741 | |
| 7742 | for decoder.Length() >= 4 { |
| 7743 | item, err := DecodeInstruction(decoder) |
| 7744 | if err != nil { |
| 7745 | return nil, err |
| 7746 | } |
| 7747 | if item != nil { |
| 7748 | _flowmod.Instructions = append(_flowmod.Instructions, item) |
| 7749 | } |
| 7750 | } |
| 7751 | |
| 7752 | switch _flowmod.Command { |
| 7753 | case 0: |
| 7754 | return DecodeFlowAdd(_flowmod, decoder) |
| 7755 | case 1: |
| 7756 | return DecodeFlowModify(_flowmod, decoder) |
| 7757 | case 2: |
| 7758 | return DecodeFlowModifyStrict(_flowmod, decoder) |
| 7759 | case 3: |
| 7760 | return DecodeFlowDelete(_flowmod, decoder) |
| 7761 | case 4: |
| 7762 | return DecodeFlowDeleteStrict(_flowmod, decoder) |
| 7763 | default: |
| 7764 | return nil, fmt.Errorf("Invalid type '%d' for 'FlowMod'", _flowmod.Command) |
| 7765 | } |
| 7766 | } |
| 7767 | |
| 7768 | func NewFlowMod(__command FmCmd) *FlowMod { |
| 7769 | obj := &FlowMod{ |
| 7770 | Header: NewHeader(14), |
| 7771 | } |
| 7772 | obj.Command = __command |
| 7773 | return obj |
| 7774 | } |
| 7775 | |
| 7776 | type FlowAdd struct { |
| 7777 | *FlowMod |
| 7778 | Importance uint16 |
| 7779 | } |
| 7780 | |
| 7781 | type IFlowAdd interface { |
| 7782 | IFlowMod |
| 7783 | GetImportance() uint16 |
| 7784 | } |
| 7785 | |
| 7786 | func (self *FlowAdd) GetImportance() uint16 { |
| 7787 | return self.Importance |
| 7788 | } |
| 7789 | |
| 7790 | func (self *FlowAdd) SetImportance(v uint16) { |
| 7791 | self.Importance = v |
| 7792 | } |
| 7793 | |
| 7794 | func (self *FlowAdd) Serialize(encoder *goloxi.Encoder) error { |
| 7795 | startIndex := len(encoder.Bytes()) |
| 7796 | if err := self.FlowMod.Serialize(encoder); err != nil { |
| 7797 | return err |
| 7798 | } |
| 7799 | |
| 7800 | encoder.PutUint16(uint16(self.Importance)) |
| 7801 | length := len(encoder.Bytes()) - startIndex |
| 7802 | |
| 7803 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 7804 | |
| 7805 | return nil |
| 7806 | } |
| 7807 | |
| 7808 | func DecodeFlowAdd(parent *FlowMod, decoder *goloxi.Decoder) (*FlowAdd, error) { |
| 7809 | _flowadd := &FlowAdd{FlowMod: parent} |
| 7810 | if decoder.Length() < 10 { |
| 7811 | return nil, fmt.Errorf("FlowAdd packet too short: %d < 10", decoder.Length()) |
| 7812 | } |
| 7813 | _flowadd.Importance = uint16(decoder.ReadUint16()) |
| 7814 | return _flowadd, nil |
| 7815 | } |
| 7816 | |
| 7817 | func NewFlowAdd() *FlowAdd { |
| 7818 | obj := &FlowAdd{ |
| 7819 | FlowMod: NewFlowMod(0), |
| 7820 | } |
| 7821 | return obj |
| 7822 | } |
| 7823 | |
| 7824 | type FlowDelete struct { |
| 7825 | *FlowMod |
| 7826 | Importance uint16 |
| 7827 | } |
| 7828 | |
| 7829 | type IFlowDelete interface { |
| 7830 | IFlowMod |
| 7831 | GetImportance() uint16 |
| 7832 | } |
| 7833 | |
| 7834 | func (self *FlowDelete) GetImportance() uint16 { |
| 7835 | return self.Importance |
| 7836 | } |
| 7837 | |
| 7838 | func (self *FlowDelete) SetImportance(v uint16) { |
| 7839 | self.Importance = v |
| 7840 | } |
| 7841 | |
| 7842 | func (self *FlowDelete) Serialize(encoder *goloxi.Encoder) error { |
| 7843 | startIndex := len(encoder.Bytes()) |
| 7844 | if err := self.FlowMod.Serialize(encoder); err != nil { |
| 7845 | return err |
| 7846 | } |
| 7847 | |
| 7848 | encoder.PutUint16(uint16(self.Importance)) |
| 7849 | length := len(encoder.Bytes()) - startIndex |
| 7850 | |
| 7851 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 7852 | |
| 7853 | return nil |
| 7854 | } |
| 7855 | |
| 7856 | func DecodeFlowDelete(parent *FlowMod, decoder *goloxi.Decoder) (*FlowDelete, error) { |
| 7857 | _flowdelete := &FlowDelete{FlowMod: parent} |
| 7858 | if decoder.Length() < 10 { |
| 7859 | return nil, fmt.Errorf("FlowDelete packet too short: %d < 10", decoder.Length()) |
| 7860 | } |
| 7861 | _flowdelete.Importance = uint16(decoder.ReadUint16()) |
| 7862 | return _flowdelete, nil |
| 7863 | } |
| 7864 | |
| 7865 | func NewFlowDelete() *FlowDelete { |
| 7866 | obj := &FlowDelete{ |
| 7867 | FlowMod: NewFlowMod(3), |
| 7868 | } |
| 7869 | return obj |
| 7870 | } |
| 7871 | |
| 7872 | type FlowDeleteStrict struct { |
| 7873 | *FlowMod |
| 7874 | Importance uint16 |
| 7875 | } |
| 7876 | |
| 7877 | type IFlowDeleteStrict interface { |
| 7878 | IFlowMod |
| 7879 | GetImportance() uint16 |
| 7880 | } |
| 7881 | |
| 7882 | func (self *FlowDeleteStrict) GetImportance() uint16 { |
| 7883 | return self.Importance |
| 7884 | } |
| 7885 | |
| 7886 | func (self *FlowDeleteStrict) SetImportance(v uint16) { |
| 7887 | self.Importance = v |
| 7888 | } |
| 7889 | |
| 7890 | func (self *FlowDeleteStrict) Serialize(encoder *goloxi.Encoder) error { |
| 7891 | startIndex := len(encoder.Bytes()) |
| 7892 | if err := self.FlowMod.Serialize(encoder); err != nil { |
| 7893 | return err |
| 7894 | } |
| 7895 | |
| 7896 | encoder.PutUint16(uint16(self.Importance)) |
| 7897 | length := len(encoder.Bytes()) - startIndex |
| 7898 | |
| 7899 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 7900 | |
| 7901 | return nil |
| 7902 | } |
| 7903 | |
| 7904 | func DecodeFlowDeleteStrict(parent *FlowMod, decoder *goloxi.Decoder) (*FlowDeleteStrict, error) { |
| 7905 | _flowdeletestrict := &FlowDeleteStrict{FlowMod: parent} |
| 7906 | if decoder.Length() < 10 { |
| 7907 | return nil, fmt.Errorf("FlowDeleteStrict packet too short: %d < 10", decoder.Length()) |
| 7908 | } |
| 7909 | _flowdeletestrict.Importance = uint16(decoder.ReadUint16()) |
| 7910 | return _flowdeletestrict, nil |
| 7911 | } |
| 7912 | |
| 7913 | func NewFlowDeleteStrict() *FlowDeleteStrict { |
| 7914 | obj := &FlowDeleteStrict{ |
| 7915 | FlowMod: NewFlowMod(4), |
| 7916 | } |
| 7917 | return obj |
| 7918 | } |
| 7919 | |
| 7920 | type FlowModFailedErrorMsg struct { |
| 7921 | *ErrorMsg |
| 7922 | Code FlowModFailedCode |
| 7923 | Data []byte |
| 7924 | } |
| 7925 | |
| 7926 | type IFlowModFailedErrorMsg interface { |
| 7927 | IErrorMsg |
| 7928 | GetCode() FlowModFailedCode |
| 7929 | GetData() []byte |
| 7930 | } |
| 7931 | |
| 7932 | func (self *FlowModFailedErrorMsg) GetCode() FlowModFailedCode { |
| 7933 | return self.Code |
| 7934 | } |
| 7935 | |
| 7936 | func (self *FlowModFailedErrorMsg) SetCode(v FlowModFailedCode) { |
| 7937 | self.Code = v |
| 7938 | } |
| 7939 | |
| 7940 | func (self *FlowModFailedErrorMsg) GetData() []byte { |
| 7941 | return self.Data |
| 7942 | } |
| 7943 | |
| 7944 | func (self *FlowModFailedErrorMsg) SetData(v []byte) { |
| 7945 | self.Data = v |
| 7946 | } |
| 7947 | |
| 7948 | func (self *FlowModFailedErrorMsg) Serialize(encoder *goloxi.Encoder) error { |
| 7949 | startIndex := len(encoder.Bytes()) |
| 7950 | if err := self.ErrorMsg.Serialize(encoder); err != nil { |
| 7951 | return err |
| 7952 | } |
| 7953 | |
| 7954 | encoder.PutUint16(uint16(self.Code)) |
| 7955 | encoder.Write(self.Data) |
| 7956 | length := len(encoder.Bytes()) - startIndex |
| 7957 | |
| 7958 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 7959 | |
| 7960 | return nil |
| 7961 | } |
| 7962 | |
| 7963 | func DecodeFlowModFailedErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*FlowModFailedErrorMsg, error) { |
| 7964 | _flowmodfailederrormsg := &FlowModFailedErrorMsg{ErrorMsg: parent} |
| 7965 | if decoder.Length() < 2 { |
| 7966 | return nil, fmt.Errorf("FlowModFailedErrorMsg packet too short: %d < 2", decoder.Length()) |
| 7967 | } |
| 7968 | _flowmodfailederrormsg.Code = FlowModFailedCode(decoder.ReadUint16()) |
| 7969 | _flowmodfailederrormsg.Data = decoder.Read(int(decoder.Length())) |
| 7970 | return _flowmodfailederrormsg, nil |
| 7971 | } |
| 7972 | |
| 7973 | func NewFlowModFailedErrorMsg() *FlowModFailedErrorMsg { |
| 7974 | obj := &FlowModFailedErrorMsg{ |
| 7975 | ErrorMsg: NewErrorMsg(5), |
| 7976 | } |
| 7977 | return obj |
| 7978 | } |
| 7979 | |
| 7980 | type FlowModify struct { |
| 7981 | *FlowMod |
| 7982 | Importance uint16 |
| 7983 | } |
| 7984 | |
| 7985 | type IFlowModify interface { |
| 7986 | IFlowMod |
| 7987 | GetImportance() uint16 |
| 7988 | } |
| 7989 | |
| 7990 | func (self *FlowModify) GetImportance() uint16 { |
| 7991 | return self.Importance |
| 7992 | } |
| 7993 | |
| 7994 | func (self *FlowModify) SetImportance(v uint16) { |
| 7995 | self.Importance = v |
| 7996 | } |
| 7997 | |
| 7998 | func (self *FlowModify) Serialize(encoder *goloxi.Encoder) error { |
| 7999 | startIndex := len(encoder.Bytes()) |
| 8000 | if err := self.FlowMod.Serialize(encoder); err != nil { |
| 8001 | return err |
| 8002 | } |
| 8003 | |
| 8004 | encoder.PutUint16(uint16(self.Importance)) |
| 8005 | length := len(encoder.Bytes()) - startIndex |
| 8006 | |
| 8007 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 8008 | |
| 8009 | return nil |
| 8010 | } |
| 8011 | |
| 8012 | func DecodeFlowModify(parent *FlowMod, decoder *goloxi.Decoder) (*FlowModify, error) { |
| 8013 | _flowmodify := &FlowModify{FlowMod: parent} |
| 8014 | if decoder.Length() < 10 { |
| 8015 | return nil, fmt.Errorf("FlowModify packet too short: %d < 10", decoder.Length()) |
| 8016 | } |
| 8017 | _flowmodify.Importance = uint16(decoder.ReadUint16()) |
| 8018 | return _flowmodify, nil |
| 8019 | } |
| 8020 | |
| 8021 | func NewFlowModify() *FlowModify { |
| 8022 | obj := &FlowModify{ |
| 8023 | FlowMod: NewFlowMod(1), |
| 8024 | } |
| 8025 | return obj |
| 8026 | } |
| 8027 | |
| 8028 | type FlowModifyStrict struct { |
| 8029 | *FlowMod |
| 8030 | Importance uint16 |
| 8031 | } |
| 8032 | |
| 8033 | type IFlowModifyStrict interface { |
| 8034 | IFlowMod |
| 8035 | GetImportance() uint16 |
| 8036 | } |
| 8037 | |
| 8038 | func (self *FlowModifyStrict) GetImportance() uint16 { |
| 8039 | return self.Importance |
| 8040 | } |
| 8041 | |
| 8042 | func (self *FlowModifyStrict) SetImportance(v uint16) { |
| 8043 | self.Importance = v |
| 8044 | } |
| 8045 | |
| 8046 | func (self *FlowModifyStrict) Serialize(encoder *goloxi.Encoder) error { |
| 8047 | startIndex := len(encoder.Bytes()) |
| 8048 | if err := self.FlowMod.Serialize(encoder); err != nil { |
| 8049 | return err |
| 8050 | } |
| 8051 | |
| 8052 | encoder.PutUint16(uint16(self.Importance)) |
| 8053 | length := len(encoder.Bytes()) - startIndex |
| 8054 | |
| 8055 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 8056 | |
| 8057 | return nil |
| 8058 | } |
| 8059 | |
| 8060 | func DecodeFlowModifyStrict(parent *FlowMod, decoder *goloxi.Decoder) (*FlowModifyStrict, error) { |
| 8061 | _flowmodifystrict := &FlowModifyStrict{FlowMod: parent} |
| 8062 | if decoder.Length() < 10 { |
| 8063 | return nil, fmt.Errorf("FlowModifyStrict packet too short: %d < 10", decoder.Length()) |
| 8064 | } |
| 8065 | _flowmodifystrict.Importance = uint16(decoder.ReadUint16()) |
| 8066 | return _flowmodifystrict, nil |
| 8067 | } |
| 8068 | |
| 8069 | func NewFlowModifyStrict() *FlowModifyStrict { |
| 8070 | obj := &FlowModifyStrict{ |
| 8071 | FlowMod: NewFlowMod(2), |
| 8072 | } |
| 8073 | return obj |
| 8074 | } |
| 8075 | |
| 8076 | type FlowMonitorFailedErrorMsg struct { |
| 8077 | *ErrorMsg |
| 8078 | Code FlowMonitorFailedCode |
| 8079 | Data []byte |
| 8080 | } |
| 8081 | |
| 8082 | type IFlowMonitorFailedErrorMsg interface { |
| 8083 | IErrorMsg |
| 8084 | GetCode() FlowMonitorFailedCode |
| 8085 | GetData() []byte |
| 8086 | } |
| 8087 | |
| 8088 | func (self *FlowMonitorFailedErrorMsg) GetCode() FlowMonitorFailedCode { |
| 8089 | return self.Code |
| 8090 | } |
| 8091 | |
| 8092 | func (self *FlowMonitorFailedErrorMsg) SetCode(v FlowMonitorFailedCode) { |
| 8093 | self.Code = v |
| 8094 | } |
| 8095 | |
| 8096 | func (self *FlowMonitorFailedErrorMsg) GetData() []byte { |
| 8097 | return self.Data |
| 8098 | } |
| 8099 | |
| 8100 | func (self *FlowMonitorFailedErrorMsg) SetData(v []byte) { |
| 8101 | self.Data = v |
| 8102 | } |
| 8103 | |
| 8104 | func (self *FlowMonitorFailedErrorMsg) Serialize(encoder *goloxi.Encoder) error { |
| 8105 | startIndex := len(encoder.Bytes()) |
| 8106 | if err := self.ErrorMsg.Serialize(encoder); err != nil { |
| 8107 | return err |
| 8108 | } |
| 8109 | |
| 8110 | encoder.PutUint16(uint16(self.Code)) |
| 8111 | encoder.Write(self.Data) |
| 8112 | length := len(encoder.Bytes()) - startIndex |
| 8113 | |
| 8114 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 8115 | |
| 8116 | return nil |
| 8117 | } |
| 8118 | |
| 8119 | func DecodeFlowMonitorFailedErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*FlowMonitorFailedErrorMsg, error) { |
| 8120 | _flowmonitorfailederrormsg := &FlowMonitorFailedErrorMsg{ErrorMsg: parent} |
| 8121 | if decoder.Length() < 2 { |
| 8122 | return nil, fmt.Errorf("FlowMonitorFailedErrorMsg packet too short: %d < 2", decoder.Length()) |
| 8123 | } |
| 8124 | _flowmonitorfailederrormsg.Code = FlowMonitorFailedCode(decoder.ReadUint16()) |
| 8125 | _flowmonitorfailederrormsg.Data = decoder.Read(int(decoder.Length())) |
| 8126 | return _flowmonitorfailederrormsg, nil |
| 8127 | } |
| 8128 | |
| 8129 | func NewFlowMonitorFailedErrorMsg() *FlowMonitorFailedErrorMsg { |
| 8130 | obj := &FlowMonitorFailedErrorMsg{ |
| 8131 | ErrorMsg: NewErrorMsg(16), |
| 8132 | } |
| 8133 | return obj |
| 8134 | } |
| 8135 | |
| 8136 | type FlowMonitorReply struct { |
| 8137 | *StatsReply |
| 8138 | Entries []IFlowMonitorReplyEntry |
| 8139 | } |
| 8140 | |
| 8141 | type IFlowMonitorReply interface { |
| 8142 | IStatsReply |
| 8143 | GetEntries() []IFlowMonitorReplyEntry |
| 8144 | } |
| 8145 | |
| 8146 | func (self *FlowMonitorReply) GetEntries() []IFlowMonitorReplyEntry { |
| 8147 | return self.Entries |
| 8148 | } |
| 8149 | |
| 8150 | func (self *FlowMonitorReply) SetEntries(v []IFlowMonitorReplyEntry) { |
| 8151 | self.Entries = v |
| 8152 | } |
| 8153 | |
| 8154 | func (self *FlowMonitorReply) Serialize(encoder *goloxi.Encoder) error { |
| 8155 | startIndex := len(encoder.Bytes()) |
| 8156 | if err := self.StatsReply.Serialize(encoder); err != nil { |
| 8157 | return err |
| 8158 | } |
| 8159 | |
| 8160 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 8161 | for _, obj := range self.Entries { |
| 8162 | if err := obj.Serialize(encoder); err != nil { |
| 8163 | return err |
| 8164 | } |
| 8165 | } |
| 8166 | length := len(encoder.Bytes()) - startIndex |
| 8167 | |
| 8168 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 8169 | |
| 8170 | return nil |
| 8171 | } |
| 8172 | |
| 8173 | func DecodeFlowMonitorReply(parent *StatsReply, decoder *goloxi.Decoder) (*FlowMonitorReply, error) { |
| 8174 | _flowmonitorreply := &FlowMonitorReply{StatsReply: parent} |
| 8175 | if decoder.Length() < 4 { |
| 8176 | return nil, fmt.Errorf("FlowMonitorReply packet too short: %d < 4", decoder.Length()) |
| 8177 | } |
| 8178 | decoder.Skip(4) |
| 8179 | |
| 8180 | for decoder.Length() >= 4 { |
| 8181 | item, err := DecodeFlowMonitorReplyEntry(decoder) |
| 8182 | if err != nil { |
| 8183 | return nil, err |
| 8184 | } |
| 8185 | if item != nil { |
| 8186 | _flowmonitorreply.Entries = append(_flowmonitorreply.Entries, item) |
| 8187 | } |
| 8188 | } |
| 8189 | return _flowmonitorreply, nil |
| 8190 | } |
| 8191 | |
| 8192 | func NewFlowMonitorReply() *FlowMonitorReply { |
| 8193 | obj := &FlowMonitorReply{ |
| 8194 | StatsReply: NewStatsReply(16), |
| 8195 | } |
| 8196 | return obj |
| 8197 | } |
| 8198 | |
| 8199 | type FlowMonitorRequest struct { |
| 8200 | *StatsRequest |
| 8201 | Entries []*FlowMonitorEntry |
| 8202 | } |
| 8203 | |
| 8204 | type IFlowMonitorRequest interface { |
| 8205 | IStatsRequest |
| 8206 | GetEntries() []*FlowMonitorEntry |
| 8207 | } |
| 8208 | |
| 8209 | func (self *FlowMonitorRequest) GetEntries() []*FlowMonitorEntry { |
| 8210 | return self.Entries |
| 8211 | } |
| 8212 | |
| 8213 | func (self *FlowMonitorRequest) SetEntries(v []*FlowMonitorEntry) { |
| 8214 | self.Entries = v |
| 8215 | } |
| 8216 | |
| 8217 | func (self *FlowMonitorRequest) Serialize(encoder *goloxi.Encoder) error { |
| 8218 | startIndex := len(encoder.Bytes()) |
| 8219 | if err := self.StatsRequest.Serialize(encoder); err != nil { |
| 8220 | return err |
| 8221 | } |
| 8222 | |
| 8223 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 8224 | for _, obj := range self.Entries { |
| 8225 | if err := obj.Serialize(encoder); err != nil { |
| 8226 | return err |
| 8227 | } |
| 8228 | } |
| 8229 | length := len(encoder.Bytes()) - startIndex |
| 8230 | |
| 8231 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 8232 | |
| 8233 | return nil |
| 8234 | } |
| 8235 | |
| 8236 | func DecodeFlowMonitorRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*FlowMonitorRequest, error) { |
| 8237 | _flowmonitorrequest := &FlowMonitorRequest{StatsRequest: parent} |
| 8238 | if decoder.Length() < 4 { |
| 8239 | return nil, fmt.Errorf("FlowMonitorRequest packet too short: %d < 4", decoder.Length()) |
| 8240 | } |
| 8241 | decoder.Skip(4) |
| 8242 | |
| 8243 | for decoder.Length() >= 24 { |
| 8244 | item, err := DecodeFlowMonitorEntry(decoder) |
| 8245 | if err != nil { |
| 8246 | return nil, err |
| 8247 | } |
| 8248 | if item != nil { |
| 8249 | _flowmonitorrequest.Entries = append(_flowmonitorrequest.Entries, item) |
| 8250 | } |
| 8251 | } |
| 8252 | return _flowmonitorrequest, nil |
| 8253 | } |
| 8254 | |
| 8255 | func NewFlowMonitorRequest() *FlowMonitorRequest { |
| 8256 | obj := &FlowMonitorRequest{ |
| 8257 | StatsRequest: NewStatsRequest(16), |
| 8258 | } |
| 8259 | return obj |
| 8260 | } |
| 8261 | |
| 8262 | type FlowRemoved struct { |
| 8263 | *Header |
| 8264 | Cookie uint64 |
| 8265 | Priority uint16 |
| 8266 | Reason FlowRemovedReason |
| 8267 | TableId uint8 |
| 8268 | DurationSec uint32 |
| 8269 | DurationNsec uint32 |
| 8270 | IdleTimeout uint16 |
| 8271 | HardTimeout uint16 |
| 8272 | PacketCount uint64 |
| 8273 | ByteCount uint64 |
| 8274 | Match Match |
| 8275 | } |
| 8276 | |
| 8277 | type IFlowRemoved interface { |
| 8278 | IHeader |
| 8279 | GetCookie() uint64 |
| 8280 | GetPriority() uint16 |
| 8281 | GetReason() FlowRemovedReason |
| 8282 | GetTableId() uint8 |
| 8283 | GetDurationSec() uint32 |
| 8284 | GetDurationNsec() uint32 |
| 8285 | GetIdleTimeout() uint16 |
| 8286 | GetHardTimeout() uint16 |
| 8287 | GetPacketCount() uint64 |
| 8288 | GetByteCount() uint64 |
| 8289 | GetMatch() Match |
| 8290 | } |
| 8291 | |
| 8292 | func (self *FlowRemoved) GetCookie() uint64 { |
| 8293 | return self.Cookie |
| 8294 | } |
| 8295 | |
| 8296 | func (self *FlowRemoved) SetCookie(v uint64) { |
| 8297 | self.Cookie = v |
| 8298 | } |
| 8299 | |
| 8300 | func (self *FlowRemoved) GetPriority() uint16 { |
| 8301 | return self.Priority |
| 8302 | } |
| 8303 | |
| 8304 | func (self *FlowRemoved) SetPriority(v uint16) { |
| 8305 | self.Priority = v |
| 8306 | } |
| 8307 | |
| 8308 | func (self *FlowRemoved) GetReason() FlowRemovedReason { |
| 8309 | return self.Reason |
| 8310 | } |
| 8311 | |
| 8312 | func (self *FlowRemoved) SetReason(v FlowRemovedReason) { |
| 8313 | self.Reason = v |
| 8314 | } |
| 8315 | |
| 8316 | func (self *FlowRemoved) GetTableId() uint8 { |
| 8317 | return self.TableId |
| 8318 | } |
| 8319 | |
| 8320 | func (self *FlowRemoved) SetTableId(v uint8) { |
| 8321 | self.TableId = v |
| 8322 | } |
| 8323 | |
| 8324 | func (self *FlowRemoved) GetDurationSec() uint32 { |
| 8325 | return self.DurationSec |
| 8326 | } |
| 8327 | |
| 8328 | func (self *FlowRemoved) SetDurationSec(v uint32) { |
| 8329 | self.DurationSec = v |
| 8330 | } |
| 8331 | |
| 8332 | func (self *FlowRemoved) GetDurationNsec() uint32 { |
| 8333 | return self.DurationNsec |
| 8334 | } |
| 8335 | |
| 8336 | func (self *FlowRemoved) SetDurationNsec(v uint32) { |
| 8337 | self.DurationNsec = v |
| 8338 | } |
| 8339 | |
| 8340 | func (self *FlowRemoved) GetIdleTimeout() uint16 { |
| 8341 | return self.IdleTimeout |
| 8342 | } |
| 8343 | |
| 8344 | func (self *FlowRemoved) SetIdleTimeout(v uint16) { |
| 8345 | self.IdleTimeout = v |
| 8346 | } |
| 8347 | |
| 8348 | func (self *FlowRemoved) GetHardTimeout() uint16 { |
| 8349 | return self.HardTimeout |
| 8350 | } |
| 8351 | |
| 8352 | func (self *FlowRemoved) SetHardTimeout(v uint16) { |
| 8353 | self.HardTimeout = v |
| 8354 | } |
| 8355 | |
| 8356 | func (self *FlowRemoved) GetPacketCount() uint64 { |
| 8357 | return self.PacketCount |
| 8358 | } |
| 8359 | |
| 8360 | func (self *FlowRemoved) SetPacketCount(v uint64) { |
| 8361 | self.PacketCount = v |
| 8362 | } |
| 8363 | |
| 8364 | func (self *FlowRemoved) GetByteCount() uint64 { |
| 8365 | return self.ByteCount |
| 8366 | } |
| 8367 | |
| 8368 | func (self *FlowRemoved) SetByteCount(v uint64) { |
| 8369 | self.ByteCount = v |
| 8370 | } |
| 8371 | |
| 8372 | func (self *FlowRemoved) GetMatch() Match { |
| 8373 | return self.Match |
| 8374 | } |
| 8375 | |
| 8376 | func (self *FlowRemoved) SetMatch(v Match) { |
| 8377 | self.Match = v |
| 8378 | } |
| 8379 | |
| 8380 | func (self *FlowRemoved) Serialize(encoder *goloxi.Encoder) error { |
| 8381 | startIndex := len(encoder.Bytes()) |
| 8382 | if err := self.Header.Serialize(encoder); err != nil { |
| 8383 | return err |
| 8384 | } |
| 8385 | |
| 8386 | encoder.PutUint64(uint64(self.Cookie)) |
| 8387 | encoder.PutUint16(uint16(self.Priority)) |
| 8388 | encoder.PutUint8(uint8(self.Reason)) |
| 8389 | encoder.PutUint8(uint8(self.TableId)) |
| 8390 | encoder.PutUint32(uint32(self.DurationSec)) |
| 8391 | encoder.PutUint32(uint32(self.DurationNsec)) |
| 8392 | encoder.PutUint16(uint16(self.IdleTimeout)) |
| 8393 | encoder.PutUint16(uint16(self.HardTimeout)) |
| 8394 | encoder.PutUint64(uint64(self.PacketCount)) |
| 8395 | encoder.PutUint64(uint64(self.ByteCount)) |
| 8396 | if err := self.Match.Serialize(encoder); err != nil { |
| 8397 | return err |
| 8398 | } |
| 8399 | |
| 8400 | length := len(encoder.Bytes()) - startIndex |
| 8401 | |
| 8402 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 8403 | |
| 8404 | return nil |
| 8405 | } |
| 8406 | |
| 8407 | func DecodeFlowRemoved(parent *Header, decoder *goloxi.Decoder) (*FlowRemoved, error) { |
| 8408 | _flowremoved := &FlowRemoved{Header: parent} |
| 8409 | if decoder.Length() < 48 { |
| 8410 | return nil, fmt.Errorf("FlowRemoved packet too short: %d < 48", decoder.Length()) |
| 8411 | } |
| 8412 | _flowremoved.Cookie = uint64(decoder.ReadUint64()) |
| 8413 | _flowremoved.Priority = uint16(decoder.ReadUint16()) |
| 8414 | _flowremoved.Reason = FlowRemovedReason(decoder.ReadByte()) |
| 8415 | _flowremoved.TableId = uint8(decoder.ReadByte()) |
| 8416 | _flowremoved.DurationSec = uint32(decoder.ReadUint32()) |
| 8417 | _flowremoved.DurationNsec = uint32(decoder.ReadUint32()) |
| 8418 | _flowremoved.IdleTimeout = uint16(decoder.ReadUint16()) |
| 8419 | _flowremoved.HardTimeout = uint16(decoder.ReadUint16()) |
| 8420 | _flowremoved.PacketCount = uint64(decoder.ReadUint64()) |
| 8421 | _flowremoved.ByteCount = uint64(decoder.ReadUint64()) |
| 8422 | if err := _flowremoved.Match.Decode(decoder); err != nil { |
| 8423 | return nil, err |
| 8424 | } |
| 8425 | |
| 8426 | decoder.SkipAlign() |
| 8427 | return _flowremoved, nil |
| 8428 | } |
| 8429 | |
| 8430 | func NewFlowRemoved() *FlowRemoved { |
| 8431 | obj := &FlowRemoved{ |
| 8432 | Header: NewHeader(11), |
| 8433 | } |
| 8434 | return obj |
| 8435 | } |
| 8436 | |
| 8437 | type FlowStatsReply struct { |
| 8438 | *StatsReply |
| 8439 | Entries []*FlowStatsEntry |
| 8440 | } |
| 8441 | |
| 8442 | type IFlowStatsReply interface { |
| 8443 | IStatsReply |
| 8444 | GetEntries() []*FlowStatsEntry |
| 8445 | } |
| 8446 | |
| 8447 | func (self *FlowStatsReply) GetEntries() []*FlowStatsEntry { |
| 8448 | return self.Entries |
| 8449 | } |
| 8450 | |
| 8451 | func (self *FlowStatsReply) SetEntries(v []*FlowStatsEntry) { |
| 8452 | self.Entries = v |
| 8453 | } |
| 8454 | |
| 8455 | func (self *FlowStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 8456 | startIndex := len(encoder.Bytes()) |
| 8457 | if err := self.StatsReply.Serialize(encoder); err != nil { |
| 8458 | return err |
| 8459 | } |
| 8460 | |
| 8461 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 8462 | for _, obj := range self.Entries { |
| 8463 | if err := obj.Serialize(encoder); err != nil { |
| 8464 | return err |
| 8465 | } |
| 8466 | } |
| 8467 | length := len(encoder.Bytes()) - startIndex |
| 8468 | |
| 8469 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 8470 | |
| 8471 | return nil |
| 8472 | } |
| 8473 | |
| 8474 | func DecodeFlowStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*FlowStatsReply, error) { |
| 8475 | _flowstatsreply := &FlowStatsReply{StatsReply: parent} |
| 8476 | if decoder.Length() < 4 { |
| 8477 | return nil, fmt.Errorf("FlowStatsReply packet too short: %d < 4", decoder.Length()) |
| 8478 | } |
| 8479 | decoder.Skip(4) |
| 8480 | |
| 8481 | for decoder.Length() >= 56 { |
| 8482 | item, err := DecodeFlowStatsEntry(decoder) |
| 8483 | if err != nil { |
| 8484 | return nil, err |
| 8485 | } |
| 8486 | if item != nil { |
| 8487 | _flowstatsreply.Entries = append(_flowstatsreply.Entries, item) |
| 8488 | } |
| 8489 | } |
| 8490 | return _flowstatsreply, nil |
| 8491 | } |
| 8492 | |
| 8493 | func NewFlowStatsReply() *FlowStatsReply { |
| 8494 | obj := &FlowStatsReply{ |
| 8495 | StatsReply: NewStatsReply(1), |
| 8496 | } |
| 8497 | return obj |
| 8498 | } |
| 8499 | |
| 8500 | type FlowStatsRequest struct { |
| 8501 | *StatsRequest |
| 8502 | TableId uint8 |
| 8503 | OutPort Port |
| 8504 | OutGroup uint32 |
| 8505 | Cookie uint64 |
| 8506 | CookieMask uint64 |
| 8507 | Match Match |
| 8508 | } |
| 8509 | |
| 8510 | type IFlowStatsRequest interface { |
| 8511 | IStatsRequest |
| 8512 | GetTableId() uint8 |
| 8513 | GetOutPort() Port |
| 8514 | GetOutGroup() uint32 |
| 8515 | GetCookie() uint64 |
| 8516 | GetCookieMask() uint64 |
| 8517 | GetMatch() Match |
| 8518 | } |
| 8519 | |
| 8520 | func (self *FlowStatsRequest) GetTableId() uint8 { |
| 8521 | return self.TableId |
| 8522 | } |
| 8523 | |
| 8524 | func (self *FlowStatsRequest) SetTableId(v uint8) { |
| 8525 | self.TableId = v |
| 8526 | } |
| 8527 | |
| 8528 | func (self *FlowStatsRequest) GetOutPort() Port { |
| 8529 | return self.OutPort |
| 8530 | } |
| 8531 | |
| 8532 | func (self *FlowStatsRequest) SetOutPort(v Port) { |
| 8533 | self.OutPort = v |
| 8534 | } |
| 8535 | |
| 8536 | func (self *FlowStatsRequest) GetOutGroup() uint32 { |
| 8537 | return self.OutGroup |
| 8538 | } |
| 8539 | |
| 8540 | func (self *FlowStatsRequest) SetOutGroup(v uint32) { |
| 8541 | self.OutGroup = v |
| 8542 | } |
| 8543 | |
| 8544 | func (self *FlowStatsRequest) GetCookie() uint64 { |
| 8545 | return self.Cookie |
| 8546 | } |
| 8547 | |
| 8548 | func (self *FlowStatsRequest) SetCookie(v uint64) { |
| 8549 | self.Cookie = v |
| 8550 | } |
| 8551 | |
| 8552 | func (self *FlowStatsRequest) GetCookieMask() uint64 { |
| 8553 | return self.CookieMask |
| 8554 | } |
| 8555 | |
| 8556 | func (self *FlowStatsRequest) SetCookieMask(v uint64) { |
| 8557 | self.CookieMask = v |
| 8558 | } |
| 8559 | |
| 8560 | func (self *FlowStatsRequest) GetMatch() Match { |
| 8561 | return self.Match |
| 8562 | } |
| 8563 | |
| 8564 | func (self *FlowStatsRequest) SetMatch(v Match) { |
| 8565 | self.Match = v |
| 8566 | } |
| 8567 | |
| 8568 | func (self *FlowStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 8569 | startIndex := len(encoder.Bytes()) |
| 8570 | if err := self.StatsRequest.Serialize(encoder); err != nil { |
| 8571 | return err |
| 8572 | } |
| 8573 | |
| 8574 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 8575 | encoder.PutUint8(uint8(self.TableId)) |
| 8576 | encoder.Write(bytes.Repeat([]byte{0}, 3)) |
| 8577 | self.OutPort.Serialize(encoder) |
| 8578 | encoder.PutUint32(uint32(self.OutGroup)) |
| 8579 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 8580 | encoder.PutUint64(uint64(self.Cookie)) |
| 8581 | encoder.PutUint64(uint64(self.CookieMask)) |
| 8582 | if err := self.Match.Serialize(encoder); err != nil { |
| 8583 | return err |
| 8584 | } |
| 8585 | |
| 8586 | length := len(encoder.Bytes()) - startIndex |
| 8587 | |
| 8588 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 8589 | |
| 8590 | return nil |
| 8591 | } |
| 8592 | |
| 8593 | func DecodeFlowStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*FlowStatsRequest, error) { |
| 8594 | _flowstatsrequest := &FlowStatsRequest{StatsRequest: parent} |
| 8595 | if decoder.Length() < 28 { |
| 8596 | return nil, fmt.Errorf("FlowStatsRequest packet too short: %d < 28", decoder.Length()) |
| 8597 | } |
| 8598 | decoder.Skip(4) |
| 8599 | _flowstatsrequest.TableId = uint8(decoder.ReadByte()) |
| 8600 | decoder.Skip(3) |
| 8601 | _flowstatsrequest.OutPort.Decode(decoder) |
| 8602 | _flowstatsrequest.OutGroup = uint32(decoder.ReadUint32()) |
| 8603 | decoder.Skip(4) |
| 8604 | _flowstatsrequest.Cookie = uint64(decoder.ReadUint64()) |
| 8605 | _flowstatsrequest.CookieMask = uint64(decoder.ReadUint64()) |
| 8606 | if err := _flowstatsrequest.Match.Decode(decoder); err != nil { |
| 8607 | return nil, err |
| 8608 | } |
| 8609 | |
| 8610 | decoder.SkipAlign() |
| 8611 | return _flowstatsrequest, nil |
| 8612 | } |
| 8613 | |
| 8614 | func NewFlowStatsRequest() *FlowStatsRequest { |
| 8615 | obj := &FlowStatsRequest{ |
| 8616 | StatsRequest: NewStatsRequest(1), |
| 8617 | } |
| 8618 | return obj |
| 8619 | } |
| 8620 | |
| 8621 | type GetConfigReply struct { |
| 8622 | *Header |
| 8623 | Flags ConfigFlags |
| 8624 | MissSendLen uint16 |
| 8625 | } |
| 8626 | |
| 8627 | type IGetConfigReply interface { |
| 8628 | IHeader |
| 8629 | GetFlags() ConfigFlags |
| 8630 | GetMissSendLen() uint16 |
| 8631 | } |
| 8632 | |
| 8633 | func (self *GetConfigReply) GetFlags() ConfigFlags { |
| 8634 | return self.Flags |
| 8635 | } |
| 8636 | |
| 8637 | func (self *GetConfigReply) SetFlags(v ConfigFlags) { |
| 8638 | self.Flags = v |
| 8639 | } |
| 8640 | |
| 8641 | func (self *GetConfigReply) GetMissSendLen() uint16 { |
| 8642 | return self.MissSendLen |
| 8643 | } |
| 8644 | |
| 8645 | func (self *GetConfigReply) SetMissSendLen(v uint16) { |
| 8646 | self.MissSendLen = v |
| 8647 | } |
| 8648 | |
| 8649 | func (self *GetConfigReply) Serialize(encoder *goloxi.Encoder) error { |
| 8650 | startIndex := len(encoder.Bytes()) |
| 8651 | if err := self.Header.Serialize(encoder); err != nil { |
| 8652 | return err |
| 8653 | } |
| 8654 | |
| 8655 | encoder.PutUint16(uint16(self.Flags)) |
| 8656 | encoder.PutUint16(uint16(self.MissSendLen)) |
| 8657 | length := len(encoder.Bytes()) - startIndex |
| 8658 | |
| 8659 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 8660 | |
| 8661 | return nil |
| 8662 | } |
| 8663 | |
| 8664 | func DecodeGetConfigReply(parent *Header, decoder *goloxi.Decoder) (*GetConfigReply, error) { |
| 8665 | _getconfigreply := &GetConfigReply{Header: parent} |
| 8666 | if decoder.Length() < 4 { |
| 8667 | return nil, fmt.Errorf("GetConfigReply packet too short: %d < 4", decoder.Length()) |
| 8668 | } |
| 8669 | _getconfigreply.Flags = ConfigFlags(decoder.ReadUint16()) |
| 8670 | _getconfigreply.MissSendLen = uint16(decoder.ReadUint16()) |
| 8671 | return _getconfigreply, nil |
| 8672 | } |
| 8673 | |
| 8674 | func NewGetConfigReply() *GetConfigReply { |
| 8675 | obj := &GetConfigReply{ |
| 8676 | Header: NewHeader(8), |
| 8677 | } |
| 8678 | return obj |
| 8679 | } |
| 8680 | |
| 8681 | type GetConfigRequest struct { |
| 8682 | *Header |
| 8683 | } |
| 8684 | |
| 8685 | type IGetConfigRequest interface { |
| 8686 | IHeader |
| 8687 | } |
| 8688 | |
| 8689 | func (self *GetConfigRequest) Serialize(encoder *goloxi.Encoder) error { |
| 8690 | startIndex := len(encoder.Bytes()) |
| 8691 | if err := self.Header.Serialize(encoder); err != nil { |
| 8692 | return err |
| 8693 | } |
| 8694 | length := len(encoder.Bytes()) - startIndex |
| 8695 | |
| 8696 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 8697 | |
| 8698 | return nil |
| 8699 | } |
| 8700 | |
| 8701 | func DecodeGetConfigRequest(parent *Header, decoder *goloxi.Decoder) (*GetConfigRequest, error) { |
| 8702 | _getconfigrequest := &GetConfigRequest{Header: parent} |
| 8703 | return _getconfigrequest, nil |
| 8704 | } |
| 8705 | |
| 8706 | func NewGetConfigRequest() *GetConfigRequest { |
| 8707 | obj := &GetConfigRequest{ |
| 8708 | Header: NewHeader(7), |
| 8709 | } |
| 8710 | return obj |
| 8711 | } |
| 8712 | |
| 8713 | type GroupMod struct { |
| 8714 | *Header |
| 8715 | Command GroupModCommand |
| 8716 | GroupType GroupType |
| 8717 | GroupId uint32 |
| 8718 | Buckets []*Bucket |
| 8719 | } |
| 8720 | |
| 8721 | type IGroupMod interface { |
| 8722 | IHeader |
| 8723 | GetCommand() GroupModCommand |
| 8724 | GetGroupType() GroupType |
| 8725 | GetGroupId() uint32 |
| 8726 | GetBuckets() []*Bucket |
| 8727 | } |
| 8728 | |
| 8729 | func (self *GroupMod) GetCommand() GroupModCommand { |
| 8730 | return self.Command |
| 8731 | } |
| 8732 | |
| 8733 | func (self *GroupMod) SetCommand(v GroupModCommand) { |
| 8734 | self.Command = v |
| 8735 | } |
| 8736 | |
| 8737 | func (self *GroupMod) GetGroupType() GroupType { |
| 8738 | return self.GroupType |
| 8739 | } |
| 8740 | |
| 8741 | func (self *GroupMod) SetGroupType(v GroupType) { |
| 8742 | self.GroupType = v |
| 8743 | } |
| 8744 | |
| 8745 | func (self *GroupMod) GetGroupId() uint32 { |
| 8746 | return self.GroupId |
| 8747 | } |
| 8748 | |
| 8749 | func (self *GroupMod) SetGroupId(v uint32) { |
| 8750 | self.GroupId = v |
| 8751 | } |
| 8752 | |
| 8753 | func (self *GroupMod) GetBuckets() []*Bucket { |
| 8754 | return self.Buckets |
| 8755 | } |
| 8756 | |
| 8757 | func (self *GroupMod) SetBuckets(v []*Bucket) { |
| 8758 | self.Buckets = v |
| 8759 | } |
| 8760 | |
| 8761 | func (self *GroupMod) Serialize(encoder *goloxi.Encoder) error { |
| 8762 | if err := self.Header.Serialize(encoder); err != nil { |
| 8763 | return err |
| 8764 | } |
| 8765 | |
| 8766 | encoder.PutUint16(uint16(self.Command)) |
| 8767 | encoder.PutUint8(uint8(self.GroupType)) |
| 8768 | encoder.Write(bytes.Repeat([]byte{0}, 1)) |
| 8769 | encoder.PutUint32(uint32(self.GroupId)) |
| 8770 | for _, obj := range self.Buckets { |
| 8771 | if err := obj.Serialize(encoder); err != nil { |
| 8772 | return err |
| 8773 | } |
| 8774 | } |
| 8775 | |
| 8776 | return nil |
| 8777 | } |
| 8778 | |
| 8779 | func DecodeGroupMod(parent *Header, decoder *goloxi.Decoder) (IGroupMod, error) { |
| 8780 | _groupmod := &GroupMod{Header: parent} |
| 8781 | if decoder.Length() < 8 { |
| 8782 | return nil, fmt.Errorf("GroupMod packet too short: %d < 8", decoder.Length()) |
| 8783 | } |
| 8784 | _groupmod.Command = GroupModCommand(decoder.ReadUint16()) |
| 8785 | _groupmod.GroupType = GroupType(decoder.ReadByte()) |
| 8786 | decoder.Skip(1) |
| 8787 | _groupmod.GroupId = uint32(decoder.ReadUint32()) |
| 8788 | |
| 8789 | for decoder.Length() >= 16 { |
| 8790 | item, err := DecodeBucket(decoder) |
| 8791 | if err != nil { |
| 8792 | return nil, err |
| 8793 | } |
| 8794 | if item != nil { |
| 8795 | _groupmod.Buckets = append(_groupmod.Buckets, item) |
| 8796 | } |
| 8797 | } |
| 8798 | |
| 8799 | switch _groupmod.Command { |
| 8800 | case 0: |
| 8801 | return DecodeGroupAdd(_groupmod, decoder) |
| 8802 | case 1: |
| 8803 | return DecodeGroupModify(_groupmod, decoder) |
| 8804 | case 2: |
| 8805 | return DecodeGroupDelete(_groupmod, decoder) |
| 8806 | default: |
| 8807 | return nil, fmt.Errorf("Invalid type '%d' for 'GroupMod'", _groupmod.Command) |
| 8808 | } |
| 8809 | } |
| 8810 | |
| 8811 | func NewGroupMod(_command GroupModCommand) *GroupMod { |
| 8812 | obj := &GroupMod{ |
| 8813 | Header: NewHeader(15), |
| 8814 | } |
| 8815 | obj.Command = _command |
| 8816 | return obj |
| 8817 | } |
| 8818 | |
| 8819 | type GroupAdd struct { |
| 8820 | *GroupMod |
| 8821 | } |
| 8822 | |
| 8823 | type IGroupAdd interface { |
| 8824 | IGroupMod |
| 8825 | } |
| 8826 | |
| 8827 | func (self *GroupAdd) Serialize(encoder *goloxi.Encoder) error { |
| 8828 | startIndex := len(encoder.Bytes()) |
| 8829 | if err := self.GroupMod.Serialize(encoder); err != nil { |
| 8830 | return err |
| 8831 | } |
| 8832 | length := len(encoder.Bytes()) - startIndex |
| 8833 | |
| 8834 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 8835 | |
| 8836 | return nil |
| 8837 | } |
| 8838 | |
| 8839 | func DecodeGroupAdd(parent *GroupMod, decoder *goloxi.Decoder) (*GroupAdd, error) { |
| 8840 | _groupadd := &GroupAdd{GroupMod: parent} |
| 8841 | return _groupadd, nil |
| 8842 | } |
| 8843 | |
| 8844 | func NewGroupAdd() *GroupAdd { |
| 8845 | obj := &GroupAdd{ |
| 8846 | GroupMod: NewGroupMod(0), |
| 8847 | } |
| 8848 | return obj |
| 8849 | } |
| 8850 | |
| 8851 | type GroupDelete struct { |
| 8852 | *GroupMod |
| 8853 | } |
| 8854 | |
| 8855 | type IGroupDelete interface { |
| 8856 | IGroupMod |
| 8857 | } |
| 8858 | |
| 8859 | func (self *GroupDelete) Serialize(encoder *goloxi.Encoder) error { |
| 8860 | startIndex := len(encoder.Bytes()) |
| 8861 | if err := self.GroupMod.Serialize(encoder); err != nil { |
| 8862 | return err |
| 8863 | } |
| 8864 | length := len(encoder.Bytes()) - startIndex |
| 8865 | |
| 8866 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 8867 | |
| 8868 | return nil |
| 8869 | } |
| 8870 | |
| 8871 | func DecodeGroupDelete(parent *GroupMod, decoder *goloxi.Decoder) (*GroupDelete, error) { |
| 8872 | _groupdelete := &GroupDelete{GroupMod: parent} |
| 8873 | return _groupdelete, nil |
| 8874 | } |
| 8875 | |
| 8876 | func NewGroupDelete() *GroupDelete { |
| 8877 | obj := &GroupDelete{ |
| 8878 | GroupMod: NewGroupMod(2), |
| 8879 | } |
| 8880 | return obj |
| 8881 | } |
| 8882 | |
| 8883 | type GroupDescStatsReply struct { |
| 8884 | *StatsReply |
| 8885 | Entries []*GroupDescStatsEntry |
| 8886 | } |
| 8887 | |
| 8888 | type IGroupDescStatsReply interface { |
| 8889 | IStatsReply |
| 8890 | GetEntries() []*GroupDescStatsEntry |
| 8891 | } |
| 8892 | |
| 8893 | func (self *GroupDescStatsReply) GetEntries() []*GroupDescStatsEntry { |
| 8894 | return self.Entries |
| 8895 | } |
| 8896 | |
| 8897 | func (self *GroupDescStatsReply) SetEntries(v []*GroupDescStatsEntry) { |
| 8898 | self.Entries = v |
| 8899 | } |
| 8900 | |
| 8901 | func (self *GroupDescStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 8902 | startIndex := len(encoder.Bytes()) |
| 8903 | if err := self.StatsReply.Serialize(encoder); err != nil { |
| 8904 | return err |
| 8905 | } |
| 8906 | |
| 8907 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 8908 | for _, obj := range self.Entries { |
| 8909 | if err := obj.Serialize(encoder); err != nil { |
| 8910 | return err |
| 8911 | } |
| 8912 | } |
| 8913 | length := len(encoder.Bytes()) - startIndex |
| 8914 | |
| 8915 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 8916 | |
| 8917 | return nil |
| 8918 | } |
| 8919 | |
| 8920 | func DecodeGroupDescStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*GroupDescStatsReply, error) { |
| 8921 | _groupdescstatsreply := &GroupDescStatsReply{StatsReply: parent} |
| 8922 | if decoder.Length() < 4 { |
| 8923 | return nil, fmt.Errorf("GroupDescStatsReply packet too short: %d < 4", decoder.Length()) |
| 8924 | } |
| 8925 | decoder.Skip(4) |
| 8926 | |
| 8927 | for decoder.Length() >= 8 { |
| 8928 | item, err := DecodeGroupDescStatsEntry(decoder) |
| 8929 | if err != nil { |
| 8930 | return nil, err |
| 8931 | } |
| 8932 | if item != nil { |
| 8933 | _groupdescstatsreply.Entries = append(_groupdescstatsreply.Entries, item) |
| 8934 | } |
| 8935 | } |
| 8936 | return _groupdescstatsreply, nil |
| 8937 | } |
| 8938 | |
| 8939 | func NewGroupDescStatsReply() *GroupDescStatsReply { |
| 8940 | obj := &GroupDescStatsReply{ |
| 8941 | StatsReply: NewStatsReply(7), |
| 8942 | } |
| 8943 | return obj |
| 8944 | } |
| 8945 | |
| 8946 | type GroupDescStatsRequest struct { |
| 8947 | *StatsRequest |
| 8948 | } |
| 8949 | |
| 8950 | type IGroupDescStatsRequest interface { |
| 8951 | IStatsRequest |
| 8952 | } |
| 8953 | |
| 8954 | func (self *GroupDescStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 8955 | startIndex := len(encoder.Bytes()) |
| 8956 | if err := self.StatsRequest.Serialize(encoder); err != nil { |
| 8957 | return err |
| 8958 | } |
| 8959 | |
| 8960 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 8961 | length := len(encoder.Bytes()) - startIndex |
| 8962 | |
| 8963 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 8964 | |
| 8965 | return nil |
| 8966 | } |
| 8967 | |
| 8968 | func DecodeGroupDescStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*GroupDescStatsRequest, error) { |
| 8969 | _groupdescstatsrequest := &GroupDescStatsRequest{StatsRequest: parent} |
| 8970 | if decoder.Length() < 4 { |
| 8971 | return nil, fmt.Errorf("GroupDescStatsRequest packet too short: %d < 4", decoder.Length()) |
| 8972 | } |
| 8973 | decoder.Skip(4) |
| 8974 | return _groupdescstatsrequest, nil |
| 8975 | } |
| 8976 | |
| 8977 | func NewGroupDescStatsRequest() *GroupDescStatsRequest { |
| 8978 | obj := &GroupDescStatsRequest{ |
| 8979 | StatsRequest: NewStatsRequest(7), |
| 8980 | } |
| 8981 | return obj |
| 8982 | } |
| 8983 | |
| 8984 | type GroupFeaturesStatsReply struct { |
| 8985 | *StatsReply |
| 8986 | Types uint32 |
| 8987 | Capabilities GroupCapabilities |
| 8988 | MaxGroupsAll uint32 |
| 8989 | MaxGroupsSelect uint32 |
| 8990 | MaxGroupsIndirect uint32 |
| 8991 | MaxGroupsFf uint32 |
| 8992 | ActionsAll uint32 |
| 8993 | ActionsSelect uint32 |
| 8994 | ActionsIndirect uint32 |
| 8995 | ActionsFf uint32 |
| 8996 | } |
| 8997 | |
| 8998 | type IGroupFeaturesStatsReply interface { |
| 8999 | IStatsReply |
| 9000 | GetTypes() uint32 |
| 9001 | GetCapabilities() GroupCapabilities |
| 9002 | GetMaxGroupsAll() uint32 |
| 9003 | GetMaxGroupsSelect() uint32 |
| 9004 | GetMaxGroupsIndirect() uint32 |
| 9005 | GetMaxGroupsFf() uint32 |
| 9006 | GetActionsAll() uint32 |
| 9007 | GetActionsSelect() uint32 |
| 9008 | GetActionsIndirect() uint32 |
| 9009 | GetActionsFf() uint32 |
| 9010 | } |
| 9011 | |
| 9012 | func (self *GroupFeaturesStatsReply) GetTypes() uint32 { |
| 9013 | return self.Types |
| 9014 | } |
| 9015 | |
| 9016 | func (self *GroupFeaturesStatsReply) SetTypes(v uint32) { |
| 9017 | self.Types = v |
| 9018 | } |
| 9019 | |
| 9020 | func (self *GroupFeaturesStatsReply) GetCapabilities() GroupCapabilities { |
| 9021 | return self.Capabilities |
| 9022 | } |
| 9023 | |
| 9024 | func (self *GroupFeaturesStatsReply) SetCapabilities(v GroupCapabilities) { |
| 9025 | self.Capabilities = v |
| 9026 | } |
| 9027 | |
| 9028 | func (self *GroupFeaturesStatsReply) GetMaxGroupsAll() uint32 { |
| 9029 | return self.MaxGroupsAll |
| 9030 | } |
| 9031 | |
| 9032 | func (self *GroupFeaturesStatsReply) SetMaxGroupsAll(v uint32) { |
| 9033 | self.MaxGroupsAll = v |
| 9034 | } |
| 9035 | |
| 9036 | func (self *GroupFeaturesStatsReply) GetMaxGroupsSelect() uint32 { |
| 9037 | return self.MaxGroupsSelect |
| 9038 | } |
| 9039 | |
| 9040 | func (self *GroupFeaturesStatsReply) SetMaxGroupsSelect(v uint32) { |
| 9041 | self.MaxGroupsSelect = v |
| 9042 | } |
| 9043 | |
| 9044 | func (self *GroupFeaturesStatsReply) GetMaxGroupsIndirect() uint32 { |
| 9045 | return self.MaxGroupsIndirect |
| 9046 | } |
| 9047 | |
| 9048 | func (self *GroupFeaturesStatsReply) SetMaxGroupsIndirect(v uint32) { |
| 9049 | self.MaxGroupsIndirect = v |
| 9050 | } |
| 9051 | |
| 9052 | func (self *GroupFeaturesStatsReply) GetMaxGroupsFf() uint32 { |
| 9053 | return self.MaxGroupsFf |
| 9054 | } |
| 9055 | |
| 9056 | func (self *GroupFeaturesStatsReply) SetMaxGroupsFf(v uint32) { |
| 9057 | self.MaxGroupsFf = v |
| 9058 | } |
| 9059 | |
| 9060 | func (self *GroupFeaturesStatsReply) GetActionsAll() uint32 { |
| 9061 | return self.ActionsAll |
| 9062 | } |
| 9063 | |
| 9064 | func (self *GroupFeaturesStatsReply) SetActionsAll(v uint32) { |
| 9065 | self.ActionsAll = v |
| 9066 | } |
| 9067 | |
| 9068 | func (self *GroupFeaturesStatsReply) GetActionsSelect() uint32 { |
| 9069 | return self.ActionsSelect |
| 9070 | } |
| 9071 | |
| 9072 | func (self *GroupFeaturesStatsReply) SetActionsSelect(v uint32) { |
| 9073 | self.ActionsSelect = v |
| 9074 | } |
| 9075 | |
| 9076 | func (self *GroupFeaturesStatsReply) GetActionsIndirect() uint32 { |
| 9077 | return self.ActionsIndirect |
| 9078 | } |
| 9079 | |
| 9080 | func (self *GroupFeaturesStatsReply) SetActionsIndirect(v uint32) { |
| 9081 | self.ActionsIndirect = v |
| 9082 | } |
| 9083 | |
| 9084 | func (self *GroupFeaturesStatsReply) GetActionsFf() uint32 { |
| 9085 | return self.ActionsFf |
| 9086 | } |
| 9087 | |
| 9088 | func (self *GroupFeaturesStatsReply) SetActionsFf(v uint32) { |
| 9089 | self.ActionsFf = v |
| 9090 | } |
| 9091 | |
| 9092 | func (self *GroupFeaturesStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 9093 | startIndex := len(encoder.Bytes()) |
| 9094 | if err := self.StatsReply.Serialize(encoder); err != nil { |
| 9095 | return err |
| 9096 | } |
| 9097 | |
| 9098 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 9099 | encoder.PutUint32(uint32(self.Types)) |
| 9100 | encoder.PutUint32(uint32(self.Capabilities)) |
| 9101 | encoder.PutUint32(uint32(self.MaxGroupsAll)) |
| 9102 | encoder.PutUint32(uint32(self.MaxGroupsSelect)) |
| 9103 | encoder.PutUint32(uint32(self.MaxGroupsIndirect)) |
| 9104 | encoder.PutUint32(uint32(self.MaxGroupsFf)) |
| 9105 | encoder.PutUint32(uint32(self.ActionsAll)) |
| 9106 | encoder.PutUint32(uint32(self.ActionsSelect)) |
| 9107 | encoder.PutUint32(uint32(self.ActionsIndirect)) |
| 9108 | encoder.PutUint32(uint32(self.ActionsFf)) |
| 9109 | length := len(encoder.Bytes()) - startIndex |
| 9110 | |
| 9111 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 9112 | |
| 9113 | return nil |
| 9114 | } |
| 9115 | |
| 9116 | func DecodeGroupFeaturesStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*GroupFeaturesStatsReply, error) { |
| 9117 | _groupfeaturesstatsreply := &GroupFeaturesStatsReply{StatsReply: parent} |
| 9118 | if decoder.Length() < 44 { |
| 9119 | return nil, fmt.Errorf("GroupFeaturesStatsReply packet too short: %d < 44", decoder.Length()) |
| 9120 | } |
| 9121 | decoder.Skip(4) |
| 9122 | _groupfeaturesstatsreply.Types = uint32(decoder.ReadUint32()) |
| 9123 | _groupfeaturesstatsreply.Capabilities = GroupCapabilities(decoder.ReadUint32()) |
| 9124 | _groupfeaturesstatsreply.MaxGroupsAll = uint32(decoder.ReadUint32()) |
| 9125 | _groupfeaturesstatsreply.MaxGroupsSelect = uint32(decoder.ReadUint32()) |
| 9126 | _groupfeaturesstatsreply.MaxGroupsIndirect = uint32(decoder.ReadUint32()) |
| 9127 | _groupfeaturesstatsreply.MaxGroupsFf = uint32(decoder.ReadUint32()) |
| 9128 | _groupfeaturesstatsreply.ActionsAll = uint32(decoder.ReadUint32()) |
| 9129 | _groupfeaturesstatsreply.ActionsSelect = uint32(decoder.ReadUint32()) |
| 9130 | _groupfeaturesstatsreply.ActionsIndirect = uint32(decoder.ReadUint32()) |
| 9131 | _groupfeaturesstatsreply.ActionsFf = uint32(decoder.ReadUint32()) |
| 9132 | return _groupfeaturesstatsreply, nil |
| 9133 | } |
| 9134 | |
| 9135 | func NewGroupFeaturesStatsReply() *GroupFeaturesStatsReply { |
| 9136 | obj := &GroupFeaturesStatsReply{ |
| 9137 | StatsReply: NewStatsReply(8), |
| 9138 | } |
| 9139 | return obj |
| 9140 | } |
| 9141 | |
| 9142 | type GroupFeaturesStatsRequest struct { |
| 9143 | *StatsRequest |
| 9144 | } |
| 9145 | |
| 9146 | type IGroupFeaturesStatsRequest interface { |
| 9147 | IStatsRequest |
| 9148 | } |
| 9149 | |
| 9150 | func (self *GroupFeaturesStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 9151 | startIndex := len(encoder.Bytes()) |
| 9152 | if err := self.StatsRequest.Serialize(encoder); err != nil { |
| 9153 | return err |
| 9154 | } |
| 9155 | |
| 9156 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 9157 | length := len(encoder.Bytes()) - startIndex |
| 9158 | |
| 9159 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 9160 | |
| 9161 | return nil |
| 9162 | } |
| 9163 | |
| 9164 | func DecodeGroupFeaturesStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*GroupFeaturesStatsRequest, error) { |
| 9165 | _groupfeaturesstatsrequest := &GroupFeaturesStatsRequest{StatsRequest: parent} |
| 9166 | if decoder.Length() < 4 { |
| 9167 | return nil, fmt.Errorf("GroupFeaturesStatsRequest packet too short: %d < 4", decoder.Length()) |
| 9168 | } |
| 9169 | decoder.Skip(4) |
| 9170 | return _groupfeaturesstatsrequest, nil |
| 9171 | } |
| 9172 | |
| 9173 | func NewGroupFeaturesStatsRequest() *GroupFeaturesStatsRequest { |
| 9174 | obj := &GroupFeaturesStatsRequest{ |
| 9175 | StatsRequest: NewStatsRequest(8), |
| 9176 | } |
| 9177 | return obj |
| 9178 | } |
| 9179 | |
| 9180 | type GroupModFailedErrorMsg struct { |
| 9181 | *ErrorMsg |
| 9182 | Code GroupModFailedCode |
| 9183 | Data []byte |
| 9184 | } |
| 9185 | |
| 9186 | type IGroupModFailedErrorMsg interface { |
| 9187 | IErrorMsg |
| 9188 | GetCode() GroupModFailedCode |
| 9189 | GetData() []byte |
| 9190 | } |
| 9191 | |
| 9192 | func (self *GroupModFailedErrorMsg) GetCode() GroupModFailedCode { |
| 9193 | return self.Code |
| 9194 | } |
| 9195 | |
| 9196 | func (self *GroupModFailedErrorMsg) SetCode(v GroupModFailedCode) { |
| 9197 | self.Code = v |
| 9198 | } |
| 9199 | |
| 9200 | func (self *GroupModFailedErrorMsg) GetData() []byte { |
| 9201 | return self.Data |
| 9202 | } |
| 9203 | |
| 9204 | func (self *GroupModFailedErrorMsg) SetData(v []byte) { |
| 9205 | self.Data = v |
| 9206 | } |
| 9207 | |
| 9208 | func (self *GroupModFailedErrorMsg) Serialize(encoder *goloxi.Encoder) error { |
| 9209 | startIndex := len(encoder.Bytes()) |
| 9210 | if err := self.ErrorMsg.Serialize(encoder); err != nil { |
| 9211 | return err |
| 9212 | } |
| 9213 | |
| 9214 | encoder.PutUint16(uint16(self.Code)) |
| 9215 | encoder.Write(self.Data) |
| 9216 | length := len(encoder.Bytes()) - startIndex |
| 9217 | |
| 9218 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 9219 | |
| 9220 | return nil |
| 9221 | } |
| 9222 | |
| 9223 | func DecodeGroupModFailedErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*GroupModFailedErrorMsg, error) { |
| 9224 | _groupmodfailederrormsg := &GroupModFailedErrorMsg{ErrorMsg: parent} |
| 9225 | if decoder.Length() < 2 { |
| 9226 | return nil, fmt.Errorf("GroupModFailedErrorMsg packet too short: %d < 2", decoder.Length()) |
| 9227 | } |
| 9228 | _groupmodfailederrormsg.Code = GroupModFailedCode(decoder.ReadUint16()) |
| 9229 | _groupmodfailederrormsg.Data = decoder.Read(int(decoder.Length())) |
| 9230 | return _groupmodfailederrormsg, nil |
| 9231 | } |
| 9232 | |
| 9233 | func NewGroupModFailedErrorMsg() *GroupModFailedErrorMsg { |
| 9234 | obj := &GroupModFailedErrorMsg{ |
| 9235 | ErrorMsg: NewErrorMsg(6), |
| 9236 | } |
| 9237 | return obj |
| 9238 | } |
| 9239 | |
| 9240 | type GroupModify struct { |
| 9241 | *GroupMod |
| 9242 | } |
| 9243 | |
| 9244 | type IGroupModify interface { |
| 9245 | IGroupMod |
| 9246 | } |
| 9247 | |
| 9248 | func (self *GroupModify) Serialize(encoder *goloxi.Encoder) error { |
| 9249 | startIndex := len(encoder.Bytes()) |
| 9250 | if err := self.GroupMod.Serialize(encoder); err != nil { |
| 9251 | return err |
| 9252 | } |
| 9253 | length := len(encoder.Bytes()) - startIndex |
| 9254 | |
| 9255 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 9256 | |
| 9257 | return nil |
| 9258 | } |
| 9259 | |
| 9260 | func DecodeGroupModify(parent *GroupMod, decoder *goloxi.Decoder) (*GroupModify, error) { |
| 9261 | _groupmodify := &GroupModify{GroupMod: parent} |
| 9262 | return _groupmodify, nil |
| 9263 | } |
| 9264 | |
| 9265 | func NewGroupModify() *GroupModify { |
| 9266 | obj := &GroupModify{ |
| 9267 | GroupMod: NewGroupMod(1), |
| 9268 | } |
| 9269 | return obj |
| 9270 | } |
| 9271 | |
| 9272 | type GroupStatsReply struct { |
| 9273 | *StatsReply |
| 9274 | Entries []*GroupStatsEntry |
| 9275 | } |
| 9276 | |
| 9277 | type IGroupStatsReply interface { |
| 9278 | IStatsReply |
| 9279 | GetEntries() []*GroupStatsEntry |
| 9280 | } |
| 9281 | |
| 9282 | func (self *GroupStatsReply) GetEntries() []*GroupStatsEntry { |
| 9283 | return self.Entries |
| 9284 | } |
| 9285 | |
| 9286 | func (self *GroupStatsReply) SetEntries(v []*GroupStatsEntry) { |
| 9287 | self.Entries = v |
| 9288 | } |
| 9289 | |
| 9290 | func (self *GroupStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 9291 | startIndex := len(encoder.Bytes()) |
| 9292 | if err := self.StatsReply.Serialize(encoder); err != nil { |
| 9293 | return err |
| 9294 | } |
| 9295 | |
| 9296 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 9297 | for _, obj := range self.Entries { |
| 9298 | if err := obj.Serialize(encoder); err != nil { |
| 9299 | return err |
| 9300 | } |
| 9301 | } |
| 9302 | length := len(encoder.Bytes()) - startIndex |
| 9303 | |
| 9304 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 9305 | |
| 9306 | return nil |
| 9307 | } |
| 9308 | |
| 9309 | func DecodeGroupStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*GroupStatsReply, error) { |
| 9310 | _groupstatsreply := &GroupStatsReply{StatsReply: parent} |
| 9311 | if decoder.Length() < 4 { |
| 9312 | return nil, fmt.Errorf("GroupStatsReply packet too short: %d < 4", decoder.Length()) |
| 9313 | } |
| 9314 | decoder.Skip(4) |
| 9315 | |
| 9316 | for decoder.Length() >= 40 { |
| 9317 | item, err := DecodeGroupStatsEntry(decoder) |
| 9318 | if err != nil { |
| 9319 | return nil, err |
| 9320 | } |
| 9321 | if item != nil { |
| 9322 | _groupstatsreply.Entries = append(_groupstatsreply.Entries, item) |
| 9323 | } |
| 9324 | } |
| 9325 | return _groupstatsreply, nil |
| 9326 | } |
| 9327 | |
| 9328 | func NewGroupStatsReply() *GroupStatsReply { |
| 9329 | obj := &GroupStatsReply{ |
| 9330 | StatsReply: NewStatsReply(6), |
| 9331 | } |
| 9332 | return obj |
| 9333 | } |
| 9334 | |
| 9335 | type GroupStatsRequest struct { |
| 9336 | *StatsRequest |
| 9337 | GroupId uint32 |
| 9338 | } |
| 9339 | |
| 9340 | type IGroupStatsRequest interface { |
| 9341 | IStatsRequest |
| 9342 | GetGroupId() uint32 |
| 9343 | } |
| 9344 | |
| 9345 | func (self *GroupStatsRequest) GetGroupId() uint32 { |
| 9346 | return self.GroupId |
| 9347 | } |
| 9348 | |
| 9349 | func (self *GroupStatsRequest) SetGroupId(v uint32) { |
| 9350 | self.GroupId = v |
| 9351 | } |
| 9352 | |
| 9353 | func (self *GroupStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 9354 | startIndex := len(encoder.Bytes()) |
| 9355 | if err := self.StatsRequest.Serialize(encoder); err != nil { |
| 9356 | return err |
| 9357 | } |
| 9358 | |
| 9359 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 9360 | encoder.PutUint32(uint32(self.GroupId)) |
| 9361 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 9362 | length := len(encoder.Bytes()) - startIndex |
| 9363 | |
| 9364 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 9365 | |
| 9366 | return nil |
| 9367 | } |
| 9368 | |
| 9369 | func DecodeGroupStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*GroupStatsRequest, error) { |
| 9370 | _groupstatsrequest := &GroupStatsRequest{StatsRequest: parent} |
| 9371 | if decoder.Length() < 4 { |
| 9372 | return nil, fmt.Errorf("GroupStatsRequest packet too short: %d < 4", decoder.Length()) |
| 9373 | } |
| 9374 | decoder.Skip(4) |
| 9375 | _groupstatsrequest.GroupId = uint32(decoder.ReadUint32()) |
| 9376 | decoder.Skip(4) |
| 9377 | return _groupstatsrequest, nil |
| 9378 | } |
| 9379 | |
| 9380 | func NewGroupStatsRequest() *GroupStatsRequest { |
| 9381 | obj := &GroupStatsRequest{ |
| 9382 | StatsRequest: NewStatsRequest(6), |
| 9383 | } |
| 9384 | return obj |
| 9385 | } |
| 9386 | |
| 9387 | type Hello struct { |
| 9388 | *Header |
| 9389 | Elements []IHelloElem |
| 9390 | } |
| 9391 | |
| 9392 | type IHello interface { |
| 9393 | IHeader |
| 9394 | GetElements() []IHelloElem |
| 9395 | } |
| 9396 | |
| 9397 | func (self *Hello) GetElements() []IHelloElem { |
| 9398 | return self.Elements |
| 9399 | } |
| 9400 | |
| 9401 | func (self *Hello) SetElements(v []IHelloElem) { |
| 9402 | self.Elements = v |
| 9403 | } |
| 9404 | |
| 9405 | func (self *Hello) Serialize(encoder *goloxi.Encoder) error { |
| 9406 | startIndex := len(encoder.Bytes()) |
| 9407 | if err := self.Header.Serialize(encoder); err != nil { |
| 9408 | return err |
| 9409 | } |
| 9410 | |
| 9411 | for _, obj := range self.Elements { |
| 9412 | if err := obj.Serialize(encoder); err != nil { |
| 9413 | return err |
| 9414 | } |
| 9415 | } |
| 9416 | length := len(encoder.Bytes()) - startIndex |
| 9417 | |
| 9418 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 9419 | |
| 9420 | return nil |
| 9421 | } |
| 9422 | |
| 9423 | func DecodeHello(parent *Header, decoder *goloxi.Decoder) (*Hello, error) { |
| 9424 | _hello := &Hello{Header: parent} |
| 9425 | |
| 9426 | for decoder.Length() >= 4 { |
| 9427 | item, err := DecodeHelloElem(decoder) |
| 9428 | if err != nil { |
| 9429 | return nil, err |
| 9430 | } |
| 9431 | if item != nil { |
| 9432 | _hello.Elements = append(_hello.Elements, item) |
| 9433 | } |
| 9434 | } |
| 9435 | return _hello, nil |
| 9436 | } |
| 9437 | |
| 9438 | func NewHello() *Hello { |
| 9439 | obj := &Hello{ |
| 9440 | Header: NewHeader(0), |
| 9441 | } |
| 9442 | return obj |
| 9443 | } |
| 9444 | |
| 9445 | type HelloFailedErrorMsg struct { |
| 9446 | *ErrorMsg |
| 9447 | Code HelloFailedCode |
| 9448 | Data []byte |
| 9449 | } |
| 9450 | |
| 9451 | type IHelloFailedErrorMsg interface { |
| 9452 | IErrorMsg |
| 9453 | GetCode() HelloFailedCode |
| 9454 | GetData() []byte |
| 9455 | } |
| 9456 | |
| 9457 | func (self *HelloFailedErrorMsg) GetCode() HelloFailedCode { |
| 9458 | return self.Code |
| 9459 | } |
| 9460 | |
| 9461 | func (self *HelloFailedErrorMsg) SetCode(v HelloFailedCode) { |
| 9462 | self.Code = v |
| 9463 | } |
| 9464 | |
| 9465 | func (self *HelloFailedErrorMsg) GetData() []byte { |
| 9466 | return self.Data |
| 9467 | } |
| 9468 | |
| 9469 | func (self *HelloFailedErrorMsg) SetData(v []byte) { |
| 9470 | self.Data = v |
| 9471 | } |
| 9472 | |
| 9473 | func (self *HelloFailedErrorMsg) Serialize(encoder *goloxi.Encoder) error { |
| 9474 | startIndex := len(encoder.Bytes()) |
| 9475 | if err := self.ErrorMsg.Serialize(encoder); err != nil { |
| 9476 | return err |
| 9477 | } |
| 9478 | |
| 9479 | encoder.PutUint16(uint16(self.Code)) |
| 9480 | encoder.Write(self.Data) |
| 9481 | length := len(encoder.Bytes()) - startIndex |
| 9482 | |
| 9483 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 9484 | |
| 9485 | return nil |
| 9486 | } |
| 9487 | |
| 9488 | func DecodeHelloFailedErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*HelloFailedErrorMsg, error) { |
| 9489 | _hellofailederrormsg := &HelloFailedErrorMsg{ErrorMsg: parent} |
| 9490 | if decoder.Length() < 2 { |
| 9491 | return nil, fmt.Errorf("HelloFailedErrorMsg packet too short: %d < 2", decoder.Length()) |
| 9492 | } |
| 9493 | _hellofailederrormsg.Code = HelloFailedCode(decoder.ReadUint16()) |
| 9494 | _hellofailederrormsg.Data = decoder.Read(int(decoder.Length())) |
| 9495 | return _hellofailederrormsg, nil |
| 9496 | } |
| 9497 | |
| 9498 | func NewHelloFailedErrorMsg() *HelloFailedErrorMsg { |
| 9499 | obj := &HelloFailedErrorMsg{ |
| 9500 | ErrorMsg: NewErrorMsg(0), |
| 9501 | } |
| 9502 | return obj |
| 9503 | } |
| 9504 | |
| 9505 | type MeterConfigStatsReply struct { |
| 9506 | *StatsReply |
| 9507 | Entries []*MeterConfig |
| 9508 | } |
| 9509 | |
| 9510 | type IMeterConfigStatsReply interface { |
| 9511 | IStatsReply |
| 9512 | GetEntries() []*MeterConfig |
| 9513 | } |
| 9514 | |
| 9515 | func (self *MeterConfigStatsReply) GetEntries() []*MeterConfig { |
| 9516 | return self.Entries |
| 9517 | } |
| 9518 | |
| 9519 | func (self *MeterConfigStatsReply) SetEntries(v []*MeterConfig) { |
| 9520 | self.Entries = v |
| 9521 | } |
| 9522 | |
| 9523 | func (self *MeterConfigStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 9524 | startIndex := len(encoder.Bytes()) |
| 9525 | if err := self.StatsReply.Serialize(encoder); err != nil { |
| 9526 | return err |
| 9527 | } |
| 9528 | |
| 9529 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 9530 | for _, obj := range self.Entries { |
| 9531 | if err := obj.Serialize(encoder); err != nil { |
| 9532 | return err |
| 9533 | } |
| 9534 | } |
| 9535 | length := len(encoder.Bytes()) - startIndex |
| 9536 | |
| 9537 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 9538 | |
| 9539 | return nil |
| 9540 | } |
| 9541 | |
| 9542 | func DecodeMeterConfigStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*MeterConfigStatsReply, error) { |
| 9543 | _meterconfigstatsreply := &MeterConfigStatsReply{StatsReply: parent} |
| 9544 | if decoder.Length() < 4 { |
| 9545 | return nil, fmt.Errorf("MeterConfigStatsReply packet too short: %d < 4", decoder.Length()) |
| 9546 | } |
| 9547 | decoder.Skip(4) |
| 9548 | |
| 9549 | for decoder.Length() >= 8 { |
| 9550 | item, err := DecodeMeterConfig(decoder) |
| 9551 | if err != nil { |
| 9552 | return nil, err |
| 9553 | } |
| 9554 | if item != nil { |
| 9555 | _meterconfigstatsreply.Entries = append(_meterconfigstatsreply.Entries, item) |
| 9556 | } |
| 9557 | } |
| 9558 | return _meterconfigstatsreply, nil |
| 9559 | } |
| 9560 | |
| 9561 | func NewMeterConfigStatsReply() *MeterConfigStatsReply { |
| 9562 | obj := &MeterConfigStatsReply{ |
| 9563 | StatsReply: NewStatsReply(10), |
| 9564 | } |
| 9565 | return obj |
| 9566 | } |
| 9567 | |
| 9568 | type MeterConfigStatsRequest struct { |
| 9569 | *StatsRequest |
| 9570 | MeterId uint32 |
| 9571 | } |
| 9572 | |
| 9573 | type IMeterConfigStatsRequest interface { |
| 9574 | IStatsRequest |
| 9575 | GetMeterId() uint32 |
| 9576 | } |
| 9577 | |
| 9578 | func (self *MeterConfigStatsRequest) GetMeterId() uint32 { |
| 9579 | return self.MeterId |
| 9580 | } |
| 9581 | |
| 9582 | func (self *MeterConfigStatsRequest) SetMeterId(v uint32) { |
| 9583 | self.MeterId = v |
| 9584 | } |
| 9585 | |
| 9586 | func (self *MeterConfigStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 9587 | startIndex := len(encoder.Bytes()) |
| 9588 | if err := self.StatsRequest.Serialize(encoder); err != nil { |
| 9589 | return err |
| 9590 | } |
| 9591 | |
| 9592 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 9593 | encoder.PutUint32(uint32(self.MeterId)) |
| 9594 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 9595 | length := len(encoder.Bytes()) - startIndex |
| 9596 | |
| 9597 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 9598 | |
| 9599 | return nil |
| 9600 | } |
| 9601 | |
| 9602 | func DecodeMeterConfigStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*MeterConfigStatsRequest, error) { |
| 9603 | _meterconfigstatsrequest := &MeterConfigStatsRequest{StatsRequest: parent} |
| 9604 | if decoder.Length() < 4 { |
| 9605 | return nil, fmt.Errorf("MeterConfigStatsRequest packet too short: %d < 4", decoder.Length()) |
| 9606 | } |
| 9607 | decoder.Skip(4) |
| 9608 | _meterconfigstatsrequest.MeterId = uint32(decoder.ReadUint32()) |
| 9609 | decoder.Skip(4) |
| 9610 | return _meterconfigstatsrequest, nil |
| 9611 | } |
| 9612 | |
| 9613 | func NewMeterConfigStatsRequest() *MeterConfigStatsRequest { |
| 9614 | obj := &MeterConfigStatsRequest{ |
| 9615 | StatsRequest: NewStatsRequest(10), |
| 9616 | } |
| 9617 | return obj |
| 9618 | } |
| 9619 | |
| 9620 | type MeterFeaturesStatsReply struct { |
| 9621 | *StatsReply |
| 9622 | Features MeterFeatures |
| 9623 | } |
| 9624 | |
| 9625 | type IMeterFeaturesStatsReply interface { |
| 9626 | IStatsReply |
| 9627 | GetFeatures() MeterFeatures |
| 9628 | } |
| 9629 | |
| 9630 | func (self *MeterFeaturesStatsReply) GetFeatures() MeterFeatures { |
| 9631 | return self.Features |
| 9632 | } |
| 9633 | |
| 9634 | func (self *MeterFeaturesStatsReply) SetFeatures(v MeterFeatures) { |
| 9635 | self.Features = v |
| 9636 | } |
| 9637 | |
| 9638 | func (self *MeterFeaturesStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 9639 | startIndex := len(encoder.Bytes()) |
| 9640 | if err := self.StatsReply.Serialize(encoder); err != nil { |
| 9641 | return err |
| 9642 | } |
| 9643 | |
| 9644 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 9645 | if err := self.Features.Serialize(encoder); err != nil { |
| 9646 | return err |
| 9647 | } |
| 9648 | |
| 9649 | length := len(encoder.Bytes()) - startIndex |
| 9650 | |
| 9651 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 9652 | |
| 9653 | return nil |
| 9654 | } |
| 9655 | |
| 9656 | func DecodeMeterFeaturesStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*MeterFeaturesStatsReply, error) { |
| 9657 | _meterfeaturesstatsreply := &MeterFeaturesStatsReply{StatsReply: parent} |
| 9658 | if decoder.Length() < 20 { |
| 9659 | return nil, fmt.Errorf("MeterFeaturesStatsReply packet too short: %d < 20", decoder.Length()) |
| 9660 | } |
| 9661 | decoder.Skip(4) |
| 9662 | if err := _meterfeaturesstatsreply.Features.Decode(decoder); err != nil { |
| 9663 | return nil, err |
| 9664 | } |
| 9665 | |
| 9666 | return _meterfeaturesstatsreply, nil |
| 9667 | } |
| 9668 | |
| 9669 | func NewMeterFeaturesStatsReply() *MeterFeaturesStatsReply { |
| 9670 | obj := &MeterFeaturesStatsReply{ |
| 9671 | StatsReply: NewStatsReply(11), |
| 9672 | } |
| 9673 | return obj |
| 9674 | } |
| 9675 | |
| 9676 | type MeterFeaturesStatsRequest struct { |
| 9677 | *StatsRequest |
| 9678 | } |
| 9679 | |
| 9680 | type IMeterFeaturesStatsRequest interface { |
| 9681 | IStatsRequest |
| 9682 | } |
| 9683 | |
| 9684 | func (self *MeterFeaturesStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 9685 | startIndex := len(encoder.Bytes()) |
| 9686 | if err := self.StatsRequest.Serialize(encoder); err != nil { |
| 9687 | return err |
| 9688 | } |
| 9689 | |
| 9690 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 9691 | length := len(encoder.Bytes()) - startIndex |
| 9692 | |
| 9693 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 9694 | |
| 9695 | return nil |
| 9696 | } |
| 9697 | |
| 9698 | func DecodeMeterFeaturesStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*MeterFeaturesStatsRequest, error) { |
| 9699 | _meterfeaturesstatsrequest := &MeterFeaturesStatsRequest{StatsRequest: parent} |
| 9700 | if decoder.Length() < 4 { |
| 9701 | return nil, fmt.Errorf("MeterFeaturesStatsRequest packet too short: %d < 4", decoder.Length()) |
| 9702 | } |
| 9703 | decoder.Skip(4) |
| 9704 | return _meterfeaturesstatsrequest, nil |
| 9705 | } |
| 9706 | |
| 9707 | func NewMeterFeaturesStatsRequest() *MeterFeaturesStatsRequest { |
| 9708 | obj := &MeterFeaturesStatsRequest{ |
| 9709 | StatsRequest: NewStatsRequest(11), |
| 9710 | } |
| 9711 | return obj |
| 9712 | } |
| 9713 | |
| 9714 | type MeterMod struct { |
| 9715 | *Header |
| 9716 | Command MeterModCommand |
| 9717 | Flags MeterFlags |
| 9718 | MeterId uint32 |
| 9719 | Bands []IMeterBand |
| 9720 | } |
| 9721 | |
| 9722 | type IMeterMod interface { |
| 9723 | IHeader |
| 9724 | GetCommand() MeterModCommand |
| 9725 | GetFlags() MeterFlags |
| 9726 | GetMeterId() uint32 |
| 9727 | GetBands() []IMeterBand |
| 9728 | } |
| 9729 | |
| 9730 | func (self *MeterMod) GetCommand() MeterModCommand { |
| 9731 | return self.Command |
| 9732 | } |
| 9733 | |
| 9734 | func (self *MeterMod) SetCommand(v MeterModCommand) { |
| 9735 | self.Command = v |
| 9736 | } |
| 9737 | |
| 9738 | func (self *MeterMod) GetFlags() MeterFlags { |
| 9739 | return self.Flags |
| 9740 | } |
| 9741 | |
| 9742 | func (self *MeterMod) SetFlags(v MeterFlags) { |
| 9743 | self.Flags = v |
| 9744 | } |
| 9745 | |
| 9746 | func (self *MeterMod) GetMeterId() uint32 { |
| 9747 | return self.MeterId |
| 9748 | } |
| 9749 | |
| 9750 | func (self *MeterMod) SetMeterId(v uint32) { |
| 9751 | self.MeterId = v |
| 9752 | } |
| 9753 | |
| 9754 | func (self *MeterMod) GetBands() []IMeterBand { |
| 9755 | return self.Bands |
| 9756 | } |
| 9757 | |
| 9758 | func (self *MeterMod) SetBands(v []IMeterBand) { |
| 9759 | self.Bands = v |
| 9760 | } |
| 9761 | |
| 9762 | func (self *MeterMod) Serialize(encoder *goloxi.Encoder) error { |
| 9763 | startIndex := len(encoder.Bytes()) |
| 9764 | if err := self.Header.Serialize(encoder); err != nil { |
| 9765 | return err |
| 9766 | } |
| 9767 | |
| 9768 | encoder.PutUint16(uint16(self.Command)) |
| 9769 | encoder.PutUint16(uint16(self.Flags)) |
| 9770 | encoder.PutUint32(uint32(self.MeterId)) |
| 9771 | for _, obj := range self.Bands { |
| 9772 | if err := obj.Serialize(encoder); err != nil { |
| 9773 | return err |
| 9774 | } |
| 9775 | } |
| 9776 | length := len(encoder.Bytes()) - startIndex |
| 9777 | |
| 9778 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 9779 | |
| 9780 | return nil |
| 9781 | } |
| 9782 | |
| 9783 | func DecodeMeterMod(parent *Header, decoder *goloxi.Decoder) (*MeterMod, error) { |
| 9784 | _metermod := &MeterMod{Header: parent} |
| 9785 | if decoder.Length() < 8 { |
| 9786 | return nil, fmt.Errorf("MeterMod packet too short: %d < 8", decoder.Length()) |
| 9787 | } |
| 9788 | _metermod.Command = MeterModCommand(decoder.ReadUint16()) |
| 9789 | _metermod.Flags = MeterFlags(decoder.ReadUint16()) |
| 9790 | _metermod.MeterId = uint32(decoder.ReadUint32()) |
| 9791 | |
| 9792 | for decoder.Length() >= 4 { |
| 9793 | item, err := DecodeMeterBand(decoder) |
| 9794 | if err != nil { |
| 9795 | return nil, err |
| 9796 | } |
| 9797 | if item != nil { |
| 9798 | _metermod.Bands = append(_metermod.Bands, item) |
| 9799 | } |
| 9800 | } |
| 9801 | return _metermod, nil |
| 9802 | } |
| 9803 | |
| 9804 | func NewMeterMod() *MeterMod { |
| 9805 | obj := &MeterMod{ |
| 9806 | Header: NewHeader(29), |
| 9807 | } |
| 9808 | return obj |
| 9809 | } |
| 9810 | |
| 9811 | type MeterModFailedErrorMsg struct { |
| 9812 | *ErrorMsg |
| 9813 | Code MeterModFailedCode |
| 9814 | Data []byte |
| 9815 | } |
| 9816 | |
| 9817 | type IMeterModFailedErrorMsg interface { |
| 9818 | IErrorMsg |
| 9819 | GetCode() MeterModFailedCode |
| 9820 | GetData() []byte |
| 9821 | } |
| 9822 | |
| 9823 | func (self *MeterModFailedErrorMsg) GetCode() MeterModFailedCode { |
| 9824 | return self.Code |
| 9825 | } |
| 9826 | |
| 9827 | func (self *MeterModFailedErrorMsg) SetCode(v MeterModFailedCode) { |
| 9828 | self.Code = v |
| 9829 | } |
| 9830 | |
| 9831 | func (self *MeterModFailedErrorMsg) GetData() []byte { |
| 9832 | return self.Data |
| 9833 | } |
| 9834 | |
| 9835 | func (self *MeterModFailedErrorMsg) SetData(v []byte) { |
| 9836 | self.Data = v |
| 9837 | } |
| 9838 | |
| 9839 | func (self *MeterModFailedErrorMsg) Serialize(encoder *goloxi.Encoder) error { |
| 9840 | startIndex := len(encoder.Bytes()) |
| 9841 | if err := self.ErrorMsg.Serialize(encoder); err != nil { |
| 9842 | return err |
| 9843 | } |
| 9844 | |
| 9845 | encoder.PutUint16(uint16(self.Code)) |
| 9846 | encoder.Write(self.Data) |
| 9847 | length := len(encoder.Bytes()) - startIndex |
| 9848 | |
| 9849 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 9850 | |
| 9851 | return nil |
| 9852 | } |
| 9853 | |
| 9854 | func DecodeMeterModFailedErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*MeterModFailedErrorMsg, error) { |
| 9855 | _metermodfailederrormsg := &MeterModFailedErrorMsg{ErrorMsg: parent} |
| 9856 | if decoder.Length() < 2 { |
| 9857 | return nil, fmt.Errorf("MeterModFailedErrorMsg packet too short: %d < 2", decoder.Length()) |
| 9858 | } |
| 9859 | _metermodfailederrormsg.Code = MeterModFailedCode(decoder.ReadUint16()) |
| 9860 | _metermodfailederrormsg.Data = decoder.Read(int(decoder.Length())) |
| 9861 | return _metermodfailederrormsg, nil |
| 9862 | } |
| 9863 | |
| 9864 | func NewMeterModFailedErrorMsg() *MeterModFailedErrorMsg { |
| 9865 | obj := &MeterModFailedErrorMsg{ |
| 9866 | ErrorMsg: NewErrorMsg(12), |
| 9867 | } |
| 9868 | return obj |
| 9869 | } |
| 9870 | |
| 9871 | type MeterStatsReply struct { |
| 9872 | *StatsReply |
| 9873 | Entries []*MeterStats |
| 9874 | } |
| 9875 | |
| 9876 | type IMeterStatsReply interface { |
| 9877 | IStatsReply |
| 9878 | GetEntries() []*MeterStats |
| 9879 | } |
| 9880 | |
| 9881 | func (self *MeterStatsReply) GetEntries() []*MeterStats { |
| 9882 | return self.Entries |
| 9883 | } |
| 9884 | |
| 9885 | func (self *MeterStatsReply) SetEntries(v []*MeterStats) { |
| 9886 | self.Entries = v |
| 9887 | } |
| 9888 | |
| 9889 | func (self *MeterStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 9890 | startIndex := len(encoder.Bytes()) |
| 9891 | if err := self.StatsReply.Serialize(encoder); err != nil { |
| 9892 | return err |
| 9893 | } |
| 9894 | |
| 9895 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 9896 | for _, obj := range self.Entries { |
| 9897 | if err := obj.Serialize(encoder); err != nil { |
| 9898 | return err |
| 9899 | } |
| 9900 | } |
| 9901 | length := len(encoder.Bytes()) - startIndex |
| 9902 | |
| 9903 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 9904 | |
| 9905 | return nil |
| 9906 | } |
| 9907 | |
| 9908 | func DecodeMeterStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*MeterStatsReply, error) { |
| 9909 | _meterstatsreply := &MeterStatsReply{StatsReply: parent} |
| 9910 | if decoder.Length() < 4 { |
| 9911 | return nil, fmt.Errorf("MeterStatsReply packet too short: %d < 4", decoder.Length()) |
| 9912 | } |
| 9913 | decoder.Skip(4) |
| 9914 | |
| 9915 | for decoder.Length() >= 40 { |
| 9916 | item, err := DecodeMeterStats(decoder) |
| 9917 | if err != nil { |
| 9918 | return nil, err |
| 9919 | } |
| 9920 | if item != nil { |
| 9921 | _meterstatsreply.Entries = append(_meterstatsreply.Entries, item) |
| 9922 | } |
| 9923 | } |
| 9924 | return _meterstatsreply, nil |
| 9925 | } |
| 9926 | |
| 9927 | func NewMeterStatsReply() *MeterStatsReply { |
| 9928 | obj := &MeterStatsReply{ |
| 9929 | StatsReply: NewStatsReply(9), |
| 9930 | } |
| 9931 | return obj |
| 9932 | } |
| 9933 | |
| 9934 | type MeterStatsRequest struct { |
| 9935 | *StatsRequest |
| 9936 | MeterId uint32 |
| 9937 | } |
| 9938 | |
| 9939 | type IMeterStatsRequest interface { |
| 9940 | IStatsRequest |
| 9941 | GetMeterId() uint32 |
| 9942 | } |
| 9943 | |
| 9944 | func (self *MeterStatsRequest) GetMeterId() uint32 { |
| 9945 | return self.MeterId |
| 9946 | } |
| 9947 | |
| 9948 | func (self *MeterStatsRequest) SetMeterId(v uint32) { |
| 9949 | self.MeterId = v |
| 9950 | } |
| 9951 | |
| 9952 | func (self *MeterStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 9953 | startIndex := len(encoder.Bytes()) |
| 9954 | if err := self.StatsRequest.Serialize(encoder); err != nil { |
| 9955 | return err |
| 9956 | } |
| 9957 | |
| 9958 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 9959 | encoder.PutUint32(uint32(self.MeterId)) |
| 9960 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 9961 | length := len(encoder.Bytes()) - startIndex |
| 9962 | |
| 9963 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 9964 | |
| 9965 | return nil |
| 9966 | } |
| 9967 | |
| 9968 | func DecodeMeterStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*MeterStatsRequest, error) { |
| 9969 | _meterstatsrequest := &MeterStatsRequest{StatsRequest: parent} |
| 9970 | if decoder.Length() < 4 { |
| 9971 | return nil, fmt.Errorf("MeterStatsRequest packet too short: %d < 4", decoder.Length()) |
| 9972 | } |
| 9973 | decoder.Skip(4) |
| 9974 | _meterstatsrequest.MeterId = uint32(decoder.ReadUint32()) |
| 9975 | decoder.Skip(4) |
| 9976 | return _meterstatsrequest, nil |
| 9977 | } |
| 9978 | |
| 9979 | func NewMeterStatsRequest() *MeterStatsRequest { |
| 9980 | obj := &MeterStatsRequest{ |
| 9981 | StatsRequest: NewStatsRequest(9), |
| 9982 | } |
| 9983 | return obj |
| 9984 | } |
| 9985 | |
| 9986 | type NiciraStatsReply struct { |
| 9987 | *ExperimenterStatsReply |
| 9988 | } |
| 9989 | |
| 9990 | type INiciraStatsReply interface { |
| 9991 | IExperimenterStatsReply |
| 9992 | } |
| 9993 | |
| 9994 | func (self *NiciraStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 9995 | if err := self.ExperimenterStatsReply.Serialize(encoder); err != nil { |
| 9996 | return err |
| 9997 | } |
| 9998 | |
| 9999 | return nil |
| 10000 | } |
| 10001 | |
| 10002 | func DecodeNiciraStatsReply(parent *ExperimenterStatsReply, decoder *goloxi.Decoder) (INiciraStatsReply, error) { |
| 10003 | _nicirastatsreply := &NiciraStatsReply{ExperimenterStatsReply: parent} |
| 10004 | if decoder.Length() < -4 { |
| 10005 | return nil, fmt.Errorf("NiciraStatsReply packet too short: %d < -4", decoder.Length()) |
| 10006 | } |
| 10007 | |
| 10008 | switch _nicirastatsreply.Subtype { |
| 10009 | case 0: |
| 10010 | return DecodeNiciraFlowStatsReply(_nicirastatsreply, decoder) |
| 10011 | case 2: |
| 10012 | return DecodeNiciraFlowMonitorReply(_nicirastatsreply, decoder) |
| 10013 | default: |
| 10014 | return nil, fmt.Errorf("Invalid type '%d' for 'NiciraStatsReply'", _nicirastatsreply.Subtype) |
| 10015 | } |
| 10016 | } |
| 10017 | |
| 10018 | func NewNiciraStatsReply(_subtype uint32) *NiciraStatsReply { |
| 10019 | obj := &NiciraStatsReply{ |
| 10020 | ExperimenterStatsReply: NewExperimenterStatsReply(8992), |
| 10021 | } |
| 10022 | obj.Subtype = _subtype |
| 10023 | return obj |
| 10024 | } |
| 10025 | |
| 10026 | type NiciraFlowMonitorReply struct { |
| 10027 | *NiciraStatsReply |
| 10028 | Updates []INiciraFlowUpdateEvent |
| 10029 | } |
| 10030 | |
| 10031 | type INiciraFlowMonitorReply interface { |
| 10032 | INiciraStatsReply |
| 10033 | GetUpdates() []INiciraFlowUpdateEvent |
| 10034 | } |
| 10035 | |
| 10036 | func (self *NiciraFlowMonitorReply) GetUpdates() []INiciraFlowUpdateEvent { |
| 10037 | return self.Updates |
| 10038 | } |
| 10039 | |
| 10040 | func (self *NiciraFlowMonitorReply) SetUpdates(v []INiciraFlowUpdateEvent) { |
| 10041 | self.Updates = v |
| 10042 | } |
| 10043 | |
| 10044 | func (self *NiciraFlowMonitorReply) Serialize(encoder *goloxi.Encoder) error { |
| 10045 | startIndex := len(encoder.Bytes()) |
| 10046 | if err := self.NiciraStatsReply.Serialize(encoder); err != nil { |
| 10047 | return err |
| 10048 | } |
| 10049 | |
| 10050 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 10051 | for _, obj := range self.Updates { |
| 10052 | if err := obj.Serialize(encoder); err != nil { |
| 10053 | return err |
| 10054 | } |
| 10055 | } |
| 10056 | length := len(encoder.Bytes()) - startIndex |
| 10057 | |
| 10058 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 10059 | |
| 10060 | return nil |
| 10061 | } |
| 10062 | |
| 10063 | func DecodeNiciraFlowMonitorReply(parent *NiciraStatsReply, decoder *goloxi.Decoder) (*NiciraFlowMonitorReply, error) { |
| 10064 | _niciraflowmonitorreply := &NiciraFlowMonitorReply{NiciraStatsReply: parent} |
| 10065 | if decoder.Length() < 4 { |
| 10066 | return nil, fmt.Errorf("NiciraFlowMonitorReply packet too short: %d < 4", decoder.Length()) |
| 10067 | } |
| 10068 | decoder.Skip(4) |
| 10069 | |
| 10070 | for decoder.Length() >= 4 { |
| 10071 | item, err := DecodeNiciraFlowUpdateEvent(decoder) |
| 10072 | if err != nil { |
| 10073 | return nil, err |
| 10074 | } |
| 10075 | if item != nil { |
| 10076 | _niciraflowmonitorreply.Updates = append(_niciraflowmonitorreply.Updates, item) |
| 10077 | } |
| 10078 | } |
| 10079 | return _niciraflowmonitorreply, nil |
| 10080 | } |
| 10081 | |
| 10082 | func NewNiciraFlowMonitorReply() *NiciraFlowMonitorReply { |
| 10083 | obj := &NiciraFlowMonitorReply{ |
| 10084 | NiciraStatsReply: NewNiciraStatsReply(2), |
| 10085 | } |
| 10086 | return obj |
| 10087 | } |
| 10088 | |
| 10089 | type NiciraFlowMonitorRequest struct { |
| 10090 | *ExperimenterStatsRequest |
| 10091 | MonitorId uint32 |
| 10092 | MonitorFlags NxFlowMonitorFlags |
| 10093 | OutPort Port |
| 10094 | MatchLen uint16 |
| 10095 | TableId uint8 |
| 10096 | Match NiciraMatch |
| 10097 | } |
| 10098 | |
| 10099 | type INiciraFlowMonitorRequest interface { |
| 10100 | IExperimenterStatsRequest |
| 10101 | GetMonitorId() uint32 |
| 10102 | GetMonitorFlags() NxFlowMonitorFlags |
| 10103 | GetOutPort() Port |
| 10104 | GetMatchLen() uint16 |
| 10105 | GetTableId() uint8 |
| 10106 | GetMatch() NiciraMatch |
| 10107 | } |
| 10108 | |
| 10109 | func (self *NiciraFlowMonitorRequest) GetMonitorId() uint32 { |
| 10110 | return self.MonitorId |
| 10111 | } |
| 10112 | |
| 10113 | func (self *NiciraFlowMonitorRequest) SetMonitorId(v uint32) { |
| 10114 | self.MonitorId = v |
| 10115 | } |
| 10116 | |
| 10117 | func (self *NiciraFlowMonitorRequest) GetMonitorFlags() NxFlowMonitorFlags { |
| 10118 | return self.MonitorFlags |
| 10119 | } |
| 10120 | |
| 10121 | func (self *NiciraFlowMonitorRequest) SetMonitorFlags(v NxFlowMonitorFlags) { |
| 10122 | self.MonitorFlags = v |
| 10123 | } |
| 10124 | |
| 10125 | func (self *NiciraFlowMonitorRequest) GetOutPort() Port { |
| 10126 | return self.OutPort |
| 10127 | } |
| 10128 | |
| 10129 | func (self *NiciraFlowMonitorRequest) SetOutPort(v Port) { |
| 10130 | self.OutPort = v |
| 10131 | } |
| 10132 | |
| 10133 | func (self *NiciraFlowMonitorRequest) GetMatchLen() uint16 { |
| 10134 | return self.MatchLen |
| 10135 | } |
| 10136 | |
| 10137 | func (self *NiciraFlowMonitorRequest) SetMatchLen(v uint16) { |
| 10138 | self.MatchLen = v |
| 10139 | } |
| 10140 | |
| 10141 | func (self *NiciraFlowMonitorRequest) GetTableId() uint8 { |
| 10142 | return self.TableId |
| 10143 | } |
| 10144 | |
| 10145 | func (self *NiciraFlowMonitorRequest) SetTableId(v uint8) { |
| 10146 | self.TableId = v |
| 10147 | } |
| 10148 | |
| 10149 | func (self *NiciraFlowMonitorRequest) GetMatch() NiciraMatch { |
| 10150 | return self.Match |
| 10151 | } |
| 10152 | |
| 10153 | func (self *NiciraFlowMonitorRequest) SetMatch(v NiciraMatch) { |
| 10154 | self.Match = v |
| 10155 | } |
| 10156 | |
| 10157 | func (self *NiciraFlowMonitorRequest) Serialize(encoder *goloxi.Encoder) error { |
| 10158 | startIndex := len(encoder.Bytes()) |
| 10159 | if err := self.ExperimenterStatsRequest.Serialize(encoder); err != nil { |
| 10160 | return err |
| 10161 | } |
| 10162 | |
| 10163 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 10164 | encoder.PutUint32(uint32(self.MonitorId)) |
| 10165 | encoder.PutUint16(uint16(self.MonitorFlags)) |
| 10166 | self.OutPort.Serialize(encoder) |
| 10167 | encoder.PutUint16(uint16(self.MatchLen)) |
| 10168 | encoder.PutUint8(uint8(self.TableId)) |
| 10169 | encoder.Write(bytes.Repeat([]byte{0}, 5)) |
| 10170 | if err := self.Match.Serialize(encoder); err != nil { |
| 10171 | return err |
| 10172 | } |
| 10173 | |
| 10174 | length := len(encoder.Bytes()) - startIndex |
| 10175 | |
| 10176 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 10177 | |
| 10178 | return nil |
| 10179 | } |
| 10180 | |
| 10181 | func DecodeNiciraFlowMonitorRequest(parent *ExperimenterStatsRequest, decoder *goloxi.Decoder) (*NiciraFlowMonitorRequest, error) { |
| 10182 | _niciraflowmonitorrequest := &NiciraFlowMonitorRequest{ExperimenterStatsRequest: parent} |
| 10183 | if decoder.Length() < 22 { |
| 10184 | return nil, fmt.Errorf("NiciraFlowMonitorRequest packet too short: %d < 22", decoder.Length()) |
| 10185 | } |
| 10186 | decoder.Skip(4) |
| 10187 | _niciraflowmonitorrequest.MonitorId = uint32(decoder.ReadUint32()) |
| 10188 | _niciraflowmonitorrequest.MonitorFlags = NxFlowMonitorFlags(decoder.ReadUint16()) |
| 10189 | _niciraflowmonitorrequest.OutPort.Decode(decoder) |
| 10190 | _niciraflowmonitorrequest.MatchLen = uint16(decoder.ReadUint16()) |
| 10191 | _niciraflowmonitorrequest.TableId = uint8(decoder.ReadByte()) |
| 10192 | decoder.Skip(5) |
| 10193 | if err := _niciraflowmonitorrequest.Match.Decode(decoder); err != nil { |
| 10194 | return nil, err |
| 10195 | } |
| 10196 | |
| 10197 | decoder.SkipAlign() |
| 10198 | return _niciraflowmonitorrequest, nil |
| 10199 | } |
| 10200 | |
| 10201 | func NewNiciraFlowMonitorRequest() *NiciraFlowMonitorRequest { |
| 10202 | obj := &NiciraFlowMonitorRequest{ |
| 10203 | ExperimenterStatsRequest: NewExperimenterStatsRequest(8992), |
| 10204 | } |
| 10205 | return obj |
| 10206 | } |
| 10207 | |
| 10208 | type NiciraFlowStatsReply struct { |
| 10209 | *NiciraStatsReply |
| 10210 | Stats []*NiciraFlowStats |
| 10211 | } |
| 10212 | |
| 10213 | type INiciraFlowStatsReply interface { |
| 10214 | INiciraStatsReply |
| 10215 | GetStats() []*NiciraFlowStats |
| 10216 | } |
| 10217 | |
| 10218 | func (self *NiciraFlowStatsReply) GetStats() []*NiciraFlowStats { |
| 10219 | return self.Stats |
| 10220 | } |
| 10221 | |
| 10222 | func (self *NiciraFlowStatsReply) SetStats(v []*NiciraFlowStats) { |
| 10223 | self.Stats = v |
| 10224 | } |
| 10225 | |
| 10226 | func (self *NiciraFlowStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 10227 | startIndex := len(encoder.Bytes()) |
| 10228 | if err := self.NiciraStatsReply.Serialize(encoder); err != nil { |
| 10229 | return err |
| 10230 | } |
| 10231 | |
| 10232 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 10233 | for _, obj := range self.Stats { |
| 10234 | if err := obj.Serialize(encoder); err != nil { |
| 10235 | return err |
| 10236 | } |
| 10237 | } |
| 10238 | length := len(encoder.Bytes()) - startIndex |
| 10239 | |
| 10240 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 10241 | |
| 10242 | return nil |
| 10243 | } |
| 10244 | |
| 10245 | func DecodeNiciraFlowStatsReply(parent *NiciraStatsReply, decoder *goloxi.Decoder) (*NiciraFlowStatsReply, error) { |
| 10246 | _niciraflowstatsreply := &NiciraFlowStatsReply{NiciraStatsReply: parent} |
| 10247 | if decoder.Length() < 4 { |
| 10248 | return nil, fmt.Errorf("NiciraFlowStatsReply packet too short: %d < 4", decoder.Length()) |
| 10249 | } |
| 10250 | decoder.Skip(4) |
| 10251 | |
| 10252 | for decoder.Length() >= 48 { |
| 10253 | item, err := DecodeNiciraFlowStats(decoder) |
| 10254 | if err != nil { |
| 10255 | return nil, err |
| 10256 | } |
| 10257 | if item != nil { |
| 10258 | _niciraflowstatsreply.Stats = append(_niciraflowstatsreply.Stats, item) |
| 10259 | } |
| 10260 | } |
| 10261 | return _niciraflowstatsreply, nil |
| 10262 | } |
| 10263 | |
| 10264 | func NewNiciraFlowStatsReply() *NiciraFlowStatsReply { |
| 10265 | obj := &NiciraFlowStatsReply{ |
| 10266 | NiciraStatsReply: NewNiciraStatsReply(0), |
| 10267 | } |
| 10268 | return obj |
| 10269 | } |
| 10270 | |
| 10271 | type NiciraFlowStatsRequest struct { |
| 10272 | *ExperimenterStatsRequest |
| 10273 | OutPort Port |
| 10274 | MatchLen uint16 |
| 10275 | TableId uint8 |
| 10276 | } |
| 10277 | |
| 10278 | type INiciraFlowStatsRequest interface { |
| 10279 | IExperimenterStatsRequest |
| 10280 | GetOutPort() Port |
| 10281 | GetMatchLen() uint16 |
| 10282 | GetTableId() uint8 |
| 10283 | } |
| 10284 | |
| 10285 | func (self *NiciraFlowStatsRequest) GetOutPort() Port { |
| 10286 | return self.OutPort |
| 10287 | } |
| 10288 | |
| 10289 | func (self *NiciraFlowStatsRequest) SetOutPort(v Port) { |
| 10290 | self.OutPort = v |
| 10291 | } |
| 10292 | |
| 10293 | func (self *NiciraFlowStatsRequest) GetMatchLen() uint16 { |
| 10294 | return self.MatchLen |
| 10295 | } |
| 10296 | |
| 10297 | func (self *NiciraFlowStatsRequest) SetMatchLen(v uint16) { |
| 10298 | self.MatchLen = v |
| 10299 | } |
| 10300 | |
| 10301 | func (self *NiciraFlowStatsRequest) GetTableId() uint8 { |
| 10302 | return self.TableId |
| 10303 | } |
| 10304 | |
| 10305 | func (self *NiciraFlowStatsRequest) SetTableId(v uint8) { |
| 10306 | self.TableId = v |
| 10307 | } |
| 10308 | |
| 10309 | func (self *NiciraFlowStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 10310 | startIndex := len(encoder.Bytes()) |
| 10311 | if err := self.ExperimenterStatsRequest.Serialize(encoder); err != nil { |
| 10312 | return err |
| 10313 | } |
| 10314 | |
| 10315 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 10316 | self.OutPort.Serialize(encoder) |
| 10317 | encoder.PutUint16(uint16(self.MatchLen)) |
| 10318 | encoder.PutUint8(uint8(self.TableId)) |
| 10319 | encoder.Write(bytes.Repeat([]byte{0}, 3)) |
| 10320 | length := len(encoder.Bytes()) - startIndex |
| 10321 | |
| 10322 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 10323 | |
| 10324 | return nil |
| 10325 | } |
| 10326 | |
| 10327 | func DecodeNiciraFlowStatsRequest(parent *ExperimenterStatsRequest, decoder *goloxi.Decoder) (*NiciraFlowStatsRequest, error) { |
| 10328 | _niciraflowstatsrequest := &NiciraFlowStatsRequest{ExperimenterStatsRequest: parent} |
| 10329 | if decoder.Length() < 14 { |
| 10330 | return nil, fmt.Errorf("NiciraFlowStatsRequest packet too short: %d < 14", decoder.Length()) |
| 10331 | } |
| 10332 | decoder.Skip(4) |
| 10333 | _niciraflowstatsrequest.OutPort.Decode(decoder) |
| 10334 | _niciraflowstatsrequest.MatchLen = uint16(decoder.ReadUint16()) |
| 10335 | _niciraflowstatsrequest.TableId = uint8(decoder.ReadByte()) |
| 10336 | decoder.Skip(3) |
| 10337 | return _niciraflowstatsrequest, nil |
| 10338 | } |
| 10339 | |
| 10340 | func NewNiciraFlowStatsRequest() *NiciraFlowStatsRequest { |
| 10341 | obj := &NiciraFlowStatsRequest{ |
| 10342 | ExperimenterStatsRequest: NewExperimenterStatsRequest(8992), |
| 10343 | } |
| 10344 | return obj |
| 10345 | } |
| 10346 | |
| 10347 | type NiciraHeader struct { |
| 10348 | *Experimenter |
| 10349 | } |
| 10350 | |
| 10351 | type INiciraHeader interface { |
| 10352 | IExperimenter |
| 10353 | } |
| 10354 | |
| 10355 | func (self *NiciraHeader) Serialize(encoder *goloxi.Encoder) error { |
| 10356 | if err := self.Experimenter.Serialize(encoder); err != nil { |
| 10357 | return err |
| 10358 | } |
| 10359 | |
| 10360 | return nil |
| 10361 | } |
| 10362 | |
| 10363 | func DecodeNiciraHeader(parent *Experimenter, decoder *goloxi.Decoder) (INiciraHeader, error) { |
| 10364 | _niciraheader := &NiciraHeader{Experimenter: parent} |
| 10365 | return _niciraheader, nil |
| 10366 | } |
| 10367 | |
| 10368 | func NewNiciraHeader(_subtype uint32) *NiciraHeader { |
| 10369 | obj := &NiciraHeader{ |
| 10370 | Experimenter: NewExperimenter(8992), |
| 10371 | } |
| 10372 | obj.Subtype = _subtype |
| 10373 | return obj |
| 10374 | } |
| 10375 | |
| 10376 | type PacketIn struct { |
| 10377 | *Header |
| 10378 | BufferId uint32 |
| 10379 | TotalLen uint16 |
| 10380 | Reason uint8 |
| 10381 | TableId uint8 |
| 10382 | Cookie uint64 |
| 10383 | Match Match |
| 10384 | Data []byte |
| 10385 | } |
| 10386 | |
| 10387 | type IPacketIn interface { |
| 10388 | IHeader |
| 10389 | GetBufferId() uint32 |
| 10390 | GetTotalLen() uint16 |
| 10391 | GetReason() uint8 |
| 10392 | GetTableId() uint8 |
| 10393 | GetCookie() uint64 |
| 10394 | GetMatch() Match |
| 10395 | GetData() []byte |
| 10396 | } |
| 10397 | |
| 10398 | func (self *PacketIn) GetBufferId() uint32 { |
| 10399 | return self.BufferId |
| 10400 | } |
| 10401 | |
| 10402 | func (self *PacketIn) SetBufferId(v uint32) { |
| 10403 | self.BufferId = v |
| 10404 | } |
| 10405 | |
| 10406 | func (self *PacketIn) GetTotalLen() uint16 { |
| 10407 | return self.TotalLen |
| 10408 | } |
| 10409 | |
| 10410 | func (self *PacketIn) SetTotalLen(v uint16) { |
| 10411 | self.TotalLen = v |
| 10412 | } |
| 10413 | |
| 10414 | func (self *PacketIn) GetReason() uint8 { |
| 10415 | return self.Reason |
| 10416 | } |
| 10417 | |
| 10418 | func (self *PacketIn) SetReason(v uint8) { |
| 10419 | self.Reason = v |
| 10420 | } |
| 10421 | |
| 10422 | func (self *PacketIn) GetTableId() uint8 { |
| 10423 | return self.TableId |
| 10424 | } |
| 10425 | |
| 10426 | func (self *PacketIn) SetTableId(v uint8) { |
| 10427 | self.TableId = v |
| 10428 | } |
| 10429 | |
| 10430 | func (self *PacketIn) GetCookie() uint64 { |
| 10431 | return self.Cookie |
| 10432 | } |
| 10433 | |
| 10434 | func (self *PacketIn) SetCookie(v uint64) { |
| 10435 | self.Cookie = v |
| 10436 | } |
| 10437 | |
| 10438 | func (self *PacketIn) GetMatch() Match { |
| 10439 | return self.Match |
| 10440 | } |
| 10441 | |
| 10442 | func (self *PacketIn) SetMatch(v Match) { |
| 10443 | self.Match = v |
| 10444 | } |
| 10445 | |
| 10446 | func (self *PacketIn) GetData() []byte { |
| 10447 | return self.Data |
| 10448 | } |
| 10449 | |
| 10450 | func (self *PacketIn) SetData(v []byte) { |
| 10451 | self.Data = v |
| 10452 | } |
| 10453 | |
| 10454 | func (self *PacketIn) Serialize(encoder *goloxi.Encoder) error { |
| 10455 | startIndex := len(encoder.Bytes()) |
| 10456 | if err := self.Header.Serialize(encoder); err != nil { |
| 10457 | return err |
| 10458 | } |
| 10459 | |
| 10460 | encoder.PutUint32(uint32(self.BufferId)) |
| 10461 | encoder.PutUint16(uint16(self.TotalLen)) |
| 10462 | encoder.PutUint8(uint8(self.Reason)) |
| 10463 | encoder.PutUint8(uint8(self.TableId)) |
| 10464 | encoder.PutUint64(uint64(self.Cookie)) |
| 10465 | if err := self.Match.Serialize(encoder); err != nil { |
| 10466 | return err |
| 10467 | } |
| 10468 | |
| 10469 | encoder.Write(bytes.Repeat([]byte{0}, 2)) |
| 10470 | encoder.Write(self.Data) |
| 10471 | length := len(encoder.Bytes()) - startIndex |
| 10472 | |
| 10473 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 10474 | |
| 10475 | return nil |
| 10476 | } |
| 10477 | |
| 10478 | func DecodePacketIn(parent *Header, decoder *goloxi.Decoder) (*PacketIn, error) { |
| 10479 | _packetin := &PacketIn{Header: parent} |
| 10480 | if decoder.Length() < 26 { |
| 10481 | return nil, fmt.Errorf("PacketIn packet too short: %d < 26", decoder.Length()) |
| 10482 | } |
| 10483 | _packetin.BufferId = uint32(decoder.ReadUint32()) |
| 10484 | _packetin.TotalLen = uint16(decoder.ReadUint16()) |
| 10485 | _packetin.Reason = uint8(decoder.ReadByte()) |
| 10486 | _packetin.TableId = uint8(decoder.ReadByte()) |
| 10487 | _packetin.Cookie = uint64(decoder.ReadUint64()) |
| 10488 | if err := _packetin.Match.Decode(decoder); err != nil { |
| 10489 | return nil, err |
| 10490 | } |
| 10491 | |
| 10492 | decoder.SkipAlign() |
| 10493 | decoder.Skip(2) |
| 10494 | _packetin.Data = decoder.Read(int(decoder.Length())) |
| 10495 | return _packetin, nil |
| 10496 | } |
| 10497 | |
| 10498 | func NewPacketIn() *PacketIn { |
| 10499 | obj := &PacketIn{ |
| 10500 | Header: NewHeader(10), |
| 10501 | } |
| 10502 | return obj |
| 10503 | } |
| 10504 | |
| 10505 | type PacketOut struct { |
| 10506 | *Header |
| 10507 | BufferId uint32 |
| 10508 | InPort Port |
| 10509 | ActionsLen uint16 |
| 10510 | Actions []goloxi.IAction |
| 10511 | Data []byte |
| 10512 | } |
| 10513 | |
| 10514 | type IPacketOut interface { |
| 10515 | IHeader |
| 10516 | GetBufferId() uint32 |
| 10517 | GetInPort() Port |
| 10518 | GetActionsLen() uint16 |
| 10519 | GetActions() []goloxi.IAction |
| 10520 | GetData() []byte |
| 10521 | } |
| 10522 | |
| 10523 | func (self *PacketOut) GetBufferId() uint32 { |
| 10524 | return self.BufferId |
| 10525 | } |
| 10526 | |
| 10527 | func (self *PacketOut) SetBufferId(v uint32) { |
| 10528 | self.BufferId = v |
| 10529 | } |
| 10530 | |
| 10531 | func (self *PacketOut) GetInPort() Port { |
| 10532 | return self.InPort |
| 10533 | } |
| 10534 | |
| 10535 | func (self *PacketOut) SetInPort(v Port) { |
| 10536 | self.InPort = v |
| 10537 | } |
| 10538 | |
| 10539 | func (self *PacketOut) GetActionsLen() uint16 { |
| 10540 | return self.ActionsLen |
| 10541 | } |
| 10542 | |
| 10543 | func (self *PacketOut) SetActionsLen(v uint16) { |
| 10544 | self.ActionsLen = v |
| 10545 | } |
| 10546 | |
| 10547 | func (self *PacketOut) GetActions() []goloxi.IAction { |
| 10548 | return self.Actions |
| 10549 | } |
| 10550 | |
| 10551 | func (self *PacketOut) SetActions(v []goloxi.IAction) { |
| 10552 | self.Actions = v |
| 10553 | } |
| 10554 | |
| 10555 | func (self *PacketOut) GetData() []byte { |
| 10556 | return self.Data |
| 10557 | } |
| 10558 | |
| 10559 | func (self *PacketOut) SetData(v []byte) { |
| 10560 | self.Data = v |
| 10561 | } |
| 10562 | |
| 10563 | func (self *PacketOut) Serialize(encoder *goloxi.Encoder) error { |
| 10564 | startIndex := len(encoder.Bytes()) |
| 10565 | if err := self.Header.Serialize(encoder); err != nil { |
| 10566 | return err |
| 10567 | } |
| 10568 | |
| 10569 | encoder.PutUint32(uint32(self.BufferId)) |
| 10570 | self.InPort.Serialize(encoder) |
| 10571 | encoder.PutUint16(uint16(self.ActionsLen)) |
| 10572 | encoder.Write(bytes.Repeat([]byte{0}, 6)) |
| 10573 | for _, obj := range self.Actions { |
| 10574 | if err := obj.Serialize(encoder); err != nil { |
| 10575 | return err |
| 10576 | } |
| 10577 | } |
| 10578 | encoder.Write(self.Data) |
| 10579 | length := len(encoder.Bytes()) - startIndex |
| 10580 | |
| 10581 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 10582 | |
| 10583 | return nil |
| 10584 | } |
| 10585 | |
| 10586 | func DecodePacketOut(parent *Header, decoder *goloxi.Decoder) (*PacketOut, error) { |
| 10587 | _packetout := &PacketOut{Header: parent} |
| 10588 | if decoder.Length() < 16 { |
| 10589 | return nil, fmt.Errorf("PacketOut packet too short: %d < 16", decoder.Length()) |
| 10590 | } |
| 10591 | _packetout.BufferId = uint32(decoder.ReadUint32()) |
| 10592 | _packetout.InPort.Decode(decoder) |
| 10593 | _packetout.ActionsLen = uint16(decoder.ReadUint16()) |
| 10594 | decoder.Skip(6) |
| 10595 | |
| 10596 | end := decoder.Offset() + int(_packetout.ActionsLen) |
| 10597 | for decoder.Offset() < end { |
| 10598 | item, err := DecodeAction(decoder) |
| 10599 | if err != nil { |
| 10600 | return nil, err |
| 10601 | } |
| 10602 | if item != nil { |
| 10603 | _packetout.Actions = append(_packetout.Actions, item) |
| 10604 | } |
| 10605 | } |
| 10606 | _packetout.Data = decoder.Read(int(decoder.Length())) |
| 10607 | return _packetout, nil |
| 10608 | } |
| 10609 | |
| 10610 | func NewPacketOut() *PacketOut { |
| 10611 | obj := &PacketOut{ |
| 10612 | Header: NewHeader(13), |
| 10613 | } |
| 10614 | return obj |
| 10615 | } |
| 10616 | |
| 10617 | type PortDescStatsReply struct { |
| 10618 | *StatsReply |
| 10619 | Entries []*PortDesc |
| 10620 | } |
| 10621 | |
| 10622 | type IPortDescStatsReply interface { |
| 10623 | IStatsReply |
| 10624 | GetEntries() []*PortDesc |
| 10625 | } |
| 10626 | |
| 10627 | func (self *PortDescStatsReply) GetEntries() []*PortDesc { |
| 10628 | return self.Entries |
| 10629 | } |
| 10630 | |
| 10631 | func (self *PortDescStatsReply) SetEntries(v []*PortDesc) { |
| 10632 | self.Entries = v |
| 10633 | } |
| 10634 | |
| 10635 | func (self *PortDescStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 10636 | startIndex := len(encoder.Bytes()) |
| 10637 | if err := self.StatsReply.Serialize(encoder); err != nil { |
| 10638 | return err |
| 10639 | } |
| 10640 | |
| 10641 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 10642 | for _, obj := range self.Entries { |
| 10643 | if err := obj.Serialize(encoder); err != nil { |
| 10644 | return err |
| 10645 | } |
| 10646 | } |
| 10647 | length := len(encoder.Bytes()) - startIndex |
| 10648 | |
| 10649 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 10650 | |
| 10651 | return nil |
| 10652 | } |
| 10653 | |
| 10654 | func DecodePortDescStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*PortDescStatsReply, error) { |
| 10655 | _portdescstatsreply := &PortDescStatsReply{StatsReply: parent} |
| 10656 | if decoder.Length() < 4 { |
| 10657 | return nil, fmt.Errorf("PortDescStatsReply packet too short: %d < 4", decoder.Length()) |
| 10658 | } |
| 10659 | decoder.Skip(4) |
| 10660 | |
| 10661 | for decoder.Length() >= 40 { |
| 10662 | item := &PortDesc{} |
| 10663 | if err := item.Decode(decoder); err != nil { |
| 10664 | return nil, err |
| 10665 | } |
| 10666 | if item != nil { |
| 10667 | _portdescstatsreply.Entries = append(_portdescstatsreply.Entries, item) |
| 10668 | } |
| 10669 | } |
| 10670 | return _portdescstatsreply, nil |
| 10671 | } |
| 10672 | |
| 10673 | func NewPortDescStatsReply() *PortDescStatsReply { |
| 10674 | obj := &PortDescStatsReply{ |
| 10675 | StatsReply: NewStatsReply(13), |
| 10676 | } |
| 10677 | return obj |
| 10678 | } |
| 10679 | |
| 10680 | type PortDescStatsRequest struct { |
| 10681 | *StatsRequest |
| 10682 | } |
| 10683 | |
| 10684 | type IPortDescStatsRequest interface { |
| 10685 | IStatsRequest |
| 10686 | } |
| 10687 | |
| 10688 | func (self *PortDescStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 10689 | startIndex := len(encoder.Bytes()) |
| 10690 | if err := self.StatsRequest.Serialize(encoder); err != nil { |
| 10691 | return err |
| 10692 | } |
| 10693 | |
| 10694 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 10695 | length := len(encoder.Bytes()) - startIndex |
| 10696 | |
| 10697 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 10698 | |
| 10699 | return nil |
| 10700 | } |
| 10701 | |
| 10702 | func DecodePortDescStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*PortDescStatsRequest, error) { |
| 10703 | _portdescstatsrequest := &PortDescStatsRequest{StatsRequest: parent} |
| 10704 | if decoder.Length() < 4 { |
| 10705 | return nil, fmt.Errorf("PortDescStatsRequest packet too short: %d < 4", decoder.Length()) |
| 10706 | } |
| 10707 | decoder.Skip(4) |
| 10708 | return _portdescstatsrequest, nil |
| 10709 | } |
| 10710 | |
| 10711 | func NewPortDescStatsRequest() *PortDescStatsRequest { |
| 10712 | obj := &PortDescStatsRequest{ |
| 10713 | StatsRequest: NewStatsRequest(13), |
| 10714 | } |
| 10715 | return obj |
| 10716 | } |
| 10717 | |
| 10718 | type PortMod struct { |
| 10719 | *Header |
| 10720 | PortNo Port |
| 10721 | HwAddr net.HardwareAddr |
| 10722 | Config PortConfig |
| 10723 | Mask PortConfig |
| 10724 | Properties []IPortModProp |
| 10725 | } |
| 10726 | |
| 10727 | type IPortMod interface { |
| 10728 | IHeader |
| 10729 | GetPortNo() Port |
| 10730 | GetHwAddr() net.HardwareAddr |
| 10731 | GetConfig() PortConfig |
| 10732 | GetMask() PortConfig |
| 10733 | GetProperties() []IPortModProp |
| 10734 | } |
| 10735 | |
| 10736 | func (self *PortMod) GetPortNo() Port { |
| 10737 | return self.PortNo |
| 10738 | } |
| 10739 | |
| 10740 | func (self *PortMod) SetPortNo(v Port) { |
| 10741 | self.PortNo = v |
| 10742 | } |
| 10743 | |
| 10744 | func (self *PortMod) GetHwAddr() net.HardwareAddr { |
| 10745 | return self.HwAddr |
| 10746 | } |
| 10747 | |
| 10748 | func (self *PortMod) SetHwAddr(v net.HardwareAddr) { |
| 10749 | self.HwAddr = v |
| 10750 | } |
| 10751 | |
| 10752 | func (self *PortMod) GetConfig() PortConfig { |
| 10753 | return self.Config |
| 10754 | } |
| 10755 | |
| 10756 | func (self *PortMod) SetConfig(v PortConfig) { |
| 10757 | self.Config = v |
| 10758 | } |
| 10759 | |
| 10760 | func (self *PortMod) GetMask() PortConfig { |
| 10761 | return self.Mask |
| 10762 | } |
| 10763 | |
| 10764 | func (self *PortMod) SetMask(v PortConfig) { |
| 10765 | self.Mask = v |
| 10766 | } |
| 10767 | |
| 10768 | func (self *PortMod) GetProperties() []IPortModProp { |
| 10769 | return self.Properties |
| 10770 | } |
| 10771 | |
| 10772 | func (self *PortMod) SetProperties(v []IPortModProp) { |
| 10773 | self.Properties = v |
| 10774 | } |
| 10775 | |
| 10776 | func (self *PortMod) Serialize(encoder *goloxi.Encoder) error { |
| 10777 | startIndex := len(encoder.Bytes()) |
| 10778 | if err := self.Header.Serialize(encoder); err != nil { |
| 10779 | return err |
| 10780 | } |
| 10781 | |
| 10782 | self.PortNo.Serialize(encoder) |
| 10783 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 10784 | encoder.Write(self.HwAddr) |
| 10785 | encoder.Write(bytes.Repeat([]byte{0}, 2)) |
| 10786 | encoder.PutUint32(uint32(self.Config)) |
| 10787 | encoder.PutUint32(uint32(self.Mask)) |
| 10788 | for _, obj := range self.Properties { |
| 10789 | if err := obj.Serialize(encoder); err != nil { |
| 10790 | return err |
| 10791 | } |
| 10792 | } |
| 10793 | length := len(encoder.Bytes()) - startIndex |
| 10794 | |
| 10795 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 10796 | |
| 10797 | return nil |
| 10798 | } |
| 10799 | |
| 10800 | func DecodePortMod(parent *Header, decoder *goloxi.Decoder) (*PortMod, error) { |
| 10801 | _portmod := &PortMod{Header: parent} |
| 10802 | if decoder.Length() < 24 { |
| 10803 | return nil, fmt.Errorf("PortMod packet too short: %d < 24", decoder.Length()) |
| 10804 | } |
| 10805 | _portmod.PortNo.Decode(decoder) |
| 10806 | decoder.Skip(4) |
| 10807 | _portmod.HwAddr = net.HardwareAddr(decoder.Read(6)) |
| 10808 | decoder.Skip(2) |
| 10809 | _portmod.Config = PortConfig(decoder.ReadUint32()) |
| 10810 | _portmod.Mask = PortConfig(decoder.ReadUint32()) |
| 10811 | |
| 10812 | for decoder.Length() >= 4 { |
| 10813 | item, err := DecodePortModProp(decoder) |
| 10814 | if err != nil { |
| 10815 | return nil, err |
| 10816 | } |
| 10817 | if item != nil { |
| 10818 | _portmod.Properties = append(_portmod.Properties, item) |
| 10819 | } |
| 10820 | } |
| 10821 | return _portmod, nil |
| 10822 | } |
| 10823 | |
| 10824 | func NewPortMod() *PortMod { |
| 10825 | obj := &PortMod{ |
| 10826 | Header: NewHeader(16), |
| 10827 | } |
| 10828 | return obj |
| 10829 | } |
| 10830 | |
| 10831 | type PortModFailedErrorMsg struct { |
| 10832 | *ErrorMsg |
| 10833 | Code PortModFailedCode |
| 10834 | Data []byte |
| 10835 | } |
| 10836 | |
| 10837 | type IPortModFailedErrorMsg interface { |
| 10838 | IErrorMsg |
| 10839 | GetCode() PortModFailedCode |
| 10840 | GetData() []byte |
| 10841 | } |
| 10842 | |
| 10843 | func (self *PortModFailedErrorMsg) GetCode() PortModFailedCode { |
| 10844 | return self.Code |
| 10845 | } |
| 10846 | |
| 10847 | func (self *PortModFailedErrorMsg) SetCode(v PortModFailedCode) { |
| 10848 | self.Code = v |
| 10849 | } |
| 10850 | |
| 10851 | func (self *PortModFailedErrorMsg) GetData() []byte { |
| 10852 | return self.Data |
| 10853 | } |
| 10854 | |
| 10855 | func (self *PortModFailedErrorMsg) SetData(v []byte) { |
| 10856 | self.Data = v |
| 10857 | } |
| 10858 | |
| 10859 | func (self *PortModFailedErrorMsg) Serialize(encoder *goloxi.Encoder) error { |
| 10860 | startIndex := len(encoder.Bytes()) |
| 10861 | if err := self.ErrorMsg.Serialize(encoder); err != nil { |
| 10862 | return err |
| 10863 | } |
| 10864 | |
| 10865 | encoder.PutUint16(uint16(self.Code)) |
| 10866 | encoder.Write(self.Data) |
| 10867 | length := len(encoder.Bytes()) - startIndex |
| 10868 | |
| 10869 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 10870 | |
| 10871 | return nil |
| 10872 | } |
| 10873 | |
| 10874 | func DecodePortModFailedErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*PortModFailedErrorMsg, error) { |
| 10875 | _portmodfailederrormsg := &PortModFailedErrorMsg{ErrorMsg: parent} |
| 10876 | if decoder.Length() < 2 { |
| 10877 | return nil, fmt.Errorf("PortModFailedErrorMsg packet too short: %d < 2", decoder.Length()) |
| 10878 | } |
| 10879 | _portmodfailederrormsg.Code = PortModFailedCode(decoder.ReadUint16()) |
| 10880 | _portmodfailederrormsg.Data = decoder.Read(int(decoder.Length())) |
| 10881 | return _portmodfailederrormsg, nil |
| 10882 | } |
| 10883 | |
| 10884 | func NewPortModFailedErrorMsg() *PortModFailedErrorMsg { |
| 10885 | obj := &PortModFailedErrorMsg{ |
| 10886 | ErrorMsg: NewErrorMsg(7), |
| 10887 | } |
| 10888 | return obj |
| 10889 | } |
| 10890 | |
| 10891 | type PortStatsReply struct { |
| 10892 | *StatsReply |
| 10893 | Entries []*PortStatsEntry |
| 10894 | } |
| 10895 | |
| 10896 | type IPortStatsReply interface { |
| 10897 | IStatsReply |
| 10898 | GetEntries() []*PortStatsEntry |
| 10899 | } |
| 10900 | |
| 10901 | func (self *PortStatsReply) GetEntries() []*PortStatsEntry { |
| 10902 | return self.Entries |
| 10903 | } |
| 10904 | |
| 10905 | func (self *PortStatsReply) SetEntries(v []*PortStatsEntry) { |
| 10906 | self.Entries = v |
| 10907 | } |
| 10908 | |
| 10909 | func (self *PortStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 10910 | startIndex := len(encoder.Bytes()) |
| 10911 | if err := self.StatsReply.Serialize(encoder); err != nil { |
| 10912 | return err |
| 10913 | } |
| 10914 | |
| 10915 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 10916 | for _, obj := range self.Entries { |
| 10917 | if err := obj.Serialize(encoder); err != nil { |
| 10918 | return err |
| 10919 | } |
| 10920 | } |
| 10921 | length := len(encoder.Bytes()) - startIndex |
| 10922 | |
| 10923 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 10924 | |
| 10925 | return nil |
| 10926 | } |
| 10927 | |
| 10928 | func DecodePortStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*PortStatsReply, error) { |
| 10929 | _portstatsreply := &PortStatsReply{StatsReply: parent} |
| 10930 | if decoder.Length() < 4 { |
| 10931 | return nil, fmt.Errorf("PortStatsReply packet too short: %d < 4", decoder.Length()) |
| 10932 | } |
| 10933 | decoder.Skip(4) |
| 10934 | |
| 10935 | for decoder.Length() >= 80 { |
| 10936 | item, err := DecodePortStatsEntry(decoder) |
| 10937 | if err != nil { |
| 10938 | return nil, err |
| 10939 | } |
| 10940 | if item != nil { |
| 10941 | _portstatsreply.Entries = append(_portstatsreply.Entries, item) |
| 10942 | } |
| 10943 | } |
| 10944 | return _portstatsreply, nil |
| 10945 | } |
| 10946 | |
| 10947 | func NewPortStatsReply() *PortStatsReply { |
| 10948 | obj := &PortStatsReply{ |
| 10949 | StatsReply: NewStatsReply(4), |
| 10950 | } |
| 10951 | return obj |
| 10952 | } |
| 10953 | |
| 10954 | type PortStatsRequest struct { |
| 10955 | *StatsRequest |
| 10956 | PortNo Port |
| 10957 | } |
| 10958 | |
| 10959 | type IPortStatsRequest interface { |
| 10960 | IStatsRequest |
| 10961 | GetPortNo() Port |
| 10962 | } |
| 10963 | |
| 10964 | func (self *PortStatsRequest) GetPortNo() Port { |
| 10965 | return self.PortNo |
| 10966 | } |
| 10967 | |
| 10968 | func (self *PortStatsRequest) SetPortNo(v Port) { |
| 10969 | self.PortNo = v |
| 10970 | } |
| 10971 | |
| 10972 | func (self *PortStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 10973 | startIndex := len(encoder.Bytes()) |
| 10974 | if err := self.StatsRequest.Serialize(encoder); err != nil { |
| 10975 | return err |
| 10976 | } |
| 10977 | |
| 10978 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 10979 | self.PortNo.Serialize(encoder) |
| 10980 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 10981 | length := len(encoder.Bytes()) - startIndex |
| 10982 | |
| 10983 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 10984 | |
| 10985 | return nil |
| 10986 | } |
| 10987 | |
| 10988 | func DecodePortStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*PortStatsRequest, error) { |
| 10989 | _portstatsrequest := &PortStatsRequest{StatsRequest: parent} |
| 10990 | if decoder.Length() < 4 { |
| 10991 | return nil, fmt.Errorf("PortStatsRequest packet too short: %d < 4", decoder.Length()) |
| 10992 | } |
| 10993 | decoder.Skip(4) |
| 10994 | _portstatsrequest.PortNo.Decode(decoder) |
| 10995 | decoder.Skip(4) |
| 10996 | return _portstatsrequest, nil |
| 10997 | } |
| 10998 | |
| 10999 | func NewPortStatsRequest() *PortStatsRequest { |
| 11000 | obj := &PortStatsRequest{ |
| 11001 | StatsRequest: NewStatsRequest(4), |
| 11002 | } |
| 11003 | return obj |
| 11004 | } |
| 11005 | |
| 11006 | type PortStatus struct { |
| 11007 | *Header |
| 11008 | Reason PortReason |
| 11009 | Desc PortDesc |
| 11010 | } |
| 11011 | |
| 11012 | type IPortStatus interface { |
| 11013 | IHeader |
| 11014 | GetReason() PortReason |
| 11015 | GetDesc() PortDesc |
| 11016 | } |
| 11017 | |
| 11018 | func (self *PortStatus) GetReason() PortReason { |
| 11019 | return self.Reason |
| 11020 | } |
| 11021 | |
| 11022 | func (self *PortStatus) SetReason(v PortReason) { |
| 11023 | self.Reason = v |
| 11024 | } |
| 11025 | |
| 11026 | func (self *PortStatus) GetDesc() PortDesc { |
| 11027 | return self.Desc |
| 11028 | } |
| 11029 | |
| 11030 | func (self *PortStatus) SetDesc(v PortDesc) { |
| 11031 | self.Desc = v |
| 11032 | } |
| 11033 | |
| 11034 | func (self *PortStatus) Serialize(encoder *goloxi.Encoder) error { |
| 11035 | startIndex := len(encoder.Bytes()) |
| 11036 | if err := self.Header.Serialize(encoder); err != nil { |
| 11037 | return err |
| 11038 | } |
| 11039 | |
| 11040 | encoder.PutUint8(uint8(self.Reason)) |
| 11041 | encoder.Write(bytes.Repeat([]byte{0}, 7)) |
| 11042 | if err := self.Desc.Serialize(encoder); err != nil { |
| 11043 | return err |
| 11044 | } |
| 11045 | |
| 11046 | length := len(encoder.Bytes()) - startIndex |
| 11047 | |
| 11048 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 11049 | |
| 11050 | return nil |
| 11051 | } |
| 11052 | |
| 11053 | func DecodePortStatus(parent *Header, decoder *goloxi.Decoder) (*PortStatus, error) { |
| 11054 | _portstatus := &PortStatus{Header: parent} |
| 11055 | if decoder.Length() < 48 { |
| 11056 | return nil, fmt.Errorf("PortStatus packet too short: %d < 48", decoder.Length()) |
| 11057 | } |
| 11058 | _portstatus.Reason = PortReason(decoder.ReadByte()) |
| 11059 | decoder.Skip(7) |
| 11060 | if err := _portstatus.Desc.Decode(decoder); err != nil { |
| 11061 | return nil, err |
| 11062 | } |
| 11063 | |
| 11064 | return _portstatus, nil |
| 11065 | } |
| 11066 | |
| 11067 | func NewPortStatus() *PortStatus { |
| 11068 | obj := &PortStatus{ |
| 11069 | Header: NewHeader(12), |
| 11070 | } |
| 11071 | return obj |
| 11072 | } |
| 11073 | |
| 11074 | type QueueDescStatsReply struct { |
| 11075 | *StatsReply |
| 11076 | Entries []*QueueDesc |
| 11077 | } |
| 11078 | |
| 11079 | type IQueueDescStatsReply interface { |
| 11080 | IStatsReply |
| 11081 | GetEntries() []*QueueDesc |
| 11082 | } |
| 11083 | |
| 11084 | func (self *QueueDescStatsReply) GetEntries() []*QueueDesc { |
| 11085 | return self.Entries |
| 11086 | } |
| 11087 | |
| 11088 | func (self *QueueDescStatsReply) SetEntries(v []*QueueDesc) { |
| 11089 | self.Entries = v |
| 11090 | } |
| 11091 | |
| 11092 | func (self *QueueDescStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 11093 | startIndex := len(encoder.Bytes()) |
| 11094 | if err := self.StatsReply.Serialize(encoder); err != nil { |
| 11095 | return err |
| 11096 | } |
| 11097 | |
| 11098 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 11099 | for _, obj := range self.Entries { |
| 11100 | if err := obj.Serialize(encoder); err != nil { |
| 11101 | return err |
| 11102 | } |
| 11103 | } |
| 11104 | length := len(encoder.Bytes()) - startIndex |
| 11105 | |
| 11106 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 11107 | |
| 11108 | return nil |
| 11109 | } |
| 11110 | |
| 11111 | func DecodeQueueDescStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*QueueDescStatsReply, error) { |
| 11112 | _queuedescstatsreply := &QueueDescStatsReply{StatsReply: parent} |
| 11113 | if decoder.Length() < 4 { |
| 11114 | return nil, fmt.Errorf("QueueDescStatsReply packet too short: %d < 4", decoder.Length()) |
| 11115 | } |
| 11116 | decoder.Skip(4) |
| 11117 | |
| 11118 | for decoder.Length() >= 16 { |
| 11119 | item, err := DecodeQueueDesc(decoder) |
| 11120 | if err != nil { |
| 11121 | return nil, err |
| 11122 | } |
| 11123 | if item != nil { |
| 11124 | _queuedescstatsreply.Entries = append(_queuedescstatsreply.Entries, item) |
| 11125 | } |
| 11126 | } |
| 11127 | return _queuedescstatsreply, nil |
| 11128 | } |
| 11129 | |
| 11130 | func NewQueueDescStatsReply() *QueueDescStatsReply { |
| 11131 | obj := &QueueDescStatsReply{ |
| 11132 | StatsReply: NewStatsReply(15), |
| 11133 | } |
| 11134 | return obj |
| 11135 | } |
| 11136 | |
| 11137 | type QueueDescStatsRequest struct { |
| 11138 | *StatsRequest |
| 11139 | PortNo Port |
| 11140 | QueueId uint32 |
| 11141 | } |
| 11142 | |
| 11143 | type IQueueDescStatsRequest interface { |
| 11144 | IStatsRequest |
| 11145 | GetPortNo() Port |
| 11146 | GetQueueId() uint32 |
| 11147 | } |
| 11148 | |
| 11149 | func (self *QueueDescStatsRequest) GetPortNo() Port { |
| 11150 | return self.PortNo |
| 11151 | } |
| 11152 | |
| 11153 | func (self *QueueDescStatsRequest) SetPortNo(v Port) { |
| 11154 | self.PortNo = v |
| 11155 | } |
| 11156 | |
| 11157 | func (self *QueueDescStatsRequest) GetQueueId() uint32 { |
| 11158 | return self.QueueId |
| 11159 | } |
| 11160 | |
| 11161 | func (self *QueueDescStatsRequest) SetQueueId(v uint32) { |
| 11162 | self.QueueId = v |
| 11163 | } |
| 11164 | |
| 11165 | func (self *QueueDescStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 11166 | startIndex := len(encoder.Bytes()) |
| 11167 | if err := self.StatsRequest.Serialize(encoder); err != nil { |
| 11168 | return err |
| 11169 | } |
| 11170 | |
| 11171 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 11172 | self.PortNo.Serialize(encoder) |
| 11173 | encoder.PutUint32(uint32(self.QueueId)) |
| 11174 | length := len(encoder.Bytes()) - startIndex |
| 11175 | |
| 11176 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 11177 | |
| 11178 | return nil |
| 11179 | } |
| 11180 | |
| 11181 | func DecodeQueueDescStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*QueueDescStatsRequest, error) { |
| 11182 | _queuedescstatsrequest := &QueueDescStatsRequest{StatsRequest: parent} |
| 11183 | if decoder.Length() < 12 { |
| 11184 | return nil, fmt.Errorf("QueueDescStatsRequest packet too short: %d < 12", decoder.Length()) |
| 11185 | } |
| 11186 | decoder.Skip(4) |
| 11187 | _queuedescstatsrequest.PortNo.Decode(decoder) |
| 11188 | _queuedescstatsrequest.QueueId = uint32(decoder.ReadUint32()) |
| 11189 | return _queuedescstatsrequest, nil |
| 11190 | } |
| 11191 | |
| 11192 | func NewQueueDescStatsRequest() *QueueDescStatsRequest { |
| 11193 | obj := &QueueDescStatsRequest{ |
| 11194 | StatsRequest: NewStatsRequest(15), |
| 11195 | } |
| 11196 | return obj |
| 11197 | } |
| 11198 | |
| 11199 | type QueueOpFailedErrorMsg struct { |
| 11200 | *ErrorMsg |
| 11201 | Code QueueOpFailedCode |
| 11202 | Data []byte |
| 11203 | } |
| 11204 | |
| 11205 | type IQueueOpFailedErrorMsg interface { |
| 11206 | IErrorMsg |
| 11207 | GetCode() QueueOpFailedCode |
| 11208 | GetData() []byte |
| 11209 | } |
| 11210 | |
| 11211 | func (self *QueueOpFailedErrorMsg) GetCode() QueueOpFailedCode { |
| 11212 | return self.Code |
| 11213 | } |
| 11214 | |
| 11215 | func (self *QueueOpFailedErrorMsg) SetCode(v QueueOpFailedCode) { |
| 11216 | self.Code = v |
| 11217 | } |
| 11218 | |
| 11219 | func (self *QueueOpFailedErrorMsg) GetData() []byte { |
| 11220 | return self.Data |
| 11221 | } |
| 11222 | |
| 11223 | func (self *QueueOpFailedErrorMsg) SetData(v []byte) { |
| 11224 | self.Data = v |
| 11225 | } |
| 11226 | |
| 11227 | func (self *QueueOpFailedErrorMsg) Serialize(encoder *goloxi.Encoder) error { |
| 11228 | startIndex := len(encoder.Bytes()) |
| 11229 | if err := self.ErrorMsg.Serialize(encoder); err != nil { |
| 11230 | return err |
| 11231 | } |
| 11232 | |
| 11233 | encoder.PutUint16(uint16(self.Code)) |
| 11234 | encoder.Write(self.Data) |
| 11235 | length := len(encoder.Bytes()) - startIndex |
| 11236 | |
| 11237 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 11238 | |
| 11239 | return nil |
| 11240 | } |
| 11241 | |
| 11242 | func DecodeQueueOpFailedErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*QueueOpFailedErrorMsg, error) { |
| 11243 | _queueopfailederrormsg := &QueueOpFailedErrorMsg{ErrorMsg: parent} |
| 11244 | if decoder.Length() < 2 { |
| 11245 | return nil, fmt.Errorf("QueueOpFailedErrorMsg packet too short: %d < 2", decoder.Length()) |
| 11246 | } |
| 11247 | _queueopfailederrormsg.Code = QueueOpFailedCode(decoder.ReadUint16()) |
| 11248 | _queueopfailederrormsg.Data = decoder.Read(int(decoder.Length())) |
| 11249 | return _queueopfailederrormsg, nil |
| 11250 | } |
| 11251 | |
| 11252 | func NewQueueOpFailedErrorMsg() *QueueOpFailedErrorMsg { |
| 11253 | obj := &QueueOpFailedErrorMsg{ |
| 11254 | ErrorMsg: NewErrorMsg(9), |
| 11255 | } |
| 11256 | return obj |
| 11257 | } |
| 11258 | |
| 11259 | type QueueStatsReply struct { |
| 11260 | *StatsReply |
| 11261 | Entries []*QueueStatsEntry |
| 11262 | } |
| 11263 | |
| 11264 | type IQueueStatsReply interface { |
| 11265 | IStatsReply |
| 11266 | GetEntries() []*QueueStatsEntry |
| 11267 | } |
| 11268 | |
| 11269 | func (self *QueueStatsReply) GetEntries() []*QueueStatsEntry { |
| 11270 | return self.Entries |
| 11271 | } |
| 11272 | |
| 11273 | func (self *QueueStatsReply) SetEntries(v []*QueueStatsEntry) { |
| 11274 | self.Entries = v |
| 11275 | } |
| 11276 | |
| 11277 | func (self *QueueStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 11278 | startIndex := len(encoder.Bytes()) |
| 11279 | if err := self.StatsReply.Serialize(encoder); err != nil { |
| 11280 | return err |
| 11281 | } |
| 11282 | |
| 11283 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 11284 | for _, obj := range self.Entries { |
| 11285 | if err := obj.Serialize(encoder); err != nil { |
| 11286 | return err |
| 11287 | } |
| 11288 | } |
| 11289 | length := len(encoder.Bytes()) - startIndex |
| 11290 | |
| 11291 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 11292 | |
| 11293 | return nil |
| 11294 | } |
| 11295 | |
| 11296 | func DecodeQueueStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*QueueStatsReply, error) { |
| 11297 | _queuestatsreply := &QueueStatsReply{StatsReply: parent} |
| 11298 | if decoder.Length() < 4 { |
| 11299 | return nil, fmt.Errorf("QueueStatsReply packet too short: %d < 4", decoder.Length()) |
| 11300 | } |
| 11301 | decoder.Skip(4) |
| 11302 | |
| 11303 | for decoder.Length() >= 48 { |
| 11304 | item, err := DecodeQueueStatsEntry(decoder) |
| 11305 | if err != nil { |
| 11306 | return nil, err |
| 11307 | } |
| 11308 | if item != nil { |
| 11309 | _queuestatsreply.Entries = append(_queuestatsreply.Entries, item) |
| 11310 | } |
| 11311 | } |
| 11312 | return _queuestatsreply, nil |
| 11313 | } |
| 11314 | |
| 11315 | func NewQueueStatsReply() *QueueStatsReply { |
| 11316 | obj := &QueueStatsReply{ |
| 11317 | StatsReply: NewStatsReply(5), |
| 11318 | } |
| 11319 | return obj |
| 11320 | } |
| 11321 | |
| 11322 | type QueueStatsRequest struct { |
| 11323 | *StatsRequest |
| 11324 | PortNo Port |
| 11325 | QueueId uint32 |
| 11326 | } |
| 11327 | |
| 11328 | type IQueueStatsRequest interface { |
| 11329 | IStatsRequest |
| 11330 | GetPortNo() Port |
| 11331 | GetQueueId() uint32 |
| 11332 | } |
| 11333 | |
| 11334 | func (self *QueueStatsRequest) GetPortNo() Port { |
| 11335 | return self.PortNo |
| 11336 | } |
| 11337 | |
| 11338 | func (self *QueueStatsRequest) SetPortNo(v Port) { |
| 11339 | self.PortNo = v |
| 11340 | } |
| 11341 | |
| 11342 | func (self *QueueStatsRequest) GetQueueId() uint32 { |
| 11343 | return self.QueueId |
| 11344 | } |
| 11345 | |
| 11346 | func (self *QueueStatsRequest) SetQueueId(v uint32) { |
| 11347 | self.QueueId = v |
| 11348 | } |
| 11349 | |
| 11350 | func (self *QueueStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 11351 | startIndex := len(encoder.Bytes()) |
| 11352 | if err := self.StatsRequest.Serialize(encoder); err != nil { |
| 11353 | return err |
| 11354 | } |
| 11355 | |
| 11356 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 11357 | self.PortNo.Serialize(encoder) |
| 11358 | encoder.PutUint32(uint32(self.QueueId)) |
| 11359 | length := len(encoder.Bytes()) - startIndex |
| 11360 | |
| 11361 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 11362 | |
| 11363 | return nil |
| 11364 | } |
| 11365 | |
| 11366 | func DecodeQueueStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*QueueStatsRequest, error) { |
| 11367 | _queuestatsrequest := &QueueStatsRequest{StatsRequest: parent} |
| 11368 | if decoder.Length() < 12 { |
| 11369 | return nil, fmt.Errorf("QueueStatsRequest packet too short: %d < 12", decoder.Length()) |
| 11370 | } |
| 11371 | decoder.Skip(4) |
| 11372 | _queuestatsrequest.PortNo.Decode(decoder) |
| 11373 | _queuestatsrequest.QueueId = uint32(decoder.ReadUint32()) |
| 11374 | return _queuestatsrequest, nil |
| 11375 | } |
| 11376 | |
| 11377 | func NewQueueStatsRequest() *QueueStatsRequest { |
| 11378 | obj := &QueueStatsRequest{ |
| 11379 | StatsRequest: NewStatsRequest(5), |
| 11380 | } |
| 11381 | return obj |
| 11382 | } |
| 11383 | |
| 11384 | type Requestforward struct { |
| 11385 | *Header |
| 11386 | Request IHeader |
| 11387 | } |
| 11388 | |
| 11389 | type IRequestforward interface { |
| 11390 | IHeader |
| 11391 | GetRequest() IHeader |
| 11392 | } |
| 11393 | |
| 11394 | func (self *Requestforward) GetRequest() IHeader { |
| 11395 | return self.Request |
| 11396 | } |
| 11397 | |
| 11398 | func (self *Requestforward) SetRequest(v IHeader) { |
| 11399 | self.Request = v |
| 11400 | } |
| 11401 | |
| 11402 | func (self *Requestforward) Serialize(encoder *goloxi.Encoder) error { |
| 11403 | startIndex := len(encoder.Bytes()) |
| 11404 | if err := self.Header.Serialize(encoder); err != nil { |
| 11405 | return err |
| 11406 | } |
| 11407 | |
| 11408 | self.Request.Serialize(encoder) |
| 11409 | length := len(encoder.Bytes()) - startIndex |
| 11410 | |
| 11411 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 11412 | |
| 11413 | return nil |
| 11414 | } |
| 11415 | |
| 11416 | func DecodeRequestforward(parent *Header, decoder *goloxi.Decoder) (*Requestforward, error) { |
| 11417 | _requestforward := &Requestforward{Header: parent} |
| 11418 | if decoder.Length() < 8 { |
| 11419 | return nil, fmt.Errorf("Requestforward packet too short: %d < 8", decoder.Length()) |
| 11420 | } |
| 11421 | if obj, err := DecodeHeader(decoder); err != nil { |
| 11422 | return nil, err |
| 11423 | } else { |
| 11424 | _requestforward.Request = obj |
| 11425 | } |
| 11426 | |
| 11427 | return _requestforward, nil |
| 11428 | } |
| 11429 | |
| 11430 | func NewRequestforward() *Requestforward { |
| 11431 | obj := &Requestforward{ |
| 11432 | Header: NewHeader(32), |
| 11433 | } |
| 11434 | return obj |
| 11435 | } |
| 11436 | |
| 11437 | type RoleReply struct { |
| 11438 | *Header |
| 11439 | Role ControllerRole |
| 11440 | GenerationId uint64 |
| 11441 | } |
| 11442 | |
| 11443 | type IRoleReply interface { |
| 11444 | IHeader |
| 11445 | GetRole() ControllerRole |
| 11446 | GetGenerationId() uint64 |
| 11447 | } |
| 11448 | |
| 11449 | func (self *RoleReply) GetRole() ControllerRole { |
| 11450 | return self.Role |
| 11451 | } |
| 11452 | |
| 11453 | func (self *RoleReply) SetRole(v ControllerRole) { |
| 11454 | self.Role = v |
| 11455 | } |
| 11456 | |
| 11457 | func (self *RoleReply) GetGenerationId() uint64 { |
| 11458 | return self.GenerationId |
| 11459 | } |
| 11460 | |
| 11461 | func (self *RoleReply) SetGenerationId(v uint64) { |
| 11462 | self.GenerationId = v |
| 11463 | } |
| 11464 | |
| 11465 | func (self *RoleReply) Serialize(encoder *goloxi.Encoder) error { |
| 11466 | startIndex := len(encoder.Bytes()) |
| 11467 | if err := self.Header.Serialize(encoder); err != nil { |
| 11468 | return err |
| 11469 | } |
| 11470 | |
| 11471 | encoder.PutUint32(uint32(self.Role)) |
| 11472 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 11473 | encoder.PutUint64(uint64(self.GenerationId)) |
| 11474 | length := len(encoder.Bytes()) - startIndex |
| 11475 | |
| 11476 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 11477 | |
| 11478 | return nil |
| 11479 | } |
| 11480 | |
| 11481 | func DecodeRoleReply(parent *Header, decoder *goloxi.Decoder) (*RoleReply, error) { |
| 11482 | _rolereply := &RoleReply{Header: parent} |
| 11483 | if decoder.Length() < 16 { |
| 11484 | return nil, fmt.Errorf("RoleReply packet too short: %d < 16", decoder.Length()) |
| 11485 | } |
| 11486 | _rolereply.Role = ControllerRole(decoder.ReadUint32()) |
| 11487 | decoder.Skip(4) |
| 11488 | _rolereply.GenerationId = uint64(decoder.ReadUint64()) |
| 11489 | return _rolereply, nil |
| 11490 | } |
| 11491 | |
| 11492 | func NewRoleReply() *RoleReply { |
| 11493 | obj := &RoleReply{ |
| 11494 | Header: NewHeader(25), |
| 11495 | } |
| 11496 | return obj |
| 11497 | } |
| 11498 | |
| 11499 | type RoleRequest struct { |
| 11500 | *Header |
| 11501 | Role ControllerRole |
| 11502 | GenerationId uint64 |
| 11503 | } |
| 11504 | |
| 11505 | type IRoleRequest interface { |
| 11506 | IHeader |
| 11507 | GetRole() ControllerRole |
| 11508 | GetGenerationId() uint64 |
| 11509 | } |
| 11510 | |
| 11511 | func (self *RoleRequest) GetRole() ControllerRole { |
| 11512 | return self.Role |
| 11513 | } |
| 11514 | |
| 11515 | func (self *RoleRequest) SetRole(v ControllerRole) { |
| 11516 | self.Role = v |
| 11517 | } |
| 11518 | |
| 11519 | func (self *RoleRequest) GetGenerationId() uint64 { |
| 11520 | return self.GenerationId |
| 11521 | } |
| 11522 | |
| 11523 | func (self *RoleRequest) SetGenerationId(v uint64) { |
| 11524 | self.GenerationId = v |
| 11525 | } |
| 11526 | |
| 11527 | func (self *RoleRequest) Serialize(encoder *goloxi.Encoder) error { |
| 11528 | startIndex := len(encoder.Bytes()) |
| 11529 | if err := self.Header.Serialize(encoder); err != nil { |
| 11530 | return err |
| 11531 | } |
| 11532 | |
| 11533 | encoder.PutUint32(uint32(self.Role)) |
| 11534 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 11535 | encoder.PutUint64(uint64(self.GenerationId)) |
| 11536 | length := len(encoder.Bytes()) - startIndex |
| 11537 | |
| 11538 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 11539 | |
| 11540 | return nil |
| 11541 | } |
| 11542 | |
| 11543 | func DecodeRoleRequest(parent *Header, decoder *goloxi.Decoder) (*RoleRequest, error) { |
| 11544 | _rolerequest := &RoleRequest{Header: parent} |
| 11545 | if decoder.Length() < 16 { |
| 11546 | return nil, fmt.Errorf("RoleRequest packet too short: %d < 16", decoder.Length()) |
| 11547 | } |
| 11548 | _rolerequest.Role = ControllerRole(decoder.ReadUint32()) |
| 11549 | decoder.Skip(4) |
| 11550 | _rolerequest.GenerationId = uint64(decoder.ReadUint64()) |
| 11551 | return _rolerequest, nil |
| 11552 | } |
| 11553 | |
| 11554 | func NewRoleRequest() *RoleRequest { |
| 11555 | obj := &RoleRequest{ |
| 11556 | Header: NewHeader(24), |
| 11557 | } |
| 11558 | return obj |
| 11559 | } |
| 11560 | |
| 11561 | type RoleRequestFailedErrorMsg struct { |
| 11562 | *ErrorMsg |
| 11563 | Code RoleRequestFailedCode |
| 11564 | Data []byte |
| 11565 | } |
| 11566 | |
| 11567 | type IRoleRequestFailedErrorMsg interface { |
| 11568 | IErrorMsg |
| 11569 | GetCode() RoleRequestFailedCode |
| 11570 | GetData() []byte |
| 11571 | } |
| 11572 | |
| 11573 | func (self *RoleRequestFailedErrorMsg) GetCode() RoleRequestFailedCode { |
| 11574 | return self.Code |
| 11575 | } |
| 11576 | |
| 11577 | func (self *RoleRequestFailedErrorMsg) SetCode(v RoleRequestFailedCode) { |
| 11578 | self.Code = v |
| 11579 | } |
| 11580 | |
| 11581 | func (self *RoleRequestFailedErrorMsg) GetData() []byte { |
| 11582 | return self.Data |
| 11583 | } |
| 11584 | |
| 11585 | func (self *RoleRequestFailedErrorMsg) SetData(v []byte) { |
| 11586 | self.Data = v |
| 11587 | } |
| 11588 | |
| 11589 | func (self *RoleRequestFailedErrorMsg) Serialize(encoder *goloxi.Encoder) error { |
| 11590 | startIndex := len(encoder.Bytes()) |
| 11591 | if err := self.ErrorMsg.Serialize(encoder); err != nil { |
| 11592 | return err |
| 11593 | } |
| 11594 | |
| 11595 | encoder.PutUint16(uint16(self.Code)) |
| 11596 | encoder.Write(self.Data) |
| 11597 | length := len(encoder.Bytes()) - startIndex |
| 11598 | |
| 11599 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 11600 | |
| 11601 | return nil |
| 11602 | } |
| 11603 | |
| 11604 | func DecodeRoleRequestFailedErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*RoleRequestFailedErrorMsg, error) { |
| 11605 | _rolerequestfailederrormsg := &RoleRequestFailedErrorMsg{ErrorMsg: parent} |
| 11606 | if decoder.Length() < 2 { |
| 11607 | return nil, fmt.Errorf("RoleRequestFailedErrorMsg packet too short: %d < 2", decoder.Length()) |
| 11608 | } |
| 11609 | _rolerequestfailederrormsg.Code = RoleRequestFailedCode(decoder.ReadUint16()) |
| 11610 | _rolerequestfailederrormsg.Data = decoder.Read(int(decoder.Length())) |
| 11611 | return _rolerequestfailederrormsg, nil |
| 11612 | } |
| 11613 | |
| 11614 | func NewRoleRequestFailedErrorMsg() *RoleRequestFailedErrorMsg { |
| 11615 | obj := &RoleRequestFailedErrorMsg{ |
| 11616 | ErrorMsg: NewErrorMsg(11), |
| 11617 | } |
| 11618 | return obj |
| 11619 | } |
| 11620 | |
| 11621 | type RoleStatus struct { |
| 11622 | *Header |
| 11623 | Role ControllerRole |
| 11624 | Reason ControllerRoleReason |
| 11625 | GenerationId uint64 |
| 11626 | Properties []IRoleProp |
| 11627 | } |
| 11628 | |
| 11629 | type IRoleStatus interface { |
| 11630 | IHeader |
| 11631 | GetRole() ControllerRole |
| 11632 | GetReason() ControllerRoleReason |
| 11633 | GetGenerationId() uint64 |
| 11634 | GetProperties() []IRoleProp |
| 11635 | } |
| 11636 | |
| 11637 | func (self *RoleStatus) GetRole() ControllerRole { |
| 11638 | return self.Role |
| 11639 | } |
| 11640 | |
| 11641 | func (self *RoleStatus) SetRole(v ControllerRole) { |
| 11642 | self.Role = v |
| 11643 | } |
| 11644 | |
| 11645 | func (self *RoleStatus) GetReason() ControllerRoleReason { |
| 11646 | return self.Reason |
| 11647 | } |
| 11648 | |
| 11649 | func (self *RoleStatus) SetReason(v ControllerRoleReason) { |
| 11650 | self.Reason = v |
| 11651 | } |
| 11652 | |
| 11653 | func (self *RoleStatus) GetGenerationId() uint64 { |
| 11654 | return self.GenerationId |
| 11655 | } |
| 11656 | |
| 11657 | func (self *RoleStatus) SetGenerationId(v uint64) { |
| 11658 | self.GenerationId = v |
| 11659 | } |
| 11660 | |
| 11661 | func (self *RoleStatus) GetProperties() []IRoleProp { |
| 11662 | return self.Properties |
| 11663 | } |
| 11664 | |
| 11665 | func (self *RoleStatus) SetProperties(v []IRoleProp) { |
| 11666 | self.Properties = v |
| 11667 | } |
| 11668 | |
| 11669 | func (self *RoleStatus) Serialize(encoder *goloxi.Encoder) error { |
| 11670 | startIndex := len(encoder.Bytes()) |
| 11671 | if err := self.Header.Serialize(encoder); err != nil { |
| 11672 | return err |
| 11673 | } |
| 11674 | |
| 11675 | encoder.PutUint32(uint32(self.Role)) |
| 11676 | encoder.PutUint8(uint8(self.Reason)) |
| 11677 | encoder.Write(bytes.Repeat([]byte{0}, 3)) |
| 11678 | encoder.PutUint64(uint64(self.GenerationId)) |
| 11679 | for _, obj := range self.Properties { |
| 11680 | if err := obj.Serialize(encoder); err != nil { |
| 11681 | return err |
| 11682 | } |
| 11683 | } |
| 11684 | length := len(encoder.Bytes()) - startIndex |
| 11685 | |
| 11686 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 11687 | |
| 11688 | return nil |
| 11689 | } |
| 11690 | |
| 11691 | func DecodeRoleStatus(parent *Header, decoder *goloxi.Decoder) (*RoleStatus, error) { |
| 11692 | _rolestatus := &RoleStatus{Header: parent} |
| 11693 | if decoder.Length() < 16 { |
| 11694 | return nil, fmt.Errorf("RoleStatus packet too short: %d < 16", decoder.Length()) |
| 11695 | } |
| 11696 | _rolestatus.Role = ControllerRole(decoder.ReadUint32()) |
| 11697 | _rolestatus.Reason = ControllerRoleReason(decoder.ReadByte()) |
| 11698 | decoder.Skip(3) |
| 11699 | _rolestatus.GenerationId = uint64(decoder.ReadUint64()) |
| 11700 | |
| 11701 | for decoder.Length() >= 4 { |
| 11702 | item, err := DecodeRoleProp(decoder) |
| 11703 | if err != nil { |
| 11704 | return nil, err |
| 11705 | } |
| 11706 | if item != nil { |
| 11707 | _rolestatus.Properties = append(_rolestatus.Properties, item) |
| 11708 | } |
| 11709 | } |
| 11710 | return _rolestatus, nil |
| 11711 | } |
| 11712 | |
| 11713 | func NewRoleStatus() *RoleStatus { |
| 11714 | obj := &RoleStatus{ |
| 11715 | Header: NewHeader(30), |
| 11716 | } |
| 11717 | return obj |
| 11718 | } |
| 11719 | |
| 11720 | type SetConfig struct { |
| 11721 | *Header |
| 11722 | Flags ConfigFlags |
| 11723 | MissSendLen uint16 |
| 11724 | } |
| 11725 | |
| 11726 | type ISetConfig interface { |
| 11727 | IHeader |
| 11728 | GetFlags() ConfigFlags |
| 11729 | GetMissSendLen() uint16 |
| 11730 | } |
| 11731 | |
| 11732 | func (self *SetConfig) GetFlags() ConfigFlags { |
| 11733 | return self.Flags |
| 11734 | } |
| 11735 | |
| 11736 | func (self *SetConfig) SetFlags(v ConfigFlags) { |
| 11737 | self.Flags = v |
| 11738 | } |
| 11739 | |
| 11740 | func (self *SetConfig) GetMissSendLen() uint16 { |
| 11741 | return self.MissSendLen |
| 11742 | } |
| 11743 | |
| 11744 | func (self *SetConfig) SetMissSendLen(v uint16) { |
| 11745 | self.MissSendLen = v |
| 11746 | } |
| 11747 | |
| 11748 | func (self *SetConfig) Serialize(encoder *goloxi.Encoder) error { |
| 11749 | startIndex := len(encoder.Bytes()) |
| 11750 | if err := self.Header.Serialize(encoder); err != nil { |
| 11751 | return err |
| 11752 | } |
| 11753 | |
| 11754 | encoder.PutUint16(uint16(self.Flags)) |
| 11755 | encoder.PutUint16(uint16(self.MissSendLen)) |
| 11756 | length := len(encoder.Bytes()) - startIndex |
| 11757 | |
| 11758 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 11759 | |
| 11760 | return nil |
| 11761 | } |
| 11762 | |
| 11763 | func DecodeSetConfig(parent *Header, decoder *goloxi.Decoder) (*SetConfig, error) { |
| 11764 | _setconfig := &SetConfig{Header: parent} |
| 11765 | if decoder.Length() < 4 { |
| 11766 | return nil, fmt.Errorf("SetConfig packet too short: %d < 4", decoder.Length()) |
| 11767 | } |
| 11768 | _setconfig.Flags = ConfigFlags(decoder.ReadUint16()) |
| 11769 | _setconfig.MissSendLen = uint16(decoder.ReadUint16()) |
| 11770 | return _setconfig, nil |
| 11771 | } |
| 11772 | |
| 11773 | func NewSetConfig() *SetConfig { |
| 11774 | obj := &SetConfig{ |
| 11775 | Header: NewHeader(9), |
| 11776 | } |
| 11777 | return obj |
| 11778 | } |
| 11779 | |
| 11780 | type SwitchConfigFailedErrorMsg struct { |
| 11781 | *ErrorMsg |
| 11782 | Code SwitchConfigFailedCode |
| 11783 | Data []byte |
| 11784 | } |
| 11785 | |
| 11786 | type ISwitchConfigFailedErrorMsg interface { |
| 11787 | IErrorMsg |
| 11788 | GetCode() SwitchConfigFailedCode |
| 11789 | GetData() []byte |
| 11790 | } |
| 11791 | |
| 11792 | func (self *SwitchConfigFailedErrorMsg) GetCode() SwitchConfigFailedCode { |
| 11793 | return self.Code |
| 11794 | } |
| 11795 | |
| 11796 | func (self *SwitchConfigFailedErrorMsg) SetCode(v SwitchConfigFailedCode) { |
| 11797 | self.Code = v |
| 11798 | } |
| 11799 | |
| 11800 | func (self *SwitchConfigFailedErrorMsg) GetData() []byte { |
| 11801 | return self.Data |
| 11802 | } |
| 11803 | |
| 11804 | func (self *SwitchConfigFailedErrorMsg) SetData(v []byte) { |
| 11805 | self.Data = v |
| 11806 | } |
| 11807 | |
| 11808 | func (self *SwitchConfigFailedErrorMsg) Serialize(encoder *goloxi.Encoder) error { |
| 11809 | startIndex := len(encoder.Bytes()) |
| 11810 | if err := self.ErrorMsg.Serialize(encoder); err != nil { |
| 11811 | return err |
| 11812 | } |
| 11813 | |
| 11814 | encoder.PutUint16(uint16(self.Code)) |
| 11815 | encoder.Write(self.Data) |
| 11816 | length := len(encoder.Bytes()) - startIndex |
| 11817 | |
| 11818 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 11819 | |
| 11820 | return nil |
| 11821 | } |
| 11822 | |
| 11823 | func DecodeSwitchConfigFailedErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*SwitchConfigFailedErrorMsg, error) { |
| 11824 | _switchconfigfailederrormsg := &SwitchConfigFailedErrorMsg{ErrorMsg: parent} |
| 11825 | if decoder.Length() < 2 { |
| 11826 | return nil, fmt.Errorf("SwitchConfigFailedErrorMsg packet too short: %d < 2", decoder.Length()) |
| 11827 | } |
| 11828 | _switchconfigfailederrormsg.Code = SwitchConfigFailedCode(decoder.ReadUint16()) |
| 11829 | _switchconfigfailederrormsg.Data = decoder.Read(int(decoder.Length())) |
| 11830 | return _switchconfigfailederrormsg, nil |
| 11831 | } |
| 11832 | |
| 11833 | func NewSwitchConfigFailedErrorMsg() *SwitchConfigFailedErrorMsg { |
| 11834 | obj := &SwitchConfigFailedErrorMsg{ |
| 11835 | ErrorMsg: NewErrorMsg(10), |
| 11836 | } |
| 11837 | return obj |
| 11838 | } |
| 11839 | |
| 11840 | type TableDescStatsReply struct { |
| 11841 | *StatsReply |
| 11842 | Entries []*TableDesc |
| 11843 | } |
| 11844 | |
| 11845 | type ITableDescStatsReply interface { |
| 11846 | IStatsReply |
| 11847 | GetEntries() []*TableDesc |
| 11848 | } |
| 11849 | |
| 11850 | func (self *TableDescStatsReply) GetEntries() []*TableDesc { |
| 11851 | return self.Entries |
| 11852 | } |
| 11853 | |
| 11854 | func (self *TableDescStatsReply) SetEntries(v []*TableDesc) { |
| 11855 | self.Entries = v |
| 11856 | } |
| 11857 | |
| 11858 | func (self *TableDescStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 11859 | startIndex := len(encoder.Bytes()) |
| 11860 | if err := self.StatsReply.Serialize(encoder); err != nil { |
| 11861 | return err |
| 11862 | } |
| 11863 | |
| 11864 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 11865 | for _, obj := range self.Entries { |
| 11866 | if err := obj.Serialize(encoder); err != nil { |
| 11867 | return err |
| 11868 | } |
| 11869 | } |
| 11870 | length := len(encoder.Bytes()) - startIndex |
| 11871 | |
| 11872 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 11873 | |
| 11874 | return nil |
| 11875 | } |
| 11876 | |
| 11877 | func DecodeTableDescStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*TableDescStatsReply, error) { |
| 11878 | _tabledescstatsreply := &TableDescStatsReply{StatsReply: parent} |
| 11879 | if decoder.Length() < 4 { |
| 11880 | return nil, fmt.Errorf("TableDescStatsReply packet too short: %d < 4", decoder.Length()) |
| 11881 | } |
| 11882 | decoder.Skip(4) |
| 11883 | |
| 11884 | for decoder.Length() >= 8 { |
| 11885 | item := &TableDesc{} |
| 11886 | if err := item.Decode(decoder); err != nil { |
| 11887 | return nil, err |
| 11888 | } |
| 11889 | if item != nil { |
| 11890 | _tabledescstatsreply.Entries = append(_tabledescstatsreply.Entries, item) |
| 11891 | } |
| 11892 | } |
| 11893 | return _tabledescstatsreply, nil |
| 11894 | } |
| 11895 | |
| 11896 | func NewTableDescStatsReply() *TableDescStatsReply { |
| 11897 | obj := &TableDescStatsReply{ |
| 11898 | StatsReply: NewStatsReply(14), |
| 11899 | } |
| 11900 | return obj |
| 11901 | } |
| 11902 | |
| 11903 | type TableDescStatsRequest struct { |
| 11904 | *StatsRequest |
| 11905 | } |
| 11906 | |
| 11907 | type ITableDescStatsRequest interface { |
| 11908 | IStatsRequest |
| 11909 | } |
| 11910 | |
| 11911 | func (self *TableDescStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 11912 | startIndex := len(encoder.Bytes()) |
| 11913 | if err := self.StatsRequest.Serialize(encoder); err != nil { |
| 11914 | return err |
| 11915 | } |
| 11916 | |
| 11917 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 11918 | length := len(encoder.Bytes()) - startIndex |
| 11919 | |
| 11920 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 11921 | |
| 11922 | return nil |
| 11923 | } |
| 11924 | |
| 11925 | func DecodeTableDescStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*TableDescStatsRequest, error) { |
| 11926 | _tabledescstatsrequest := &TableDescStatsRequest{StatsRequest: parent} |
| 11927 | if decoder.Length() < 4 { |
| 11928 | return nil, fmt.Errorf("TableDescStatsRequest packet too short: %d < 4", decoder.Length()) |
| 11929 | } |
| 11930 | decoder.Skip(4) |
| 11931 | return _tabledescstatsrequest, nil |
| 11932 | } |
| 11933 | |
| 11934 | func NewTableDescStatsRequest() *TableDescStatsRequest { |
| 11935 | obj := &TableDescStatsRequest{ |
| 11936 | StatsRequest: NewStatsRequest(14), |
| 11937 | } |
| 11938 | return obj |
| 11939 | } |
| 11940 | |
| 11941 | type TableFeaturesFailedErrorMsg struct { |
| 11942 | *ErrorMsg |
| 11943 | Code TableFeaturesFailedCode |
| 11944 | Data []byte |
| 11945 | } |
| 11946 | |
| 11947 | type ITableFeaturesFailedErrorMsg interface { |
| 11948 | IErrorMsg |
| 11949 | GetCode() TableFeaturesFailedCode |
| 11950 | GetData() []byte |
| 11951 | } |
| 11952 | |
| 11953 | func (self *TableFeaturesFailedErrorMsg) GetCode() TableFeaturesFailedCode { |
| 11954 | return self.Code |
| 11955 | } |
| 11956 | |
| 11957 | func (self *TableFeaturesFailedErrorMsg) SetCode(v TableFeaturesFailedCode) { |
| 11958 | self.Code = v |
| 11959 | } |
| 11960 | |
| 11961 | func (self *TableFeaturesFailedErrorMsg) GetData() []byte { |
| 11962 | return self.Data |
| 11963 | } |
| 11964 | |
| 11965 | func (self *TableFeaturesFailedErrorMsg) SetData(v []byte) { |
| 11966 | self.Data = v |
| 11967 | } |
| 11968 | |
| 11969 | func (self *TableFeaturesFailedErrorMsg) Serialize(encoder *goloxi.Encoder) error { |
| 11970 | startIndex := len(encoder.Bytes()) |
| 11971 | if err := self.ErrorMsg.Serialize(encoder); err != nil { |
| 11972 | return err |
| 11973 | } |
| 11974 | |
| 11975 | encoder.PutUint16(uint16(self.Code)) |
| 11976 | encoder.Write(self.Data) |
| 11977 | length := len(encoder.Bytes()) - startIndex |
| 11978 | |
| 11979 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 11980 | |
| 11981 | return nil |
| 11982 | } |
| 11983 | |
| 11984 | func DecodeTableFeaturesFailedErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*TableFeaturesFailedErrorMsg, error) { |
| 11985 | _tablefeaturesfailederrormsg := &TableFeaturesFailedErrorMsg{ErrorMsg: parent} |
| 11986 | if decoder.Length() < 2 { |
| 11987 | return nil, fmt.Errorf("TableFeaturesFailedErrorMsg packet too short: %d < 2", decoder.Length()) |
| 11988 | } |
| 11989 | _tablefeaturesfailederrormsg.Code = TableFeaturesFailedCode(decoder.ReadUint16()) |
| 11990 | _tablefeaturesfailederrormsg.Data = decoder.Read(int(decoder.Length())) |
| 11991 | return _tablefeaturesfailederrormsg, nil |
| 11992 | } |
| 11993 | |
| 11994 | func NewTableFeaturesFailedErrorMsg() *TableFeaturesFailedErrorMsg { |
| 11995 | obj := &TableFeaturesFailedErrorMsg{ |
| 11996 | ErrorMsg: NewErrorMsg(13), |
| 11997 | } |
| 11998 | return obj |
| 11999 | } |
| 12000 | |
| 12001 | type TableFeaturesStatsReply struct { |
| 12002 | *StatsReply |
| 12003 | Entries []*TableFeatures |
| 12004 | } |
| 12005 | |
| 12006 | type ITableFeaturesStatsReply interface { |
| 12007 | IStatsReply |
| 12008 | GetEntries() []*TableFeatures |
| 12009 | } |
| 12010 | |
| 12011 | func (self *TableFeaturesStatsReply) GetEntries() []*TableFeatures { |
| 12012 | return self.Entries |
| 12013 | } |
| 12014 | |
| 12015 | func (self *TableFeaturesStatsReply) SetEntries(v []*TableFeatures) { |
| 12016 | self.Entries = v |
| 12017 | } |
| 12018 | |
| 12019 | func (self *TableFeaturesStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 12020 | startIndex := len(encoder.Bytes()) |
| 12021 | if err := self.StatsReply.Serialize(encoder); err != nil { |
| 12022 | return err |
| 12023 | } |
| 12024 | |
| 12025 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 12026 | for _, obj := range self.Entries { |
| 12027 | if err := obj.Serialize(encoder); err != nil { |
| 12028 | return err |
| 12029 | } |
| 12030 | } |
| 12031 | length := len(encoder.Bytes()) - startIndex |
| 12032 | |
| 12033 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 12034 | |
| 12035 | return nil |
| 12036 | } |
| 12037 | |
| 12038 | func DecodeTableFeaturesStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*TableFeaturesStatsReply, error) { |
| 12039 | _tablefeaturesstatsreply := &TableFeaturesStatsReply{StatsReply: parent} |
| 12040 | if decoder.Length() < 4 { |
| 12041 | return nil, fmt.Errorf("TableFeaturesStatsReply packet too short: %d < 4", decoder.Length()) |
| 12042 | } |
| 12043 | decoder.Skip(4) |
| 12044 | |
| 12045 | for decoder.Length() >= 64 { |
| 12046 | item, err := DecodeTableFeatures(decoder) |
| 12047 | if err != nil { |
| 12048 | return nil, err |
| 12049 | } |
| 12050 | if item != nil { |
| 12051 | _tablefeaturesstatsreply.Entries = append(_tablefeaturesstatsreply.Entries, item) |
| 12052 | } |
| 12053 | } |
| 12054 | return _tablefeaturesstatsreply, nil |
| 12055 | } |
| 12056 | |
| 12057 | func NewTableFeaturesStatsReply() *TableFeaturesStatsReply { |
| 12058 | obj := &TableFeaturesStatsReply{ |
| 12059 | StatsReply: NewStatsReply(12), |
| 12060 | } |
| 12061 | return obj |
| 12062 | } |
| 12063 | |
| 12064 | type TableFeaturesStatsRequest struct { |
| 12065 | *StatsRequest |
| 12066 | Entries []*TableFeatures |
| 12067 | } |
| 12068 | |
| 12069 | type ITableFeaturesStatsRequest interface { |
| 12070 | IStatsRequest |
| 12071 | GetEntries() []*TableFeatures |
| 12072 | } |
| 12073 | |
| 12074 | func (self *TableFeaturesStatsRequest) GetEntries() []*TableFeatures { |
| 12075 | return self.Entries |
| 12076 | } |
| 12077 | |
| 12078 | func (self *TableFeaturesStatsRequest) SetEntries(v []*TableFeatures) { |
| 12079 | self.Entries = v |
| 12080 | } |
| 12081 | |
| 12082 | func (self *TableFeaturesStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 12083 | startIndex := len(encoder.Bytes()) |
| 12084 | if err := self.StatsRequest.Serialize(encoder); err != nil { |
| 12085 | return err |
| 12086 | } |
| 12087 | |
| 12088 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 12089 | for _, obj := range self.Entries { |
| 12090 | if err := obj.Serialize(encoder); err != nil { |
| 12091 | return err |
| 12092 | } |
| 12093 | } |
| 12094 | length := len(encoder.Bytes()) - startIndex |
| 12095 | |
| 12096 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 12097 | |
| 12098 | return nil |
| 12099 | } |
| 12100 | |
| 12101 | func DecodeTableFeaturesStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*TableFeaturesStatsRequest, error) { |
| 12102 | _tablefeaturesstatsrequest := &TableFeaturesStatsRequest{StatsRequest: parent} |
| 12103 | if decoder.Length() < 4 { |
| 12104 | return nil, fmt.Errorf("TableFeaturesStatsRequest packet too short: %d < 4", decoder.Length()) |
| 12105 | } |
| 12106 | decoder.Skip(4) |
| 12107 | |
| 12108 | for decoder.Length() >= 64 { |
| 12109 | item, err := DecodeTableFeatures(decoder) |
| 12110 | if err != nil { |
| 12111 | return nil, err |
| 12112 | } |
| 12113 | if item != nil { |
| 12114 | _tablefeaturesstatsrequest.Entries = append(_tablefeaturesstatsrequest.Entries, item) |
| 12115 | } |
| 12116 | } |
| 12117 | return _tablefeaturesstatsrequest, nil |
| 12118 | } |
| 12119 | |
| 12120 | func NewTableFeaturesStatsRequest() *TableFeaturesStatsRequest { |
| 12121 | obj := &TableFeaturesStatsRequest{ |
| 12122 | StatsRequest: NewStatsRequest(12), |
| 12123 | } |
| 12124 | return obj |
| 12125 | } |
| 12126 | |
| 12127 | type TableMod struct { |
| 12128 | *Header |
| 12129 | TableId uint8 |
| 12130 | Config uint32 |
| 12131 | Properties []ITableModProp |
| 12132 | } |
| 12133 | |
| 12134 | type ITableMod interface { |
| 12135 | IHeader |
| 12136 | GetTableId() uint8 |
| 12137 | GetConfig() uint32 |
| 12138 | GetProperties() []ITableModProp |
| 12139 | } |
| 12140 | |
| 12141 | func (self *TableMod) GetTableId() uint8 { |
| 12142 | return self.TableId |
| 12143 | } |
| 12144 | |
| 12145 | func (self *TableMod) SetTableId(v uint8) { |
| 12146 | self.TableId = v |
| 12147 | } |
| 12148 | |
| 12149 | func (self *TableMod) GetConfig() uint32 { |
| 12150 | return self.Config |
| 12151 | } |
| 12152 | |
| 12153 | func (self *TableMod) SetConfig(v uint32) { |
| 12154 | self.Config = v |
| 12155 | } |
| 12156 | |
| 12157 | func (self *TableMod) GetProperties() []ITableModProp { |
| 12158 | return self.Properties |
| 12159 | } |
| 12160 | |
| 12161 | func (self *TableMod) SetProperties(v []ITableModProp) { |
| 12162 | self.Properties = v |
| 12163 | } |
| 12164 | |
| 12165 | func (self *TableMod) Serialize(encoder *goloxi.Encoder) error { |
| 12166 | startIndex := len(encoder.Bytes()) |
| 12167 | if err := self.Header.Serialize(encoder); err != nil { |
| 12168 | return err |
| 12169 | } |
| 12170 | |
| 12171 | encoder.PutUint8(uint8(self.TableId)) |
| 12172 | encoder.Write(bytes.Repeat([]byte{0}, 3)) |
| 12173 | encoder.PutUint32(uint32(self.Config)) |
| 12174 | for _, obj := range self.Properties { |
| 12175 | if err := obj.Serialize(encoder); err != nil { |
| 12176 | return err |
| 12177 | } |
| 12178 | } |
| 12179 | length := len(encoder.Bytes()) - startIndex |
| 12180 | |
| 12181 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 12182 | |
| 12183 | return nil |
| 12184 | } |
| 12185 | |
| 12186 | func DecodeTableMod(parent *Header, decoder *goloxi.Decoder) (*TableMod, error) { |
| 12187 | _tablemod := &TableMod{Header: parent} |
| 12188 | if decoder.Length() < 8 { |
| 12189 | return nil, fmt.Errorf("TableMod packet too short: %d < 8", decoder.Length()) |
| 12190 | } |
| 12191 | _tablemod.TableId = uint8(decoder.ReadByte()) |
| 12192 | decoder.Skip(3) |
| 12193 | _tablemod.Config = uint32(decoder.ReadUint32()) |
| 12194 | |
| 12195 | for decoder.Length() >= 4 { |
| 12196 | item, err := DecodeTableModProp(decoder) |
| 12197 | if err != nil { |
| 12198 | return nil, err |
| 12199 | } |
| 12200 | if item != nil { |
| 12201 | _tablemod.Properties = append(_tablemod.Properties, item) |
| 12202 | } |
| 12203 | } |
| 12204 | return _tablemod, nil |
| 12205 | } |
| 12206 | |
| 12207 | func NewTableMod() *TableMod { |
| 12208 | obj := &TableMod{ |
| 12209 | Header: NewHeader(17), |
| 12210 | } |
| 12211 | return obj |
| 12212 | } |
| 12213 | |
| 12214 | type TableModFailedErrorMsg struct { |
| 12215 | *ErrorMsg |
| 12216 | Code TableModFailedCode |
| 12217 | Data []byte |
| 12218 | } |
| 12219 | |
| 12220 | type ITableModFailedErrorMsg interface { |
| 12221 | IErrorMsg |
| 12222 | GetCode() TableModFailedCode |
| 12223 | GetData() []byte |
| 12224 | } |
| 12225 | |
| 12226 | func (self *TableModFailedErrorMsg) GetCode() TableModFailedCode { |
| 12227 | return self.Code |
| 12228 | } |
| 12229 | |
| 12230 | func (self *TableModFailedErrorMsg) SetCode(v TableModFailedCode) { |
| 12231 | self.Code = v |
| 12232 | } |
| 12233 | |
| 12234 | func (self *TableModFailedErrorMsg) GetData() []byte { |
| 12235 | return self.Data |
| 12236 | } |
| 12237 | |
| 12238 | func (self *TableModFailedErrorMsg) SetData(v []byte) { |
| 12239 | self.Data = v |
| 12240 | } |
| 12241 | |
| 12242 | func (self *TableModFailedErrorMsg) Serialize(encoder *goloxi.Encoder) error { |
| 12243 | startIndex := len(encoder.Bytes()) |
| 12244 | if err := self.ErrorMsg.Serialize(encoder); err != nil { |
| 12245 | return err |
| 12246 | } |
| 12247 | |
| 12248 | encoder.PutUint16(uint16(self.Code)) |
| 12249 | encoder.Write(self.Data) |
| 12250 | length := len(encoder.Bytes()) - startIndex |
| 12251 | |
| 12252 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 12253 | |
| 12254 | return nil |
| 12255 | } |
| 12256 | |
| 12257 | func DecodeTableModFailedErrorMsg(parent *ErrorMsg, decoder *goloxi.Decoder) (*TableModFailedErrorMsg, error) { |
| 12258 | _tablemodfailederrormsg := &TableModFailedErrorMsg{ErrorMsg: parent} |
| 12259 | if decoder.Length() < 2 { |
| 12260 | return nil, fmt.Errorf("TableModFailedErrorMsg packet too short: %d < 2", decoder.Length()) |
| 12261 | } |
| 12262 | _tablemodfailederrormsg.Code = TableModFailedCode(decoder.ReadUint16()) |
| 12263 | _tablemodfailederrormsg.Data = decoder.Read(int(decoder.Length())) |
| 12264 | return _tablemodfailederrormsg, nil |
| 12265 | } |
| 12266 | |
| 12267 | func NewTableModFailedErrorMsg() *TableModFailedErrorMsg { |
| 12268 | obj := &TableModFailedErrorMsg{ |
| 12269 | ErrorMsg: NewErrorMsg(8), |
| 12270 | } |
| 12271 | return obj |
| 12272 | } |
| 12273 | |
| 12274 | type TableStatsReply struct { |
| 12275 | *StatsReply |
| 12276 | Entries []*TableStatsEntry |
| 12277 | } |
| 12278 | |
| 12279 | type ITableStatsReply interface { |
| 12280 | IStatsReply |
| 12281 | GetEntries() []*TableStatsEntry |
| 12282 | } |
| 12283 | |
| 12284 | func (self *TableStatsReply) GetEntries() []*TableStatsEntry { |
| 12285 | return self.Entries |
| 12286 | } |
| 12287 | |
| 12288 | func (self *TableStatsReply) SetEntries(v []*TableStatsEntry) { |
| 12289 | self.Entries = v |
| 12290 | } |
| 12291 | |
| 12292 | func (self *TableStatsReply) Serialize(encoder *goloxi.Encoder) error { |
| 12293 | startIndex := len(encoder.Bytes()) |
| 12294 | if err := self.StatsReply.Serialize(encoder); err != nil { |
| 12295 | return err |
| 12296 | } |
| 12297 | |
| 12298 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 12299 | for _, obj := range self.Entries { |
| 12300 | if err := obj.Serialize(encoder); err != nil { |
| 12301 | return err |
| 12302 | } |
| 12303 | } |
| 12304 | length := len(encoder.Bytes()) - startIndex |
| 12305 | |
| 12306 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 12307 | |
| 12308 | return nil |
| 12309 | } |
| 12310 | |
| 12311 | func DecodeTableStatsReply(parent *StatsReply, decoder *goloxi.Decoder) (*TableStatsReply, error) { |
| 12312 | _tablestatsreply := &TableStatsReply{StatsReply: parent} |
| 12313 | if decoder.Length() < 4 { |
| 12314 | return nil, fmt.Errorf("TableStatsReply packet too short: %d < 4", decoder.Length()) |
| 12315 | } |
| 12316 | decoder.Skip(4) |
| 12317 | |
| 12318 | for decoder.Length() >= 24 { |
| 12319 | item, err := DecodeTableStatsEntry(decoder) |
| 12320 | if err != nil { |
| 12321 | return nil, err |
| 12322 | } |
| 12323 | if item != nil { |
| 12324 | _tablestatsreply.Entries = append(_tablestatsreply.Entries, item) |
| 12325 | } |
| 12326 | } |
| 12327 | return _tablestatsreply, nil |
| 12328 | } |
| 12329 | |
| 12330 | func NewTableStatsReply() *TableStatsReply { |
| 12331 | obj := &TableStatsReply{ |
| 12332 | StatsReply: NewStatsReply(3), |
| 12333 | } |
| 12334 | return obj |
| 12335 | } |
| 12336 | |
| 12337 | type TableStatsRequest struct { |
| 12338 | *StatsRequest |
| 12339 | } |
| 12340 | |
| 12341 | type ITableStatsRequest interface { |
| 12342 | IStatsRequest |
| 12343 | } |
| 12344 | |
| 12345 | func (self *TableStatsRequest) Serialize(encoder *goloxi.Encoder) error { |
| 12346 | startIndex := len(encoder.Bytes()) |
| 12347 | if err := self.StatsRequest.Serialize(encoder); err != nil { |
| 12348 | return err |
| 12349 | } |
| 12350 | |
| 12351 | encoder.Write(bytes.Repeat([]byte{0}, 4)) |
| 12352 | length := len(encoder.Bytes()) - startIndex |
| 12353 | |
| 12354 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 12355 | |
| 12356 | return nil |
| 12357 | } |
| 12358 | |
| 12359 | func DecodeTableStatsRequest(parent *StatsRequest, decoder *goloxi.Decoder) (*TableStatsRequest, error) { |
| 12360 | _tablestatsrequest := &TableStatsRequest{StatsRequest: parent} |
| 12361 | if decoder.Length() < 4 { |
| 12362 | return nil, fmt.Errorf("TableStatsRequest packet too short: %d < 4", decoder.Length()) |
| 12363 | } |
| 12364 | decoder.Skip(4) |
| 12365 | return _tablestatsrequest, nil |
| 12366 | } |
| 12367 | |
| 12368 | func NewTableStatsRequest() *TableStatsRequest { |
| 12369 | obj := &TableStatsRequest{ |
| 12370 | StatsRequest: NewStatsRequest(3), |
| 12371 | } |
| 12372 | return obj |
| 12373 | } |
| 12374 | |
| 12375 | type TableStatus struct { |
| 12376 | *Header |
| 12377 | Role uint32 |
| 12378 | Reason TableReason |
| 12379 | Table TableDesc |
| 12380 | } |
| 12381 | |
| 12382 | type ITableStatus interface { |
| 12383 | IHeader |
| 12384 | GetRole() uint32 |
| 12385 | GetReason() TableReason |
| 12386 | GetTable() TableDesc |
| 12387 | } |
| 12388 | |
| 12389 | func (self *TableStatus) GetRole() uint32 { |
| 12390 | return self.Role |
| 12391 | } |
| 12392 | |
| 12393 | func (self *TableStatus) SetRole(v uint32) { |
| 12394 | self.Role = v |
| 12395 | } |
| 12396 | |
| 12397 | func (self *TableStatus) GetReason() TableReason { |
| 12398 | return self.Reason |
| 12399 | } |
| 12400 | |
| 12401 | func (self *TableStatus) SetReason(v TableReason) { |
| 12402 | self.Reason = v |
| 12403 | } |
| 12404 | |
| 12405 | func (self *TableStatus) GetTable() TableDesc { |
| 12406 | return self.Table |
| 12407 | } |
| 12408 | |
| 12409 | func (self *TableStatus) SetTable(v TableDesc) { |
| 12410 | self.Table = v |
| 12411 | } |
| 12412 | |
| 12413 | func (self *TableStatus) Serialize(encoder *goloxi.Encoder) error { |
| 12414 | startIndex := len(encoder.Bytes()) |
| 12415 | if err := self.Header.Serialize(encoder); err != nil { |
| 12416 | return err |
| 12417 | } |
| 12418 | |
| 12419 | encoder.PutUint32(uint32(self.Role)) |
| 12420 | encoder.PutUint8(uint8(self.Reason)) |
| 12421 | encoder.Write(bytes.Repeat([]byte{0}, 7)) |
| 12422 | if err := self.Table.Serialize(encoder); err != nil { |
| 12423 | return err |
| 12424 | } |
| 12425 | |
| 12426 | length := len(encoder.Bytes()) - startIndex |
| 12427 | |
| 12428 | binary.BigEndian.PutUint16(encoder.Bytes()[startIndex+2:startIndex+4], uint16(length)) |
| 12429 | |
| 12430 | return nil |
| 12431 | } |
| 12432 | |
| 12433 | func DecodeTableStatus(parent *Header, decoder *goloxi.Decoder) (*TableStatus, error) { |
| 12434 | _tablestatus := &TableStatus{Header: parent} |
| 12435 | if decoder.Length() < 20 { |
| 12436 | return nil, fmt.Errorf("TableStatus packet too short: %d < 20", decoder.Length()) |
| 12437 | } |
| 12438 | _tablestatus.Role = uint32(decoder.ReadUint32()) |
| 12439 | _tablestatus.Reason = TableReason(decoder.ReadByte()) |
| 12440 | decoder.Skip(7) |
| 12441 | if err := _tablestatus.Table.Decode(decoder); err != nil { |
| 12442 | return nil, err |
| 12443 | } |
| 12444 | |
| 12445 | return _tablestatus, nil |
| 12446 | } |
| 12447 | |
| 12448 | func NewTableStatus() *TableStatus { |
| 12449 | obj := &TableStatus{ |
| 12450 | Header: NewHeader(31), |
| 12451 | } |
| 12452 | return obj |
| 12453 | } |