github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/l2/l2.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/l2.api.json 6 7 // Package l2 contains generated bindings for API file l2.api. 8 // 9 // Contents: 10 // - 3 enums 11 // - 3 structs 12 // - 64 messages 13 package l2 14 15 import ( 16 "strconv" 17 18 ethernet_types "github.com/networkservicemesh/govpp/binapi/ethernet_types" 19 interface_types "github.com/networkservicemesh/govpp/binapi/interface_types" 20 ip_types "github.com/networkservicemesh/govpp/binapi/ip_types" 21 api "go.fd.io/govpp/api" 22 codec "go.fd.io/govpp/codec" 23 ) 24 25 // This is a compile-time assertion to ensure that this generated file 26 // is compatible with the GoVPP api package it is being compiled against. 27 // A compilation error at this line likely means your copy of the 28 // GoVPP api package needs to be updated. 29 const _ = api.GoVppAPIPackageIsVersion2 30 31 const ( 32 APIFile = "l2" 33 APIVersion = "3.2.0" 34 VersionCrc = 0x2720d298 35 ) 36 37 // BdFlags defines enum 'bd_flags'. 38 type BdFlags uint32 39 40 const ( 41 BRIDGE_API_FLAG_NONE BdFlags = 0 42 BRIDGE_API_FLAG_LEARN BdFlags = 1 43 BRIDGE_API_FLAG_FWD BdFlags = 2 44 BRIDGE_API_FLAG_FLOOD BdFlags = 4 45 BRIDGE_API_FLAG_UU_FLOOD BdFlags = 8 46 BRIDGE_API_FLAG_ARP_TERM BdFlags = 16 47 BRIDGE_API_FLAG_ARP_UFWD BdFlags = 32 48 ) 49 50 var ( 51 BdFlags_name = map[uint32]string{ 52 0: "BRIDGE_API_FLAG_NONE", 53 1: "BRIDGE_API_FLAG_LEARN", 54 2: "BRIDGE_API_FLAG_FWD", 55 4: "BRIDGE_API_FLAG_FLOOD", 56 8: "BRIDGE_API_FLAG_UU_FLOOD", 57 16: "BRIDGE_API_FLAG_ARP_TERM", 58 32: "BRIDGE_API_FLAG_ARP_UFWD", 59 } 60 BdFlags_value = map[string]uint32{ 61 "BRIDGE_API_FLAG_NONE": 0, 62 "BRIDGE_API_FLAG_LEARN": 1, 63 "BRIDGE_API_FLAG_FWD": 2, 64 "BRIDGE_API_FLAG_FLOOD": 4, 65 "BRIDGE_API_FLAG_UU_FLOOD": 8, 66 "BRIDGE_API_FLAG_ARP_TERM": 16, 67 "BRIDGE_API_FLAG_ARP_UFWD": 32, 68 } 69 ) 70 71 func (x BdFlags) String() string { 72 s, ok := BdFlags_name[uint32(x)] 73 if ok { 74 return s 75 } 76 str := func(n uint32) string { 77 s, ok := BdFlags_name[uint32(n)] 78 if ok { 79 return s 80 } 81 return "BdFlags(" + strconv.Itoa(int(n)) + ")" 82 } 83 for i := uint32(0); i <= 32; i++ { 84 val := uint32(x) 85 if val&(1<<i) != 0 { 86 if s != "" { 87 s += "|" 88 } 89 s += str(1 << i) 90 } 91 } 92 if s == "" { 93 return str(uint32(x)) 94 } 95 return s 96 } 97 98 // L2PortType defines enum 'l2_port_type'. 99 type L2PortType uint32 100 101 const ( 102 L2_API_PORT_TYPE_NORMAL L2PortType = 0 103 L2_API_PORT_TYPE_BVI L2PortType = 1 104 L2_API_PORT_TYPE_UU_FWD L2PortType = 2 105 ) 106 107 var ( 108 L2PortType_name = map[uint32]string{ 109 0: "L2_API_PORT_TYPE_NORMAL", 110 1: "L2_API_PORT_TYPE_BVI", 111 2: "L2_API_PORT_TYPE_UU_FWD", 112 } 113 L2PortType_value = map[string]uint32{ 114 "L2_API_PORT_TYPE_NORMAL": 0, 115 "L2_API_PORT_TYPE_BVI": 1, 116 "L2_API_PORT_TYPE_UU_FWD": 2, 117 } 118 ) 119 120 func (x L2PortType) String() string { 121 s, ok := L2PortType_name[uint32(x)] 122 if ok { 123 return s 124 } 125 return "L2PortType(" + strconv.Itoa(int(x)) + ")" 126 } 127 128 // MacEventAction defines enum 'mac_event_action'. 129 type MacEventAction uint32 130 131 const ( 132 MAC_EVENT_ACTION_API_ADD MacEventAction = 0 133 MAC_EVENT_ACTION_API_DELETE MacEventAction = 1 134 MAC_EVENT_ACTION_API_MOVE MacEventAction = 2 135 ) 136 137 var ( 138 MacEventAction_name = map[uint32]string{ 139 0: "MAC_EVENT_ACTION_API_ADD", 140 1: "MAC_EVENT_ACTION_API_DELETE", 141 2: "MAC_EVENT_ACTION_API_MOVE", 142 } 143 MacEventAction_value = map[string]uint32{ 144 "MAC_EVENT_ACTION_API_ADD": 0, 145 "MAC_EVENT_ACTION_API_DELETE": 1, 146 "MAC_EVENT_ACTION_API_MOVE": 2, 147 } 148 ) 149 150 func (x MacEventAction) String() string { 151 s, ok := MacEventAction_name[uint32(x)] 152 if ok { 153 return s 154 } 155 return "MacEventAction(" + strconv.Itoa(int(x)) + ")" 156 } 157 158 // BdIPMac defines type 'bd_ip_mac'. 159 type BdIPMac struct { 160 BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` 161 IP ip_types.Address `binapi:"address,name=ip" json:"ip,omitempty"` 162 Mac ethernet_types.MacAddress `binapi:"mac_address,name=mac" json:"mac,omitempty"` 163 } 164 165 // BridgeDomainSwIf defines type 'bridge_domain_sw_if'. 166 type BridgeDomainSwIf struct { 167 Context uint32 `binapi:"u32,name=context" json:"context,omitempty"` 168 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 169 Shg uint8 `binapi:"u8,name=shg" json:"shg,omitempty"` 170 } 171 172 // MacEntry defines type 'mac_entry'. 173 type MacEntry struct { 174 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 175 MacAddr ethernet_types.MacAddress `binapi:"mac_address,name=mac_addr" json:"mac_addr,omitempty"` 176 Action MacEventAction `binapi:"mac_event_action,name=action" json:"action,omitempty"` 177 Flags uint8 `binapi:"u8,name=flags" json:"flags,omitempty"` 178 } 179 180 // Set bridge domain ip to mac entry request 181 // - bd_id - the bridge domain to set the flags for 182 // - is_add - if non-zero, add the entry, else clear it 183 // - ip - ipv4 or ipv6 address 184 // - mac - MAC address 185 // 186 // BdIPMacAddDel defines message 'bd_ip_mac_add_del'. 187 type BdIPMacAddDel struct { 188 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` 189 Entry BdIPMac `binapi:"bd_ip_mac,name=entry" json:"entry,omitempty"` 190 } 191 192 func (m *BdIPMacAddDel) Reset() { *m = BdIPMacAddDel{} } 193 func (*BdIPMacAddDel) GetMessageName() string { return "bd_ip_mac_add_del" } 194 func (*BdIPMacAddDel) GetCrcString() string { return "0257c869" } 195 func (*BdIPMacAddDel) GetMessageType() api.MessageType { 196 return api.RequestMessage 197 } 198 199 func (m *BdIPMacAddDel) Size() (size int) { 200 if m == nil { 201 return 0 202 } 203 size += 1 // m.IsAdd 204 size += 4 // m.Entry.BdID 205 size += 1 // m.Entry.IP.Af 206 size += 1 * 16 // m.Entry.IP.Un 207 size += 1 * 6 // m.Entry.Mac 208 return size 209 } 210 func (m *BdIPMacAddDel) Marshal(b []byte) ([]byte, error) { 211 if b == nil { 212 b = make([]byte, m.Size()) 213 } 214 buf := codec.NewBuffer(b) 215 buf.EncodeBool(m.IsAdd) 216 buf.EncodeUint32(m.Entry.BdID) 217 buf.EncodeUint8(uint8(m.Entry.IP.Af)) 218 buf.EncodeBytes(m.Entry.IP.Un.XXX_UnionData[:], 16) 219 buf.EncodeBytes(m.Entry.Mac[:], 6) 220 return buf.Bytes(), nil 221 } 222 func (m *BdIPMacAddDel) Unmarshal(b []byte) error { 223 buf := codec.NewBuffer(b) 224 m.IsAdd = buf.DecodeBool() 225 m.Entry.BdID = buf.DecodeUint32() 226 m.Entry.IP.Af = ip_types.AddressFamily(buf.DecodeUint8()) 227 copy(m.Entry.IP.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 228 copy(m.Entry.Mac[:], buf.DecodeBytes(6)) 229 return nil 230 } 231 232 // BdIPMacAddDelReply defines message 'bd_ip_mac_add_del_reply'. 233 type BdIPMacAddDelReply struct { 234 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 235 } 236 237 func (m *BdIPMacAddDelReply) Reset() { *m = BdIPMacAddDelReply{} } 238 func (*BdIPMacAddDelReply) GetMessageName() string { return "bd_ip_mac_add_del_reply" } 239 func (*BdIPMacAddDelReply) GetCrcString() string { return "e8d4e804" } 240 func (*BdIPMacAddDelReply) GetMessageType() api.MessageType { 241 return api.ReplyMessage 242 } 243 244 func (m *BdIPMacAddDelReply) Size() (size int) { 245 if m == nil { 246 return 0 247 } 248 size += 4 // m.Retval 249 return size 250 } 251 func (m *BdIPMacAddDelReply) Marshal(b []byte) ([]byte, error) { 252 if b == nil { 253 b = make([]byte, m.Size()) 254 } 255 buf := codec.NewBuffer(b) 256 buf.EncodeInt32(m.Retval) 257 return buf.Bytes(), nil 258 } 259 func (m *BdIPMacAddDelReply) Unmarshal(b []byte) error { 260 buf := codec.NewBuffer(b) 261 m.Retval = buf.DecodeInt32() 262 return nil 263 } 264 265 // bridge domain IP to MAC entry details structure 266 // - bd_id - bridge domain table id 267 // - is_ipv6 - if non-zero, ipv6 address, else ipv4 address 268 // - ip_address - ipv4 or ipv6 address 269 // - mac_address - MAC address 270 // 271 // BdIPMacDetails defines message 'bd_ip_mac_details'. 272 type BdIPMacDetails struct { 273 Entry BdIPMac `binapi:"bd_ip_mac,name=entry" json:"entry,omitempty"` 274 } 275 276 func (m *BdIPMacDetails) Reset() { *m = BdIPMacDetails{} } 277 func (*BdIPMacDetails) GetMessageName() string { return "bd_ip_mac_details" } 278 func (*BdIPMacDetails) GetCrcString() string { return "545af86a" } 279 func (*BdIPMacDetails) GetMessageType() api.MessageType { 280 return api.ReplyMessage 281 } 282 283 func (m *BdIPMacDetails) Size() (size int) { 284 if m == nil { 285 return 0 286 } 287 size += 4 // m.Entry.BdID 288 size += 1 // m.Entry.IP.Af 289 size += 1 * 16 // m.Entry.IP.Un 290 size += 1 * 6 // m.Entry.Mac 291 return size 292 } 293 func (m *BdIPMacDetails) Marshal(b []byte) ([]byte, error) { 294 if b == nil { 295 b = make([]byte, m.Size()) 296 } 297 buf := codec.NewBuffer(b) 298 buf.EncodeUint32(m.Entry.BdID) 299 buf.EncodeUint8(uint8(m.Entry.IP.Af)) 300 buf.EncodeBytes(m.Entry.IP.Un.XXX_UnionData[:], 16) 301 buf.EncodeBytes(m.Entry.Mac[:], 6) 302 return buf.Bytes(), nil 303 } 304 func (m *BdIPMacDetails) Unmarshal(b []byte) error { 305 buf := codec.NewBuffer(b) 306 m.Entry.BdID = buf.DecodeUint32() 307 m.Entry.IP.Af = ip_types.AddressFamily(buf.DecodeUint8()) 308 copy(m.Entry.IP.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 309 copy(m.Entry.Mac[:], buf.DecodeBytes(6)) 310 return nil 311 } 312 313 // Dump bridge domain IP to MAC entries 314 // - bd_id - bridge domain identifier 315 // 316 // BdIPMacDump defines message 'bd_ip_mac_dump'. 317 type BdIPMacDump struct { 318 BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` 319 } 320 321 func (m *BdIPMacDump) Reset() { *m = BdIPMacDump{} } 322 func (*BdIPMacDump) GetMessageName() string { return "bd_ip_mac_dump" } 323 func (*BdIPMacDump) GetCrcString() string { return "c25fdce6" } 324 func (*BdIPMacDump) GetMessageType() api.MessageType { 325 return api.RequestMessage 326 } 327 328 func (m *BdIPMacDump) Size() (size int) { 329 if m == nil { 330 return 0 331 } 332 size += 4 // m.BdID 333 return size 334 } 335 func (m *BdIPMacDump) Marshal(b []byte) ([]byte, error) { 336 if b == nil { 337 b = make([]byte, m.Size()) 338 } 339 buf := codec.NewBuffer(b) 340 buf.EncodeUint32(m.BdID) 341 return buf.Bytes(), nil 342 } 343 func (m *BdIPMacDump) Unmarshal(b []byte) error { 344 buf := codec.NewBuffer(b) 345 m.BdID = buf.DecodeUint32() 346 return nil 347 } 348 349 // Flush bridge domain IP to MAC entries 350 // - bd_id - bridge domain identifier 351 // 352 // BdIPMacFlush defines message 'bd_ip_mac_flush'. 353 type BdIPMacFlush struct { 354 BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` 355 } 356 357 func (m *BdIPMacFlush) Reset() { *m = BdIPMacFlush{} } 358 func (*BdIPMacFlush) GetMessageName() string { return "bd_ip_mac_flush" } 359 func (*BdIPMacFlush) GetCrcString() string { return "c25fdce6" } 360 func (*BdIPMacFlush) GetMessageType() api.MessageType { 361 return api.RequestMessage 362 } 363 364 func (m *BdIPMacFlush) Size() (size int) { 365 if m == nil { 366 return 0 367 } 368 size += 4 // m.BdID 369 return size 370 } 371 func (m *BdIPMacFlush) Marshal(b []byte) ([]byte, error) { 372 if b == nil { 373 b = make([]byte, m.Size()) 374 } 375 buf := codec.NewBuffer(b) 376 buf.EncodeUint32(m.BdID) 377 return buf.Bytes(), nil 378 } 379 func (m *BdIPMacFlush) Unmarshal(b []byte) error { 380 buf := codec.NewBuffer(b) 381 m.BdID = buf.DecodeUint32() 382 return nil 383 } 384 385 // BdIPMacFlushReply defines message 'bd_ip_mac_flush_reply'. 386 type BdIPMacFlushReply struct { 387 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 388 } 389 390 func (m *BdIPMacFlushReply) Reset() { *m = BdIPMacFlushReply{} } 391 func (*BdIPMacFlushReply) GetMessageName() string { return "bd_ip_mac_flush_reply" } 392 func (*BdIPMacFlushReply) GetCrcString() string { return "e8d4e804" } 393 func (*BdIPMacFlushReply) GetMessageType() api.MessageType { 394 return api.ReplyMessage 395 } 396 397 func (m *BdIPMacFlushReply) Size() (size int) { 398 if m == nil { 399 return 0 400 } 401 size += 4 // m.Retval 402 return size 403 } 404 func (m *BdIPMacFlushReply) Marshal(b []byte) ([]byte, error) { 405 if b == nil { 406 b = make([]byte, m.Size()) 407 } 408 buf := codec.NewBuffer(b) 409 buf.EncodeInt32(m.Retval) 410 return buf.Bytes(), nil 411 } 412 func (m *BdIPMacFlushReply) Unmarshal(b []byte) error { 413 buf := codec.NewBuffer(b) 414 m.Retval = buf.DecodeInt32() 415 return nil 416 } 417 418 // L2 bridge domain add or delete request - will be deprecated 419 // - bd_id - the bridge domain to create 420 // - flood - enable/disable bcast/mcast flooding in the bd 421 // - uu_flood - enable/disable unknown unicast flood in the bd 422 // - forward - enable/disable forwarding on all interfaces in the bd 423 // - learn - enable/disable learning on all interfaces in the bd 424 // - arp_term - enable/disable arp termination in the bd 425 // - arp_ufwd - enable/disable arp unicast forwarding in the bd 426 // - mac_age - mac aging time in min, 0 for disabled 427 // - is_add - add or delete flag 428 // 429 // BridgeDomainAddDel defines message 'bridge_domain_add_del'. 430 // Deprecated: the message will be removed in the future versions 431 type BridgeDomainAddDel struct { 432 BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` 433 Flood bool `binapi:"bool,name=flood" json:"flood,omitempty"` 434 UuFlood bool `binapi:"bool,name=uu_flood" json:"uu_flood,omitempty"` 435 Forward bool `binapi:"bool,name=forward" json:"forward,omitempty"` 436 Learn bool `binapi:"bool,name=learn" json:"learn,omitempty"` 437 ArpTerm bool `binapi:"bool,name=arp_term" json:"arp_term,omitempty"` 438 ArpUfwd bool `binapi:"bool,name=arp_ufwd" json:"arp_ufwd,omitempty"` 439 MacAge uint8 `binapi:"u8,name=mac_age" json:"mac_age,omitempty"` 440 BdTag string `binapi:"string[64],name=bd_tag" json:"bd_tag,omitempty"` 441 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` 442 } 443 444 func (m *BridgeDomainAddDel) Reset() { *m = BridgeDomainAddDel{} } 445 func (*BridgeDomainAddDel) GetMessageName() string { return "bridge_domain_add_del" } 446 func (*BridgeDomainAddDel) GetCrcString() string { return "600b7170" } 447 func (*BridgeDomainAddDel) GetMessageType() api.MessageType { 448 return api.RequestMessage 449 } 450 451 func (m *BridgeDomainAddDel) Size() (size int) { 452 if m == nil { 453 return 0 454 } 455 size += 4 // m.BdID 456 size += 1 // m.Flood 457 size += 1 // m.UuFlood 458 size += 1 // m.Forward 459 size += 1 // m.Learn 460 size += 1 // m.ArpTerm 461 size += 1 // m.ArpUfwd 462 size += 1 // m.MacAge 463 size += 64 // m.BdTag 464 size += 1 // m.IsAdd 465 return size 466 } 467 func (m *BridgeDomainAddDel) Marshal(b []byte) ([]byte, error) { 468 if b == nil { 469 b = make([]byte, m.Size()) 470 } 471 buf := codec.NewBuffer(b) 472 buf.EncodeUint32(m.BdID) 473 buf.EncodeBool(m.Flood) 474 buf.EncodeBool(m.UuFlood) 475 buf.EncodeBool(m.Forward) 476 buf.EncodeBool(m.Learn) 477 buf.EncodeBool(m.ArpTerm) 478 buf.EncodeBool(m.ArpUfwd) 479 buf.EncodeUint8(m.MacAge) 480 buf.EncodeString(m.BdTag, 64) 481 buf.EncodeBool(m.IsAdd) 482 return buf.Bytes(), nil 483 } 484 func (m *BridgeDomainAddDel) Unmarshal(b []byte) error { 485 buf := codec.NewBuffer(b) 486 m.BdID = buf.DecodeUint32() 487 m.Flood = buf.DecodeBool() 488 m.UuFlood = buf.DecodeBool() 489 m.Forward = buf.DecodeBool() 490 m.Learn = buf.DecodeBool() 491 m.ArpTerm = buf.DecodeBool() 492 m.ArpUfwd = buf.DecodeBool() 493 m.MacAge = buf.DecodeUint8() 494 m.BdTag = buf.DecodeString(64) 495 m.IsAdd = buf.DecodeBool() 496 return nil 497 } 498 499 // BridgeDomainAddDelReply defines message 'bridge_domain_add_del_reply'. 500 // Deprecated: the message will be removed in the future versions 501 type BridgeDomainAddDelReply struct { 502 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 503 } 504 505 func (m *BridgeDomainAddDelReply) Reset() { *m = BridgeDomainAddDelReply{} } 506 func (*BridgeDomainAddDelReply) GetMessageName() string { return "bridge_domain_add_del_reply" } 507 func (*BridgeDomainAddDelReply) GetCrcString() string { return "e8d4e804" } 508 func (*BridgeDomainAddDelReply) GetMessageType() api.MessageType { 509 return api.ReplyMessage 510 } 511 512 func (m *BridgeDomainAddDelReply) Size() (size int) { 513 if m == nil { 514 return 0 515 } 516 size += 4 // m.Retval 517 return size 518 } 519 func (m *BridgeDomainAddDelReply) Marshal(b []byte) ([]byte, error) { 520 if b == nil { 521 b = make([]byte, m.Size()) 522 } 523 buf := codec.NewBuffer(b) 524 buf.EncodeInt32(m.Retval) 525 return buf.Bytes(), nil 526 } 527 func (m *BridgeDomainAddDelReply) Unmarshal(b []byte) error { 528 buf := codec.NewBuffer(b) 529 m.Retval = buf.DecodeInt32() 530 return nil 531 } 532 533 // L2 bridge domain add delete request version 2 534 // - bd_id - if the id == ~0 creates a bridge domain with an unused id 535 // if the id != ~0 the id of the bridge domain to create/delete 536 // - flood - enable/disable bcast/mcast flooding in the bd 537 // - uu_flood - enable/disable unknown unicast flood in the bd 538 // - forward - enable/disable forwarding on all interfaces in the bd 539 // - learn - enable/disable learning on all interfaces in the bd 540 // - arp_term - enable/disable arp termination in the bd 541 // - arp_ufwd - enable/disable arp unicast forwarding in the bd 542 // - mac_age - mac aging time in min, 0 for disabled 543 // - is_add - add or delete flag 544 // 545 // BridgeDomainAddDelV2 defines message 'bridge_domain_add_del_v2'. 546 type BridgeDomainAddDelV2 struct { 547 BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` 548 Flood bool `binapi:"bool,name=flood" json:"flood,omitempty"` 549 UuFlood bool `binapi:"bool,name=uu_flood" json:"uu_flood,omitempty"` 550 Forward bool `binapi:"bool,name=forward" json:"forward,omitempty"` 551 Learn bool `binapi:"bool,name=learn" json:"learn,omitempty"` 552 ArpTerm bool `binapi:"bool,name=arp_term" json:"arp_term,omitempty"` 553 ArpUfwd bool `binapi:"bool,name=arp_ufwd" json:"arp_ufwd,omitempty"` 554 MacAge uint8 `binapi:"u8,name=mac_age" json:"mac_age,omitempty"` 555 BdTag string `binapi:"string[64],name=bd_tag" json:"bd_tag,omitempty"` 556 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` 557 } 558 559 func (m *BridgeDomainAddDelV2) Reset() { *m = BridgeDomainAddDelV2{} } 560 func (*BridgeDomainAddDelV2) GetMessageName() string { return "bridge_domain_add_del_v2" } 561 func (*BridgeDomainAddDelV2) GetCrcString() string { return "600b7170" } 562 func (*BridgeDomainAddDelV2) GetMessageType() api.MessageType { 563 return api.RequestMessage 564 } 565 566 func (m *BridgeDomainAddDelV2) Size() (size int) { 567 if m == nil { 568 return 0 569 } 570 size += 4 // m.BdID 571 size += 1 // m.Flood 572 size += 1 // m.UuFlood 573 size += 1 // m.Forward 574 size += 1 // m.Learn 575 size += 1 // m.ArpTerm 576 size += 1 // m.ArpUfwd 577 size += 1 // m.MacAge 578 size += 64 // m.BdTag 579 size += 1 // m.IsAdd 580 return size 581 } 582 func (m *BridgeDomainAddDelV2) Marshal(b []byte) ([]byte, error) { 583 if b == nil { 584 b = make([]byte, m.Size()) 585 } 586 buf := codec.NewBuffer(b) 587 buf.EncodeUint32(m.BdID) 588 buf.EncodeBool(m.Flood) 589 buf.EncodeBool(m.UuFlood) 590 buf.EncodeBool(m.Forward) 591 buf.EncodeBool(m.Learn) 592 buf.EncodeBool(m.ArpTerm) 593 buf.EncodeBool(m.ArpUfwd) 594 buf.EncodeUint8(m.MacAge) 595 buf.EncodeString(m.BdTag, 64) 596 buf.EncodeBool(m.IsAdd) 597 return buf.Bytes(), nil 598 } 599 func (m *BridgeDomainAddDelV2) Unmarshal(b []byte) error { 600 buf := codec.NewBuffer(b) 601 m.BdID = buf.DecodeUint32() 602 m.Flood = buf.DecodeBool() 603 m.UuFlood = buf.DecodeBool() 604 m.Forward = buf.DecodeBool() 605 m.Learn = buf.DecodeBool() 606 m.ArpTerm = buf.DecodeBool() 607 m.ArpUfwd = buf.DecodeBool() 608 m.MacAge = buf.DecodeUint8() 609 m.BdTag = buf.DecodeString(64) 610 m.IsAdd = buf.DecodeBool() 611 return nil 612 } 613 614 // L2 bridge domain add delete version 2 response 615 // - retval - return code for the set bridge flags request 616 // - resulting_id - the id for the new bridge domain 617 // 618 // BridgeDomainAddDelV2Reply defines message 'bridge_domain_add_del_v2_reply'. 619 type BridgeDomainAddDelV2Reply struct { 620 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 621 BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` 622 } 623 624 func (m *BridgeDomainAddDelV2Reply) Reset() { *m = BridgeDomainAddDelV2Reply{} } 625 func (*BridgeDomainAddDelV2Reply) GetMessageName() string { return "bridge_domain_add_del_v2_reply" } 626 func (*BridgeDomainAddDelV2Reply) GetCrcString() string { return "fcb1e980" } 627 func (*BridgeDomainAddDelV2Reply) GetMessageType() api.MessageType { 628 return api.ReplyMessage 629 } 630 631 func (m *BridgeDomainAddDelV2Reply) Size() (size int) { 632 if m == nil { 633 return 0 634 } 635 size += 4 // m.Retval 636 size += 4 // m.BdID 637 return size 638 } 639 func (m *BridgeDomainAddDelV2Reply) Marshal(b []byte) ([]byte, error) { 640 if b == nil { 641 b = make([]byte, m.Size()) 642 } 643 buf := codec.NewBuffer(b) 644 buf.EncodeInt32(m.Retval) 645 buf.EncodeUint32(m.BdID) 646 return buf.Bytes(), nil 647 } 648 func (m *BridgeDomainAddDelV2Reply) Unmarshal(b []byte) error { 649 buf := codec.NewBuffer(b) 650 m.Retval = buf.DecodeInt32() 651 m.BdID = buf.DecodeUint32() 652 return nil 653 } 654 655 // L2 bridge domain operational state response 656 // - bd_id - the bridge domain id 657 // - flood - bcast/mcast flooding state on all interfaces in the bd 658 // - uu_flood - unknown unicast flooding state on all interfaces in the bd 659 // - forward - forwarding state on all interfaces in the bd 660 // - learn - learning state on all interfaces in the bd 661 // - arp_term - arp termination state on all interfaces in the bd 662 // - arp_ufwd - arp unicast forwarding state on all interfaces in the bd 663 // - mac_age - mac aging time in min, 0 for disabled 664 // - bd_tag - optional textual tag for the bridge domain 665 // - n_sw_ifs - number of sw_if_index's in the domain 666 // 667 // BridgeDomainDetails defines message 'bridge_domain_details'. 668 type BridgeDomainDetails struct { 669 BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` 670 Flood bool `binapi:"bool,name=flood" json:"flood,omitempty"` 671 UuFlood bool `binapi:"bool,name=uu_flood" json:"uu_flood,omitempty"` 672 Forward bool `binapi:"bool,name=forward" json:"forward,omitempty"` 673 Learn bool `binapi:"bool,name=learn" json:"learn,omitempty"` 674 ArpTerm bool `binapi:"bool,name=arp_term" json:"arp_term,omitempty"` 675 ArpUfwd bool `binapi:"bool,name=arp_ufwd" json:"arp_ufwd,omitempty"` 676 MacAge uint8 `binapi:"u8,name=mac_age" json:"mac_age,omitempty"` 677 BdTag string `binapi:"string[64],name=bd_tag" json:"bd_tag,omitempty"` 678 BviSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=bvi_sw_if_index" json:"bvi_sw_if_index,omitempty"` 679 UuFwdSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=uu_fwd_sw_if_index" json:"uu_fwd_sw_if_index,omitempty"` 680 NSwIfs uint32 `binapi:"u32,name=n_sw_ifs" json:"-"` 681 SwIfDetails []BridgeDomainSwIf `binapi:"bridge_domain_sw_if[n_sw_ifs],name=sw_if_details" json:"sw_if_details,omitempty"` 682 } 683 684 func (m *BridgeDomainDetails) Reset() { *m = BridgeDomainDetails{} } 685 func (*BridgeDomainDetails) GetMessageName() string { return "bridge_domain_details" } 686 func (*BridgeDomainDetails) GetCrcString() string { return "0fa506fd" } 687 func (*BridgeDomainDetails) GetMessageType() api.MessageType { 688 return api.ReplyMessage 689 } 690 691 func (m *BridgeDomainDetails) Size() (size int) { 692 if m == nil { 693 return 0 694 } 695 size += 4 // m.BdID 696 size += 1 // m.Flood 697 size += 1 // m.UuFlood 698 size += 1 // m.Forward 699 size += 1 // m.Learn 700 size += 1 // m.ArpTerm 701 size += 1 // m.ArpUfwd 702 size += 1 // m.MacAge 703 size += 64 // m.BdTag 704 size += 4 // m.BviSwIfIndex 705 size += 4 // m.UuFwdSwIfIndex 706 size += 4 // m.NSwIfs 707 for j1 := 0; j1 < len(m.SwIfDetails); j1++ { 708 var s1 BridgeDomainSwIf 709 _ = s1 710 if j1 < len(m.SwIfDetails) { 711 s1 = m.SwIfDetails[j1] 712 } 713 size += 4 // s1.Context 714 size += 4 // s1.SwIfIndex 715 size += 1 // s1.Shg 716 } 717 return size 718 } 719 func (m *BridgeDomainDetails) Marshal(b []byte) ([]byte, error) { 720 if b == nil { 721 b = make([]byte, m.Size()) 722 } 723 buf := codec.NewBuffer(b) 724 buf.EncodeUint32(m.BdID) 725 buf.EncodeBool(m.Flood) 726 buf.EncodeBool(m.UuFlood) 727 buf.EncodeBool(m.Forward) 728 buf.EncodeBool(m.Learn) 729 buf.EncodeBool(m.ArpTerm) 730 buf.EncodeBool(m.ArpUfwd) 731 buf.EncodeUint8(m.MacAge) 732 buf.EncodeString(m.BdTag, 64) 733 buf.EncodeUint32(uint32(m.BviSwIfIndex)) 734 buf.EncodeUint32(uint32(m.UuFwdSwIfIndex)) 735 buf.EncodeUint32(uint32(len(m.SwIfDetails))) 736 for j0 := 0; j0 < len(m.SwIfDetails); j0++ { 737 var v0 BridgeDomainSwIf // SwIfDetails 738 if j0 < len(m.SwIfDetails) { 739 v0 = m.SwIfDetails[j0] 740 } 741 buf.EncodeUint32(v0.Context) 742 buf.EncodeUint32(uint32(v0.SwIfIndex)) 743 buf.EncodeUint8(v0.Shg) 744 } 745 return buf.Bytes(), nil 746 } 747 func (m *BridgeDomainDetails) Unmarshal(b []byte) error { 748 buf := codec.NewBuffer(b) 749 m.BdID = buf.DecodeUint32() 750 m.Flood = buf.DecodeBool() 751 m.UuFlood = buf.DecodeBool() 752 m.Forward = buf.DecodeBool() 753 m.Learn = buf.DecodeBool() 754 m.ArpTerm = buf.DecodeBool() 755 m.ArpUfwd = buf.DecodeBool() 756 m.MacAge = buf.DecodeUint8() 757 m.BdTag = buf.DecodeString(64) 758 m.BviSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 759 m.UuFwdSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 760 m.NSwIfs = buf.DecodeUint32() 761 m.SwIfDetails = make([]BridgeDomainSwIf, m.NSwIfs) 762 for j0 := 0; j0 < len(m.SwIfDetails); j0++ { 763 m.SwIfDetails[j0].Context = buf.DecodeUint32() 764 m.SwIfDetails[j0].SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 765 m.SwIfDetails[j0].Shg = buf.DecodeUint8() 766 } 767 return nil 768 } 769 770 // L2 bridge domain request operational state details 771 // - bd_id - the bridge domain id desired or ~0 to request all bds 772 // - sw_if_index - filter by sw_if_index UNIMPLEMENTED 773 // 774 // BridgeDomainDump defines message 'bridge_domain_dump'. 775 type BridgeDomainDump struct { 776 BdID uint32 `binapi:"u32,name=bd_id,default=4294967295" json:"bd_id,omitempty"` 777 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"` 778 } 779 780 func (m *BridgeDomainDump) Reset() { *m = BridgeDomainDump{} } 781 func (*BridgeDomainDump) GetMessageName() string { return "bridge_domain_dump" } 782 func (*BridgeDomainDump) GetCrcString() string { return "74396a43" } 783 func (*BridgeDomainDump) GetMessageType() api.MessageType { 784 return api.RequestMessage 785 } 786 787 func (m *BridgeDomainDump) Size() (size int) { 788 if m == nil { 789 return 0 790 } 791 size += 4 // m.BdID 792 size += 4 // m.SwIfIndex 793 return size 794 } 795 func (m *BridgeDomainDump) Marshal(b []byte) ([]byte, error) { 796 if b == nil { 797 b = make([]byte, m.Size()) 798 } 799 buf := codec.NewBuffer(b) 800 buf.EncodeUint32(m.BdID) 801 buf.EncodeUint32(uint32(m.SwIfIndex)) 802 return buf.Bytes(), nil 803 } 804 func (m *BridgeDomainDump) Unmarshal(b []byte) error { 805 buf := codec.NewBuffer(b) 806 m.BdID = buf.DecodeUint32() 807 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 808 return nil 809 } 810 811 // L2 bridge domain set default learn limit 812 // - learn limit - maximum number of entries by default for bridge domains 813 // 814 // BridgeDomainSetDefaultLearnLimit defines message 'bridge_domain_set_default_learn_limit'. 815 type BridgeDomainSetDefaultLearnLimit struct { 816 LearnLimit uint32 `binapi:"u32,name=learn_limit" json:"learn_limit,omitempty"` 817 } 818 819 func (m *BridgeDomainSetDefaultLearnLimit) Reset() { *m = BridgeDomainSetDefaultLearnLimit{} } 820 func (*BridgeDomainSetDefaultLearnLimit) GetMessageName() string { 821 return "bridge_domain_set_default_learn_limit" 822 } 823 func (*BridgeDomainSetDefaultLearnLimit) GetCrcString() string { return "f097ffce" } 824 func (*BridgeDomainSetDefaultLearnLimit) GetMessageType() api.MessageType { 825 return api.RequestMessage 826 } 827 828 func (m *BridgeDomainSetDefaultLearnLimit) Size() (size int) { 829 if m == nil { 830 return 0 831 } 832 size += 4 // m.LearnLimit 833 return size 834 } 835 func (m *BridgeDomainSetDefaultLearnLimit) Marshal(b []byte) ([]byte, error) { 836 if b == nil { 837 b = make([]byte, m.Size()) 838 } 839 buf := codec.NewBuffer(b) 840 buf.EncodeUint32(m.LearnLimit) 841 return buf.Bytes(), nil 842 } 843 func (m *BridgeDomainSetDefaultLearnLimit) Unmarshal(b []byte) error { 844 buf := codec.NewBuffer(b) 845 m.LearnLimit = buf.DecodeUint32() 846 return nil 847 } 848 849 // BridgeDomainSetDefaultLearnLimitReply defines message 'bridge_domain_set_default_learn_limit_reply'. 850 type BridgeDomainSetDefaultLearnLimitReply struct { 851 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 852 } 853 854 func (m *BridgeDomainSetDefaultLearnLimitReply) Reset() { *m = BridgeDomainSetDefaultLearnLimitReply{} } 855 func (*BridgeDomainSetDefaultLearnLimitReply) GetMessageName() string { 856 return "bridge_domain_set_default_learn_limit_reply" 857 } 858 func (*BridgeDomainSetDefaultLearnLimitReply) GetCrcString() string { return "e8d4e804" } 859 func (*BridgeDomainSetDefaultLearnLimitReply) GetMessageType() api.MessageType { 860 return api.ReplyMessage 861 } 862 863 func (m *BridgeDomainSetDefaultLearnLimitReply) Size() (size int) { 864 if m == nil { 865 return 0 866 } 867 size += 4 // m.Retval 868 return size 869 } 870 func (m *BridgeDomainSetDefaultLearnLimitReply) Marshal(b []byte) ([]byte, error) { 871 if b == nil { 872 b = make([]byte, m.Size()) 873 } 874 buf := codec.NewBuffer(b) 875 buf.EncodeInt32(m.Retval) 876 return buf.Bytes(), nil 877 } 878 func (m *BridgeDomainSetDefaultLearnLimitReply) Unmarshal(b []byte) error { 879 buf := codec.NewBuffer(b) 880 m.Retval = buf.DecodeInt32() 881 return nil 882 } 883 884 // L2 bridge domain set learn limit 885 // - bd_id - the bridge domain idenntifier 886 // - learn limit - maximum number of entries for this bd 887 // 888 // BridgeDomainSetLearnLimit defines message 'bridge_domain_set_learn_limit'. 889 type BridgeDomainSetLearnLimit struct { 890 BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` 891 LearnLimit uint32 `binapi:"u32,name=learn_limit" json:"learn_limit,omitempty"` 892 } 893 894 func (m *BridgeDomainSetLearnLimit) Reset() { *m = BridgeDomainSetLearnLimit{} } 895 func (*BridgeDomainSetLearnLimit) GetMessageName() string { return "bridge_domain_set_learn_limit" } 896 func (*BridgeDomainSetLearnLimit) GetCrcString() string { return "89c52b5f" } 897 func (*BridgeDomainSetLearnLimit) GetMessageType() api.MessageType { 898 return api.RequestMessage 899 } 900 901 func (m *BridgeDomainSetLearnLimit) Size() (size int) { 902 if m == nil { 903 return 0 904 } 905 size += 4 // m.BdID 906 size += 4 // m.LearnLimit 907 return size 908 } 909 func (m *BridgeDomainSetLearnLimit) Marshal(b []byte) ([]byte, error) { 910 if b == nil { 911 b = make([]byte, m.Size()) 912 } 913 buf := codec.NewBuffer(b) 914 buf.EncodeUint32(m.BdID) 915 buf.EncodeUint32(m.LearnLimit) 916 return buf.Bytes(), nil 917 } 918 func (m *BridgeDomainSetLearnLimit) Unmarshal(b []byte) error { 919 buf := codec.NewBuffer(b) 920 m.BdID = buf.DecodeUint32() 921 m.LearnLimit = buf.DecodeUint32() 922 return nil 923 } 924 925 // BridgeDomainSetLearnLimitReply defines message 'bridge_domain_set_learn_limit_reply'. 926 type BridgeDomainSetLearnLimitReply struct { 927 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 928 } 929 930 func (m *BridgeDomainSetLearnLimitReply) Reset() { *m = BridgeDomainSetLearnLimitReply{} } 931 func (*BridgeDomainSetLearnLimitReply) GetMessageName() string { 932 return "bridge_domain_set_learn_limit_reply" 933 } 934 func (*BridgeDomainSetLearnLimitReply) GetCrcString() string { return "e8d4e804" } 935 func (*BridgeDomainSetLearnLimitReply) GetMessageType() api.MessageType { 936 return api.ReplyMessage 937 } 938 939 func (m *BridgeDomainSetLearnLimitReply) Size() (size int) { 940 if m == nil { 941 return 0 942 } 943 size += 4 // m.Retval 944 return size 945 } 946 func (m *BridgeDomainSetLearnLimitReply) Marshal(b []byte) ([]byte, error) { 947 if b == nil { 948 b = make([]byte, m.Size()) 949 } 950 buf := codec.NewBuffer(b) 951 buf.EncodeInt32(m.Retval) 952 return buf.Bytes(), nil 953 } 954 func (m *BridgeDomainSetLearnLimitReply) Unmarshal(b []byte) error { 955 buf := codec.NewBuffer(b) 956 m.Retval = buf.DecodeInt32() 957 return nil 958 } 959 960 // L2 bridge domain set mac age 961 // - bd_id - the bridge domain to create 962 // - mac_age - mac aging time in min, 0 for disabled 963 // 964 // BridgeDomainSetMacAge defines message 'bridge_domain_set_mac_age'. 965 type BridgeDomainSetMacAge struct { 966 BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` 967 MacAge uint8 `binapi:"u8,name=mac_age" json:"mac_age,omitempty"` 968 } 969 970 func (m *BridgeDomainSetMacAge) Reset() { *m = BridgeDomainSetMacAge{} } 971 func (*BridgeDomainSetMacAge) GetMessageName() string { return "bridge_domain_set_mac_age" } 972 func (*BridgeDomainSetMacAge) GetCrcString() string { return "b537ad7b" } 973 func (*BridgeDomainSetMacAge) GetMessageType() api.MessageType { 974 return api.RequestMessage 975 } 976 977 func (m *BridgeDomainSetMacAge) Size() (size int) { 978 if m == nil { 979 return 0 980 } 981 size += 4 // m.BdID 982 size += 1 // m.MacAge 983 return size 984 } 985 func (m *BridgeDomainSetMacAge) Marshal(b []byte) ([]byte, error) { 986 if b == nil { 987 b = make([]byte, m.Size()) 988 } 989 buf := codec.NewBuffer(b) 990 buf.EncodeUint32(m.BdID) 991 buf.EncodeUint8(m.MacAge) 992 return buf.Bytes(), nil 993 } 994 func (m *BridgeDomainSetMacAge) Unmarshal(b []byte) error { 995 buf := codec.NewBuffer(b) 996 m.BdID = buf.DecodeUint32() 997 m.MacAge = buf.DecodeUint8() 998 return nil 999 } 1000 1001 // BridgeDomainSetMacAgeReply defines message 'bridge_domain_set_mac_age_reply'. 1002 type BridgeDomainSetMacAgeReply struct { 1003 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1004 } 1005 1006 func (m *BridgeDomainSetMacAgeReply) Reset() { *m = BridgeDomainSetMacAgeReply{} } 1007 func (*BridgeDomainSetMacAgeReply) GetMessageName() string { return "bridge_domain_set_mac_age_reply" } 1008 func (*BridgeDomainSetMacAgeReply) GetCrcString() string { return "e8d4e804" } 1009 func (*BridgeDomainSetMacAgeReply) GetMessageType() api.MessageType { 1010 return api.ReplyMessage 1011 } 1012 1013 func (m *BridgeDomainSetMacAgeReply) Size() (size int) { 1014 if m == nil { 1015 return 0 1016 } 1017 size += 4 // m.Retval 1018 return size 1019 } 1020 func (m *BridgeDomainSetMacAgeReply) Marshal(b []byte) ([]byte, error) { 1021 if b == nil { 1022 b = make([]byte, m.Size()) 1023 } 1024 buf := codec.NewBuffer(b) 1025 buf.EncodeInt32(m.Retval) 1026 return buf.Bytes(), nil 1027 } 1028 func (m *BridgeDomainSetMacAgeReply) Unmarshal(b []byte) error { 1029 buf := codec.NewBuffer(b) 1030 m.Retval = buf.DecodeInt32() 1031 return nil 1032 } 1033 1034 // Set bridge flags request 1035 // - bd_id - the bridge domain to set the flags for 1036 // - is_set - if non-zero, set the flags, else clear them 1037 // - flags - flags that are non-zero to set or clear 1038 // 1039 // BridgeFlags defines message 'bridge_flags'. 1040 type BridgeFlags struct { 1041 BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` 1042 IsSet bool `binapi:"bool,name=is_set" json:"is_set,omitempty"` 1043 Flags BdFlags `binapi:"bd_flags,name=flags" json:"flags,omitempty"` 1044 } 1045 1046 func (m *BridgeFlags) Reset() { *m = BridgeFlags{} } 1047 func (*BridgeFlags) GetMessageName() string { return "bridge_flags" } 1048 func (*BridgeFlags) GetCrcString() string { return "1b0c5fbd" } 1049 func (*BridgeFlags) GetMessageType() api.MessageType { 1050 return api.RequestMessage 1051 } 1052 1053 func (m *BridgeFlags) Size() (size int) { 1054 if m == nil { 1055 return 0 1056 } 1057 size += 4 // m.BdID 1058 size += 1 // m.IsSet 1059 size += 4 // m.Flags 1060 return size 1061 } 1062 func (m *BridgeFlags) Marshal(b []byte) ([]byte, error) { 1063 if b == nil { 1064 b = make([]byte, m.Size()) 1065 } 1066 buf := codec.NewBuffer(b) 1067 buf.EncodeUint32(m.BdID) 1068 buf.EncodeBool(m.IsSet) 1069 buf.EncodeUint32(uint32(m.Flags)) 1070 return buf.Bytes(), nil 1071 } 1072 func (m *BridgeFlags) Unmarshal(b []byte) error { 1073 buf := codec.NewBuffer(b) 1074 m.BdID = buf.DecodeUint32() 1075 m.IsSet = buf.DecodeBool() 1076 m.Flags = BdFlags(buf.DecodeUint32()) 1077 return nil 1078 } 1079 1080 // Set bridge flags response 1081 // - retval - return code for the set bridge flags request 1082 // - resulting_feature_bitmap - the internal L2 feature bitmap after the request is implemented 1083 // 1084 // BridgeFlagsReply defines message 'bridge_flags_reply'. 1085 type BridgeFlagsReply struct { 1086 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1087 ResultingFeatureBitmap uint32 `binapi:"u32,name=resulting_feature_bitmap" json:"resulting_feature_bitmap,omitempty"` 1088 } 1089 1090 func (m *BridgeFlagsReply) Reset() { *m = BridgeFlagsReply{} } 1091 func (*BridgeFlagsReply) GetMessageName() string { return "bridge_flags_reply" } 1092 func (*BridgeFlagsReply) GetCrcString() string { return "29b2a2b3" } 1093 func (*BridgeFlagsReply) GetMessageType() api.MessageType { 1094 return api.ReplyMessage 1095 } 1096 1097 func (m *BridgeFlagsReply) Size() (size int) { 1098 if m == nil { 1099 return 0 1100 } 1101 size += 4 // m.Retval 1102 size += 4 // m.ResultingFeatureBitmap 1103 return size 1104 } 1105 func (m *BridgeFlagsReply) Marshal(b []byte) ([]byte, error) { 1106 if b == nil { 1107 b = make([]byte, m.Size()) 1108 } 1109 buf := codec.NewBuffer(b) 1110 buf.EncodeInt32(m.Retval) 1111 buf.EncodeUint32(m.ResultingFeatureBitmap) 1112 return buf.Bytes(), nil 1113 } 1114 func (m *BridgeFlagsReply) Unmarshal(b []byte) error { 1115 buf := codec.NewBuffer(b) 1116 m.Retval = buf.DecodeInt32() 1117 m.ResultingFeatureBitmap = buf.DecodeUint32() 1118 return nil 1119 } 1120 1121 // Create BVI interface instance request 1122 // - mac_address - mac addr to assign to the interface if none-zero 1123 // - user_instance - requested instance, ~0 => dynamically allocate 1124 // 1125 // BviCreate defines message 'bvi_create'. 1126 type BviCreate struct { 1127 Mac ethernet_types.MacAddress `binapi:"mac_address,name=mac" json:"mac,omitempty"` 1128 UserInstance uint32 `binapi:"u32,name=user_instance,default=4294967295" json:"user_instance,omitempty"` 1129 } 1130 1131 func (m *BviCreate) Reset() { *m = BviCreate{} } 1132 func (*BviCreate) GetMessageName() string { return "bvi_create" } 1133 func (*BviCreate) GetCrcString() string { return "f5398559" } 1134 func (*BviCreate) GetMessageType() api.MessageType { 1135 return api.RequestMessage 1136 } 1137 1138 func (m *BviCreate) Size() (size int) { 1139 if m == nil { 1140 return 0 1141 } 1142 size += 1 * 6 // m.Mac 1143 size += 4 // m.UserInstance 1144 return size 1145 } 1146 func (m *BviCreate) Marshal(b []byte) ([]byte, error) { 1147 if b == nil { 1148 b = make([]byte, m.Size()) 1149 } 1150 buf := codec.NewBuffer(b) 1151 buf.EncodeBytes(m.Mac[:], 6) 1152 buf.EncodeUint32(m.UserInstance) 1153 return buf.Bytes(), nil 1154 } 1155 func (m *BviCreate) Unmarshal(b []byte) error { 1156 buf := codec.NewBuffer(b) 1157 copy(m.Mac[:], buf.DecodeBytes(6)) 1158 m.UserInstance = buf.DecodeUint32() 1159 return nil 1160 } 1161 1162 // Create BVI interface instance response 1163 // - sw_if_index - sw index of the interface that was created 1164 // - retval - return code for the request 1165 // 1166 // BviCreateReply defines message 'bvi_create_reply'. 1167 type BviCreateReply struct { 1168 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1169 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 1170 } 1171 1172 func (m *BviCreateReply) Reset() { *m = BviCreateReply{} } 1173 func (*BviCreateReply) GetMessageName() string { return "bvi_create_reply" } 1174 func (*BviCreateReply) GetCrcString() string { return "5383d31f" } 1175 func (*BviCreateReply) GetMessageType() api.MessageType { 1176 return api.ReplyMessage 1177 } 1178 1179 func (m *BviCreateReply) Size() (size int) { 1180 if m == nil { 1181 return 0 1182 } 1183 size += 4 // m.Retval 1184 size += 4 // m.SwIfIndex 1185 return size 1186 } 1187 func (m *BviCreateReply) Marshal(b []byte) ([]byte, error) { 1188 if b == nil { 1189 b = make([]byte, m.Size()) 1190 } 1191 buf := codec.NewBuffer(b) 1192 buf.EncodeInt32(m.Retval) 1193 buf.EncodeUint32(uint32(m.SwIfIndex)) 1194 return buf.Bytes(), nil 1195 } 1196 func (m *BviCreateReply) Unmarshal(b []byte) error { 1197 buf := codec.NewBuffer(b) 1198 m.Retval = buf.DecodeInt32() 1199 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1200 return nil 1201 } 1202 1203 // Delete BVI interface request 1204 // - sw_if_index - sw index of the interface that was created 1205 // 1206 // BviDelete defines message 'bvi_delete'. 1207 type BviDelete struct { 1208 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 1209 } 1210 1211 func (m *BviDelete) Reset() { *m = BviDelete{} } 1212 func (*BviDelete) GetMessageName() string { return "bvi_delete" } 1213 func (*BviDelete) GetCrcString() string { return "f9e6675e" } 1214 func (*BviDelete) GetMessageType() api.MessageType { 1215 return api.RequestMessage 1216 } 1217 1218 func (m *BviDelete) Size() (size int) { 1219 if m == nil { 1220 return 0 1221 } 1222 size += 4 // m.SwIfIndex 1223 return size 1224 } 1225 func (m *BviDelete) Marshal(b []byte) ([]byte, error) { 1226 if b == nil { 1227 b = make([]byte, m.Size()) 1228 } 1229 buf := codec.NewBuffer(b) 1230 buf.EncodeUint32(uint32(m.SwIfIndex)) 1231 return buf.Bytes(), nil 1232 } 1233 func (m *BviDelete) Unmarshal(b []byte) error { 1234 buf := codec.NewBuffer(b) 1235 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1236 return nil 1237 } 1238 1239 // BviDeleteReply defines message 'bvi_delete_reply'. 1240 type BviDeleteReply struct { 1241 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1242 } 1243 1244 func (m *BviDeleteReply) Reset() { *m = BviDeleteReply{} } 1245 func (*BviDeleteReply) GetMessageName() string { return "bvi_delete_reply" } 1246 func (*BviDeleteReply) GetCrcString() string { return "e8d4e804" } 1247 func (*BviDeleteReply) GetMessageType() api.MessageType { 1248 return api.ReplyMessage 1249 } 1250 1251 func (m *BviDeleteReply) Size() (size int) { 1252 if m == nil { 1253 return 0 1254 } 1255 size += 4 // m.Retval 1256 return size 1257 } 1258 func (m *BviDeleteReply) Marshal(b []byte) ([]byte, error) { 1259 if b == nil { 1260 b = make([]byte, m.Size()) 1261 } 1262 buf := codec.NewBuffer(b) 1263 buf.EncodeInt32(m.Retval) 1264 return buf.Bytes(), nil 1265 } 1266 func (m *BviDeleteReply) Unmarshal(b []byte) error { 1267 buf := codec.NewBuffer(b) 1268 m.Retval = buf.DecodeInt32() 1269 return nil 1270 } 1271 1272 // Tell client about an IP4 ARP resolution event or 1273 // 1274 // MAC/IP info from ARP requests in L2 BDs 1275 // - pid - client pid registered to receive notification 1276 // - ip - IP address of new ARP term entry 1277 // - sw_if_index - interface of new ARP term entry 1278 // - mac - MAC address of new ARP term entry 1279 // 1280 // L2ArpTermEvent defines message 'l2_arp_term_event'. 1281 type L2ArpTermEvent struct { 1282 PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"` 1283 IP ip_types.Address `binapi:"address,name=ip" json:"ip,omitempty"` 1284 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 1285 Mac ethernet_types.MacAddress `binapi:"mac_address,name=mac" json:"mac,omitempty"` 1286 } 1287 1288 func (m *L2ArpTermEvent) Reset() { *m = L2ArpTermEvent{} } 1289 func (*L2ArpTermEvent) GetMessageName() string { return "l2_arp_term_event" } 1290 func (*L2ArpTermEvent) GetCrcString() string { return "6963e07a" } 1291 func (*L2ArpTermEvent) GetMessageType() api.MessageType { 1292 return api.EventMessage 1293 } 1294 1295 func (m *L2ArpTermEvent) Size() (size int) { 1296 if m == nil { 1297 return 0 1298 } 1299 size += 4 // m.PID 1300 size += 1 // m.IP.Af 1301 size += 1 * 16 // m.IP.Un 1302 size += 4 // m.SwIfIndex 1303 size += 1 * 6 // m.Mac 1304 return size 1305 } 1306 func (m *L2ArpTermEvent) Marshal(b []byte) ([]byte, error) { 1307 if b == nil { 1308 b = make([]byte, m.Size()) 1309 } 1310 buf := codec.NewBuffer(b) 1311 buf.EncodeUint32(m.PID) 1312 buf.EncodeUint8(uint8(m.IP.Af)) 1313 buf.EncodeBytes(m.IP.Un.XXX_UnionData[:], 16) 1314 buf.EncodeUint32(uint32(m.SwIfIndex)) 1315 buf.EncodeBytes(m.Mac[:], 6) 1316 return buf.Bytes(), nil 1317 } 1318 func (m *L2ArpTermEvent) Unmarshal(b []byte) error { 1319 buf := codec.NewBuffer(b) 1320 m.PID = buf.DecodeUint32() 1321 m.IP.Af = ip_types.AddressFamily(buf.DecodeUint8()) 1322 copy(m.IP.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 1323 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1324 copy(m.Mac[:], buf.DecodeBytes(6)) 1325 return nil 1326 } 1327 1328 // L2 fib clear table request, clear all mac entries in the l2 fib 1329 // L2FibClearTable defines message 'l2_fib_clear_table'. 1330 type L2FibClearTable struct{} 1331 1332 func (m *L2FibClearTable) Reset() { *m = L2FibClearTable{} } 1333 func (*L2FibClearTable) GetMessageName() string { return "l2_fib_clear_table" } 1334 func (*L2FibClearTable) GetCrcString() string { return "51077d14" } 1335 func (*L2FibClearTable) GetMessageType() api.MessageType { 1336 return api.RequestMessage 1337 } 1338 1339 func (m *L2FibClearTable) Size() (size int) { 1340 if m == nil { 1341 return 0 1342 } 1343 return size 1344 } 1345 func (m *L2FibClearTable) Marshal(b []byte) ([]byte, error) { 1346 if b == nil { 1347 b = make([]byte, m.Size()) 1348 } 1349 buf := codec.NewBuffer(b) 1350 return buf.Bytes(), nil 1351 } 1352 func (m *L2FibClearTable) Unmarshal(b []byte) error { 1353 return nil 1354 } 1355 1356 // L2FibClearTableReply defines message 'l2_fib_clear_table_reply'. 1357 type L2FibClearTableReply struct { 1358 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1359 } 1360 1361 func (m *L2FibClearTableReply) Reset() { *m = L2FibClearTableReply{} } 1362 func (*L2FibClearTableReply) GetMessageName() string { return "l2_fib_clear_table_reply" } 1363 func (*L2FibClearTableReply) GetCrcString() string { return "e8d4e804" } 1364 func (*L2FibClearTableReply) GetMessageType() api.MessageType { 1365 return api.ReplyMessage 1366 } 1367 1368 func (m *L2FibClearTableReply) Size() (size int) { 1369 if m == nil { 1370 return 0 1371 } 1372 size += 4 // m.Retval 1373 return size 1374 } 1375 func (m *L2FibClearTableReply) Marshal(b []byte) ([]byte, error) { 1376 if b == nil { 1377 b = make([]byte, m.Size()) 1378 } 1379 buf := codec.NewBuffer(b) 1380 buf.EncodeInt32(m.Retval) 1381 return buf.Bytes(), nil 1382 } 1383 func (m *L2FibClearTableReply) Unmarshal(b []byte) error { 1384 buf := codec.NewBuffer(b) 1385 m.Retval = buf.DecodeInt32() 1386 return nil 1387 } 1388 1389 // l2 fib table details structure 1390 // - bd_id - the l2 fib / bridge domain table id 1391 // - mac - the entry's mac address 1392 // - sw_if_index - index of the interface 1393 // - static_mac - the entry is statically configured. 1394 // - filter_mac - the entry is a mac filter entry. 1395 // - bvi_mac - the mac address is a bridge virtual interface 1396 // 1397 // L2FibTableDetails defines message 'l2_fib_table_details'. 1398 type L2FibTableDetails struct { 1399 BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` 1400 Mac ethernet_types.MacAddress `binapi:"mac_address,name=mac" json:"mac,omitempty"` 1401 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 1402 StaticMac bool `binapi:"bool,name=static_mac" json:"static_mac,omitempty"` 1403 FilterMac bool `binapi:"bool,name=filter_mac" json:"filter_mac,omitempty"` 1404 BviMac bool `binapi:"bool,name=bvi_mac" json:"bvi_mac,omitempty"` 1405 } 1406 1407 func (m *L2FibTableDetails) Reset() { *m = L2FibTableDetails{} } 1408 func (*L2FibTableDetails) GetMessageName() string { return "l2_fib_table_details" } 1409 func (*L2FibTableDetails) GetCrcString() string { return "a44ef6b8" } 1410 func (*L2FibTableDetails) GetMessageType() api.MessageType { 1411 return api.ReplyMessage 1412 } 1413 1414 func (m *L2FibTableDetails) Size() (size int) { 1415 if m == nil { 1416 return 0 1417 } 1418 size += 4 // m.BdID 1419 size += 1 * 6 // m.Mac 1420 size += 4 // m.SwIfIndex 1421 size += 1 // m.StaticMac 1422 size += 1 // m.FilterMac 1423 size += 1 // m.BviMac 1424 return size 1425 } 1426 func (m *L2FibTableDetails) Marshal(b []byte) ([]byte, error) { 1427 if b == nil { 1428 b = make([]byte, m.Size()) 1429 } 1430 buf := codec.NewBuffer(b) 1431 buf.EncodeUint32(m.BdID) 1432 buf.EncodeBytes(m.Mac[:], 6) 1433 buf.EncodeUint32(uint32(m.SwIfIndex)) 1434 buf.EncodeBool(m.StaticMac) 1435 buf.EncodeBool(m.FilterMac) 1436 buf.EncodeBool(m.BviMac) 1437 return buf.Bytes(), nil 1438 } 1439 func (m *L2FibTableDetails) Unmarshal(b []byte) error { 1440 buf := codec.NewBuffer(b) 1441 m.BdID = buf.DecodeUint32() 1442 copy(m.Mac[:], buf.DecodeBytes(6)) 1443 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1444 m.StaticMac = buf.DecodeBool() 1445 m.FilterMac = buf.DecodeBool() 1446 m.BviMac = buf.DecodeBool() 1447 return nil 1448 } 1449 1450 // Dump l2 fib (aka bridge domain) table 1451 // - bd_id - the l2 fib / bridge domain table identifier 1452 // 1453 // L2FibTableDump defines message 'l2_fib_table_dump'. 1454 type L2FibTableDump struct { 1455 BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` 1456 } 1457 1458 func (m *L2FibTableDump) Reset() { *m = L2FibTableDump{} } 1459 func (*L2FibTableDump) GetMessageName() string { return "l2_fib_table_dump" } 1460 func (*L2FibTableDump) GetCrcString() string { return "c25fdce6" } 1461 func (*L2FibTableDump) GetMessageType() api.MessageType { 1462 return api.RequestMessage 1463 } 1464 1465 func (m *L2FibTableDump) Size() (size int) { 1466 if m == nil { 1467 return 0 1468 } 1469 size += 4 // m.BdID 1470 return size 1471 } 1472 func (m *L2FibTableDump) Marshal(b []byte) ([]byte, error) { 1473 if b == nil { 1474 b = make([]byte, m.Size()) 1475 } 1476 buf := codec.NewBuffer(b) 1477 buf.EncodeUint32(m.BdID) 1478 return buf.Bytes(), nil 1479 } 1480 func (m *L2FibTableDump) Unmarshal(b []byte) error { 1481 buf := codec.NewBuffer(b) 1482 m.BdID = buf.DecodeUint32() 1483 return nil 1484 } 1485 1486 // Set interface L2 flags (such as L2_LEARN, L2_FWD, 1487 // 1488 // L2_FLOOD, L2_UU_FLOOD, or L2_ARP_TERM bits). This can be used 1489 // to disable one or more of the features represented by the 1490 // flag bits on an interface to override what is set as default 1491 // for all interfaces in the bridge domain 1492 // - sw_if_index - interface 1493 // - is_set - if non-zero, set the bits, else clear them 1494 // - feature_bitmap - non-zero bits (as above) to set or clear 1495 // 1496 // L2Flags defines message 'l2_flags'. 1497 type L2Flags struct { 1498 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 1499 IsSet bool `binapi:"bool,name=is_set" json:"is_set,omitempty"` 1500 FeatureBitmap uint32 `binapi:"u32,name=feature_bitmap" json:"feature_bitmap,omitempty"` 1501 } 1502 1503 func (m *L2Flags) Reset() { *m = L2Flags{} } 1504 func (*L2Flags) GetMessageName() string { return "l2_flags" } 1505 func (*L2Flags) GetCrcString() string { return "fc41cfe8" } 1506 func (*L2Flags) GetMessageType() api.MessageType { 1507 return api.RequestMessage 1508 } 1509 1510 func (m *L2Flags) Size() (size int) { 1511 if m == nil { 1512 return 0 1513 } 1514 size += 4 // m.SwIfIndex 1515 size += 1 // m.IsSet 1516 size += 4 // m.FeatureBitmap 1517 return size 1518 } 1519 func (m *L2Flags) Marshal(b []byte) ([]byte, error) { 1520 if b == nil { 1521 b = make([]byte, m.Size()) 1522 } 1523 buf := codec.NewBuffer(b) 1524 buf.EncodeUint32(uint32(m.SwIfIndex)) 1525 buf.EncodeBool(m.IsSet) 1526 buf.EncodeUint32(m.FeatureBitmap) 1527 return buf.Bytes(), nil 1528 } 1529 func (m *L2Flags) Unmarshal(b []byte) error { 1530 buf := codec.NewBuffer(b) 1531 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1532 m.IsSet = buf.DecodeBool() 1533 m.FeatureBitmap = buf.DecodeUint32() 1534 return nil 1535 } 1536 1537 // Set interface L2 flags response 1538 // - retval - return code for the set l2 bits request 1539 // - resulting_feature_bitmap - the internal l2 feature bitmap after the request is implemented 1540 // 1541 // L2FlagsReply defines message 'l2_flags_reply'. 1542 type L2FlagsReply struct { 1543 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1544 ResultingFeatureBitmap uint32 `binapi:"u32,name=resulting_feature_bitmap" json:"resulting_feature_bitmap,omitempty"` 1545 } 1546 1547 func (m *L2FlagsReply) Reset() { *m = L2FlagsReply{} } 1548 func (*L2FlagsReply) GetMessageName() string { return "l2_flags_reply" } 1549 func (*L2FlagsReply) GetCrcString() string { return "29b2a2b3" } 1550 func (*L2FlagsReply) GetMessageType() api.MessageType { 1551 return api.ReplyMessage 1552 } 1553 1554 func (m *L2FlagsReply) Size() (size int) { 1555 if m == nil { 1556 return 0 1557 } 1558 size += 4 // m.Retval 1559 size += 4 // m.ResultingFeatureBitmap 1560 return size 1561 } 1562 func (m *L2FlagsReply) Marshal(b []byte) ([]byte, error) { 1563 if b == nil { 1564 b = make([]byte, m.Size()) 1565 } 1566 buf := codec.NewBuffer(b) 1567 buf.EncodeInt32(m.Retval) 1568 buf.EncodeUint32(m.ResultingFeatureBitmap) 1569 return buf.Bytes(), nil 1570 } 1571 func (m *L2FlagsReply) Unmarshal(b []byte) error { 1572 buf := codec.NewBuffer(b) 1573 m.Retval = buf.DecodeInt32() 1574 m.ResultingFeatureBitmap = buf.DecodeUint32() 1575 return nil 1576 } 1577 1578 // L2 interface ethernet flow point filtering enable/disable request 1579 // - sw_if_index - interface to enable/disable filtering on 1580 // - enable_disable - if non-zero enable filtering, else disable 1581 // 1582 // L2InterfaceEfpFilter defines message 'l2_interface_efp_filter'. 1583 type L2InterfaceEfpFilter struct { 1584 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 1585 EnableDisable bool `binapi:"bool,name=enable_disable,default=true" json:"enable_disable,omitempty"` 1586 } 1587 1588 func (m *L2InterfaceEfpFilter) Reset() { *m = L2InterfaceEfpFilter{} } 1589 func (*L2InterfaceEfpFilter) GetMessageName() string { return "l2_interface_efp_filter" } 1590 func (*L2InterfaceEfpFilter) GetCrcString() string { return "5501adee" } 1591 func (*L2InterfaceEfpFilter) GetMessageType() api.MessageType { 1592 return api.RequestMessage 1593 } 1594 1595 func (m *L2InterfaceEfpFilter) Size() (size int) { 1596 if m == nil { 1597 return 0 1598 } 1599 size += 4 // m.SwIfIndex 1600 size += 1 // m.EnableDisable 1601 return size 1602 } 1603 func (m *L2InterfaceEfpFilter) Marshal(b []byte) ([]byte, error) { 1604 if b == nil { 1605 b = make([]byte, m.Size()) 1606 } 1607 buf := codec.NewBuffer(b) 1608 buf.EncodeUint32(uint32(m.SwIfIndex)) 1609 buf.EncodeBool(m.EnableDisable) 1610 return buf.Bytes(), nil 1611 } 1612 func (m *L2InterfaceEfpFilter) Unmarshal(b []byte) error { 1613 buf := codec.NewBuffer(b) 1614 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1615 m.EnableDisable = buf.DecodeBool() 1616 return nil 1617 } 1618 1619 // L2InterfaceEfpFilterReply defines message 'l2_interface_efp_filter_reply'. 1620 type L2InterfaceEfpFilterReply struct { 1621 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1622 } 1623 1624 func (m *L2InterfaceEfpFilterReply) Reset() { *m = L2InterfaceEfpFilterReply{} } 1625 func (*L2InterfaceEfpFilterReply) GetMessageName() string { return "l2_interface_efp_filter_reply" } 1626 func (*L2InterfaceEfpFilterReply) GetCrcString() string { return "e8d4e804" } 1627 func (*L2InterfaceEfpFilterReply) GetMessageType() api.MessageType { 1628 return api.ReplyMessage 1629 } 1630 1631 func (m *L2InterfaceEfpFilterReply) Size() (size int) { 1632 if m == nil { 1633 return 0 1634 } 1635 size += 4 // m.Retval 1636 return size 1637 } 1638 func (m *L2InterfaceEfpFilterReply) Marshal(b []byte) ([]byte, error) { 1639 if b == nil { 1640 b = make([]byte, m.Size()) 1641 } 1642 buf := codec.NewBuffer(b) 1643 buf.EncodeInt32(m.Retval) 1644 return buf.Bytes(), nil 1645 } 1646 func (m *L2InterfaceEfpFilterReply) Unmarshal(b []byte) error { 1647 buf := codec.NewBuffer(b) 1648 m.Retval = buf.DecodeInt32() 1649 return nil 1650 } 1651 1652 // L2 interface pbb tag rewrite configure request 1653 // - sw_if_index - interface the operation is applied to 1654 // - vtr_op - Choose from l2_vtr_op_t enum values 1655 // - inner_tag - needed for translate_qinq vtr op only 1656 // - outer_tag - needed for translate_qinq vtr op only 1657 // - b_dmac - B-tag remote mac address, needed for any push or translate_qinq vtr op 1658 // - b_smac - B-tag local mac address, needed for any push or translate qinq vtr op 1659 // - b_vlanid - B-tag vlanid, needed for any push or translate qinq vtr op 1660 // - i_sid - I-tag service id, needed for any push or translate qinq vtr op 1661 // 1662 // L2InterfacePbbTagRewrite defines message 'l2_interface_pbb_tag_rewrite'. 1663 type L2InterfacePbbTagRewrite struct { 1664 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 1665 VtrOp uint32 `binapi:"u32,name=vtr_op" json:"vtr_op,omitempty"` 1666 OuterTag uint16 `binapi:"u16,name=outer_tag" json:"outer_tag,omitempty"` 1667 BDmac ethernet_types.MacAddress `binapi:"mac_address,name=b_dmac" json:"b_dmac,omitempty"` 1668 BSmac ethernet_types.MacAddress `binapi:"mac_address,name=b_smac" json:"b_smac,omitempty"` 1669 BVlanid uint16 `binapi:"u16,name=b_vlanid" json:"b_vlanid,omitempty"` 1670 ISid uint32 `binapi:"u32,name=i_sid" json:"i_sid,omitempty"` 1671 } 1672 1673 func (m *L2InterfacePbbTagRewrite) Reset() { *m = L2InterfacePbbTagRewrite{} } 1674 func (*L2InterfacePbbTagRewrite) GetMessageName() string { return "l2_interface_pbb_tag_rewrite" } 1675 func (*L2InterfacePbbTagRewrite) GetCrcString() string { return "38e802a8" } 1676 func (*L2InterfacePbbTagRewrite) GetMessageType() api.MessageType { 1677 return api.RequestMessage 1678 } 1679 1680 func (m *L2InterfacePbbTagRewrite) Size() (size int) { 1681 if m == nil { 1682 return 0 1683 } 1684 size += 4 // m.SwIfIndex 1685 size += 4 // m.VtrOp 1686 size += 2 // m.OuterTag 1687 size += 1 * 6 // m.BDmac 1688 size += 1 * 6 // m.BSmac 1689 size += 2 // m.BVlanid 1690 size += 4 // m.ISid 1691 return size 1692 } 1693 func (m *L2InterfacePbbTagRewrite) Marshal(b []byte) ([]byte, error) { 1694 if b == nil { 1695 b = make([]byte, m.Size()) 1696 } 1697 buf := codec.NewBuffer(b) 1698 buf.EncodeUint32(uint32(m.SwIfIndex)) 1699 buf.EncodeUint32(m.VtrOp) 1700 buf.EncodeUint16(m.OuterTag) 1701 buf.EncodeBytes(m.BDmac[:], 6) 1702 buf.EncodeBytes(m.BSmac[:], 6) 1703 buf.EncodeUint16(m.BVlanid) 1704 buf.EncodeUint32(m.ISid) 1705 return buf.Bytes(), nil 1706 } 1707 func (m *L2InterfacePbbTagRewrite) Unmarshal(b []byte) error { 1708 buf := codec.NewBuffer(b) 1709 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1710 m.VtrOp = buf.DecodeUint32() 1711 m.OuterTag = buf.DecodeUint16() 1712 copy(m.BDmac[:], buf.DecodeBytes(6)) 1713 copy(m.BSmac[:], buf.DecodeBytes(6)) 1714 m.BVlanid = buf.DecodeUint16() 1715 m.ISid = buf.DecodeUint32() 1716 return nil 1717 } 1718 1719 // L2InterfacePbbTagRewriteReply defines message 'l2_interface_pbb_tag_rewrite_reply'. 1720 type L2InterfacePbbTagRewriteReply struct { 1721 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1722 } 1723 1724 func (m *L2InterfacePbbTagRewriteReply) Reset() { *m = L2InterfacePbbTagRewriteReply{} } 1725 func (*L2InterfacePbbTagRewriteReply) GetMessageName() string { 1726 return "l2_interface_pbb_tag_rewrite_reply" 1727 } 1728 func (*L2InterfacePbbTagRewriteReply) GetCrcString() string { return "e8d4e804" } 1729 func (*L2InterfacePbbTagRewriteReply) GetMessageType() api.MessageType { 1730 return api.ReplyMessage 1731 } 1732 1733 func (m *L2InterfacePbbTagRewriteReply) Size() (size int) { 1734 if m == nil { 1735 return 0 1736 } 1737 size += 4 // m.Retval 1738 return size 1739 } 1740 func (m *L2InterfacePbbTagRewriteReply) Marshal(b []byte) ([]byte, error) { 1741 if b == nil { 1742 b = make([]byte, m.Size()) 1743 } 1744 buf := codec.NewBuffer(b) 1745 buf.EncodeInt32(m.Retval) 1746 return buf.Bytes(), nil 1747 } 1748 func (m *L2InterfacePbbTagRewriteReply) Unmarshal(b []byte) error { 1749 buf := codec.NewBuffer(b) 1750 m.Retval = buf.DecodeInt32() 1751 return nil 1752 } 1753 1754 // L2 interface vlan tag rewrite configure request 1755 // - sw_if_index - interface the operation is applied to 1756 // - vtr_op - Choose from l2_vtr_op_t enum values 1757 // - push_dot1q - first pushed flag dot1q id set, else dot1ad 1758 // - tag1 - Needed for any push or translate vtr op 1759 // - tag2 - Needed for any push 2 or translate x-2 vtr ops 1760 // 1761 // L2InterfaceVlanTagRewrite defines message 'l2_interface_vlan_tag_rewrite'. 1762 type L2InterfaceVlanTagRewrite struct { 1763 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 1764 VtrOp uint32 `binapi:"u32,name=vtr_op" json:"vtr_op,omitempty"` 1765 PushDot1q uint32 `binapi:"u32,name=push_dot1q" json:"push_dot1q,omitempty"` 1766 Tag1 uint32 `binapi:"u32,name=tag1" json:"tag1,omitempty"` 1767 Tag2 uint32 `binapi:"u32,name=tag2" json:"tag2,omitempty"` 1768 } 1769 1770 func (m *L2InterfaceVlanTagRewrite) Reset() { *m = L2InterfaceVlanTagRewrite{} } 1771 func (*L2InterfaceVlanTagRewrite) GetMessageName() string { return "l2_interface_vlan_tag_rewrite" } 1772 func (*L2InterfaceVlanTagRewrite) GetCrcString() string { return "62cc0bbc" } 1773 func (*L2InterfaceVlanTagRewrite) GetMessageType() api.MessageType { 1774 return api.RequestMessage 1775 } 1776 1777 func (m *L2InterfaceVlanTagRewrite) Size() (size int) { 1778 if m == nil { 1779 return 0 1780 } 1781 size += 4 // m.SwIfIndex 1782 size += 4 // m.VtrOp 1783 size += 4 // m.PushDot1q 1784 size += 4 // m.Tag1 1785 size += 4 // m.Tag2 1786 return size 1787 } 1788 func (m *L2InterfaceVlanTagRewrite) Marshal(b []byte) ([]byte, error) { 1789 if b == nil { 1790 b = make([]byte, m.Size()) 1791 } 1792 buf := codec.NewBuffer(b) 1793 buf.EncodeUint32(uint32(m.SwIfIndex)) 1794 buf.EncodeUint32(m.VtrOp) 1795 buf.EncodeUint32(m.PushDot1q) 1796 buf.EncodeUint32(m.Tag1) 1797 buf.EncodeUint32(m.Tag2) 1798 return buf.Bytes(), nil 1799 } 1800 func (m *L2InterfaceVlanTagRewrite) Unmarshal(b []byte) error { 1801 buf := codec.NewBuffer(b) 1802 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1803 m.VtrOp = buf.DecodeUint32() 1804 m.PushDot1q = buf.DecodeUint32() 1805 m.Tag1 = buf.DecodeUint32() 1806 m.Tag2 = buf.DecodeUint32() 1807 return nil 1808 } 1809 1810 // L2InterfaceVlanTagRewriteReply defines message 'l2_interface_vlan_tag_rewrite_reply'. 1811 type L2InterfaceVlanTagRewriteReply struct { 1812 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1813 } 1814 1815 func (m *L2InterfaceVlanTagRewriteReply) Reset() { *m = L2InterfaceVlanTagRewriteReply{} } 1816 func (*L2InterfaceVlanTagRewriteReply) GetMessageName() string { 1817 return "l2_interface_vlan_tag_rewrite_reply" 1818 } 1819 func (*L2InterfaceVlanTagRewriteReply) GetCrcString() string { return "e8d4e804" } 1820 func (*L2InterfaceVlanTagRewriteReply) GetMessageType() api.MessageType { 1821 return api.ReplyMessage 1822 } 1823 1824 func (m *L2InterfaceVlanTagRewriteReply) Size() (size int) { 1825 if m == nil { 1826 return 0 1827 } 1828 size += 4 // m.Retval 1829 return size 1830 } 1831 func (m *L2InterfaceVlanTagRewriteReply) Marshal(b []byte) ([]byte, error) { 1832 if b == nil { 1833 b = make([]byte, m.Size()) 1834 } 1835 buf := codec.NewBuffer(b) 1836 buf.EncodeInt32(m.Retval) 1837 return buf.Bytes(), nil 1838 } 1839 func (m *L2InterfaceVlanTagRewriteReply) Unmarshal(b []byte) error { 1840 buf := codec.NewBuffer(b) 1841 m.Retval = buf.DecodeInt32() 1842 return nil 1843 } 1844 1845 // L2 MAC event for a list of learned or aged MACs 1846 // - pid - client pid registered to receive notification 1847 // - n_macs - number of learned/aged MAC entries 1848 // - mac - array of learned/aged MAC entries 1849 // 1850 // L2MacsEvent defines message 'l2_macs_event'. 1851 type L2MacsEvent struct { 1852 PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"` 1853 NMacs uint32 `binapi:"u32,name=n_macs" json:"-"` 1854 Mac []MacEntry `binapi:"mac_entry[n_macs],name=mac" json:"mac,omitempty"` 1855 } 1856 1857 func (m *L2MacsEvent) Reset() { *m = L2MacsEvent{} } 1858 func (*L2MacsEvent) GetMessageName() string { return "l2_macs_event" } 1859 func (*L2MacsEvent) GetCrcString() string { return "44b8fd64" } 1860 func (*L2MacsEvent) GetMessageType() api.MessageType { 1861 return api.EventMessage 1862 } 1863 1864 func (m *L2MacsEvent) Size() (size int) { 1865 if m == nil { 1866 return 0 1867 } 1868 size += 4 // m.PID 1869 size += 4 // m.NMacs 1870 for j1 := 0; j1 < len(m.Mac); j1++ { 1871 var s1 MacEntry 1872 _ = s1 1873 if j1 < len(m.Mac) { 1874 s1 = m.Mac[j1] 1875 } 1876 size += 4 // s1.SwIfIndex 1877 size += 1 * 6 // s1.MacAddr 1878 size += 4 // s1.Action 1879 size += 1 // s1.Flags 1880 } 1881 return size 1882 } 1883 func (m *L2MacsEvent) Marshal(b []byte) ([]byte, error) { 1884 if b == nil { 1885 b = make([]byte, m.Size()) 1886 } 1887 buf := codec.NewBuffer(b) 1888 buf.EncodeUint32(m.PID) 1889 buf.EncodeUint32(uint32(len(m.Mac))) 1890 for j0 := 0; j0 < len(m.Mac); j0++ { 1891 var v0 MacEntry // Mac 1892 if j0 < len(m.Mac) { 1893 v0 = m.Mac[j0] 1894 } 1895 buf.EncodeUint32(uint32(v0.SwIfIndex)) 1896 buf.EncodeBytes(v0.MacAddr[:], 6) 1897 buf.EncodeUint32(uint32(v0.Action)) 1898 buf.EncodeUint8(v0.Flags) 1899 } 1900 return buf.Bytes(), nil 1901 } 1902 func (m *L2MacsEvent) Unmarshal(b []byte) error { 1903 buf := codec.NewBuffer(b) 1904 m.PID = buf.DecodeUint32() 1905 m.NMacs = buf.DecodeUint32() 1906 m.Mac = make([]MacEntry, m.NMacs) 1907 for j0 := 0; j0 < len(m.Mac); j0++ { 1908 m.Mac[j0].SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1909 copy(m.Mac[j0].MacAddr[:], buf.DecodeBytes(6)) 1910 m.Mac[j0].Action = MacEventAction(buf.DecodeUint32()) 1911 m.Mac[j0].Flags = buf.DecodeUint8() 1912 } 1913 return nil 1914 } 1915 1916 // L2 interface patch add / del request 1917 // - rx_sw_if_index - receive side interface 1918 // - tx_sw_if_index - transmit side interface 1919 // - is_add - if non-zero set up the interface patch, else remove it 1920 // 1921 // L2PatchAddDel defines message 'l2_patch_add_del'. 1922 type L2PatchAddDel struct { 1923 RxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"` 1924 TxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=tx_sw_if_index" json:"tx_sw_if_index,omitempty"` 1925 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` 1926 } 1927 1928 func (m *L2PatchAddDel) Reset() { *m = L2PatchAddDel{} } 1929 func (*L2PatchAddDel) GetMessageName() string { return "l2_patch_add_del" } 1930 func (*L2PatchAddDel) GetCrcString() string { return "a1f6a6f3" } 1931 func (*L2PatchAddDel) GetMessageType() api.MessageType { 1932 return api.RequestMessage 1933 } 1934 1935 func (m *L2PatchAddDel) Size() (size int) { 1936 if m == nil { 1937 return 0 1938 } 1939 size += 4 // m.RxSwIfIndex 1940 size += 4 // m.TxSwIfIndex 1941 size += 1 // m.IsAdd 1942 return size 1943 } 1944 func (m *L2PatchAddDel) Marshal(b []byte) ([]byte, error) { 1945 if b == nil { 1946 b = make([]byte, m.Size()) 1947 } 1948 buf := codec.NewBuffer(b) 1949 buf.EncodeUint32(uint32(m.RxSwIfIndex)) 1950 buf.EncodeUint32(uint32(m.TxSwIfIndex)) 1951 buf.EncodeBool(m.IsAdd) 1952 return buf.Bytes(), nil 1953 } 1954 func (m *L2PatchAddDel) Unmarshal(b []byte) error { 1955 buf := codec.NewBuffer(b) 1956 m.RxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1957 m.TxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1958 m.IsAdd = buf.DecodeBool() 1959 return nil 1960 } 1961 1962 // L2PatchAddDelReply defines message 'l2_patch_add_del_reply'. 1963 type L2PatchAddDelReply struct { 1964 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1965 } 1966 1967 func (m *L2PatchAddDelReply) Reset() { *m = L2PatchAddDelReply{} } 1968 func (*L2PatchAddDelReply) GetMessageName() string { return "l2_patch_add_del_reply" } 1969 func (*L2PatchAddDelReply) GetCrcString() string { return "e8d4e804" } 1970 func (*L2PatchAddDelReply) GetMessageType() api.MessageType { 1971 return api.ReplyMessage 1972 } 1973 1974 func (m *L2PatchAddDelReply) Size() (size int) { 1975 if m == nil { 1976 return 0 1977 } 1978 size += 4 // m.Retval 1979 return size 1980 } 1981 func (m *L2PatchAddDelReply) Marshal(b []byte) ([]byte, error) { 1982 if b == nil { 1983 b = make([]byte, m.Size()) 1984 } 1985 buf := codec.NewBuffer(b) 1986 buf.EncodeInt32(m.Retval) 1987 return buf.Bytes(), nil 1988 } 1989 func (m *L2PatchAddDelReply) Unmarshal(b []byte) error { 1990 buf := codec.NewBuffer(b) 1991 m.Retval = buf.DecodeInt32() 1992 return nil 1993 } 1994 1995 // Reply to l2_xconnect_dump 1996 // - rx_sw_if_index - Receive interface index 1997 // - tx_sw_if_index - Transmit interface index 1998 // 1999 // L2XconnectDetails defines message 'l2_xconnect_details'. 2000 type L2XconnectDetails struct { 2001 RxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"` 2002 TxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=tx_sw_if_index" json:"tx_sw_if_index,omitempty"` 2003 } 2004 2005 func (m *L2XconnectDetails) Reset() { *m = L2XconnectDetails{} } 2006 func (*L2XconnectDetails) GetMessageName() string { return "l2_xconnect_details" } 2007 func (*L2XconnectDetails) GetCrcString() string { return "472b6b67" } 2008 func (*L2XconnectDetails) GetMessageType() api.MessageType { 2009 return api.ReplyMessage 2010 } 2011 2012 func (m *L2XconnectDetails) Size() (size int) { 2013 if m == nil { 2014 return 0 2015 } 2016 size += 4 // m.RxSwIfIndex 2017 size += 4 // m.TxSwIfIndex 2018 return size 2019 } 2020 func (m *L2XconnectDetails) Marshal(b []byte) ([]byte, error) { 2021 if b == nil { 2022 b = make([]byte, m.Size()) 2023 } 2024 buf := codec.NewBuffer(b) 2025 buf.EncodeUint32(uint32(m.RxSwIfIndex)) 2026 buf.EncodeUint32(uint32(m.TxSwIfIndex)) 2027 return buf.Bytes(), nil 2028 } 2029 func (m *L2XconnectDetails) Unmarshal(b []byte) error { 2030 buf := codec.NewBuffer(b) 2031 m.RxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 2032 m.TxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 2033 return nil 2034 } 2035 2036 // Dump L2 XConnects 2037 // L2XconnectDump defines message 'l2_xconnect_dump'. 2038 type L2XconnectDump struct{} 2039 2040 func (m *L2XconnectDump) Reset() { *m = L2XconnectDump{} } 2041 func (*L2XconnectDump) GetMessageName() string { return "l2_xconnect_dump" } 2042 func (*L2XconnectDump) GetCrcString() string { return "51077d14" } 2043 func (*L2XconnectDump) GetMessageType() api.MessageType { 2044 return api.RequestMessage 2045 } 2046 2047 func (m *L2XconnectDump) Size() (size int) { 2048 if m == nil { 2049 return 0 2050 } 2051 return size 2052 } 2053 func (m *L2XconnectDump) Marshal(b []byte) ([]byte, error) { 2054 if b == nil { 2055 b = make([]byte, m.Size()) 2056 } 2057 buf := codec.NewBuffer(b) 2058 return buf.Bytes(), nil 2059 } 2060 func (m *L2XconnectDump) Unmarshal(b []byte) error { 2061 return nil 2062 } 2063 2064 // L2 FIB add entry request 2065 // - mac - the entry's mac address 2066 // - bd_id - the entry's bridge domain id 2067 // - sw_if_index - the interface 2068 // - is_add - If non zero add the entry, else delete it 2069 // - static_mac - 2070 // - filter_mac - 2071 // - bvi_mac - 2072 // 2073 // L2fibAddDel defines message 'l2fib_add_del'. 2074 type L2fibAddDel struct { 2075 Mac ethernet_types.MacAddress `binapi:"mac_address,name=mac" json:"mac,omitempty"` 2076 BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` 2077 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 2078 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` 2079 StaticMac bool `binapi:"bool,name=static_mac" json:"static_mac,omitempty"` 2080 FilterMac bool `binapi:"bool,name=filter_mac" json:"filter_mac,omitempty"` 2081 BviMac bool `binapi:"bool,name=bvi_mac" json:"bvi_mac,omitempty"` 2082 } 2083 2084 func (m *L2fibAddDel) Reset() { *m = L2fibAddDel{} } 2085 func (*L2fibAddDel) GetMessageName() string { return "l2fib_add_del" } 2086 func (*L2fibAddDel) GetCrcString() string { return "eddda487" } 2087 func (*L2fibAddDel) GetMessageType() api.MessageType { 2088 return api.RequestMessage 2089 } 2090 2091 func (m *L2fibAddDel) Size() (size int) { 2092 if m == nil { 2093 return 0 2094 } 2095 size += 1 * 6 // m.Mac 2096 size += 4 // m.BdID 2097 size += 4 // m.SwIfIndex 2098 size += 1 // m.IsAdd 2099 size += 1 // m.StaticMac 2100 size += 1 // m.FilterMac 2101 size += 1 // m.BviMac 2102 return size 2103 } 2104 func (m *L2fibAddDel) Marshal(b []byte) ([]byte, error) { 2105 if b == nil { 2106 b = make([]byte, m.Size()) 2107 } 2108 buf := codec.NewBuffer(b) 2109 buf.EncodeBytes(m.Mac[:], 6) 2110 buf.EncodeUint32(m.BdID) 2111 buf.EncodeUint32(uint32(m.SwIfIndex)) 2112 buf.EncodeBool(m.IsAdd) 2113 buf.EncodeBool(m.StaticMac) 2114 buf.EncodeBool(m.FilterMac) 2115 buf.EncodeBool(m.BviMac) 2116 return buf.Bytes(), nil 2117 } 2118 func (m *L2fibAddDel) Unmarshal(b []byte) error { 2119 buf := codec.NewBuffer(b) 2120 copy(m.Mac[:], buf.DecodeBytes(6)) 2121 m.BdID = buf.DecodeUint32() 2122 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 2123 m.IsAdd = buf.DecodeBool() 2124 m.StaticMac = buf.DecodeBool() 2125 m.FilterMac = buf.DecodeBool() 2126 m.BviMac = buf.DecodeBool() 2127 return nil 2128 } 2129 2130 // L2fibAddDelReply defines message 'l2fib_add_del_reply'. 2131 type L2fibAddDelReply struct { 2132 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 2133 } 2134 2135 func (m *L2fibAddDelReply) Reset() { *m = L2fibAddDelReply{} } 2136 func (*L2fibAddDelReply) GetMessageName() string { return "l2fib_add_del_reply" } 2137 func (*L2fibAddDelReply) GetCrcString() string { return "e8d4e804" } 2138 func (*L2fibAddDelReply) GetMessageType() api.MessageType { 2139 return api.ReplyMessage 2140 } 2141 2142 func (m *L2fibAddDelReply) Size() (size int) { 2143 if m == nil { 2144 return 0 2145 } 2146 size += 4 // m.Retval 2147 return size 2148 } 2149 func (m *L2fibAddDelReply) Marshal(b []byte) ([]byte, error) { 2150 if b == nil { 2151 b = make([]byte, m.Size()) 2152 } 2153 buf := codec.NewBuffer(b) 2154 buf.EncodeInt32(m.Retval) 2155 return buf.Bytes(), nil 2156 } 2157 func (m *L2fibAddDelReply) Unmarshal(b []byte) error { 2158 buf := codec.NewBuffer(b) 2159 m.Retval = buf.DecodeInt32() 2160 return nil 2161 } 2162 2163 // L2 FIB flush all entries 2164 // L2fibFlushAll defines message 'l2fib_flush_all'. 2165 type L2fibFlushAll struct{} 2166 2167 func (m *L2fibFlushAll) Reset() { *m = L2fibFlushAll{} } 2168 func (*L2fibFlushAll) GetMessageName() string { return "l2fib_flush_all" } 2169 func (*L2fibFlushAll) GetCrcString() string { return "51077d14" } 2170 func (*L2fibFlushAll) GetMessageType() api.MessageType { 2171 return api.RequestMessage 2172 } 2173 2174 func (m *L2fibFlushAll) Size() (size int) { 2175 if m == nil { 2176 return 0 2177 } 2178 return size 2179 } 2180 func (m *L2fibFlushAll) Marshal(b []byte) ([]byte, error) { 2181 if b == nil { 2182 b = make([]byte, m.Size()) 2183 } 2184 buf := codec.NewBuffer(b) 2185 return buf.Bytes(), nil 2186 } 2187 func (m *L2fibFlushAll) Unmarshal(b []byte) error { 2188 return nil 2189 } 2190 2191 // L2fibFlushAllReply defines message 'l2fib_flush_all_reply'. 2192 type L2fibFlushAllReply struct { 2193 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 2194 } 2195 2196 func (m *L2fibFlushAllReply) Reset() { *m = L2fibFlushAllReply{} } 2197 func (*L2fibFlushAllReply) GetMessageName() string { return "l2fib_flush_all_reply" } 2198 func (*L2fibFlushAllReply) GetCrcString() string { return "e8d4e804" } 2199 func (*L2fibFlushAllReply) GetMessageType() api.MessageType { 2200 return api.ReplyMessage 2201 } 2202 2203 func (m *L2fibFlushAllReply) Size() (size int) { 2204 if m == nil { 2205 return 0 2206 } 2207 size += 4 // m.Retval 2208 return size 2209 } 2210 func (m *L2fibFlushAllReply) Marshal(b []byte) ([]byte, error) { 2211 if b == nil { 2212 b = make([]byte, m.Size()) 2213 } 2214 buf := codec.NewBuffer(b) 2215 buf.EncodeInt32(m.Retval) 2216 return buf.Bytes(), nil 2217 } 2218 func (m *L2fibFlushAllReply) Unmarshal(b []byte) error { 2219 buf := codec.NewBuffer(b) 2220 m.Retval = buf.DecodeInt32() 2221 return nil 2222 } 2223 2224 // L2 FIB flush bridge domain entries 2225 // - bd_id - the entry's bridge domain id 2226 // 2227 // L2fibFlushBd defines message 'l2fib_flush_bd'. 2228 type L2fibFlushBd struct { 2229 BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` 2230 } 2231 2232 func (m *L2fibFlushBd) Reset() { *m = L2fibFlushBd{} } 2233 func (*L2fibFlushBd) GetMessageName() string { return "l2fib_flush_bd" } 2234 func (*L2fibFlushBd) GetCrcString() string { return "c25fdce6" } 2235 func (*L2fibFlushBd) GetMessageType() api.MessageType { 2236 return api.RequestMessage 2237 } 2238 2239 func (m *L2fibFlushBd) Size() (size int) { 2240 if m == nil { 2241 return 0 2242 } 2243 size += 4 // m.BdID 2244 return size 2245 } 2246 func (m *L2fibFlushBd) Marshal(b []byte) ([]byte, error) { 2247 if b == nil { 2248 b = make([]byte, m.Size()) 2249 } 2250 buf := codec.NewBuffer(b) 2251 buf.EncodeUint32(m.BdID) 2252 return buf.Bytes(), nil 2253 } 2254 func (m *L2fibFlushBd) Unmarshal(b []byte) error { 2255 buf := codec.NewBuffer(b) 2256 m.BdID = buf.DecodeUint32() 2257 return nil 2258 } 2259 2260 // L2fibFlushBdReply defines message 'l2fib_flush_bd_reply'. 2261 type L2fibFlushBdReply struct { 2262 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 2263 } 2264 2265 func (m *L2fibFlushBdReply) Reset() { *m = L2fibFlushBdReply{} } 2266 func (*L2fibFlushBdReply) GetMessageName() string { return "l2fib_flush_bd_reply" } 2267 func (*L2fibFlushBdReply) GetCrcString() string { return "e8d4e804" } 2268 func (*L2fibFlushBdReply) GetMessageType() api.MessageType { 2269 return api.ReplyMessage 2270 } 2271 2272 func (m *L2fibFlushBdReply) Size() (size int) { 2273 if m == nil { 2274 return 0 2275 } 2276 size += 4 // m.Retval 2277 return size 2278 } 2279 func (m *L2fibFlushBdReply) Marshal(b []byte) ([]byte, error) { 2280 if b == nil { 2281 b = make([]byte, m.Size()) 2282 } 2283 buf := codec.NewBuffer(b) 2284 buf.EncodeInt32(m.Retval) 2285 return buf.Bytes(), nil 2286 } 2287 func (m *L2fibFlushBdReply) Unmarshal(b []byte) error { 2288 buf := codec.NewBuffer(b) 2289 m.Retval = buf.DecodeInt32() 2290 return nil 2291 } 2292 2293 // L2 FIB flush interface entries 2294 // - bd_id - the entry's bridge domain id 2295 // 2296 // L2fibFlushInt defines message 'l2fib_flush_int'. 2297 type L2fibFlushInt struct { 2298 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 2299 } 2300 2301 func (m *L2fibFlushInt) Reset() { *m = L2fibFlushInt{} } 2302 func (*L2fibFlushInt) GetMessageName() string { return "l2fib_flush_int" } 2303 func (*L2fibFlushInt) GetCrcString() string { return "f9e6675e" } 2304 func (*L2fibFlushInt) GetMessageType() api.MessageType { 2305 return api.RequestMessage 2306 } 2307 2308 func (m *L2fibFlushInt) Size() (size int) { 2309 if m == nil { 2310 return 0 2311 } 2312 size += 4 // m.SwIfIndex 2313 return size 2314 } 2315 func (m *L2fibFlushInt) Marshal(b []byte) ([]byte, error) { 2316 if b == nil { 2317 b = make([]byte, m.Size()) 2318 } 2319 buf := codec.NewBuffer(b) 2320 buf.EncodeUint32(uint32(m.SwIfIndex)) 2321 return buf.Bytes(), nil 2322 } 2323 func (m *L2fibFlushInt) Unmarshal(b []byte) error { 2324 buf := codec.NewBuffer(b) 2325 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 2326 return nil 2327 } 2328 2329 // L2fibFlushIntReply defines message 'l2fib_flush_int_reply'. 2330 type L2fibFlushIntReply struct { 2331 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 2332 } 2333 2334 func (m *L2fibFlushIntReply) Reset() { *m = L2fibFlushIntReply{} } 2335 func (*L2fibFlushIntReply) GetMessageName() string { return "l2fib_flush_int_reply" } 2336 func (*L2fibFlushIntReply) GetCrcString() string { return "e8d4e804" } 2337 func (*L2fibFlushIntReply) GetMessageType() api.MessageType { 2338 return api.ReplyMessage 2339 } 2340 2341 func (m *L2fibFlushIntReply) Size() (size int) { 2342 if m == nil { 2343 return 0 2344 } 2345 size += 4 // m.Retval 2346 return size 2347 } 2348 func (m *L2fibFlushIntReply) Marshal(b []byte) ([]byte, error) { 2349 if b == nil { 2350 b = make([]byte, m.Size()) 2351 } 2352 buf := codec.NewBuffer(b) 2353 buf.EncodeInt32(m.Retval) 2354 return buf.Bytes(), nil 2355 } 2356 func (m *L2fibFlushIntReply) Unmarshal(b []byte) error { 2357 buf := codec.NewBuffer(b) 2358 m.Retval = buf.DecodeInt32() 2359 return nil 2360 } 2361 2362 // set l2 table scan delay 2363 // - scan_delay - event scan delay in 10 msec unit 2364 // 2365 // L2fibSetScanDelay defines message 'l2fib_set_scan_delay'. 2366 type L2fibSetScanDelay struct { 2367 ScanDelay uint16 `binapi:"u16,name=scan_delay,default=10" json:"scan_delay,omitempty"` 2368 } 2369 2370 func (m *L2fibSetScanDelay) Reset() { *m = L2fibSetScanDelay{} } 2371 func (*L2fibSetScanDelay) GetMessageName() string { return "l2fib_set_scan_delay" } 2372 func (*L2fibSetScanDelay) GetCrcString() string { return "a3b968a4" } 2373 func (*L2fibSetScanDelay) GetMessageType() api.MessageType { 2374 return api.RequestMessage 2375 } 2376 2377 func (m *L2fibSetScanDelay) Size() (size int) { 2378 if m == nil { 2379 return 0 2380 } 2381 size += 2 // m.ScanDelay 2382 return size 2383 } 2384 func (m *L2fibSetScanDelay) Marshal(b []byte) ([]byte, error) { 2385 if b == nil { 2386 b = make([]byte, m.Size()) 2387 } 2388 buf := codec.NewBuffer(b) 2389 buf.EncodeUint16(m.ScanDelay) 2390 return buf.Bytes(), nil 2391 } 2392 func (m *L2fibSetScanDelay) Unmarshal(b []byte) error { 2393 buf := codec.NewBuffer(b) 2394 m.ScanDelay = buf.DecodeUint16() 2395 return nil 2396 } 2397 2398 // L2fibSetScanDelayReply defines message 'l2fib_set_scan_delay_reply'. 2399 type L2fibSetScanDelayReply struct { 2400 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 2401 } 2402 2403 func (m *L2fibSetScanDelayReply) Reset() { *m = L2fibSetScanDelayReply{} } 2404 func (*L2fibSetScanDelayReply) GetMessageName() string { return "l2fib_set_scan_delay_reply" } 2405 func (*L2fibSetScanDelayReply) GetCrcString() string { return "e8d4e804" } 2406 func (*L2fibSetScanDelayReply) GetMessageType() api.MessageType { 2407 return api.ReplyMessage 2408 } 2409 2410 func (m *L2fibSetScanDelayReply) Size() (size int) { 2411 if m == nil { 2412 return 0 2413 } 2414 size += 4 // m.Retval 2415 return size 2416 } 2417 func (m *L2fibSetScanDelayReply) Marshal(b []byte) ([]byte, error) { 2418 if b == nil { 2419 b = make([]byte, m.Size()) 2420 } 2421 buf := codec.NewBuffer(b) 2422 buf.EncodeInt32(m.Retval) 2423 return buf.Bytes(), nil 2424 } 2425 func (m *L2fibSetScanDelayReply) Unmarshal(b []byte) error { 2426 buf := codec.NewBuffer(b) 2427 m.Retval = buf.DecodeInt32() 2428 return nil 2429 } 2430 2431 // Interface bridge mode request 2432 // - rx_sw_if_index - the interface 2433 // - bd_id - bridge domain id 2434 // - port_type - port_mode, see #l2_port_type 2435 // - shg - Split horizon group, for bridge mode only 2436 // - enable - Enable beige mode if not 0, else set to L3 mode 2437 // 2438 // SwInterfaceSetL2Bridge defines message 'sw_interface_set_l2_bridge'. 2439 type SwInterfaceSetL2Bridge struct { 2440 RxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"` 2441 BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` 2442 PortType L2PortType `binapi:"l2_port_type,name=port_type" json:"port_type,omitempty"` 2443 Shg uint8 `binapi:"u8,name=shg" json:"shg,omitempty"` 2444 Enable bool `binapi:"bool,name=enable,default=true" json:"enable,omitempty"` 2445 } 2446 2447 func (m *SwInterfaceSetL2Bridge) Reset() { *m = SwInterfaceSetL2Bridge{} } 2448 func (*SwInterfaceSetL2Bridge) GetMessageName() string { return "sw_interface_set_l2_bridge" } 2449 func (*SwInterfaceSetL2Bridge) GetCrcString() string { return "d0678b13" } 2450 func (*SwInterfaceSetL2Bridge) GetMessageType() api.MessageType { 2451 return api.RequestMessage 2452 } 2453 2454 func (m *SwInterfaceSetL2Bridge) Size() (size int) { 2455 if m == nil { 2456 return 0 2457 } 2458 size += 4 // m.RxSwIfIndex 2459 size += 4 // m.BdID 2460 size += 4 // m.PortType 2461 size += 1 // m.Shg 2462 size += 1 // m.Enable 2463 return size 2464 } 2465 func (m *SwInterfaceSetL2Bridge) Marshal(b []byte) ([]byte, error) { 2466 if b == nil { 2467 b = make([]byte, m.Size()) 2468 } 2469 buf := codec.NewBuffer(b) 2470 buf.EncodeUint32(uint32(m.RxSwIfIndex)) 2471 buf.EncodeUint32(m.BdID) 2472 buf.EncodeUint32(uint32(m.PortType)) 2473 buf.EncodeUint8(m.Shg) 2474 buf.EncodeBool(m.Enable) 2475 return buf.Bytes(), nil 2476 } 2477 func (m *SwInterfaceSetL2Bridge) Unmarshal(b []byte) error { 2478 buf := codec.NewBuffer(b) 2479 m.RxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 2480 m.BdID = buf.DecodeUint32() 2481 m.PortType = L2PortType(buf.DecodeUint32()) 2482 m.Shg = buf.DecodeUint8() 2483 m.Enable = buf.DecodeBool() 2484 return nil 2485 } 2486 2487 // SwInterfaceSetL2BridgeReply defines message 'sw_interface_set_l2_bridge_reply'. 2488 type SwInterfaceSetL2BridgeReply struct { 2489 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 2490 } 2491 2492 func (m *SwInterfaceSetL2BridgeReply) Reset() { *m = SwInterfaceSetL2BridgeReply{} } 2493 func (*SwInterfaceSetL2BridgeReply) GetMessageName() string { 2494 return "sw_interface_set_l2_bridge_reply" 2495 } 2496 func (*SwInterfaceSetL2BridgeReply) GetCrcString() string { return "e8d4e804" } 2497 func (*SwInterfaceSetL2BridgeReply) GetMessageType() api.MessageType { 2498 return api.ReplyMessage 2499 } 2500 2501 func (m *SwInterfaceSetL2BridgeReply) Size() (size int) { 2502 if m == nil { 2503 return 0 2504 } 2505 size += 4 // m.Retval 2506 return size 2507 } 2508 func (m *SwInterfaceSetL2BridgeReply) Marshal(b []byte) ([]byte, error) { 2509 if b == nil { 2510 b = make([]byte, m.Size()) 2511 } 2512 buf := codec.NewBuffer(b) 2513 buf.EncodeInt32(m.Retval) 2514 return buf.Bytes(), nil 2515 } 2516 func (m *SwInterfaceSetL2BridgeReply) Unmarshal(b []byte) error { 2517 buf := codec.NewBuffer(b) 2518 m.Retval = buf.DecodeInt32() 2519 return nil 2520 } 2521 2522 // Set L2 XConnect between two interfaces request 2523 // - rx_sw_if_index - Receive interface index 2524 // - tx_sw_if_index - Transmit interface index 2525 // - enable - enable xconnect if not 0, else set to L3 mode 2526 // 2527 // SwInterfaceSetL2Xconnect defines message 'sw_interface_set_l2_xconnect'. 2528 type SwInterfaceSetL2Xconnect struct { 2529 RxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"` 2530 TxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=tx_sw_if_index" json:"tx_sw_if_index,omitempty"` 2531 Enable bool `binapi:"bool,name=enable,default=true" json:"enable,omitempty"` 2532 } 2533 2534 func (m *SwInterfaceSetL2Xconnect) Reset() { *m = SwInterfaceSetL2Xconnect{} } 2535 func (*SwInterfaceSetL2Xconnect) GetMessageName() string { return "sw_interface_set_l2_xconnect" } 2536 func (*SwInterfaceSetL2Xconnect) GetCrcString() string { return "4fa28a85" } 2537 func (*SwInterfaceSetL2Xconnect) GetMessageType() api.MessageType { 2538 return api.RequestMessage 2539 } 2540 2541 func (m *SwInterfaceSetL2Xconnect) Size() (size int) { 2542 if m == nil { 2543 return 0 2544 } 2545 size += 4 // m.RxSwIfIndex 2546 size += 4 // m.TxSwIfIndex 2547 size += 1 // m.Enable 2548 return size 2549 } 2550 func (m *SwInterfaceSetL2Xconnect) Marshal(b []byte) ([]byte, error) { 2551 if b == nil { 2552 b = make([]byte, m.Size()) 2553 } 2554 buf := codec.NewBuffer(b) 2555 buf.EncodeUint32(uint32(m.RxSwIfIndex)) 2556 buf.EncodeUint32(uint32(m.TxSwIfIndex)) 2557 buf.EncodeBool(m.Enable) 2558 return buf.Bytes(), nil 2559 } 2560 func (m *SwInterfaceSetL2Xconnect) Unmarshal(b []byte) error { 2561 buf := codec.NewBuffer(b) 2562 m.RxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 2563 m.TxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 2564 m.Enable = buf.DecodeBool() 2565 return nil 2566 } 2567 2568 // SwInterfaceSetL2XconnectReply defines message 'sw_interface_set_l2_xconnect_reply'. 2569 type SwInterfaceSetL2XconnectReply struct { 2570 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 2571 } 2572 2573 func (m *SwInterfaceSetL2XconnectReply) Reset() { *m = SwInterfaceSetL2XconnectReply{} } 2574 func (*SwInterfaceSetL2XconnectReply) GetMessageName() string { 2575 return "sw_interface_set_l2_xconnect_reply" 2576 } 2577 func (*SwInterfaceSetL2XconnectReply) GetCrcString() string { return "e8d4e804" } 2578 func (*SwInterfaceSetL2XconnectReply) GetMessageType() api.MessageType { 2579 return api.ReplyMessage 2580 } 2581 2582 func (m *SwInterfaceSetL2XconnectReply) Size() (size int) { 2583 if m == nil { 2584 return 0 2585 } 2586 size += 4 // m.Retval 2587 return size 2588 } 2589 func (m *SwInterfaceSetL2XconnectReply) Marshal(b []byte) ([]byte, error) { 2590 if b == nil { 2591 b = make([]byte, m.Size()) 2592 } 2593 buf := codec.NewBuffer(b) 2594 buf.EncodeInt32(m.Retval) 2595 return buf.Bytes(), nil 2596 } 2597 func (m *SwInterfaceSetL2XconnectReply) Unmarshal(b []byte) error { 2598 buf := codec.NewBuffer(b) 2599 m.Retval = buf.DecodeInt32() 2600 return nil 2601 } 2602 2603 // Interface set vpath request 2604 // - sw_if_index - interface used to reach neighbor 2605 // - enable - if non-zero enable, else disable 2606 // 2607 // SwInterfaceSetVpath defines message 'sw_interface_set_vpath'. 2608 type SwInterfaceSetVpath struct { 2609 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 2610 Enable bool `binapi:"bool,name=enable,default=4.294967295e+09" json:"enable,omitempty"` 2611 } 2612 2613 func (m *SwInterfaceSetVpath) Reset() { *m = SwInterfaceSetVpath{} } 2614 func (*SwInterfaceSetVpath) GetMessageName() string { return "sw_interface_set_vpath" } 2615 func (*SwInterfaceSetVpath) GetCrcString() string { return "ae6cfcfb" } 2616 func (*SwInterfaceSetVpath) GetMessageType() api.MessageType { 2617 return api.RequestMessage 2618 } 2619 2620 func (m *SwInterfaceSetVpath) Size() (size int) { 2621 if m == nil { 2622 return 0 2623 } 2624 size += 4 // m.SwIfIndex 2625 size += 1 // m.Enable 2626 return size 2627 } 2628 func (m *SwInterfaceSetVpath) Marshal(b []byte) ([]byte, error) { 2629 if b == nil { 2630 b = make([]byte, m.Size()) 2631 } 2632 buf := codec.NewBuffer(b) 2633 buf.EncodeUint32(uint32(m.SwIfIndex)) 2634 buf.EncodeBool(m.Enable) 2635 return buf.Bytes(), nil 2636 } 2637 func (m *SwInterfaceSetVpath) Unmarshal(b []byte) error { 2638 buf := codec.NewBuffer(b) 2639 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 2640 m.Enable = buf.DecodeBool() 2641 return nil 2642 } 2643 2644 // SwInterfaceSetVpathReply defines message 'sw_interface_set_vpath_reply'. 2645 type SwInterfaceSetVpathReply struct { 2646 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 2647 } 2648 2649 func (m *SwInterfaceSetVpathReply) Reset() { *m = SwInterfaceSetVpathReply{} } 2650 func (*SwInterfaceSetVpathReply) GetMessageName() string { return "sw_interface_set_vpath_reply" } 2651 func (*SwInterfaceSetVpathReply) GetCrcString() string { return "e8d4e804" } 2652 func (*SwInterfaceSetVpathReply) GetMessageType() api.MessageType { 2653 return api.ReplyMessage 2654 } 2655 2656 func (m *SwInterfaceSetVpathReply) Size() (size int) { 2657 if m == nil { 2658 return 0 2659 } 2660 size += 4 // m.Retval 2661 return size 2662 } 2663 func (m *SwInterfaceSetVpathReply) Marshal(b []byte) ([]byte, error) { 2664 if b == nil { 2665 b = make([]byte, m.Size()) 2666 } 2667 buf := codec.NewBuffer(b) 2668 buf.EncodeInt32(m.Retval) 2669 return buf.Bytes(), nil 2670 } 2671 func (m *SwInterfaceSetVpathReply) Unmarshal(b []byte) error { 2672 buf := codec.NewBuffer(b) 2673 m.Retval = buf.DecodeInt32() 2674 return nil 2675 } 2676 2677 // Register for IP4 ARP resolution event on receiving ARP reply or 2678 // 2679 // MAC/IP info from ARP requests in L2 BDs 2680 // - enable - 1 => register for events, 0 => cancel registration 2681 // - pid - sender's pid 2682 // 2683 // WantL2ArpTermEvents defines message 'want_l2_arp_term_events'. 2684 type WantL2ArpTermEvents struct { 2685 Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"` 2686 PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"` 2687 } 2688 2689 func (m *WantL2ArpTermEvents) Reset() { *m = WantL2ArpTermEvents{} } 2690 func (*WantL2ArpTermEvents) GetMessageName() string { return "want_l2_arp_term_events" } 2691 func (*WantL2ArpTermEvents) GetCrcString() string { return "3ec6d6c2" } 2692 func (*WantL2ArpTermEvents) GetMessageType() api.MessageType { 2693 return api.RequestMessage 2694 } 2695 2696 func (m *WantL2ArpTermEvents) Size() (size int) { 2697 if m == nil { 2698 return 0 2699 } 2700 size += 1 // m.Enable 2701 size += 4 // m.PID 2702 return size 2703 } 2704 func (m *WantL2ArpTermEvents) Marshal(b []byte) ([]byte, error) { 2705 if b == nil { 2706 b = make([]byte, m.Size()) 2707 } 2708 buf := codec.NewBuffer(b) 2709 buf.EncodeBool(m.Enable) 2710 buf.EncodeUint32(m.PID) 2711 return buf.Bytes(), nil 2712 } 2713 func (m *WantL2ArpTermEvents) Unmarshal(b []byte) error { 2714 buf := codec.NewBuffer(b) 2715 m.Enable = buf.DecodeBool() 2716 m.PID = buf.DecodeUint32() 2717 return nil 2718 } 2719 2720 // WantL2ArpTermEventsReply defines message 'want_l2_arp_term_events_reply'. 2721 type WantL2ArpTermEventsReply struct { 2722 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 2723 } 2724 2725 func (m *WantL2ArpTermEventsReply) Reset() { *m = WantL2ArpTermEventsReply{} } 2726 func (*WantL2ArpTermEventsReply) GetMessageName() string { return "want_l2_arp_term_events_reply" } 2727 func (*WantL2ArpTermEventsReply) GetCrcString() string { return "e8d4e804" } 2728 func (*WantL2ArpTermEventsReply) GetMessageType() api.MessageType { 2729 return api.ReplyMessage 2730 } 2731 2732 func (m *WantL2ArpTermEventsReply) Size() (size int) { 2733 if m == nil { 2734 return 0 2735 } 2736 size += 4 // m.Retval 2737 return size 2738 } 2739 func (m *WantL2ArpTermEventsReply) Marshal(b []byte) ([]byte, error) { 2740 if b == nil { 2741 b = make([]byte, m.Size()) 2742 } 2743 buf := codec.NewBuffer(b) 2744 buf.EncodeInt32(m.Retval) 2745 return buf.Bytes(), nil 2746 } 2747 func (m *WantL2ArpTermEventsReply) Unmarshal(b []byte) error { 2748 buf := codec.NewBuffer(b) 2749 m.Retval = buf.DecodeInt32() 2750 return nil 2751 } 2752 2753 // Register to receive L2 MAC events for learned and aged MAC 2754 // - learn_limit - MAC learn limit 2755 // - scan_delay - event scan delay in 10 msec unit 2756 // - max_macs_in_event - in units of 10 mac entries 2757 // - enable_disable - 1 => register for MAC events, 0 => cancel registration 2758 // - pid - sender's pid 2759 // 2760 // WantL2MacsEvents defines message 'want_l2_macs_events'. 2761 // Deprecated: the message will be removed in the future versions 2762 type WantL2MacsEvents struct { 2763 LearnLimit uint32 `binapi:"u32,name=learn_limit,default=1000" json:"learn_limit,omitempty"` 2764 ScanDelay uint8 `binapi:"u8,name=scan_delay,default=10" json:"scan_delay,omitempty"` 2765 MaxMacsInEvent uint8 `binapi:"u8,name=max_macs_in_event,default=10" json:"max_macs_in_event,omitempty"` 2766 EnableDisable bool `binapi:"bool,name=enable_disable,default=true" json:"enable_disable,omitempty"` 2767 PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"` 2768 } 2769 2770 func (m *WantL2MacsEvents) Reset() { *m = WantL2MacsEvents{} } 2771 func (*WantL2MacsEvents) GetMessageName() string { return "want_l2_macs_events" } 2772 func (*WantL2MacsEvents) GetCrcString() string { return "9aabdfde" } 2773 func (*WantL2MacsEvents) GetMessageType() api.MessageType { 2774 return api.RequestMessage 2775 } 2776 2777 func (m *WantL2MacsEvents) Size() (size int) { 2778 if m == nil { 2779 return 0 2780 } 2781 size += 4 // m.LearnLimit 2782 size += 1 // m.ScanDelay 2783 size += 1 // m.MaxMacsInEvent 2784 size += 1 // m.EnableDisable 2785 size += 4 // m.PID 2786 return size 2787 } 2788 func (m *WantL2MacsEvents) Marshal(b []byte) ([]byte, error) { 2789 if b == nil { 2790 b = make([]byte, m.Size()) 2791 } 2792 buf := codec.NewBuffer(b) 2793 buf.EncodeUint32(m.LearnLimit) 2794 buf.EncodeUint8(m.ScanDelay) 2795 buf.EncodeUint8(m.MaxMacsInEvent) 2796 buf.EncodeBool(m.EnableDisable) 2797 buf.EncodeUint32(m.PID) 2798 return buf.Bytes(), nil 2799 } 2800 func (m *WantL2MacsEvents) Unmarshal(b []byte) error { 2801 buf := codec.NewBuffer(b) 2802 m.LearnLimit = buf.DecodeUint32() 2803 m.ScanDelay = buf.DecodeUint8() 2804 m.MaxMacsInEvent = buf.DecodeUint8() 2805 m.EnableDisable = buf.DecodeBool() 2806 m.PID = buf.DecodeUint32() 2807 return nil 2808 } 2809 2810 // Register to receive L2 MAC events for learned and aged MAC 2811 // - max_macs_in_event - in units of 10 mac entries 2812 // - enable_disable - 1 => register for MAC events, 0 => cancel registration 2813 // - pid - sender's pid 2814 // 2815 // WantL2MacsEvents2 defines message 'want_l2_macs_events2'. 2816 type WantL2MacsEvents2 struct { 2817 MaxMacsInEvent uint8 `binapi:"u8,name=max_macs_in_event,default=10" json:"max_macs_in_event,omitempty"` 2818 EnableDisable bool `binapi:"bool,name=enable_disable,default=true" json:"enable_disable,omitempty"` 2819 PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"` 2820 } 2821 2822 func (m *WantL2MacsEvents2) Reset() { *m = WantL2MacsEvents2{} } 2823 func (*WantL2MacsEvents2) GetMessageName() string { return "want_l2_macs_events2" } 2824 func (*WantL2MacsEvents2) GetCrcString() string { return "cc1377b0" } 2825 func (*WantL2MacsEvents2) GetMessageType() api.MessageType { 2826 return api.RequestMessage 2827 } 2828 2829 func (m *WantL2MacsEvents2) Size() (size int) { 2830 if m == nil { 2831 return 0 2832 } 2833 size += 1 // m.MaxMacsInEvent 2834 size += 1 // m.EnableDisable 2835 size += 4 // m.PID 2836 return size 2837 } 2838 func (m *WantL2MacsEvents2) Marshal(b []byte) ([]byte, error) { 2839 if b == nil { 2840 b = make([]byte, m.Size()) 2841 } 2842 buf := codec.NewBuffer(b) 2843 buf.EncodeUint8(m.MaxMacsInEvent) 2844 buf.EncodeBool(m.EnableDisable) 2845 buf.EncodeUint32(m.PID) 2846 return buf.Bytes(), nil 2847 } 2848 func (m *WantL2MacsEvents2) Unmarshal(b []byte) error { 2849 buf := codec.NewBuffer(b) 2850 m.MaxMacsInEvent = buf.DecodeUint8() 2851 m.EnableDisable = buf.DecodeBool() 2852 m.PID = buf.DecodeUint32() 2853 return nil 2854 } 2855 2856 // WantL2MacsEvents2Reply defines message 'want_l2_macs_events2_reply'. 2857 type WantL2MacsEvents2Reply struct { 2858 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 2859 } 2860 2861 func (m *WantL2MacsEvents2Reply) Reset() { *m = WantL2MacsEvents2Reply{} } 2862 func (*WantL2MacsEvents2Reply) GetMessageName() string { return "want_l2_macs_events2_reply" } 2863 func (*WantL2MacsEvents2Reply) GetCrcString() string { return "e8d4e804" } 2864 func (*WantL2MacsEvents2Reply) GetMessageType() api.MessageType { 2865 return api.ReplyMessage 2866 } 2867 2868 func (m *WantL2MacsEvents2Reply) Size() (size int) { 2869 if m == nil { 2870 return 0 2871 } 2872 size += 4 // m.Retval 2873 return size 2874 } 2875 func (m *WantL2MacsEvents2Reply) Marshal(b []byte) ([]byte, error) { 2876 if b == nil { 2877 b = make([]byte, m.Size()) 2878 } 2879 buf := codec.NewBuffer(b) 2880 buf.EncodeInt32(m.Retval) 2881 return buf.Bytes(), nil 2882 } 2883 func (m *WantL2MacsEvents2Reply) Unmarshal(b []byte) error { 2884 buf := codec.NewBuffer(b) 2885 m.Retval = buf.DecodeInt32() 2886 return nil 2887 } 2888 2889 // WantL2MacsEventsReply defines message 'want_l2_macs_events_reply'. 2890 // Deprecated: the message will be removed in the future versions 2891 type WantL2MacsEventsReply struct { 2892 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 2893 } 2894 2895 func (m *WantL2MacsEventsReply) Reset() { *m = WantL2MacsEventsReply{} } 2896 func (*WantL2MacsEventsReply) GetMessageName() string { return "want_l2_macs_events_reply" } 2897 func (*WantL2MacsEventsReply) GetCrcString() string { return "e8d4e804" } 2898 func (*WantL2MacsEventsReply) GetMessageType() api.MessageType { 2899 return api.ReplyMessage 2900 } 2901 2902 func (m *WantL2MacsEventsReply) Size() (size int) { 2903 if m == nil { 2904 return 0 2905 } 2906 size += 4 // m.Retval 2907 return size 2908 } 2909 func (m *WantL2MacsEventsReply) Marshal(b []byte) ([]byte, error) { 2910 if b == nil { 2911 b = make([]byte, m.Size()) 2912 } 2913 buf := codec.NewBuffer(b) 2914 buf.EncodeInt32(m.Retval) 2915 return buf.Bytes(), nil 2916 } 2917 func (m *WantL2MacsEventsReply) Unmarshal(b []byte) error { 2918 buf := codec.NewBuffer(b) 2919 m.Retval = buf.DecodeInt32() 2920 return nil 2921 } 2922 2923 func init() { file_l2_binapi_init() } 2924 func file_l2_binapi_init() { 2925 api.RegisterMessage((*BdIPMacAddDel)(nil), "bd_ip_mac_add_del_0257c869") 2926 api.RegisterMessage((*BdIPMacAddDelReply)(nil), "bd_ip_mac_add_del_reply_e8d4e804") 2927 api.RegisterMessage((*BdIPMacDetails)(nil), "bd_ip_mac_details_545af86a") 2928 api.RegisterMessage((*BdIPMacDump)(nil), "bd_ip_mac_dump_c25fdce6") 2929 api.RegisterMessage((*BdIPMacFlush)(nil), "bd_ip_mac_flush_c25fdce6") 2930 api.RegisterMessage((*BdIPMacFlushReply)(nil), "bd_ip_mac_flush_reply_e8d4e804") 2931 api.RegisterMessage((*BridgeDomainAddDel)(nil), "bridge_domain_add_del_600b7170") 2932 api.RegisterMessage((*BridgeDomainAddDelReply)(nil), "bridge_domain_add_del_reply_e8d4e804") 2933 api.RegisterMessage((*BridgeDomainAddDelV2)(nil), "bridge_domain_add_del_v2_600b7170") 2934 api.RegisterMessage((*BridgeDomainAddDelV2Reply)(nil), "bridge_domain_add_del_v2_reply_fcb1e980") 2935 api.RegisterMessage((*BridgeDomainDetails)(nil), "bridge_domain_details_0fa506fd") 2936 api.RegisterMessage((*BridgeDomainDump)(nil), "bridge_domain_dump_74396a43") 2937 api.RegisterMessage((*BridgeDomainSetDefaultLearnLimit)(nil), "bridge_domain_set_default_learn_limit_f097ffce") 2938 api.RegisterMessage((*BridgeDomainSetDefaultLearnLimitReply)(nil), "bridge_domain_set_default_learn_limit_reply_e8d4e804") 2939 api.RegisterMessage((*BridgeDomainSetLearnLimit)(nil), "bridge_domain_set_learn_limit_89c52b5f") 2940 api.RegisterMessage((*BridgeDomainSetLearnLimitReply)(nil), "bridge_domain_set_learn_limit_reply_e8d4e804") 2941 api.RegisterMessage((*BridgeDomainSetMacAge)(nil), "bridge_domain_set_mac_age_b537ad7b") 2942 api.RegisterMessage((*BridgeDomainSetMacAgeReply)(nil), "bridge_domain_set_mac_age_reply_e8d4e804") 2943 api.RegisterMessage((*BridgeFlags)(nil), "bridge_flags_1b0c5fbd") 2944 api.RegisterMessage((*BridgeFlagsReply)(nil), "bridge_flags_reply_29b2a2b3") 2945 api.RegisterMessage((*BviCreate)(nil), "bvi_create_f5398559") 2946 api.RegisterMessage((*BviCreateReply)(nil), "bvi_create_reply_5383d31f") 2947 api.RegisterMessage((*BviDelete)(nil), "bvi_delete_f9e6675e") 2948 api.RegisterMessage((*BviDeleteReply)(nil), "bvi_delete_reply_e8d4e804") 2949 api.RegisterMessage((*L2ArpTermEvent)(nil), "l2_arp_term_event_6963e07a") 2950 api.RegisterMessage((*L2FibClearTable)(nil), "l2_fib_clear_table_51077d14") 2951 api.RegisterMessage((*L2FibClearTableReply)(nil), "l2_fib_clear_table_reply_e8d4e804") 2952 api.RegisterMessage((*L2FibTableDetails)(nil), "l2_fib_table_details_a44ef6b8") 2953 api.RegisterMessage((*L2FibTableDump)(nil), "l2_fib_table_dump_c25fdce6") 2954 api.RegisterMessage((*L2Flags)(nil), "l2_flags_fc41cfe8") 2955 api.RegisterMessage((*L2FlagsReply)(nil), "l2_flags_reply_29b2a2b3") 2956 api.RegisterMessage((*L2InterfaceEfpFilter)(nil), "l2_interface_efp_filter_5501adee") 2957 api.RegisterMessage((*L2InterfaceEfpFilterReply)(nil), "l2_interface_efp_filter_reply_e8d4e804") 2958 api.RegisterMessage((*L2InterfacePbbTagRewrite)(nil), "l2_interface_pbb_tag_rewrite_38e802a8") 2959 api.RegisterMessage((*L2InterfacePbbTagRewriteReply)(nil), "l2_interface_pbb_tag_rewrite_reply_e8d4e804") 2960 api.RegisterMessage((*L2InterfaceVlanTagRewrite)(nil), "l2_interface_vlan_tag_rewrite_62cc0bbc") 2961 api.RegisterMessage((*L2InterfaceVlanTagRewriteReply)(nil), "l2_interface_vlan_tag_rewrite_reply_e8d4e804") 2962 api.RegisterMessage((*L2MacsEvent)(nil), "l2_macs_event_44b8fd64") 2963 api.RegisterMessage((*L2PatchAddDel)(nil), "l2_patch_add_del_a1f6a6f3") 2964 api.RegisterMessage((*L2PatchAddDelReply)(nil), "l2_patch_add_del_reply_e8d4e804") 2965 api.RegisterMessage((*L2XconnectDetails)(nil), "l2_xconnect_details_472b6b67") 2966 api.RegisterMessage((*L2XconnectDump)(nil), "l2_xconnect_dump_51077d14") 2967 api.RegisterMessage((*L2fibAddDel)(nil), "l2fib_add_del_eddda487") 2968 api.RegisterMessage((*L2fibAddDelReply)(nil), "l2fib_add_del_reply_e8d4e804") 2969 api.RegisterMessage((*L2fibFlushAll)(nil), "l2fib_flush_all_51077d14") 2970 api.RegisterMessage((*L2fibFlushAllReply)(nil), "l2fib_flush_all_reply_e8d4e804") 2971 api.RegisterMessage((*L2fibFlushBd)(nil), "l2fib_flush_bd_c25fdce6") 2972 api.RegisterMessage((*L2fibFlushBdReply)(nil), "l2fib_flush_bd_reply_e8d4e804") 2973 api.RegisterMessage((*L2fibFlushInt)(nil), "l2fib_flush_int_f9e6675e") 2974 api.RegisterMessage((*L2fibFlushIntReply)(nil), "l2fib_flush_int_reply_e8d4e804") 2975 api.RegisterMessage((*L2fibSetScanDelay)(nil), "l2fib_set_scan_delay_a3b968a4") 2976 api.RegisterMessage((*L2fibSetScanDelayReply)(nil), "l2fib_set_scan_delay_reply_e8d4e804") 2977 api.RegisterMessage((*SwInterfaceSetL2Bridge)(nil), "sw_interface_set_l2_bridge_d0678b13") 2978 api.RegisterMessage((*SwInterfaceSetL2BridgeReply)(nil), "sw_interface_set_l2_bridge_reply_e8d4e804") 2979 api.RegisterMessage((*SwInterfaceSetL2Xconnect)(nil), "sw_interface_set_l2_xconnect_4fa28a85") 2980 api.RegisterMessage((*SwInterfaceSetL2XconnectReply)(nil), "sw_interface_set_l2_xconnect_reply_e8d4e804") 2981 api.RegisterMessage((*SwInterfaceSetVpath)(nil), "sw_interface_set_vpath_ae6cfcfb") 2982 api.RegisterMessage((*SwInterfaceSetVpathReply)(nil), "sw_interface_set_vpath_reply_e8d4e804") 2983 api.RegisterMessage((*WantL2ArpTermEvents)(nil), "want_l2_arp_term_events_3ec6d6c2") 2984 api.RegisterMessage((*WantL2ArpTermEventsReply)(nil), "want_l2_arp_term_events_reply_e8d4e804") 2985 api.RegisterMessage((*WantL2MacsEvents)(nil), "want_l2_macs_events_9aabdfde") 2986 api.RegisterMessage((*WantL2MacsEvents2)(nil), "want_l2_macs_events2_cc1377b0") 2987 api.RegisterMessage((*WantL2MacsEvents2Reply)(nil), "want_l2_macs_events2_reply_e8d4e804") 2988 api.RegisterMessage((*WantL2MacsEventsReply)(nil), "want_l2_macs_events_reply_e8d4e804") 2989 } 2990 2991 // Messages returns list of all messages in this module. 2992 func AllMessages() []api.Message { 2993 return []api.Message{ 2994 (*BdIPMacAddDel)(nil), 2995 (*BdIPMacAddDelReply)(nil), 2996 (*BdIPMacDetails)(nil), 2997 (*BdIPMacDump)(nil), 2998 (*BdIPMacFlush)(nil), 2999 (*BdIPMacFlushReply)(nil), 3000 (*BridgeDomainAddDel)(nil), 3001 (*BridgeDomainAddDelReply)(nil), 3002 (*BridgeDomainAddDelV2)(nil), 3003 (*BridgeDomainAddDelV2Reply)(nil), 3004 (*BridgeDomainDetails)(nil), 3005 (*BridgeDomainDump)(nil), 3006 (*BridgeDomainSetDefaultLearnLimit)(nil), 3007 (*BridgeDomainSetDefaultLearnLimitReply)(nil), 3008 (*BridgeDomainSetLearnLimit)(nil), 3009 (*BridgeDomainSetLearnLimitReply)(nil), 3010 (*BridgeDomainSetMacAge)(nil), 3011 (*BridgeDomainSetMacAgeReply)(nil), 3012 (*BridgeFlags)(nil), 3013 (*BridgeFlagsReply)(nil), 3014 (*BviCreate)(nil), 3015 (*BviCreateReply)(nil), 3016 (*BviDelete)(nil), 3017 (*BviDeleteReply)(nil), 3018 (*L2ArpTermEvent)(nil), 3019 (*L2FibClearTable)(nil), 3020 (*L2FibClearTableReply)(nil), 3021 (*L2FibTableDetails)(nil), 3022 (*L2FibTableDump)(nil), 3023 (*L2Flags)(nil), 3024 (*L2FlagsReply)(nil), 3025 (*L2InterfaceEfpFilter)(nil), 3026 (*L2InterfaceEfpFilterReply)(nil), 3027 (*L2InterfacePbbTagRewrite)(nil), 3028 (*L2InterfacePbbTagRewriteReply)(nil), 3029 (*L2InterfaceVlanTagRewrite)(nil), 3030 (*L2InterfaceVlanTagRewriteReply)(nil), 3031 (*L2MacsEvent)(nil), 3032 (*L2PatchAddDel)(nil), 3033 (*L2PatchAddDelReply)(nil), 3034 (*L2XconnectDetails)(nil), 3035 (*L2XconnectDump)(nil), 3036 (*L2fibAddDel)(nil), 3037 (*L2fibAddDelReply)(nil), 3038 (*L2fibFlushAll)(nil), 3039 (*L2fibFlushAllReply)(nil), 3040 (*L2fibFlushBd)(nil), 3041 (*L2fibFlushBdReply)(nil), 3042 (*L2fibFlushInt)(nil), 3043 (*L2fibFlushIntReply)(nil), 3044 (*L2fibSetScanDelay)(nil), 3045 (*L2fibSetScanDelayReply)(nil), 3046 (*SwInterfaceSetL2Bridge)(nil), 3047 (*SwInterfaceSetL2BridgeReply)(nil), 3048 (*SwInterfaceSetL2Xconnect)(nil), 3049 (*SwInterfaceSetL2XconnectReply)(nil), 3050 (*SwInterfaceSetVpath)(nil), 3051 (*SwInterfaceSetVpathReply)(nil), 3052 (*WantL2ArpTermEvents)(nil), 3053 (*WantL2ArpTermEventsReply)(nil), 3054 (*WantL2MacsEvents)(nil), 3055 (*WantL2MacsEvents2)(nil), 3056 (*WantL2MacsEvents2Reply)(nil), 3057 (*WantL2MacsEventsReply)(nil), 3058 } 3059 }