1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: /usr/share/vpp/api/plugins/vrrp.api.json
7 // Package vrrp contains generated bindings for API file vrrp.api.
19 api "git.fd.io/govpp.git/api"
20 ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types"
21 interface_types "git.fd.io/govpp.git/binapi/interface_types"
22 ip_types "git.fd.io/govpp.git/binapi/ip_types"
23 codec "git.fd.io/govpp.git/codec"
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
35 VersionCrc = 0x6a3c71cd
38 // VrrpVrFlags defines enum 'vrrp_vr_flags'.
39 type VrrpVrFlags uint32
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
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",
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,
63 func (x VrrpVrFlags) String() string {
64 s, ok := VrrpVrFlags_name[uint32(x)]
68 str := func(n uint32) string {
69 s, ok := VrrpVrFlags_name[uint32(n)]
73 return "VrrpVrFlags(" + strconv.Itoa(int(n)) + ")"
75 for i := uint32(0); i <= 32; i++ {
90 // VrrpVrState defines enum 'vrrp_vr_state'.
91 type VrrpVrState uint32
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
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",
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,
115 func (x VrrpVrState) String() string {
116 s, ok := VrrpVrState_name[uint32(x)]
120 return "VrrpVrState(" + strconv.Itoa(int(x)) + ")"
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"`
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"`
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"`
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"`
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"`
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"`
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
180 func (m *VrrpVrAddDel) Size() (size int) {
185 size += 4 // m.SwIfIndex
187 size += 1 // m.Priority
188 size += 2 // m.Interval
190 size += 1 // m.NAddrs
191 for j1 := 0; j1 < len(m.Addrs); j1++ {
192 var s1 ip_types.Address
194 if j1 < len(m.Addrs) {
198 size += 1 * 16 // s1.Un
202 func (m *VrrpVrAddDel) Marshal(b []byte) ([]byte, error) {
204 b = make([]byte, m.Size())
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) {
219 buf.EncodeUint8(uint8(v0.Af))
220 buf.EncodeBytes(v0.Un.XXX_UnionData[:], 16)
222 return buf.Bytes(), nil
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))
241 // VrrpVrAddDelReply defines message 'vrrp_vr_add_del_reply'.
242 type VrrpVrAddDelReply struct {
243 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
253 func (m *VrrpVrAddDelReply) Size() (size int) {
257 size += 4 // m.Retval
260 func (m *VrrpVrAddDelReply) Marshal(b []byte) ([]byte, error) {
262 b = make([]byte, m.Size())
264 buf := codec.NewBuffer(b)
265 buf.EncodeInt32(m.Retval)
266 return buf.Bytes(), nil
268 func (m *VrrpVrAddDelReply) Unmarshal(b []byte) error {
269 buf := codec.NewBuffer(b)
270 m.Retval = buf.DecodeInt32()
274 // VrrpVrDetails defines message 'vrrp_vr_details'.
275 type VrrpVrDetails struct {
276 Config VrrpVrConf `binapi:"vrrp_vr_conf,name=config" json:"config,omitempty"`
277 Runtime VrrpVrRuntime `binapi:"vrrp_vr_runtime,name=runtime" json:"runtime,omitempty"`
278 NAddrs uint8 `binapi:"u8,name=n_addrs" json:"-"`
279 Addrs []ip_types.Address `binapi:"address[n_addrs],name=addrs" json:"addrs,omitempty"`
282 func (m *VrrpVrDetails) Reset() { *m = VrrpVrDetails{} }
283 func (*VrrpVrDetails) GetMessageName() string { return "vrrp_vr_details" }
284 func (*VrrpVrDetails) GetCrcString() string { return "46edcebd" }
285 func (*VrrpVrDetails) GetMessageType() api.MessageType {
286 return api.ReplyMessage
289 func (m *VrrpVrDetails) Size() (size int) {
293 size += 4 // m.Config.SwIfIndex
294 size += 1 // m.Config.VrID
295 size += 1 // m.Config.Priority
296 size += 2 // m.Config.Interval
297 size += 4 // m.Config.Flags
298 size += 4 // m.Runtime.State
299 size += 2 // m.Runtime.MasterAdvInt
300 size += 2 // m.Runtime.Skew
301 size += 2 // m.Runtime.MasterDownInt
302 size += 1 * 6 // m.Runtime.Mac
303 size += 4 // m.Runtime.Tracking.InterfacesDec
304 size += 1 // m.Runtime.Tracking.Priority
305 size += 1 // m.NAddrs
306 for j1 := 0; j1 < len(m.Addrs); j1++ {
307 var s1 ip_types.Address
309 if j1 < len(m.Addrs) {
313 size += 1 * 16 // s1.Un
317 func (m *VrrpVrDetails) Marshal(b []byte) ([]byte, error) {
319 b = make([]byte, m.Size())
321 buf := codec.NewBuffer(b)
322 buf.EncodeUint32(uint32(m.Config.SwIfIndex))
323 buf.EncodeUint8(m.Config.VrID)
324 buf.EncodeUint8(m.Config.Priority)
325 buf.EncodeUint16(m.Config.Interval)
326 buf.EncodeUint32(uint32(m.Config.Flags))
327 buf.EncodeUint32(uint32(m.Runtime.State))
328 buf.EncodeUint16(m.Runtime.MasterAdvInt)
329 buf.EncodeUint16(m.Runtime.Skew)
330 buf.EncodeUint16(m.Runtime.MasterDownInt)
331 buf.EncodeBytes(m.Runtime.Mac[:], 6)
332 buf.EncodeUint32(m.Runtime.Tracking.InterfacesDec)
333 buf.EncodeUint8(m.Runtime.Tracking.Priority)
334 buf.EncodeUint8(uint8(len(m.Addrs)))
335 for j0 := 0; j0 < len(m.Addrs); j0++ {
336 var v0 ip_types.Address // Addrs
337 if j0 < len(m.Addrs) {
340 buf.EncodeUint8(uint8(v0.Af))
341 buf.EncodeBytes(v0.Un.XXX_UnionData[:], 16)
343 return buf.Bytes(), nil
345 func (m *VrrpVrDetails) Unmarshal(b []byte) error {
346 buf := codec.NewBuffer(b)
347 m.Config.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
348 m.Config.VrID = buf.DecodeUint8()
349 m.Config.Priority = buf.DecodeUint8()
350 m.Config.Interval = buf.DecodeUint16()
351 m.Config.Flags = VrrpVrFlags(buf.DecodeUint32())
352 m.Runtime.State = VrrpVrState(buf.DecodeUint32())
353 m.Runtime.MasterAdvInt = buf.DecodeUint16()
354 m.Runtime.Skew = buf.DecodeUint16()
355 m.Runtime.MasterDownInt = buf.DecodeUint16()
356 copy(m.Runtime.Mac[:], buf.DecodeBytes(6))
357 m.Runtime.Tracking.InterfacesDec = buf.DecodeUint32()
358 m.Runtime.Tracking.Priority = buf.DecodeUint8()
359 m.NAddrs = buf.DecodeUint8()
360 m.Addrs = make([]ip_types.Address, m.NAddrs)
361 for j0 := 0; j0 < len(m.Addrs); j0++ {
362 m.Addrs[j0].Af = ip_types.AddressFamily(buf.DecodeUint8())
363 copy(m.Addrs[j0].Un.XXX_UnionData[:], buf.DecodeBytes(16))
368 // VrrpVrDump defines message 'vrrp_vr_dump'.
369 type VrrpVrDump struct {
370 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
373 func (m *VrrpVrDump) Reset() { *m = VrrpVrDump{} }
374 func (*VrrpVrDump) GetMessageName() string { return "vrrp_vr_dump" }
375 func (*VrrpVrDump) GetCrcString() string { return "f9e6675e" }
376 func (*VrrpVrDump) GetMessageType() api.MessageType {
377 return api.RequestMessage
380 func (m *VrrpVrDump) Size() (size int) {
384 size += 4 // m.SwIfIndex
387 func (m *VrrpVrDump) Marshal(b []byte) ([]byte, error) {
389 b = make([]byte, m.Size())
391 buf := codec.NewBuffer(b)
392 buf.EncodeUint32(uint32(m.SwIfIndex))
393 return buf.Bytes(), nil
395 func (m *VrrpVrDump) Unmarshal(b []byte) error {
396 buf := codec.NewBuffer(b)
397 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
401 // VrrpVrEvent defines message 'vrrp_vr_event'.
402 type VrrpVrEvent struct {
403 PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
404 Vr VrrpVrKey `binapi:"vrrp_vr_key,name=vr" json:"vr,omitempty"`
405 OldState VrrpVrState `binapi:"vrrp_vr_state,name=old_state" json:"old_state,omitempty"`
406 NewState VrrpVrState `binapi:"vrrp_vr_state,name=new_state" json:"new_state,omitempty"`
409 func (m *VrrpVrEvent) Reset() { *m = VrrpVrEvent{} }
410 func (*VrrpVrEvent) GetMessageName() string { return "vrrp_vr_event" }
411 func (*VrrpVrEvent) GetCrcString() string { return "c1fea6a5" }
412 func (*VrrpVrEvent) GetMessageType() api.MessageType {
413 return api.EventMessage
416 func (m *VrrpVrEvent) Size() (size int) {
421 size += 4 // m.Vr.SwIfIndex
422 size += 1 // m.Vr.VrID
423 size += 1 // m.Vr.IsIPv6
424 size += 4 // m.OldState
425 size += 4 // m.NewState
428 func (m *VrrpVrEvent) Marshal(b []byte) ([]byte, error) {
430 b = make([]byte, m.Size())
432 buf := codec.NewBuffer(b)
433 buf.EncodeUint32(m.PID)
434 buf.EncodeUint32(uint32(m.Vr.SwIfIndex))
435 buf.EncodeUint8(m.Vr.VrID)
436 buf.EncodeUint8(m.Vr.IsIPv6)
437 buf.EncodeUint32(uint32(m.OldState))
438 buf.EncodeUint32(uint32(m.NewState))
439 return buf.Bytes(), nil
441 func (m *VrrpVrEvent) Unmarshal(b []byte) error {
442 buf := codec.NewBuffer(b)
443 m.PID = buf.DecodeUint32()
444 m.Vr.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
445 m.Vr.VrID = buf.DecodeUint8()
446 m.Vr.IsIPv6 = buf.DecodeUint8()
447 m.OldState = VrrpVrState(buf.DecodeUint32())
448 m.NewState = VrrpVrState(buf.DecodeUint32())
452 // VrrpVrPeerDetails defines message 'vrrp_vr_peer_details'.
453 type VrrpVrPeerDetails struct {
454 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
455 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
456 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
457 NPeerAddrs uint8 `binapi:"u8,name=n_peer_addrs" json:"-"`
458 PeerAddrs []ip_types.Address `binapi:"address[n_peer_addrs],name=peer_addrs" json:"peer_addrs,omitempty"`
461 func (m *VrrpVrPeerDetails) Reset() { *m = VrrpVrPeerDetails{} }
462 func (*VrrpVrPeerDetails) GetMessageName() string { return "vrrp_vr_peer_details" }
463 func (*VrrpVrPeerDetails) GetCrcString() string { return "3d99c108" }
464 func (*VrrpVrPeerDetails) GetMessageType() api.MessageType {
465 return api.RequestMessage
468 func (m *VrrpVrPeerDetails) Size() (size int) {
472 size += 4 // m.SwIfIndex
474 size += 1 // m.IsIPv6
475 size += 1 // m.NPeerAddrs
476 for j1 := 0; j1 < len(m.PeerAddrs); j1++ {
477 var s1 ip_types.Address
479 if j1 < len(m.PeerAddrs) {
483 size += 1 * 16 // s1.Un
487 func (m *VrrpVrPeerDetails) Marshal(b []byte) ([]byte, error) {
489 b = make([]byte, m.Size())
491 buf := codec.NewBuffer(b)
492 buf.EncodeUint32(uint32(m.SwIfIndex))
493 buf.EncodeUint8(m.VrID)
494 buf.EncodeUint8(m.IsIPv6)
495 buf.EncodeUint8(uint8(len(m.PeerAddrs)))
496 for j0 := 0; j0 < len(m.PeerAddrs); j0++ {
497 var v0 ip_types.Address // PeerAddrs
498 if j0 < len(m.PeerAddrs) {
501 buf.EncodeUint8(uint8(v0.Af))
502 buf.EncodeBytes(v0.Un.XXX_UnionData[:], 16)
504 return buf.Bytes(), nil
506 func (m *VrrpVrPeerDetails) Unmarshal(b []byte) error {
507 buf := codec.NewBuffer(b)
508 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
509 m.VrID = buf.DecodeUint8()
510 m.IsIPv6 = buf.DecodeUint8()
511 m.NPeerAddrs = buf.DecodeUint8()
512 m.PeerAddrs = make([]ip_types.Address, m.NPeerAddrs)
513 for j0 := 0; j0 < len(m.PeerAddrs); j0++ {
514 m.PeerAddrs[j0].Af = ip_types.AddressFamily(buf.DecodeUint8())
515 copy(m.PeerAddrs[j0].Un.XXX_UnionData[:], buf.DecodeBytes(16))
520 // VrrpVrPeerDump defines message 'vrrp_vr_peer_dump'.
521 type VrrpVrPeerDump struct {
522 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
523 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
524 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
527 func (m *VrrpVrPeerDump) Reset() { *m = VrrpVrPeerDump{} }
528 func (*VrrpVrPeerDump) GetMessageName() string { return "vrrp_vr_peer_dump" }
529 func (*VrrpVrPeerDump) GetCrcString() string { return "6fa3f7c4" }
530 func (*VrrpVrPeerDump) GetMessageType() api.MessageType {
531 return api.RequestMessage
534 func (m *VrrpVrPeerDump) Size() (size int) {
538 size += 4 // m.SwIfIndex
539 size += 1 // m.IsIPv6
543 func (m *VrrpVrPeerDump) Marshal(b []byte) ([]byte, error) {
545 b = make([]byte, m.Size())
547 buf := codec.NewBuffer(b)
548 buf.EncodeUint32(uint32(m.SwIfIndex))
549 buf.EncodeUint8(m.IsIPv6)
550 buf.EncodeUint8(m.VrID)
551 return buf.Bytes(), nil
553 func (m *VrrpVrPeerDump) Unmarshal(b []byte) error {
554 buf := codec.NewBuffer(b)
555 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
556 m.IsIPv6 = buf.DecodeUint8()
557 m.VrID = buf.DecodeUint8()
561 // VrrpVrSetPeers defines message 'vrrp_vr_set_peers'.
562 type VrrpVrSetPeers struct {
563 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
564 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
565 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
566 NAddrs uint8 `binapi:"u8,name=n_addrs" json:"-"`
567 Addrs []ip_types.Address `binapi:"address[n_addrs],name=addrs" json:"addrs,omitempty"`
570 func (m *VrrpVrSetPeers) Reset() { *m = VrrpVrSetPeers{} }
571 func (*VrrpVrSetPeers) GetMessageName() string { return "vrrp_vr_set_peers" }
572 func (*VrrpVrSetPeers) GetCrcString() string { return "20bec71f" }
573 func (*VrrpVrSetPeers) GetMessageType() api.MessageType {
574 return api.RequestMessage
577 func (m *VrrpVrSetPeers) Size() (size int) {
581 size += 4 // m.SwIfIndex
583 size += 1 // m.IsIPv6
584 size += 1 // m.NAddrs
585 for j1 := 0; j1 < len(m.Addrs); j1++ {
586 var s1 ip_types.Address
588 if j1 < len(m.Addrs) {
592 size += 1 * 16 // s1.Un
596 func (m *VrrpVrSetPeers) Marshal(b []byte) ([]byte, error) {
598 b = make([]byte, m.Size())
600 buf := codec.NewBuffer(b)
601 buf.EncodeUint32(uint32(m.SwIfIndex))
602 buf.EncodeUint8(m.VrID)
603 buf.EncodeUint8(m.IsIPv6)
604 buf.EncodeUint8(uint8(len(m.Addrs)))
605 for j0 := 0; j0 < len(m.Addrs); j0++ {
606 var v0 ip_types.Address // Addrs
607 if j0 < len(m.Addrs) {
610 buf.EncodeUint8(uint8(v0.Af))
611 buf.EncodeBytes(v0.Un.XXX_UnionData[:], 16)
613 return buf.Bytes(), nil
615 func (m *VrrpVrSetPeers) Unmarshal(b []byte) error {
616 buf := codec.NewBuffer(b)
617 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
618 m.VrID = buf.DecodeUint8()
619 m.IsIPv6 = buf.DecodeUint8()
620 m.NAddrs = buf.DecodeUint8()
621 m.Addrs = make([]ip_types.Address, m.NAddrs)
622 for j0 := 0; j0 < len(m.Addrs); j0++ {
623 m.Addrs[j0].Af = ip_types.AddressFamily(buf.DecodeUint8())
624 copy(m.Addrs[j0].Un.XXX_UnionData[:], buf.DecodeBytes(16))
629 // VrrpVrSetPeersReply defines message 'vrrp_vr_set_peers_reply'.
630 type VrrpVrSetPeersReply struct {
631 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
634 func (m *VrrpVrSetPeersReply) Reset() { *m = VrrpVrSetPeersReply{} }
635 func (*VrrpVrSetPeersReply) GetMessageName() string { return "vrrp_vr_set_peers_reply" }
636 func (*VrrpVrSetPeersReply) GetCrcString() string { return "e8d4e804" }
637 func (*VrrpVrSetPeersReply) GetMessageType() api.MessageType {
638 return api.ReplyMessage
641 func (m *VrrpVrSetPeersReply) Size() (size int) {
645 size += 4 // m.Retval
648 func (m *VrrpVrSetPeersReply) Marshal(b []byte) ([]byte, error) {
650 b = make([]byte, m.Size())
652 buf := codec.NewBuffer(b)
653 buf.EncodeInt32(m.Retval)
654 return buf.Bytes(), nil
656 func (m *VrrpVrSetPeersReply) Unmarshal(b []byte) error {
657 buf := codec.NewBuffer(b)
658 m.Retval = buf.DecodeInt32()
662 // VrrpVrStartStop defines message 'vrrp_vr_start_stop'.
663 type VrrpVrStartStop struct {
664 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
665 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
666 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
667 IsStart uint8 `binapi:"u8,name=is_start" json:"is_start,omitempty"`
670 func (m *VrrpVrStartStop) Reset() { *m = VrrpVrStartStop{} }
671 func (*VrrpVrStartStop) GetMessageName() string { return "vrrp_vr_start_stop" }
672 func (*VrrpVrStartStop) GetCrcString() string { return "0662a3b7" }
673 func (*VrrpVrStartStop) GetMessageType() api.MessageType {
674 return api.RequestMessage
677 func (m *VrrpVrStartStop) Size() (size int) {
681 size += 4 // m.SwIfIndex
683 size += 1 // m.IsIPv6
684 size += 1 // m.IsStart
687 func (m *VrrpVrStartStop) Marshal(b []byte) ([]byte, error) {
689 b = make([]byte, m.Size())
691 buf := codec.NewBuffer(b)
692 buf.EncodeUint32(uint32(m.SwIfIndex))
693 buf.EncodeUint8(m.VrID)
694 buf.EncodeUint8(m.IsIPv6)
695 buf.EncodeUint8(m.IsStart)
696 return buf.Bytes(), nil
698 func (m *VrrpVrStartStop) Unmarshal(b []byte) error {
699 buf := codec.NewBuffer(b)
700 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
701 m.VrID = buf.DecodeUint8()
702 m.IsIPv6 = buf.DecodeUint8()
703 m.IsStart = buf.DecodeUint8()
707 // VrrpVrStartStopReply defines message 'vrrp_vr_start_stop_reply'.
708 type VrrpVrStartStopReply struct {
709 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
712 func (m *VrrpVrStartStopReply) Reset() { *m = VrrpVrStartStopReply{} }
713 func (*VrrpVrStartStopReply) GetMessageName() string { return "vrrp_vr_start_stop_reply" }
714 func (*VrrpVrStartStopReply) GetCrcString() string { return "e8d4e804" }
715 func (*VrrpVrStartStopReply) GetMessageType() api.MessageType {
716 return api.ReplyMessage
719 func (m *VrrpVrStartStopReply) Size() (size int) {
723 size += 4 // m.Retval
726 func (m *VrrpVrStartStopReply) Marshal(b []byte) ([]byte, error) {
728 b = make([]byte, m.Size())
730 buf := codec.NewBuffer(b)
731 buf.EncodeInt32(m.Retval)
732 return buf.Bytes(), nil
734 func (m *VrrpVrStartStopReply) Unmarshal(b []byte) error {
735 buf := codec.NewBuffer(b)
736 m.Retval = buf.DecodeInt32()
740 // VrrpVrTrackIfAddDel defines message 'vrrp_vr_track_if_add_del'.
741 type VrrpVrTrackIfAddDel struct {
742 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
743 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
744 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
745 IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
746 NIfs uint8 `binapi:"u8,name=n_ifs" json:"-"`
747 Ifs []VrrpVrTrackIf `binapi:"vrrp_vr_track_if[n_ifs],name=ifs" json:"ifs,omitempty"`
750 func (m *VrrpVrTrackIfAddDel) Reset() { *m = VrrpVrTrackIfAddDel{} }
751 func (*VrrpVrTrackIfAddDel) GetMessageName() string { return "vrrp_vr_track_if_add_del" }
752 func (*VrrpVrTrackIfAddDel) GetCrcString() string { return "d67df299" }
753 func (*VrrpVrTrackIfAddDel) GetMessageType() api.MessageType {
754 return api.RequestMessage
757 func (m *VrrpVrTrackIfAddDel) Size() (size int) {
761 size += 4 // m.SwIfIndex
762 size += 1 // m.IsIPv6
766 for j1 := 0; j1 < len(m.Ifs); j1++ {
772 size += 4 // s1.SwIfIndex
773 size += 1 // s1.Priority
777 func (m *VrrpVrTrackIfAddDel) Marshal(b []byte) ([]byte, error) {
779 b = make([]byte, m.Size())
781 buf := codec.NewBuffer(b)
782 buf.EncodeUint32(uint32(m.SwIfIndex))
783 buf.EncodeUint8(m.IsIPv6)
784 buf.EncodeUint8(m.VrID)
785 buf.EncodeUint8(m.IsAdd)
786 buf.EncodeUint8(uint8(len(m.Ifs)))
787 for j0 := 0; j0 < len(m.Ifs); j0++ {
788 var v0 VrrpVrTrackIf // Ifs
792 buf.EncodeUint32(uint32(v0.SwIfIndex))
793 buf.EncodeUint8(v0.Priority)
795 return buf.Bytes(), nil
797 func (m *VrrpVrTrackIfAddDel) Unmarshal(b []byte) error {
798 buf := codec.NewBuffer(b)
799 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
800 m.IsIPv6 = buf.DecodeUint8()
801 m.VrID = buf.DecodeUint8()
802 m.IsAdd = buf.DecodeUint8()
803 m.NIfs = buf.DecodeUint8()
804 m.Ifs = make([]VrrpVrTrackIf, m.NIfs)
805 for j0 := 0; j0 < len(m.Ifs); j0++ {
806 m.Ifs[j0].SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
807 m.Ifs[j0].Priority = buf.DecodeUint8()
812 // VrrpVrTrackIfAddDelReply defines message 'vrrp_vr_track_if_add_del_reply'.
813 type VrrpVrTrackIfAddDelReply struct {
814 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
817 func (m *VrrpVrTrackIfAddDelReply) Reset() { *m = VrrpVrTrackIfAddDelReply{} }
818 func (*VrrpVrTrackIfAddDelReply) GetMessageName() string { return "vrrp_vr_track_if_add_del_reply" }
819 func (*VrrpVrTrackIfAddDelReply) GetCrcString() string { return "e8d4e804" }
820 func (*VrrpVrTrackIfAddDelReply) GetMessageType() api.MessageType {
821 return api.ReplyMessage
824 func (m *VrrpVrTrackIfAddDelReply) Size() (size int) {
828 size += 4 // m.Retval
831 func (m *VrrpVrTrackIfAddDelReply) Marshal(b []byte) ([]byte, error) {
833 b = make([]byte, m.Size())
835 buf := codec.NewBuffer(b)
836 buf.EncodeInt32(m.Retval)
837 return buf.Bytes(), nil
839 func (m *VrrpVrTrackIfAddDelReply) Unmarshal(b []byte) error {
840 buf := codec.NewBuffer(b)
841 m.Retval = buf.DecodeInt32()
845 // VrrpVrTrackIfDetails defines message 'vrrp_vr_track_if_details'.
846 type VrrpVrTrackIfDetails struct {
847 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
848 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
849 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
850 NIfs uint8 `binapi:"u8,name=n_ifs" json:"-"`
851 Ifs []VrrpVrTrackIf `binapi:"vrrp_vr_track_if[n_ifs],name=ifs" json:"ifs,omitempty"`
854 func (m *VrrpVrTrackIfDetails) Reset() { *m = VrrpVrTrackIfDetails{} }
855 func (*VrrpVrTrackIfDetails) GetMessageName() string { return "vrrp_vr_track_if_details" }
856 func (*VrrpVrTrackIfDetails) GetCrcString() string { return "73c36f81" }
857 func (*VrrpVrTrackIfDetails) GetMessageType() api.MessageType {
858 return api.RequestMessage
861 func (m *VrrpVrTrackIfDetails) Size() (size int) {
865 size += 4 // m.SwIfIndex
867 size += 1 // m.IsIPv6
869 for j1 := 0; j1 < len(m.Ifs); j1++ {
875 size += 4 // s1.SwIfIndex
876 size += 1 // s1.Priority
880 func (m *VrrpVrTrackIfDetails) Marshal(b []byte) ([]byte, error) {
882 b = make([]byte, m.Size())
884 buf := codec.NewBuffer(b)
885 buf.EncodeUint32(uint32(m.SwIfIndex))
886 buf.EncodeUint8(m.VrID)
887 buf.EncodeUint8(m.IsIPv6)
888 buf.EncodeUint8(uint8(len(m.Ifs)))
889 for j0 := 0; j0 < len(m.Ifs); j0++ {
890 var v0 VrrpVrTrackIf // Ifs
894 buf.EncodeUint32(uint32(v0.SwIfIndex))
895 buf.EncodeUint8(v0.Priority)
897 return buf.Bytes(), nil
899 func (m *VrrpVrTrackIfDetails) Unmarshal(b []byte) error {
900 buf := codec.NewBuffer(b)
901 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
902 m.VrID = buf.DecodeUint8()
903 m.IsIPv6 = buf.DecodeUint8()
904 m.NIfs = buf.DecodeUint8()
905 m.Ifs = make([]VrrpVrTrackIf, m.NIfs)
906 for j0 := 0; j0 < len(m.Ifs); j0++ {
907 m.Ifs[j0].SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
908 m.Ifs[j0].Priority = buf.DecodeUint8()
913 // VrrpVrTrackIfDump defines message 'vrrp_vr_track_if_dump'.
914 type VrrpVrTrackIfDump struct {
915 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
916 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
917 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
918 DumpAll uint8 `binapi:"u8,name=dump_all" json:"dump_all,omitempty"`
921 func (m *VrrpVrTrackIfDump) Reset() { *m = VrrpVrTrackIfDump{} }
922 func (*VrrpVrTrackIfDump) GetMessageName() string { return "vrrp_vr_track_if_dump" }
923 func (*VrrpVrTrackIfDump) GetCrcString() string { return "a34dfc6d" }
924 func (*VrrpVrTrackIfDump) GetMessageType() api.MessageType {
925 return api.RequestMessage
928 func (m *VrrpVrTrackIfDump) Size() (size int) {
932 size += 4 // m.SwIfIndex
933 size += 1 // m.IsIPv6
935 size += 1 // m.DumpAll
938 func (m *VrrpVrTrackIfDump) Marshal(b []byte) ([]byte, error) {
940 b = make([]byte, m.Size())
942 buf := codec.NewBuffer(b)
943 buf.EncodeUint32(uint32(m.SwIfIndex))
944 buf.EncodeUint8(m.IsIPv6)
945 buf.EncodeUint8(m.VrID)
946 buf.EncodeUint8(m.DumpAll)
947 return buf.Bytes(), nil
949 func (m *VrrpVrTrackIfDump) Unmarshal(b []byte) error {
950 buf := codec.NewBuffer(b)
951 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
952 m.IsIPv6 = buf.DecodeUint8()
953 m.VrID = buf.DecodeUint8()
954 m.DumpAll = buf.DecodeUint8()
958 // WantVrrpVrEvents defines message 'want_vrrp_vr_events'.
959 type WantVrrpVrEvents struct {
960 EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
961 PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
964 func (m *WantVrrpVrEvents) Reset() { *m = WantVrrpVrEvents{} }
965 func (*WantVrrpVrEvents) GetMessageName() string { return "want_vrrp_vr_events" }
966 func (*WantVrrpVrEvents) GetCrcString() string { return "c5e2af94" }
967 func (*WantVrrpVrEvents) GetMessageType() api.MessageType {
968 return api.RequestMessage
971 func (m *WantVrrpVrEvents) Size() (size int) {
975 size += 1 // m.EnableDisable
979 func (m *WantVrrpVrEvents) Marshal(b []byte) ([]byte, error) {
981 b = make([]byte, m.Size())
983 buf := codec.NewBuffer(b)
984 buf.EncodeBool(m.EnableDisable)
985 buf.EncodeUint32(m.PID)
986 return buf.Bytes(), nil
988 func (m *WantVrrpVrEvents) Unmarshal(b []byte) error {
989 buf := codec.NewBuffer(b)
990 m.EnableDisable = buf.DecodeBool()
991 m.PID = buf.DecodeUint32()
995 // WantVrrpVrEventsReply defines message 'want_vrrp_vr_events_reply'.
996 type WantVrrpVrEventsReply struct {
997 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1000 func (m *WantVrrpVrEventsReply) Reset() { *m = WantVrrpVrEventsReply{} }
1001 func (*WantVrrpVrEventsReply) GetMessageName() string { return "want_vrrp_vr_events_reply" }
1002 func (*WantVrrpVrEventsReply) GetCrcString() string { return "e8d4e804" }
1003 func (*WantVrrpVrEventsReply) GetMessageType() api.MessageType {
1004 return api.ReplyMessage
1007 func (m *WantVrrpVrEventsReply) Size() (size int) {
1011 size += 4 // m.Retval
1014 func (m *WantVrrpVrEventsReply) Marshal(b []byte) ([]byte, error) {
1016 b = make([]byte, m.Size())
1018 buf := codec.NewBuffer(b)
1019 buf.EncodeInt32(m.Retval)
1020 return buf.Bytes(), nil
1022 func (m *WantVrrpVrEventsReply) Unmarshal(b []byte) error {
1023 buf := codec.NewBuffer(b)
1024 m.Retval = buf.DecodeInt32()
1028 func init() { file_vrrp_binapi_init() }
1029 func file_vrrp_binapi_init() {
1030 api.RegisterMessage((*VrrpVrAddDel)(nil), "vrrp_vr_add_del_c5cf15aa")
1031 api.RegisterMessage((*VrrpVrAddDelReply)(nil), "vrrp_vr_add_del_reply_e8d4e804")
1032 api.RegisterMessage((*VrrpVrDetails)(nil), "vrrp_vr_details_46edcebd")
1033 api.RegisterMessage((*VrrpVrDump)(nil), "vrrp_vr_dump_f9e6675e")
1034 api.RegisterMessage((*VrrpVrEvent)(nil), "vrrp_vr_event_c1fea6a5")
1035 api.RegisterMessage((*VrrpVrPeerDetails)(nil), "vrrp_vr_peer_details_3d99c108")
1036 api.RegisterMessage((*VrrpVrPeerDump)(nil), "vrrp_vr_peer_dump_6fa3f7c4")
1037 api.RegisterMessage((*VrrpVrSetPeers)(nil), "vrrp_vr_set_peers_20bec71f")
1038 api.RegisterMessage((*VrrpVrSetPeersReply)(nil), "vrrp_vr_set_peers_reply_e8d4e804")
1039 api.RegisterMessage((*VrrpVrStartStop)(nil), "vrrp_vr_start_stop_0662a3b7")
1040 api.RegisterMessage((*VrrpVrStartStopReply)(nil), "vrrp_vr_start_stop_reply_e8d4e804")
1041 api.RegisterMessage((*VrrpVrTrackIfAddDel)(nil), "vrrp_vr_track_if_add_del_d67df299")
1042 api.RegisterMessage((*VrrpVrTrackIfAddDelReply)(nil), "vrrp_vr_track_if_add_del_reply_e8d4e804")
1043 api.RegisterMessage((*VrrpVrTrackIfDetails)(nil), "vrrp_vr_track_if_details_73c36f81")
1044 api.RegisterMessage((*VrrpVrTrackIfDump)(nil), "vrrp_vr_track_if_dump_a34dfc6d")
1045 api.RegisterMessage((*WantVrrpVrEvents)(nil), "want_vrrp_vr_events_c5e2af94")
1046 api.RegisterMessage((*WantVrrpVrEventsReply)(nil), "want_vrrp_vr_events_reply_e8d4e804")
1049 // Messages returns list of all messages in this module.
1050 func AllMessages() []api.Message {
1051 return []api.Message{
1052 (*VrrpVrAddDel)(nil),
1053 (*VrrpVrAddDelReply)(nil),
1054 (*VrrpVrDetails)(nil),
1056 (*VrrpVrEvent)(nil),
1057 (*VrrpVrPeerDetails)(nil),
1058 (*VrrpVrPeerDump)(nil),
1059 (*VrrpVrSetPeers)(nil),
1060 (*VrrpVrSetPeersReply)(nil),
1061 (*VrrpVrStartStop)(nil),
1062 (*VrrpVrStartStopReply)(nil),
1063 (*VrrpVrTrackIfAddDel)(nil),
1064 (*VrrpVrTrackIfAddDelReply)(nil),
1065 (*VrrpVrTrackIfDetails)(nil),
1066 (*VrrpVrTrackIfDump)(nil),
1067 (*WantVrrpVrEvents)(nil),
1068 (*WantVrrpVrEventsReply)(nil),