github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/igmp/igmp.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: plugins/igmp.api.json 6 7 // Package igmp contains generated bindings for API file igmp.api. 8 // 9 // Contents: 10 // - 2 enums 11 // - 2 structs 12 // - 19 messages 13 package igmp 14 15 import ( 16 "strconv" 17 18 interface_types "github.com/networkservicemesh/govpp/binapi/interface_types" 19 ip_types "github.com/networkservicemesh/govpp/binapi/ip_types" 20 api "go.fd.io/govpp/api" 21 codec "go.fd.io/govpp/codec" 22 ) 23 24 // This is a compile-time assertion to ensure that this generated file 25 // is compatible with the GoVPP api package it is being compiled against. 26 // A compilation error at this line likely means your copy of the 27 // GoVPP api package needs to be updated. 28 const _ = api.GoVppAPIPackageIsVersion2 29 30 const ( 31 APIFile = "igmp" 32 APIVersion = "1.0.0" 33 VersionCrc = 0x95a4ff29 34 ) 35 36 // FilterMode defines enum 'filter_mode'. 37 type FilterMode uint32 38 39 const ( 40 EXCLUDE FilterMode = 0 41 INCLUDE FilterMode = 1 42 ) 43 44 var ( 45 FilterMode_name = map[uint32]string{ 46 0: "EXCLUDE", 47 1: "INCLUDE", 48 } 49 FilterMode_value = map[string]uint32{ 50 "EXCLUDE": 0, 51 "INCLUDE": 1, 52 } 53 ) 54 55 func (x FilterMode) String() string { 56 s, ok := FilterMode_name[uint32(x)] 57 if ok { 58 return s 59 } 60 return "FilterMode(" + strconv.Itoa(int(x)) + ")" 61 } 62 63 // GroupPrefixType defines enum 'group_prefix_type'. 64 type GroupPrefixType uint32 65 66 const ( 67 ASM GroupPrefixType = 0 68 SSM GroupPrefixType = 1 69 ) 70 71 var ( 72 GroupPrefixType_name = map[uint32]string{ 73 0: "ASM", 74 1: "SSM", 75 } 76 GroupPrefixType_value = map[string]uint32{ 77 "ASM": 0, 78 "SSM": 1, 79 } 80 ) 81 82 func (x GroupPrefixType) String() string { 83 s, ok := GroupPrefixType_name[uint32(x)] 84 if ok { 85 return s 86 } 87 return "GroupPrefixType(" + strconv.Itoa(int(x)) + ")" 88 } 89 90 // GroupPrefix defines type 'group_prefix'. 91 type GroupPrefix struct { 92 Type GroupPrefixType `binapi:"group_prefix_type,name=type" json:"type,omitempty"` 93 Prefix ip_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"` 94 } 95 96 // IgmpGroup defines type 'igmp_group'. 97 type IgmpGroup struct { 98 Filter FilterMode `binapi:"filter_mode,name=filter" json:"filter,omitempty"` 99 NSrcs uint8 `binapi:"u8,name=n_srcs" json:"-"` 100 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 101 Gaddr ip_types.IP4Address `binapi:"ip4_address,name=gaddr" json:"gaddr,omitempty"` 102 Saddrs []ip_types.IP4Address `binapi:"ip4_address[n_srcs],name=saddrs" json:"saddrs,omitempty"` 103 } 104 105 // remove all (S,G)s from an interface 106 // - sw_if_index - interface sw index 107 // 108 // IgmpClearInterface defines message 'igmp_clear_interface'. 109 type IgmpClearInterface struct { 110 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 111 } 112 113 func (m *IgmpClearInterface) Reset() { *m = IgmpClearInterface{} } 114 func (*IgmpClearInterface) GetMessageName() string { return "igmp_clear_interface" } 115 func (*IgmpClearInterface) GetCrcString() string { return "f9e6675e" } 116 func (*IgmpClearInterface) GetMessageType() api.MessageType { 117 return api.RequestMessage 118 } 119 120 func (m *IgmpClearInterface) Size() (size int) { 121 if m == nil { 122 return 0 123 } 124 size += 4 // m.SwIfIndex 125 return size 126 } 127 func (m *IgmpClearInterface) Marshal(b []byte) ([]byte, error) { 128 if b == nil { 129 b = make([]byte, m.Size()) 130 } 131 buf := codec.NewBuffer(b) 132 buf.EncodeUint32(uint32(m.SwIfIndex)) 133 return buf.Bytes(), nil 134 } 135 func (m *IgmpClearInterface) Unmarshal(b []byte) error { 136 buf := codec.NewBuffer(b) 137 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 138 return nil 139 } 140 141 // IgmpClearInterfaceReply defines message 'igmp_clear_interface_reply'. 142 type IgmpClearInterfaceReply struct { 143 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 144 } 145 146 func (m *IgmpClearInterfaceReply) Reset() { *m = IgmpClearInterfaceReply{} } 147 func (*IgmpClearInterfaceReply) GetMessageName() string { return "igmp_clear_interface_reply" } 148 func (*IgmpClearInterfaceReply) GetCrcString() string { return "e8d4e804" } 149 func (*IgmpClearInterfaceReply) GetMessageType() api.MessageType { 150 return api.ReplyMessage 151 } 152 153 func (m *IgmpClearInterfaceReply) Size() (size int) { 154 if m == nil { 155 return 0 156 } 157 size += 4 // m.Retval 158 return size 159 } 160 func (m *IgmpClearInterfaceReply) Marshal(b []byte) ([]byte, error) { 161 if b == nil { 162 b = make([]byte, m.Size()) 163 } 164 buf := codec.NewBuffer(b) 165 buf.EncodeInt32(m.Retval) 166 return buf.Bytes(), nil 167 } 168 func (m *IgmpClearInterfaceReply) Unmarshal(b []byte) error { 169 buf := codec.NewBuffer(b) 170 m.Retval = buf.DecodeInt32() 171 return nil 172 } 173 174 // * @brief igmp details 175 // - - sw_if_index - interface sw index 176 // - - saddr - source address 177 // - - gaddr - group address 178 // 179 // IgmpDetails defines message 'igmp_details'. 180 type IgmpDetails struct { 181 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 182 Saddr ip_types.IP4Address `binapi:"ip4_address,name=saddr" json:"saddr,omitempty"` 183 Gaddr ip_types.IP4Address `binapi:"ip4_address,name=gaddr" json:"gaddr,omitempty"` 184 } 185 186 func (m *IgmpDetails) Reset() { *m = IgmpDetails{} } 187 func (*IgmpDetails) GetMessageName() string { return "igmp_details" } 188 func (*IgmpDetails) GetCrcString() string { return "38f09929" } 189 func (*IgmpDetails) GetMessageType() api.MessageType { 190 return api.ReplyMessage 191 } 192 193 func (m *IgmpDetails) Size() (size int) { 194 if m == nil { 195 return 0 196 } 197 size += 4 // m.SwIfIndex 198 size += 1 * 4 // m.Saddr 199 size += 1 * 4 // m.Gaddr 200 return size 201 } 202 func (m *IgmpDetails) Marshal(b []byte) ([]byte, error) { 203 if b == nil { 204 b = make([]byte, m.Size()) 205 } 206 buf := codec.NewBuffer(b) 207 buf.EncodeUint32(uint32(m.SwIfIndex)) 208 buf.EncodeBytes(m.Saddr[:], 4) 209 buf.EncodeBytes(m.Gaddr[:], 4) 210 return buf.Bytes(), nil 211 } 212 func (m *IgmpDetails) Unmarshal(b []byte) error { 213 buf := codec.NewBuffer(b) 214 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 215 copy(m.Saddr[:], buf.DecodeBytes(4)) 216 copy(m.Gaddr[:], buf.DecodeBytes(4)) 217 return nil 218 } 219 220 // * @brief dump (S,G)s from interface 221 // - - sw_if_index - interface sw index (~0 for all) 222 // 223 // IgmpDump defines message 'igmp_dump'. 224 type IgmpDump struct { 225 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 226 } 227 228 func (m *IgmpDump) Reset() { *m = IgmpDump{} } 229 func (*IgmpDump) GetMessageName() string { return "igmp_dump" } 230 func (*IgmpDump) GetCrcString() string { return "f9e6675e" } 231 func (*IgmpDump) GetMessageType() api.MessageType { 232 return api.RequestMessage 233 } 234 235 func (m *IgmpDump) Size() (size int) { 236 if m == nil { 237 return 0 238 } 239 size += 4 // m.SwIfIndex 240 return size 241 } 242 func (m *IgmpDump) Marshal(b []byte) ([]byte, error) { 243 if b == nil { 244 b = make([]byte, m.Size()) 245 } 246 buf := codec.NewBuffer(b) 247 buf.EncodeUint32(uint32(m.SwIfIndex)) 248 return buf.Bytes(), nil 249 } 250 func (m *IgmpDump) Unmarshal(b []byte) error { 251 buf := codec.NewBuffer(b) 252 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 253 return nil 254 } 255 256 // * @brief 257 // - Used by a 'router' and 'host' to enable the reception of IGMP packets. 258 // - For hosts this must be called once before igmp_listen. 259 // * 260 // - - enable - if set, enable igmp messages on configuration 261 // - - mode - Host (1) or router (0) mode 262 // - - sw_if_index - interface sw index 263 // 264 // IgmpEnableDisable defines message 'igmp_enable_disable'. 265 type IgmpEnableDisable struct { 266 Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"` 267 Mode uint8 `binapi:"u8,name=mode" json:"mode,omitempty"` 268 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 269 } 270 271 func (m *IgmpEnableDisable) Reset() { *m = IgmpEnableDisable{} } 272 func (*IgmpEnableDisable) GetMessageName() string { return "igmp_enable_disable" } 273 func (*IgmpEnableDisable) GetCrcString() string { return "b1edfb96" } 274 func (*IgmpEnableDisable) GetMessageType() api.MessageType { 275 return api.RequestMessage 276 } 277 278 func (m *IgmpEnableDisable) Size() (size int) { 279 if m == nil { 280 return 0 281 } 282 size += 1 // m.Enable 283 size += 1 // m.Mode 284 size += 4 // m.SwIfIndex 285 return size 286 } 287 func (m *IgmpEnableDisable) Marshal(b []byte) ([]byte, error) { 288 if b == nil { 289 b = make([]byte, m.Size()) 290 } 291 buf := codec.NewBuffer(b) 292 buf.EncodeBool(m.Enable) 293 buf.EncodeUint8(m.Mode) 294 buf.EncodeUint32(uint32(m.SwIfIndex)) 295 return buf.Bytes(), nil 296 } 297 func (m *IgmpEnableDisable) Unmarshal(b []byte) error { 298 buf := codec.NewBuffer(b) 299 m.Enable = buf.DecodeBool() 300 m.Mode = buf.DecodeUint8() 301 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 302 return nil 303 } 304 305 // IgmpEnableDisableReply defines message 'igmp_enable_disable_reply'. 306 type IgmpEnableDisableReply struct { 307 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 308 } 309 310 func (m *IgmpEnableDisableReply) Reset() { *m = IgmpEnableDisableReply{} } 311 func (*IgmpEnableDisableReply) GetMessageName() string { return "igmp_enable_disable_reply" } 312 func (*IgmpEnableDisableReply) GetCrcString() string { return "e8d4e804" } 313 func (*IgmpEnableDisableReply) GetMessageType() api.MessageType { 314 return api.ReplyMessage 315 } 316 317 func (m *IgmpEnableDisableReply) Size() (size int) { 318 if m == nil { 319 return 0 320 } 321 size += 4 // m.Retval 322 return size 323 } 324 func (m *IgmpEnableDisableReply) Marshal(b []byte) ([]byte, error) { 325 if b == nil { 326 b = make([]byte, m.Size()) 327 } 328 buf := codec.NewBuffer(b) 329 buf.EncodeInt32(m.Retval) 330 return buf.Bytes(), nil 331 } 332 func (m *IgmpEnableDisableReply) Unmarshal(b []byte) error { 333 buf := codec.NewBuffer(b) 334 m.Retval = buf.DecodeInt32() 335 return nil 336 } 337 338 // * @brief igmp event details 339 // - - sw_if_index - interface sw index 340 // - - saddr - source address 341 // - - gaddr - group address 342 // *- filter - filter mode 343 // 344 // IgmpEvent defines message 'igmp_event'. 345 type IgmpEvent struct { 346 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 347 Filter FilterMode `binapi:"filter_mode,name=filter" json:"filter,omitempty"` 348 Saddr ip_types.IP4Address `binapi:"ip4_address,name=saddr" json:"saddr,omitempty"` 349 Gaddr ip_types.IP4Address `binapi:"ip4_address,name=gaddr" json:"gaddr,omitempty"` 350 } 351 352 func (m *IgmpEvent) Reset() { *m = IgmpEvent{} } 353 func (*IgmpEvent) GetMessageName() string { return "igmp_event" } 354 func (*IgmpEvent) GetCrcString() string { return "85fe93ec" } 355 func (*IgmpEvent) GetMessageType() api.MessageType { 356 return api.OtherMessage 357 } 358 359 func (m *IgmpEvent) Size() (size int) { 360 if m == nil { 361 return 0 362 } 363 size += 4 // m.SwIfIndex 364 size += 4 // m.Filter 365 size += 1 * 4 // m.Saddr 366 size += 1 * 4 // m.Gaddr 367 return size 368 } 369 func (m *IgmpEvent) Marshal(b []byte) ([]byte, error) { 370 if b == nil { 371 b = make([]byte, m.Size()) 372 } 373 buf := codec.NewBuffer(b) 374 buf.EncodeUint32(uint32(m.SwIfIndex)) 375 buf.EncodeUint32(uint32(m.Filter)) 376 buf.EncodeBytes(m.Saddr[:], 4) 377 buf.EncodeBytes(m.Gaddr[:], 4) 378 return buf.Bytes(), nil 379 } 380 func (m *IgmpEvent) Unmarshal(b []byte) error { 381 buf := codec.NewBuffer(b) 382 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 383 m.Filter = FilterMode(buf.DecodeUint32()) 384 copy(m.Saddr[:], buf.DecodeBytes(4)) 385 copy(m.Gaddr[:], buf.DecodeBytes(4)) 386 return nil 387 } 388 389 // IgmpGroupPrefixDetails defines message 'igmp_group_prefix_details'. 390 type IgmpGroupPrefixDetails struct { 391 Gp GroupPrefix `binapi:"group_prefix,name=gp" json:"gp,omitempty"` 392 } 393 394 func (m *IgmpGroupPrefixDetails) Reset() { *m = IgmpGroupPrefixDetails{} } 395 func (*IgmpGroupPrefixDetails) GetMessageName() string { return "igmp_group_prefix_details" } 396 func (*IgmpGroupPrefixDetails) GetCrcString() string { return "259ccd81" } 397 func (*IgmpGroupPrefixDetails) GetMessageType() api.MessageType { 398 return api.ReplyMessage 399 } 400 401 func (m *IgmpGroupPrefixDetails) Size() (size int) { 402 if m == nil { 403 return 0 404 } 405 size += 4 // m.Gp.Type 406 size += 1 // m.Gp.Prefix.Address.Af 407 size += 1 * 16 // m.Gp.Prefix.Address.Un 408 size += 1 // m.Gp.Prefix.Len 409 return size 410 } 411 func (m *IgmpGroupPrefixDetails) Marshal(b []byte) ([]byte, error) { 412 if b == nil { 413 b = make([]byte, m.Size()) 414 } 415 buf := codec.NewBuffer(b) 416 buf.EncodeUint32(uint32(m.Gp.Type)) 417 buf.EncodeUint8(uint8(m.Gp.Prefix.Address.Af)) 418 buf.EncodeBytes(m.Gp.Prefix.Address.Un.XXX_UnionData[:], 16) 419 buf.EncodeUint8(m.Gp.Prefix.Len) 420 return buf.Bytes(), nil 421 } 422 func (m *IgmpGroupPrefixDetails) Unmarshal(b []byte) error { 423 buf := codec.NewBuffer(b) 424 m.Gp.Type = GroupPrefixType(buf.DecodeUint32()) 425 m.Gp.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) 426 copy(m.Gp.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 427 m.Gp.Prefix.Len = buf.DecodeUint8() 428 return nil 429 } 430 431 // IgmpGroupPrefixDump defines message 'igmp_group_prefix_dump'. 432 type IgmpGroupPrefixDump struct{} 433 434 func (m *IgmpGroupPrefixDump) Reset() { *m = IgmpGroupPrefixDump{} } 435 func (*IgmpGroupPrefixDump) GetMessageName() string { return "igmp_group_prefix_dump" } 436 func (*IgmpGroupPrefixDump) GetCrcString() string { return "51077d14" } 437 func (*IgmpGroupPrefixDump) GetMessageType() api.MessageType { 438 return api.RequestMessage 439 } 440 441 func (m *IgmpGroupPrefixDump) Size() (size int) { 442 if m == nil { 443 return 0 444 } 445 return size 446 } 447 func (m *IgmpGroupPrefixDump) Marshal(b []byte) ([]byte, error) { 448 if b == nil { 449 b = make([]byte, m.Size()) 450 } 451 buf := codec.NewBuffer(b) 452 return buf.Bytes(), nil 453 } 454 func (m *IgmpGroupPrefixDump) Unmarshal(b []byte) error { 455 return nil 456 } 457 458 // * @brief Configure a prefix for SSM or ASM semantics 459 // - - address - Prefix address 460 // - - address_length - Prefix length 461 // 462 // IgmpGroupPrefixSet defines message 'igmp_group_prefix_set'. 463 type IgmpGroupPrefixSet struct { 464 Gp GroupPrefix `binapi:"group_prefix,name=gp" json:"gp,omitempty"` 465 } 466 467 func (m *IgmpGroupPrefixSet) Reset() { *m = IgmpGroupPrefixSet{} } 468 func (*IgmpGroupPrefixSet) GetMessageName() string { return "igmp_group_prefix_set" } 469 func (*IgmpGroupPrefixSet) GetCrcString() string { return "5b14a5ce" } 470 func (*IgmpGroupPrefixSet) GetMessageType() api.MessageType { 471 return api.RequestMessage 472 } 473 474 func (m *IgmpGroupPrefixSet) Size() (size int) { 475 if m == nil { 476 return 0 477 } 478 size += 4 // m.Gp.Type 479 size += 1 // m.Gp.Prefix.Address.Af 480 size += 1 * 16 // m.Gp.Prefix.Address.Un 481 size += 1 // m.Gp.Prefix.Len 482 return size 483 } 484 func (m *IgmpGroupPrefixSet) Marshal(b []byte) ([]byte, error) { 485 if b == nil { 486 b = make([]byte, m.Size()) 487 } 488 buf := codec.NewBuffer(b) 489 buf.EncodeUint32(uint32(m.Gp.Type)) 490 buf.EncodeUint8(uint8(m.Gp.Prefix.Address.Af)) 491 buf.EncodeBytes(m.Gp.Prefix.Address.Un.XXX_UnionData[:], 16) 492 buf.EncodeUint8(m.Gp.Prefix.Len) 493 return buf.Bytes(), nil 494 } 495 func (m *IgmpGroupPrefixSet) Unmarshal(b []byte) error { 496 buf := codec.NewBuffer(b) 497 m.Gp.Type = GroupPrefixType(buf.DecodeUint32()) 498 m.Gp.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) 499 copy(m.Gp.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 500 m.Gp.Prefix.Len = buf.DecodeUint8() 501 return nil 502 } 503 504 // IgmpGroupPrefixSetReply defines message 'igmp_group_prefix_set_reply'. 505 type IgmpGroupPrefixSetReply struct { 506 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 507 } 508 509 func (m *IgmpGroupPrefixSetReply) Reset() { *m = IgmpGroupPrefixSetReply{} } 510 func (*IgmpGroupPrefixSetReply) GetMessageName() string { return "igmp_group_prefix_set_reply" } 511 func (*IgmpGroupPrefixSetReply) GetCrcString() string { return "e8d4e804" } 512 func (*IgmpGroupPrefixSetReply) GetMessageType() api.MessageType { 513 return api.ReplyMessage 514 } 515 516 func (m *IgmpGroupPrefixSetReply) Size() (size int) { 517 if m == nil { 518 return 0 519 } 520 size += 4 // m.Retval 521 return size 522 } 523 func (m *IgmpGroupPrefixSetReply) Marshal(b []byte) ([]byte, error) { 524 if b == nil { 525 b = make([]byte, m.Size()) 526 } 527 buf := codec.NewBuffer(b) 528 buf.EncodeInt32(m.Retval) 529 return buf.Bytes(), nil 530 } 531 func (m *IgmpGroupPrefixSetReply) Unmarshal(b []byte) error { 532 buf := codec.NewBuffer(b) 533 m.Retval = buf.DecodeInt32() 534 return nil 535 } 536 537 // * @brief 538 // - Used by a 'host' to enable the reception/listening of packets for a specific 539 // - multicast group 540 // * 541 // - For each socket on which IPMulticastListen has been invoked, the 542 // - system records the desired multicast reception state for that socket. 543 // - That state conceptually consists of a set of records of the form: 544 // * 545 // - (interface, multicast-address, filter-mode, source-list) 546 // * 547 // - The socket state evolves in response to each invocation of 548 // - IPMulticastListen on the socket, as follows: 549 // * 550 // - o If the requested filter mode is INCLUDE *and* the requested source 551 // - list is empty, then the entry corresponding to the requested 552 // - interface and multicast address is deleted if present. If no such 553 // - entry is present, the request is ignored. 554 // * 555 // - o If the requested filter mode is EXCLUDE *or* the requested source 556 // - list is non-empty, then the entry corresponding to the requested 557 // - interface and multicast address, if present, is changed to contain 558 // - the requested filter mode and source list. If no such entry is 559 // - present, a new entry is created, using the parameters specified in 560 // - the request. 561 // * 562 // - - sw_if_index - interface sw index 563 // - - filter - filter mode 564 // - - saddr - source address 565 // - - gaddr - group address 566 // 567 // IgmpListen defines message 'igmp_listen'. 568 type IgmpListen struct { 569 Group IgmpGroup `binapi:"igmp_group,name=group" json:"group,omitempty"` 570 } 571 572 func (m *IgmpListen) Reset() { *m = IgmpListen{} } 573 func (*IgmpListen) GetMessageName() string { return "igmp_listen" } 574 func (*IgmpListen) GetCrcString() string { return "19a49f1e" } 575 func (*IgmpListen) GetMessageType() api.MessageType { 576 return api.RequestMessage 577 } 578 579 func (m *IgmpListen) Size() (size int) { 580 if m == nil { 581 return 0 582 } 583 size += 4 // m.Group.Filter 584 size += 1 // m.Group.NSrcs 585 size += 4 // m.Group.SwIfIndex 586 size += 1 * 4 // m.Group.Gaddr 587 for j2 := 0; j2 < len(m.Group.Saddrs); j2++ { 588 var s2 ip_types.IP4Address 589 _ = s2 590 if j2 < len(m.Group.Saddrs) { 591 s2 = m.Group.Saddrs[j2] 592 } 593 size += 1 * 4 // s2 594 } 595 return size 596 } 597 func (m *IgmpListen) Marshal(b []byte) ([]byte, error) { 598 if b == nil { 599 b = make([]byte, m.Size()) 600 } 601 buf := codec.NewBuffer(b) 602 buf.EncodeUint32(uint32(m.Group.Filter)) 603 buf.EncodeUint8(uint8(len(m.Group.Saddrs))) 604 buf.EncodeUint32(uint32(m.Group.SwIfIndex)) 605 buf.EncodeBytes(m.Group.Gaddr[:], 4) 606 for j1 := 0; j1 < len(m.Group.Saddrs); j1++ { 607 var v1 ip_types.IP4Address // Saddrs 608 if j1 < len(m.Group.Saddrs) { 609 v1 = m.Group.Saddrs[j1] 610 } 611 buf.EncodeBytes(v1[:], 4) 612 } 613 return buf.Bytes(), nil 614 } 615 func (m *IgmpListen) Unmarshal(b []byte) error { 616 buf := codec.NewBuffer(b) 617 m.Group.Filter = FilterMode(buf.DecodeUint32()) 618 m.Group.NSrcs = buf.DecodeUint8() 619 m.Group.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 620 copy(m.Group.Gaddr[:], buf.DecodeBytes(4)) 621 m.Group.Saddrs = make([]ip_types.IP4Address, m.Group.NSrcs) 622 for j1 := 0; j1 < len(m.Group.Saddrs); j1++ { 623 copy(m.Group.Saddrs[j1][:], buf.DecodeBytes(4)) 624 } 625 return nil 626 } 627 628 // IgmpListenReply defines message 'igmp_listen_reply'. 629 type IgmpListenReply struct { 630 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 631 } 632 633 func (m *IgmpListenReply) Reset() { *m = IgmpListenReply{} } 634 func (*IgmpListenReply) GetMessageName() string { return "igmp_listen_reply" } 635 func (*IgmpListenReply) GetCrcString() string { return "e8d4e804" } 636 func (*IgmpListenReply) GetMessageType() api.MessageType { 637 return api.ReplyMessage 638 } 639 640 func (m *IgmpListenReply) Size() (size int) { 641 if m == nil { 642 return 0 643 } 644 size += 4 // m.Retval 645 return size 646 } 647 func (m *IgmpListenReply) Marshal(b []byte) ([]byte, error) { 648 if b == nil { 649 b = make([]byte, m.Size()) 650 } 651 buf := codec.NewBuffer(b) 652 buf.EncodeInt32(m.Retval) 653 return buf.Bytes(), nil 654 } 655 func (m *IgmpListenReply) Unmarshal(b []byte) error { 656 buf := codec.NewBuffer(b) 657 m.Retval = buf.DecodeInt32() 658 return nil 659 } 660 661 // * @brief 662 // - Add/del proxy device on specified VRF. 663 // - Interface must be IGMP enabled in HOST mode. 664 // * 665 // - - add - add (1) del (0) 666 // - - vrf_id - VRF id 667 // - - sw_if_index - upstream interface sw index 668 // 669 // IgmpProxyDeviceAddDel defines message 'igmp_proxy_device_add_del'. 670 type IgmpProxyDeviceAddDel struct { 671 Add uint8 `binapi:"u8,name=add" json:"add,omitempty"` 672 VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"` 673 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 674 } 675 676 func (m *IgmpProxyDeviceAddDel) Reset() { *m = IgmpProxyDeviceAddDel{} } 677 func (*IgmpProxyDeviceAddDel) GetMessageName() string { return "igmp_proxy_device_add_del" } 678 func (*IgmpProxyDeviceAddDel) GetCrcString() string { return "0b9be9ce" } 679 func (*IgmpProxyDeviceAddDel) GetMessageType() api.MessageType { 680 return api.RequestMessage 681 } 682 683 func (m *IgmpProxyDeviceAddDel) Size() (size int) { 684 if m == nil { 685 return 0 686 } 687 size += 1 // m.Add 688 size += 4 // m.VrfID 689 size += 4 // m.SwIfIndex 690 return size 691 } 692 func (m *IgmpProxyDeviceAddDel) Marshal(b []byte) ([]byte, error) { 693 if b == nil { 694 b = make([]byte, m.Size()) 695 } 696 buf := codec.NewBuffer(b) 697 buf.EncodeUint8(m.Add) 698 buf.EncodeUint32(m.VrfID) 699 buf.EncodeUint32(uint32(m.SwIfIndex)) 700 return buf.Bytes(), nil 701 } 702 func (m *IgmpProxyDeviceAddDel) Unmarshal(b []byte) error { 703 buf := codec.NewBuffer(b) 704 m.Add = buf.DecodeUint8() 705 m.VrfID = buf.DecodeUint32() 706 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 707 return nil 708 } 709 710 // * @brief 711 // - Add/del downstream interface to/from proxy device. 712 // - Interface must be IGMP enabled in ROUTER mode. 713 // * 714 // - - add - add (1) del (0) 715 // - - vrf_id - VRF id 716 // - - sw_if_index - downstream interface sw index 717 // 718 // IgmpProxyDeviceAddDelInterface defines message 'igmp_proxy_device_add_del_interface'. 719 type IgmpProxyDeviceAddDelInterface struct { 720 Add bool `binapi:"bool,name=add" json:"add,omitempty"` 721 VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"` 722 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 723 } 724 725 func (m *IgmpProxyDeviceAddDelInterface) Reset() { *m = IgmpProxyDeviceAddDelInterface{} } 726 func (*IgmpProxyDeviceAddDelInterface) GetMessageName() string { 727 return "igmp_proxy_device_add_del_interface" 728 } 729 func (*IgmpProxyDeviceAddDelInterface) GetCrcString() string { return "1a9ec24a" } 730 func (*IgmpProxyDeviceAddDelInterface) GetMessageType() api.MessageType { 731 return api.RequestMessage 732 } 733 734 func (m *IgmpProxyDeviceAddDelInterface) Size() (size int) { 735 if m == nil { 736 return 0 737 } 738 size += 1 // m.Add 739 size += 4 // m.VrfID 740 size += 4 // m.SwIfIndex 741 return size 742 } 743 func (m *IgmpProxyDeviceAddDelInterface) Marshal(b []byte) ([]byte, error) { 744 if b == nil { 745 b = make([]byte, m.Size()) 746 } 747 buf := codec.NewBuffer(b) 748 buf.EncodeBool(m.Add) 749 buf.EncodeUint32(m.VrfID) 750 buf.EncodeUint32(uint32(m.SwIfIndex)) 751 return buf.Bytes(), nil 752 } 753 func (m *IgmpProxyDeviceAddDelInterface) Unmarshal(b []byte) error { 754 buf := codec.NewBuffer(b) 755 m.Add = buf.DecodeBool() 756 m.VrfID = buf.DecodeUint32() 757 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 758 return nil 759 } 760 761 // IgmpProxyDeviceAddDelInterfaceReply defines message 'igmp_proxy_device_add_del_interface_reply'. 762 type IgmpProxyDeviceAddDelInterfaceReply struct { 763 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 764 } 765 766 func (m *IgmpProxyDeviceAddDelInterfaceReply) Reset() { *m = IgmpProxyDeviceAddDelInterfaceReply{} } 767 func (*IgmpProxyDeviceAddDelInterfaceReply) GetMessageName() string { 768 return "igmp_proxy_device_add_del_interface_reply" 769 } 770 func (*IgmpProxyDeviceAddDelInterfaceReply) GetCrcString() string { return "e8d4e804" } 771 func (*IgmpProxyDeviceAddDelInterfaceReply) GetMessageType() api.MessageType { 772 return api.ReplyMessage 773 } 774 775 func (m *IgmpProxyDeviceAddDelInterfaceReply) Size() (size int) { 776 if m == nil { 777 return 0 778 } 779 size += 4 // m.Retval 780 return size 781 } 782 func (m *IgmpProxyDeviceAddDelInterfaceReply) Marshal(b []byte) ([]byte, error) { 783 if b == nil { 784 b = make([]byte, m.Size()) 785 } 786 buf := codec.NewBuffer(b) 787 buf.EncodeInt32(m.Retval) 788 return buf.Bytes(), nil 789 } 790 func (m *IgmpProxyDeviceAddDelInterfaceReply) Unmarshal(b []byte) error { 791 buf := codec.NewBuffer(b) 792 m.Retval = buf.DecodeInt32() 793 return nil 794 } 795 796 // IgmpProxyDeviceAddDelReply defines message 'igmp_proxy_device_add_del_reply'. 797 type IgmpProxyDeviceAddDelReply struct { 798 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 799 } 800 801 func (m *IgmpProxyDeviceAddDelReply) Reset() { *m = IgmpProxyDeviceAddDelReply{} } 802 func (*IgmpProxyDeviceAddDelReply) GetMessageName() string { return "igmp_proxy_device_add_del_reply" } 803 func (*IgmpProxyDeviceAddDelReply) GetCrcString() string { return "e8d4e804" } 804 func (*IgmpProxyDeviceAddDelReply) GetMessageType() api.MessageType { 805 return api.ReplyMessage 806 } 807 808 func (m *IgmpProxyDeviceAddDelReply) Size() (size int) { 809 if m == nil { 810 return 0 811 } 812 size += 4 // m.Retval 813 return size 814 } 815 func (m *IgmpProxyDeviceAddDelReply) Marshal(b []byte) ([]byte, error) { 816 if b == nil { 817 b = make([]byte, m.Size()) 818 } 819 buf := codec.NewBuffer(b) 820 buf.EncodeInt32(m.Retval) 821 return buf.Bytes(), nil 822 } 823 func (m *IgmpProxyDeviceAddDelReply) Unmarshal(b []byte) error { 824 buf := codec.NewBuffer(b) 825 m.Retval = buf.DecodeInt32() 826 return nil 827 } 828 829 // * @brief register for igmp events 830 // - - pid - sender's pid 831 // - - enable - 1 enable, 0 disable igmp events 832 // 833 // WantIgmpEvents defines message 'want_igmp_events'. 834 type WantIgmpEvents struct { 835 Enable uint32 `binapi:"u32,name=enable" json:"enable,omitempty"` 836 PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"` 837 } 838 839 func (m *WantIgmpEvents) Reset() { *m = WantIgmpEvents{} } 840 func (*WantIgmpEvents) GetMessageName() string { return "want_igmp_events" } 841 func (*WantIgmpEvents) GetCrcString() string { return "cfaccc1f" } 842 func (*WantIgmpEvents) GetMessageType() api.MessageType { 843 return api.RequestMessage 844 } 845 846 func (m *WantIgmpEvents) Size() (size int) { 847 if m == nil { 848 return 0 849 } 850 size += 4 // m.Enable 851 size += 4 // m.PID 852 return size 853 } 854 func (m *WantIgmpEvents) Marshal(b []byte) ([]byte, error) { 855 if b == nil { 856 b = make([]byte, m.Size()) 857 } 858 buf := codec.NewBuffer(b) 859 buf.EncodeUint32(m.Enable) 860 buf.EncodeUint32(m.PID) 861 return buf.Bytes(), nil 862 } 863 func (m *WantIgmpEvents) Unmarshal(b []byte) error { 864 buf := codec.NewBuffer(b) 865 m.Enable = buf.DecodeUint32() 866 m.PID = buf.DecodeUint32() 867 return nil 868 } 869 870 // WantIgmpEventsReply defines message 'want_igmp_events_reply'. 871 type WantIgmpEventsReply struct { 872 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 873 } 874 875 func (m *WantIgmpEventsReply) Reset() { *m = WantIgmpEventsReply{} } 876 func (*WantIgmpEventsReply) GetMessageName() string { return "want_igmp_events_reply" } 877 func (*WantIgmpEventsReply) GetCrcString() string { return "e8d4e804" } 878 func (*WantIgmpEventsReply) GetMessageType() api.MessageType { 879 return api.ReplyMessage 880 } 881 882 func (m *WantIgmpEventsReply) Size() (size int) { 883 if m == nil { 884 return 0 885 } 886 size += 4 // m.Retval 887 return size 888 } 889 func (m *WantIgmpEventsReply) Marshal(b []byte) ([]byte, error) { 890 if b == nil { 891 b = make([]byte, m.Size()) 892 } 893 buf := codec.NewBuffer(b) 894 buf.EncodeInt32(m.Retval) 895 return buf.Bytes(), nil 896 } 897 func (m *WantIgmpEventsReply) Unmarshal(b []byte) error { 898 buf := codec.NewBuffer(b) 899 m.Retval = buf.DecodeInt32() 900 return nil 901 } 902 903 func init() { file_igmp_binapi_init() } 904 func file_igmp_binapi_init() { 905 api.RegisterMessage((*IgmpClearInterface)(nil), "igmp_clear_interface_f9e6675e") 906 api.RegisterMessage((*IgmpClearInterfaceReply)(nil), "igmp_clear_interface_reply_e8d4e804") 907 api.RegisterMessage((*IgmpDetails)(nil), "igmp_details_38f09929") 908 api.RegisterMessage((*IgmpDump)(nil), "igmp_dump_f9e6675e") 909 api.RegisterMessage((*IgmpEnableDisable)(nil), "igmp_enable_disable_b1edfb96") 910 api.RegisterMessage((*IgmpEnableDisableReply)(nil), "igmp_enable_disable_reply_e8d4e804") 911 api.RegisterMessage((*IgmpEvent)(nil), "igmp_event_85fe93ec") 912 api.RegisterMessage((*IgmpGroupPrefixDetails)(nil), "igmp_group_prefix_details_259ccd81") 913 api.RegisterMessage((*IgmpGroupPrefixDump)(nil), "igmp_group_prefix_dump_51077d14") 914 api.RegisterMessage((*IgmpGroupPrefixSet)(nil), "igmp_group_prefix_set_5b14a5ce") 915 api.RegisterMessage((*IgmpGroupPrefixSetReply)(nil), "igmp_group_prefix_set_reply_e8d4e804") 916 api.RegisterMessage((*IgmpListen)(nil), "igmp_listen_19a49f1e") 917 api.RegisterMessage((*IgmpListenReply)(nil), "igmp_listen_reply_e8d4e804") 918 api.RegisterMessage((*IgmpProxyDeviceAddDel)(nil), "igmp_proxy_device_add_del_0b9be9ce") 919 api.RegisterMessage((*IgmpProxyDeviceAddDelInterface)(nil), "igmp_proxy_device_add_del_interface_1a9ec24a") 920 api.RegisterMessage((*IgmpProxyDeviceAddDelInterfaceReply)(nil), "igmp_proxy_device_add_del_interface_reply_e8d4e804") 921 api.RegisterMessage((*IgmpProxyDeviceAddDelReply)(nil), "igmp_proxy_device_add_del_reply_e8d4e804") 922 api.RegisterMessage((*WantIgmpEvents)(nil), "want_igmp_events_cfaccc1f") 923 api.RegisterMessage((*WantIgmpEventsReply)(nil), "want_igmp_events_reply_e8d4e804") 924 } 925 926 // Messages returns list of all messages in this module. 927 func AllMessages() []api.Message { 928 return []api.Message{ 929 (*IgmpClearInterface)(nil), 930 (*IgmpClearInterfaceReply)(nil), 931 (*IgmpDetails)(nil), 932 (*IgmpDump)(nil), 933 (*IgmpEnableDisable)(nil), 934 (*IgmpEnableDisableReply)(nil), 935 (*IgmpEvent)(nil), 936 (*IgmpGroupPrefixDetails)(nil), 937 (*IgmpGroupPrefixDump)(nil), 938 (*IgmpGroupPrefixSet)(nil), 939 (*IgmpGroupPrefixSetReply)(nil), 940 (*IgmpListen)(nil), 941 (*IgmpListenReply)(nil), 942 (*IgmpProxyDeviceAddDel)(nil), 943 (*IgmpProxyDeviceAddDelInterface)(nil), 944 (*IgmpProxyDeviceAddDelInterfaceReply)(nil), 945 (*IgmpProxyDeviceAddDelReply)(nil), 946 (*WantIgmpEvents)(nil), 947 (*WantIgmpEventsReply)(nil), 948 } 949 }