github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/vrrp/vrrp.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/vrrp.api.json 6 7 // Package vrrp contains generated bindings for API file vrrp.api. 8 // 9 // Contents: 10 // - 2 enums 11 // - 5 structs 12 // - 21 messages 13 package vrrp 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 = "vrrp" 33 APIVersion = "1.1.1" 34 VersionCrc = 0x674aea12 35 ) 36 37 // VrrpVrFlags defines enum 'vrrp_vr_flags'. 38 type VrrpVrFlags uint32 39 40 const ( 41 VRRP_API_VR_PREEMPT VrrpVrFlags = 1 42 VRRP_API_VR_ACCEPT VrrpVrFlags = 2 43 VRRP_API_VR_UNICAST VrrpVrFlags = 4 44 VRRP_API_VR_IPV6 VrrpVrFlags = 8 45 ) 46 47 var ( 48 VrrpVrFlags_name = map[uint32]string{ 49 1: "VRRP_API_VR_PREEMPT", 50 2: "VRRP_API_VR_ACCEPT", 51 4: "VRRP_API_VR_UNICAST", 52 8: "VRRP_API_VR_IPV6", 53 } 54 VrrpVrFlags_value = map[string]uint32{ 55 "VRRP_API_VR_PREEMPT": 1, 56 "VRRP_API_VR_ACCEPT": 2, 57 "VRRP_API_VR_UNICAST": 4, 58 "VRRP_API_VR_IPV6": 8, 59 } 60 ) 61 62 func (x VrrpVrFlags) String() string { 63 s, ok := VrrpVrFlags_name[uint32(x)] 64 if ok { 65 return s 66 } 67 str := func(n uint32) string { 68 s, ok := VrrpVrFlags_name[uint32(n)] 69 if ok { 70 return s 71 } 72 return "VrrpVrFlags(" + strconv.Itoa(int(n)) + ")" 73 } 74 for i := uint32(0); i <= 32; i++ { 75 val := uint32(x) 76 if val&(1<<i) != 0 { 77 if s != "" { 78 s += "|" 79 } 80 s += str(1 << i) 81 } 82 } 83 if s == "" { 84 return str(uint32(x)) 85 } 86 return s 87 } 88 89 // VrrpVrState defines enum 'vrrp_vr_state'. 90 type VrrpVrState uint32 91 92 const ( 93 VRRP_API_VR_STATE_INIT VrrpVrState = 0 94 VRRP_API_VR_STATE_BACKUP VrrpVrState = 1 95 VRRP_API_VR_STATE_MASTER VrrpVrState = 2 96 VRRP_API_VR_STATE_INTF_DOWN VrrpVrState = 3 97 ) 98 99 var ( 100 VrrpVrState_name = map[uint32]string{ 101 0: "VRRP_API_VR_STATE_INIT", 102 1: "VRRP_API_VR_STATE_BACKUP", 103 2: "VRRP_API_VR_STATE_MASTER", 104 3: "VRRP_API_VR_STATE_INTF_DOWN", 105 } 106 VrrpVrState_value = map[string]uint32{ 107 "VRRP_API_VR_STATE_INIT": 0, 108 "VRRP_API_VR_STATE_BACKUP": 1, 109 "VRRP_API_VR_STATE_MASTER": 2, 110 "VRRP_API_VR_STATE_INTF_DOWN": 3, 111 } 112 ) 113 114 func (x VrrpVrState) String() string { 115 s, ok := VrrpVrState_name[uint32(x)] 116 if ok { 117 return s 118 } 119 return "VrrpVrState(" + strconv.Itoa(int(x)) + ")" 120 } 121 122 // VrrpVrConf defines type 'vrrp_vr_conf'. 123 type VrrpVrConf struct { 124 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 125 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"` 126 Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"` 127 Interval uint16 `binapi:"u16,name=interval" json:"interval,omitempty"` 128 Flags VrrpVrFlags `binapi:"vrrp_vr_flags,name=flags" json:"flags,omitempty"` 129 } 130 131 // VrrpVrKey defines type 'vrrp_vr_key'. 132 type VrrpVrKey struct { 133 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 134 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"` 135 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"` 136 } 137 138 // VrrpVrRuntime defines type 'vrrp_vr_runtime'. 139 type VrrpVrRuntime struct { 140 State VrrpVrState `binapi:"vrrp_vr_state,name=state" json:"state,omitempty"` 141 MasterAdvInt uint16 `binapi:"u16,name=master_adv_int" json:"master_adv_int,omitempty"` 142 Skew uint16 `binapi:"u16,name=skew" json:"skew,omitempty"` 143 MasterDownInt uint16 `binapi:"u16,name=master_down_int" json:"master_down_int,omitempty"` 144 Mac ethernet_types.MacAddress `binapi:"mac_address,name=mac" json:"mac,omitempty"` 145 Tracking VrrpVrTracking `binapi:"vrrp_vr_tracking,name=tracking" json:"tracking,omitempty"` 146 } 147 148 // VrrpVrTrackIf defines type 'vrrp_vr_track_if'. 149 type VrrpVrTrackIf struct { 150 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 151 Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"` 152 } 153 154 // VrrpVrTracking defines type 'vrrp_vr_tracking'. 155 type VrrpVrTracking struct { 156 InterfacesDec uint32 `binapi:"u32,name=interfaces_dec" json:"interfaces_dec,omitempty"` 157 Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"` 158 } 159 160 // VRRP: Add or delete a VRRP virtual router 161 // - is_add - 0 if deleting, != 0 if adding 162 // - sw_if_index - interface backed up by this vr 163 // - vr_id - the VR ID advertised by this vr 164 // - priority - the priority advertised for this vr 165 // - interval - interval between advertisements in centiseconds 166 // - flags - bit flags for booleans - preempt, accept, unicast, ipv6 167 // - n_addrs - number of addresses being backed up by this vr 168 // - addrs - the addresses backed up by this vr 169 // 170 // VrrpVrAddDel defines message 'vrrp_vr_add_del'. 171 type VrrpVrAddDel struct { 172 IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"` 173 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 174 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"` 175 Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"` 176 Interval uint16 `binapi:"u16,name=interval" json:"interval,omitempty"` 177 Flags VrrpVrFlags `binapi:"vrrp_vr_flags,name=flags" json:"flags,omitempty"` 178 NAddrs uint8 `binapi:"u8,name=n_addrs" json:"-"` 179 Addrs []ip_types.Address `binapi:"address[n_addrs],name=addrs" json:"addrs,omitempty"` 180 } 181 182 func (m *VrrpVrAddDel) Reset() { *m = VrrpVrAddDel{} } 183 func (*VrrpVrAddDel) GetMessageName() string { return "vrrp_vr_add_del" } 184 func (*VrrpVrAddDel) GetCrcString() string { return "c5cf15aa" } 185 func (*VrrpVrAddDel) GetMessageType() api.MessageType { 186 return api.RequestMessage 187 } 188 189 func (m *VrrpVrAddDel) Size() (size int) { 190 if m == nil { 191 return 0 192 } 193 size += 1 // m.IsAdd 194 size += 4 // m.SwIfIndex 195 size += 1 // m.VrID 196 size += 1 // m.Priority 197 size += 2 // m.Interval 198 size += 4 // m.Flags 199 size += 1 // m.NAddrs 200 for j1 := 0; j1 < len(m.Addrs); j1++ { 201 var s1 ip_types.Address 202 _ = s1 203 if j1 < len(m.Addrs) { 204 s1 = m.Addrs[j1] 205 } 206 size += 1 // s1.Af 207 size += 1 * 16 // s1.Un 208 } 209 return size 210 } 211 func (m *VrrpVrAddDel) Marshal(b []byte) ([]byte, error) { 212 if b == nil { 213 b = make([]byte, m.Size()) 214 } 215 buf := codec.NewBuffer(b) 216 buf.EncodeUint8(m.IsAdd) 217 buf.EncodeUint32(uint32(m.SwIfIndex)) 218 buf.EncodeUint8(m.VrID) 219 buf.EncodeUint8(m.Priority) 220 buf.EncodeUint16(m.Interval) 221 buf.EncodeUint32(uint32(m.Flags)) 222 buf.EncodeUint8(uint8(len(m.Addrs))) 223 for j0 := 0; j0 < len(m.Addrs); j0++ { 224 var v0 ip_types.Address // Addrs 225 if j0 < len(m.Addrs) { 226 v0 = m.Addrs[j0] 227 } 228 buf.EncodeUint8(uint8(v0.Af)) 229 buf.EncodeBytes(v0.Un.XXX_UnionData[:], 16) 230 } 231 return buf.Bytes(), nil 232 } 233 func (m *VrrpVrAddDel) Unmarshal(b []byte) error { 234 buf := codec.NewBuffer(b) 235 m.IsAdd = buf.DecodeUint8() 236 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 237 m.VrID = buf.DecodeUint8() 238 m.Priority = buf.DecodeUint8() 239 m.Interval = buf.DecodeUint16() 240 m.Flags = VrrpVrFlags(buf.DecodeUint32()) 241 m.NAddrs = buf.DecodeUint8() 242 m.Addrs = make([]ip_types.Address, m.NAddrs) 243 for j0 := 0; j0 < len(m.Addrs); j0++ { 244 m.Addrs[j0].Af = ip_types.AddressFamily(buf.DecodeUint8()) 245 copy(m.Addrs[j0].Un.XXX_UnionData[:], buf.DecodeBytes(16)) 246 } 247 return nil 248 } 249 250 // VrrpVrAddDelReply defines message 'vrrp_vr_add_del_reply'. 251 type VrrpVrAddDelReply struct { 252 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 253 } 254 255 func (m *VrrpVrAddDelReply) Reset() { *m = VrrpVrAddDelReply{} } 256 func (*VrrpVrAddDelReply) GetMessageName() string { return "vrrp_vr_add_del_reply" } 257 func (*VrrpVrAddDelReply) GetCrcString() string { return "e8d4e804" } 258 func (*VrrpVrAddDelReply) GetMessageType() api.MessageType { 259 return api.ReplyMessage 260 } 261 262 func (m *VrrpVrAddDelReply) Size() (size int) { 263 if m == nil { 264 return 0 265 } 266 size += 4 // m.Retval 267 return size 268 } 269 func (m *VrrpVrAddDelReply) Marshal(b []byte) ([]byte, error) { 270 if b == nil { 271 b = make([]byte, m.Size()) 272 } 273 buf := codec.NewBuffer(b) 274 buf.EncodeInt32(m.Retval) 275 return buf.Bytes(), nil 276 } 277 func (m *VrrpVrAddDelReply) Unmarshal(b []byte) error { 278 buf := codec.NewBuffer(b) 279 m.Retval = buf.DecodeInt32() 280 return nil 281 } 282 283 // * @brief Delete an existing VRRP instance 284 // - - vrrp_index - index of the VRRP instance to delete 285 // 286 // VrrpVrDel defines message 'vrrp_vr_del'. 287 type VrrpVrDel struct { 288 VrrpIndex uint32 `binapi:"u32,name=vrrp_index" json:"vrrp_index,omitempty"` 289 } 290 291 func (m *VrrpVrDel) Reset() { *m = VrrpVrDel{} } 292 func (*VrrpVrDel) GetMessageName() string { return "vrrp_vr_del" } 293 func (*VrrpVrDel) GetCrcString() string { return "6029baa1" } 294 func (*VrrpVrDel) GetMessageType() api.MessageType { 295 return api.RequestMessage 296 } 297 298 func (m *VrrpVrDel) Size() (size int) { 299 if m == nil { 300 return 0 301 } 302 size += 4 // m.VrrpIndex 303 return size 304 } 305 func (m *VrrpVrDel) Marshal(b []byte) ([]byte, error) { 306 if b == nil { 307 b = make([]byte, m.Size()) 308 } 309 buf := codec.NewBuffer(b) 310 buf.EncodeUint32(m.VrrpIndex) 311 return buf.Bytes(), nil 312 } 313 func (m *VrrpVrDel) Unmarshal(b []byte) error { 314 buf := codec.NewBuffer(b) 315 m.VrrpIndex = buf.DecodeUint32() 316 return nil 317 } 318 319 // VrrpVrDelReply defines message 'vrrp_vr_del_reply'. 320 type VrrpVrDelReply struct { 321 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 322 } 323 324 func (m *VrrpVrDelReply) Reset() { *m = VrrpVrDelReply{} } 325 func (*VrrpVrDelReply) GetMessageName() string { return "vrrp_vr_del_reply" } 326 func (*VrrpVrDelReply) GetCrcString() string { return "e8d4e804" } 327 func (*VrrpVrDelReply) GetMessageType() api.MessageType { 328 return api.ReplyMessage 329 } 330 331 func (m *VrrpVrDelReply) Size() (size int) { 332 if m == nil { 333 return 0 334 } 335 size += 4 // m.Retval 336 return size 337 } 338 func (m *VrrpVrDelReply) Marshal(b []byte) ([]byte, error) { 339 if b == nil { 340 b = make([]byte, m.Size()) 341 } 342 buf := codec.NewBuffer(b) 343 buf.EncodeInt32(m.Retval) 344 return buf.Bytes(), nil 345 } 346 func (m *VrrpVrDelReply) Unmarshal(b []byte) error { 347 buf := codec.NewBuffer(b) 348 m.Retval = buf.DecodeInt32() 349 return nil 350 } 351 352 // VRRP: VR dump response 353 // - conf - configuration parameters for the VR 354 // - runtime - runtime state for the VR 355 // 356 // VrrpVrDetails defines message 'vrrp_vr_details'. 357 type VrrpVrDetails struct { 358 Config VrrpVrConf `binapi:"vrrp_vr_conf,name=config" json:"config,omitempty"` 359 Runtime VrrpVrRuntime `binapi:"vrrp_vr_runtime,name=runtime" json:"runtime,omitempty"` 360 NAddrs uint8 `binapi:"u8,name=n_addrs" json:"-"` 361 Addrs []ip_types.Address `binapi:"address[n_addrs],name=addrs" json:"addrs,omitempty"` 362 } 363 364 func (m *VrrpVrDetails) Reset() { *m = VrrpVrDetails{} } 365 func (*VrrpVrDetails) GetMessageName() string { return "vrrp_vr_details" } 366 func (*VrrpVrDetails) GetCrcString() string { return "46edcebd" } 367 func (*VrrpVrDetails) GetMessageType() api.MessageType { 368 return api.ReplyMessage 369 } 370 371 func (m *VrrpVrDetails) Size() (size int) { 372 if m == nil { 373 return 0 374 } 375 size += 4 // m.Config.SwIfIndex 376 size += 1 // m.Config.VrID 377 size += 1 // m.Config.Priority 378 size += 2 // m.Config.Interval 379 size += 4 // m.Config.Flags 380 size += 4 // m.Runtime.State 381 size += 2 // m.Runtime.MasterAdvInt 382 size += 2 // m.Runtime.Skew 383 size += 2 // m.Runtime.MasterDownInt 384 size += 1 * 6 // m.Runtime.Mac 385 size += 4 // m.Runtime.Tracking.InterfacesDec 386 size += 1 // m.Runtime.Tracking.Priority 387 size += 1 // m.NAddrs 388 for j1 := 0; j1 < len(m.Addrs); j1++ { 389 var s1 ip_types.Address 390 _ = s1 391 if j1 < len(m.Addrs) { 392 s1 = m.Addrs[j1] 393 } 394 size += 1 // s1.Af 395 size += 1 * 16 // s1.Un 396 } 397 return size 398 } 399 func (m *VrrpVrDetails) Marshal(b []byte) ([]byte, error) { 400 if b == nil { 401 b = make([]byte, m.Size()) 402 } 403 buf := codec.NewBuffer(b) 404 buf.EncodeUint32(uint32(m.Config.SwIfIndex)) 405 buf.EncodeUint8(m.Config.VrID) 406 buf.EncodeUint8(m.Config.Priority) 407 buf.EncodeUint16(m.Config.Interval) 408 buf.EncodeUint32(uint32(m.Config.Flags)) 409 buf.EncodeUint32(uint32(m.Runtime.State)) 410 buf.EncodeUint16(m.Runtime.MasterAdvInt) 411 buf.EncodeUint16(m.Runtime.Skew) 412 buf.EncodeUint16(m.Runtime.MasterDownInt) 413 buf.EncodeBytes(m.Runtime.Mac[:], 6) 414 buf.EncodeUint32(m.Runtime.Tracking.InterfacesDec) 415 buf.EncodeUint8(m.Runtime.Tracking.Priority) 416 buf.EncodeUint8(uint8(len(m.Addrs))) 417 for j0 := 0; j0 < len(m.Addrs); j0++ { 418 var v0 ip_types.Address // Addrs 419 if j0 < len(m.Addrs) { 420 v0 = m.Addrs[j0] 421 } 422 buf.EncodeUint8(uint8(v0.Af)) 423 buf.EncodeBytes(v0.Un.XXX_UnionData[:], 16) 424 } 425 return buf.Bytes(), nil 426 } 427 func (m *VrrpVrDetails) Unmarshal(b []byte) error { 428 buf := codec.NewBuffer(b) 429 m.Config.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 430 m.Config.VrID = buf.DecodeUint8() 431 m.Config.Priority = buf.DecodeUint8() 432 m.Config.Interval = buf.DecodeUint16() 433 m.Config.Flags = VrrpVrFlags(buf.DecodeUint32()) 434 m.Runtime.State = VrrpVrState(buf.DecodeUint32()) 435 m.Runtime.MasterAdvInt = buf.DecodeUint16() 436 m.Runtime.Skew = buf.DecodeUint16() 437 m.Runtime.MasterDownInt = buf.DecodeUint16() 438 copy(m.Runtime.Mac[:], buf.DecodeBytes(6)) 439 m.Runtime.Tracking.InterfacesDec = buf.DecodeUint32() 440 m.Runtime.Tracking.Priority = buf.DecodeUint8() 441 m.NAddrs = buf.DecodeUint8() 442 m.Addrs = make([]ip_types.Address, m.NAddrs) 443 for j0 := 0; j0 < len(m.Addrs); j0++ { 444 m.Addrs[j0].Af = ip_types.AddressFamily(buf.DecodeUint8()) 445 copy(m.Addrs[j0].Un.XXX_UnionData[:], buf.DecodeBytes(16)) 446 } 447 return nil 448 } 449 450 // VRRP: dump virtual router data 451 // - sw_if_index - interface to use as filter (0,~0 == "all") 452 // 453 // VrrpVrDump defines message 'vrrp_vr_dump'. 454 type VrrpVrDump struct { 455 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 456 } 457 458 func (m *VrrpVrDump) Reset() { *m = VrrpVrDump{} } 459 func (*VrrpVrDump) GetMessageName() string { return "vrrp_vr_dump" } 460 func (*VrrpVrDump) GetCrcString() string { return "f9e6675e" } 461 func (*VrrpVrDump) GetMessageType() api.MessageType { 462 return api.RequestMessage 463 } 464 465 func (m *VrrpVrDump) Size() (size int) { 466 if m == nil { 467 return 0 468 } 469 size += 4 // m.SwIfIndex 470 return size 471 } 472 func (m *VrrpVrDump) Marshal(b []byte) ([]byte, error) { 473 if b == nil { 474 b = make([]byte, m.Size()) 475 } 476 buf := codec.NewBuffer(b) 477 buf.EncodeUint32(uint32(m.SwIfIndex)) 478 return buf.Bytes(), nil 479 } 480 func (m *VrrpVrDump) Unmarshal(b []byte) error { 481 buf := codec.NewBuffer(b) 482 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 483 return nil 484 } 485 486 // Notification about VRRP VR state change event 487 // - pid - client pid registered to receive notification 488 // - vr - configuration parameters identifying the VR 489 // - old_state - old state of VR 490 // - new_state - new state of VR 491 // 492 // VrrpVrEvent defines message 'vrrp_vr_event'. 493 type VrrpVrEvent struct { 494 PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"` 495 Vr VrrpVrKey `binapi:"vrrp_vr_key,name=vr" json:"vr,omitempty"` 496 OldState VrrpVrState `binapi:"vrrp_vr_state,name=old_state" json:"old_state,omitempty"` 497 NewState VrrpVrState `binapi:"vrrp_vr_state,name=new_state" json:"new_state,omitempty"` 498 } 499 500 func (m *VrrpVrEvent) Reset() { *m = VrrpVrEvent{} } 501 func (*VrrpVrEvent) GetMessageName() string { return "vrrp_vr_event" } 502 func (*VrrpVrEvent) GetCrcString() string { return "c1fea6a5" } 503 func (*VrrpVrEvent) GetMessageType() api.MessageType { 504 return api.EventMessage 505 } 506 507 func (m *VrrpVrEvent) Size() (size int) { 508 if m == nil { 509 return 0 510 } 511 size += 4 // m.PID 512 size += 4 // m.Vr.SwIfIndex 513 size += 1 // m.Vr.VrID 514 size += 1 // m.Vr.IsIPv6 515 size += 4 // m.OldState 516 size += 4 // m.NewState 517 return size 518 } 519 func (m *VrrpVrEvent) Marshal(b []byte) ([]byte, error) { 520 if b == nil { 521 b = make([]byte, m.Size()) 522 } 523 buf := codec.NewBuffer(b) 524 buf.EncodeUint32(m.PID) 525 buf.EncodeUint32(uint32(m.Vr.SwIfIndex)) 526 buf.EncodeUint8(m.Vr.VrID) 527 buf.EncodeUint8(m.Vr.IsIPv6) 528 buf.EncodeUint32(uint32(m.OldState)) 529 buf.EncodeUint32(uint32(m.NewState)) 530 return buf.Bytes(), nil 531 } 532 func (m *VrrpVrEvent) Unmarshal(b []byte) error { 533 buf := codec.NewBuffer(b) 534 m.PID = buf.DecodeUint32() 535 m.Vr.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 536 m.Vr.VrID = buf.DecodeUint8() 537 m.Vr.IsIPv6 = buf.DecodeUint8() 538 m.OldState = VrrpVrState(buf.DecodeUint32()) 539 m.NewState = VrrpVrState(buf.DecodeUint32()) 540 return nil 541 } 542 543 // VRRP: VR peer dump response 544 // - sw_if_index - interface index 545 // - is_ipv6 - 0 -> IPv4, 1 -> IPv6 546 // - vr_id - ID of VR 547 // - n_peer_addrs - number of peer addresses 548 // - peer_addrs - peer addresses 549 // 550 // VrrpVrPeerDetails defines message 'vrrp_vr_peer_details'. 551 type VrrpVrPeerDetails struct { 552 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 553 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"` 554 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"` 555 NPeerAddrs uint8 `binapi:"u8,name=n_peer_addrs" json:"-"` 556 PeerAddrs []ip_types.Address `binapi:"address[n_peer_addrs],name=peer_addrs" json:"peer_addrs,omitempty"` 557 } 558 559 func (m *VrrpVrPeerDetails) Reset() { *m = VrrpVrPeerDetails{} } 560 func (*VrrpVrPeerDetails) GetMessageName() string { return "vrrp_vr_peer_details" } 561 func (*VrrpVrPeerDetails) GetCrcString() string { return "3d99c108" } 562 func (*VrrpVrPeerDetails) GetMessageType() api.MessageType { 563 return api.RequestMessage 564 } 565 566 func (m *VrrpVrPeerDetails) Size() (size int) { 567 if m == nil { 568 return 0 569 } 570 size += 4 // m.SwIfIndex 571 size += 1 // m.VrID 572 size += 1 // m.IsIPv6 573 size += 1 // m.NPeerAddrs 574 for j1 := 0; j1 < len(m.PeerAddrs); j1++ { 575 var s1 ip_types.Address 576 _ = s1 577 if j1 < len(m.PeerAddrs) { 578 s1 = m.PeerAddrs[j1] 579 } 580 size += 1 // s1.Af 581 size += 1 * 16 // s1.Un 582 } 583 return size 584 } 585 func (m *VrrpVrPeerDetails) Marshal(b []byte) ([]byte, error) { 586 if b == nil { 587 b = make([]byte, m.Size()) 588 } 589 buf := codec.NewBuffer(b) 590 buf.EncodeUint32(uint32(m.SwIfIndex)) 591 buf.EncodeUint8(m.VrID) 592 buf.EncodeUint8(m.IsIPv6) 593 buf.EncodeUint8(uint8(len(m.PeerAddrs))) 594 for j0 := 0; j0 < len(m.PeerAddrs); j0++ { 595 var v0 ip_types.Address // PeerAddrs 596 if j0 < len(m.PeerAddrs) { 597 v0 = m.PeerAddrs[j0] 598 } 599 buf.EncodeUint8(uint8(v0.Af)) 600 buf.EncodeBytes(v0.Un.XXX_UnionData[:], 16) 601 } 602 return buf.Bytes(), nil 603 } 604 func (m *VrrpVrPeerDetails) Unmarshal(b []byte) error { 605 buf := codec.NewBuffer(b) 606 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 607 m.VrID = buf.DecodeUint8() 608 m.IsIPv6 = buf.DecodeUint8() 609 m.NPeerAddrs = buf.DecodeUint8() 610 m.PeerAddrs = make([]ip_types.Address, m.NPeerAddrs) 611 for j0 := 0; j0 < len(m.PeerAddrs); j0++ { 612 m.PeerAddrs[j0].Af = ip_types.AddressFamily(buf.DecodeUint8()) 613 copy(m.PeerAddrs[j0].Un.XXX_UnionData[:], buf.DecodeBytes(16)) 614 } 615 return nil 616 } 617 618 // VRRP: dump virtual router peer address data 619 // - sw_if_index - interface (0,~0 == "all" -> ignore is_ipv6 & vr_id)) 620 // - is_ipv6 - 0 -> IPv4, 1 -> IPv6 621 // - vr_id - ID of VR to dump 622 // 623 // VrrpVrPeerDump defines message 'vrrp_vr_peer_dump'. 624 type VrrpVrPeerDump struct { 625 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 626 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"` 627 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"` 628 } 629 630 func (m *VrrpVrPeerDump) Reset() { *m = VrrpVrPeerDump{} } 631 func (*VrrpVrPeerDump) GetMessageName() string { return "vrrp_vr_peer_dump" } 632 func (*VrrpVrPeerDump) GetCrcString() string { return "6fa3f7c4" } 633 func (*VrrpVrPeerDump) GetMessageType() api.MessageType { 634 return api.RequestMessage 635 } 636 637 func (m *VrrpVrPeerDump) Size() (size int) { 638 if m == nil { 639 return 0 640 } 641 size += 4 // m.SwIfIndex 642 size += 1 // m.IsIPv6 643 size += 1 // m.VrID 644 return size 645 } 646 func (m *VrrpVrPeerDump) Marshal(b []byte) ([]byte, error) { 647 if b == nil { 648 b = make([]byte, m.Size()) 649 } 650 buf := codec.NewBuffer(b) 651 buf.EncodeUint32(uint32(m.SwIfIndex)) 652 buf.EncodeUint8(m.IsIPv6) 653 buf.EncodeUint8(m.VrID) 654 return buf.Bytes(), nil 655 } 656 func (m *VrrpVrPeerDump) Unmarshal(b []byte) error { 657 buf := codec.NewBuffer(b) 658 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 659 m.IsIPv6 = buf.DecodeUint8() 660 m.VrID = buf.DecodeUint8() 661 return nil 662 } 663 664 // VRRP: set unicast peers for a VR 665 // - sw_if_index - interface ID that VR is backing up 666 // - vr_id - VR ID 667 // - is_ipv6 - 1 for IPv6, 0 for IPv4 668 // - n_addrs - number of peer addresses 669 // - addrs - peer addresses 670 // 671 // VrrpVrSetPeers defines message 'vrrp_vr_set_peers'. 672 type VrrpVrSetPeers struct { 673 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 674 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"` 675 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"` 676 NAddrs uint8 `binapi:"u8,name=n_addrs" json:"-"` 677 Addrs []ip_types.Address `binapi:"address[n_addrs],name=addrs" json:"addrs,omitempty"` 678 } 679 680 func (m *VrrpVrSetPeers) Reset() { *m = VrrpVrSetPeers{} } 681 func (*VrrpVrSetPeers) GetMessageName() string { return "vrrp_vr_set_peers" } 682 func (*VrrpVrSetPeers) GetCrcString() string { return "20bec71f" } 683 func (*VrrpVrSetPeers) GetMessageType() api.MessageType { 684 return api.RequestMessage 685 } 686 687 func (m *VrrpVrSetPeers) Size() (size int) { 688 if m == nil { 689 return 0 690 } 691 size += 4 // m.SwIfIndex 692 size += 1 // m.VrID 693 size += 1 // m.IsIPv6 694 size += 1 // m.NAddrs 695 for j1 := 0; j1 < len(m.Addrs); j1++ { 696 var s1 ip_types.Address 697 _ = s1 698 if j1 < len(m.Addrs) { 699 s1 = m.Addrs[j1] 700 } 701 size += 1 // s1.Af 702 size += 1 * 16 // s1.Un 703 } 704 return size 705 } 706 func (m *VrrpVrSetPeers) Marshal(b []byte) ([]byte, error) { 707 if b == nil { 708 b = make([]byte, m.Size()) 709 } 710 buf := codec.NewBuffer(b) 711 buf.EncodeUint32(uint32(m.SwIfIndex)) 712 buf.EncodeUint8(m.VrID) 713 buf.EncodeUint8(m.IsIPv6) 714 buf.EncodeUint8(uint8(len(m.Addrs))) 715 for j0 := 0; j0 < len(m.Addrs); j0++ { 716 var v0 ip_types.Address // Addrs 717 if j0 < len(m.Addrs) { 718 v0 = m.Addrs[j0] 719 } 720 buf.EncodeUint8(uint8(v0.Af)) 721 buf.EncodeBytes(v0.Un.XXX_UnionData[:], 16) 722 } 723 return buf.Bytes(), nil 724 } 725 func (m *VrrpVrSetPeers) Unmarshal(b []byte) error { 726 buf := codec.NewBuffer(b) 727 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 728 m.VrID = buf.DecodeUint8() 729 m.IsIPv6 = buf.DecodeUint8() 730 m.NAddrs = buf.DecodeUint8() 731 m.Addrs = make([]ip_types.Address, m.NAddrs) 732 for j0 := 0; j0 < len(m.Addrs); j0++ { 733 m.Addrs[j0].Af = ip_types.AddressFamily(buf.DecodeUint8()) 734 copy(m.Addrs[j0].Un.XXX_UnionData[:], buf.DecodeBytes(16)) 735 } 736 return nil 737 } 738 739 // VrrpVrSetPeersReply defines message 'vrrp_vr_set_peers_reply'. 740 type VrrpVrSetPeersReply struct { 741 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 742 } 743 744 func (m *VrrpVrSetPeersReply) Reset() { *m = VrrpVrSetPeersReply{} } 745 func (*VrrpVrSetPeersReply) GetMessageName() string { return "vrrp_vr_set_peers_reply" } 746 func (*VrrpVrSetPeersReply) GetCrcString() string { return "e8d4e804" } 747 func (*VrrpVrSetPeersReply) GetMessageType() api.MessageType { 748 return api.ReplyMessage 749 } 750 751 func (m *VrrpVrSetPeersReply) Size() (size int) { 752 if m == nil { 753 return 0 754 } 755 size += 4 // m.Retval 756 return size 757 } 758 func (m *VrrpVrSetPeersReply) Marshal(b []byte) ([]byte, error) { 759 if b == nil { 760 b = make([]byte, m.Size()) 761 } 762 buf := codec.NewBuffer(b) 763 buf.EncodeInt32(m.Retval) 764 return buf.Bytes(), nil 765 } 766 func (m *VrrpVrSetPeersReply) Unmarshal(b []byte) error { 767 buf := codec.NewBuffer(b) 768 m.Retval = buf.DecodeInt32() 769 return nil 770 } 771 772 // VRRP: start or shutdown the VRRP protocol for a virtual router 773 // - sw_if_index - interface ID that VR is backing up 774 // - vr_id - VR ID 775 // - is_ipv6 - 1 for IPv6, 0 for IPv4 776 // - is_start - 1 to start VRRP proto on this VR, 0 to shutdown 777 // 778 // VrrpVrStartStop defines message 'vrrp_vr_start_stop'. 779 type VrrpVrStartStop struct { 780 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 781 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"` 782 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"` 783 IsStart uint8 `binapi:"u8,name=is_start" json:"is_start,omitempty"` 784 } 785 786 func (m *VrrpVrStartStop) Reset() { *m = VrrpVrStartStop{} } 787 func (*VrrpVrStartStop) GetMessageName() string { return "vrrp_vr_start_stop" } 788 func (*VrrpVrStartStop) GetCrcString() string { return "0662a3b7" } 789 func (*VrrpVrStartStop) GetMessageType() api.MessageType { 790 return api.RequestMessage 791 } 792 793 func (m *VrrpVrStartStop) Size() (size int) { 794 if m == nil { 795 return 0 796 } 797 size += 4 // m.SwIfIndex 798 size += 1 // m.VrID 799 size += 1 // m.IsIPv6 800 size += 1 // m.IsStart 801 return size 802 } 803 func (m *VrrpVrStartStop) Marshal(b []byte) ([]byte, error) { 804 if b == nil { 805 b = make([]byte, m.Size()) 806 } 807 buf := codec.NewBuffer(b) 808 buf.EncodeUint32(uint32(m.SwIfIndex)) 809 buf.EncodeUint8(m.VrID) 810 buf.EncodeUint8(m.IsIPv6) 811 buf.EncodeUint8(m.IsStart) 812 return buf.Bytes(), nil 813 } 814 func (m *VrrpVrStartStop) Unmarshal(b []byte) error { 815 buf := codec.NewBuffer(b) 816 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 817 m.VrID = buf.DecodeUint8() 818 m.IsIPv6 = buf.DecodeUint8() 819 m.IsStart = buf.DecodeUint8() 820 return nil 821 } 822 823 // VrrpVrStartStopReply defines message 'vrrp_vr_start_stop_reply'. 824 type VrrpVrStartStopReply struct { 825 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 826 } 827 828 func (m *VrrpVrStartStopReply) Reset() { *m = VrrpVrStartStopReply{} } 829 func (*VrrpVrStartStopReply) GetMessageName() string { return "vrrp_vr_start_stop_reply" } 830 func (*VrrpVrStartStopReply) GetCrcString() string { return "e8d4e804" } 831 func (*VrrpVrStartStopReply) GetMessageType() api.MessageType { 832 return api.ReplyMessage 833 } 834 835 func (m *VrrpVrStartStopReply) Size() (size int) { 836 if m == nil { 837 return 0 838 } 839 size += 4 // m.Retval 840 return size 841 } 842 func (m *VrrpVrStartStopReply) Marshal(b []byte) ([]byte, error) { 843 if b == nil { 844 b = make([]byte, m.Size()) 845 } 846 buf := codec.NewBuffer(b) 847 buf.EncodeInt32(m.Retval) 848 return buf.Bytes(), nil 849 } 850 func (m *VrrpVrStartStopReply) Unmarshal(b []byte) error { 851 buf := codec.NewBuffer(b) 852 m.Retval = buf.DecodeInt32() 853 return nil 854 } 855 856 // VRRP: Add/delete VR priority tracking of interface status 857 // - sw_if_index - interface index 858 // - is_ipv6 - 0 -> IPv4, 1 -> IPv6 859 // - vr_id - ID of VR 860 // - is_add - 0 -> delete, 1 -> add 861 // - n_ifs - number of interface tracking records 862 // - ifs - array of interface tracking records 863 // 864 // VrrpVrTrackIfAddDel defines message 'vrrp_vr_track_if_add_del'. 865 type VrrpVrTrackIfAddDel struct { 866 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 867 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"` 868 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"` 869 IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"` 870 NIfs uint8 `binapi:"u8,name=n_ifs" json:"-"` 871 Ifs []VrrpVrTrackIf `binapi:"vrrp_vr_track_if[n_ifs],name=ifs" json:"ifs,omitempty"` 872 } 873 874 func (m *VrrpVrTrackIfAddDel) Reset() { *m = VrrpVrTrackIfAddDel{} } 875 func (*VrrpVrTrackIfAddDel) GetMessageName() string { return "vrrp_vr_track_if_add_del" } 876 func (*VrrpVrTrackIfAddDel) GetCrcString() string { return "d67df299" } 877 func (*VrrpVrTrackIfAddDel) GetMessageType() api.MessageType { 878 return api.RequestMessage 879 } 880 881 func (m *VrrpVrTrackIfAddDel) Size() (size int) { 882 if m == nil { 883 return 0 884 } 885 size += 4 // m.SwIfIndex 886 size += 1 // m.IsIPv6 887 size += 1 // m.VrID 888 size += 1 // m.IsAdd 889 size += 1 // m.NIfs 890 for j1 := 0; j1 < len(m.Ifs); j1++ { 891 var s1 VrrpVrTrackIf 892 _ = s1 893 if j1 < len(m.Ifs) { 894 s1 = m.Ifs[j1] 895 } 896 size += 4 // s1.SwIfIndex 897 size += 1 // s1.Priority 898 } 899 return size 900 } 901 func (m *VrrpVrTrackIfAddDel) Marshal(b []byte) ([]byte, error) { 902 if b == nil { 903 b = make([]byte, m.Size()) 904 } 905 buf := codec.NewBuffer(b) 906 buf.EncodeUint32(uint32(m.SwIfIndex)) 907 buf.EncodeUint8(m.IsIPv6) 908 buf.EncodeUint8(m.VrID) 909 buf.EncodeUint8(m.IsAdd) 910 buf.EncodeUint8(uint8(len(m.Ifs))) 911 for j0 := 0; j0 < len(m.Ifs); j0++ { 912 var v0 VrrpVrTrackIf // Ifs 913 if j0 < len(m.Ifs) { 914 v0 = m.Ifs[j0] 915 } 916 buf.EncodeUint32(uint32(v0.SwIfIndex)) 917 buf.EncodeUint8(v0.Priority) 918 } 919 return buf.Bytes(), nil 920 } 921 func (m *VrrpVrTrackIfAddDel) Unmarshal(b []byte) error { 922 buf := codec.NewBuffer(b) 923 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 924 m.IsIPv6 = buf.DecodeUint8() 925 m.VrID = buf.DecodeUint8() 926 m.IsAdd = buf.DecodeUint8() 927 m.NIfs = buf.DecodeUint8() 928 m.Ifs = make([]VrrpVrTrackIf, m.NIfs) 929 for j0 := 0; j0 < len(m.Ifs); j0++ { 930 m.Ifs[j0].SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 931 m.Ifs[j0].Priority = buf.DecodeUint8() 932 } 933 return nil 934 } 935 936 // VrrpVrTrackIfAddDelReply defines message 'vrrp_vr_track_if_add_del_reply'. 937 type VrrpVrTrackIfAddDelReply struct { 938 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 939 } 940 941 func (m *VrrpVrTrackIfAddDelReply) Reset() { *m = VrrpVrTrackIfAddDelReply{} } 942 func (*VrrpVrTrackIfAddDelReply) GetMessageName() string { return "vrrp_vr_track_if_add_del_reply" } 943 func (*VrrpVrTrackIfAddDelReply) GetCrcString() string { return "e8d4e804" } 944 func (*VrrpVrTrackIfAddDelReply) GetMessageType() api.MessageType { 945 return api.ReplyMessage 946 } 947 948 func (m *VrrpVrTrackIfAddDelReply) Size() (size int) { 949 if m == nil { 950 return 0 951 } 952 size += 4 // m.Retval 953 return size 954 } 955 func (m *VrrpVrTrackIfAddDelReply) Marshal(b []byte) ([]byte, error) { 956 if b == nil { 957 b = make([]byte, m.Size()) 958 } 959 buf := codec.NewBuffer(b) 960 buf.EncodeInt32(m.Retval) 961 return buf.Bytes(), nil 962 } 963 func (m *VrrpVrTrackIfAddDelReply) Unmarshal(b []byte) error { 964 buf := codec.NewBuffer(b) 965 m.Retval = buf.DecodeInt32() 966 return nil 967 } 968 969 // VRRP: VR interface tracking dump response 970 // - sw_if_index - interface index 971 // - is_ipv6 - 0 -> IPv4, 1 -> IPv6 972 // - vr_id - ID of VR 973 // - n_ifs - number of tracked interfaces 974 // - ifs - array of tracked interface data 975 // 976 // VrrpVrTrackIfDetails defines message 'vrrp_vr_track_if_details'. 977 type VrrpVrTrackIfDetails struct { 978 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 979 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"` 980 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"` 981 NIfs uint8 `binapi:"u8,name=n_ifs" json:"-"` 982 Ifs []VrrpVrTrackIf `binapi:"vrrp_vr_track_if[n_ifs],name=ifs" json:"ifs,omitempty"` 983 } 984 985 func (m *VrrpVrTrackIfDetails) Reset() { *m = VrrpVrTrackIfDetails{} } 986 func (*VrrpVrTrackIfDetails) GetMessageName() string { return "vrrp_vr_track_if_details" } 987 func (*VrrpVrTrackIfDetails) GetCrcString() string { return "73c36f81" } 988 func (*VrrpVrTrackIfDetails) GetMessageType() api.MessageType { 989 return api.RequestMessage 990 } 991 992 func (m *VrrpVrTrackIfDetails) Size() (size int) { 993 if m == nil { 994 return 0 995 } 996 size += 4 // m.SwIfIndex 997 size += 1 // m.VrID 998 size += 1 // m.IsIPv6 999 size += 1 // m.NIfs 1000 for j1 := 0; j1 < len(m.Ifs); j1++ { 1001 var s1 VrrpVrTrackIf 1002 _ = s1 1003 if j1 < len(m.Ifs) { 1004 s1 = m.Ifs[j1] 1005 } 1006 size += 4 // s1.SwIfIndex 1007 size += 1 // s1.Priority 1008 } 1009 return size 1010 } 1011 func (m *VrrpVrTrackIfDetails) Marshal(b []byte) ([]byte, error) { 1012 if b == nil { 1013 b = make([]byte, m.Size()) 1014 } 1015 buf := codec.NewBuffer(b) 1016 buf.EncodeUint32(uint32(m.SwIfIndex)) 1017 buf.EncodeUint8(m.VrID) 1018 buf.EncodeUint8(m.IsIPv6) 1019 buf.EncodeUint8(uint8(len(m.Ifs))) 1020 for j0 := 0; j0 < len(m.Ifs); j0++ { 1021 var v0 VrrpVrTrackIf // Ifs 1022 if j0 < len(m.Ifs) { 1023 v0 = m.Ifs[j0] 1024 } 1025 buf.EncodeUint32(uint32(v0.SwIfIndex)) 1026 buf.EncodeUint8(v0.Priority) 1027 } 1028 return buf.Bytes(), nil 1029 } 1030 func (m *VrrpVrTrackIfDetails) Unmarshal(b []byte) error { 1031 buf := codec.NewBuffer(b) 1032 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1033 m.VrID = buf.DecodeUint8() 1034 m.IsIPv6 = buf.DecodeUint8() 1035 m.NIfs = buf.DecodeUint8() 1036 m.Ifs = make([]VrrpVrTrackIf, m.NIfs) 1037 for j0 := 0; j0 < len(m.Ifs); j0++ { 1038 m.Ifs[j0].SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1039 m.Ifs[j0].Priority = buf.DecodeUint8() 1040 } 1041 return nil 1042 } 1043 1044 // VRRP: dump virtual router interface tracking data 1045 // - sw_if_index - interface 1046 // - is_ipv6 - 0 -> IPv4, 1 -> IPv6 1047 // - vr_id - ID of VR to dump 1048 // - dump_all - dump all VR interface tracking, ignore other fields 1049 // 1050 // VrrpVrTrackIfDump defines message 'vrrp_vr_track_if_dump'. 1051 type VrrpVrTrackIfDump struct { 1052 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 1053 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"` 1054 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"` 1055 DumpAll uint8 `binapi:"u8,name=dump_all" json:"dump_all,omitempty"` 1056 } 1057 1058 func (m *VrrpVrTrackIfDump) Reset() { *m = VrrpVrTrackIfDump{} } 1059 func (*VrrpVrTrackIfDump) GetMessageName() string { return "vrrp_vr_track_if_dump" } 1060 func (*VrrpVrTrackIfDump) GetCrcString() string { return "a34dfc6d" } 1061 func (*VrrpVrTrackIfDump) GetMessageType() api.MessageType { 1062 return api.RequestMessage 1063 } 1064 1065 func (m *VrrpVrTrackIfDump) Size() (size int) { 1066 if m == nil { 1067 return 0 1068 } 1069 size += 4 // m.SwIfIndex 1070 size += 1 // m.IsIPv6 1071 size += 1 // m.VrID 1072 size += 1 // m.DumpAll 1073 return size 1074 } 1075 func (m *VrrpVrTrackIfDump) Marshal(b []byte) ([]byte, error) { 1076 if b == nil { 1077 b = make([]byte, m.Size()) 1078 } 1079 buf := codec.NewBuffer(b) 1080 buf.EncodeUint32(uint32(m.SwIfIndex)) 1081 buf.EncodeUint8(m.IsIPv6) 1082 buf.EncodeUint8(m.VrID) 1083 buf.EncodeUint8(m.DumpAll) 1084 return buf.Bytes(), nil 1085 } 1086 func (m *VrrpVrTrackIfDump) Unmarshal(b []byte) error { 1087 buf := codec.NewBuffer(b) 1088 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1089 m.IsIPv6 = buf.DecodeUint8() 1090 m.VrID = buf.DecodeUint8() 1091 m.DumpAll = buf.DecodeUint8() 1092 return nil 1093 } 1094 1095 // @brief Replace an existing VRRP virtual router in-place or create a new one 1096 // - vrrp_index - an existing VRRP entry to replace, or 0xffffffff to crate a new one 1097 // - sw_if_index - interface backed up by this vr 1098 // - vr_id - the VR ID advertised by this vr 1099 // - priority - the priority advertised for this vr 1100 // - interval - interval between advertisements in centiseconds 1101 // - flags - bit flags for booleans - preempt, accept, unicast, ipv6 1102 // - n_addrs - number of addresses being backed up by this vr 1103 // - addrs - the addresses backed up by this vr 1104 // 1105 // VrrpVrUpdate defines message 'vrrp_vr_update'. 1106 type VrrpVrUpdate struct { 1107 VrrpIndex uint32 `binapi:"u32,name=vrrp_index" json:"vrrp_index,omitempty"` 1108 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 1109 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"` 1110 Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"` 1111 Interval uint16 `binapi:"u16,name=interval" json:"interval,omitempty"` 1112 Flags VrrpVrFlags `binapi:"vrrp_vr_flags,name=flags" json:"flags,omitempty"` 1113 NAddrs uint8 `binapi:"u8,name=n_addrs" json:"-"` 1114 Addrs []ip_types.Address `binapi:"address[n_addrs],name=addrs" json:"addrs,omitempty"` 1115 } 1116 1117 func (m *VrrpVrUpdate) Reset() { *m = VrrpVrUpdate{} } 1118 func (*VrrpVrUpdate) GetMessageName() string { return "vrrp_vr_update" } 1119 func (*VrrpVrUpdate) GetCrcString() string { return "0b51e2f4" } 1120 func (*VrrpVrUpdate) GetMessageType() api.MessageType { 1121 return api.RequestMessage 1122 } 1123 1124 func (m *VrrpVrUpdate) Size() (size int) { 1125 if m == nil { 1126 return 0 1127 } 1128 size += 4 // m.VrrpIndex 1129 size += 4 // m.SwIfIndex 1130 size += 1 // m.VrID 1131 size += 1 // m.Priority 1132 size += 2 // m.Interval 1133 size += 4 // m.Flags 1134 size += 1 // m.NAddrs 1135 for j1 := 0; j1 < len(m.Addrs); j1++ { 1136 var s1 ip_types.Address 1137 _ = s1 1138 if j1 < len(m.Addrs) { 1139 s1 = m.Addrs[j1] 1140 } 1141 size += 1 // s1.Af 1142 size += 1 * 16 // s1.Un 1143 } 1144 return size 1145 } 1146 func (m *VrrpVrUpdate) Marshal(b []byte) ([]byte, error) { 1147 if b == nil { 1148 b = make([]byte, m.Size()) 1149 } 1150 buf := codec.NewBuffer(b) 1151 buf.EncodeUint32(m.VrrpIndex) 1152 buf.EncodeUint32(uint32(m.SwIfIndex)) 1153 buf.EncodeUint8(m.VrID) 1154 buf.EncodeUint8(m.Priority) 1155 buf.EncodeUint16(m.Interval) 1156 buf.EncodeUint32(uint32(m.Flags)) 1157 buf.EncodeUint8(uint8(len(m.Addrs))) 1158 for j0 := 0; j0 < len(m.Addrs); j0++ { 1159 var v0 ip_types.Address // Addrs 1160 if j0 < len(m.Addrs) { 1161 v0 = m.Addrs[j0] 1162 } 1163 buf.EncodeUint8(uint8(v0.Af)) 1164 buf.EncodeBytes(v0.Un.XXX_UnionData[:], 16) 1165 } 1166 return buf.Bytes(), nil 1167 } 1168 func (m *VrrpVrUpdate) Unmarshal(b []byte) error { 1169 buf := codec.NewBuffer(b) 1170 m.VrrpIndex = buf.DecodeUint32() 1171 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 1172 m.VrID = buf.DecodeUint8() 1173 m.Priority = buf.DecodeUint8() 1174 m.Interval = buf.DecodeUint16() 1175 m.Flags = VrrpVrFlags(buf.DecodeUint32()) 1176 m.NAddrs = buf.DecodeUint8() 1177 m.Addrs = make([]ip_types.Address, m.NAddrs) 1178 for j0 := 0; j0 < len(m.Addrs); j0++ { 1179 m.Addrs[j0].Af = ip_types.AddressFamily(buf.DecodeUint8()) 1180 copy(m.Addrs[j0].Un.XXX_UnionData[:], buf.DecodeBytes(16)) 1181 } 1182 return nil 1183 } 1184 1185 // * @brief Reply to a VRRP add/replace 1186 // - - vrrp_index - index of the updated or newly created VRRP instance 1187 // - - retval 0 - no error 1188 // 1189 // VrrpVrUpdateReply defines message 'vrrp_vr_update_reply'. 1190 type VrrpVrUpdateReply struct { 1191 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1192 VrrpIndex uint32 `binapi:"u32,name=vrrp_index" json:"vrrp_index,omitempty"` 1193 } 1194 1195 func (m *VrrpVrUpdateReply) Reset() { *m = VrrpVrUpdateReply{} } 1196 func (*VrrpVrUpdateReply) GetMessageName() string { return "vrrp_vr_update_reply" } 1197 func (*VrrpVrUpdateReply) GetCrcString() string { return "5317d608" } 1198 func (*VrrpVrUpdateReply) GetMessageType() api.MessageType { 1199 return api.ReplyMessage 1200 } 1201 1202 func (m *VrrpVrUpdateReply) Size() (size int) { 1203 if m == nil { 1204 return 0 1205 } 1206 size += 4 // m.Retval 1207 size += 4 // m.VrrpIndex 1208 return size 1209 } 1210 func (m *VrrpVrUpdateReply) Marshal(b []byte) ([]byte, error) { 1211 if b == nil { 1212 b = make([]byte, m.Size()) 1213 } 1214 buf := codec.NewBuffer(b) 1215 buf.EncodeInt32(m.Retval) 1216 buf.EncodeUint32(m.VrrpIndex) 1217 return buf.Bytes(), nil 1218 } 1219 func (m *VrrpVrUpdateReply) Unmarshal(b []byte) error { 1220 buf := codec.NewBuffer(b) 1221 m.Retval = buf.DecodeInt32() 1222 m.VrrpIndex = buf.DecodeUint32() 1223 return nil 1224 } 1225 1226 // Register for VRRP VR state change events 1227 // - enable_disable - 1 to register, 0 to cancel registration 1228 // - pid - sender's pid 1229 // 1230 // WantVrrpVrEvents defines message 'want_vrrp_vr_events'. 1231 type WantVrrpVrEvents struct { 1232 EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"` 1233 PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"` 1234 } 1235 1236 func (m *WantVrrpVrEvents) Reset() { *m = WantVrrpVrEvents{} } 1237 func (*WantVrrpVrEvents) GetMessageName() string { return "want_vrrp_vr_events" } 1238 func (*WantVrrpVrEvents) GetCrcString() string { return "c5e2af94" } 1239 func (*WantVrrpVrEvents) GetMessageType() api.MessageType { 1240 return api.RequestMessage 1241 } 1242 1243 func (m *WantVrrpVrEvents) Size() (size int) { 1244 if m == nil { 1245 return 0 1246 } 1247 size += 1 // m.EnableDisable 1248 size += 4 // m.PID 1249 return size 1250 } 1251 func (m *WantVrrpVrEvents) Marshal(b []byte) ([]byte, error) { 1252 if b == nil { 1253 b = make([]byte, m.Size()) 1254 } 1255 buf := codec.NewBuffer(b) 1256 buf.EncodeBool(m.EnableDisable) 1257 buf.EncodeUint32(m.PID) 1258 return buf.Bytes(), nil 1259 } 1260 func (m *WantVrrpVrEvents) Unmarshal(b []byte) error { 1261 buf := codec.NewBuffer(b) 1262 m.EnableDisable = buf.DecodeBool() 1263 m.PID = buf.DecodeUint32() 1264 return nil 1265 } 1266 1267 // WantVrrpVrEventsReply defines message 'want_vrrp_vr_events_reply'. 1268 type WantVrrpVrEventsReply struct { 1269 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 1270 } 1271 1272 func (m *WantVrrpVrEventsReply) Reset() { *m = WantVrrpVrEventsReply{} } 1273 func (*WantVrrpVrEventsReply) GetMessageName() string { return "want_vrrp_vr_events_reply" } 1274 func (*WantVrrpVrEventsReply) GetCrcString() string { return "e8d4e804" } 1275 func (*WantVrrpVrEventsReply) GetMessageType() api.MessageType { 1276 return api.ReplyMessage 1277 } 1278 1279 func (m *WantVrrpVrEventsReply) Size() (size int) { 1280 if m == nil { 1281 return 0 1282 } 1283 size += 4 // m.Retval 1284 return size 1285 } 1286 func (m *WantVrrpVrEventsReply) Marshal(b []byte) ([]byte, error) { 1287 if b == nil { 1288 b = make([]byte, m.Size()) 1289 } 1290 buf := codec.NewBuffer(b) 1291 buf.EncodeInt32(m.Retval) 1292 return buf.Bytes(), nil 1293 } 1294 func (m *WantVrrpVrEventsReply) Unmarshal(b []byte) error { 1295 buf := codec.NewBuffer(b) 1296 m.Retval = buf.DecodeInt32() 1297 return nil 1298 } 1299 1300 func init() { file_vrrp_binapi_init() } 1301 func file_vrrp_binapi_init() { 1302 api.RegisterMessage((*VrrpVrAddDel)(nil), "vrrp_vr_add_del_c5cf15aa") 1303 api.RegisterMessage((*VrrpVrAddDelReply)(nil), "vrrp_vr_add_del_reply_e8d4e804") 1304 api.RegisterMessage((*VrrpVrDel)(nil), "vrrp_vr_del_6029baa1") 1305 api.RegisterMessage((*VrrpVrDelReply)(nil), "vrrp_vr_del_reply_e8d4e804") 1306 api.RegisterMessage((*VrrpVrDetails)(nil), "vrrp_vr_details_46edcebd") 1307 api.RegisterMessage((*VrrpVrDump)(nil), "vrrp_vr_dump_f9e6675e") 1308 api.RegisterMessage((*VrrpVrEvent)(nil), "vrrp_vr_event_c1fea6a5") 1309 api.RegisterMessage((*VrrpVrPeerDetails)(nil), "vrrp_vr_peer_details_3d99c108") 1310 api.RegisterMessage((*VrrpVrPeerDump)(nil), "vrrp_vr_peer_dump_6fa3f7c4") 1311 api.RegisterMessage((*VrrpVrSetPeers)(nil), "vrrp_vr_set_peers_20bec71f") 1312 api.RegisterMessage((*VrrpVrSetPeersReply)(nil), "vrrp_vr_set_peers_reply_e8d4e804") 1313 api.RegisterMessage((*VrrpVrStartStop)(nil), "vrrp_vr_start_stop_0662a3b7") 1314 api.RegisterMessage((*VrrpVrStartStopReply)(nil), "vrrp_vr_start_stop_reply_e8d4e804") 1315 api.RegisterMessage((*VrrpVrTrackIfAddDel)(nil), "vrrp_vr_track_if_add_del_d67df299") 1316 api.RegisterMessage((*VrrpVrTrackIfAddDelReply)(nil), "vrrp_vr_track_if_add_del_reply_e8d4e804") 1317 api.RegisterMessage((*VrrpVrTrackIfDetails)(nil), "vrrp_vr_track_if_details_73c36f81") 1318 api.RegisterMessage((*VrrpVrTrackIfDump)(nil), "vrrp_vr_track_if_dump_a34dfc6d") 1319 api.RegisterMessage((*VrrpVrUpdate)(nil), "vrrp_vr_update_0b51e2f4") 1320 api.RegisterMessage((*VrrpVrUpdateReply)(nil), "vrrp_vr_update_reply_5317d608") 1321 api.RegisterMessage((*WantVrrpVrEvents)(nil), "want_vrrp_vr_events_c5e2af94") 1322 api.RegisterMessage((*WantVrrpVrEventsReply)(nil), "want_vrrp_vr_events_reply_e8d4e804") 1323 } 1324 1325 // Messages returns list of all messages in this module. 1326 func AllMessages() []api.Message { 1327 return []api.Message{ 1328 (*VrrpVrAddDel)(nil), 1329 (*VrrpVrAddDelReply)(nil), 1330 (*VrrpVrDel)(nil), 1331 (*VrrpVrDelReply)(nil), 1332 (*VrrpVrDetails)(nil), 1333 (*VrrpVrDump)(nil), 1334 (*VrrpVrEvent)(nil), 1335 (*VrrpVrPeerDetails)(nil), 1336 (*VrrpVrPeerDump)(nil), 1337 (*VrrpVrSetPeers)(nil), 1338 (*VrrpVrSetPeersReply)(nil), 1339 (*VrrpVrStartStop)(nil), 1340 (*VrrpVrStartStopReply)(nil), 1341 (*VrrpVrTrackIfAddDel)(nil), 1342 (*VrrpVrTrackIfAddDelReply)(nil), 1343 (*VrrpVrTrackIfDetails)(nil), 1344 (*VrrpVrTrackIfDump)(nil), 1345 (*VrrpVrUpdate)(nil), 1346 (*VrrpVrUpdateReply)(nil), 1347 (*WantVrrpVrEvents)(nil), 1348 (*WantVrrpVrEventsReply)(nil), 1349 } 1350 }