github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/bond/bond.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/bond.api.json 6 7 // Package bond contains generated bindings for API file bond.api. 8 // 9 // Contents: 10 // - 2 enums 11 // - 24 messages 12 package bond 13 14 import ( 15 "strconv" 16 17 ethernet_types "github.com/networkservicemesh/govpp/binapi/ethernet_types" 18 interface_types "github.com/networkservicemesh/govpp/binapi/interface_types" 19 api "go.fd.io/govpp/api" 20 codec "go.fd.io/govpp/codec" 21 ) 22 23 // This is a compile-time assertion to ensure that this generated file 24 // is compatible with the GoVPP api package it is being compiled against. 25 // A compilation error at this line likely means your copy of the 26 // GoVPP api package needs to be updated. 27 const _ = api.GoVppAPIPackageIsVersion2 28 29 const ( 30 APIFile = "bond" 31 APIVersion = "2.1.0" 32 VersionCrc = 0xa03f5330 33 ) 34 35 // BondLbAlgo defines enum 'bond_lb_algo'. 36 type BondLbAlgo uint32 37 38 const ( 39 BOND_API_LB_ALGO_L2 BondLbAlgo = 0 40 BOND_API_LB_ALGO_L34 BondLbAlgo = 1 41 BOND_API_LB_ALGO_L23 BondLbAlgo = 2 42 BOND_API_LB_ALGO_RR BondLbAlgo = 3 43 BOND_API_LB_ALGO_BC BondLbAlgo = 4 44 BOND_API_LB_ALGO_AB BondLbAlgo = 5 45 ) 46 47 var ( 48 BondLbAlgo_name = map[uint32]string{ 49 0: "BOND_API_LB_ALGO_L2", 50 1: "BOND_API_LB_ALGO_L34", 51 2: "BOND_API_LB_ALGO_L23", 52 3: "BOND_API_LB_ALGO_RR", 53 4: "BOND_API_LB_ALGO_BC", 54 5: "BOND_API_LB_ALGO_AB", 55 } 56 BondLbAlgo_value = map[string]uint32{ 57 "BOND_API_LB_ALGO_L2": 0, 58 "BOND_API_LB_ALGO_L34": 1, 59 "BOND_API_LB_ALGO_L23": 2, 60 "BOND_API_LB_ALGO_RR": 3, 61 "BOND_API_LB_ALGO_BC": 4, 62 "BOND_API_LB_ALGO_AB": 5, 63 } 64 ) 65 66 func (x BondLbAlgo) String() string { 67 s, ok := BondLbAlgo_name[uint32(x)] 68 if ok { 69 return s 70 } 71 return "BondLbAlgo(" + strconv.Itoa(int(x)) + ")" 72 } 73 74 // BondMode defines enum 'bond_mode'. 75 type BondMode uint32 76 77 const ( 78 BOND_API_MODE_ROUND_ROBIN BondMode = 1 79 BOND_API_MODE_ACTIVE_BACKUP BondMode = 2 80 BOND_API_MODE_XOR BondMode = 3 81 BOND_API_MODE_BROADCAST BondMode = 4 82 BOND_API_MODE_LACP BondMode = 5 83 ) 84 85 var ( 86 BondMode_name = map[uint32]string{ 87 1: "BOND_API_MODE_ROUND_ROBIN", 88 2: "BOND_API_MODE_ACTIVE_BACKUP", 89 3: "BOND_API_MODE_XOR", 90 4: "BOND_API_MODE_BROADCAST", 91 5: "BOND_API_MODE_LACP", 92 } 93 BondMode_value = map[string]uint32{ 94 "BOND_API_MODE_ROUND_ROBIN": 1, 95 "BOND_API_MODE_ACTIVE_BACKUP": 2, 96 "BOND_API_MODE_XOR": 3, 97 "BOND_API_MODE_BROADCAST": 4, 98 "BOND_API_MODE_LACP": 5, 99 } 100 ) 101 102 func (x BondMode) String() string { 103 s, ok := BondMode_name[uint32(x)] 104 if ok { 105 return s 106 } 107 return "BondMode(" + strconv.Itoa(int(x)) + ")" 108 } 109 110 // Initialize a new bond interface with the given paramters 111 // - sw_if_index - member sw_if_index 112 // - bond_sw_if_index - bond sw_if_index 113 // - is_passive - interface does not initiate the lacp protocol, remote must be active speaker 114 // - is_long_timeout - 90 seconds vs default 3 seconds neighbor timeout 115 // 116 // BondAddMember defines message 'bond_add_member'. 117 type BondAddMember struct { 118 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 119 BondSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=bond_sw_if_index" json:"bond_sw_if_index,omitempty"` 120 IsPassive bool `binapi:"bool,name=is_passive" json:"is_passive,omitempty"` 121 IsLongTimeout bool `binapi:"bool,name=is_long_timeout" json:"is_long_timeout,omitempty"` 122 } 123 124 func (m *BondAddMember) Reset() { *m = BondAddMember{} } 125 func (*BondAddMember) GetMessageName() string { return "bond_add_member" } 126 func (*BondAddMember) GetCrcString() string { return "e7d14948" } 127 func (*BondAddMember) GetMessageType() api.MessageType { 128 return api.RequestMessage 129 } 130 131 func (m *BondAddMember) Size() (size int) { 132 if m == nil { 133 return 0 134 } 135 size += 4 // m.SwIfIndex 136 size += 4 // m.BondSwIfIndex 137 size += 1 // m.IsPassive 138 size += 1 // m.IsLongTimeout 139 return size 140 } 141 func (m *BondAddMember) Marshal(b []byte) ([]byte, error) { 142 if b == nil { 143 b = make([]byte, m.Size()) 144 } 145 buf := codec.NewBuffer(b) 146 buf.EncodeUint32(uint32(m.SwIfIndex)) 147 buf.EncodeUint32(uint32(m.BondSwIfIndex)) 148 buf.EncodeBool(m.IsPassive) 149 buf.EncodeBool(m.IsLongTimeout) 150 return buf.Bytes(), nil 151 } 152 func (m *BondAddMember) Unmarshal(b []byte) error { 153 buf := codec.NewBuffer(b) 154 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 155 m.BondSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 156 m.IsPassive = buf.DecodeBool() 157 m.IsLongTimeout = buf.DecodeBool() 158 return nil 159 } 160 161 // Reply for bond add_member reply 162 // - retval - return code 163 // 164 // BondAddMemberReply defines message 'bond_add_member_reply'. 165 type BondAddMemberReply struct { 166 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 167 } 168 169 func (m *BondAddMemberReply) Reset() { *m = BondAddMemberReply{} } 170 func (*BondAddMemberReply) GetMessageName() string { return "bond_add_member_reply" } 171 func (*BondAddMemberReply) GetCrcString() string { return "e8d4e804" } 172 func (*BondAddMemberReply) GetMessageType() api.MessageType { 173 return api.ReplyMessage 174 } 175 176 func (m *BondAddMemberReply) Size() (size int) { 177 if m == nil { 178 return 0 179 } 180 size += 4 // m.Retval 181 return size 182 } 183 func (m *BondAddMemberReply) Marshal(b []byte) ([]byte, error) { 184 if b == nil { 185 b = make([]byte, m.Size()) 186 } 187 buf := codec.NewBuffer(b) 188 buf.EncodeInt32(m.Retval) 189 return buf.Bytes(), nil 190 } 191 func (m *BondAddMemberReply) Unmarshal(b []byte) error { 192 buf := codec.NewBuffer(b) 193 m.Retval = buf.DecodeInt32() 194 return nil 195 } 196 197 // Initialize a new bond interface with the given paramters 198 // - id - if non-~0, specifies a custom interface ID 199 // - use_custom_mac - if set, mac_address is valid 200 // - mac_address - mac addr to assign to the interface if use_custom_mac is set 201 // - mode - mode, required (1=round-robin, 2=active-backup, 3=xor, 4=broadcast, 5=lacp) 202 // - lb - load balance, optional (0=l2, 1=l34, 2=l23) valid for xor and lacp modes. Otherwise ignored 203 // - numa_only - if numa_only is set, pkts will be transmitted by LAG members on local numa node only if have at least one, otherwise it works as usual. 204 // 205 // BondCreate defines message 'bond_create'. 206 // Deprecated: the message will be removed in the future versions 207 type BondCreate struct { 208 ID uint32 `binapi:"u32,name=id,default=4294967295" json:"id,omitempty"` 209 UseCustomMac bool `binapi:"bool,name=use_custom_mac" json:"use_custom_mac,omitempty"` 210 MacAddress ethernet_types.MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"` 211 Mode BondMode `binapi:"bond_mode,name=mode" json:"mode,omitempty"` 212 Lb BondLbAlgo `binapi:"bond_lb_algo,name=lb" json:"lb,omitempty"` 213 NumaOnly bool `binapi:"bool,name=numa_only" json:"numa_only,omitempty"` 214 } 215 216 func (m *BondCreate) Reset() { *m = BondCreate{} } 217 func (*BondCreate) GetMessageName() string { return "bond_create" } 218 func (*BondCreate) GetCrcString() string { return "f1dbd4ff" } 219 func (*BondCreate) GetMessageType() api.MessageType { 220 return api.RequestMessage 221 } 222 223 func (m *BondCreate) Size() (size int) { 224 if m == nil { 225 return 0 226 } 227 size += 4 // m.ID 228 size += 1 // m.UseCustomMac 229 size += 1 * 6 // m.MacAddress 230 size += 4 // m.Mode 231 size += 4 // m.Lb 232 size += 1 // m.NumaOnly 233 return size 234 } 235 func (m *BondCreate) Marshal(b []byte) ([]byte, error) { 236 if b == nil { 237 b = make([]byte, m.Size()) 238 } 239 buf := codec.NewBuffer(b) 240 buf.EncodeUint32(m.ID) 241 buf.EncodeBool(m.UseCustomMac) 242 buf.EncodeBytes(m.MacAddress[:], 6) 243 buf.EncodeUint32(uint32(m.Mode)) 244 buf.EncodeUint32(uint32(m.Lb)) 245 buf.EncodeBool(m.NumaOnly) 246 return buf.Bytes(), nil 247 } 248 func (m *BondCreate) Unmarshal(b []byte) error { 249 buf := codec.NewBuffer(b) 250 m.ID = buf.DecodeUint32() 251 m.UseCustomMac = buf.DecodeBool() 252 copy(m.MacAddress[:], buf.DecodeBytes(6)) 253 m.Mode = BondMode(buf.DecodeUint32()) 254 m.Lb = BondLbAlgo(buf.DecodeUint32()) 255 m.NumaOnly = buf.DecodeBool() 256 return nil 257 } 258 259 // Initialize a new bond interface with the given paramters 260 // - mode - mode, required (1=round-robin, 2=active-backup, 3=xor, 4=broadcast, 5=lacp) 261 // - lb - load balance, optional (0=l2, 1=l34, 2=l23) valid for xor and lacp modes. Otherwise ignored (default=l2) 262 // - numa_only - if numa_only is set, pkts will be transmitted by LAG members on local numa node only if have at least one, otherwise it works as usual. 263 // - enable_gso - enable gso support (default 0) 264 // - use_custom_mac - if set, mac_address is valid 265 // - mac_address - mac addr to assign to the interface if use_custom_mac is set 266 // - id - if non-~0, specifies a custom interface ID (default=0xFFFFFFFF) 267 // 268 // BondCreate2 defines message 'bond_create2'. 269 type BondCreate2 struct { 270 Mode BondMode `binapi:"bond_mode,name=mode" json:"mode,omitempty"` 271 Lb BondLbAlgo `binapi:"bond_lb_algo,name=lb" json:"lb,omitempty"` 272 NumaOnly bool `binapi:"bool,name=numa_only" json:"numa_only,omitempty"` 273 EnableGso bool `binapi:"bool,name=enable_gso" json:"enable_gso,omitempty"` 274 UseCustomMac bool `binapi:"bool,name=use_custom_mac" json:"use_custom_mac,omitempty"` 275 MacAddress ethernet_types.MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"` 276 ID uint32 `binapi:"u32,name=id,default=4294967295" json:"id,omitempty"` 277 } 278 279 func (m *BondCreate2) Reset() { *m = BondCreate2{} } 280 func (*BondCreate2) GetMessageName() string { return "bond_create2" } 281 func (*BondCreate2) GetCrcString() string { return "912fda76" } 282 func (*BondCreate2) GetMessageType() api.MessageType { 283 return api.RequestMessage 284 } 285 286 func (m *BondCreate2) Size() (size int) { 287 if m == nil { 288 return 0 289 } 290 size += 4 // m.Mode 291 size += 4 // m.Lb 292 size += 1 // m.NumaOnly 293 size += 1 // m.EnableGso 294 size += 1 // m.UseCustomMac 295 size += 1 * 6 // m.MacAddress 296 size += 4 // m.ID 297 return size 298 } 299 func (m *BondCreate2) Marshal(b []byte) ([]byte, error) { 300 if b == nil { 301 b = make([]byte, m.Size()) 302 } 303 buf := codec.NewBuffer(b) 304 buf.EncodeUint32(uint32(m.Mode)) 305 buf.EncodeUint32(uint32(m.Lb)) 306 buf.EncodeBool(m.NumaOnly) 307 buf.EncodeBool(m.EnableGso) 308 buf.EncodeBool(m.UseCustomMac) 309 buf.EncodeBytes(m.MacAddress[:], 6) 310 buf.EncodeUint32(m.ID) 311 return buf.Bytes(), nil 312 } 313 func (m *BondCreate2) Unmarshal(b []byte) error { 314 buf := codec.NewBuffer(b) 315 m.Mode = BondMode(buf.DecodeUint32()) 316 m.Lb = BondLbAlgo(buf.DecodeUint32()) 317 m.NumaOnly = buf.DecodeBool() 318 m.EnableGso = buf.DecodeBool() 319 m.UseCustomMac = buf.DecodeBool() 320 copy(m.MacAddress[:], buf.DecodeBytes(6)) 321 m.ID = buf.DecodeUint32() 322 return nil 323 } 324 325 // Reply for bond create2 reply 326 // - retval - return code 327 // - sw_if_index - software index allocated for the new tap interface 328 // 329 // BondCreate2Reply defines message 'bond_create2_reply'. 330 type BondCreate2Reply struct { 331 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 332 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 333 } 334 335 func (m *BondCreate2Reply) Reset() { *m = BondCreate2Reply{} } 336 func (*BondCreate2Reply) GetMessageName() string { return "bond_create2_reply" } 337 func (*BondCreate2Reply) GetCrcString() string { return "5383d31f" } 338 func (*BondCreate2Reply) GetMessageType() api.MessageType { 339 return api.ReplyMessage 340 } 341 342 func (m *BondCreate2Reply) Size() (size int) { 343 if m == nil { 344 return 0 345 } 346 size += 4 // m.Retval 347 size += 4 // m.SwIfIndex 348 return size 349 } 350 func (m *BondCreate2Reply) Marshal(b []byte) ([]byte, error) { 351 if b == nil { 352 b = make([]byte, m.Size()) 353 } 354 buf := codec.NewBuffer(b) 355 buf.EncodeInt32(m.Retval) 356 buf.EncodeUint32(uint32(m.SwIfIndex)) 357 return buf.Bytes(), nil 358 } 359 func (m *BondCreate2Reply) Unmarshal(b []byte) error { 360 buf := codec.NewBuffer(b) 361 m.Retval = buf.DecodeInt32() 362 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 363 return nil 364 } 365 366 // Reply for bond create reply 367 // - retval - return code 368 // - sw_if_index - software index allocated for the new tap interface 369 // 370 // BondCreateReply defines message 'bond_create_reply'. 371 type BondCreateReply struct { 372 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 373 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 374 } 375 376 func (m *BondCreateReply) Reset() { *m = BondCreateReply{} } 377 func (*BondCreateReply) GetMessageName() string { return "bond_create_reply" } 378 func (*BondCreateReply) GetCrcString() string { return "5383d31f" } 379 func (*BondCreateReply) GetMessageType() api.MessageType { 380 return api.ReplyMessage 381 } 382 383 func (m *BondCreateReply) Size() (size int) { 384 if m == nil { 385 return 0 386 } 387 size += 4 // m.Retval 388 size += 4 // m.SwIfIndex 389 return size 390 } 391 func (m *BondCreateReply) Marshal(b []byte) ([]byte, error) { 392 if b == nil { 393 b = make([]byte, m.Size()) 394 } 395 buf := codec.NewBuffer(b) 396 buf.EncodeInt32(m.Retval) 397 buf.EncodeUint32(uint32(m.SwIfIndex)) 398 return buf.Bytes(), nil 399 } 400 func (m *BondCreateReply) Unmarshal(b []byte) error { 401 buf := codec.NewBuffer(b) 402 m.Retval = buf.DecodeInt32() 403 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 404 return nil 405 } 406 407 // Delete bond interface 408 // - sw_if_index - interface index of member interface 409 // 410 // BondDelete defines message 'bond_delete'. 411 type BondDelete struct { 412 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 413 } 414 415 func (m *BondDelete) Reset() { *m = BondDelete{} } 416 func (*BondDelete) GetMessageName() string { return "bond_delete" } 417 func (*BondDelete) GetCrcString() string { return "f9e6675e" } 418 func (*BondDelete) GetMessageType() api.MessageType { 419 return api.RequestMessage 420 } 421 422 func (m *BondDelete) Size() (size int) { 423 if m == nil { 424 return 0 425 } 426 size += 4 // m.SwIfIndex 427 return size 428 } 429 func (m *BondDelete) Marshal(b []byte) ([]byte, error) { 430 if b == nil { 431 b = make([]byte, m.Size()) 432 } 433 buf := codec.NewBuffer(b) 434 buf.EncodeUint32(uint32(m.SwIfIndex)) 435 return buf.Bytes(), nil 436 } 437 func (m *BondDelete) Unmarshal(b []byte) error { 438 buf := codec.NewBuffer(b) 439 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 440 return nil 441 } 442 443 // BondDeleteReply defines message 'bond_delete_reply'. 444 type BondDeleteReply struct { 445 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 446 } 447 448 func (m *BondDeleteReply) Reset() { *m = BondDeleteReply{} } 449 func (*BondDeleteReply) GetMessageName() string { return "bond_delete_reply" } 450 func (*BondDeleteReply) GetCrcString() string { return "e8d4e804" } 451 func (*BondDeleteReply) GetMessageType() api.MessageType { 452 return api.ReplyMessage 453 } 454 455 func (m *BondDeleteReply) Size() (size int) { 456 if m == nil { 457 return 0 458 } 459 size += 4 // m.Retval 460 return size 461 } 462 func (m *BondDeleteReply) Marshal(b []byte) ([]byte, error) { 463 if b == nil { 464 b = make([]byte, m.Size()) 465 } 466 buf := codec.NewBuffer(b) 467 buf.EncodeInt32(m.Retval) 468 return buf.Bytes(), nil 469 } 470 func (m *BondDeleteReply) Unmarshal(b []byte) error { 471 buf := codec.NewBuffer(b) 472 m.Retval = buf.DecodeInt32() 473 return nil 474 } 475 476 // bond detach member 477 // - sw_if_index - interface index of member interface 478 // 479 // BondDetachMember defines message 'bond_detach_member'. 480 type BondDetachMember struct { 481 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 482 } 483 484 func (m *BondDetachMember) Reset() { *m = BondDetachMember{} } 485 func (*BondDetachMember) GetMessageName() string { return "bond_detach_member" } 486 func (*BondDetachMember) GetCrcString() string { return "f9e6675e" } 487 func (*BondDetachMember) GetMessageType() api.MessageType { 488 return api.RequestMessage 489 } 490 491 func (m *BondDetachMember) Size() (size int) { 492 if m == nil { 493 return 0 494 } 495 size += 4 // m.SwIfIndex 496 return size 497 } 498 func (m *BondDetachMember) Marshal(b []byte) ([]byte, error) { 499 if b == nil { 500 b = make([]byte, m.Size()) 501 } 502 buf := codec.NewBuffer(b) 503 buf.EncodeUint32(uint32(m.SwIfIndex)) 504 return buf.Bytes(), nil 505 } 506 func (m *BondDetachMember) Unmarshal(b []byte) error { 507 buf := codec.NewBuffer(b) 508 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 509 return nil 510 } 511 512 // BondDetachMemberReply defines message 'bond_detach_member_reply'. 513 type BondDetachMemberReply struct { 514 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 515 } 516 517 func (m *BondDetachMemberReply) Reset() { *m = BondDetachMemberReply{} } 518 func (*BondDetachMemberReply) GetMessageName() string { return "bond_detach_member_reply" } 519 func (*BondDetachMemberReply) GetCrcString() string { return "e8d4e804" } 520 func (*BondDetachMemberReply) GetMessageType() api.MessageType { 521 return api.ReplyMessage 522 } 523 524 func (m *BondDetachMemberReply) Size() (size int) { 525 if m == nil { 526 return 0 527 } 528 size += 4 // m.Retval 529 return size 530 } 531 func (m *BondDetachMemberReply) Marshal(b []byte) ([]byte, error) { 532 if b == nil { 533 b = make([]byte, m.Size()) 534 } 535 buf := codec.NewBuffer(b) 536 buf.EncodeInt32(m.Retval) 537 return buf.Bytes(), nil 538 } 539 func (m *BondDetachMemberReply) Unmarshal(b []byte) error { 540 buf := codec.NewBuffer(b) 541 m.Retval = buf.DecodeInt32() 542 return nil 543 } 544 545 // bond detach slave 546 // - sw_if_index - interface index of member interface 547 // 548 // BondDetachSlave defines message 'bond_detach_slave'. 549 // Deprecated: the message will be removed in the future versions 550 type BondDetachSlave struct { 551 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 552 } 553 554 func (m *BondDetachSlave) Reset() { *m = BondDetachSlave{} } 555 func (*BondDetachSlave) GetMessageName() string { return "bond_detach_slave" } 556 func (*BondDetachSlave) GetCrcString() string { return "f9e6675e" } 557 func (*BondDetachSlave) GetMessageType() api.MessageType { 558 return api.RequestMessage 559 } 560 561 func (m *BondDetachSlave) Size() (size int) { 562 if m == nil { 563 return 0 564 } 565 size += 4 // m.SwIfIndex 566 return size 567 } 568 func (m *BondDetachSlave) Marshal(b []byte) ([]byte, error) { 569 if b == nil { 570 b = make([]byte, m.Size()) 571 } 572 buf := codec.NewBuffer(b) 573 buf.EncodeUint32(uint32(m.SwIfIndex)) 574 return buf.Bytes(), nil 575 } 576 func (m *BondDetachSlave) Unmarshal(b []byte) error { 577 buf := codec.NewBuffer(b) 578 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 579 return nil 580 } 581 582 // BondDetachSlaveReply defines message 'bond_detach_slave_reply'. 583 // Deprecated: the message will be removed in the future versions 584 type BondDetachSlaveReply struct { 585 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 586 } 587 588 func (m *BondDetachSlaveReply) Reset() { *m = BondDetachSlaveReply{} } 589 func (*BondDetachSlaveReply) GetMessageName() string { return "bond_detach_slave_reply" } 590 func (*BondDetachSlaveReply) GetCrcString() string { return "e8d4e804" } 591 func (*BondDetachSlaveReply) GetMessageType() api.MessageType { 592 return api.ReplyMessage 593 } 594 595 func (m *BondDetachSlaveReply) Size() (size int) { 596 if m == nil { 597 return 0 598 } 599 size += 4 // m.Retval 600 return size 601 } 602 func (m *BondDetachSlaveReply) Marshal(b []byte) ([]byte, error) { 603 if b == nil { 604 b = make([]byte, m.Size()) 605 } 606 buf := codec.NewBuffer(b) 607 buf.EncodeInt32(m.Retval) 608 return buf.Bytes(), nil 609 } 610 func (m *BondDetachSlaveReply) Unmarshal(b []byte) error { 611 buf := codec.NewBuffer(b) 612 m.Retval = buf.DecodeInt32() 613 return nil 614 } 615 616 // Initialize a new bond interface with the given paramters 617 // - sw_if_index - slave sw_if_index 618 // - bond_sw_if_index - bond sw_if_index 619 // - is_passive - interface does not initiate the lacp protocol, remote must be active speaker 620 // - is_long_timeout - 90 seconds vs default 3 seconds neighbor timeout 621 // 622 // BondEnslave defines message 'bond_enslave'. 623 // Deprecated: the message will be removed in the future versions 624 type BondEnslave struct { 625 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 626 BondSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=bond_sw_if_index" json:"bond_sw_if_index,omitempty"` 627 IsPassive bool `binapi:"bool,name=is_passive" json:"is_passive,omitempty"` 628 IsLongTimeout bool `binapi:"bool,name=is_long_timeout" json:"is_long_timeout,omitempty"` 629 } 630 631 func (m *BondEnslave) Reset() { *m = BondEnslave{} } 632 func (*BondEnslave) GetMessageName() string { return "bond_enslave" } 633 func (*BondEnslave) GetCrcString() string { return "e7d14948" } 634 func (*BondEnslave) GetMessageType() api.MessageType { 635 return api.RequestMessage 636 } 637 638 func (m *BondEnslave) Size() (size int) { 639 if m == nil { 640 return 0 641 } 642 size += 4 // m.SwIfIndex 643 size += 4 // m.BondSwIfIndex 644 size += 1 // m.IsPassive 645 size += 1 // m.IsLongTimeout 646 return size 647 } 648 func (m *BondEnslave) Marshal(b []byte) ([]byte, error) { 649 if b == nil { 650 b = make([]byte, m.Size()) 651 } 652 buf := codec.NewBuffer(b) 653 buf.EncodeUint32(uint32(m.SwIfIndex)) 654 buf.EncodeUint32(uint32(m.BondSwIfIndex)) 655 buf.EncodeBool(m.IsPassive) 656 buf.EncodeBool(m.IsLongTimeout) 657 return buf.Bytes(), nil 658 } 659 func (m *BondEnslave) Unmarshal(b []byte) error { 660 buf := codec.NewBuffer(b) 661 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 662 m.BondSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 663 m.IsPassive = buf.DecodeBool() 664 m.IsLongTimeout = buf.DecodeBool() 665 return nil 666 } 667 668 // Reply for bond enslave reply 669 // - retval - return code 670 // 671 // BondEnslaveReply defines message 'bond_enslave_reply'. 672 type BondEnslaveReply struct { 673 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 674 } 675 676 func (m *BondEnslaveReply) Reset() { *m = BondEnslaveReply{} } 677 func (*BondEnslaveReply) GetMessageName() string { return "bond_enslave_reply" } 678 func (*BondEnslaveReply) GetCrcString() string { return "e8d4e804" } 679 func (*BondEnslaveReply) GetMessageType() api.MessageType { 680 return api.ReplyMessage 681 } 682 683 func (m *BondEnslaveReply) Size() (size int) { 684 if m == nil { 685 return 0 686 } 687 size += 4 // m.Retval 688 return size 689 } 690 func (m *BondEnslaveReply) Marshal(b []byte) ([]byte, error) { 691 if b == nil { 692 b = make([]byte, m.Size()) 693 } 694 buf := codec.NewBuffer(b) 695 buf.EncodeInt32(m.Retval) 696 return buf.Bytes(), nil 697 } 698 func (m *BondEnslaveReply) Unmarshal(b []byte) error { 699 buf := codec.NewBuffer(b) 700 m.Retval = buf.DecodeInt32() 701 return nil 702 } 703 704 // Reply for bond dump request 705 // - sw_if_index - software index of bond interface 706 // - id - ID of interface 707 // - mode - bonding mode 708 // - lb - load balance algo 709 // - numa_only - enable local numa TX for lacp mode 710 // - active_members - active members count 711 // - members - config member count 712 // - interface_name - name of interface 713 // 714 // SwBondInterfaceDetails defines message 'sw_bond_interface_details'. 715 type SwBondInterfaceDetails struct { 716 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 717 ID uint32 `binapi:"u32,name=id" json:"id,omitempty"` 718 Mode BondMode `binapi:"bond_mode,name=mode" json:"mode,omitempty"` 719 Lb BondLbAlgo `binapi:"bond_lb_algo,name=lb" json:"lb,omitempty"` 720 NumaOnly bool `binapi:"bool,name=numa_only" json:"numa_only,omitempty"` 721 ActiveMembers uint32 `binapi:"u32,name=active_members" json:"active_members,omitempty"` 722 Members uint32 `binapi:"u32,name=members" json:"members,omitempty"` 723 InterfaceName string `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"` 724 } 725 726 func (m *SwBondInterfaceDetails) Reset() { *m = SwBondInterfaceDetails{} } 727 func (*SwBondInterfaceDetails) GetMessageName() string { return "sw_bond_interface_details" } 728 func (*SwBondInterfaceDetails) GetCrcString() string { return "9428a69c" } 729 func (*SwBondInterfaceDetails) GetMessageType() api.MessageType { 730 return api.ReplyMessage 731 } 732 733 func (m *SwBondInterfaceDetails) Size() (size int) { 734 if m == nil { 735 return 0 736 } 737 size += 4 // m.SwIfIndex 738 size += 4 // m.ID 739 size += 4 // m.Mode 740 size += 4 // m.Lb 741 size += 1 // m.NumaOnly 742 size += 4 // m.ActiveMembers 743 size += 4 // m.Members 744 size += 64 // m.InterfaceName 745 return size 746 } 747 func (m *SwBondInterfaceDetails) Marshal(b []byte) ([]byte, error) { 748 if b == nil { 749 b = make([]byte, m.Size()) 750 } 751 buf := codec.NewBuffer(b) 752 buf.EncodeUint32(uint32(m.SwIfIndex)) 753 buf.EncodeUint32(m.ID) 754 buf.EncodeUint32(uint32(m.Mode)) 755 buf.EncodeUint32(uint32(m.Lb)) 756 buf.EncodeBool(m.NumaOnly) 757 buf.EncodeUint32(m.ActiveMembers) 758 buf.EncodeUint32(m.Members) 759 buf.EncodeString(m.InterfaceName, 64) 760 return buf.Bytes(), nil 761 } 762 func (m *SwBondInterfaceDetails) Unmarshal(b []byte) error { 763 buf := codec.NewBuffer(b) 764 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 765 m.ID = buf.DecodeUint32() 766 m.Mode = BondMode(buf.DecodeUint32()) 767 m.Lb = BondLbAlgo(buf.DecodeUint32()) 768 m.NumaOnly = buf.DecodeBool() 769 m.ActiveMembers = buf.DecodeUint32() 770 m.Members = buf.DecodeUint32() 771 m.InterfaceName = buf.DecodeString(64) 772 return nil 773 } 774 775 // Dump bond interfaces request 776 // SwBondInterfaceDump defines message 'sw_bond_interface_dump'. 777 type SwBondInterfaceDump struct { 778 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"` 779 } 780 781 func (m *SwBondInterfaceDump) Reset() { *m = SwBondInterfaceDump{} } 782 func (*SwBondInterfaceDump) GetMessageName() string { return "sw_bond_interface_dump" } 783 func (*SwBondInterfaceDump) GetCrcString() string { return "f9e6675e" } 784 func (*SwBondInterfaceDump) GetMessageType() api.MessageType { 785 return api.RequestMessage 786 } 787 788 func (m *SwBondInterfaceDump) Size() (size int) { 789 if m == nil { 790 return 0 791 } 792 size += 4 // m.SwIfIndex 793 return size 794 } 795 func (m *SwBondInterfaceDump) Marshal(b []byte) ([]byte, error) { 796 if b == nil { 797 b = make([]byte, m.Size()) 798 } 799 buf := codec.NewBuffer(b) 800 buf.EncodeUint32(uint32(m.SwIfIndex)) 801 return buf.Bytes(), nil 802 } 803 func (m *SwBondInterfaceDump) Unmarshal(b []byte) error { 804 buf := codec.NewBuffer(b) 805 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 806 return nil 807 } 808 809 // Reply for bond dump request 810 // - sw_if_index - software index of bond interface 811 // - id - ID of interface 812 // - interface_name - name of interface 813 // - mode - bonding mode 814 // - lb - load balance algo 815 // - numa_only - enable local numa TX for lacp mode 816 // - active_slaves - active member count 817 // - slaves - config member count 818 // 819 // SwInterfaceBondDetails defines message 'sw_interface_bond_details'. 820 type SwInterfaceBondDetails struct { 821 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 822 ID uint32 `binapi:"u32,name=id" json:"id,omitempty"` 823 Mode BondMode `binapi:"bond_mode,name=mode" json:"mode,omitempty"` 824 Lb BondLbAlgo `binapi:"bond_lb_algo,name=lb" json:"lb,omitempty"` 825 NumaOnly bool `binapi:"bool,name=numa_only" json:"numa_only,omitempty"` 826 ActiveSlaves uint32 `binapi:"u32,name=active_slaves" json:"active_slaves,omitempty"` 827 Slaves uint32 `binapi:"u32,name=slaves" json:"slaves,omitempty"` 828 InterfaceName string `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"` 829 } 830 831 func (m *SwInterfaceBondDetails) Reset() { *m = SwInterfaceBondDetails{} } 832 func (*SwInterfaceBondDetails) GetMessageName() string { return "sw_interface_bond_details" } 833 func (*SwInterfaceBondDetails) GetCrcString() string { return "bb7c929b" } 834 func (*SwInterfaceBondDetails) GetMessageType() api.MessageType { 835 return api.ReplyMessage 836 } 837 838 func (m *SwInterfaceBondDetails) Size() (size int) { 839 if m == nil { 840 return 0 841 } 842 size += 4 // m.SwIfIndex 843 size += 4 // m.ID 844 size += 4 // m.Mode 845 size += 4 // m.Lb 846 size += 1 // m.NumaOnly 847 size += 4 // m.ActiveSlaves 848 size += 4 // m.Slaves 849 size += 64 // m.InterfaceName 850 return size 851 } 852 func (m *SwInterfaceBondDetails) Marshal(b []byte) ([]byte, error) { 853 if b == nil { 854 b = make([]byte, m.Size()) 855 } 856 buf := codec.NewBuffer(b) 857 buf.EncodeUint32(uint32(m.SwIfIndex)) 858 buf.EncodeUint32(m.ID) 859 buf.EncodeUint32(uint32(m.Mode)) 860 buf.EncodeUint32(uint32(m.Lb)) 861 buf.EncodeBool(m.NumaOnly) 862 buf.EncodeUint32(m.ActiveSlaves) 863 buf.EncodeUint32(m.Slaves) 864 buf.EncodeString(m.InterfaceName, 64) 865 return buf.Bytes(), nil 866 } 867 func (m *SwInterfaceBondDetails) Unmarshal(b []byte) error { 868 buf := codec.NewBuffer(b) 869 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 870 m.ID = buf.DecodeUint32() 871 m.Mode = BondMode(buf.DecodeUint32()) 872 m.Lb = BondLbAlgo(buf.DecodeUint32()) 873 m.NumaOnly = buf.DecodeBool() 874 m.ActiveSlaves = buf.DecodeUint32() 875 m.Slaves = buf.DecodeUint32() 876 m.InterfaceName = buf.DecodeString(64) 877 return nil 878 } 879 880 // Dump bond interfaces request 881 // SwInterfaceBondDump defines message 'sw_interface_bond_dump'. 882 // Deprecated: the message will be removed in the future versions 883 type SwInterfaceBondDump struct{} 884 885 func (m *SwInterfaceBondDump) Reset() { *m = SwInterfaceBondDump{} } 886 func (*SwInterfaceBondDump) GetMessageName() string { return "sw_interface_bond_dump" } 887 func (*SwInterfaceBondDump) GetCrcString() string { return "51077d14" } 888 func (*SwInterfaceBondDump) GetMessageType() api.MessageType { 889 return api.RequestMessage 890 } 891 892 func (m *SwInterfaceBondDump) Size() (size int) { 893 if m == nil { 894 return 0 895 } 896 return size 897 } 898 func (m *SwInterfaceBondDump) Marshal(b []byte) ([]byte, error) { 899 if b == nil { 900 b = make([]byte, m.Size()) 901 } 902 buf := codec.NewBuffer(b) 903 return buf.Bytes(), nil 904 } 905 func (m *SwInterfaceBondDump) Unmarshal(b []byte) error { 906 return nil 907 } 908 909 // Interface set bond weight 910 // - sw_if_index - member interface for which to set the weight 911 // - weight - weight value to be set for the member interface 912 // 913 // SwInterfaceSetBondWeight defines message 'sw_interface_set_bond_weight'. 914 type SwInterfaceSetBondWeight struct { 915 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 916 Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"` 917 } 918 919 func (m *SwInterfaceSetBondWeight) Reset() { *m = SwInterfaceSetBondWeight{} } 920 func (*SwInterfaceSetBondWeight) GetMessageName() string { return "sw_interface_set_bond_weight" } 921 func (*SwInterfaceSetBondWeight) GetCrcString() string { return "deb510a0" } 922 func (*SwInterfaceSetBondWeight) GetMessageType() api.MessageType { 923 return api.RequestMessage 924 } 925 926 func (m *SwInterfaceSetBondWeight) Size() (size int) { 927 if m == nil { 928 return 0 929 } 930 size += 4 // m.SwIfIndex 931 size += 4 // m.Weight 932 return size 933 } 934 func (m *SwInterfaceSetBondWeight) Marshal(b []byte) ([]byte, error) { 935 if b == nil { 936 b = make([]byte, m.Size()) 937 } 938 buf := codec.NewBuffer(b) 939 buf.EncodeUint32(uint32(m.SwIfIndex)) 940 buf.EncodeUint32(m.Weight) 941 return buf.Bytes(), nil 942 } 943 func (m *SwInterfaceSetBondWeight) Unmarshal(b []byte) error { 944 buf := codec.NewBuffer(b) 945 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 946 m.Weight = buf.DecodeUint32() 947 return nil 948 } 949 950 // SwInterfaceSetBondWeightReply defines message 'sw_interface_set_bond_weight_reply'. 951 type SwInterfaceSetBondWeightReply struct { 952 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 953 } 954 955 func (m *SwInterfaceSetBondWeightReply) Reset() { *m = SwInterfaceSetBondWeightReply{} } 956 func (*SwInterfaceSetBondWeightReply) GetMessageName() string { 957 return "sw_interface_set_bond_weight_reply" 958 } 959 func (*SwInterfaceSetBondWeightReply) GetCrcString() string { return "e8d4e804" } 960 func (*SwInterfaceSetBondWeightReply) GetMessageType() api.MessageType { 961 return api.ReplyMessage 962 } 963 964 func (m *SwInterfaceSetBondWeightReply) Size() (size int) { 965 if m == nil { 966 return 0 967 } 968 size += 4 // m.Retval 969 return size 970 } 971 func (m *SwInterfaceSetBondWeightReply) Marshal(b []byte) ([]byte, error) { 972 if b == nil { 973 b = make([]byte, m.Size()) 974 } 975 buf := codec.NewBuffer(b) 976 buf.EncodeInt32(m.Retval) 977 return buf.Bytes(), nil 978 } 979 func (m *SwInterfaceSetBondWeightReply) Unmarshal(b []byte) error { 980 buf := codec.NewBuffer(b) 981 m.Retval = buf.DecodeInt32() 982 return nil 983 } 984 985 // Reply for slave dump request 986 // - sw_if_index - software index of slave interface 987 // - interface_name - name of interface 988 // - is_passve - interface does not initiate the lacp protocol, remote must be active speaker 989 // - is_long_timeout - 90 seconds vs default 3 seconds neighbor timeout 990 // - is_local_numa - the slave interface is local numa 991 // - weight - the weight for the slave interface (active-backup mode only) 992 // 993 // SwInterfaceSlaveDetails defines message 'sw_interface_slave_details'. 994 type SwInterfaceSlaveDetails struct { 995 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 996 InterfaceName string `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"` 997 IsPassive bool `binapi:"bool,name=is_passive" json:"is_passive,omitempty"` 998 IsLongTimeout bool `binapi:"bool,name=is_long_timeout" json:"is_long_timeout,omitempty"` 999 IsLocalNuma bool `binapi:"bool,name=is_local_numa" json:"is_local_numa,omitempty"` 1000 Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"` 1001 } 1002 1003 func (m *SwInterfaceSlaveDetails) Reset() { *m = SwInterfaceSlaveDetails{} } 1004 func (*SwInterfaceSlaveDetails) GetMessageName() string { return "sw_interface_slave_details" } 1005 func (*SwInterfaceSlaveDetails) GetCrcString() string { return "3c4a0e23" } 1006 func (*SwInterfaceSlaveDetails) GetMessageType() api.MessageType { 1007 return api.ReplyMessage 1008 } 1009 1010 func (m *SwInterfaceSlaveDetails) Size() (size int) { 1011 if m == nil { 1012 return 0 1013 } 1014 size += 4 // m.SwIfIndex 1015 size += 64 // m.InterfaceName 1016 size += 1 // m.IsPassive 1017 size += 1 // m.IsLongTimeout 1018 size += 1 // m.IsLocalNuma 1019 size += 4 // m.Weight 1020 return size 1021 } 1022 func (m *SwInterfaceSlaveDetails) Marshal(b []byte) ([]byte, error) { 1023 if b == nil { 1024 b = make([]byte, m.Size()) 1025 } 1026 buf := codec.NewBuffer(b) 1027 buf.EncodeUint32(uint32(m.SwIfIndex)) 1028 buf.EncodeString(m.InterfaceName, 64) 1029 buf.EncodeBool(m.IsPassive) 1030 buf.EncodeBool(m.IsLongTimeout) 1031 buf.EncodeBool(m.IsLocalNuma) 1032 buf.EncodeUint32(m.Weight) 1033 return buf.Bytes(), nil 1034 } 1035 func (m *SwInterfaceSlaveDetails) Unmarshal(b []byte) error { 1036 buf := codec.NewBuffer(b) 1037 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1038 m.InterfaceName = buf.DecodeString(64) 1039 m.IsPassive = buf.DecodeBool() 1040 m.IsLongTimeout = buf.DecodeBool() 1041 m.IsLocalNuma = buf.DecodeBool() 1042 m.Weight = buf.DecodeUint32() 1043 return nil 1044 } 1045 1046 // bond slave dump 1047 // - sw_if_index - interface index of bond interface 1048 // 1049 // SwInterfaceSlaveDump defines message 'sw_interface_slave_dump'. 1050 // Deprecated: the message will be removed in the future versions 1051 type SwInterfaceSlaveDump struct { 1052 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 1053 } 1054 1055 func (m *SwInterfaceSlaveDump) Reset() { *m = SwInterfaceSlaveDump{} } 1056 func (*SwInterfaceSlaveDump) GetMessageName() string { return "sw_interface_slave_dump" } 1057 func (*SwInterfaceSlaveDump) GetCrcString() string { return "f9e6675e" } 1058 func (*SwInterfaceSlaveDump) GetMessageType() api.MessageType { 1059 return api.RequestMessage 1060 } 1061 1062 func (m *SwInterfaceSlaveDump) Size() (size int) { 1063 if m == nil { 1064 return 0 1065 } 1066 size += 4 // m.SwIfIndex 1067 return size 1068 } 1069 func (m *SwInterfaceSlaveDump) Marshal(b []byte) ([]byte, error) { 1070 if b == nil { 1071 b = make([]byte, m.Size()) 1072 } 1073 buf := codec.NewBuffer(b) 1074 buf.EncodeUint32(uint32(m.SwIfIndex)) 1075 return buf.Bytes(), nil 1076 } 1077 func (m *SwInterfaceSlaveDump) Unmarshal(b []byte) error { 1078 buf := codec.NewBuffer(b) 1079 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1080 return nil 1081 } 1082 1083 // Reply for member dump request 1084 // - sw_if_index - software index of member interface 1085 // - interface_name - name of interface 1086 // - is_passve - interface does not initiate the lacp protocol, remote must be active speaker 1087 // - is_long_timeout - 90 seconds vs default 3 seconds neighbor timeout 1088 // - is_local_numa - the member interface is local numa 1089 // - weight - the weight for the member interface (active-backup mode only) 1090 // 1091 // SwMemberInterfaceDetails defines message 'sw_member_interface_details'. 1092 type SwMemberInterfaceDetails struct { 1093 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 1094 InterfaceName string `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"` 1095 IsPassive bool `binapi:"bool,name=is_passive" json:"is_passive,omitempty"` 1096 IsLongTimeout bool `binapi:"bool,name=is_long_timeout" json:"is_long_timeout,omitempty"` 1097 IsLocalNuma bool `binapi:"bool,name=is_local_numa" json:"is_local_numa,omitempty"` 1098 Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"` 1099 } 1100 1101 func (m *SwMemberInterfaceDetails) Reset() { *m = SwMemberInterfaceDetails{} } 1102 func (*SwMemberInterfaceDetails) GetMessageName() string { return "sw_member_interface_details" } 1103 func (*SwMemberInterfaceDetails) GetCrcString() string { return "3c4a0e23" } 1104 func (*SwMemberInterfaceDetails) GetMessageType() api.MessageType { 1105 return api.ReplyMessage 1106 } 1107 1108 func (m *SwMemberInterfaceDetails) Size() (size int) { 1109 if m == nil { 1110 return 0 1111 } 1112 size += 4 // m.SwIfIndex 1113 size += 64 // m.InterfaceName 1114 size += 1 // m.IsPassive 1115 size += 1 // m.IsLongTimeout 1116 size += 1 // m.IsLocalNuma 1117 size += 4 // m.Weight 1118 return size 1119 } 1120 func (m *SwMemberInterfaceDetails) Marshal(b []byte) ([]byte, error) { 1121 if b == nil { 1122 b = make([]byte, m.Size()) 1123 } 1124 buf := codec.NewBuffer(b) 1125 buf.EncodeUint32(uint32(m.SwIfIndex)) 1126 buf.EncodeString(m.InterfaceName, 64) 1127 buf.EncodeBool(m.IsPassive) 1128 buf.EncodeBool(m.IsLongTimeout) 1129 buf.EncodeBool(m.IsLocalNuma) 1130 buf.EncodeUint32(m.Weight) 1131 return buf.Bytes(), nil 1132 } 1133 func (m *SwMemberInterfaceDetails) Unmarshal(b []byte) error { 1134 buf := codec.NewBuffer(b) 1135 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1136 m.InterfaceName = buf.DecodeString(64) 1137 m.IsPassive = buf.DecodeBool() 1138 m.IsLongTimeout = buf.DecodeBool() 1139 m.IsLocalNuma = buf.DecodeBool() 1140 m.Weight = buf.DecodeUint32() 1141 return nil 1142 } 1143 1144 // bond member dump 1145 // - sw_if_index - interface index of bond interface 1146 // 1147 // SwMemberInterfaceDump defines message 'sw_member_interface_dump'. 1148 type SwMemberInterfaceDump struct { 1149 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 1150 } 1151 1152 func (m *SwMemberInterfaceDump) Reset() { *m = SwMemberInterfaceDump{} } 1153 func (*SwMemberInterfaceDump) GetMessageName() string { return "sw_member_interface_dump" } 1154 func (*SwMemberInterfaceDump) GetCrcString() string { return "f9e6675e" } 1155 func (*SwMemberInterfaceDump) GetMessageType() api.MessageType { 1156 return api.RequestMessage 1157 } 1158 1159 func (m *SwMemberInterfaceDump) Size() (size int) { 1160 if m == nil { 1161 return 0 1162 } 1163 size += 4 // m.SwIfIndex 1164 return size 1165 } 1166 func (m *SwMemberInterfaceDump) Marshal(b []byte) ([]byte, error) { 1167 if b == nil { 1168 b = make([]byte, m.Size()) 1169 } 1170 buf := codec.NewBuffer(b) 1171 buf.EncodeUint32(uint32(m.SwIfIndex)) 1172 return buf.Bytes(), nil 1173 } 1174 func (m *SwMemberInterfaceDump) Unmarshal(b []byte) error { 1175 buf := codec.NewBuffer(b) 1176 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1177 return nil 1178 } 1179 1180 func init() { file_bond_binapi_init() } 1181 func file_bond_binapi_init() { 1182 api.RegisterMessage((*BondAddMember)(nil), "bond_add_member_e7d14948") 1183 api.RegisterMessage((*BondAddMemberReply)(nil), "bond_add_member_reply_e8d4e804") 1184 api.RegisterMessage((*BondCreate)(nil), "bond_create_f1dbd4ff") 1185 api.RegisterMessage((*BondCreate2)(nil), "bond_create2_912fda76") 1186 api.RegisterMessage((*BondCreate2Reply)(nil), "bond_create2_reply_5383d31f") 1187 api.RegisterMessage((*BondCreateReply)(nil), "bond_create_reply_5383d31f") 1188 api.RegisterMessage((*BondDelete)(nil), "bond_delete_f9e6675e") 1189 api.RegisterMessage((*BondDeleteReply)(nil), "bond_delete_reply_e8d4e804") 1190 api.RegisterMessage((*BondDetachMember)(nil), "bond_detach_member_f9e6675e") 1191 api.RegisterMessage((*BondDetachMemberReply)(nil), "bond_detach_member_reply_e8d4e804") 1192 api.RegisterMessage((*BondDetachSlave)(nil), "bond_detach_slave_f9e6675e") 1193 api.RegisterMessage((*BondDetachSlaveReply)(nil), "bond_detach_slave_reply_e8d4e804") 1194 api.RegisterMessage((*BondEnslave)(nil), "bond_enslave_e7d14948") 1195 api.RegisterMessage((*BondEnslaveReply)(nil), "bond_enslave_reply_e8d4e804") 1196 api.RegisterMessage((*SwBondInterfaceDetails)(nil), "sw_bond_interface_details_9428a69c") 1197 api.RegisterMessage((*SwBondInterfaceDump)(nil), "sw_bond_interface_dump_f9e6675e") 1198 api.RegisterMessage((*SwInterfaceBondDetails)(nil), "sw_interface_bond_details_bb7c929b") 1199 api.RegisterMessage((*SwInterfaceBondDump)(nil), "sw_interface_bond_dump_51077d14") 1200 api.RegisterMessage((*SwInterfaceSetBondWeight)(nil), "sw_interface_set_bond_weight_deb510a0") 1201 api.RegisterMessage((*SwInterfaceSetBondWeightReply)(nil), "sw_interface_set_bond_weight_reply_e8d4e804") 1202 api.RegisterMessage((*SwInterfaceSlaveDetails)(nil), "sw_interface_slave_details_3c4a0e23") 1203 api.RegisterMessage((*SwInterfaceSlaveDump)(nil), "sw_interface_slave_dump_f9e6675e") 1204 api.RegisterMessage((*SwMemberInterfaceDetails)(nil), "sw_member_interface_details_3c4a0e23") 1205 api.RegisterMessage((*SwMemberInterfaceDump)(nil), "sw_member_interface_dump_f9e6675e") 1206 } 1207 1208 // Messages returns list of all messages in this module. 1209 func AllMessages() []api.Message { 1210 return []api.Message{ 1211 (*BondAddMember)(nil), 1212 (*BondAddMemberReply)(nil), 1213 (*BondCreate)(nil), 1214 (*BondCreate2)(nil), 1215 (*BondCreate2Reply)(nil), 1216 (*BondCreateReply)(nil), 1217 (*BondDelete)(nil), 1218 (*BondDeleteReply)(nil), 1219 (*BondDetachMember)(nil), 1220 (*BondDetachMemberReply)(nil), 1221 (*BondDetachSlave)(nil), 1222 (*BondDetachSlaveReply)(nil), 1223 (*BondEnslave)(nil), 1224 (*BondEnslaveReply)(nil), 1225 (*SwBondInterfaceDetails)(nil), 1226 (*SwBondInterfaceDump)(nil), 1227 (*SwInterfaceBondDetails)(nil), 1228 (*SwInterfaceBondDump)(nil), 1229 (*SwInterfaceSetBondWeight)(nil), 1230 (*SwInterfaceSetBondWeightReply)(nil), 1231 (*SwInterfaceSlaveDetails)(nil), 1232 (*SwInterfaceSlaveDump)(nil), 1233 (*SwMemberInterfaceDetails)(nil), 1234 (*SwMemberInterfaceDump)(nil), 1235 } 1236 }