github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/qos/qos.ba.go (about) 1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT. 2 // versions: 3 // binapi-generator: v0.10.0-dev 4 // VPP: 23.10-rc0~170-g6f1548434 5 // source: core/qos.api.json 6 7 // Package qos contains generated bindings for API file qos.api. 8 // 9 // Contents: 10 // - 1 enum 11 // - 5 structs 12 // - 19 messages 13 package qos 14 15 import ( 16 "strconv" 17 18 interface_types "github.com/networkservicemesh/govpp/binapi/interface_types" 19 _ "github.com/networkservicemesh/govpp/binapi/ip_types" 20 api "go.fd.io/govpp/api" 21 codec "go.fd.io/govpp/codec" 22 ) 23 24 // This is a compile-time assertion to ensure that this generated file 25 // is compatible with the GoVPP api package it is being compiled against. 26 // A compilation error at this line likely means your copy of the 27 // GoVPP api package needs to be updated. 28 const _ = api.GoVppAPIPackageIsVersion2 29 30 const ( 31 APIFile = "qos" 32 APIVersion = "1.1.1" 33 VersionCrc = 0x7b7b5955 34 ) 35 36 // QosSource defines enum 'qos_source'. 37 type QosSource uint8 38 39 const ( 40 QOS_API_SOURCE_EXT QosSource = 0 41 QOS_API_SOURCE_VLAN QosSource = 1 42 QOS_API_SOURCE_MPLS QosSource = 2 43 QOS_API_SOURCE_IP QosSource = 3 44 ) 45 46 var ( 47 QosSource_name = map[uint8]string{ 48 0: "QOS_API_SOURCE_EXT", 49 1: "QOS_API_SOURCE_VLAN", 50 2: "QOS_API_SOURCE_MPLS", 51 3: "QOS_API_SOURCE_IP", 52 } 53 QosSource_value = map[string]uint8{ 54 "QOS_API_SOURCE_EXT": 0, 55 "QOS_API_SOURCE_VLAN": 1, 56 "QOS_API_SOURCE_MPLS": 2, 57 "QOS_API_SOURCE_IP": 3, 58 } 59 ) 60 61 func (x QosSource) String() string { 62 s, ok := QosSource_name[uint8(x)] 63 if ok { 64 return s 65 } 66 return "QosSource(" + strconv.Itoa(int(x)) + ")" 67 } 68 69 // QosEgressMap defines type 'qos_egress_map'. 70 type QosEgressMap struct { 71 ID uint32 `binapi:"u32,name=id" json:"id,omitempty"` 72 Rows [4]QosEgressMapRow `binapi:"qos_egress_map_row[4],name=rows" json:"rows,omitempty"` 73 } 74 75 // QosEgressMapRow defines type 'qos_egress_map_row'. 76 type QosEgressMapRow struct { 77 Outputs []byte `binapi:"u8[256],name=outputs" json:"outputs,omitempty"` 78 } 79 80 // QosMark defines type 'qos_mark'. 81 type QosMark struct { 82 SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"` 83 MapID uint32 `binapi:"u32,name=map_id" json:"map_id,omitempty"` 84 OutputSource QosSource `binapi:"qos_source,name=output_source" json:"output_source,omitempty"` 85 } 86 87 // QosRecord defines type 'qos_record'. 88 type QosRecord struct { 89 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 90 InputSource QosSource `binapi:"qos_source,name=input_source" json:"input_source,omitempty"` 91 } 92 93 // QosStore defines type 'qos_store'. 94 type QosStore struct { 95 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 96 InputSource QosSource `binapi:"qos_source,name=input_source" json:"input_source,omitempty"` 97 Value uint8 `binapi:"u8,name=value" json:"value,omitempty"` 98 } 99 100 // * @brief Delete a Qos Map 101 // - - map_id - ID of the map to delete 102 // 103 // QosEgressMapDelete defines message 'qos_egress_map_delete'. 104 type QosEgressMapDelete struct { 105 ID uint32 `binapi:"u32,name=id" json:"id,omitempty"` 106 } 107 108 func (m *QosEgressMapDelete) Reset() { *m = QosEgressMapDelete{} } 109 func (*QosEgressMapDelete) GetMessageName() string { return "qos_egress_map_delete" } 110 func (*QosEgressMapDelete) GetCrcString() string { return "3a91bde5" } 111 func (*QosEgressMapDelete) GetMessageType() api.MessageType { 112 return api.RequestMessage 113 } 114 115 func (m *QosEgressMapDelete) Size() (size int) { 116 if m == nil { 117 return 0 118 } 119 size += 4 // m.ID 120 return size 121 } 122 func (m *QosEgressMapDelete) Marshal(b []byte) ([]byte, error) { 123 if b == nil { 124 b = make([]byte, m.Size()) 125 } 126 buf := codec.NewBuffer(b) 127 buf.EncodeUint32(m.ID) 128 return buf.Bytes(), nil 129 } 130 func (m *QosEgressMapDelete) Unmarshal(b []byte) error { 131 buf := codec.NewBuffer(b) 132 m.ID = buf.DecodeUint32() 133 return nil 134 } 135 136 // QosEgressMapDeleteReply defines message 'qos_egress_map_delete_reply'. 137 type QosEgressMapDeleteReply struct { 138 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 139 } 140 141 func (m *QosEgressMapDeleteReply) Reset() { *m = QosEgressMapDeleteReply{} } 142 func (*QosEgressMapDeleteReply) GetMessageName() string { return "qos_egress_map_delete_reply" } 143 func (*QosEgressMapDeleteReply) GetCrcString() string { return "e8d4e804" } 144 func (*QosEgressMapDeleteReply) GetMessageType() api.MessageType { 145 return api.ReplyMessage 146 } 147 148 func (m *QosEgressMapDeleteReply) Size() (size int) { 149 if m == nil { 150 return 0 151 } 152 size += 4 // m.Retval 153 return size 154 } 155 func (m *QosEgressMapDeleteReply) Marshal(b []byte) ([]byte, error) { 156 if b == nil { 157 b = make([]byte, m.Size()) 158 } 159 buf := codec.NewBuffer(b) 160 buf.EncodeInt32(m.Retval) 161 return buf.Bytes(), nil 162 } 163 func (m *QosEgressMapDeleteReply) Unmarshal(b []byte) error { 164 buf := codec.NewBuffer(b) 165 m.Retval = buf.DecodeInt32() 166 return nil 167 } 168 169 // * QoS map details 170 // QosEgressMapDetails defines message 'qos_egress_map_details'. 171 type QosEgressMapDetails struct { 172 Map QosEgressMap `binapi:"qos_egress_map,name=map" json:"map,omitempty"` 173 } 174 175 func (m *QosEgressMapDetails) Reset() { *m = QosEgressMapDetails{} } 176 func (*QosEgressMapDetails) GetMessageName() string { return "qos_egress_map_details" } 177 func (*QosEgressMapDetails) GetCrcString() string { return "46c5653c" } 178 func (*QosEgressMapDetails) GetMessageType() api.MessageType { 179 return api.ReplyMessage 180 } 181 182 func (m *QosEgressMapDetails) Size() (size int) { 183 if m == nil { 184 return 0 185 } 186 size += 4 // m.Map.ID 187 for j2 := 0; j2 < 4; j2++ { 188 size += 1 * 256 // m.Map.Rows[j2].Outputs 189 } 190 return size 191 } 192 func (m *QosEgressMapDetails) Marshal(b []byte) ([]byte, error) { 193 if b == nil { 194 b = make([]byte, m.Size()) 195 } 196 buf := codec.NewBuffer(b) 197 buf.EncodeUint32(m.Map.ID) 198 for j1 := 0; j1 < 4; j1++ { 199 buf.EncodeBytes(m.Map.Rows[j1].Outputs, 256) 200 } 201 return buf.Bytes(), nil 202 } 203 func (m *QosEgressMapDetails) Unmarshal(b []byte) error { 204 buf := codec.NewBuffer(b) 205 m.Map.ID = buf.DecodeUint32() 206 for j1 := 0; j1 < 4; j1++ { 207 m.Map.Rows[j1].Outputs = make([]byte, 256) 208 copy(m.Map.Rows[j1].Outputs, buf.DecodeBytes(len(m.Map.Rows[j1].Outputs))) 209 } 210 return nil 211 } 212 213 // * Dump the QoS egress maps 214 // QosEgressMapDump defines message 'qos_egress_map_dump'. 215 type QosEgressMapDump struct{} 216 217 func (m *QosEgressMapDump) Reset() { *m = QosEgressMapDump{} } 218 func (*QosEgressMapDump) GetMessageName() string { return "qos_egress_map_dump" } 219 func (*QosEgressMapDump) GetCrcString() string { return "51077d14" } 220 func (*QosEgressMapDump) GetMessageType() api.MessageType { 221 return api.RequestMessage 222 } 223 224 func (m *QosEgressMapDump) Size() (size int) { 225 if m == nil { 226 return 0 227 } 228 return size 229 } 230 func (m *QosEgressMapDump) Marshal(b []byte) ([]byte, error) { 231 if b == nil { 232 b = make([]byte, m.Size()) 233 } 234 buf := codec.NewBuffer(b) 235 return buf.Bytes(), nil 236 } 237 func (m *QosEgressMapDump) Unmarshal(b []byte) error { 238 return nil 239 } 240 241 // * @brief Update a QoS Map 242 // - A QoS map, translates from the QoS value in the packet set by the 'record' 243 // - feature, to the value used for output in the 'mark' feature. 244 // - There is one row in the map for each input/record source. 245 // - The MAP is then applied to the egress interface at for a given output source 246 // - - map - The Map 247 // 248 // QosEgressMapUpdate defines message 'qos_egress_map_update'. 249 type QosEgressMapUpdate struct { 250 Map QosEgressMap `binapi:"qos_egress_map,name=map" json:"map,omitempty"` 251 } 252 253 func (m *QosEgressMapUpdate) Reset() { *m = QosEgressMapUpdate{} } 254 func (*QosEgressMapUpdate) GetMessageName() string { return "qos_egress_map_update" } 255 func (*QosEgressMapUpdate) GetCrcString() string { return "6d1c065f" } 256 func (*QosEgressMapUpdate) GetMessageType() api.MessageType { 257 return api.RequestMessage 258 } 259 260 func (m *QosEgressMapUpdate) Size() (size int) { 261 if m == nil { 262 return 0 263 } 264 size += 4 // m.Map.ID 265 for j2 := 0; j2 < 4; j2++ { 266 size += 1 * 256 // m.Map.Rows[j2].Outputs 267 } 268 return size 269 } 270 func (m *QosEgressMapUpdate) Marshal(b []byte) ([]byte, error) { 271 if b == nil { 272 b = make([]byte, m.Size()) 273 } 274 buf := codec.NewBuffer(b) 275 buf.EncodeUint32(m.Map.ID) 276 for j1 := 0; j1 < 4; j1++ { 277 buf.EncodeBytes(m.Map.Rows[j1].Outputs, 256) 278 } 279 return buf.Bytes(), nil 280 } 281 func (m *QosEgressMapUpdate) Unmarshal(b []byte) error { 282 buf := codec.NewBuffer(b) 283 m.Map.ID = buf.DecodeUint32() 284 for j1 := 0; j1 < 4; j1++ { 285 m.Map.Rows[j1].Outputs = make([]byte, 256) 286 copy(m.Map.Rows[j1].Outputs, buf.DecodeBytes(len(m.Map.Rows[j1].Outputs))) 287 } 288 return nil 289 } 290 291 // QosEgressMapUpdateReply defines message 'qos_egress_map_update_reply'. 292 type QosEgressMapUpdateReply struct { 293 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 294 } 295 296 func (m *QosEgressMapUpdateReply) Reset() { *m = QosEgressMapUpdateReply{} } 297 func (*QosEgressMapUpdateReply) GetMessageName() string { return "qos_egress_map_update_reply" } 298 func (*QosEgressMapUpdateReply) GetCrcString() string { return "e8d4e804" } 299 func (*QosEgressMapUpdateReply) GetMessageType() api.MessageType { 300 return api.ReplyMessage 301 } 302 303 func (m *QosEgressMapUpdateReply) Size() (size int) { 304 if m == nil { 305 return 0 306 } 307 size += 4 // m.Retval 308 return size 309 } 310 func (m *QosEgressMapUpdateReply) Marshal(b []byte) ([]byte, error) { 311 if b == nil { 312 b = make([]byte, m.Size()) 313 } 314 buf := codec.NewBuffer(b) 315 buf.EncodeInt32(m.Retval) 316 return buf.Bytes(), nil 317 } 318 func (m *QosEgressMapUpdateReply) Unmarshal(b []byte) error { 319 buf := codec.NewBuffer(b) 320 m.Retval = buf.DecodeInt32() 321 return nil 322 } 323 324 // * QoS marking details 325 // QosMarkDetails defines message 'qos_mark_details'. 326 type QosMarkDetails struct { 327 Mark QosMark `binapi:"qos_mark,name=mark" json:"mark,omitempty"` 328 } 329 330 func (m *QosMarkDetails) Reset() { *m = QosMarkDetails{} } 331 func (*QosMarkDetails) GetMessageName() string { return "qos_mark_details" } 332 func (*QosMarkDetails) GetCrcString() string { return "89fe81a9" } 333 func (*QosMarkDetails) GetMessageType() api.MessageType { 334 return api.ReplyMessage 335 } 336 337 func (m *QosMarkDetails) Size() (size int) { 338 if m == nil { 339 return 0 340 } 341 size += 4 // m.Mark.SwIfIndex 342 size += 4 // m.Mark.MapID 343 size += 1 // m.Mark.OutputSource 344 return size 345 } 346 func (m *QosMarkDetails) Marshal(b []byte) ([]byte, error) { 347 if b == nil { 348 b = make([]byte, m.Size()) 349 } 350 buf := codec.NewBuffer(b) 351 buf.EncodeUint32(m.Mark.SwIfIndex) 352 buf.EncodeUint32(m.Mark.MapID) 353 buf.EncodeUint8(uint8(m.Mark.OutputSource)) 354 return buf.Bytes(), nil 355 } 356 func (m *QosMarkDetails) Unmarshal(b []byte) error { 357 buf := codec.NewBuffer(b) 358 m.Mark.SwIfIndex = buf.DecodeUint32() 359 m.Mark.MapID = buf.DecodeUint32() 360 m.Mark.OutputSource = QosSource(buf.DecodeUint8()) 361 return nil 362 } 363 364 // QosMarkDetailsReply defines message 'qos_mark_details_reply'. 365 type QosMarkDetailsReply struct { 366 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 367 } 368 369 func (m *QosMarkDetailsReply) Reset() { *m = QosMarkDetailsReply{} } 370 func (*QosMarkDetailsReply) GetMessageName() string { return "qos_mark_details_reply" } 371 func (*QosMarkDetailsReply) GetCrcString() string { return "e8d4e804" } 372 func (*QosMarkDetailsReply) GetMessageType() api.MessageType { 373 return api.ReplyMessage 374 } 375 376 func (m *QosMarkDetailsReply) Size() (size int) { 377 if m == nil { 378 return 0 379 } 380 size += 4 // m.Retval 381 return size 382 } 383 func (m *QosMarkDetailsReply) Marshal(b []byte) ([]byte, error) { 384 if b == nil { 385 b = make([]byte, m.Size()) 386 } 387 buf := codec.NewBuffer(b) 388 buf.EncodeInt32(m.Retval) 389 return buf.Bytes(), nil 390 } 391 func (m *QosMarkDetailsReply) Unmarshal(b []byte) error { 392 buf := codec.NewBuffer(b) 393 m.Retval = buf.DecodeInt32() 394 return nil 395 } 396 397 // * Dump QoS marking configs 398 // QosMarkDump defines message 'qos_mark_dump'. 399 type QosMarkDump struct { 400 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 401 } 402 403 func (m *QosMarkDump) Reset() { *m = QosMarkDump{} } 404 func (*QosMarkDump) GetMessageName() string { return "qos_mark_dump" } 405 func (*QosMarkDump) GetCrcString() string { return "f9e6675e" } 406 func (*QosMarkDump) GetMessageType() api.MessageType { 407 return api.RequestMessage 408 } 409 410 func (m *QosMarkDump) Size() (size int) { 411 if m == nil { 412 return 0 413 } 414 size += 4 // m.SwIfIndex 415 return size 416 } 417 func (m *QosMarkDump) Marshal(b []byte) ([]byte, error) { 418 if b == nil { 419 b = make([]byte, m.Size()) 420 } 421 buf := codec.NewBuffer(b) 422 buf.EncodeUint32(uint32(m.SwIfIndex)) 423 return buf.Bytes(), nil 424 } 425 func (m *QosMarkDump) Unmarshal(b []byte) error { 426 buf := codec.NewBuffer(b) 427 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 428 return nil 429 } 430 431 // * @brief Enable/Disable QoS marking 432 // - - enable - enable=1 or disable the feature 433 // - - mark - Marking config 434 // 435 // QosMarkEnableDisable defines message 'qos_mark_enable_disable'. 436 type QosMarkEnableDisable struct { 437 Enable bool `binapi:"bool,name=enable,default=true" json:"enable,omitempty"` 438 Mark QosMark `binapi:"qos_mark,name=mark" json:"mark,omitempty"` 439 } 440 441 func (m *QosMarkEnableDisable) Reset() { *m = QosMarkEnableDisable{} } 442 func (*QosMarkEnableDisable) GetMessageName() string { return "qos_mark_enable_disable" } 443 func (*QosMarkEnableDisable) GetCrcString() string { return "1a010f74" } 444 func (*QosMarkEnableDisable) GetMessageType() api.MessageType { 445 return api.RequestMessage 446 } 447 448 func (m *QosMarkEnableDisable) Size() (size int) { 449 if m == nil { 450 return 0 451 } 452 size += 1 // m.Enable 453 size += 4 // m.Mark.SwIfIndex 454 size += 4 // m.Mark.MapID 455 size += 1 // m.Mark.OutputSource 456 return size 457 } 458 func (m *QosMarkEnableDisable) Marshal(b []byte) ([]byte, error) { 459 if b == nil { 460 b = make([]byte, m.Size()) 461 } 462 buf := codec.NewBuffer(b) 463 buf.EncodeBool(m.Enable) 464 buf.EncodeUint32(m.Mark.SwIfIndex) 465 buf.EncodeUint32(m.Mark.MapID) 466 buf.EncodeUint8(uint8(m.Mark.OutputSource)) 467 return buf.Bytes(), nil 468 } 469 func (m *QosMarkEnableDisable) Unmarshal(b []byte) error { 470 buf := codec.NewBuffer(b) 471 m.Enable = buf.DecodeBool() 472 m.Mark.SwIfIndex = buf.DecodeUint32() 473 m.Mark.MapID = buf.DecodeUint32() 474 m.Mark.OutputSource = QosSource(buf.DecodeUint8()) 475 return nil 476 } 477 478 // QosMarkEnableDisableReply defines message 'qos_mark_enable_disable_reply'. 479 type QosMarkEnableDisableReply struct { 480 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 481 } 482 483 func (m *QosMarkEnableDisableReply) Reset() { *m = QosMarkEnableDisableReply{} } 484 func (*QosMarkEnableDisableReply) GetMessageName() string { return "qos_mark_enable_disable_reply" } 485 func (*QosMarkEnableDisableReply) GetCrcString() string { return "e8d4e804" } 486 func (*QosMarkEnableDisableReply) GetMessageType() api.MessageType { 487 return api.ReplyMessage 488 } 489 490 func (m *QosMarkEnableDisableReply) Size() (size int) { 491 if m == nil { 492 return 0 493 } 494 size += 4 // m.Retval 495 return size 496 } 497 func (m *QosMarkEnableDisableReply) Marshal(b []byte) ([]byte, error) { 498 if b == nil { 499 b = make([]byte, m.Size()) 500 } 501 buf := codec.NewBuffer(b) 502 buf.EncodeInt32(m.Retval) 503 return buf.Bytes(), nil 504 } 505 func (m *QosMarkEnableDisableReply) Unmarshal(b []byte) error { 506 buf := codec.NewBuffer(b) 507 m.Retval = buf.DecodeInt32() 508 return nil 509 } 510 511 // * Details of QoS recording configs 512 // QosRecordDetails defines message 'qos_record_details'. 513 type QosRecordDetails struct { 514 Record QosRecord `binapi:"qos_record,name=record" json:"record,omitempty"` 515 } 516 517 func (m *QosRecordDetails) Reset() { *m = QosRecordDetails{} } 518 func (*QosRecordDetails) GetMessageName() string { return "qos_record_details" } 519 func (*QosRecordDetails) GetCrcString() string { return "a425d4d3" } 520 func (*QosRecordDetails) GetMessageType() api.MessageType { 521 return api.ReplyMessage 522 } 523 524 func (m *QosRecordDetails) Size() (size int) { 525 if m == nil { 526 return 0 527 } 528 size += 4 // m.Record.SwIfIndex 529 size += 1 // m.Record.InputSource 530 return size 531 } 532 func (m *QosRecordDetails) Marshal(b []byte) ([]byte, error) { 533 if b == nil { 534 b = make([]byte, m.Size()) 535 } 536 buf := codec.NewBuffer(b) 537 buf.EncodeUint32(uint32(m.Record.SwIfIndex)) 538 buf.EncodeUint8(uint8(m.Record.InputSource)) 539 return buf.Bytes(), nil 540 } 541 func (m *QosRecordDetails) Unmarshal(b []byte) error { 542 buf := codec.NewBuffer(b) 543 m.Record.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 544 m.Record.InputSource = QosSource(buf.DecodeUint8()) 545 return nil 546 } 547 548 // * Dump the QoS record configs 549 // QosRecordDump defines message 'qos_record_dump'. 550 type QosRecordDump struct{} 551 552 func (m *QosRecordDump) Reset() { *m = QosRecordDump{} } 553 func (*QosRecordDump) GetMessageName() string { return "qos_record_dump" } 554 func (*QosRecordDump) GetCrcString() string { return "51077d14" } 555 func (*QosRecordDump) GetMessageType() api.MessageType { 556 return api.RequestMessage 557 } 558 559 func (m *QosRecordDump) Size() (size int) { 560 if m == nil { 561 return 0 562 } 563 return size 564 } 565 func (m *QosRecordDump) Marshal(b []byte) ([]byte, error) { 566 if b == nil { 567 b = make([]byte, m.Size()) 568 } 569 buf := codec.NewBuffer(b) 570 return buf.Bytes(), nil 571 } 572 func (m *QosRecordDump) Unmarshal(b []byte) error { 573 return nil 574 } 575 576 // * Enable/Disable QoS recording 577 // - The QoS bits from the packet at the specified input layer are copied 578 // - into the packet. Recording should be used in conjunction with marking 579 // - - enable - enable=1 or disable the feature 580 // - - record - Recording configuration 581 // 582 // QosRecordEnableDisable defines message 'qos_record_enable_disable'. 583 type QosRecordEnableDisable struct { 584 Enable bool `binapi:"bool,name=enable,default=true" json:"enable,omitempty"` 585 Record QosRecord `binapi:"qos_record,name=record" json:"record,omitempty"` 586 } 587 588 func (m *QosRecordEnableDisable) Reset() { *m = QosRecordEnableDisable{} } 589 func (*QosRecordEnableDisable) GetMessageName() string { return "qos_record_enable_disable" } 590 func (*QosRecordEnableDisable) GetCrcString() string { return "2f1a4a38" } 591 func (*QosRecordEnableDisable) GetMessageType() api.MessageType { 592 return api.RequestMessage 593 } 594 595 func (m *QosRecordEnableDisable) Size() (size int) { 596 if m == nil { 597 return 0 598 } 599 size += 1 // m.Enable 600 size += 4 // m.Record.SwIfIndex 601 size += 1 // m.Record.InputSource 602 return size 603 } 604 func (m *QosRecordEnableDisable) Marshal(b []byte) ([]byte, error) { 605 if b == nil { 606 b = make([]byte, m.Size()) 607 } 608 buf := codec.NewBuffer(b) 609 buf.EncodeBool(m.Enable) 610 buf.EncodeUint32(uint32(m.Record.SwIfIndex)) 611 buf.EncodeUint8(uint8(m.Record.InputSource)) 612 return buf.Bytes(), nil 613 } 614 func (m *QosRecordEnableDisable) Unmarshal(b []byte) error { 615 buf := codec.NewBuffer(b) 616 m.Enable = buf.DecodeBool() 617 m.Record.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 618 m.Record.InputSource = QosSource(buf.DecodeUint8()) 619 return nil 620 } 621 622 // QosRecordEnableDisableReply defines message 'qos_record_enable_disable_reply'. 623 type QosRecordEnableDisableReply struct { 624 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 625 } 626 627 func (m *QosRecordEnableDisableReply) Reset() { *m = QosRecordEnableDisableReply{} } 628 func (*QosRecordEnableDisableReply) GetMessageName() string { return "qos_record_enable_disable_reply" } 629 func (*QosRecordEnableDisableReply) GetCrcString() string { return "e8d4e804" } 630 func (*QosRecordEnableDisableReply) GetMessageType() api.MessageType { 631 return api.ReplyMessage 632 } 633 634 func (m *QosRecordEnableDisableReply) Size() (size int) { 635 if m == nil { 636 return 0 637 } 638 size += 4 // m.Retval 639 return size 640 } 641 func (m *QosRecordEnableDisableReply) Marshal(b []byte) ([]byte, error) { 642 if b == nil { 643 b = make([]byte, m.Size()) 644 } 645 buf := codec.NewBuffer(b) 646 buf.EncodeInt32(m.Retval) 647 return buf.Bytes(), nil 648 } 649 func (m *QosRecordEnableDisableReply) Unmarshal(b []byte) error { 650 buf := codec.NewBuffer(b) 651 m.Retval = buf.DecodeInt32() 652 return nil 653 } 654 655 // * Details of QoS recording configs 656 // QosStoreDetails defines message 'qos_store_details'. 657 type QosStoreDetails struct { 658 Store QosStore `binapi:"qos_store,name=store" json:"store,omitempty"` 659 } 660 661 func (m *QosStoreDetails) Reset() { *m = QosStoreDetails{} } 662 func (*QosStoreDetails) GetMessageName() string { return "qos_store_details" } 663 func (*QosStoreDetails) GetCrcString() string { return "3ee0aad7" } 664 func (*QosStoreDetails) GetMessageType() api.MessageType { 665 return api.ReplyMessage 666 } 667 668 func (m *QosStoreDetails) Size() (size int) { 669 if m == nil { 670 return 0 671 } 672 size += 4 // m.Store.SwIfIndex 673 size += 1 // m.Store.InputSource 674 size += 1 // m.Store.Value 675 return size 676 } 677 func (m *QosStoreDetails) Marshal(b []byte) ([]byte, error) { 678 if b == nil { 679 b = make([]byte, m.Size()) 680 } 681 buf := codec.NewBuffer(b) 682 buf.EncodeUint32(uint32(m.Store.SwIfIndex)) 683 buf.EncodeUint8(uint8(m.Store.InputSource)) 684 buf.EncodeUint8(m.Store.Value) 685 return buf.Bytes(), nil 686 } 687 func (m *QosStoreDetails) Unmarshal(b []byte) error { 688 buf := codec.NewBuffer(b) 689 m.Store.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 690 m.Store.InputSource = QosSource(buf.DecodeUint8()) 691 m.Store.Value = buf.DecodeUint8() 692 return nil 693 } 694 695 // * Dump the QoS store configs 696 // QosStoreDump defines message 'qos_store_dump'. 697 type QosStoreDump struct{} 698 699 func (m *QosStoreDump) Reset() { *m = QosStoreDump{} } 700 func (*QosStoreDump) GetMessageName() string { return "qos_store_dump" } 701 func (*QosStoreDump) GetCrcString() string { return "51077d14" } 702 func (*QosStoreDump) GetMessageType() api.MessageType { 703 return api.RequestMessage 704 } 705 706 func (m *QosStoreDump) Size() (size int) { 707 if m == nil { 708 return 0 709 } 710 return size 711 } 712 func (m *QosStoreDump) Marshal(b []byte) ([]byte, error) { 713 if b == nil { 714 b = make([]byte, m.Size()) 715 } 716 buf := codec.NewBuffer(b) 717 return buf.Bytes(), nil 718 } 719 func (m *QosStoreDump) Unmarshal(b []byte) error { 720 return nil 721 } 722 723 // * Enable/Disable QoS storing 724 // - The QoS bits from the packet at the specified input layer are copied 725 // - into the packet. Storing should be used in conjunction with marking 726 // - - enable - enable=1 or disable the feature 727 // - - store - Store configuration 728 // 729 // QosStoreEnableDisable defines message 'qos_store_enable_disable'. 730 type QosStoreEnableDisable struct { 731 Enable bool `binapi:"bool,name=enable,default=true" json:"enable,omitempty"` 732 Store QosStore `binapi:"qos_store,name=store" json:"store,omitempty"` 733 } 734 735 func (m *QosStoreEnableDisable) Reset() { *m = QosStoreEnableDisable{} } 736 func (*QosStoreEnableDisable) GetMessageName() string { return "qos_store_enable_disable" } 737 func (*QosStoreEnableDisable) GetCrcString() string { return "f3abcc8b" } 738 func (*QosStoreEnableDisable) GetMessageType() api.MessageType { 739 return api.RequestMessage 740 } 741 742 func (m *QosStoreEnableDisable) Size() (size int) { 743 if m == nil { 744 return 0 745 } 746 size += 1 // m.Enable 747 size += 4 // m.Store.SwIfIndex 748 size += 1 // m.Store.InputSource 749 size += 1 // m.Store.Value 750 return size 751 } 752 func (m *QosStoreEnableDisable) Marshal(b []byte) ([]byte, error) { 753 if b == nil { 754 b = make([]byte, m.Size()) 755 } 756 buf := codec.NewBuffer(b) 757 buf.EncodeBool(m.Enable) 758 buf.EncodeUint32(uint32(m.Store.SwIfIndex)) 759 buf.EncodeUint8(uint8(m.Store.InputSource)) 760 buf.EncodeUint8(m.Store.Value) 761 return buf.Bytes(), nil 762 } 763 func (m *QosStoreEnableDisable) Unmarshal(b []byte) error { 764 buf := codec.NewBuffer(b) 765 m.Enable = buf.DecodeBool() 766 m.Store.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 767 m.Store.InputSource = QosSource(buf.DecodeUint8()) 768 m.Store.Value = buf.DecodeUint8() 769 return nil 770 } 771 772 // QosStoreEnableDisableReply defines message 'qos_store_enable_disable_reply'. 773 type QosStoreEnableDisableReply struct { 774 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 775 } 776 777 func (m *QosStoreEnableDisableReply) Reset() { *m = QosStoreEnableDisableReply{} } 778 func (*QosStoreEnableDisableReply) GetMessageName() string { return "qos_store_enable_disable_reply" } 779 func (*QosStoreEnableDisableReply) GetCrcString() string { return "e8d4e804" } 780 func (*QosStoreEnableDisableReply) GetMessageType() api.MessageType { 781 return api.ReplyMessage 782 } 783 784 func (m *QosStoreEnableDisableReply) Size() (size int) { 785 if m == nil { 786 return 0 787 } 788 size += 4 // m.Retval 789 return size 790 } 791 func (m *QosStoreEnableDisableReply) Marshal(b []byte) ([]byte, error) { 792 if b == nil { 793 b = make([]byte, m.Size()) 794 } 795 buf := codec.NewBuffer(b) 796 buf.EncodeInt32(m.Retval) 797 return buf.Bytes(), nil 798 } 799 func (m *QosStoreEnableDisableReply) Unmarshal(b []byte) error { 800 buf := codec.NewBuffer(b) 801 m.Retval = buf.DecodeInt32() 802 return nil 803 } 804 805 func init() { file_qos_binapi_init() } 806 func file_qos_binapi_init() { 807 api.RegisterMessage((*QosEgressMapDelete)(nil), "qos_egress_map_delete_3a91bde5") 808 api.RegisterMessage((*QosEgressMapDeleteReply)(nil), "qos_egress_map_delete_reply_e8d4e804") 809 api.RegisterMessage((*QosEgressMapDetails)(nil), "qos_egress_map_details_46c5653c") 810 api.RegisterMessage((*QosEgressMapDump)(nil), "qos_egress_map_dump_51077d14") 811 api.RegisterMessage((*QosEgressMapUpdate)(nil), "qos_egress_map_update_6d1c065f") 812 api.RegisterMessage((*QosEgressMapUpdateReply)(nil), "qos_egress_map_update_reply_e8d4e804") 813 api.RegisterMessage((*QosMarkDetails)(nil), "qos_mark_details_89fe81a9") 814 api.RegisterMessage((*QosMarkDetailsReply)(nil), "qos_mark_details_reply_e8d4e804") 815 api.RegisterMessage((*QosMarkDump)(nil), "qos_mark_dump_f9e6675e") 816 api.RegisterMessage((*QosMarkEnableDisable)(nil), "qos_mark_enable_disable_1a010f74") 817 api.RegisterMessage((*QosMarkEnableDisableReply)(nil), "qos_mark_enable_disable_reply_e8d4e804") 818 api.RegisterMessage((*QosRecordDetails)(nil), "qos_record_details_a425d4d3") 819 api.RegisterMessage((*QosRecordDump)(nil), "qos_record_dump_51077d14") 820 api.RegisterMessage((*QosRecordEnableDisable)(nil), "qos_record_enable_disable_2f1a4a38") 821 api.RegisterMessage((*QosRecordEnableDisableReply)(nil), "qos_record_enable_disable_reply_e8d4e804") 822 api.RegisterMessage((*QosStoreDetails)(nil), "qos_store_details_3ee0aad7") 823 api.RegisterMessage((*QosStoreDump)(nil), "qos_store_dump_51077d14") 824 api.RegisterMessage((*QosStoreEnableDisable)(nil), "qos_store_enable_disable_f3abcc8b") 825 api.RegisterMessage((*QosStoreEnableDisableReply)(nil), "qos_store_enable_disable_reply_e8d4e804") 826 } 827 828 // Messages returns list of all messages in this module. 829 func AllMessages() []api.Message { 830 return []api.Message{ 831 (*QosEgressMapDelete)(nil), 832 (*QosEgressMapDeleteReply)(nil), 833 (*QosEgressMapDetails)(nil), 834 (*QosEgressMapDump)(nil), 835 (*QosEgressMapUpdate)(nil), 836 (*QosEgressMapUpdateReply)(nil), 837 (*QosMarkDetails)(nil), 838 (*QosMarkDetailsReply)(nil), 839 (*QosMarkDump)(nil), 840 (*QosMarkEnableDisable)(nil), 841 (*QosMarkEnableDisableReply)(nil), 842 (*QosRecordDetails)(nil), 843 (*QosRecordDump)(nil), 844 (*QosRecordEnableDisable)(nil), 845 (*QosRecordEnableDisableReply)(nil), 846 (*QosStoreDetails)(nil), 847 (*QosStoreDump)(nil), 848 (*QosStoreEnableDisable)(nil), 849 (*QosStoreEnableDisableReply)(nil), 850 } 851 }