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