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