github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/interface/interface.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/interface.api.json 6 7 // Package interfaces contains generated bindings for API file interface.api. 8 // 9 // Contents: 10 // - 74 messages 11 package interfaces 12 13 import ( 14 ethernet_types "github.com/networkservicemesh/govpp/binapi/ethernet_types" 15 interface_types "github.com/networkservicemesh/govpp/binapi/interface_types" 16 ip_types "github.com/networkservicemesh/govpp/binapi/ip_types" 17 api "go.fd.io/govpp/api" 18 codec "go.fd.io/govpp/codec" 19 ) 20 21 // This is a compile-time assertion to ensure that this generated file 22 // is compatible with the GoVPP api package it is being compiled against. 23 // A compilation error at this line likely means your copy of the 24 // GoVPP api package needs to be updated. 25 const _ = api.GoVppAPIPackageIsVersion2 26 27 const ( 28 APIFile = "interface" 29 APIVersion = "3.2.3" 30 VersionCrc = 0x446ae86d 31 ) 32 33 // Enable or disable detailed interface stats 34 // - sw_if_index - The interface to collect detail stats on. ~0 implies 35 // all interfaces. 36 // - enable_disable - set to 1 to enable, 0 to disable detailed stats 37 // 38 // CollectDetailedInterfaceStats defines message 'collect_detailed_interface_stats'. 39 type CollectDetailedInterfaceStats struct { 40 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 41 EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"` 42 } 43 44 func (m *CollectDetailedInterfaceStats) Reset() { *m = CollectDetailedInterfaceStats{} } 45 func (*CollectDetailedInterfaceStats) GetMessageName() string { 46 return "collect_detailed_interface_stats" 47 } 48 func (*CollectDetailedInterfaceStats) GetCrcString() string { return "5501adee" } 49 func (*CollectDetailedInterfaceStats) GetMessageType() api.MessageType { 50 return api.RequestMessage 51 } 52 53 func (m *CollectDetailedInterfaceStats) Size() (size int) { 54 if m == nil { 55 return 0 56 } 57 size += 4 // m.SwIfIndex 58 size += 1 // m.EnableDisable 59 return size 60 } 61 func (m *CollectDetailedInterfaceStats) Marshal(b []byte) ([]byte, error) { 62 if b == nil { 63 b = make([]byte, m.Size()) 64 } 65 buf := codec.NewBuffer(b) 66 buf.EncodeUint32(uint32(m.SwIfIndex)) 67 buf.EncodeBool(m.EnableDisable) 68 return buf.Bytes(), nil 69 } 70 func (m *CollectDetailedInterfaceStats) Unmarshal(b []byte) error { 71 buf := codec.NewBuffer(b) 72 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 73 m.EnableDisable = buf.DecodeBool() 74 return nil 75 } 76 77 // CollectDetailedInterfaceStatsReply defines message 'collect_detailed_interface_stats_reply'. 78 type CollectDetailedInterfaceStatsReply struct { 79 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 80 } 81 82 func (m *CollectDetailedInterfaceStatsReply) Reset() { *m = CollectDetailedInterfaceStatsReply{} } 83 func (*CollectDetailedInterfaceStatsReply) GetMessageName() string { 84 return "collect_detailed_interface_stats_reply" 85 } 86 func (*CollectDetailedInterfaceStatsReply) GetCrcString() string { return "e8d4e804" } 87 func (*CollectDetailedInterfaceStatsReply) GetMessageType() api.MessageType { 88 return api.ReplyMessage 89 } 90 91 func (m *CollectDetailedInterfaceStatsReply) Size() (size int) { 92 if m == nil { 93 return 0 94 } 95 size += 4 // m.Retval 96 return size 97 } 98 func (m *CollectDetailedInterfaceStatsReply) Marshal(b []byte) ([]byte, error) { 99 if b == nil { 100 b = make([]byte, m.Size()) 101 } 102 buf := codec.NewBuffer(b) 103 buf.EncodeInt32(m.Retval) 104 return buf.Bytes(), nil 105 } 106 func (m *CollectDetailedInterfaceStatsReply) Unmarshal(b []byte) error { 107 buf := codec.NewBuffer(b) 108 m.Retval = buf.DecodeInt32() 109 return nil 110 } 111 112 // Create loopback interface request 113 // - mac_address - mac addr to assign to the interface if none-zero 114 // 115 // CreateLoopback defines message 'create_loopback'. 116 type CreateLoopback struct { 117 MacAddress ethernet_types.MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"` 118 } 119 120 func (m *CreateLoopback) Reset() { *m = CreateLoopback{} } 121 func (*CreateLoopback) GetMessageName() string { return "create_loopback" } 122 func (*CreateLoopback) GetCrcString() string { return "42bb5d22" } 123 func (*CreateLoopback) GetMessageType() api.MessageType { 124 return api.RequestMessage 125 } 126 127 func (m *CreateLoopback) Size() (size int) { 128 if m == nil { 129 return 0 130 } 131 size += 1 * 6 // m.MacAddress 132 return size 133 } 134 func (m *CreateLoopback) Marshal(b []byte) ([]byte, error) { 135 if b == nil { 136 b = make([]byte, m.Size()) 137 } 138 buf := codec.NewBuffer(b) 139 buf.EncodeBytes(m.MacAddress[:], 6) 140 return buf.Bytes(), nil 141 } 142 func (m *CreateLoopback) Unmarshal(b []byte) error { 143 buf := codec.NewBuffer(b) 144 copy(m.MacAddress[:], buf.DecodeBytes(6)) 145 return nil 146 } 147 148 // Create loopback interface instance request 149 // - mac_address - mac addr to assign to the interface if none-zero 150 // - is_specified - if non-0, a specific user_instance is being requested 151 // - user_instance - requested instance, ~0 => dynamically allocate 152 // 153 // CreateLoopbackInstance defines message 'create_loopback_instance'. 154 type CreateLoopbackInstance struct { 155 MacAddress ethernet_types.MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"` 156 IsSpecified bool `binapi:"bool,name=is_specified" json:"is_specified,omitempty"` 157 UserInstance uint32 `binapi:"u32,name=user_instance" json:"user_instance,omitempty"` 158 } 159 160 func (m *CreateLoopbackInstance) Reset() { *m = CreateLoopbackInstance{} } 161 func (*CreateLoopbackInstance) GetMessageName() string { return "create_loopback_instance" } 162 func (*CreateLoopbackInstance) GetCrcString() string { return "d36a3ee2" } 163 func (*CreateLoopbackInstance) GetMessageType() api.MessageType { 164 return api.RequestMessage 165 } 166 167 func (m *CreateLoopbackInstance) Size() (size int) { 168 if m == nil { 169 return 0 170 } 171 size += 1 * 6 // m.MacAddress 172 size += 1 // m.IsSpecified 173 size += 4 // m.UserInstance 174 return size 175 } 176 func (m *CreateLoopbackInstance) Marshal(b []byte) ([]byte, error) { 177 if b == nil { 178 b = make([]byte, m.Size()) 179 } 180 buf := codec.NewBuffer(b) 181 buf.EncodeBytes(m.MacAddress[:], 6) 182 buf.EncodeBool(m.IsSpecified) 183 buf.EncodeUint32(m.UserInstance) 184 return buf.Bytes(), nil 185 } 186 func (m *CreateLoopbackInstance) Unmarshal(b []byte) error { 187 buf := codec.NewBuffer(b) 188 copy(m.MacAddress[:], buf.DecodeBytes(6)) 189 m.IsSpecified = buf.DecodeBool() 190 m.UserInstance = buf.DecodeUint32() 191 return nil 192 } 193 194 // Create loopback interface instance response 195 // - sw_if_index - sw index of the interface that was created 196 // - retval - return code for the request 197 // 198 // CreateLoopbackInstanceReply defines message 'create_loopback_instance_reply'. 199 type CreateLoopbackInstanceReply struct { 200 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 201 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 202 } 203 204 func (m *CreateLoopbackInstanceReply) Reset() { *m = CreateLoopbackInstanceReply{} } 205 func (*CreateLoopbackInstanceReply) GetMessageName() string { return "create_loopback_instance_reply" } 206 func (*CreateLoopbackInstanceReply) GetCrcString() string { return "5383d31f" } 207 func (*CreateLoopbackInstanceReply) GetMessageType() api.MessageType { 208 return api.ReplyMessage 209 } 210 211 func (m *CreateLoopbackInstanceReply) Size() (size int) { 212 if m == nil { 213 return 0 214 } 215 size += 4 // m.Retval 216 size += 4 // m.SwIfIndex 217 return size 218 } 219 func (m *CreateLoopbackInstanceReply) Marshal(b []byte) ([]byte, error) { 220 if b == nil { 221 b = make([]byte, m.Size()) 222 } 223 buf := codec.NewBuffer(b) 224 buf.EncodeInt32(m.Retval) 225 buf.EncodeUint32(uint32(m.SwIfIndex)) 226 return buf.Bytes(), nil 227 } 228 func (m *CreateLoopbackInstanceReply) Unmarshal(b []byte) error { 229 buf := codec.NewBuffer(b) 230 m.Retval = buf.DecodeInt32() 231 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 232 return nil 233 } 234 235 // Create loopback interface response 236 // - sw_if_index - sw index of the interface that was created 237 // - retval - return code for the request 238 // 239 // CreateLoopbackReply defines message 'create_loopback_reply'. 240 type CreateLoopbackReply struct { 241 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 242 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 243 } 244 245 func (m *CreateLoopbackReply) Reset() { *m = CreateLoopbackReply{} } 246 func (*CreateLoopbackReply) GetMessageName() string { return "create_loopback_reply" } 247 func (*CreateLoopbackReply) GetCrcString() string { return "5383d31f" } 248 func (*CreateLoopbackReply) GetMessageType() api.MessageType { 249 return api.ReplyMessage 250 } 251 252 func (m *CreateLoopbackReply) Size() (size int) { 253 if m == nil { 254 return 0 255 } 256 size += 4 // m.Retval 257 size += 4 // m.SwIfIndex 258 return size 259 } 260 func (m *CreateLoopbackReply) Marshal(b []byte) ([]byte, error) { 261 if b == nil { 262 b = make([]byte, m.Size()) 263 } 264 buf := codec.NewBuffer(b) 265 buf.EncodeInt32(m.Retval) 266 buf.EncodeUint32(uint32(m.SwIfIndex)) 267 return buf.Bytes(), nil 268 } 269 func (m *CreateLoopbackReply) Unmarshal(b []byte) error { 270 buf := codec.NewBuffer(b) 271 m.Retval = buf.DecodeInt32() 272 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 273 return nil 274 } 275 276 // CreateSubif defines message 'create_subif'. 277 type CreateSubif struct { 278 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 279 SubID uint32 `binapi:"u32,name=sub_id" json:"sub_id,omitempty"` 280 SubIfFlags interface_types.SubIfFlags `binapi:"sub_if_flags,name=sub_if_flags" json:"sub_if_flags,omitempty"` 281 OuterVlanID uint16 `binapi:"u16,name=outer_vlan_id" json:"outer_vlan_id,omitempty"` 282 InnerVlanID uint16 `binapi:"u16,name=inner_vlan_id" json:"inner_vlan_id,omitempty"` 283 } 284 285 func (m *CreateSubif) Reset() { *m = CreateSubif{} } 286 func (*CreateSubif) GetMessageName() string { return "create_subif" } 287 func (*CreateSubif) GetCrcString() string { return "790ca755" } 288 func (*CreateSubif) GetMessageType() api.MessageType { 289 return api.RequestMessage 290 } 291 292 func (m *CreateSubif) Size() (size int) { 293 if m == nil { 294 return 0 295 } 296 size += 4 // m.SwIfIndex 297 size += 4 // m.SubID 298 size += 4 // m.SubIfFlags 299 size += 2 // m.OuterVlanID 300 size += 2 // m.InnerVlanID 301 return size 302 } 303 func (m *CreateSubif) Marshal(b []byte) ([]byte, error) { 304 if b == nil { 305 b = make([]byte, m.Size()) 306 } 307 buf := codec.NewBuffer(b) 308 buf.EncodeUint32(uint32(m.SwIfIndex)) 309 buf.EncodeUint32(m.SubID) 310 buf.EncodeUint32(uint32(m.SubIfFlags)) 311 buf.EncodeUint16(m.OuterVlanID) 312 buf.EncodeUint16(m.InnerVlanID) 313 return buf.Bytes(), nil 314 } 315 func (m *CreateSubif) Unmarshal(b []byte) error { 316 buf := codec.NewBuffer(b) 317 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 318 m.SubID = buf.DecodeUint32() 319 m.SubIfFlags = interface_types.SubIfFlags(buf.DecodeUint32()) 320 m.OuterVlanID = buf.DecodeUint16() 321 m.InnerVlanID = buf.DecodeUint16() 322 return nil 323 } 324 325 // CreateSubifReply defines message 'create_subif_reply'. 326 type CreateSubifReply struct { 327 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 328 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 329 } 330 331 func (m *CreateSubifReply) Reset() { *m = CreateSubifReply{} } 332 func (*CreateSubifReply) GetMessageName() string { return "create_subif_reply" } 333 func (*CreateSubifReply) GetCrcString() string { return "5383d31f" } 334 func (*CreateSubifReply) GetMessageType() api.MessageType { 335 return api.ReplyMessage 336 } 337 338 func (m *CreateSubifReply) Size() (size int) { 339 if m == nil { 340 return 0 341 } 342 size += 4 // m.Retval 343 size += 4 // m.SwIfIndex 344 return size 345 } 346 func (m *CreateSubifReply) Marshal(b []byte) ([]byte, error) { 347 if b == nil { 348 b = make([]byte, m.Size()) 349 } 350 buf := codec.NewBuffer(b) 351 buf.EncodeInt32(m.Retval) 352 buf.EncodeUint32(uint32(m.SwIfIndex)) 353 return buf.Bytes(), nil 354 } 355 func (m *CreateSubifReply) Unmarshal(b []byte) error { 356 buf := codec.NewBuffer(b) 357 m.Retval = buf.DecodeInt32() 358 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 359 return nil 360 } 361 362 // Create a new subinterface with the given vlan id 363 // - sw_if_index - software index of the new vlan's parent interface 364 // - vlan_id - vlan tag of the new interface 365 // 366 // CreateVlanSubif defines message 'create_vlan_subif'. 367 type CreateVlanSubif struct { 368 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 369 VlanID uint32 `binapi:"u32,name=vlan_id" json:"vlan_id,omitempty"` 370 } 371 372 func (m *CreateVlanSubif) Reset() { *m = CreateVlanSubif{} } 373 func (*CreateVlanSubif) GetMessageName() string { return "create_vlan_subif" } 374 func (*CreateVlanSubif) GetCrcString() string { return "af34ac8b" } 375 func (*CreateVlanSubif) GetMessageType() api.MessageType { 376 return api.RequestMessage 377 } 378 379 func (m *CreateVlanSubif) Size() (size int) { 380 if m == nil { 381 return 0 382 } 383 size += 4 // m.SwIfIndex 384 size += 4 // m.VlanID 385 return size 386 } 387 func (m *CreateVlanSubif) Marshal(b []byte) ([]byte, error) { 388 if b == nil { 389 b = make([]byte, m.Size()) 390 } 391 buf := codec.NewBuffer(b) 392 buf.EncodeUint32(uint32(m.SwIfIndex)) 393 buf.EncodeUint32(m.VlanID) 394 return buf.Bytes(), nil 395 } 396 func (m *CreateVlanSubif) Unmarshal(b []byte) error { 397 buf := codec.NewBuffer(b) 398 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 399 m.VlanID = buf.DecodeUint32() 400 return nil 401 } 402 403 // Reply for the vlan subinterface create request 404 // - retval - return code 405 // - sw_if_index - software index allocated for the new subinterface 406 // 407 // CreateVlanSubifReply defines message 'create_vlan_subif_reply'. 408 type CreateVlanSubifReply struct { 409 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 410 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 411 } 412 413 func (m *CreateVlanSubifReply) Reset() { *m = CreateVlanSubifReply{} } 414 func (*CreateVlanSubifReply) GetMessageName() string { return "create_vlan_subif_reply" } 415 func (*CreateVlanSubifReply) GetCrcString() string { return "5383d31f" } 416 func (*CreateVlanSubifReply) GetMessageType() api.MessageType { 417 return api.ReplyMessage 418 } 419 420 func (m *CreateVlanSubifReply) Size() (size int) { 421 if m == nil { 422 return 0 423 } 424 size += 4 // m.Retval 425 size += 4 // m.SwIfIndex 426 return size 427 } 428 func (m *CreateVlanSubifReply) Marshal(b []byte) ([]byte, error) { 429 if b == nil { 430 b = make([]byte, m.Size()) 431 } 432 buf := codec.NewBuffer(b) 433 buf.EncodeInt32(m.Retval) 434 buf.EncodeUint32(uint32(m.SwIfIndex)) 435 return buf.Bytes(), nil 436 } 437 func (m *CreateVlanSubifReply) Unmarshal(b []byte) error { 438 buf := codec.NewBuffer(b) 439 m.Retval = buf.DecodeInt32() 440 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 441 return nil 442 } 443 444 // Delete loopback interface request 445 // - sw_if_index - sw index of the interface that was created 446 // 447 // DeleteLoopback defines message 'delete_loopback'. 448 type DeleteLoopback struct { 449 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 450 } 451 452 func (m *DeleteLoopback) Reset() { *m = DeleteLoopback{} } 453 func (*DeleteLoopback) GetMessageName() string { return "delete_loopback" } 454 func (*DeleteLoopback) GetCrcString() string { return "f9e6675e" } 455 func (*DeleteLoopback) GetMessageType() api.MessageType { 456 return api.RequestMessage 457 } 458 459 func (m *DeleteLoopback) Size() (size int) { 460 if m == nil { 461 return 0 462 } 463 size += 4 // m.SwIfIndex 464 return size 465 } 466 func (m *DeleteLoopback) Marshal(b []byte) ([]byte, error) { 467 if b == nil { 468 b = make([]byte, m.Size()) 469 } 470 buf := codec.NewBuffer(b) 471 buf.EncodeUint32(uint32(m.SwIfIndex)) 472 return buf.Bytes(), nil 473 } 474 func (m *DeleteLoopback) Unmarshal(b []byte) error { 475 buf := codec.NewBuffer(b) 476 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 477 return nil 478 } 479 480 // DeleteLoopbackReply defines message 'delete_loopback_reply'. 481 type DeleteLoopbackReply struct { 482 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 483 } 484 485 func (m *DeleteLoopbackReply) Reset() { *m = DeleteLoopbackReply{} } 486 func (*DeleteLoopbackReply) GetMessageName() string { return "delete_loopback_reply" } 487 func (*DeleteLoopbackReply) GetCrcString() string { return "e8d4e804" } 488 func (*DeleteLoopbackReply) GetMessageType() api.MessageType { 489 return api.ReplyMessage 490 } 491 492 func (m *DeleteLoopbackReply) Size() (size int) { 493 if m == nil { 494 return 0 495 } 496 size += 4 // m.Retval 497 return size 498 } 499 func (m *DeleteLoopbackReply) Marshal(b []byte) ([]byte, error) { 500 if b == nil { 501 b = make([]byte, m.Size()) 502 } 503 buf := codec.NewBuffer(b) 504 buf.EncodeInt32(m.Retval) 505 return buf.Bytes(), nil 506 } 507 func (m *DeleteLoopbackReply) Unmarshal(b []byte) error { 508 buf := codec.NewBuffer(b) 509 m.Retval = buf.DecodeInt32() 510 return nil 511 } 512 513 // Delete sub interface request 514 // - sw_if_index - sw index of the interface that was created by create_subif 515 // 516 // DeleteSubif defines message 'delete_subif'. 517 type DeleteSubif struct { 518 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 519 } 520 521 func (m *DeleteSubif) Reset() { *m = DeleteSubif{} } 522 func (*DeleteSubif) GetMessageName() string { return "delete_subif" } 523 func (*DeleteSubif) GetCrcString() string { return "f9e6675e" } 524 func (*DeleteSubif) GetMessageType() api.MessageType { 525 return api.RequestMessage 526 } 527 528 func (m *DeleteSubif) Size() (size int) { 529 if m == nil { 530 return 0 531 } 532 size += 4 // m.SwIfIndex 533 return size 534 } 535 func (m *DeleteSubif) Marshal(b []byte) ([]byte, error) { 536 if b == nil { 537 b = make([]byte, m.Size()) 538 } 539 buf := codec.NewBuffer(b) 540 buf.EncodeUint32(uint32(m.SwIfIndex)) 541 return buf.Bytes(), nil 542 } 543 func (m *DeleteSubif) Unmarshal(b []byte) error { 544 buf := codec.NewBuffer(b) 545 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 546 return nil 547 } 548 549 // DeleteSubifReply defines message 'delete_subif_reply'. 550 type DeleteSubifReply struct { 551 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 552 } 553 554 func (m *DeleteSubifReply) Reset() { *m = DeleteSubifReply{} } 555 func (*DeleteSubifReply) GetMessageName() string { return "delete_subif_reply" } 556 func (*DeleteSubifReply) GetCrcString() string { return "e8d4e804" } 557 func (*DeleteSubifReply) GetMessageType() api.MessageType { 558 return api.ReplyMessage 559 } 560 561 func (m *DeleteSubifReply) Size() (size int) { 562 if m == nil { 563 return 0 564 } 565 size += 4 // m.Retval 566 return size 567 } 568 func (m *DeleteSubifReply) Marshal(b []byte) ([]byte, error) { 569 if b == nil { 570 b = make([]byte, m.Size()) 571 } 572 buf := codec.NewBuffer(b) 573 buf.EncodeInt32(m.Retval) 574 return buf.Bytes(), nil 575 } 576 func (m *DeleteSubifReply) Unmarshal(b []byte) error { 577 buf := codec.NewBuffer(b) 578 m.Retval = buf.DecodeInt32() 579 return nil 580 } 581 582 // Get available, cached and used buffers 583 // - buffer_index - buffer stat index 584 // 585 // GetBuffersStats defines message 'get_buffers_stats'. 586 type GetBuffersStats struct { 587 BufferIndex uint32 `binapi:"u32,name=buffer_index" json:"buffer_index,omitempty"` 588 } 589 590 func (m *GetBuffersStats) Reset() { *m = GetBuffersStats{} } 591 func (*GetBuffersStats) GetMessageName() string { return "get_buffers_stats" } 592 func (*GetBuffersStats) GetCrcString() string { return "d698f87e" } 593 func (*GetBuffersStats) GetMessageType() api.MessageType { 594 return api.RequestMessage 595 } 596 597 func (m *GetBuffersStats) Size() (size int) { 598 if m == nil { 599 return 0 600 } 601 size += 4 // m.BufferIndex 602 return size 603 } 604 func (m *GetBuffersStats) Marshal(b []byte) ([]byte, error) { 605 if b == nil { 606 b = make([]byte, m.Size()) 607 } 608 buf := codec.NewBuffer(b) 609 buf.EncodeUint32(m.BufferIndex) 610 return buf.Bytes(), nil 611 } 612 func (m *GetBuffersStats) Unmarshal(b []byte) error { 613 buf := codec.NewBuffer(b) 614 m.BufferIndex = buf.DecodeUint32() 615 return nil 616 } 617 618 // GetBuffersStatsReply defines message 'get_buffers_stats_reply'. 619 type GetBuffersStatsReply struct { 620 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 621 AvailableBuffers uint32 `binapi:"u32,name=available_buffers" json:"available_buffers,omitempty"` 622 CachedBuffers uint32 `binapi:"u32,name=cached_buffers" json:"cached_buffers,omitempty"` 623 UsedBuffers uint32 `binapi:"u32,name=used_buffers" json:"used_buffers,omitempty"` 624 } 625 626 func (m *GetBuffersStatsReply) Reset() { *m = GetBuffersStatsReply{} } 627 func (*GetBuffersStatsReply) GetMessageName() string { return "get_buffers_stats_reply" } 628 func (*GetBuffersStatsReply) GetCrcString() string { return "22c0649d" } 629 func (*GetBuffersStatsReply) GetMessageType() api.MessageType { 630 return api.ReplyMessage 631 } 632 633 func (m *GetBuffersStatsReply) Size() (size int) { 634 if m == nil { 635 return 0 636 } 637 size += 4 // m.Retval 638 size += 4 // m.AvailableBuffers 639 size += 4 // m.CachedBuffers 640 size += 4 // m.UsedBuffers 641 return size 642 } 643 func (m *GetBuffersStatsReply) Marshal(b []byte) ([]byte, error) { 644 if b == nil { 645 b = make([]byte, m.Size()) 646 } 647 buf := codec.NewBuffer(b) 648 buf.EncodeInt32(m.Retval) 649 buf.EncodeUint32(m.AvailableBuffers) 650 buf.EncodeUint32(m.CachedBuffers) 651 buf.EncodeUint32(m.UsedBuffers) 652 return buf.Bytes(), nil 653 } 654 func (m *GetBuffersStatsReply) Unmarshal(b []byte) error { 655 buf := codec.NewBuffer(b) 656 m.Retval = buf.DecodeInt32() 657 m.AvailableBuffers = buf.DecodeUint32() 658 m.CachedBuffers = buf.DecodeUint32() 659 m.UsedBuffers = buf.DecodeUint32() 660 return nil 661 } 662 663 // Set interface physical MTU 664 // - sw_if_index - index of the interface to set MTU on 665 // - mtu - MTU 666 // 667 // HwInterfaceSetMtu defines message 'hw_interface_set_mtu'. 668 type HwInterfaceSetMtu struct { 669 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 670 Mtu uint16 `binapi:"u16,name=mtu" json:"mtu,omitempty"` 671 } 672 673 func (m *HwInterfaceSetMtu) Reset() { *m = HwInterfaceSetMtu{} } 674 func (*HwInterfaceSetMtu) GetMessageName() string { return "hw_interface_set_mtu" } 675 func (*HwInterfaceSetMtu) GetCrcString() string { return "e6746899" } 676 func (*HwInterfaceSetMtu) GetMessageType() api.MessageType { 677 return api.RequestMessage 678 } 679 680 func (m *HwInterfaceSetMtu) Size() (size int) { 681 if m == nil { 682 return 0 683 } 684 size += 4 // m.SwIfIndex 685 size += 2 // m.Mtu 686 return size 687 } 688 func (m *HwInterfaceSetMtu) Marshal(b []byte) ([]byte, error) { 689 if b == nil { 690 b = make([]byte, m.Size()) 691 } 692 buf := codec.NewBuffer(b) 693 buf.EncodeUint32(uint32(m.SwIfIndex)) 694 buf.EncodeUint16(m.Mtu) 695 return buf.Bytes(), nil 696 } 697 func (m *HwInterfaceSetMtu) Unmarshal(b []byte) error { 698 buf := codec.NewBuffer(b) 699 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 700 m.Mtu = buf.DecodeUint16() 701 return nil 702 } 703 704 // HwInterfaceSetMtuReply defines message 'hw_interface_set_mtu_reply'. 705 type HwInterfaceSetMtuReply struct { 706 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 707 } 708 709 func (m *HwInterfaceSetMtuReply) Reset() { *m = HwInterfaceSetMtuReply{} } 710 func (*HwInterfaceSetMtuReply) GetMessageName() string { return "hw_interface_set_mtu_reply" } 711 func (*HwInterfaceSetMtuReply) GetCrcString() string { return "e8d4e804" } 712 func (*HwInterfaceSetMtuReply) GetMessageType() api.MessageType { 713 return api.ReplyMessage 714 } 715 716 func (m *HwInterfaceSetMtuReply) Size() (size int) { 717 if m == nil { 718 return 0 719 } 720 size += 4 // m.Retval 721 return size 722 } 723 func (m *HwInterfaceSetMtuReply) Marshal(b []byte) ([]byte, error) { 724 if b == nil { 725 b = make([]byte, m.Size()) 726 } 727 buf := codec.NewBuffer(b) 728 buf.EncodeInt32(m.Retval) 729 return buf.Bytes(), nil 730 } 731 func (m *HwInterfaceSetMtuReply) Unmarshal(b []byte) error { 732 buf := codec.NewBuffer(b) 733 m.Retval = buf.DecodeInt32() 734 return nil 735 } 736 737 // /* Gross kludge, DGMS 738 // InterfaceNameRenumber defines message 'interface_name_renumber'. 739 type InterfaceNameRenumber struct { 740 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 741 NewShowDevInstance uint32 `binapi:"u32,name=new_show_dev_instance" json:"new_show_dev_instance,omitempty"` 742 } 743 744 func (m *InterfaceNameRenumber) Reset() { *m = InterfaceNameRenumber{} } 745 func (*InterfaceNameRenumber) GetMessageName() string { return "interface_name_renumber" } 746 func (*InterfaceNameRenumber) GetCrcString() string { return "2b8858b8" } 747 func (*InterfaceNameRenumber) GetMessageType() api.MessageType { 748 return api.RequestMessage 749 } 750 751 func (m *InterfaceNameRenumber) Size() (size int) { 752 if m == nil { 753 return 0 754 } 755 size += 4 // m.SwIfIndex 756 size += 4 // m.NewShowDevInstance 757 return size 758 } 759 func (m *InterfaceNameRenumber) Marshal(b []byte) ([]byte, error) { 760 if b == nil { 761 b = make([]byte, m.Size()) 762 } 763 buf := codec.NewBuffer(b) 764 buf.EncodeUint32(uint32(m.SwIfIndex)) 765 buf.EncodeUint32(m.NewShowDevInstance) 766 return buf.Bytes(), nil 767 } 768 func (m *InterfaceNameRenumber) Unmarshal(b []byte) error { 769 buf := codec.NewBuffer(b) 770 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 771 m.NewShowDevInstance = buf.DecodeUint32() 772 return nil 773 } 774 775 // InterfaceNameRenumberReply defines message 'interface_name_renumber_reply'. 776 type InterfaceNameRenumberReply struct { 777 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 778 } 779 780 func (m *InterfaceNameRenumberReply) Reset() { *m = InterfaceNameRenumberReply{} } 781 func (*InterfaceNameRenumberReply) GetMessageName() string { return "interface_name_renumber_reply" } 782 func (*InterfaceNameRenumberReply) GetCrcString() string { return "e8d4e804" } 783 func (*InterfaceNameRenumberReply) GetMessageType() api.MessageType { 784 return api.ReplyMessage 785 } 786 787 func (m *InterfaceNameRenumberReply) Size() (size int) { 788 if m == nil { 789 return 0 790 } 791 size += 4 // m.Retval 792 return size 793 } 794 func (m *InterfaceNameRenumberReply) Marshal(b []byte) ([]byte, error) { 795 if b == nil { 796 b = make([]byte, m.Size()) 797 } 798 buf := codec.NewBuffer(b) 799 buf.EncodeInt32(m.Retval) 800 return buf.Bytes(), nil 801 } 802 func (m *InterfaceNameRenumberReply) Unmarshal(b []byte) error { 803 buf := codec.NewBuffer(b) 804 m.Retval = buf.DecodeInt32() 805 return nil 806 } 807 808 // pcap_set_filter_function 809 // - filter_function_name - the name of the filter function 810 // to set for pcap capture 811 // 812 // PcapSetFilterFunction defines message 'pcap_set_filter_function'. 813 type PcapSetFilterFunction struct { 814 FilterFunctionName string `binapi:"string[],name=filter_function_name" json:"filter_function_name,omitempty"` 815 } 816 817 func (m *PcapSetFilterFunction) Reset() { *m = PcapSetFilterFunction{} } 818 func (*PcapSetFilterFunction) GetMessageName() string { return "pcap_set_filter_function" } 819 func (*PcapSetFilterFunction) GetCrcString() string { return "616abb92" } 820 func (*PcapSetFilterFunction) GetMessageType() api.MessageType { 821 return api.RequestMessage 822 } 823 824 func (m *PcapSetFilterFunction) Size() (size int) { 825 if m == nil { 826 return 0 827 } 828 size += 4 + len(m.FilterFunctionName) // m.FilterFunctionName 829 return size 830 } 831 func (m *PcapSetFilterFunction) Marshal(b []byte) ([]byte, error) { 832 if b == nil { 833 b = make([]byte, m.Size()) 834 } 835 buf := codec.NewBuffer(b) 836 buf.EncodeString(m.FilterFunctionName, 0) 837 return buf.Bytes(), nil 838 } 839 func (m *PcapSetFilterFunction) Unmarshal(b []byte) error { 840 buf := codec.NewBuffer(b) 841 m.FilterFunctionName = buf.DecodeString(0) 842 return nil 843 } 844 845 // PcapSetFilterFunctionReply defines message 'pcap_set_filter_function_reply'. 846 type PcapSetFilterFunctionReply struct { 847 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 848 } 849 850 func (m *PcapSetFilterFunctionReply) Reset() { *m = PcapSetFilterFunctionReply{} } 851 func (*PcapSetFilterFunctionReply) GetMessageName() string { return "pcap_set_filter_function_reply" } 852 func (*PcapSetFilterFunctionReply) GetCrcString() string { return "e8d4e804" } 853 func (*PcapSetFilterFunctionReply) GetMessageType() api.MessageType { 854 return api.ReplyMessage 855 } 856 857 func (m *PcapSetFilterFunctionReply) Size() (size int) { 858 if m == nil { 859 return 0 860 } 861 size += 4 // m.Retval 862 return size 863 } 864 func (m *PcapSetFilterFunctionReply) Marshal(b []byte) ([]byte, error) { 865 if b == nil { 866 b = make([]byte, m.Size()) 867 } 868 buf := codec.NewBuffer(b) 869 buf.EncodeInt32(m.Retval) 870 return buf.Bytes(), nil 871 } 872 func (m *PcapSetFilterFunctionReply) Unmarshal(b []byte) error { 873 buf := codec.NewBuffer(b) 874 m.Retval = buf.DecodeInt32() 875 return nil 876 } 877 878 // PcapTraceOff defines message 'pcap_trace_off'. 879 type PcapTraceOff struct{} 880 881 func (m *PcapTraceOff) Reset() { *m = PcapTraceOff{} } 882 func (*PcapTraceOff) GetMessageName() string { return "pcap_trace_off" } 883 func (*PcapTraceOff) GetCrcString() string { return "51077d14" } 884 func (*PcapTraceOff) GetMessageType() api.MessageType { 885 return api.RequestMessage 886 } 887 888 func (m *PcapTraceOff) Size() (size int) { 889 if m == nil { 890 return 0 891 } 892 return size 893 } 894 func (m *PcapTraceOff) Marshal(b []byte) ([]byte, error) { 895 if b == nil { 896 b = make([]byte, m.Size()) 897 } 898 buf := codec.NewBuffer(b) 899 return buf.Bytes(), nil 900 } 901 func (m *PcapTraceOff) Unmarshal(b []byte) error { 902 return nil 903 } 904 905 // PcapTraceOffReply defines message 'pcap_trace_off_reply'. 906 type PcapTraceOffReply struct { 907 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 908 } 909 910 func (m *PcapTraceOffReply) Reset() { *m = PcapTraceOffReply{} } 911 func (*PcapTraceOffReply) GetMessageName() string { return "pcap_trace_off_reply" } 912 func (*PcapTraceOffReply) GetCrcString() string { return "e8d4e804" } 913 func (*PcapTraceOffReply) GetMessageType() api.MessageType { 914 return api.ReplyMessage 915 } 916 917 func (m *PcapTraceOffReply) Size() (size int) { 918 if m == nil { 919 return 0 920 } 921 size += 4 // m.Retval 922 return size 923 } 924 func (m *PcapTraceOffReply) Marshal(b []byte) ([]byte, error) { 925 if b == nil { 926 b = make([]byte, m.Size()) 927 } 928 buf := codec.NewBuffer(b) 929 buf.EncodeInt32(m.Retval) 930 return buf.Bytes(), nil 931 } 932 func (m *PcapTraceOffReply) Unmarshal(b []byte) error { 933 buf := codec.NewBuffer(b) 934 m.Retval = buf.DecodeInt32() 935 return nil 936 } 937 938 // pcap_trace_on 939 // - capture_rx - capture received packets 940 // - capture_tx - capture transmitted packets 941 // - capture_drop - capture dropped packets 942 // - filter - is a filter is being used on this capture 943 // - preallocate_data - preallocate the data buffer 944 // - free_data - free the data buffer 945 // - max_packets - depth of local buffer 946 // - max_bytes_per_packet - maximum number of bytes to capture 947 // for each packet 948 // - sw_if_index - specify a given interface, or 0 for any 949 // - error - filter packets based on a specific error. 950 // - filename - output filename, will be placed in /tmp 951 // 952 // PcapTraceOn defines message 'pcap_trace_on'. 953 type PcapTraceOn struct { 954 CaptureRx bool `binapi:"bool,name=capture_rx" json:"capture_rx,omitempty"` 955 CaptureTx bool `binapi:"bool,name=capture_tx" json:"capture_tx,omitempty"` 956 CaptureDrop bool `binapi:"bool,name=capture_drop" json:"capture_drop,omitempty"` 957 Filter bool `binapi:"bool,name=filter" json:"filter,omitempty"` 958 PreallocateData bool `binapi:"bool,name=preallocate_data" json:"preallocate_data,omitempty"` 959 FreeData bool `binapi:"bool,name=free_data" json:"free_data,omitempty"` 960 MaxPackets uint32 `binapi:"u32,name=max_packets,default=1000" json:"max_packets,omitempty"` 961 MaxBytesPerPacket uint32 `binapi:"u32,name=max_bytes_per_packet,default=512" json:"max_bytes_per_packet,omitempty"` 962 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 963 Error string `binapi:"string[128],name=error" json:"error,omitempty"` 964 Filename string `binapi:"string[64],name=filename" json:"filename,omitempty"` 965 } 966 967 func (m *PcapTraceOn) Reset() { *m = PcapTraceOn{} } 968 func (*PcapTraceOn) GetMessageName() string { return "pcap_trace_on" } 969 func (*PcapTraceOn) GetCrcString() string { return "cb39e968" } 970 func (*PcapTraceOn) GetMessageType() api.MessageType { 971 return api.RequestMessage 972 } 973 974 func (m *PcapTraceOn) Size() (size int) { 975 if m == nil { 976 return 0 977 } 978 size += 1 // m.CaptureRx 979 size += 1 // m.CaptureTx 980 size += 1 // m.CaptureDrop 981 size += 1 // m.Filter 982 size += 1 // m.PreallocateData 983 size += 1 // m.FreeData 984 size += 4 // m.MaxPackets 985 size += 4 // m.MaxBytesPerPacket 986 size += 4 // m.SwIfIndex 987 size += 128 // m.Error 988 size += 64 // m.Filename 989 return size 990 } 991 func (m *PcapTraceOn) Marshal(b []byte) ([]byte, error) { 992 if b == nil { 993 b = make([]byte, m.Size()) 994 } 995 buf := codec.NewBuffer(b) 996 buf.EncodeBool(m.CaptureRx) 997 buf.EncodeBool(m.CaptureTx) 998 buf.EncodeBool(m.CaptureDrop) 999 buf.EncodeBool(m.Filter) 1000 buf.EncodeBool(m.PreallocateData) 1001 buf.EncodeBool(m.FreeData) 1002 buf.EncodeUint32(m.MaxPackets) 1003 buf.EncodeUint32(m.MaxBytesPerPacket) 1004 buf.EncodeUint32(uint32(m.SwIfIndex)) 1005 buf.EncodeString(m.Error, 128) 1006 buf.EncodeString(m.Filename, 64) 1007 return buf.Bytes(), nil 1008 } 1009 func (m *PcapTraceOn) Unmarshal(b []byte) error { 1010 buf := codec.NewBuffer(b) 1011 m.CaptureRx = buf.DecodeBool() 1012 m.CaptureTx = buf.DecodeBool() 1013 m.CaptureDrop = buf.DecodeBool() 1014 m.Filter = buf.DecodeBool() 1015 m.PreallocateData = buf.DecodeBool() 1016 m.FreeData = buf.DecodeBool() 1017 m.MaxPackets = buf.DecodeUint32() 1018 m.MaxBytesPerPacket = buf.DecodeUint32() 1019 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1020 m.Error = buf.DecodeString(128) 1021 m.Filename = buf.DecodeString(64) 1022 return nil 1023 } 1024 1025 // PcapTraceOnReply defines message 'pcap_trace_on_reply'. 1026 type PcapTraceOnReply struct { 1027 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1028 } 1029 1030 func (m *PcapTraceOnReply) Reset() { *m = PcapTraceOnReply{} } 1031 func (*PcapTraceOnReply) GetMessageName() string { return "pcap_trace_on_reply" } 1032 func (*PcapTraceOnReply) GetCrcString() string { return "e8d4e804" } 1033 func (*PcapTraceOnReply) GetMessageType() api.MessageType { 1034 return api.ReplyMessage 1035 } 1036 1037 func (m *PcapTraceOnReply) Size() (size int) { 1038 if m == nil { 1039 return 0 1040 } 1041 size += 4 // m.Retval 1042 return size 1043 } 1044 func (m *PcapTraceOnReply) Marshal(b []byte) ([]byte, error) { 1045 if b == nil { 1046 b = make([]byte, m.Size()) 1047 } 1048 buf := codec.NewBuffer(b) 1049 buf.EncodeInt32(m.Retval) 1050 return buf.Bytes(), nil 1051 } 1052 func (m *PcapTraceOnReply) Unmarshal(b []byte) error { 1053 buf := codec.NewBuffer(b) 1054 m.Retval = buf.DecodeInt32() 1055 return nil 1056 } 1057 1058 // Set or delete one or all ip addresses on a specified interface 1059 // - sw_if_index - index of the interface to add/del addresses 1060 // - is_add - add address if non-zero, else delete 1061 // - del_all - if non-zero delete all addresses on the interface 1062 // - prefix - address + a prefix length for the implied connected route 1063 // 1064 // SwInterfaceAddDelAddress defines message 'sw_interface_add_del_address'. 1065 type SwInterfaceAddDelAddress struct { 1066 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 1067 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` 1068 DelAll bool `binapi:"bool,name=del_all" json:"del_all,omitempty"` 1069 Prefix ip_types.AddressWithPrefix `binapi:"address_with_prefix,name=prefix" json:"prefix,omitempty"` 1070 } 1071 1072 func (m *SwInterfaceAddDelAddress) Reset() { *m = SwInterfaceAddDelAddress{} } 1073 func (*SwInterfaceAddDelAddress) GetMessageName() string { return "sw_interface_add_del_address" } 1074 func (*SwInterfaceAddDelAddress) GetCrcString() string { return "5463d73b" } 1075 func (*SwInterfaceAddDelAddress) GetMessageType() api.MessageType { 1076 return api.RequestMessage 1077 } 1078 1079 func (m *SwInterfaceAddDelAddress) Size() (size int) { 1080 if m == nil { 1081 return 0 1082 } 1083 size += 4 // m.SwIfIndex 1084 size += 1 // m.IsAdd 1085 size += 1 // m.DelAll 1086 size += 1 // m.Prefix.Address.Af 1087 size += 1 * 16 // m.Prefix.Address.Un 1088 size += 1 // m.Prefix.Len 1089 return size 1090 } 1091 func (m *SwInterfaceAddDelAddress) Marshal(b []byte) ([]byte, error) { 1092 if b == nil { 1093 b = make([]byte, m.Size()) 1094 } 1095 buf := codec.NewBuffer(b) 1096 buf.EncodeUint32(uint32(m.SwIfIndex)) 1097 buf.EncodeBool(m.IsAdd) 1098 buf.EncodeBool(m.DelAll) 1099 buf.EncodeUint8(uint8(m.Prefix.Address.Af)) 1100 buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16) 1101 buf.EncodeUint8(m.Prefix.Len) 1102 return buf.Bytes(), nil 1103 } 1104 func (m *SwInterfaceAddDelAddress) Unmarshal(b []byte) error { 1105 buf := codec.NewBuffer(b) 1106 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1107 m.IsAdd = buf.DecodeBool() 1108 m.DelAll = buf.DecodeBool() 1109 m.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) 1110 copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 1111 m.Prefix.Len = buf.DecodeUint8() 1112 return nil 1113 } 1114 1115 // SwInterfaceAddDelAddressReply defines message 'sw_interface_add_del_address_reply'. 1116 type SwInterfaceAddDelAddressReply struct { 1117 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1118 } 1119 1120 func (m *SwInterfaceAddDelAddressReply) Reset() { *m = SwInterfaceAddDelAddressReply{} } 1121 func (*SwInterfaceAddDelAddressReply) GetMessageName() string { 1122 return "sw_interface_add_del_address_reply" 1123 } 1124 func (*SwInterfaceAddDelAddressReply) GetCrcString() string { return "e8d4e804" } 1125 func (*SwInterfaceAddDelAddressReply) GetMessageType() api.MessageType { 1126 return api.ReplyMessage 1127 } 1128 1129 func (m *SwInterfaceAddDelAddressReply) Size() (size int) { 1130 if m == nil { 1131 return 0 1132 } 1133 size += 4 // m.Retval 1134 return size 1135 } 1136 func (m *SwInterfaceAddDelAddressReply) Marshal(b []byte) ([]byte, error) { 1137 if b == nil { 1138 b = make([]byte, m.Size()) 1139 } 1140 buf := codec.NewBuffer(b) 1141 buf.EncodeInt32(m.Retval) 1142 return buf.Bytes(), nil 1143 } 1144 func (m *SwInterfaceAddDelAddressReply) Unmarshal(b []byte) error { 1145 buf := codec.NewBuffer(b) 1146 m.Retval = buf.DecodeInt32() 1147 return nil 1148 } 1149 1150 // Add or delete a secondary MAC address on an interface 1151 // - sw_if_index - the interface whose MAC will be set 1152 // - mac_addr - the new MAC address 1153 // - is_add - 0 to delete, != 0 to add 1154 // 1155 // SwInterfaceAddDelMacAddress defines message 'sw_interface_add_del_mac_address'. 1156 type SwInterfaceAddDelMacAddress struct { 1157 SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"` 1158 Addr ethernet_types.MacAddress `binapi:"mac_address,name=addr" json:"addr,omitempty"` 1159 IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"` 1160 } 1161 1162 func (m *SwInterfaceAddDelMacAddress) Reset() { *m = SwInterfaceAddDelMacAddress{} } 1163 func (*SwInterfaceAddDelMacAddress) GetMessageName() string { 1164 return "sw_interface_add_del_mac_address" 1165 } 1166 func (*SwInterfaceAddDelMacAddress) GetCrcString() string { return "638bb9f4" } 1167 func (*SwInterfaceAddDelMacAddress) GetMessageType() api.MessageType { 1168 return api.RequestMessage 1169 } 1170 1171 func (m *SwInterfaceAddDelMacAddress) Size() (size int) { 1172 if m == nil { 1173 return 0 1174 } 1175 size += 4 // m.SwIfIndex 1176 size += 1 * 6 // m.Addr 1177 size += 1 // m.IsAdd 1178 return size 1179 } 1180 func (m *SwInterfaceAddDelMacAddress) Marshal(b []byte) ([]byte, error) { 1181 if b == nil { 1182 b = make([]byte, m.Size()) 1183 } 1184 buf := codec.NewBuffer(b) 1185 buf.EncodeUint32(m.SwIfIndex) 1186 buf.EncodeBytes(m.Addr[:], 6) 1187 buf.EncodeUint8(m.IsAdd) 1188 return buf.Bytes(), nil 1189 } 1190 func (m *SwInterfaceAddDelMacAddress) Unmarshal(b []byte) error { 1191 buf := codec.NewBuffer(b) 1192 m.SwIfIndex = buf.DecodeUint32() 1193 copy(m.Addr[:], buf.DecodeBytes(6)) 1194 m.IsAdd = buf.DecodeUint8() 1195 return nil 1196 } 1197 1198 // SwInterfaceAddDelMacAddressReply defines message 'sw_interface_add_del_mac_address_reply'. 1199 type SwInterfaceAddDelMacAddressReply struct { 1200 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1201 } 1202 1203 func (m *SwInterfaceAddDelMacAddressReply) Reset() { *m = SwInterfaceAddDelMacAddressReply{} } 1204 func (*SwInterfaceAddDelMacAddressReply) GetMessageName() string { 1205 return "sw_interface_add_del_mac_address_reply" 1206 } 1207 func (*SwInterfaceAddDelMacAddressReply) GetCrcString() string { return "e8d4e804" } 1208 func (*SwInterfaceAddDelMacAddressReply) GetMessageType() api.MessageType { 1209 return api.ReplyMessage 1210 } 1211 1212 func (m *SwInterfaceAddDelMacAddressReply) Size() (size int) { 1213 if m == nil { 1214 return 0 1215 } 1216 size += 4 // m.Retval 1217 return size 1218 } 1219 func (m *SwInterfaceAddDelMacAddressReply) Marshal(b []byte) ([]byte, error) { 1220 if b == nil { 1221 b = make([]byte, m.Size()) 1222 } 1223 buf := codec.NewBuffer(b) 1224 buf.EncodeInt32(m.Retval) 1225 return buf.Bytes(), nil 1226 } 1227 func (m *SwInterfaceAddDelMacAddressReply) Unmarshal(b []byte) error { 1228 buf := codec.NewBuffer(b) 1229 m.Retval = buf.DecodeInt32() 1230 return nil 1231 } 1232 1233 // IP interface address replace begin 1234 // 1235 // The use-case is that, for some unspecified reason, the control plane 1236 // has a different set of interface addresses than VPP 1237 // currently has. The CP would thus like to 'replace' VPP's set 1238 // only by specifying what the new set shall be, i.e. it is not 1239 // going to delete anything that already eixts, rather, is wants any 1240 // unspecified interface addresses to be deleted implicitly. 1241 // The CP declares the start of this procedure with this replace_begin 1242 // API Call, and when it has populated all addresses it wants, it calls 1243 // the below replace_end API. From this point on it is of course free 1244 // to add and delete interface addresses as usual. 1245 // The underlying mechanism by which VPP implements this replace is 1246 // intentionally left unspecified. 1247 // 1248 // SwInterfaceAddressReplaceBegin defines message 'sw_interface_address_replace_begin'. 1249 type SwInterfaceAddressReplaceBegin struct{} 1250 1251 func (m *SwInterfaceAddressReplaceBegin) Reset() { *m = SwInterfaceAddressReplaceBegin{} } 1252 func (*SwInterfaceAddressReplaceBegin) GetMessageName() string { 1253 return "sw_interface_address_replace_begin" 1254 } 1255 func (*SwInterfaceAddressReplaceBegin) GetCrcString() string { return "51077d14" } 1256 func (*SwInterfaceAddressReplaceBegin) GetMessageType() api.MessageType { 1257 return api.RequestMessage 1258 } 1259 1260 func (m *SwInterfaceAddressReplaceBegin) Size() (size int) { 1261 if m == nil { 1262 return 0 1263 } 1264 return size 1265 } 1266 func (m *SwInterfaceAddressReplaceBegin) Marshal(b []byte) ([]byte, error) { 1267 if b == nil { 1268 b = make([]byte, m.Size()) 1269 } 1270 buf := codec.NewBuffer(b) 1271 return buf.Bytes(), nil 1272 } 1273 func (m *SwInterfaceAddressReplaceBegin) Unmarshal(b []byte) error { 1274 return nil 1275 } 1276 1277 // SwInterfaceAddressReplaceBeginReply defines message 'sw_interface_address_replace_begin_reply'. 1278 type SwInterfaceAddressReplaceBeginReply struct { 1279 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1280 } 1281 1282 func (m *SwInterfaceAddressReplaceBeginReply) Reset() { *m = SwInterfaceAddressReplaceBeginReply{} } 1283 func (*SwInterfaceAddressReplaceBeginReply) GetMessageName() string { 1284 return "sw_interface_address_replace_begin_reply" 1285 } 1286 func (*SwInterfaceAddressReplaceBeginReply) GetCrcString() string { return "e8d4e804" } 1287 func (*SwInterfaceAddressReplaceBeginReply) GetMessageType() api.MessageType { 1288 return api.ReplyMessage 1289 } 1290 1291 func (m *SwInterfaceAddressReplaceBeginReply) Size() (size int) { 1292 if m == nil { 1293 return 0 1294 } 1295 size += 4 // m.Retval 1296 return size 1297 } 1298 func (m *SwInterfaceAddressReplaceBeginReply) Marshal(b []byte) ([]byte, error) { 1299 if b == nil { 1300 b = make([]byte, m.Size()) 1301 } 1302 buf := codec.NewBuffer(b) 1303 buf.EncodeInt32(m.Retval) 1304 return buf.Bytes(), nil 1305 } 1306 func (m *SwInterfaceAddressReplaceBeginReply) Unmarshal(b []byte) error { 1307 buf := codec.NewBuffer(b) 1308 m.Retval = buf.DecodeInt32() 1309 return nil 1310 } 1311 1312 // IP interface address replace end 1313 // 1314 // see ip_interface_address_replace_begin description. 1315 // 1316 // SwInterfaceAddressReplaceEnd defines message 'sw_interface_address_replace_end'. 1317 type SwInterfaceAddressReplaceEnd struct{} 1318 1319 func (m *SwInterfaceAddressReplaceEnd) Reset() { *m = SwInterfaceAddressReplaceEnd{} } 1320 func (*SwInterfaceAddressReplaceEnd) GetMessageName() string { 1321 return "sw_interface_address_replace_end" 1322 } 1323 func (*SwInterfaceAddressReplaceEnd) GetCrcString() string { return "51077d14" } 1324 func (*SwInterfaceAddressReplaceEnd) GetMessageType() api.MessageType { 1325 return api.RequestMessage 1326 } 1327 1328 func (m *SwInterfaceAddressReplaceEnd) Size() (size int) { 1329 if m == nil { 1330 return 0 1331 } 1332 return size 1333 } 1334 func (m *SwInterfaceAddressReplaceEnd) Marshal(b []byte) ([]byte, error) { 1335 if b == nil { 1336 b = make([]byte, m.Size()) 1337 } 1338 buf := codec.NewBuffer(b) 1339 return buf.Bytes(), nil 1340 } 1341 func (m *SwInterfaceAddressReplaceEnd) Unmarshal(b []byte) error { 1342 return nil 1343 } 1344 1345 // SwInterfaceAddressReplaceEndReply defines message 'sw_interface_address_replace_end_reply'. 1346 type SwInterfaceAddressReplaceEndReply struct { 1347 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1348 } 1349 1350 func (m *SwInterfaceAddressReplaceEndReply) Reset() { *m = SwInterfaceAddressReplaceEndReply{} } 1351 func (*SwInterfaceAddressReplaceEndReply) GetMessageName() string { 1352 return "sw_interface_address_replace_end_reply" 1353 } 1354 func (*SwInterfaceAddressReplaceEndReply) GetCrcString() string { return "e8d4e804" } 1355 func (*SwInterfaceAddressReplaceEndReply) GetMessageType() api.MessageType { 1356 return api.ReplyMessage 1357 } 1358 1359 func (m *SwInterfaceAddressReplaceEndReply) Size() (size int) { 1360 if m == nil { 1361 return 0 1362 } 1363 size += 4 // m.Retval 1364 return size 1365 } 1366 func (m *SwInterfaceAddressReplaceEndReply) Marshal(b []byte) ([]byte, error) { 1367 if b == nil { 1368 b = make([]byte, m.Size()) 1369 } 1370 buf := codec.NewBuffer(b) 1371 buf.EncodeInt32(m.Retval) 1372 return buf.Bytes(), nil 1373 } 1374 func (m *SwInterfaceAddressReplaceEndReply) Unmarshal(b []byte) error { 1375 buf := codec.NewBuffer(b) 1376 m.Retval = buf.DecodeInt32() 1377 return nil 1378 } 1379 1380 // Clear interface statistics 1381 // - sw_if_index - index of the interface to clear statistics 1382 // 1383 // SwInterfaceClearStats defines message 'sw_interface_clear_stats'. 1384 type SwInterfaceClearStats struct { 1385 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 1386 } 1387 1388 func (m *SwInterfaceClearStats) Reset() { *m = SwInterfaceClearStats{} } 1389 func (*SwInterfaceClearStats) GetMessageName() string { return "sw_interface_clear_stats" } 1390 func (*SwInterfaceClearStats) GetCrcString() string { return "f9e6675e" } 1391 func (*SwInterfaceClearStats) GetMessageType() api.MessageType { 1392 return api.RequestMessage 1393 } 1394 1395 func (m *SwInterfaceClearStats) Size() (size int) { 1396 if m == nil { 1397 return 0 1398 } 1399 size += 4 // m.SwIfIndex 1400 return size 1401 } 1402 func (m *SwInterfaceClearStats) Marshal(b []byte) ([]byte, error) { 1403 if b == nil { 1404 b = make([]byte, m.Size()) 1405 } 1406 buf := codec.NewBuffer(b) 1407 buf.EncodeUint32(uint32(m.SwIfIndex)) 1408 return buf.Bytes(), nil 1409 } 1410 func (m *SwInterfaceClearStats) Unmarshal(b []byte) error { 1411 buf := codec.NewBuffer(b) 1412 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1413 return nil 1414 } 1415 1416 // SwInterfaceClearStatsReply defines message 'sw_interface_clear_stats_reply'. 1417 type SwInterfaceClearStatsReply struct { 1418 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1419 } 1420 1421 func (m *SwInterfaceClearStatsReply) Reset() { *m = SwInterfaceClearStatsReply{} } 1422 func (*SwInterfaceClearStatsReply) GetMessageName() string { return "sw_interface_clear_stats_reply" } 1423 func (*SwInterfaceClearStatsReply) GetCrcString() string { return "e8d4e804" } 1424 func (*SwInterfaceClearStatsReply) GetMessageType() api.MessageType { 1425 return api.ReplyMessage 1426 } 1427 1428 func (m *SwInterfaceClearStatsReply) Size() (size int) { 1429 if m == nil { 1430 return 0 1431 } 1432 size += 4 // m.Retval 1433 return size 1434 } 1435 func (m *SwInterfaceClearStatsReply) Marshal(b []byte) ([]byte, error) { 1436 if b == nil { 1437 b = make([]byte, m.Size()) 1438 } 1439 buf := codec.NewBuffer(b) 1440 buf.EncodeInt32(m.Retval) 1441 return buf.Bytes(), nil 1442 } 1443 func (m *SwInterfaceClearStatsReply) Unmarshal(b []byte) error { 1444 buf := codec.NewBuffer(b) 1445 m.Retval = buf.DecodeInt32() 1446 return nil 1447 } 1448 1449 // Interface details structure (fix this) 1450 // - sw_if_index - index of the interface 1451 // - sup_sw_if_index - index of parent interface if any, else same as sw_if_index 1452 // - l2_address - the interface's l2 address 1453 // - flags - interface_status flags 1454 // - type - interface type 1455 // - link_duplex - 1 if half duplex, 2 if full duplex 1456 // - link_speed - value in kbps 1457 // - link_MTU - max. transmission unit 1458 // - sub_id - A number 0-N to uniquely identify this subif on super if 1459 // - sub_number_of_tags - Number of tags (0 - 2) 1460 // - sub_outer_vlan_id 1461 // - sub_inner_vlan_id 1462 // - sub_if_flags - sub interface flags 1463 // - vtr_op - vlan tag rewrite operation 1464 // - vtr_push_dot1q 1465 // - vtr_tag1 1466 // - vtr_tag2 1467 // - pbb_outer_tag - translate pbb s-tag 1468 // - pbb_b_dmac[6] - B-tag remote mac address 1469 // - pbb_b_smac[6] - B-tag local mac address 1470 // - pbb_b_vlanid - B-tag vlanid 1471 // - pbb_i_sid - I-tag service id 1472 // - interface_name - name of the interface 1473 // - interface_dev_type - device type of the interface 1474 // - tag - an ascii tag 1475 // 1476 // SwInterfaceDetails defines message 'sw_interface_details'. 1477 type SwInterfaceDetails struct { 1478 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 1479 SupSwIfIndex uint32 `binapi:"u32,name=sup_sw_if_index" json:"sup_sw_if_index,omitempty"` 1480 L2Address ethernet_types.MacAddress `binapi:"mac_address,name=l2_address" json:"l2_address,omitempty"` 1481 Flags interface_types.IfStatusFlags `binapi:"if_status_flags,name=flags" json:"flags,omitempty"` 1482 Type interface_types.IfType `binapi:"if_type,name=type" json:"type,omitempty"` 1483 LinkDuplex interface_types.LinkDuplex `binapi:"link_duplex,name=link_duplex" json:"link_duplex,omitempty"` 1484 LinkSpeed uint32 `binapi:"u32,name=link_speed" json:"link_speed,omitempty"` 1485 LinkMtu uint16 `binapi:"u16,name=link_mtu" json:"link_mtu,omitempty"` 1486 Mtu []uint32 `binapi:"u32[4],name=mtu" json:"mtu,omitempty"` 1487 SubID uint32 `binapi:"u32,name=sub_id" json:"sub_id,omitempty"` 1488 SubNumberOfTags uint8 `binapi:"u8,name=sub_number_of_tags" json:"sub_number_of_tags,omitempty"` 1489 SubOuterVlanID uint16 `binapi:"u16,name=sub_outer_vlan_id" json:"sub_outer_vlan_id,omitempty"` 1490 SubInnerVlanID uint16 `binapi:"u16,name=sub_inner_vlan_id" json:"sub_inner_vlan_id,omitempty"` 1491 SubIfFlags interface_types.SubIfFlags `binapi:"sub_if_flags,name=sub_if_flags" json:"sub_if_flags,omitempty"` 1492 VtrOp uint32 `binapi:"u32,name=vtr_op" json:"vtr_op,omitempty"` 1493 VtrPushDot1q uint32 `binapi:"u32,name=vtr_push_dot1q" json:"vtr_push_dot1q,omitempty"` 1494 VtrTag1 uint32 `binapi:"u32,name=vtr_tag1" json:"vtr_tag1,omitempty"` 1495 VtrTag2 uint32 `binapi:"u32,name=vtr_tag2" json:"vtr_tag2,omitempty"` 1496 OuterTag uint16 `binapi:"u16,name=outer_tag" json:"outer_tag,omitempty"` 1497 BDmac ethernet_types.MacAddress `binapi:"mac_address,name=b_dmac" json:"b_dmac,omitempty"` 1498 BSmac ethernet_types.MacAddress `binapi:"mac_address,name=b_smac" json:"b_smac,omitempty"` 1499 BVlanid uint16 `binapi:"u16,name=b_vlanid" json:"b_vlanid,omitempty"` 1500 ISid uint32 `binapi:"u32,name=i_sid" json:"i_sid,omitempty"` 1501 InterfaceName string `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"` 1502 InterfaceDevType string `binapi:"string[64],name=interface_dev_type" json:"interface_dev_type,omitempty"` 1503 Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"` 1504 } 1505 1506 func (m *SwInterfaceDetails) Reset() { *m = SwInterfaceDetails{} } 1507 func (*SwInterfaceDetails) GetMessageName() string { return "sw_interface_details" } 1508 func (*SwInterfaceDetails) GetCrcString() string { return "6c221fc7" } 1509 func (*SwInterfaceDetails) GetMessageType() api.MessageType { 1510 return api.ReplyMessage 1511 } 1512 1513 func (m *SwInterfaceDetails) Size() (size int) { 1514 if m == nil { 1515 return 0 1516 } 1517 size += 4 // m.SwIfIndex 1518 size += 4 // m.SupSwIfIndex 1519 size += 1 * 6 // m.L2Address 1520 size += 4 // m.Flags 1521 size += 4 // m.Type 1522 size += 4 // m.LinkDuplex 1523 size += 4 // m.LinkSpeed 1524 size += 2 // m.LinkMtu 1525 size += 4 * 4 // m.Mtu 1526 size += 4 // m.SubID 1527 size += 1 // m.SubNumberOfTags 1528 size += 2 // m.SubOuterVlanID 1529 size += 2 // m.SubInnerVlanID 1530 size += 4 // m.SubIfFlags 1531 size += 4 // m.VtrOp 1532 size += 4 // m.VtrPushDot1q 1533 size += 4 // m.VtrTag1 1534 size += 4 // m.VtrTag2 1535 size += 2 // m.OuterTag 1536 size += 1 * 6 // m.BDmac 1537 size += 1 * 6 // m.BSmac 1538 size += 2 // m.BVlanid 1539 size += 4 // m.ISid 1540 size += 64 // m.InterfaceName 1541 size += 64 // m.InterfaceDevType 1542 size += 64 // m.Tag 1543 return size 1544 } 1545 func (m *SwInterfaceDetails) Marshal(b []byte) ([]byte, error) { 1546 if b == nil { 1547 b = make([]byte, m.Size()) 1548 } 1549 buf := codec.NewBuffer(b) 1550 buf.EncodeUint32(uint32(m.SwIfIndex)) 1551 buf.EncodeUint32(m.SupSwIfIndex) 1552 buf.EncodeBytes(m.L2Address[:], 6) 1553 buf.EncodeUint32(uint32(m.Flags)) 1554 buf.EncodeUint32(uint32(m.Type)) 1555 buf.EncodeUint32(uint32(m.LinkDuplex)) 1556 buf.EncodeUint32(m.LinkSpeed) 1557 buf.EncodeUint16(m.LinkMtu) 1558 for i := 0; i < 4; i++ { 1559 var x uint32 1560 if i < len(m.Mtu) { 1561 x = uint32(m.Mtu[i]) 1562 } 1563 buf.EncodeUint32(x) 1564 } 1565 buf.EncodeUint32(m.SubID) 1566 buf.EncodeUint8(m.SubNumberOfTags) 1567 buf.EncodeUint16(m.SubOuterVlanID) 1568 buf.EncodeUint16(m.SubInnerVlanID) 1569 buf.EncodeUint32(uint32(m.SubIfFlags)) 1570 buf.EncodeUint32(m.VtrOp) 1571 buf.EncodeUint32(m.VtrPushDot1q) 1572 buf.EncodeUint32(m.VtrTag1) 1573 buf.EncodeUint32(m.VtrTag2) 1574 buf.EncodeUint16(m.OuterTag) 1575 buf.EncodeBytes(m.BDmac[:], 6) 1576 buf.EncodeBytes(m.BSmac[:], 6) 1577 buf.EncodeUint16(m.BVlanid) 1578 buf.EncodeUint32(m.ISid) 1579 buf.EncodeString(m.InterfaceName, 64) 1580 buf.EncodeString(m.InterfaceDevType, 64) 1581 buf.EncodeString(m.Tag, 64) 1582 return buf.Bytes(), nil 1583 } 1584 func (m *SwInterfaceDetails) Unmarshal(b []byte) error { 1585 buf := codec.NewBuffer(b) 1586 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1587 m.SupSwIfIndex = buf.DecodeUint32() 1588 copy(m.L2Address[:], buf.DecodeBytes(6)) 1589 m.Flags = interface_types.IfStatusFlags(buf.DecodeUint32()) 1590 m.Type = interface_types.IfType(buf.DecodeUint32()) 1591 m.LinkDuplex = interface_types.LinkDuplex(buf.DecodeUint32()) 1592 m.LinkSpeed = buf.DecodeUint32() 1593 m.LinkMtu = buf.DecodeUint16() 1594 m.Mtu = make([]uint32, 4) 1595 for i := 0; i < len(m.Mtu); i++ { 1596 m.Mtu[i] = buf.DecodeUint32() 1597 } 1598 m.SubID = buf.DecodeUint32() 1599 m.SubNumberOfTags = buf.DecodeUint8() 1600 m.SubOuterVlanID = buf.DecodeUint16() 1601 m.SubInnerVlanID = buf.DecodeUint16() 1602 m.SubIfFlags = interface_types.SubIfFlags(buf.DecodeUint32()) 1603 m.VtrOp = buf.DecodeUint32() 1604 m.VtrPushDot1q = buf.DecodeUint32() 1605 m.VtrTag1 = buf.DecodeUint32() 1606 m.VtrTag2 = buf.DecodeUint32() 1607 m.OuterTag = buf.DecodeUint16() 1608 copy(m.BDmac[:], buf.DecodeBytes(6)) 1609 copy(m.BSmac[:], buf.DecodeBytes(6)) 1610 m.BVlanid = buf.DecodeUint16() 1611 m.ISid = buf.DecodeUint32() 1612 m.InterfaceName = buf.DecodeString(64) 1613 m.InterfaceDevType = buf.DecodeString(64) 1614 m.Tag = buf.DecodeString(64) 1615 return nil 1616 } 1617 1618 // Request all or filtered subset of sw_interface_details 1619 // - sw_if_index - index of the interface to dump info on, 0 or ~0 if on all 1620 // TODO: Support selecting only index==0 when CSIT is ready. 1621 // - name_filter_valid - 1 if requesting a filtered subset of records else 0 1622 // if name filter is set as valid, sw_if_index value is ignored and all interfaces are examined 1623 // - name_filter - interface name substring filter. Eg. loop1 returns [loop1, loop10] 1624 // 1625 // SwInterfaceDump defines message 'sw_interface_dump'. 1626 type SwInterfaceDump struct { 1627 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"` 1628 NameFilterValid bool `binapi:"bool,name=name_filter_valid" json:"name_filter_valid,omitempty"` 1629 NameFilter string `binapi:"string[],name=name_filter" json:"name_filter,omitempty"` 1630 } 1631 1632 func (m *SwInterfaceDump) Reset() { *m = SwInterfaceDump{} } 1633 func (*SwInterfaceDump) GetMessageName() string { return "sw_interface_dump" } 1634 func (*SwInterfaceDump) GetCrcString() string { return "aa610c27" } 1635 func (*SwInterfaceDump) GetMessageType() api.MessageType { 1636 return api.RequestMessage 1637 } 1638 1639 func (m *SwInterfaceDump) Size() (size int) { 1640 if m == nil { 1641 return 0 1642 } 1643 size += 4 // m.SwIfIndex 1644 size += 1 // m.NameFilterValid 1645 size += 4 + len(m.NameFilter) // m.NameFilter 1646 return size 1647 } 1648 func (m *SwInterfaceDump) Marshal(b []byte) ([]byte, error) { 1649 if b == nil { 1650 b = make([]byte, m.Size()) 1651 } 1652 buf := codec.NewBuffer(b) 1653 buf.EncodeUint32(uint32(m.SwIfIndex)) 1654 buf.EncodeBool(m.NameFilterValid) 1655 buf.EncodeString(m.NameFilter, 0) 1656 return buf.Bytes(), nil 1657 } 1658 func (m *SwInterfaceDump) Unmarshal(b []byte) error { 1659 buf := codec.NewBuffer(b) 1660 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1661 m.NameFilterValid = buf.DecodeBool() 1662 m.NameFilter = buf.DecodeString(0) 1663 return nil 1664 } 1665 1666 // Interface Event generated by want_interface_events 1667 // - pid - client pid registered to receive notification 1668 // - sw_if_index - index of the interface of the event 1669 // - flags - interface_status flags 1670 // - deleted - interface was deleted 1671 // 1672 // SwInterfaceEvent defines message 'sw_interface_event'. 1673 type SwInterfaceEvent struct { 1674 PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"` 1675 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 1676 Flags interface_types.IfStatusFlags `binapi:"if_status_flags,name=flags" json:"flags,omitempty"` 1677 Deleted bool `binapi:"bool,name=deleted" json:"deleted,omitempty"` 1678 } 1679 1680 func (m *SwInterfaceEvent) Reset() { *m = SwInterfaceEvent{} } 1681 func (*SwInterfaceEvent) GetMessageName() string { return "sw_interface_event" } 1682 func (*SwInterfaceEvent) GetCrcString() string { return "2d3d95a7" } 1683 func (*SwInterfaceEvent) GetMessageType() api.MessageType { 1684 return api.EventMessage 1685 } 1686 1687 func (m *SwInterfaceEvent) Size() (size int) { 1688 if m == nil { 1689 return 0 1690 } 1691 size += 4 // m.PID 1692 size += 4 // m.SwIfIndex 1693 size += 4 // m.Flags 1694 size += 1 // m.Deleted 1695 return size 1696 } 1697 func (m *SwInterfaceEvent) Marshal(b []byte) ([]byte, error) { 1698 if b == nil { 1699 b = make([]byte, m.Size()) 1700 } 1701 buf := codec.NewBuffer(b) 1702 buf.EncodeUint32(m.PID) 1703 buf.EncodeUint32(uint32(m.SwIfIndex)) 1704 buf.EncodeUint32(uint32(m.Flags)) 1705 buf.EncodeBool(m.Deleted) 1706 return buf.Bytes(), nil 1707 } 1708 func (m *SwInterfaceEvent) Unmarshal(b []byte) error { 1709 buf := codec.NewBuffer(b) 1710 m.PID = buf.DecodeUint32() 1711 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1712 m.Flags = interface_types.IfStatusFlags(buf.DecodeUint32()) 1713 m.Deleted = buf.DecodeBool() 1714 return nil 1715 } 1716 1717 // Get interface's MAC address 1718 // - sw_if_index - the interface whose MAC will be returned 1719 // 1720 // SwInterfaceGetMacAddress defines message 'sw_interface_get_mac_address'. 1721 type SwInterfaceGetMacAddress struct { 1722 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 1723 } 1724 1725 func (m *SwInterfaceGetMacAddress) Reset() { *m = SwInterfaceGetMacAddress{} } 1726 func (*SwInterfaceGetMacAddress) GetMessageName() string { return "sw_interface_get_mac_address" } 1727 func (*SwInterfaceGetMacAddress) GetCrcString() string { return "f9e6675e" } 1728 func (*SwInterfaceGetMacAddress) GetMessageType() api.MessageType { 1729 return api.RequestMessage 1730 } 1731 1732 func (m *SwInterfaceGetMacAddress) Size() (size int) { 1733 if m == nil { 1734 return 0 1735 } 1736 size += 4 // m.SwIfIndex 1737 return size 1738 } 1739 func (m *SwInterfaceGetMacAddress) Marshal(b []byte) ([]byte, error) { 1740 if b == nil { 1741 b = make([]byte, m.Size()) 1742 } 1743 buf := codec.NewBuffer(b) 1744 buf.EncodeUint32(uint32(m.SwIfIndex)) 1745 return buf.Bytes(), nil 1746 } 1747 func (m *SwInterfaceGetMacAddress) Unmarshal(b []byte) error { 1748 buf := codec.NewBuffer(b) 1749 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1750 return nil 1751 } 1752 1753 // Reply for get interface's MAC address request 1754 // - retval - return code 1755 // - mac_addr - returned interface's MAC address 1756 // 1757 // SwInterfaceGetMacAddressReply defines message 'sw_interface_get_mac_address_reply'. 1758 type SwInterfaceGetMacAddressReply struct { 1759 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1760 MacAddress ethernet_types.MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"` 1761 } 1762 1763 func (m *SwInterfaceGetMacAddressReply) Reset() { *m = SwInterfaceGetMacAddressReply{} } 1764 func (*SwInterfaceGetMacAddressReply) GetMessageName() string { 1765 return "sw_interface_get_mac_address_reply" 1766 } 1767 func (*SwInterfaceGetMacAddressReply) GetCrcString() string { return "40ef2c08" } 1768 func (*SwInterfaceGetMacAddressReply) GetMessageType() api.MessageType { 1769 return api.ReplyMessage 1770 } 1771 1772 func (m *SwInterfaceGetMacAddressReply) Size() (size int) { 1773 if m == nil { 1774 return 0 1775 } 1776 size += 4 // m.Retval 1777 size += 1 * 6 // m.MacAddress 1778 return size 1779 } 1780 func (m *SwInterfaceGetMacAddressReply) Marshal(b []byte) ([]byte, error) { 1781 if b == nil { 1782 b = make([]byte, m.Size()) 1783 } 1784 buf := codec.NewBuffer(b) 1785 buf.EncodeInt32(m.Retval) 1786 buf.EncodeBytes(m.MacAddress[:], 6) 1787 return buf.Bytes(), nil 1788 } 1789 func (m *SwInterfaceGetMacAddressReply) Unmarshal(b []byte) error { 1790 buf := codec.NewBuffer(b) 1791 m.Retval = buf.DecodeInt32() 1792 copy(m.MacAddress[:], buf.DecodeBytes(6)) 1793 return nil 1794 } 1795 1796 // Get VRF id assigned to interface 1797 // - sw_if_index - index of the interface 1798 // 1799 // SwInterfaceGetTable defines message 'sw_interface_get_table'. 1800 type SwInterfaceGetTable struct { 1801 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 1802 IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"` 1803 } 1804 1805 func (m *SwInterfaceGetTable) Reset() { *m = SwInterfaceGetTable{} } 1806 func (*SwInterfaceGetTable) GetMessageName() string { return "sw_interface_get_table" } 1807 func (*SwInterfaceGetTable) GetCrcString() string { return "2d033de4" } 1808 func (*SwInterfaceGetTable) GetMessageType() api.MessageType { 1809 return api.RequestMessage 1810 } 1811 1812 func (m *SwInterfaceGetTable) Size() (size int) { 1813 if m == nil { 1814 return 0 1815 } 1816 size += 4 // m.SwIfIndex 1817 size += 1 // m.IsIPv6 1818 return size 1819 } 1820 func (m *SwInterfaceGetTable) Marshal(b []byte) ([]byte, error) { 1821 if b == nil { 1822 b = make([]byte, m.Size()) 1823 } 1824 buf := codec.NewBuffer(b) 1825 buf.EncodeUint32(uint32(m.SwIfIndex)) 1826 buf.EncodeBool(m.IsIPv6) 1827 return buf.Bytes(), nil 1828 } 1829 func (m *SwInterfaceGetTable) Unmarshal(b []byte) error { 1830 buf := codec.NewBuffer(b) 1831 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1832 m.IsIPv6 = buf.DecodeBool() 1833 return nil 1834 } 1835 1836 // Reply to get_sw_interface_vrf 1837 // - vrf_id - VRF id assigned to the interface 1838 // 1839 // SwInterfaceGetTableReply defines message 'sw_interface_get_table_reply'. 1840 type SwInterfaceGetTableReply struct { 1841 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1842 VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"` 1843 } 1844 1845 func (m *SwInterfaceGetTableReply) Reset() { *m = SwInterfaceGetTableReply{} } 1846 func (*SwInterfaceGetTableReply) GetMessageName() string { return "sw_interface_get_table_reply" } 1847 func (*SwInterfaceGetTableReply) GetCrcString() string { return "a6eb0109" } 1848 func (*SwInterfaceGetTableReply) GetMessageType() api.MessageType { 1849 return api.ReplyMessage 1850 } 1851 1852 func (m *SwInterfaceGetTableReply) Size() (size int) { 1853 if m == nil { 1854 return 0 1855 } 1856 size += 4 // m.Retval 1857 size += 4 // m.VrfID 1858 return size 1859 } 1860 func (m *SwInterfaceGetTableReply) Marshal(b []byte) ([]byte, error) { 1861 if b == nil { 1862 b = make([]byte, m.Size()) 1863 } 1864 buf := codec.NewBuffer(b) 1865 buf.EncodeInt32(m.Retval) 1866 buf.EncodeUint32(m.VrfID) 1867 return buf.Bytes(), nil 1868 } 1869 func (m *SwInterfaceGetTableReply) Unmarshal(b []byte) error { 1870 buf := codec.NewBuffer(b) 1871 m.Retval = buf.DecodeInt32() 1872 m.VrfID = buf.DecodeUint32() 1873 return nil 1874 } 1875 1876 // show the interface's queue - thread placement 1877 // 1878 // This api is used to display the interface and queue worker 1879 // thread placement. One message per rx-queue per interface will 1880 // be sent to client. 1881 // Each message will contain information about rx-queue id of an 1882 // interface, interface index, thread on which this rx-queue is 1883 // placed and mode of rx-queue. 1884 // - sw_if_index - the interface whose rx-placement will be dumped 1885 // - queue_id - the queue id 1886 // - worker_id - the worker id on which queue_id is placed, 1887 // worker_id = 0 means main thread. 1888 // - mode - polling=1, interrupt=2, adaptive=3 1889 // 1890 // SwInterfaceRxPlacementDetails defines message 'sw_interface_rx_placement_details'. 1891 type SwInterfaceRxPlacementDetails struct { 1892 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 1893 QueueID uint32 `binapi:"u32,name=queue_id" json:"queue_id,omitempty"` 1894 WorkerID uint32 `binapi:"u32,name=worker_id" json:"worker_id,omitempty"` 1895 Mode interface_types.RxMode `binapi:"rx_mode,name=mode" json:"mode,omitempty"` 1896 } 1897 1898 func (m *SwInterfaceRxPlacementDetails) Reset() { *m = SwInterfaceRxPlacementDetails{} } 1899 func (*SwInterfaceRxPlacementDetails) GetMessageName() string { 1900 return "sw_interface_rx_placement_details" 1901 } 1902 func (*SwInterfaceRxPlacementDetails) GetCrcString() string { return "9e44a7ce" } 1903 func (*SwInterfaceRxPlacementDetails) GetMessageType() api.MessageType { 1904 return api.RequestMessage 1905 } 1906 1907 func (m *SwInterfaceRxPlacementDetails) Size() (size int) { 1908 if m == nil { 1909 return 0 1910 } 1911 size += 4 // m.SwIfIndex 1912 size += 4 // m.QueueID 1913 size += 4 // m.WorkerID 1914 size += 4 // m.Mode 1915 return size 1916 } 1917 func (m *SwInterfaceRxPlacementDetails) Marshal(b []byte) ([]byte, error) { 1918 if b == nil { 1919 b = make([]byte, m.Size()) 1920 } 1921 buf := codec.NewBuffer(b) 1922 buf.EncodeUint32(uint32(m.SwIfIndex)) 1923 buf.EncodeUint32(m.QueueID) 1924 buf.EncodeUint32(m.WorkerID) 1925 buf.EncodeUint32(uint32(m.Mode)) 1926 return buf.Bytes(), nil 1927 } 1928 func (m *SwInterfaceRxPlacementDetails) Unmarshal(b []byte) error { 1929 buf := codec.NewBuffer(b) 1930 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1931 m.QueueID = buf.DecodeUint32() 1932 m.WorkerID = buf.DecodeUint32() 1933 m.Mode = interface_types.RxMode(buf.DecodeUint32()) 1934 return nil 1935 } 1936 1937 // dump the rx queue placement of interface(s) 1938 // - sw_if_index - optional interface index for which queue placement to 1939 // be requested. sw_if_index = ~0 will dump placement information for all 1940 // interfaces. It will not dump information related to sub-interfaces, p2p 1941 // and pipe interfaces. 1942 // 1943 // SwInterfaceRxPlacementDump defines message 'sw_interface_rx_placement_dump'. 1944 type SwInterfaceRxPlacementDump struct { 1945 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 1946 } 1947 1948 func (m *SwInterfaceRxPlacementDump) Reset() { *m = SwInterfaceRxPlacementDump{} } 1949 func (*SwInterfaceRxPlacementDump) GetMessageName() string { return "sw_interface_rx_placement_dump" } 1950 func (*SwInterfaceRxPlacementDump) GetCrcString() string { return "f9e6675e" } 1951 func (*SwInterfaceRxPlacementDump) GetMessageType() api.MessageType { 1952 return api.RequestMessage 1953 } 1954 1955 func (m *SwInterfaceRxPlacementDump) Size() (size int) { 1956 if m == nil { 1957 return 0 1958 } 1959 size += 4 // m.SwIfIndex 1960 return size 1961 } 1962 func (m *SwInterfaceRxPlacementDump) Marshal(b []byte) ([]byte, error) { 1963 if b == nil { 1964 b = make([]byte, m.Size()) 1965 } 1966 buf := codec.NewBuffer(b) 1967 buf.EncodeUint32(uint32(m.SwIfIndex)) 1968 return buf.Bytes(), nil 1969 } 1970 func (m *SwInterfaceRxPlacementDump) Unmarshal(b []byte) error { 1971 buf := codec.NewBuffer(b) 1972 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1973 return nil 1974 } 1975 1976 // Set flags on the interface 1977 // - sw_if_index - index of the interface to set flags on 1978 // - flags - interface_status flags 1979 // (only IF_STATUS_API_FLAG_ADMIN_UP used in config) 1980 // 1981 // SwInterfaceSetFlags defines message 'sw_interface_set_flags'. 1982 type SwInterfaceSetFlags struct { 1983 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 1984 Flags interface_types.IfStatusFlags `binapi:"if_status_flags,name=flags" json:"flags,omitempty"` 1985 } 1986 1987 func (m *SwInterfaceSetFlags) Reset() { *m = SwInterfaceSetFlags{} } 1988 func (*SwInterfaceSetFlags) GetMessageName() string { return "sw_interface_set_flags" } 1989 func (*SwInterfaceSetFlags) GetCrcString() string { return "f5aec1b8" } 1990 func (*SwInterfaceSetFlags) GetMessageType() api.MessageType { 1991 return api.RequestMessage 1992 } 1993 1994 func (m *SwInterfaceSetFlags) Size() (size int) { 1995 if m == nil { 1996 return 0 1997 } 1998 size += 4 // m.SwIfIndex 1999 size += 4 // m.Flags 2000 return size 2001 } 2002 func (m *SwInterfaceSetFlags) Marshal(b []byte) ([]byte, error) { 2003 if b == nil { 2004 b = make([]byte, m.Size()) 2005 } 2006 buf := codec.NewBuffer(b) 2007 buf.EncodeUint32(uint32(m.SwIfIndex)) 2008 buf.EncodeUint32(uint32(m.Flags)) 2009 return buf.Bytes(), nil 2010 } 2011 func (m *SwInterfaceSetFlags) Unmarshal(b []byte) error { 2012 buf := codec.NewBuffer(b) 2013 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 2014 m.Flags = interface_types.IfStatusFlags(buf.DecodeUint32()) 2015 return nil 2016 } 2017 2018 // SwInterfaceSetFlagsReply defines message 'sw_interface_set_flags_reply'. 2019 type SwInterfaceSetFlagsReply struct { 2020 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 2021 } 2022 2023 func (m *SwInterfaceSetFlagsReply) Reset() { *m = SwInterfaceSetFlagsReply{} } 2024 func (*SwInterfaceSetFlagsReply) GetMessageName() string { return "sw_interface_set_flags_reply" } 2025 func (*SwInterfaceSetFlagsReply) GetCrcString() string { return "e8d4e804" } 2026 func (*SwInterfaceSetFlagsReply) GetMessageType() api.MessageType { 2027 return api.ReplyMessage 2028 } 2029 2030 func (m *SwInterfaceSetFlagsReply) Size() (size int) { 2031 if m == nil { 2032 return 0 2033 } 2034 size += 4 // m.Retval 2035 return size 2036 } 2037 func (m *SwInterfaceSetFlagsReply) Marshal(b []byte) ([]byte, error) { 2038 if b == nil { 2039 b = make([]byte, m.Size()) 2040 } 2041 buf := codec.NewBuffer(b) 2042 buf.EncodeInt32(m.Retval) 2043 return buf.Bytes(), nil 2044 } 2045 func (m *SwInterfaceSetFlagsReply) Unmarshal(b []byte) error { 2046 buf := codec.NewBuffer(b) 2047 m.Retval = buf.DecodeInt32() 2048 return nil 2049 } 2050 2051 // Set custom interface name 2052 // 2053 // Set custom interface name for the interface. 2054 // - sw_if_index - the interface whose name will be set 2055 // - name - the custom interface name to be set 2056 // 2057 // k 2058 // SwInterfaceSetInterfaceName defines message 'sw_interface_set_interface_name'. 2059 type SwInterfaceSetInterfaceName struct { 2060 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 2061 Name string `binapi:"string[64],name=name" json:"name,omitempty"` 2062 } 2063 2064 func (m *SwInterfaceSetInterfaceName) Reset() { *m = SwInterfaceSetInterfaceName{} } 2065 func (*SwInterfaceSetInterfaceName) GetMessageName() string { return "sw_interface_set_interface_name" } 2066 func (*SwInterfaceSetInterfaceName) GetCrcString() string { return "45a1d548" } 2067 func (*SwInterfaceSetInterfaceName) GetMessageType() api.MessageType { 2068 return api.RequestMessage 2069 } 2070 2071 func (m *SwInterfaceSetInterfaceName) Size() (size int) { 2072 if m == nil { 2073 return 0 2074 } 2075 size += 4 // m.SwIfIndex 2076 size += 64 // m.Name 2077 return size 2078 } 2079 func (m *SwInterfaceSetInterfaceName) Marshal(b []byte) ([]byte, error) { 2080 if b == nil { 2081 b = make([]byte, m.Size()) 2082 } 2083 buf := codec.NewBuffer(b) 2084 buf.EncodeUint32(uint32(m.SwIfIndex)) 2085 buf.EncodeString(m.Name, 64) 2086 return buf.Bytes(), nil 2087 } 2088 func (m *SwInterfaceSetInterfaceName) Unmarshal(b []byte) error { 2089 buf := codec.NewBuffer(b) 2090 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 2091 m.Name = buf.DecodeString(64) 2092 return nil 2093 } 2094 2095 // SwInterfaceSetInterfaceNameReply defines message 'sw_interface_set_interface_name_reply'. 2096 type SwInterfaceSetInterfaceNameReply struct { 2097 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 2098 } 2099 2100 func (m *SwInterfaceSetInterfaceNameReply) Reset() { *m = SwInterfaceSetInterfaceNameReply{} } 2101 func (*SwInterfaceSetInterfaceNameReply) GetMessageName() string { 2102 return "sw_interface_set_interface_name_reply" 2103 } 2104 func (*SwInterfaceSetInterfaceNameReply) GetCrcString() string { return "e8d4e804" } 2105 func (*SwInterfaceSetInterfaceNameReply) GetMessageType() api.MessageType { 2106 return api.ReplyMessage 2107 } 2108 2109 func (m *SwInterfaceSetInterfaceNameReply) Size() (size int) { 2110 if m == nil { 2111 return 0 2112 } 2113 size += 4 // m.Retval 2114 return size 2115 } 2116 func (m *SwInterfaceSetInterfaceNameReply) Marshal(b []byte) ([]byte, error) { 2117 if b == nil { 2118 b = make([]byte, m.Size()) 2119 } 2120 buf := codec.NewBuffer(b) 2121 buf.EncodeInt32(m.Retval) 2122 return buf.Bytes(), nil 2123 } 2124 func (m *SwInterfaceSetInterfaceNameReply) Unmarshal(b []byte) error { 2125 buf := codec.NewBuffer(b) 2126 m.Retval = buf.DecodeInt32() 2127 return nil 2128 } 2129 2130 // Set IP4 directed broadcast 2131 // 2132 // The directed broadcast enabled a packet sent to the interface's 2133 // subnet address will be broadcast on the interface 2134 // - sw_if_index 2135 // - enable 2136 // 2137 // SwInterfaceSetIPDirectedBroadcast defines message 'sw_interface_set_ip_directed_broadcast'. 2138 type SwInterfaceSetIPDirectedBroadcast struct { 2139 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 2140 Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"` 2141 } 2142 2143 func (m *SwInterfaceSetIPDirectedBroadcast) Reset() { *m = SwInterfaceSetIPDirectedBroadcast{} } 2144 func (*SwInterfaceSetIPDirectedBroadcast) GetMessageName() string { 2145 return "sw_interface_set_ip_directed_broadcast" 2146 } 2147 func (*SwInterfaceSetIPDirectedBroadcast) GetCrcString() string { return "ae6cfcfb" } 2148 func (*SwInterfaceSetIPDirectedBroadcast) GetMessageType() api.MessageType { 2149 return api.RequestMessage 2150 } 2151 2152 func (m *SwInterfaceSetIPDirectedBroadcast) Size() (size int) { 2153 if m == nil { 2154 return 0 2155 } 2156 size += 4 // m.SwIfIndex 2157 size += 1 // m.Enable 2158 return size 2159 } 2160 func (m *SwInterfaceSetIPDirectedBroadcast) Marshal(b []byte) ([]byte, error) { 2161 if b == nil { 2162 b = make([]byte, m.Size()) 2163 } 2164 buf := codec.NewBuffer(b) 2165 buf.EncodeUint32(uint32(m.SwIfIndex)) 2166 buf.EncodeBool(m.Enable) 2167 return buf.Bytes(), nil 2168 } 2169 func (m *SwInterfaceSetIPDirectedBroadcast) Unmarshal(b []byte) error { 2170 buf := codec.NewBuffer(b) 2171 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 2172 m.Enable = buf.DecodeBool() 2173 return nil 2174 } 2175 2176 // SwInterfaceSetIPDirectedBroadcastReply defines message 'sw_interface_set_ip_directed_broadcast_reply'. 2177 type SwInterfaceSetIPDirectedBroadcastReply struct { 2178 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 2179 } 2180 2181 func (m *SwInterfaceSetIPDirectedBroadcastReply) Reset() { 2182 *m = SwInterfaceSetIPDirectedBroadcastReply{} 2183 } 2184 func (*SwInterfaceSetIPDirectedBroadcastReply) GetMessageName() string { 2185 return "sw_interface_set_ip_directed_broadcast_reply" 2186 } 2187 func (*SwInterfaceSetIPDirectedBroadcastReply) GetCrcString() string { return "e8d4e804" } 2188 func (*SwInterfaceSetIPDirectedBroadcastReply) GetMessageType() api.MessageType { 2189 return api.ReplyMessage 2190 } 2191 2192 func (m *SwInterfaceSetIPDirectedBroadcastReply) Size() (size int) { 2193 if m == nil { 2194 return 0 2195 } 2196 size += 4 // m.Retval 2197 return size 2198 } 2199 func (m *SwInterfaceSetIPDirectedBroadcastReply) Marshal(b []byte) ([]byte, error) { 2200 if b == nil { 2201 b = make([]byte, m.Size()) 2202 } 2203 buf := codec.NewBuffer(b) 2204 buf.EncodeInt32(m.Retval) 2205 return buf.Bytes(), nil 2206 } 2207 func (m *SwInterfaceSetIPDirectedBroadcastReply) Unmarshal(b []byte) error { 2208 buf := codec.NewBuffer(b) 2209 m.Retval = buf.DecodeInt32() 2210 return nil 2211 } 2212 2213 // Set an interface's MAC address 2214 // - sw_if_index - the interface whose MAC will be set 2215 // - mac_addr - the new MAC address 2216 // 2217 // SwInterfaceSetMacAddress defines message 'sw_interface_set_mac_address'. 2218 type SwInterfaceSetMacAddress struct { 2219 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 2220 MacAddress ethernet_types.MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"` 2221 } 2222 2223 func (m *SwInterfaceSetMacAddress) Reset() { *m = SwInterfaceSetMacAddress{} } 2224 func (*SwInterfaceSetMacAddress) GetMessageName() string { return "sw_interface_set_mac_address" } 2225 func (*SwInterfaceSetMacAddress) GetCrcString() string { return "c536e7eb" } 2226 func (*SwInterfaceSetMacAddress) GetMessageType() api.MessageType { 2227 return api.RequestMessage 2228 } 2229 2230 func (m *SwInterfaceSetMacAddress) Size() (size int) { 2231 if m == nil { 2232 return 0 2233 } 2234 size += 4 // m.SwIfIndex 2235 size += 1 * 6 // m.MacAddress 2236 return size 2237 } 2238 func (m *SwInterfaceSetMacAddress) Marshal(b []byte) ([]byte, error) { 2239 if b == nil { 2240 b = make([]byte, m.Size()) 2241 } 2242 buf := codec.NewBuffer(b) 2243 buf.EncodeUint32(uint32(m.SwIfIndex)) 2244 buf.EncodeBytes(m.MacAddress[:], 6) 2245 return buf.Bytes(), nil 2246 } 2247 func (m *SwInterfaceSetMacAddress) Unmarshal(b []byte) error { 2248 buf := codec.NewBuffer(b) 2249 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 2250 copy(m.MacAddress[:], buf.DecodeBytes(6)) 2251 return nil 2252 } 2253 2254 // SwInterfaceSetMacAddressReply defines message 'sw_interface_set_mac_address_reply'. 2255 type SwInterfaceSetMacAddressReply struct { 2256 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 2257 } 2258 2259 func (m *SwInterfaceSetMacAddressReply) Reset() { *m = SwInterfaceSetMacAddressReply{} } 2260 func (*SwInterfaceSetMacAddressReply) GetMessageName() string { 2261 return "sw_interface_set_mac_address_reply" 2262 } 2263 func (*SwInterfaceSetMacAddressReply) GetCrcString() string { return "e8d4e804" } 2264 func (*SwInterfaceSetMacAddressReply) GetMessageType() api.MessageType { 2265 return api.ReplyMessage 2266 } 2267 2268 func (m *SwInterfaceSetMacAddressReply) Size() (size int) { 2269 if m == nil { 2270 return 0 2271 } 2272 size += 4 // m.Retval 2273 return size 2274 } 2275 func (m *SwInterfaceSetMacAddressReply) Marshal(b []byte) ([]byte, error) { 2276 if b == nil { 2277 b = make([]byte, m.Size()) 2278 } 2279 buf := codec.NewBuffer(b) 2280 buf.EncodeInt32(m.Retval) 2281 return buf.Bytes(), nil 2282 } 2283 func (m *SwInterfaceSetMacAddressReply) Unmarshal(b []byte) error { 2284 buf := codec.NewBuffer(b) 2285 m.Retval = buf.DecodeInt32() 2286 return nil 2287 } 2288 2289 // Set interface L3 MTU 2290 // SwInterfaceSetMtu defines message 'sw_interface_set_mtu'. 2291 type SwInterfaceSetMtu struct { 2292 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 2293 Mtu []uint32 `binapi:"u32[4],name=mtu" json:"mtu,omitempty"` 2294 } 2295 2296 func (m *SwInterfaceSetMtu) Reset() { *m = SwInterfaceSetMtu{} } 2297 func (*SwInterfaceSetMtu) GetMessageName() string { return "sw_interface_set_mtu" } 2298 func (*SwInterfaceSetMtu) GetCrcString() string { return "5cbe85e5" } 2299 func (*SwInterfaceSetMtu) GetMessageType() api.MessageType { 2300 return api.RequestMessage 2301 } 2302 2303 func (m *SwInterfaceSetMtu) Size() (size int) { 2304 if m == nil { 2305 return 0 2306 } 2307 size += 4 // m.SwIfIndex 2308 size += 4 * 4 // m.Mtu 2309 return size 2310 } 2311 func (m *SwInterfaceSetMtu) Marshal(b []byte) ([]byte, error) { 2312 if b == nil { 2313 b = make([]byte, m.Size()) 2314 } 2315 buf := codec.NewBuffer(b) 2316 buf.EncodeUint32(uint32(m.SwIfIndex)) 2317 for i := 0; i < 4; i++ { 2318 var x uint32 2319 if i < len(m.Mtu) { 2320 x = uint32(m.Mtu[i]) 2321 } 2322 buf.EncodeUint32(x) 2323 } 2324 return buf.Bytes(), nil 2325 } 2326 func (m *SwInterfaceSetMtu) Unmarshal(b []byte) error { 2327 buf := codec.NewBuffer(b) 2328 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 2329 m.Mtu = make([]uint32, 4) 2330 for i := 0; i < len(m.Mtu); i++ { 2331 m.Mtu[i] = buf.DecodeUint32() 2332 } 2333 return nil 2334 } 2335 2336 // SwInterfaceSetMtuReply defines message 'sw_interface_set_mtu_reply'. 2337 type SwInterfaceSetMtuReply struct { 2338 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 2339 } 2340 2341 func (m *SwInterfaceSetMtuReply) Reset() { *m = SwInterfaceSetMtuReply{} } 2342 func (*SwInterfaceSetMtuReply) GetMessageName() string { return "sw_interface_set_mtu_reply" } 2343 func (*SwInterfaceSetMtuReply) GetCrcString() string { return "e8d4e804" } 2344 func (*SwInterfaceSetMtuReply) GetMessageType() api.MessageType { 2345 return api.ReplyMessage 2346 } 2347 2348 func (m *SwInterfaceSetMtuReply) Size() (size int) { 2349 if m == nil { 2350 return 0 2351 } 2352 size += 4 // m.Retval 2353 return size 2354 } 2355 func (m *SwInterfaceSetMtuReply) Marshal(b []byte) ([]byte, error) { 2356 if b == nil { 2357 b = make([]byte, m.Size()) 2358 } 2359 buf := codec.NewBuffer(b) 2360 buf.EncodeInt32(m.Retval) 2361 return buf.Bytes(), nil 2362 } 2363 func (m *SwInterfaceSetMtuReply) Unmarshal(b []byte) error { 2364 buf := codec.NewBuffer(b) 2365 m.Retval = buf.DecodeInt32() 2366 return nil 2367 } 2368 2369 // Set interface promiscuous mode 2370 // - sw_if_index - index of the interface to set flags on 2371 // - promisc_on - promiscuous mode is on ? 2372 // 2373 // SwInterfaceSetPromisc defines message 'sw_interface_set_promisc'. 2374 type SwInterfaceSetPromisc struct { 2375 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 2376 PromiscOn bool `binapi:"bool,name=promisc_on" json:"promisc_on,omitempty"` 2377 } 2378 2379 func (m *SwInterfaceSetPromisc) Reset() { *m = SwInterfaceSetPromisc{} } 2380 func (*SwInterfaceSetPromisc) GetMessageName() string { return "sw_interface_set_promisc" } 2381 func (*SwInterfaceSetPromisc) GetCrcString() string { return "d40860d4" } 2382 func (*SwInterfaceSetPromisc) GetMessageType() api.MessageType { 2383 return api.RequestMessage 2384 } 2385 2386 func (m *SwInterfaceSetPromisc) Size() (size int) { 2387 if m == nil { 2388 return 0 2389 } 2390 size += 4 // m.SwIfIndex 2391 size += 1 // m.PromiscOn 2392 return size 2393 } 2394 func (m *SwInterfaceSetPromisc) Marshal(b []byte) ([]byte, error) { 2395 if b == nil { 2396 b = make([]byte, m.Size()) 2397 } 2398 buf := codec.NewBuffer(b) 2399 buf.EncodeUint32(uint32(m.SwIfIndex)) 2400 buf.EncodeBool(m.PromiscOn) 2401 return buf.Bytes(), nil 2402 } 2403 func (m *SwInterfaceSetPromisc) Unmarshal(b []byte) error { 2404 buf := codec.NewBuffer(b) 2405 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 2406 m.PromiscOn = buf.DecodeBool() 2407 return nil 2408 } 2409 2410 // SwInterfaceSetPromiscReply defines message 'sw_interface_set_promisc_reply'. 2411 type SwInterfaceSetPromiscReply struct { 2412 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 2413 } 2414 2415 func (m *SwInterfaceSetPromiscReply) Reset() { *m = SwInterfaceSetPromiscReply{} } 2416 func (*SwInterfaceSetPromiscReply) GetMessageName() string { return "sw_interface_set_promisc_reply" } 2417 func (*SwInterfaceSetPromiscReply) GetCrcString() string { return "e8d4e804" } 2418 func (*SwInterfaceSetPromiscReply) GetMessageType() api.MessageType { 2419 return api.ReplyMessage 2420 } 2421 2422 func (m *SwInterfaceSetPromiscReply) Size() (size int) { 2423 if m == nil { 2424 return 0 2425 } 2426 size += 4 // m.Retval 2427 return size 2428 } 2429 func (m *SwInterfaceSetPromiscReply) Marshal(b []byte) ([]byte, error) { 2430 if b == nil { 2431 b = make([]byte, m.Size()) 2432 } 2433 buf := codec.NewBuffer(b) 2434 buf.EncodeInt32(m.Retval) 2435 return buf.Bytes(), nil 2436 } 2437 func (m *SwInterfaceSetPromiscReply) Unmarshal(b []byte) error { 2438 buf := codec.NewBuffer(b) 2439 m.Retval = buf.DecodeInt32() 2440 return nil 2441 } 2442 2443 // Set an interface's rx-mode 2444 // - sw_if_index - the interface whose rx-mode will be set 2445 // - queue_id_valid - 1 = the queue_id field is valid. 0 means all 2446 // queue_id's 2447 // - queue_id - the queue number whose rx-mode will be set. Only valid 2448 // if queue_id_valid is 1 2449 // - mode - polling=1, interrupt=2, adaptive=3 2450 // 2451 // SwInterfaceSetRxMode defines message 'sw_interface_set_rx_mode'. 2452 type SwInterfaceSetRxMode struct { 2453 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 2454 QueueIDValid bool `binapi:"bool,name=queue_id_valid" json:"queue_id_valid,omitempty"` 2455 QueueID uint32 `binapi:"u32,name=queue_id" json:"queue_id,omitempty"` 2456 Mode interface_types.RxMode `binapi:"rx_mode,name=mode" json:"mode,omitempty"` 2457 } 2458 2459 func (m *SwInterfaceSetRxMode) Reset() { *m = SwInterfaceSetRxMode{} } 2460 func (*SwInterfaceSetRxMode) GetMessageName() string { return "sw_interface_set_rx_mode" } 2461 func (*SwInterfaceSetRxMode) GetCrcString() string { return "b04d1cfe" } 2462 func (*SwInterfaceSetRxMode) GetMessageType() api.MessageType { 2463 return api.RequestMessage 2464 } 2465 2466 func (m *SwInterfaceSetRxMode) Size() (size int) { 2467 if m == nil { 2468 return 0 2469 } 2470 size += 4 // m.SwIfIndex 2471 size += 1 // m.QueueIDValid 2472 size += 4 // m.QueueID 2473 size += 4 // m.Mode 2474 return size 2475 } 2476 func (m *SwInterfaceSetRxMode) Marshal(b []byte) ([]byte, error) { 2477 if b == nil { 2478 b = make([]byte, m.Size()) 2479 } 2480 buf := codec.NewBuffer(b) 2481 buf.EncodeUint32(uint32(m.SwIfIndex)) 2482 buf.EncodeBool(m.QueueIDValid) 2483 buf.EncodeUint32(m.QueueID) 2484 buf.EncodeUint32(uint32(m.Mode)) 2485 return buf.Bytes(), nil 2486 } 2487 func (m *SwInterfaceSetRxMode) Unmarshal(b []byte) error { 2488 buf := codec.NewBuffer(b) 2489 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 2490 m.QueueIDValid = buf.DecodeBool() 2491 m.QueueID = buf.DecodeUint32() 2492 m.Mode = interface_types.RxMode(buf.DecodeUint32()) 2493 return nil 2494 } 2495 2496 // SwInterfaceSetRxModeReply defines message 'sw_interface_set_rx_mode_reply'. 2497 type SwInterfaceSetRxModeReply struct { 2498 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 2499 } 2500 2501 func (m *SwInterfaceSetRxModeReply) Reset() { *m = SwInterfaceSetRxModeReply{} } 2502 func (*SwInterfaceSetRxModeReply) GetMessageName() string { return "sw_interface_set_rx_mode_reply" } 2503 func (*SwInterfaceSetRxModeReply) GetCrcString() string { return "e8d4e804" } 2504 func (*SwInterfaceSetRxModeReply) GetMessageType() api.MessageType { 2505 return api.ReplyMessage 2506 } 2507 2508 func (m *SwInterfaceSetRxModeReply) Size() (size int) { 2509 if m == nil { 2510 return 0 2511 } 2512 size += 4 // m.Retval 2513 return size 2514 } 2515 func (m *SwInterfaceSetRxModeReply) Marshal(b []byte) ([]byte, error) { 2516 if b == nil { 2517 b = make([]byte, m.Size()) 2518 } 2519 buf := codec.NewBuffer(b) 2520 buf.EncodeInt32(m.Retval) 2521 return buf.Bytes(), nil 2522 } 2523 func (m *SwInterfaceSetRxModeReply) Unmarshal(b []byte) error { 2524 buf := codec.NewBuffer(b) 2525 m.Retval = buf.DecodeInt32() 2526 return nil 2527 } 2528 2529 // Set an interface's rx-placement 2530 // 2531 // Rx-Queue placement on specific thread is operational for only hardware 2532 // interface. It will not set queue - thread placement for sub-interfaces, 2533 // p2p and pipe interfaces. 2534 // - sw_if_index - the interface whose rx-placement will be set 2535 // - queue_id - the queue number whose rx-placement will be set. 2536 // - worker_id - the worker number whom rx-placement will be at. 2537 // - is_main - flag to set rx-placement to main thread 2538 // 2539 // SwInterfaceSetRxPlacement defines message 'sw_interface_set_rx_placement'. 2540 type SwInterfaceSetRxPlacement struct { 2541 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 2542 QueueID uint32 `binapi:"u32,name=queue_id" json:"queue_id,omitempty"` 2543 WorkerID uint32 `binapi:"u32,name=worker_id" json:"worker_id,omitempty"` 2544 IsMain bool `binapi:"bool,name=is_main" json:"is_main,omitempty"` 2545 } 2546 2547 func (m *SwInterfaceSetRxPlacement) Reset() { *m = SwInterfaceSetRxPlacement{} } 2548 func (*SwInterfaceSetRxPlacement) GetMessageName() string { return "sw_interface_set_rx_placement" } 2549 func (*SwInterfaceSetRxPlacement) GetCrcString() string { return "db65f3c9" } 2550 func (*SwInterfaceSetRxPlacement) GetMessageType() api.MessageType { 2551 return api.RequestMessage 2552 } 2553 2554 func (m *SwInterfaceSetRxPlacement) Size() (size int) { 2555 if m == nil { 2556 return 0 2557 } 2558 size += 4 // m.SwIfIndex 2559 size += 4 // m.QueueID 2560 size += 4 // m.WorkerID 2561 size += 1 // m.IsMain 2562 return size 2563 } 2564 func (m *SwInterfaceSetRxPlacement) Marshal(b []byte) ([]byte, error) { 2565 if b == nil { 2566 b = make([]byte, m.Size()) 2567 } 2568 buf := codec.NewBuffer(b) 2569 buf.EncodeUint32(uint32(m.SwIfIndex)) 2570 buf.EncodeUint32(m.QueueID) 2571 buf.EncodeUint32(m.WorkerID) 2572 buf.EncodeBool(m.IsMain) 2573 return buf.Bytes(), nil 2574 } 2575 func (m *SwInterfaceSetRxPlacement) Unmarshal(b []byte) error { 2576 buf := codec.NewBuffer(b) 2577 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 2578 m.QueueID = buf.DecodeUint32() 2579 m.WorkerID = buf.DecodeUint32() 2580 m.IsMain = buf.DecodeBool() 2581 return nil 2582 } 2583 2584 // SwInterfaceSetRxPlacementReply defines message 'sw_interface_set_rx_placement_reply'. 2585 type SwInterfaceSetRxPlacementReply struct { 2586 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 2587 } 2588 2589 func (m *SwInterfaceSetRxPlacementReply) Reset() { *m = SwInterfaceSetRxPlacementReply{} } 2590 func (*SwInterfaceSetRxPlacementReply) GetMessageName() string { 2591 return "sw_interface_set_rx_placement_reply" 2592 } 2593 func (*SwInterfaceSetRxPlacementReply) GetCrcString() string { return "e8d4e804" } 2594 func (*SwInterfaceSetRxPlacementReply) GetMessageType() api.MessageType { 2595 return api.ReplyMessage 2596 } 2597 2598 func (m *SwInterfaceSetRxPlacementReply) Size() (size int) { 2599 if m == nil { 2600 return 0 2601 } 2602 size += 4 // m.Retval 2603 return size 2604 } 2605 func (m *SwInterfaceSetRxPlacementReply) Marshal(b []byte) ([]byte, error) { 2606 if b == nil { 2607 b = make([]byte, m.Size()) 2608 } 2609 buf := codec.NewBuffer(b) 2610 buf.EncodeInt32(m.Retval) 2611 return buf.Bytes(), nil 2612 } 2613 func (m *SwInterfaceSetRxPlacementReply) Unmarshal(b []byte) error { 2614 buf := codec.NewBuffer(b) 2615 m.Retval = buf.DecodeInt32() 2616 return nil 2617 } 2618 2619 // Associate the specified interface with a fib table 2620 // - sw_if_index - index of the interface 2621 // - is_ipv6 - if non-zero ipv6, else ipv4 2622 // - vrf_id - fib table/vrf id to associate the interface with 2623 // 2624 // SwInterfaceSetTable defines message 'sw_interface_set_table'. 2625 type SwInterfaceSetTable struct { 2626 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 2627 IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"` 2628 VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"` 2629 } 2630 2631 func (m *SwInterfaceSetTable) Reset() { *m = SwInterfaceSetTable{} } 2632 func (*SwInterfaceSetTable) GetMessageName() string { return "sw_interface_set_table" } 2633 func (*SwInterfaceSetTable) GetCrcString() string { return "df42a577" } 2634 func (*SwInterfaceSetTable) GetMessageType() api.MessageType { 2635 return api.RequestMessage 2636 } 2637 2638 func (m *SwInterfaceSetTable) Size() (size int) { 2639 if m == nil { 2640 return 0 2641 } 2642 size += 4 // m.SwIfIndex 2643 size += 1 // m.IsIPv6 2644 size += 4 // m.VrfID 2645 return size 2646 } 2647 func (m *SwInterfaceSetTable) Marshal(b []byte) ([]byte, error) { 2648 if b == nil { 2649 b = make([]byte, m.Size()) 2650 } 2651 buf := codec.NewBuffer(b) 2652 buf.EncodeUint32(uint32(m.SwIfIndex)) 2653 buf.EncodeBool(m.IsIPv6) 2654 buf.EncodeUint32(m.VrfID) 2655 return buf.Bytes(), nil 2656 } 2657 func (m *SwInterfaceSetTable) Unmarshal(b []byte) error { 2658 buf := codec.NewBuffer(b) 2659 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 2660 m.IsIPv6 = buf.DecodeBool() 2661 m.VrfID = buf.DecodeUint32() 2662 return nil 2663 } 2664 2665 // SwInterfaceSetTableReply defines message 'sw_interface_set_table_reply'. 2666 type SwInterfaceSetTableReply struct { 2667 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 2668 } 2669 2670 func (m *SwInterfaceSetTableReply) Reset() { *m = SwInterfaceSetTableReply{} } 2671 func (*SwInterfaceSetTableReply) GetMessageName() string { return "sw_interface_set_table_reply" } 2672 func (*SwInterfaceSetTableReply) GetCrcString() string { return "e8d4e804" } 2673 func (*SwInterfaceSetTableReply) GetMessageType() api.MessageType { 2674 return api.ReplyMessage 2675 } 2676 2677 func (m *SwInterfaceSetTableReply) Size() (size int) { 2678 if m == nil { 2679 return 0 2680 } 2681 size += 4 // m.Retval 2682 return size 2683 } 2684 func (m *SwInterfaceSetTableReply) Marshal(b []byte) ([]byte, error) { 2685 if b == nil { 2686 b = make([]byte, m.Size()) 2687 } 2688 buf := codec.NewBuffer(b) 2689 buf.EncodeInt32(m.Retval) 2690 return buf.Bytes(), nil 2691 } 2692 func (m *SwInterfaceSetTableReply) Unmarshal(b []byte) error { 2693 buf := codec.NewBuffer(b) 2694 m.Retval = buf.DecodeInt32() 2695 return nil 2696 } 2697 2698 // Set an interface's tx-placement 2699 // 2700 // Tx-Queue placement on specific thread is operational for only hardware 2701 // interface. It will not set queue - thread placement for sub-interfaces, 2702 // p2p and pipe interfaces. 2703 // - sw_if_index - the interface whose tx-placement will be set 2704 // - queue_id - the queue number whose tx-placement will be set. 2705 // - array_size - the size of the thread indexes array 2706 // - threads - the thread indexes of main and worker(s) threads 2707 // whom tx-placement will be at. 2708 // 2709 // SwInterfaceSetTxPlacement defines message 'sw_interface_set_tx_placement'. 2710 type SwInterfaceSetTxPlacement struct { 2711 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 2712 QueueID uint32 `binapi:"u32,name=queue_id" json:"queue_id,omitempty"` 2713 ArraySize uint8 `binapi:"u8,name=array_size" json:"-"` 2714 Threads []uint32 `binapi:"u32[array_size],name=threads" json:"threads,omitempty"` 2715 } 2716 2717 func (m *SwInterfaceSetTxPlacement) Reset() { *m = SwInterfaceSetTxPlacement{} } 2718 func (*SwInterfaceSetTxPlacement) GetMessageName() string { return "sw_interface_set_tx_placement" } 2719 func (*SwInterfaceSetTxPlacement) GetCrcString() string { return "0b855b40" } 2720 func (*SwInterfaceSetTxPlacement) GetMessageType() api.MessageType { 2721 return api.RequestMessage 2722 } 2723 2724 func (m *SwInterfaceSetTxPlacement) Size() (size int) { 2725 if m == nil { 2726 return 0 2727 } 2728 size += 4 // m.SwIfIndex 2729 size += 4 // m.QueueID 2730 size += 1 // m.ArraySize 2731 size += 4 * len(m.Threads) // m.Threads 2732 return size 2733 } 2734 func (m *SwInterfaceSetTxPlacement) Marshal(b []byte) ([]byte, error) { 2735 if b == nil { 2736 b = make([]byte, m.Size()) 2737 } 2738 buf := codec.NewBuffer(b) 2739 buf.EncodeUint32(uint32(m.SwIfIndex)) 2740 buf.EncodeUint32(m.QueueID) 2741 buf.EncodeUint8(uint8(len(m.Threads))) 2742 for i := 0; i < len(m.Threads); i++ { 2743 var x uint32 2744 if i < len(m.Threads) { 2745 x = uint32(m.Threads[i]) 2746 } 2747 buf.EncodeUint32(x) 2748 } 2749 return buf.Bytes(), nil 2750 } 2751 func (m *SwInterfaceSetTxPlacement) Unmarshal(b []byte) error { 2752 buf := codec.NewBuffer(b) 2753 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 2754 m.QueueID = buf.DecodeUint32() 2755 m.ArraySize = buf.DecodeUint8() 2756 m.Threads = make([]uint32, m.ArraySize) 2757 for i := 0; i < len(m.Threads); i++ { 2758 m.Threads[i] = buf.DecodeUint32() 2759 } 2760 return nil 2761 } 2762 2763 // SwInterfaceSetTxPlacementReply defines message 'sw_interface_set_tx_placement_reply'. 2764 type SwInterfaceSetTxPlacementReply struct { 2765 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 2766 } 2767 2768 func (m *SwInterfaceSetTxPlacementReply) Reset() { *m = SwInterfaceSetTxPlacementReply{} } 2769 func (*SwInterfaceSetTxPlacementReply) GetMessageName() string { 2770 return "sw_interface_set_tx_placement_reply" 2771 } 2772 func (*SwInterfaceSetTxPlacementReply) GetCrcString() string { return "e8d4e804" } 2773 func (*SwInterfaceSetTxPlacementReply) GetMessageType() api.MessageType { 2774 return api.ReplyMessage 2775 } 2776 2777 func (m *SwInterfaceSetTxPlacementReply) Size() (size int) { 2778 if m == nil { 2779 return 0 2780 } 2781 size += 4 // m.Retval 2782 return size 2783 } 2784 func (m *SwInterfaceSetTxPlacementReply) Marshal(b []byte) ([]byte, error) { 2785 if b == nil { 2786 b = make([]byte, m.Size()) 2787 } 2788 buf := codec.NewBuffer(b) 2789 buf.EncodeInt32(m.Retval) 2790 return buf.Bytes(), nil 2791 } 2792 func (m *SwInterfaceSetTxPlacementReply) Unmarshal(b []byte) error { 2793 buf := codec.NewBuffer(b) 2794 m.Retval = buf.DecodeInt32() 2795 return nil 2796 } 2797 2798 // Set unnumbered interface add / del request 2799 // - sw_if_index - interface with an IP address 2800 // - unnumbered_sw_if_index - interface which will use the address 2801 // - is_add - if non-zero set the association, else unset it 2802 // 2803 // SwInterfaceSetUnnumbered defines message 'sw_interface_set_unnumbered'. 2804 type SwInterfaceSetUnnumbered struct { 2805 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 2806 UnnumberedSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=unnumbered_sw_if_index" json:"unnumbered_sw_if_index,omitempty"` 2807 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` 2808 } 2809 2810 func (m *SwInterfaceSetUnnumbered) Reset() { *m = SwInterfaceSetUnnumbered{} } 2811 func (*SwInterfaceSetUnnumbered) GetMessageName() string { return "sw_interface_set_unnumbered" } 2812 func (*SwInterfaceSetUnnumbered) GetCrcString() string { return "154a6439" } 2813 func (*SwInterfaceSetUnnumbered) GetMessageType() api.MessageType { 2814 return api.RequestMessage 2815 } 2816 2817 func (m *SwInterfaceSetUnnumbered) Size() (size int) { 2818 if m == nil { 2819 return 0 2820 } 2821 size += 4 // m.SwIfIndex 2822 size += 4 // m.UnnumberedSwIfIndex 2823 size += 1 // m.IsAdd 2824 return size 2825 } 2826 func (m *SwInterfaceSetUnnumbered) Marshal(b []byte) ([]byte, error) { 2827 if b == nil { 2828 b = make([]byte, m.Size()) 2829 } 2830 buf := codec.NewBuffer(b) 2831 buf.EncodeUint32(uint32(m.SwIfIndex)) 2832 buf.EncodeUint32(uint32(m.UnnumberedSwIfIndex)) 2833 buf.EncodeBool(m.IsAdd) 2834 return buf.Bytes(), nil 2835 } 2836 func (m *SwInterfaceSetUnnumbered) Unmarshal(b []byte) error { 2837 buf := codec.NewBuffer(b) 2838 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 2839 m.UnnumberedSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 2840 m.IsAdd = buf.DecodeBool() 2841 return nil 2842 } 2843 2844 // SwInterfaceSetUnnumberedReply defines message 'sw_interface_set_unnumbered_reply'. 2845 type SwInterfaceSetUnnumberedReply struct { 2846 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 2847 } 2848 2849 func (m *SwInterfaceSetUnnumberedReply) Reset() { *m = SwInterfaceSetUnnumberedReply{} } 2850 func (*SwInterfaceSetUnnumberedReply) GetMessageName() string { 2851 return "sw_interface_set_unnumbered_reply" 2852 } 2853 func (*SwInterfaceSetUnnumberedReply) GetCrcString() string { return "e8d4e804" } 2854 func (*SwInterfaceSetUnnumberedReply) GetMessageType() api.MessageType { 2855 return api.ReplyMessage 2856 } 2857 2858 func (m *SwInterfaceSetUnnumberedReply) Size() (size int) { 2859 if m == nil { 2860 return 0 2861 } 2862 size += 4 // m.Retval 2863 return size 2864 } 2865 func (m *SwInterfaceSetUnnumberedReply) Marshal(b []byte) ([]byte, error) { 2866 if b == nil { 2867 b = make([]byte, m.Size()) 2868 } 2869 buf := codec.NewBuffer(b) 2870 buf.EncodeInt32(m.Retval) 2871 return buf.Bytes(), nil 2872 } 2873 func (m *SwInterfaceSetUnnumberedReply) Unmarshal(b []byte) error { 2874 buf := codec.NewBuffer(b) 2875 m.Retval = buf.DecodeInt32() 2876 return nil 2877 } 2878 2879 // Set / clear software interface tag 2880 // - sw_if_index - the interface 2881 // - add_del - 1 = add, 0 = delete 2882 // - tag - an ascii tag 2883 // 2884 // SwInterfaceTagAddDel defines message 'sw_interface_tag_add_del'. 2885 type SwInterfaceTagAddDel struct { 2886 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` 2887 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 2888 Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"` 2889 } 2890 2891 func (m *SwInterfaceTagAddDel) Reset() { *m = SwInterfaceTagAddDel{} } 2892 func (*SwInterfaceTagAddDel) GetMessageName() string { return "sw_interface_tag_add_del" } 2893 func (*SwInterfaceTagAddDel) GetCrcString() string { return "426f8bc1" } 2894 func (*SwInterfaceTagAddDel) GetMessageType() api.MessageType { 2895 return api.RequestMessage 2896 } 2897 2898 func (m *SwInterfaceTagAddDel) Size() (size int) { 2899 if m == nil { 2900 return 0 2901 } 2902 size += 1 // m.IsAdd 2903 size += 4 // m.SwIfIndex 2904 size += 64 // m.Tag 2905 return size 2906 } 2907 func (m *SwInterfaceTagAddDel) Marshal(b []byte) ([]byte, error) { 2908 if b == nil { 2909 b = make([]byte, m.Size()) 2910 } 2911 buf := codec.NewBuffer(b) 2912 buf.EncodeBool(m.IsAdd) 2913 buf.EncodeUint32(uint32(m.SwIfIndex)) 2914 buf.EncodeString(m.Tag, 64) 2915 return buf.Bytes(), nil 2916 } 2917 func (m *SwInterfaceTagAddDel) Unmarshal(b []byte) error { 2918 buf := codec.NewBuffer(b) 2919 m.IsAdd = buf.DecodeBool() 2920 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 2921 m.Tag = buf.DecodeString(64) 2922 return nil 2923 } 2924 2925 // SwInterfaceTagAddDelReply defines message 'sw_interface_tag_add_del_reply'. 2926 type SwInterfaceTagAddDelReply struct { 2927 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 2928 } 2929 2930 func (m *SwInterfaceTagAddDelReply) Reset() { *m = SwInterfaceTagAddDelReply{} } 2931 func (*SwInterfaceTagAddDelReply) GetMessageName() string { return "sw_interface_tag_add_del_reply" } 2932 func (*SwInterfaceTagAddDelReply) GetCrcString() string { return "e8d4e804" } 2933 func (*SwInterfaceTagAddDelReply) GetMessageType() api.MessageType { 2934 return api.ReplyMessage 2935 } 2936 2937 func (m *SwInterfaceTagAddDelReply) Size() (size int) { 2938 if m == nil { 2939 return 0 2940 } 2941 size += 4 // m.Retval 2942 return size 2943 } 2944 func (m *SwInterfaceTagAddDelReply) Marshal(b []byte) ([]byte, error) { 2945 if b == nil { 2946 b = make([]byte, m.Size()) 2947 } 2948 buf := codec.NewBuffer(b) 2949 buf.EncodeInt32(m.Retval) 2950 return buf.Bytes(), nil 2951 } 2952 func (m *SwInterfaceTagAddDelReply) Unmarshal(b []byte) error { 2953 buf := codec.NewBuffer(b) 2954 m.Retval = buf.DecodeInt32() 2955 return nil 2956 } 2957 2958 // show the interface's queue - thread placement 2959 // 2960 // This api is used to display the interface and queue worker 2961 // thread placement. One message per tx-queue per interface will 2962 // be sent to client. 2963 // Each message will contain information about tx-queue id of an 2964 // interface, interface index, thread on which this tx-queue is 2965 // placed and mode of tx-queue. 2966 // - sw_if_index - the interface whose tx-placement will be dumped 2967 // - queue_id - the queue id 2968 // - shared - the queue is shared on other threads 2969 // - array_size - the size of the threads array 2970 // - threads - the main and worker(s) thread index(es) whom tx-placement are at. 2971 // 2972 // SwInterfaceTxPlacementDetails defines message 'sw_interface_tx_placement_details'. 2973 type SwInterfaceTxPlacementDetails struct { 2974 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 2975 QueueID uint32 `binapi:"u32,name=queue_id" json:"queue_id,omitempty"` 2976 Shared uint8 `binapi:"u8,name=shared" json:"shared,omitempty"` 2977 ArraySize uint32 `binapi:"u32,name=array_size" json:"-"` 2978 Threads []uint32 `binapi:"u32[array_size],name=threads" json:"threads,omitempty"` 2979 } 2980 2981 func (m *SwInterfaceTxPlacementDetails) Reset() { *m = SwInterfaceTxPlacementDetails{} } 2982 func (*SwInterfaceTxPlacementDetails) GetMessageName() string { 2983 return "sw_interface_tx_placement_details" 2984 } 2985 func (*SwInterfaceTxPlacementDetails) GetCrcString() string { return "00381a2e" } 2986 func (*SwInterfaceTxPlacementDetails) GetMessageType() api.MessageType { 2987 return api.RequestMessage 2988 } 2989 2990 func (m *SwInterfaceTxPlacementDetails) Size() (size int) { 2991 if m == nil { 2992 return 0 2993 } 2994 size += 4 // m.SwIfIndex 2995 size += 4 // m.QueueID 2996 size += 1 // m.Shared 2997 size += 4 // m.ArraySize 2998 size += 4 * len(m.Threads) // m.Threads 2999 return size 3000 } 3001 func (m *SwInterfaceTxPlacementDetails) Marshal(b []byte) ([]byte, error) { 3002 if b == nil { 3003 b = make([]byte, m.Size()) 3004 } 3005 buf := codec.NewBuffer(b) 3006 buf.EncodeUint32(uint32(m.SwIfIndex)) 3007 buf.EncodeUint32(m.QueueID) 3008 buf.EncodeUint8(m.Shared) 3009 buf.EncodeUint32(uint32(len(m.Threads))) 3010 for i := 0; i < len(m.Threads); i++ { 3011 var x uint32 3012 if i < len(m.Threads) { 3013 x = uint32(m.Threads[i]) 3014 } 3015 buf.EncodeUint32(x) 3016 } 3017 return buf.Bytes(), nil 3018 } 3019 func (m *SwInterfaceTxPlacementDetails) Unmarshal(b []byte) error { 3020 buf := codec.NewBuffer(b) 3021 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 3022 m.QueueID = buf.DecodeUint32() 3023 m.Shared = buf.DecodeUint8() 3024 m.ArraySize = buf.DecodeUint32() 3025 m.Threads = make([]uint32, m.ArraySize) 3026 for i := 0; i < len(m.Threads); i++ { 3027 m.Threads[i] = buf.DecodeUint32() 3028 } 3029 return nil 3030 } 3031 3032 // get the tx queue placement of interface(s) 3033 // - cursor - optional, it allows client to continue a dump 3034 // - sw_if_index - optional interface index for which queue placement to 3035 // be requested. sw_if_index = ~0 will get the placement information for all 3036 // interfaces. It will not get information related to sub-interfaces, p2p 3037 // and pipe interfaces. 3038 // 3039 // SwInterfaceTxPlacementGet defines message 'sw_interface_tx_placement_get'. 3040 type SwInterfaceTxPlacementGet struct { 3041 Cursor uint32 `binapi:"u32,name=cursor" json:"cursor,omitempty"` 3042 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 3043 } 3044 3045 func (m *SwInterfaceTxPlacementGet) Reset() { *m = SwInterfaceTxPlacementGet{} } 3046 func (*SwInterfaceTxPlacementGet) GetMessageName() string { return "sw_interface_tx_placement_get" } 3047 func (*SwInterfaceTxPlacementGet) GetCrcString() string { return "47250981" } 3048 func (*SwInterfaceTxPlacementGet) GetMessageType() api.MessageType { 3049 return api.RequestMessage 3050 } 3051 3052 func (m *SwInterfaceTxPlacementGet) Size() (size int) { 3053 if m == nil { 3054 return 0 3055 } 3056 size += 4 // m.Cursor 3057 size += 4 // m.SwIfIndex 3058 return size 3059 } 3060 func (m *SwInterfaceTxPlacementGet) Marshal(b []byte) ([]byte, error) { 3061 if b == nil { 3062 b = make([]byte, m.Size()) 3063 } 3064 buf := codec.NewBuffer(b) 3065 buf.EncodeUint32(m.Cursor) 3066 buf.EncodeUint32(uint32(m.SwIfIndex)) 3067 return buf.Bytes(), nil 3068 } 3069 func (m *SwInterfaceTxPlacementGet) Unmarshal(b []byte) error { 3070 buf := codec.NewBuffer(b) 3071 m.Cursor = buf.DecodeUint32() 3072 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 3073 return nil 3074 } 3075 3076 // SwInterfaceTxPlacementGetReply defines message 'sw_interface_tx_placement_get_reply'. 3077 type SwInterfaceTxPlacementGetReply struct { 3078 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 3079 Cursor uint32 `binapi:"u32,name=cursor" json:"cursor,omitempty"` 3080 } 3081 3082 func (m *SwInterfaceTxPlacementGetReply) Reset() { *m = SwInterfaceTxPlacementGetReply{} } 3083 func (*SwInterfaceTxPlacementGetReply) GetMessageName() string { 3084 return "sw_interface_tx_placement_get_reply" 3085 } 3086 func (*SwInterfaceTxPlacementGetReply) GetCrcString() string { return "53b48f5d" } 3087 func (*SwInterfaceTxPlacementGetReply) GetMessageType() api.MessageType { 3088 return api.ReplyMessage 3089 } 3090 3091 func (m *SwInterfaceTxPlacementGetReply) Size() (size int) { 3092 if m == nil { 3093 return 0 3094 } 3095 size += 4 // m.Retval 3096 size += 4 // m.Cursor 3097 return size 3098 } 3099 func (m *SwInterfaceTxPlacementGetReply) Marshal(b []byte) ([]byte, error) { 3100 if b == nil { 3101 b = make([]byte, m.Size()) 3102 } 3103 buf := codec.NewBuffer(b) 3104 buf.EncodeInt32(m.Retval) 3105 buf.EncodeUint32(m.Cursor) 3106 return buf.Bytes(), nil 3107 } 3108 func (m *SwInterfaceTxPlacementGetReply) Unmarshal(b []byte) error { 3109 buf := codec.NewBuffer(b) 3110 m.Retval = buf.DecodeInt32() 3111 m.Cursor = buf.DecodeUint32() 3112 return nil 3113 } 3114 3115 // Register for interface events 3116 // - enable_disable - 1 => register for events, 0 => cancel registration 3117 // - pid - sender's pid 3118 // 3119 // WantInterfaceEvents defines message 'want_interface_events'. 3120 type WantInterfaceEvents struct { 3121 EnableDisable uint32 `binapi:"u32,name=enable_disable" json:"enable_disable,omitempty"` 3122 PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"` 3123 } 3124 3125 func (m *WantInterfaceEvents) Reset() { *m = WantInterfaceEvents{} } 3126 func (*WantInterfaceEvents) GetMessageName() string { return "want_interface_events" } 3127 func (*WantInterfaceEvents) GetCrcString() string { return "476f5a08" } 3128 func (*WantInterfaceEvents) GetMessageType() api.MessageType { 3129 return api.RequestMessage 3130 } 3131 3132 func (m *WantInterfaceEvents) Size() (size int) { 3133 if m == nil { 3134 return 0 3135 } 3136 size += 4 // m.EnableDisable 3137 size += 4 // m.PID 3138 return size 3139 } 3140 func (m *WantInterfaceEvents) Marshal(b []byte) ([]byte, error) { 3141 if b == nil { 3142 b = make([]byte, m.Size()) 3143 } 3144 buf := codec.NewBuffer(b) 3145 buf.EncodeUint32(m.EnableDisable) 3146 buf.EncodeUint32(m.PID) 3147 return buf.Bytes(), nil 3148 } 3149 func (m *WantInterfaceEvents) Unmarshal(b []byte) error { 3150 buf := codec.NewBuffer(b) 3151 m.EnableDisable = buf.DecodeUint32() 3152 m.PID = buf.DecodeUint32() 3153 return nil 3154 } 3155 3156 // WantInterfaceEventsReply defines message 'want_interface_events_reply'. 3157 type WantInterfaceEventsReply struct { 3158 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 3159 } 3160 3161 func (m *WantInterfaceEventsReply) Reset() { *m = WantInterfaceEventsReply{} } 3162 func (*WantInterfaceEventsReply) GetMessageName() string { return "want_interface_events_reply" } 3163 func (*WantInterfaceEventsReply) GetCrcString() string { return "e8d4e804" } 3164 func (*WantInterfaceEventsReply) GetMessageType() api.MessageType { 3165 return api.ReplyMessage 3166 } 3167 3168 func (m *WantInterfaceEventsReply) Size() (size int) { 3169 if m == nil { 3170 return 0 3171 } 3172 size += 4 // m.Retval 3173 return size 3174 } 3175 func (m *WantInterfaceEventsReply) Marshal(b []byte) ([]byte, error) { 3176 if b == nil { 3177 b = make([]byte, m.Size()) 3178 } 3179 buf := codec.NewBuffer(b) 3180 buf.EncodeInt32(m.Retval) 3181 return buf.Bytes(), nil 3182 } 3183 func (m *WantInterfaceEventsReply) Unmarshal(b []byte) error { 3184 buf := codec.NewBuffer(b) 3185 m.Retval = buf.DecodeInt32() 3186 return nil 3187 } 3188 3189 func init() { file_interfaces_binapi_init() } 3190 func file_interfaces_binapi_init() { 3191 api.RegisterMessage((*CollectDetailedInterfaceStats)(nil), "collect_detailed_interface_stats_5501adee") 3192 api.RegisterMessage((*CollectDetailedInterfaceStatsReply)(nil), "collect_detailed_interface_stats_reply_e8d4e804") 3193 api.RegisterMessage((*CreateLoopback)(nil), "create_loopback_42bb5d22") 3194 api.RegisterMessage((*CreateLoopbackInstance)(nil), "create_loopback_instance_d36a3ee2") 3195 api.RegisterMessage((*CreateLoopbackInstanceReply)(nil), "create_loopback_instance_reply_5383d31f") 3196 api.RegisterMessage((*CreateLoopbackReply)(nil), "create_loopback_reply_5383d31f") 3197 api.RegisterMessage((*CreateSubif)(nil), "create_subif_790ca755") 3198 api.RegisterMessage((*CreateSubifReply)(nil), "create_subif_reply_5383d31f") 3199 api.RegisterMessage((*CreateVlanSubif)(nil), "create_vlan_subif_af34ac8b") 3200 api.RegisterMessage((*CreateVlanSubifReply)(nil), "create_vlan_subif_reply_5383d31f") 3201 api.RegisterMessage((*DeleteLoopback)(nil), "delete_loopback_f9e6675e") 3202 api.RegisterMessage((*DeleteLoopbackReply)(nil), "delete_loopback_reply_e8d4e804") 3203 api.RegisterMessage((*DeleteSubif)(nil), "delete_subif_f9e6675e") 3204 api.RegisterMessage((*DeleteSubifReply)(nil), "delete_subif_reply_e8d4e804") 3205 api.RegisterMessage((*GetBuffersStats)(nil), "get_buffers_stats_d698f87e") 3206 api.RegisterMessage((*GetBuffersStatsReply)(nil), "get_buffers_stats_reply_22c0649d") 3207 api.RegisterMessage((*HwInterfaceSetMtu)(nil), "hw_interface_set_mtu_e6746899") 3208 api.RegisterMessage((*HwInterfaceSetMtuReply)(nil), "hw_interface_set_mtu_reply_e8d4e804") 3209 api.RegisterMessage((*InterfaceNameRenumber)(nil), "interface_name_renumber_2b8858b8") 3210 api.RegisterMessage((*InterfaceNameRenumberReply)(nil), "interface_name_renumber_reply_e8d4e804") 3211 api.RegisterMessage((*PcapSetFilterFunction)(nil), "pcap_set_filter_function_616abb92") 3212 api.RegisterMessage((*PcapSetFilterFunctionReply)(nil), "pcap_set_filter_function_reply_e8d4e804") 3213 api.RegisterMessage((*PcapTraceOff)(nil), "pcap_trace_off_51077d14") 3214 api.RegisterMessage((*PcapTraceOffReply)(nil), "pcap_trace_off_reply_e8d4e804") 3215 api.RegisterMessage((*PcapTraceOn)(nil), "pcap_trace_on_cb39e968") 3216 api.RegisterMessage((*PcapTraceOnReply)(nil), "pcap_trace_on_reply_e8d4e804") 3217 api.RegisterMessage((*SwInterfaceAddDelAddress)(nil), "sw_interface_add_del_address_5463d73b") 3218 api.RegisterMessage((*SwInterfaceAddDelAddressReply)(nil), "sw_interface_add_del_address_reply_e8d4e804") 3219 api.RegisterMessage((*SwInterfaceAddDelMacAddress)(nil), "sw_interface_add_del_mac_address_638bb9f4") 3220 api.RegisterMessage((*SwInterfaceAddDelMacAddressReply)(nil), "sw_interface_add_del_mac_address_reply_e8d4e804") 3221 api.RegisterMessage((*SwInterfaceAddressReplaceBegin)(nil), "sw_interface_address_replace_begin_51077d14") 3222 api.RegisterMessage((*SwInterfaceAddressReplaceBeginReply)(nil), "sw_interface_address_replace_begin_reply_e8d4e804") 3223 api.RegisterMessage((*SwInterfaceAddressReplaceEnd)(nil), "sw_interface_address_replace_end_51077d14") 3224 api.RegisterMessage((*SwInterfaceAddressReplaceEndReply)(nil), "sw_interface_address_replace_end_reply_e8d4e804") 3225 api.RegisterMessage((*SwInterfaceClearStats)(nil), "sw_interface_clear_stats_f9e6675e") 3226 api.RegisterMessage((*SwInterfaceClearStatsReply)(nil), "sw_interface_clear_stats_reply_e8d4e804") 3227 api.RegisterMessage((*SwInterfaceDetails)(nil), "sw_interface_details_6c221fc7") 3228 api.RegisterMessage((*SwInterfaceDump)(nil), "sw_interface_dump_aa610c27") 3229 api.RegisterMessage((*SwInterfaceEvent)(nil), "sw_interface_event_2d3d95a7") 3230 api.RegisterMessage((*SwInterfaceGetMacAddress)(nil), "sw_interface_get_mac_address_f9e6675e") 3231 api.RegisterMessage((*SwInterfaceGetMacAddressReply)(nil), "sw_interface_get_mac_address_reply_40ef2c08") 3232 api.RegisterMessage((*SwInterfaceGetTable)(nil), "sw_interface_get_table_2d033de4") 3233 api.RegisterMessage((*SwInterfaceGetTableReply)(nil), "sw_interface_get_table_reply_a6eb0109") 3234 api.RegisterMessage((*SwInterfaceRxPlacementDetails)(nil), "sw_interface_rx_placement_details_9e44a7ce") 3235 api.RegisterMessage((*SwInterfaceRxPlacementDump)(nil), "sw_interface_rx_placement_dump_f9e6675e") 3236 api.RegisterMessage((*SwInterfaceSetFlags)(nil), "sw_interface_set_flags_f5aec1b8") 3237 api.RegisterMessage((*SwInterfaceSetFlagsReply)(nil), "sw_interface_set_flags_reply_e8d4e804") 3238 api.RegisterMessage((*SwInterfaceSetInterfaceName)(nil), "sw_interface_set_interface_name_45a1d548") 3239 api.RegisterMessage((*SwInterfaceSetInterfaceNameReply)(nil), "sw_interface_set_interface_name_reply_e8d4e804") 3240 api.RegisterMessage((*SwInterfaceSetIPDirectedBroadcast)(nil), "sw_interface_set_ip_directed_broadcast_ae6cfcfb") 3241 api.RegisterMessage((*SwInterfaceSetIPDirectedBroadcastReply)(nil), "sw_interface_set_ip_directed_broadcast_reply_e8d4e804") 3242 api.RegisterMessage((*SwInterfaceSetMacAddress)(nil), "sw_interface_set_mac_address_c536e7eb") 3243 api.RegisterMessage((*SwInterfaceSetMacAddressReply)(nil), "sw_interface_set_mac_address_reply_e8d4e804") 3244 api.RegisterMessage((*SwInterfaceSetMtu)(nil), "sw_interface_set_mtu_5cbe85e5") 3245 api.RegisterMessage((*SwInterfaceSetMtuReply)(nil), "sw_interface_set_mtu_reply_e8d4e804") 3246 api.RegisterMessage((*SwInterfaceSetPromisc)(nil), "sw_interface_set_promisc_d40860d4") 3247 api.RegisterMessage((*SwInterfaceSetPromiscReply)(nil), "sw_interface_set_promisc_reply_e8d4e804") 3248 api.RegisterMessage((*SwInterfaceSetRxMode)(nil), "sw_interface_set_rx_mode_b04d1cfe") 3249 api.RegisterMessage((*SwInterfaceSetRxModeReply)(nil), "sw_interface_set_rx_mode_reply_e8d4e804") 3250 api.RegisterMessage((*SwInterfaceSetRxPlacement)(nil), "sw_interface_set_rx_placement_db65f3c9") 3251 api.RegisterMessage((*SwInterfaceSetRxPlacementReply)(nil), "sw_interface_set_rx_placement_reply_e8d4e804") 3252 api.RegisterMessage((*SwInterfaceSetTable)(nil), "sw_interface_set_table_df42a577") 3253 api.RegisterMessage((*SwInterfaceSetTableReply)(nil), "sw_interface_set_table_reply_e8d4e804") 3254 api.RegisterMessage((*SwInterfaceSetTxPlacement)(nil), "sw_interface_set_tx_placement_0b855b40") 3255 api.RegisterMessage((*SwInterfaceSetTxPlacementReply)(nil), "sw_interface_set_tx_placement_reply_e8d4e804") 3256 api.RegisterMessage((*SwInterfaceSetUnnumbered)(nil), "sw_interface_set_unnumbered_154a6439") 3257 api.RegisterMessage((*SwInterfaceSetUnnumberedReply)(nil), "sw_interface_set_unnumbered_reply_e8d4e804") 3258 api.RegisterMessage((*SwInterfaceTagAddDel)(nil), "sw_interface_tag_add_del_426f8bc1") 3259 api.RegisterMessage((*SwInterfaceTagAddDelReply)(nil), "sw_interface_tag_add_del_reply_e8d4e804") 3260 api.RegisterMessage((*SwInterfaceTxPlacementDetails)(nil), "sw_interface_tx_placement_details_00381a2e") 3261 api.RegisterMessage((*SwInterfaceTxPlacementGet)(nil), "sw_interface_tx_placement_get_47250981") 3262 api.RegisterMessage((*SwInterfaceTxPlacementGetReply)(nil), "sw_interface_tx_placement_get_reply_53b48f5d") 3263 api.RegisterMessage((*WantInterfaceEvents)(nil), "want_interface_events_476f5a08") 3264 api.RegisterMessage((*WantInterfaceEventsReply)(nil), "want_interface_events_reply_e8d4e804") 3265 } 3266 3267 // Messages returns list of all messages in this module. 3268 func AllMessages() []api.Message { 3269 return []api.Message{ 3270 (*CollectDetailedInterfaceStats)(nil), 3271 (*CollectDetailedInterfaceStatsReply)(nil), 3272 (*CreateLoopback)(nil), 3273 (*CreateLoopbackInstance)(nil), 3274 (*CreateLoopbackInstanceReply)(nil), 3275 (*CreateLoopbackReply)(nil), 3276 (*CreateSubif)(nil), 3277 (*CreateSubifReply)(nil), 3278 (*CreateVlanSubif)(nil), 3279 (*CreateVlanSubifReply)(nil), 3280 (*DeleteLoopback)(nil), 3281 (*DeleteLoopbackReply)(nil), 3282 (*DeleteSubif)(nil), 3283 (*DeleteSubifReply)(nil), 3284 (*GetBuffersStats)(nil), 3285 (*GetBuffersStatsReply)(nil), 3286 (*HwInterfaceSetMtu)(nil), 3287 (*HwInterfaceSetMtuReply)(nil), 3288 (*InterfaceNameRenumber)(nil), 3289 (*InterfaceNameRenumberReply)(nil), 3290 (*PcapSetFilterFunction)(nil), 3291 (*PcapSetFilterFunctionReply)(nil), 3292 (*PcapTraceOff)(nil), 3293 (*PcapTraceOffReply)(nil), 3294 (*PcapTraceOn)(nil), 3295 (*PcapTraceOnReply)(nil), 3296 (*SwInterfaceAddDelAddress)(nil), 3297 (*SwInterfaceAddDelAddressReply)(nil), 3298 (*SwInterfaceAddDelMacAddress)(nil), 3299 (*SwInterfaceAddDelMacAddressReply)(nil), 3300 (*SwInterfaceAddressReplaceBegin)(nil), 3301 (*SwInterfaceAddressReplaceBeginReply)(nil), 3302 (*SwInterfaceAddressReplaceEnd)(nil), 3303 (*SwInterfaceAddressReplaceEndReply)(nil), 3304 (*SwInterfaceClearStats)(nil), 3305 (*SwInterfaceClearStatsReply)(nil), 3306 (*SwInterfaceDetails)(nil), 3307 (*SwInterfaceDump)(nil), 3308 (*SwInterfaceEvent)(nil), 3309 (*SwInterfaceGetMacAddress)(nil), 3310 (*SwInterfaceGetMacAddressReply)(nil), 3311 (*SwInterfaceGetTable)(nil), 3312 (*SwInterfaceGetTableReply)(nil), 3313 (*SwInterfaceRxPlacementDetails)(nil), 3314 (*SwInterfaceRxPlacementDump)(nil), 3315 (*SwInterfaceSetFlags)(nil), 3316 (*SwInterfaceSetFlagsReply)(nil), 3317 (*SwInterfaceSetInterfaceName)(nil), 3318 (*SwInterfaceSetInterfaceNameReply)(nil), 3319 (*SwInterfaceSetIPDirectedBroadcast)(nil), 3320 (*SwInterfaceSetIPDirectedBroadcastReply)(nil), 3321 (*SwInterfaceSetMacAddress)(nil), 3322 (*SwInterfaceSetMacAddressReply)(nil), 3323 (*SwInterfaceSetMtu)(nil), 3324 (*SwInterfaceSetMtuReply)(nil), 3325 (*SwInterfaceSetPromisc)(nil), 3326 (*SwInterfaceSetPromiscReply)(nil), 3327 (*SwInterfaceSetRxMode)(nil), 3328 (*SwInterfaceSetRxModeReply)(nil), 3329 (*SwInterfaceSetRxPlacement)(nil), 3330 (*SwInterfaceSetRxPlacementReply)(nil), 3331 (*SwInterfaceSetTable)(nil), 3332 (*SwInterfaceSetTableReply)(nil), 3333 (*SwInterfaceSetTxPlacement)(nil), 3334 (*SwInterfaceSetTxPlacementReply)(nil), 3335 (*SwInterfaceSetUnnumbered)(nil), 3336 (*SwInterfaceSetUnnumberedReply)(nil), 3337 (*SwInterfaceTagAddDel)(nil), 3338 (*SwInterfaceTagAddDelReply)(nil), 3339 (*SwInterfaceTxPlacementDetails)(nil), 3340 (*SwInterfaceTxPlacementGet)(nil), 3341 (*SwInterfaceTxPlacementGetReply)(nil), 3342 (*WantInterfaceEvents)(nil), 3343 (*WantInterfaceEventsReply)(nil), 3344 } 3345 }