github.com/edwarnicke/govpp@v0.0.0-20230130211138-14ef5d20b1d0/binapi/ip_neighbor/ip_neighbor.ba.go (about) 1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT. 2 // versions: 3 // binapi-generator: v0.4.0-dev 4 // VPP: 23.02-rc0~189-g57127b32a 5 // source: /usr/share/vpp/api/core/ip_neighbor.api.json 6 7 // Package ip_neighbor contains generated bindings for API file ip_neighbor.api. 8 // 9 // Contents: 10 // 2 enums 11 // 1 struct 12 // 18 messages 13 // 14 package ip_neighbor 15 16 import ( 17 "strconv" 18 19 api "git.fd.io/govpp.git/api" 20 codec "git.fd.io/govpp.git/codec" 21 ethernet_types "github.com/edwarnicke/govpp/binapi/ethernet_types" 22 interface_types "github.com/edwarnicke/govpp/binapi/interface_types" 23 ip_types "github.com/edwarnicke/govpp/binapi/ip_types" 24 ) 25 26 // This is a compile-time assertion to ensure that this generated file 27 // is compatible with the GoVPP api package it is being compiled against. 28 // A compilation error at this line likely means your copy of the 29 // GoVPP api package needs to be updated. 30 const _ = api.GoVppAPIPackageIsVersion2 31 32 const ( 33 APIFile = "ip_neighbor" 34 APIVersion = "1.0.0" 35 VersionCrc = 0xfde4a69a 36 ) 37 38 // IPNeighborEventFlags defines enum 'ip_neighbor_event_flags'. 39 type IPNeighborEventFlags uint32 40 41 const ( 42 IP_NEIGHBOR_API_EVENT_FLAG_ADDED IPNeighborEventFlags = 1 43 IP_NEIGHBOR_API_EVENT_FLAG_REMOVED IPNeighborEventFlags = 2 44 ) 45 46 var ( 47 IPNeighborEventFlags_name = map[uint32]string{ 48 1: "IP_NEIGHBOR_API_EVENT_FLAG_ADDED", 49 2: "IP_NEIGHBOR_API_EVENT_FLAG_REMOVED", 50 } 51 IPNeighborEventFlags_value = map[string]uint32{ 52 "IP_NEIGHBOR_API_EVENT_FLAG_ADDED": 1, 53 "IP_NEIGHBOR_API_EVENT_FLAG_REMOVED": 2, 54 } 55 ) 56 57 func (x IPNeighborEventFlags) String() string { 58 s, ok := IPNeighborEventFlags_name[uint32(x)] 59 if ok { 60 return s 61 } 62 str := func(n uint32) string { 63 s, ok := IPNeighborEventFlags_name[uint32(n)] 64 if ok { 65 return s 66 } 67 return "IPNeighborEventFlags(" + strconv.Itoa(int(n)) + ")" 68 } 69 for i := uint32(0); i <= 32; i++ { 70 val := uint32(x) 71 if val&(1<<i) != 0 { 72 if s != "" { 73 s += "|" 74 } 75 s += str(1 << i) 76 } 77 } 78 if s == "" { 79 return str(uint32(x)) 80 } 81 return s 82 } 83 84 // IPNeighborFlags defines enum 'ip_neighbor_flags'. 85 type IPNeighborFlags uint8 86 87 const ( 88 IP_API_NEIGHBOR_FLAG_NONE IPNeighborFlags = 0 89 IP_API_NEIGHBOR_FLAG_STATIC IPNeighborFlags = 1 90 IP_API_NEIGHBOR_FLAG_NO_FIB_ENTRY IPNeighborFlags = 2 91 ) 92 93 var ( 94 IPNeighborFlags_name = map[uint8]string{ 95 0: "IP_API_NEIGHBOR_FLAG_NONE", 96 1: "IP_API_NEIGHBOR_FLAG_STATIC", 97 2: "IP_API_NEIGHBOR_FLAG_NO_FIB_ENTRY", 98 } 99 IPNeighborFlags_value = map[string]uint8{ 100 "IP_API_NEIGHBOR_FLAG_NONE": 0, 101 "IP_API_NEIGHBOR_FLAG_STATIC": 1, 102 "IP_API_NEIGHBOR_FLAG_NO_FIB_ENTRY": 2, 103 } 104 ) 105 106 func (x IPNeighborFlags) String() string { 107 s, ok := IPNeighborFlags_name[uint8(x)] 108 if ok { 109 return s 110 } 111 str := func(n uint8) string { 112 s, ok := IPNeighborFlags_name[uint8(n)] 113 if ok { 114 return s 115 } 116 return "IPNeighborFlags(" + strconv.Itoa(int(n)) + ")" 117 } 118 for i := uint8(0); i <= 8; i++ { 119 val := uint8(x) 120 if val&(1<<i) != 0 { 121 if s != "" { 122 s += "|" 123 } 124 s += str(1 << i) 125 } 126 } 127 if s == "" { 128 return str(uint8(x)) 129 } 130 return s 131 } 132 133 // IPNeighbor defines type 'ip_neighbor'. 134 type IPNeighbor struct { 135 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 136 Flags IPNeighborFlags `binapi:"ip_neighbor_flags,name=flags" json:"flags,omitempty"` 137 MacAddress ethernet_types.MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"` 138 IPAddress ip_types.Address `binapi:"address,name=ip_address" json:"ip_address,omitempty"` 139 } 140 141 // IPNeighborAddDel defines message 'ip_neighbor_add_del'. 142 type IPNeighborAddDel struct { 143 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` 144 Neighbor IPNeighbor `binapi:"ip_neighbor,name=neighbor" json:"neighbor,omitempty"` 145 } 146 147 func (m *IPNeighborAddDel) Reset() { *m = IPNeighborAddDel{} } 148 func (*IPNeighborAddDel) GetMessageName() string { return "ip_neighbor_add_del" } 149 func (*IPNeighborAddDel) GetCrcString() string { return "0607c257" } 150 func (*IPNeighborAddDel) GetMessageType() api.MessageType { 151 return api.RequestMessage 152 } 153 154 func (m *IPNeighborAddDel) Size() (size int) { 155 if m == nil { 156 return 0 157 } 158 size += 1 // m.IsAdd 159 size += 4 // m.Neighbor.SwIfIndex 160 size += 1 // m.Neighbor.Flags 161 size += 1 * 6 // m.Neighbor.MacAddress 162 size += 1 // m.Neighbor.IPAddress.Af 163 size += 1 * 16 // m.Neighbor.IPAddress.Un 164 return size 165 } 166 func (m *IPNeighborAddDel) Marshal(b []byte) ([]byte, error) { 167 if b == nil { 168 b = make([]byte, m.Size()) 169 } 170 buf := codec.NewBuffer(b) 171 buf.EncodeBool(m.IsAdd) 172 buf.EncodeUint32(uint32(m.Neighbor.SwIfIndex)) 173 buf.EncodeUint8(uint8(m.Neighbor.Flags)) 174 buf.EncodeBytes(m.Neighbor.MacAddress[:], 6) 175 buf.EncodeUint8(uint8(m.Neighbor.IPAddress.Af)) 176 buf.EncodeBytes(m.Neighbor.IPAddress.Un.XXX_UnionData[:], 16) 177 return buf.Bytes(), nil 178 } 179 func (m *IPNeighborAddDel) Unmarshal(b []byte) error { 180 buf := codec.NewBuffer(b) 181 m.IsAdd = buf.DecodeBool() 182 m.Neighbor.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 183 m.Neighbor.Flags = IPNeighborFlags(buf.DecodeUint8()) 184 copy(m.Neighbor.MacAddress[:], buf.DecodeBytes(6)) 185 m.Neighbor.IPAddress.Af = ip_types.AddressFamily(buf.DecodeUint8()) 186 copy(m.Neighbor.IPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 187 return nil 188 } 189 190 // IPNeighborAddDelReply defines message 'ip_neighbor_add_del_reply'. 191 type IPNeighborAddDelReply struct { 192 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 193 StatsIndex uint32 `binapi:"u32,name=stats_index" json:"stats_index,omitempty"` 194 } 195 196 func (m *IPNeighborAddDelReply) Reset() { *m = IPNeighborAddDelReply{} } 197 func (*IPNeighborAddDelReply) GetMessageName() string { return "ip_neighbor_add_del_reply" } 198 func (*IPNeighborAddDelReply) GetCrcString() string { return "1992deab" } 199 func (*IPNeighborAddDelReply) GetMessageType() api.MessageType { 200 return api.ReplyMessage 201 } 202 203 func (m *IPNeighborAddDelReply) Size() (size int) { 204 if m == nil { 205 return 0 206 } 207 size += 4 // m.Retval 208 size += 4 // m.StatsIndex 209 return size 210 } 211 func (m *IPNeighborAddDelReply) Marshal(b []byte) ([]byte, error) { 212 if b == nil { 213 b = make([]byte, m.Size()) 214 } 215 buf := codec.NewBuffer(b) 216 buf.EncodeInt32(m.Retval) 217 buf.EncodeUint32(m.StatsIndex) 218 return buf.Bytes(), nil 219 } 220 func (m *IPNeighborAddDelReply) Unmarshal(b []byte) error { 221 buf := codec.NewBuffer(b) 222 m.Retval = buf.DecodeInt32() 223 m.StatsIndex = buf.DecodeUint32() 224 return nil 225 } 226 227 // IPNeighborConfig defines message 'ip_neighbor_config'. 228 type IPNeighborConfig struct { 229 Af ip_types.AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"` 230 MaxNumber uint32 `binapi:"u32,name=max_number" json:"max_number,omitempty"` 231 MaxAge uint32 `binapi:"u32,name=max_age" json:"max_age,omitempty"` 232 Recycle bool `binapi:"bool,name=recycle" json:"recycle,omitempty"` 233 } 234 235 func (m *IPNeighborConfig) Reset() { *m = IPNeighborConfig{} } 236 func (*IPNeighborConfig) GetMessageName() string { return "ip_neighbor_config" } 237 func (*IPNeighborConfig) GetCrcString() string { return "f4a5cf44" } 238 func (*IPNeighborConfig) GetMessageType() api.MessageType { 239 return api.RequestMessage 240 } 241 242 func (m *IPNeighborConfig) Size() (size int) { 243 if m == nil { 244 return 0 245 } 246 size += 1 // m.Af 247 size += 4 // m.MaxNumber 248 size += 4 // m.MaxAge 249 size += 1 // m.Recycle 250 return size 251 } 252 func (m *IPNeighborConfig) Marshal(b []byte) ([]byte, error) { 253 if b == nil { 254 b = make([]byte, m.Size()) 255 } 256 buf := codec.NewBuffer(b) 257 buf.EncodeUint8(uint8(m.Af)) 258 buf.EncodeUint32(m.MaxNumber) 259 buf.EncodeUint32(m.MaxAge) 260 buf.EncodeBool(m.Recycle) 261 return buf.Bytes(), nil 262 } 263 func (m *IPNeighborConfig) Unmarshal(b []byte) error { 264 buf := codec.NewBuffer(b) 265 m.Af = ip_types.AddressFamily(buf.DecodeUint8()) 266 m.MaxNumber = buf.DecodeUint32() 267 m.MaxAge = buf.DecodeUint32() 268 m.Recycle = buf.DecodeBool() 269 return nil 270 } 271 272 // IPNeighborConfigReply defines message 'ip_neighbor_config_reply'. 273 type IPNeighborConfigReply struct { 274 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 275 } 276 277 func (m *IPNeighborConfigReply) Reset() { *m = IPNeighborConfigReply{} } 278 func (*IPNeighborConfigReply) GetMessageName() string { return "ip_neighbor_config_reply" } 279 func (*IPNeighborConfigReply) GetCrcString() string { return "e8d4e804" } 280 func (*IPNeighborConfigReply) GetMessageType() api.MessageType { 281 return api.ReplyMessage 282 } 283 284 func (m *IPNeighborConfigReply) Size() (size int) { 285 if m == nil { 286 return 0 287 } 288 size += 4 // m.Retval 289 return size 290 } 291 func (m *IPNeighborConfigReply) Marshal(b []byte) ([]byte, error) { 292 if b == nil { 293 b = make([]byte, m.Size()) 294 } 295 buf := codec.NewBuffer(b) 296 buf.EncodeInt32(m.Retval) 297 return buf.Bytes(), nil 298 } 299 func (m *IPNeighborConfigReply) Unmarshal(b []byte) error { 300 buf := codec.NewBuffer(b) 301 m.Retval = buf.DecodeInt32() 302 return nil 303 } 304 305 // IPNeighborDetails defines message 'ip_neighbor_details'. 306 type IPNeighborDetails struct { 307 Age float64 `binapi:"f64,name=age" json:"age,omitempty"` 308 Neighbor IPNeighbor `binapi:"ip_neighbor,name=neighbor" json:"neighbor,omitempty"` 309 } 310 311 func (m *IPNeighborDetails) Reset() { *m = IPNeighborDetails{} } 312 func (*IPNeighborDetails) GetMessageName() string { return "ip_neighbor_details" } 313 func (*IPNeighborDetails) GetCrcString() string { return "e29d79f0" } 314 func (*IPNeighborDetails) GetMessageType() api.MessageType { 315 return api.ReplyMessage 316 } 317 318 func (m *IPNeighborDetails) Size() (size int) { 319 if m == nil { 320 return 0 321 } 322 size += 8 // m.Age 323 size += 4 // m.Neighbor.SwIfIndex 324 size += 1 // m.Neighbor.Flags 325 size += 1 * 6 // m.Neighbor.MacAddress 326 size += 1 // m.Neighbor.IPAddress.Af 327 size += 1 * 16 // m.Neighbor.IPAddress.Un 328 return size 329 } 330 func (m *IPNeighborDetails) Marshal(b []byte) ([]byte, error) { 331 if b == nil { 332 b = make([]byte, m.Size()) 333 } 334 buf := codec.NewBuffer(b) 335 buf.EncodeFloat64(m.Age) 336 buf.EncodeUint32(uint32(m.Neighbor.SwIfIndex)) 337 buf.EncodeUint8(uint8(m.Neighbor.Flags)) 338 buf.EncodeBytes(m.Neighbor.MacAddress[:], 6) 339 buf.EncodeUint8(uint8(m.Neighbor.IPAddress.Af)) 340 buf.EncodeBytes(m.Neighbor.IPAddress.Un.XXX_UnionData[:], 16) 341 return buf.Bytes(), nil 342 } 343 func (m *IPNeighborDetails) Unmarshal(b []byte) error { 344 buf := codec.NewBuffer(b) 345 m.Age = buf.DecodeFloat64() 346 m.Neighbor.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 347 m.Neighbor.Flags = IPNeighborFlags(buf.DecodeUint8()) 348 copy(m.Neighbor.MacAddress[:], buf.DecodeBytes(6)) 349 m.Neighbor.IPAddress.Af = ip_types.AddressFamily(buf.DecodeUint8()) 350 copy(m.Neighbor.IPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 351 return nil 352 } 353 354 // IPNeighborDump defines message 'ip_neighbor_dump'. 355 type IPNeighborDump struct { 356 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"` 357 Af ip_types.AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"` 358 } 359 360 func (m *IPNeighborDump) Reset() { *m = IPNeighborDump{} } 361 func (*IPNeighborDump) GetMessageName() string { return "ip_neighbor_dump" } 362 func (*IPNeighborDump) GetCrcString() string { return "d817a484" } 363 func (*IPNeighborDump) GetMessageType() api.MessageType { 364 return api.RequestMessage 365 } 366 367 func (m *IPNeighborDump) Size() (size int) { 368 if m == nil { 369 return 0 370 } 371 size += 4 // m.SwIfIndex 372 size += 1 // m.Af 373 return size 374 } 375 func (m *IPNeighborDump) Marshal(b []byte) ([]byte, error) { 376 if b == nil { 377 b = make([]byte, m.Size()) 378 } 379 buf := codec.NewBuffer(b) 380 buf.EncodeUint32(uint32(m.SwIfIndex)) 381 buf.EncodeUint8(uint8(m.Af)) 382 return buf.Bytes(), nil 383 } 384 func (m *IPNeighborDump) Unmarshal(b []byte) error { 385 buf := codec.NewBuffer(b) 386 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 387 m.Af = ip_types.AddressFamily(buf.DecodeUint8()) 388 return nil 389 } 390 391 // IPNeighborEvent defines message 'ip_neighbor_event'. 392 // Deprecated: the message will be removed in the future versions 393 type IPNeighborEvent struct { 394 PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"` 395 Neighbor IPNeighbor `binapi:"ip_neighbor,name=neighbor" json:"neighbor,omitempty"` 396 } 397 398 func (m *IPNeighborEvent) Reset() { *m = IPNeighborEvent{} } 399 func (*IPNeighborEvent) GetMessageName() string { return "ip_neighbor_event" } 400 func (*IPNeighborEvent) GetCrcString() string { return "bdb092b2" } 401 func (*IPNeighborEvent) GetMessageType() api.MessageType { 402 return api.EventMessage 403 } 404 405 func (m *IPNeighborEvent) Size() (size int) { 406 if m == nil { 407 return 0 408 } 409 size += 4 // m.PID 410 size += 4 // m.Neighbor.SwIfIndex 411 size += 1 // m.Neighbor.Flags 412 size += 1 * 6 // m.Neighbor.MacAddress 413 size += 1 // m.Neighbor.IPAddress.Af 414 size += 1 * 16 // m.Neighbor.IPAddress.Un 415 return size 416 } 417 func (m *IPNeighborEvent) Marshal(b []byte) ([]byte, error) { 418 if b == nil { 419 b = make([]byte, m.Size()) 420 } 421 buf := codec.NewBuffer(b) 422 buf.EncodeUint32(m.PID) 423 buf.EncodeUint32(uint32(m.Neighbor.SwIfIndex)) 424 buf.EncodeUint8(uint8(m.Neighbor.Flags)) 425 buf.EncodeBytes(m.Neighbor.MacAddress[:], 6) 426 buf.EncodeUint8(uint8(m.Neighbor.IPAddress.Af)) 427 buf.EncodeBytes(m.Neighbor.IPAddress.Un.XXX_UnionData[:], 16) 428 return buf.Bytes(), nil 429 } 430 func (m *IPNeighborEvent) Unmarshal(b []byte) error { 431 buf := codec.NewBuffer(b) 432 m.PID = buf.DecodeUint32() 433 m.Neighbor.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 434 m.Neighbor.Flags = IPNeighborFlags(buf.DecodeUint8()) 435 copy(m.Neighbor.MacAddress[:], buf.DecodeBytes(6)) 436 m.Neighbor.IPAddress.Af = ip_types.AddressFamily(buf.DecodeUint8()) 437 copy(m.Neighbor.IPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 438 return nil 439 } 440 441 // IPNeighborEventV2 defines message 'ip_neighbor_event_v2'. 442 type IPNeighborEventV2 struct { 443 PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"` 444 Flags IPNeighborEventFlags `binapi:"ip_neighbor_event_flags,name=flags" json:"flags,omitempty"` 445 Neighbor IPNeighbor `binapi:"ip_neighbor,name=neighbor" json:"neighbor,omitempty"` 446 } 447 448 func (m *IPNeighborEventV2) Reset() { *m = IPNeighborEventV2{} } 449 func (*IPNeighborEventV2) GetMessageName() string { return "ip_neighbor_event_v2" } 450 func (*IPNeighborEventV2) GetCrcString() string { return "c1d53dc0" } 451 func (*IPNeighborEventV2) GetMessageType() api.MessageType { 452 return api.EventMessage 453 } 454 455 func (m *IPNeighborEventV2) Size() (size int) { 456 if m == nil { 457 return 0 458 } 459 size += 4 // m.PID 460 size += 4 // m.Flags 461 size += 4 // m.Neighbor.SwIfIndex 462 size += 1 // m.Neighbor.Flags 463 size += 1 * 6 // m.Neighbor.MacAddress 464 size += 1 // m.Neighbor.IPAddress.Af 465 size += 1 * 16 // m.Neighbor.IPAddress.Un 466 return size 467 } 468 func (m *IPNeighborEventV2) Marshal(b []byte) ([]byte, error) { 469 if b == nil { 470 b = make([]byte, m.Size()) 471 } 472 buf := codec.NewBuffer(b) 473 buf.EncodeUint32(m.PID) 474 buf.EncodeUint32(uint32(m.Flags)) 475 buf.EncodeUint32(uint32(m.Neighbor.SwIfIndex)) 476 buf.EncodeUint8(uint8(m.Neighbor.Flags)) 477 buf.EncodeBytes(m.Neighbor.MacAddress[:], 6) 478 buf.EncodeUint8(uint8(m.Neighbor.IPAddress.Af)) 479 buf.EncodeBytes(m.Neighbor.IPAddress.Un.XXX_UnionData[:], 16) 480 return buf.Bytes(), nil 481 } 482 func (m *IPNeighborEventV2) Unmarshal(b []byte) error { 483 buf := codec.NewBuffer(b) 484 m.PID = buf.DecodeUint32() 485 m.Flags = IPNeighborEventFlags(buf.DecodeUint32()) 486 m.Neighbor.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 487 m.Neighbor.Flags = IPNeighborFlags(buf.DecodeUint8()) 488 copy(m.Neighbor.MacAddress[:], buf.DecodeBytes(6)) 489 m.Neighbor.IPAddress.Af = ip_types.AddressFamily(buf.DecodeUint8()) 490 copy(m.Neighbor.IPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 491 return nil 492 } 493 494 // IPNeighborFlush defines message 'ip_neighbor_flush'. 495 type IPNeighborFlush struct { 496 Af ip_types.AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"` 497 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"` 498 } 499 500 func (m *IPNeighborFlush) Reset() { *m = IPNeighborFlush{} } 501 func (*IPNeighborFlush) GetMessageName() string { return "ip_neighbor_flush" } 502 func (*IPNeighborFlush) GetCrcString() string { return "16aa35d2" } 503 func (*IPNeighborFlush) GetMessageType() api.MessageType { 504 return api.RequestMessage 505 } 506 507 func (m *IPNeighborFlush) Size() (size int) { 508 if m == nil { 509 return 0 510 } 511 size += 1 // m.Af 512 size += 4 // m.SwIfIndex 513 return size 514 } 515 func (m *IPNeighborFlush) Marshal(b []byte) ([]byte, error) { 516 if b == nil { 517 b = make([]byte, m.Size()) 518 } 519 buf := codec.NewBuffer(b) 520 buf.EncodeUint8(uint8(m.Af)) 521 buf.EncodeUint32(uint32(m.SwIfIndex)) 522 return buf.Bytes(), nil 523 } 524 func (m *IPNeighborFlush) Unmarshal(b []byte) error { 525 buf := codec.NewBuffer(b) 526 m.Af = ip_types.AddressFamily(buf.DecodeUint8()) 527 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 528 return nil 529 } 530 531 // IPNeighborFlushReply defines message 'ip_neighbor_flush_reply'. 532 type IPNeighborFlushReply struct { 533 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 534 } 535 536 func (m *IPNeighborFlushReply) Reset() { *m = IPNeighborFlushReply{} } 537 func (*IPNeighborFlushReply) GetMessageName() string { return "ip_neighbor_flush_reply" } 538 func (*IPNeighborFlushReply) GetCrcString() string { return "e8d4e804" } 539 func (*IPNeighborFlushReply) GetMessageType() api.MessageType { 540 return api.ReplyMessage 541 } 542 543 func (m *IPNeighborFlushReply) Size() (size int) { 544 if m == nil { 545 return 0 546 } 547 size += 4 // m.Retval 548 return size 549 } 550 func (m *IPNeighborFlushReply) Marshal(b []byte) ([]byte, error) { 551 if b == nil { 552 b = make([]byte, m.Size()) 553 } 554 buf := codec.NewBuffer(b) 555 buf.EncodeInt32(m.Retval) 556 return buf.Bytes(), nil 557 } 558 func (m *IPNeighborFlushReply) Unmarshal(b []byte) error { 559 buf := codec.NewBuffer(b) 560 m.Retval = buf.DecodeInt32() 561 return nil 562 } 563 564 // IPNeighborReplaceBegin defines message 'ip_neighbor_replace_begin'. 565 type IPNeighborReplaceBegin struct{} 566 567 func (m *IPNeighborReplaceBegin) Reset() { *m = IPNeighborReplaceBegin{} } 568 func (*IPNeighborReplaceBegin) GetMessageName() string { return "ip_neighbor_replace_begin" } 569 func (*IPNeighborReplaceBegin) GetCrcString() string { return "51077d14" } 570 func (*IPNeighborReplaceBegin) GetMessageType() api.MessageType { 571 return api.RequestMessage 572 } 573 574 func (m *IPNeighborReplaceBegin) Size() (size int) { 575 if m == nil { 576 return 0 577 } 578 return size 579 } 580 func (m *IPNeighborReplaceBegin) Marshal(b []byte) ([]byte, error) { 581 if b == nil { 582 b = make([]byte, m.Size()) 583 } 584 buf := codec.NewBuffer(b) 585 return buf.Bytes(), nil 586 } 587 func (m *IPNeighborReplaceBegin) Unmarshal(b []byte) error { 588 return nil 589 } 590 591 // IPNeighborReplaceBeginReply defines message 'ip_neighbor_replace_begin_reply'. 592 type IPNeighborReplaceBeginReply struct { 593 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 594 } 595 596 func (m *IPNeighborReplaceBeginReply) Reset() { *m = IPNeighborReplaceBeginReply{} } 597 func (*IPNeighborReplaceBeginReply) GetMessageName() string { return "ip_neighbor_replace_begin_reply" } 598 func (*IPNeighborReplaceBeginReply) GetCrcString() string { return "e8d4e804" } 599 func (*IPNeighborReplaceBeginReply) GetMessageType() api.MessageType { 600 return api.ReplyMessage 601 } 602 603 func (m *IPNeighborReplaceBeginReply) Size() (size int) { 604 if m == nil { 605 return 0 606 } 607 size += 4 // m.Retval 608 return size 609 } 610 func (m *IPNeighborReplaceBeginReply) Marshal(b []byte) ([]byte, error) { 611 if b == nil { 612 b = make([]byte, m.Size()) 613 } 614 buf := codec.NewBuffer(b) 615 buf.EncodeInt32(m.Retval) 616 return buf.Bytes(), nil 617 } 618 func (m *IPNeighborReplaceBeginReply) Unmarshal(b []byte) error { 619 buf := codec.NewBuffer(b) 620 m.Retval = buf.DecodeInt32() 621 return nil 622 } 623 624 // IPNeighborReplaceEnd defines message 'ip_neighbor_replace_end'. 625 type IPNeighborReplaceEnd struct{} 626 627 func (m *IPNeighborReplaceEnd) Reset() { *m = IPNeighborReplaceEnd{} } 628 func (*IPNeighborReplaceEnd) GetMessageName() string { return "ip_neighbor_replace_end" } 629 func (*IPNeighborReplaceEnd) GetCrcString() string { return "51077d14" } 630 func (*IPNeighborReplaceEnd) GetMessageType() api.MessageType { 631 return api.RequestMessage 632 } 633 634 func (m *IPNeighborReplaceEnd) Size() (size int) { 635 if m == nil { 636 return 0 637 } 638 return size 639 } 640 func (m *IPNeighborReplaceEnd) Marshal(b []byte) ([]byte, error) { 641 if b == nil { 642 b = make([]byte, m.Size()) 643 } 644 buf := codec.NewBuffer(b) 645 return buf.Bytes(), nil 646 } 647 func (m *IPNeighborReplaceEnd) Unmarshal(b []byte) error { 648 return nil 649 } 650 651 // IPNeighborReplaceEndReply defines message 'ip_neighbor_replace_end_reply'. 652 type IPNeighborReplaceEndReply struct { 653 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 654 } 655 656 func (m *IPNeighborReplaceEndReply) Reset() { *m = IPNeighborReplaceEndReply{} } 657 func (*IPNeighborReplaceEndReply) GetMessageName() string { return "ip_neighbor_replace_end_reply" } 658 func (*IPNeighborReplaceEndReply) GetCrcString() string { return "e8d4e804" } 659 func (*IPNeighborReplaceEndReply) GetMessageType() api.MessageType { 660 return api.ReplyMessage 661 } 662 663 func (m *IPNeighborReplaceEndReply) Size() (size int) { 664 if m == nil { 665 return 0 666 } 667 size += 4 // m.Retval 668 return size 669 } 670 func (m *IPNeighborReplaceEndReply) Marshal(b []byte) ([]byte, error) { 671 if b == nil { 672 b = make([]byte, m.Size()) 673 } 674 buf := codec.NewBuffer(b) 675 buf.EncodeInt32(m.Retval) 676 return buf.Bytes(), nil 677 } 678 func (m *IPNeighborReplaceEndReply) Unmarshal(b []byte) error { 679 buf := codec.NewBuffer(b) 680 m.Retval = buf.DecodeInt32() 681 return nil 682 } 683 684 // WantIPNeighborEvents defines message 'want_ip_neighbor_events'. 685 // Deprecated: the message will be removed in the future versions 686 type WantIPNeighborEvents struct { 687 Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"` 688 PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"` 689 IP ip_types.Address `binapi:"address,name=ip" json:"ip,omitempty"` 690 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"` 691 } 692 693 func (m *WantIPNeighborEvents) Reset() { *m = WantIPNeighborEvents{} } 694 func (*WantIPNeighborEvents) GetMessageName() string { return "want_ip_neighbor_events" } 695 func (*WantIPNeighborEvents) GetCrcString() string { return "73e70a86" } 696 func (*WantIPNeighborEvents) GetMessageType() api.MessageType { 697 return api.RequestMessage 698 } 699 700 func (m *WantIPNeighborEvents) Size() (size int) { 701 if m == nil { 702 return 0 703 } 704 size += 1 // m.Enable 705 size += 4 // m.PID 706 size += 1 // m.IP.Af 707 size += 1 * 16 // m.IP.Un 708 size += 4 // m.SwIfIndex 709 return size 710 } 711 func (m *WantIPNeighborEvents) Marshal(b []byte) ([]byte, error) { 712 if b == nil { 713 b = make([]byte, m.Size()) 714 } 715 buf := codec.NewBuffer(b) 716 buf.EncodeBool(m.Enable) 717 buf.EncodeUint32(m.PID) 718 buf.EncodeUint8(uint8(m.IP.Af)) 719 buf.EncodeBytes(m.IP.Un.XXX_UnionData[:], 16) 720 buf.EncodeUint32(uint32(m.SwIfIndex)) 721 return buf.Bytes(), nil 722 } 723 func (m *WantIPNeighborEvents) Unmarshal(b []byte) error { 724 buf := codec.NewBuffer(b) 725 m.Enable = buf.DecodeBool() 726 m.PID = buf.DecodeUint32() 727 m.IP.Af = ip_types.AddressFamily(buf.DecodeUint8()) 728 copy(m.IP.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 729 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 730 return nil 731 } 732 733 // WantIPNeighborEventsReply defines message 'want_ip_neighbor_events_reply'. 734 // Deprecated: the message will be removed in the future versions 735 type WantIPNeighborEventsReply struct { 736 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 737 } 738 739 func (m *WantIPNeighborEventsReply) Reset() { *m = WantIPNeighborEventsReply{} } 740 func (*WantIPNeighborEventsReply) GetMessageName() string { return "want_ip_neighbor_events_reply" } 741 func (*WantIPNeighborEventsReply) GetCrcString() string { return "e8d4e804" } 742 func (*WantIPNeighborEventsReply) GetMessageType() api.MessageType { 743 return api.ReplyMessage 744 } 745 746 func (m *WantIPNeighborEventsReply) Size() (size int) { 747 if m == nil { 748 return 0 749 } 750 size += 4 // m.Retval 751 return size 752 } 753 func (m *WantIPNeighborEventsReply) Marshal(b []byte) ([]byte, error) { 754 if b == nil { 755 b = make([]byte, m.Size()) 756 } 757 buf := codec.NewBuffer(b) 758 buf.EncodeInt32(m.Retval) 759 return buf.Bytes(), nil 760 } 761 func (m *WantIPNeighborEventsReply) Unmarshal(b []byte) error { 762 buf := codec.NewBuffer(b) 763 m.Retval = buf.DecodeInt32() 764 return nil 765 } 766 767 // WantIPNeighborEventsV2 defines message 'want_ip_neighbor_events_v2'. 768 type WantIPNeighborEventsV2 struct { 769 Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"` 770 PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"` 771 IP ip_types.Address `binapi:"address,name=ip" json:"ip,omitempty"` 772 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"` 773 } 774 775 func (m *WantIPNeighborEventsV2) Reset() { *m = WantIPNeighborEventsV2{} } 776 func (*WantIPNeighborEventsV2) GetMessageName() string { return "want_ip_neighbor_events_v2" } 777 func (*WantIPNeighborEventsV2) GetCrcString() string { return "73e70a86" } 778 func (*WantIPNeighborEventsV2) GetMessageType() api.MessageType { 779 return api.RequestMessage 780 } 781 782 func (m *WantIPNeighborEventsV2) Size() (size int) { 783 if m == nil { 784 return 0 785 } 786 size += 1 // m.Enable 787 size += 4 // m.PID 788 size += 1 // m.IP.Af 789 size += 1 * 16 // m.IP.Un 790 size += 4 // m.SwIfIndex 791 return size 792 } 793 func (m *WantIPNeighborEventsV2) Marshal(b []byte) ([]byte, error) { 794 if b == nil { 795 b = make([]byte, m.Size()) 796 } 797 buf := codec.NewBuffer(b) 798 buf.EncodeBool(m.Enable) 799 buf.EncodeUint32(m.PID) 800 buf.EncodeUint8(uint8(m.IP.Af)) 801 buf.EncodeBytes(m.IP.Un.XXX_UnionData[:], 16) 802 buf.EncodeUint32(uint32(m.SwIfIndex)) 803 return buf.Bytes(), nil 804 } 805 func (m *WantIPNeighborEventsV2) Unmarshal(b []byte) error { 806 buf := codec.NewBuffer(b) 807 m.Enable = buf.DecodeBool() 808 m.PID = buf.DecodeUint32() 809 m.IP.Af = ip_types.AddressFamily(buf.DecodeUint8()) 810 copy(m.IP.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 811 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 812 return nil 813 } 814 815 // WantIPNeighborEventsV2Reply defines message 'want_ip_neighbor_events_v2_reply'. 816 type WantIPNeighborEventsV2Reply struct { 817 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 818 } 819 820 func (m *WantIPNeighborEventsV2Reply) Reset() { *m = WantIPNeighborEventsV2Reply{} } 821 func (*WantIPNeighborEventsV2Reply) GetMessageName() string { 822 return "want_ip_neighbor_events_v2_reply" 823 } 824 func (*WantIPNeighborEventsV2Reply) GetCrcString() string { return "e8d4e804" } 825 func (*WantIPNeighborEventsV2Reply) GetMessageType() api.MessageType { 826 return api.ReplyMessage 827 } 828 829 func (m *WantIPNeighborEventsV2Reply) Size() (size int) { 830 if m == nil { 831 return 0 832 } 833 size += 4 // m.Retval 834 return size 835 } 836 func (m *WantIPNeighborEventsV2Reply) Marshal(b []byte) ([]byte, error) { 837 if b == nil { 838 b = make([]byte, m.Size()) 839 } 840 buf := codec.NewBuffer(b) 841 buf.EncodeInt32(m.Retval) 842 return buf.Bytes(), nil 843 } 844 func (m *WantIPNeighborEventsV2Reply) Unmarshal(b []byte) error { 845 buf := codec.NewBuffer(b) 846 m.Retval = buf.DecodeInt32() 847 return nil 848 } 849 850 func init() { file_ip_neighbor_binapi_init() } 851 func file_ip_neighbor_binapi_init() { 852 api.RegisterMessage((*IPNeighborAddDel)(nil), "ip_neighbor_add_del_0607c257") 853 api.RegisterMessage((*IPNeighborAddDelReply)(nil), "ip_neighbor_add_del_reply_1992deab") 854 api.RegisterMessage((*IPNeighborConfig)(nil), "ip_neighbor_config_f4a5cf44") 855 api.RegisterMessage((*IPNeighborConfigReply)(nil), "ip_neighbor_config_reply_e8d4e804") 856 api.RegisterMessage((*IPNeighborDetails)(nil), "ip_neighbor_details_e29d79f0") 857 api.RegisterMessage((*IPNeighborDump)(nil), "ip_neighbor_dump_d817a484") 858 api.RegisterMessage((*IPNeighborEvent)(nil), "ip_neighbor_event_bdb092b2") 859 api.RegisterMessage((*IPNeighborEventV2)(nil), "ip_neighbor_event_v2_c1d53dc0") 860 api.RegisterMessage((*IPNeighborFlush)(nil), "ip_neighbor_flush_16aa35d2") 861 api.RegisterMessage((*IPNeighborFlushReply)(nil), "ip_neighbor_flush_reply_e8d4e804") 862 api.RegisterMessage((*IPNeighborReplaceBegin)(nil), "ip_neighbor_replace_begin_51077d14") 863 api.RegisterMessage((*IPNeighborReplaceBeginReply)(nil), "ip_neighbor_replace_begin_reply_e8d4e804") 864 api.RegisterMessage((*IPNeighborReplaceEnd)(nil), "ip_neighbor_replace_end_51077d14") 865 api.RegisterMessage((*IPNeighborReplaceEndReply)(nil), "ip_neighbor_replace_end_reply_e8d4e804") 866 api.RegisterMessage((*WantIPNeighborEvents)(nil), "want_ip_neighbor_events_73e70a86") 867 api.RegisterMessage((*WantIPNeighborEventsReply)(nil), "want_ip_neighbor_events_reply_e8d4e804") 868 api.RegisterMessage((*WantIPNeighborEventsV2)(nil), "want_ip_neighbor_events_v2_73e70a86") 869 api.RegisterMessage((*WantIPNeighborEventsV2Reply)(nil), "want_ip_neighbor_events_v2_reply_e8d4e804") 870 } 871 872 // Messages returns list of all messages in this module. 873 func AllMessages() []api.Message { 874 return []api.Message{ 875 (*IPNeighborAddDel)(nil), 876 (*IPNeighborAddDelReply)(nil), 877 (*IPNeighborConfig)(nil), 878 (*IPNeighborConfigReply)(nil), 879 (*IPNeighborDetails)(nil), 880 (*IPNeighborDump)(nil), 881 (*IPNeighborEvent)(nil), 882 (*IPNeighborEventV2)(nil), 883 (*IPNeighborFlush)(nil), 884 (*IPNeighborFlushReply)(nil), 885 (*IPNeighborReplaceBegin)(nil), 886 (*IPNeighborReplaceBeginReply)(nil), 887 (*IPNeighborReplaceEnd)(nil), 888 (*IPNeighborReplaceEndReply)(nil), 889 (*WantIPNeighborEvents)(nil), 890 (*WantIPNeighborEventsReply)(nil), 891 (*WantIPNeighborEventsV2)(nil), 892 (*WantIPNeighborEventsV2Reply)(nil), 893 } 894 }