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.
17 api "git.fd.io/govpp.git/api"
18 ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types"
19 interface_types "git.fd.io/govpp.git/binapi/interface_types"
20 ip_types "git.fd.io/govpp.git/binapi/ip_types"
21 codec "git.fd.io/govpp.git/codec"
25 // This is a compile-time assertion to ensure that this generated file
26 // is compatible with the GoVPP api package it is being compiled against.
27 // A compilation error at this line likely means your copy of the
28 // GoVPP api package needs to be updated.
29 const _ = api.GoVppAPIPackageIsVersion2
34 VersionCrc = 0x1903f1f1
37 // VrrpVrFlags defines enum 'vrrp_vr_flags'.
38 type VrrpVrFlags uint32
41 VRRP_API_VR_PREEMPT VrrpVrFlags = 1
42 VRRP_API_VR_ACCEPT VrrpVrFlags = 2
43 VRRP_API_VR_UNICAST VrrpVrFlags = 4
44 VRRP_API_VR_IPV6 VrrpVrFlags = 8
48 VrrpVrFlags_name = map[uint32]string{
49 1: "VRRP_API_VR_PREEMPT",
50 2: "VRRP_API_VR_ACCEPT",
51 4: "VRRP_API_VR_UNICAST",
52 8: "VRRP_API_VR_IPV6",
54 VrrpVrFlags_value = map[string]uint32{
55 "VRRP_API_VR_PREEMPT": 1,
56 "VRRP_API_VR_ACCEPT": 2,
57 "VRRP_API_VR_UNICAST": 4,
58 "VRRP_API_VR_IPV6": 8,
62 func (x VrrpVrFlags) String() string {
63 s, ok := VrrpVrFlags_name[uint32(x)]
67 str := func(n uint32) string {
68 s, ok := VrrpVrFlags_name[uint32(n)]
72 return "VrrpVrFlags(" + strconv.Itoa(int(n)) + ")"
74 for i := uint32(0); i <= 32; i++ {
89 // VrrpVrState defines enum 'vrrp_vr_state'.
90 type VrrpVrState uint32
93 VRRP_API_VR_STATE_INIT VrrpVrState = 0
94 VRRP_API_VR_STATE_BACKUP VrrpVrState = 1
95 VRRP_API_VR_STATE_MASTER VrrpVrState = 2
96 VRRP_API_VR_STATE_INTF_DOWN VrrpVrState = 3
100 VrrpVrState_name = map[uint32]string{
101 0: "VRRP_API_VR_STATE_INIT",
102 1: "VRRP_API_VR_STATE_BACKUP",
103 2: "VRRP_API_VR_STATE_MASTER",
104 3: "VRRP_API_VR_STATE_INTF_DOWN",
106 VrrpVrState_value = map[string]uint32{
107 "VRRP_API_VR_STATE_INIT": 0,
108 "VRRP_API_VR_STATE_BACKUP": 1,
109 "VRRP_API_VR_STATE_MASTER": 2,
110 "VRRP_API_VR_STATE_INTF_DOWN": 3,
114 func (x VrrpVrState) String() string {
115 s, ok := VrrpVrState_name[uint32(x)]
119 return "VrrpVrState(" + strconv.Itoa(int(x)) + ")"
122 // VrrpVrConf defines type 'vrrp_vr_conf'.
123 type VrrpVrConf struct {
124 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
125 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
126 Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"`
127 Interval uint16 `binapi:"u16,name=interval" json:"interval,omitempty"`
128 Flags VrrpVrFlags `binapi:"vrrp_vr_flags,name=flags" json:"flags,omitempty"`
131 // VrrpVrKey defines type 'vrrp_vr_key'.
132 type VrrpVrKey struct {
133 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
134 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
135 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
138 // VrrpVrRuntime defines type 'vrrp_vr_runtime'.
139 type VrrpVrRuntime struct {
140 State VrrpVrState `binapi:"vrrp_vr_state,name=state" json:"state,omitempty"`
141 MasterAdvInt uint16 `binapi:"u16,name=master_adv_int" json:"master_adv_int,omitempty"`
142 Skew uint16 `binapi:"u16,name=skew" json:"skew,omitempty"`
143 MasterDownInt uint16 `binapi:"u16,name=master_down_int" json:"master_down_int,omitempty"`
144 Mac ethernet_types.MacAddress `binapi:"mac_address,name=mac" json:"mac,omitempty"`
145 Tracking VrrpVrTracking `binapi:"vrrp_vr_tracking,name=tracking" json:"tracking,omitempty"`
148 // VrrpVrTrackIf defines type 'vrrp_vr_track_if'.
149 type VrrpVrTrackIf struct {
150 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
151 Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"`
154 // VrrpVrTracking defines type 'vrrp_vr_tracking'.
155 type VrrpVrTracking struct {
156 InterfacesDec uint32 `binapi:"u32,name=interfaces_dec" json:"interfaces_dec,omitempty"`
157 Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"`
160 // VrrpVrAddDel defines message 'vrrp_vr_add_del'.
161 type VrrpVrAddDel struct {
162 IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
163 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
164 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
165 Priority uint8 `binapi:"u8,name=priority" json:"priority,omitempty"`
166 Interval uint16 `binapi:"u16,name=interval" json:"interval,omitempty"`
167 Flags VrrpVrFlags `binapi:"vrrp_vr_flags,name=flags" json:"flags,omitempty"`
168 NAddrs uint8 `binapi:"u8,name=n_addrs" json:"-"`
169 Addrs []ip_types.Address `binapi:"address[n_addrs],name=addrs" json:"addrs,omitempty"`
172 func (m *VrrpVrAddDel) Reset() { *m = VrrpVrAddDel{} }
173 func (*VrrpVrAddDel) GetMessageName() string { return "vrrp_vr_add_del" }
174 func (*VrrpVrAddDel) GetCrcString() string { return "6dc4b881" }
175 func (*VrrpVrAddDel) GetMessageType() api.MessageType {
176 return api.RequestMessage
179 func (m *VrrpVrAddDel) Size() (size int) {
184 size += 4 // m.SwIfIndex
186 size += 1 // m.Priority
187 size += 2 // m.Interval
189 size += 1 // m.NAddrs
190 for j1 := 0; j1 < len(m.Addrs); j1++ {
191 var s1 ip_types.Address
193 if j1 < len(m.Addrs) {
197 size += 1 * 16 // s1.Un
201 func (m *VrrpVrAddDel) Marshal(b []byte) ([]byte, error) {
203 b = make([]byte, m.Size())
205 buf := codec.NewBuffer(b)
206 buf.EncodeUint8(m.IsAdd)
207 buf.EncodeUint32(uint32(m.SwIfIndex))
208 buf.EncodeUint8(m.VrID)
209 buf.EncodeUint8(m.Priority)
210 buf.EncodeUint16(m.Interval)
211 buf.EncodeUint32(uint32(m.Flags))
212 buf.EncodeUint8(uint8(len(m.Addrs)))
213 for j0 := 0; j0 < len(m.Addrs); j0++ {
214 var v0 ip_types.Address // Addrs
215 if j0 < len(m.Addrs) {
218 buf.EncodeUint8(uint8(v0.Af))
219 buf.EncodeBytes(v0.Un.XXX_UnionData[:], 16)
221 return buf.Bytes(), nil
223 func (m *VrrpVrAddDel) Unmarshal(b []byte) error {
224 buf := codec.NewBuffer(b)
225 m.IsAdd = buf.DecodeUint8()
226 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
227 m.VrID = buf.DecodeUint8()
228 m.Priority = buf.DecodeUint8()
229 m.Interval = buf.DecodeUint16()
230 m.Flags = VrrpVrFlags(buf.DecodeUint32())
231 m.NAddrs = buf.DecodeUint8()
232 m.Addrs = make([]ip_types.Address, m.NAddrs)
233 for j0 := 0; j0 < len(m.Addrs); j0++ {
234 m.Addrs[j0].Af = ip_types.AddressFamily(buf.DecodeUint8())
235 copy(m.Addrs[j0].Un.XXX_UnionData[:], buf.DecodeBytes(16))
240 // VrrpVrAddDelReply defines message 'vrrp_vr_add_del_reply'.
241 type VrrpVrAddDelReply struct {
242 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
245 func (m *VrrpVrAddDelReply) Reset() { *m = VrrpVrAddDelReply{} }
246 func (*VrrpVrAddDelReply) GetMessageName() string { return "vrrp_vr_add_del_reply" }
247 func (*VrrpVrAddDelReply) GetCrcString() string { return "e8d4e804" }
248 func (*VrrpVrAddDelReply) GetMessageType() api.MessageType {
249 return api.ReplyMessage
252 func (m *VrrpVrAddDelReply) Size() (size int) {
256 size += 4 // m.Retval
259 func (m *VrrpVrAddDelReply) Marshal(b []byte) ([]byte, error) {
261 b = make([]byte, m.Size())
263 buf := codec.NewBuffer(b)
264 buf.EncodeInt32(m.Retval)
265 return buf.Bytes(), nil
267 func (m *VrrpVrAddDelReply) Unmarshal(b []byte) error {
268 buf := codec.NewBuffer(b)
269 m.Retval = buf.DecodeInt32()
273 // VrrpVrDetails defines message 'vrrp_vr_details'.
274 type VrrpVrDetails struct {
275 Config VrrpVrConf `binapi:"vrrp_vr_conf,name=config" json:"config,omitempty"`
276 Runtime VrrpVrRuntime `binapi:"vrrp_vr_runtime,name=runtime" json:"runtime,omitempty"`
277 NAddrs uint8 `binapi:"u8,name=n_addrs" json:"-"`
278 Addrs []ip_types.Address `binapi:"address[n_addrs],name=addrs" json:"addrs,omitempty"`
281 func (m *VrrpVrDetails) Reset() { *m = VrrpVrDetails{} }
282 func (*VrrpVrDetails) GetMessageName() string { return "vrrp_vr_details" }
283 func (*VrrpVrDetails) GetCrcString() string { return "0412fa71" }
284 func (*VrrpVrDetails) GetMessageType() api.MessageType {
285 return api.ReplyMessage
288 func (m *VrrpVrDetails) Size() (size int) {
292 size += 4 // m.Config.SwIfIndex
293 size += 1 // m.Config.VrID
294 size += 1 // m.Config.Priority
295 size += 2 // m.Config.Interval
296 size += 4 // m.Config.Flags
297 size += 4 // m.Runtime.State
298 size += 2 // m.Runtime.MasterAdvInt
299 size += 2 // m.Runtime.Skew
300 size += 2 // m.Runtime.MasterDownInt
301 size += 1 * 6 // m.Runtime.Mac
302 size += 4 // m.Runtime.Tracking.InterfacesDec
303 size += 1 // m.Runtime.Tracking.Priority
304 size += 1 // m.NAddrs
305 for j1 := 0; j1 < len(m.Addrs); j1++ {
306 var s1 ip_types.Address
308 if j1 < len(m.Addrs) {
312 size += 1 * 16 // s1.Un
316 func (m *VrrpVrDetails) Marshal(b []byte) ([]byte, error) {
318 b = make([]byte, m.Size())
320 buf := codec.NewBuffer(b)
321 buf.EncodeUint32(uint32(m.Config.SwIfIndex))
322 buf.EncodeUint8(m.Config.VrID)
323 buf.EncodeUint8(m.Config.Priority)
324 buf.EncodeUint16(m.Config.Interval)
325 buf.EncodeUint32(uint32(m.Config.Flags))
326 buf.EncodeUint32(uint32(m.Runtime.State))
327 buf.EncodeUint16(m.Runtime.MasterAdvInt)
328 buf.EncodeUint16(m.Runtime.Skew)
329 buf.EncodeUint16(m.Runtime.MasterDownInt)
330 buf.EncodeBytes(m.Runtime.Mac[:], 6)
331 buf.EncodeUint32(m.Runtime.Tracking.InterfacesDec)
332 buf.EncodeUint8(m.Runtime.Tracking.Priority)
333 buf.EncodeUint8(uint8(len(m.Addrs)))
334 for j0 := 0; j0 < len(m.Addrs); j0++ {
335 var v0 ip_types.Address // Addrs
336 if j0 < len(m.Addrs) {
339 buf.EncodeUint8(uint8(v0.Af))
340 buf.EncodeBytes(v0.Un.XXX_UnionData[:], 16)
342 return buf.Bytes(), nil
344 func (m *VrrpVrDetails) Unmarshal(b []byte) error {
345 buf := codec.NewBuffer(b)
346 m.Config.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
347 m.Config.VrID = buf.DecodeUint8()
348 m.Config.Priority = buf.DecodeUint8()
349 m.Config.Interval = buf.DecodeUint16()
350 m.Config.Flags = VrrpVrFlags(buf.DecodeUint32())
351 m.Runtime.State = VrrpVrState(buf.DecodeUint32())
352 m.Runtime.MasterAdvInt = buf.DecodeUint16()
353 m.Runtime.Skew = buf.DecodeUint16()
354 m.Runtime.MasterDownInt = buf.DecodeUint16()
355 copy(m.Runtime.Mac[:], buf.DecodeBytes(6))
356 m.Runtime.Tracking.InterfacesDec = buf.DecodeUint32()
357 m.Runtime.Tracking.Priority = buf.DecodeUint8()
358 m.NAddrs = buf.DecodeUint8()
359 m.Addrs = make([]ip_types.Address, m.NAddrs)
360 for j0 := 0; j0 < len(m.Addrs); j0++ {
361 m.Addrs[j0].Af = ip_types.AddressFamily(buf.DecodeUint8())
362 copy(m.Addrs[j0].Un.XXX_UnionData[:], buf.DecodeBytes(16))
367 // VrrpVrDump defines message 'vrrp_vr_dump'.
368 type VrrpVrDump struct {
369 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
372 func (m *VrrpVrDump) Reset() { *m = VrrpVrDump{} }
373 func (*VrrpVrDump) GetMessageName() string { return "vrrp_vr_dump" }
374 func (*VrrpVrDump) GetCrcString() string { return "f9e6675e" }
375 func (*VrrpVrDump) GetMessageType() api.MessageType {
376 return api.RequestMessage
379 func (m *VrrpVrDump) Size() (size int) {
383 size += 4 // m.SwIfIndex
386 func (m *VrrpVrDump) Marshal(b []byte) ([]byte, error) {
388 b = make([]byte, m.Size())
390 buf := codec.NewBuffer(b)
391 buf.EncodeUint32(uint32(m.SwIfIndex))
392 return buf.Bytes(), nil
394 func (m *VrrpVrDump) Unmarshal(b []byte) error {
395 buf := codec.NewBuffer(b)
396 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
400 // VrrpVrPeerDetails defines message 'vrrp_vr_peer_details'.
401 type VrrpVrPeerDetails struct {
402 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
403 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
404 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
405 NPeerAddrs uint8 `binapi:"u8,name=n_peer_addrs" json:"-"`
406 PeerAddrs []ip_types.Address `binapi:"address[n_peer_addrs],name=peer_addrs" json:"peer_addrs,omitempty"`
409 func (m *VrrpVrPeerDetails) Reset() { *m = VrrpVrPeerDetails{} }
410 func (*VrrpVrPeerDetails) GetMessageName() string { return "vrrp_vr_peer_details" }
411 func (*VrrpVrPeerDetails) GetCrcString() string { return "abd9145e" }
412 func (*VrrpVrPeerDetails) GetMessageType() api.MessageType {
413 return api.RequestMessage
416 func (m *VrrpVrPeerDetails) Size() (size int) {
420 size += 4 // m.SwIfIndex
422 size += 1 // m.IsIPv6
423 size += 1 // m.NPeerAddrs
424 for j1 := 0; j1 < len(m.PeerAddrs); j1++ {
425 var s1 ip_types.Address
427 if j1 < len(m.PeerAddrs) {
431 size += 1 * 16 // s1.Un
435 func (m *VrrpVrPeerDetails) Marshal(b []byte) ([]byte, error) {
437 b = make([]byte, m.Size())
439 buf := codec.NewBuffer(b)
440 buf.EncodeUint32(uint32(m.SwIfIndex))
441 buf.EncodeUint8(m.VrID)
442 buf.EncodeUint8(m.IsIPv6)
443 buf.EncodeUint8(uint8(len(m.PeerAddrs)))
444 for j0 := 0; j0 < len(m.PeerAddrs); j0++ {
445 var v0 ip_types.Address // PeerAddrs
446 if j0 < len(m.PeerAddrs) {
449 buf.EncodeUint8(uint8(v0.Af))
450 buf.EncodeBytes(v0.Un.XXX_UnionData[:], 16)
452 return buf.Bytes(), nil
454 func (m *VrrpVrPeerDetails) Unmarshal(b []byte) error {
455 buf := codec.NewBuffer(b)
456 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
457 m.VrID = buf.DecodeUint8()
458 m.IsIPv6 = buf.DecodeUint8()
459 m.NPeerAddrs = buf.DecodeUint8()
460 m.PeerAddrs = make([]ip_types.Address, m.NPeerAddrs)
461 for j0 := 0; j0 < len(m.PeerAddrs); j0++ {
462 m.PeerAddrs[j0].Af = ip_types.AddressFamily(buf.DecodeUint8())
463 copy(m.PeerAddrs[j0].Un.XXX_UnionData[:], buf.DecodeBytes(16))
468 // VrrpVrPeerDump defines message 'vrrp_vr_peer_dump'.
469 type VrrpVrPeerDump struct {
470 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
471 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
472 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
475 func (m *VrrpVrPeerDump) Reset() { *m = VrrpVrPeerDump{} }
476 func (*VrrpVrPeerDump) GetMessageName() string { return "vrrp_vr_peer_dump" }
477 func (*VrrpVrPeerDump) GetCrcString() string { return "6fa3f7c4" }
478 func (*VrrpVrPeerDump) GetMessageType() api.MessageType {
479 return api.RequestMessage
482 func (m *VrrpVrPeerDump) Size() (size int) {
486 size += 4 // m.SwIfIndex
487 size += 1 // m.IsIPv6
491 func (m *VrrpVrPeerDump) Marshal(b []byte) ([]byte, error) {
493 b = make([]byte, m.Size())
495 buf := codec.NewBuffer(b)
496 buf.EncodeUint32(uint32(m.SwIfIndex))
497 buf.EncodeUint8(m.IsIPv6)
498 buf.EncodeUint8(m.VrID)
499 return buf.Bytes(), nil
501 func (m *VrrpVrPeerDump) Unmarshal(b []byte) error {
502 buf := codec.NewBuffer(b)
503 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
504 m.IsIPv6 = buf.DecodeUint8()
505 m.VrID = buf.DecodeUint8()
509 // VrrpVrSetPeers defines message 'vrrp_vr_set_peers'.
510 type VrrpVrSetPeers struct {
511 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
512 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
513 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
514 NAddrs uint8 `binapi:"u8,name=n_addrs" json:"-"`
515 Addrs []ip_types.Address `binapi:"address[n_addrs],name=addrs" json:"addrs,omitempty"`
518 func (m *VrrpVrSetPeers) Reset() { *m = VrrpVrSetPeers{} }
519 func (*VrrpVrSetPeers) GetMessageName() string { return "vrrp_vr_set_peers" }
520 func (*VrrpVrSetPeers) GetCrcString() string { return "baa2e52b" }
521 func (*VrrpVrSetPeers) GetMessageType() api.MessageType {
522 return api.RequestMessage
525 func (m *VrrpVrSetPeers) Size() (size int) {
529 size += 4 // m.SwIfIndex
531 size += 1 // m.IsIPv6
532 size += 1 // m.NAddrs
533 for j1 := 0; j1 < len(m.Addrs); j1++ {
534 var s1 ip_types.Address
536 if j1 < len(m.Addrs) {
540 size += 1 * 16 // s1.Un
544 func (m *VrrpVrSetPeers) Marshal(b []byte) ([]byte, error) {
546 b = make([]byte, m.Size())
548 buf := codec.NewBuffer(b)
549 buf.EncodeUint32(uint32(m.SwIfIndex))
550 buf.EncodeUint8(m.VrID)
551 buf.EncodeUint8(m.IsIPv6)
552 buf.EncodeUint8(uint8(len(m.Addrs)))
553 for j0 := 0; j0 < len(m.Addrs); j0++ {
554 var v0 ip_types.Address // Addrs
555 if j0 < len(m.Addrs) {
558 buf.EncodeUint8(uint8(v0.Af))
559 buf.EncodeBytes(v0.Un.XXX_UnionData[:], 16)
561 return buf.Bytes(), nil
563 func (m *VrrpVrSetPeers) Unmarshal(b []byte) error {
564 buf := codec.NewBuffer(b)
565 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
566 m.VrID = buf.DecodeUint8()
567 m.IsIPv6 = buf.DecodeUint8()
568 m.NAddrs = buf.DecodeUint8()
569 m.Addrs = make([]ip_types.Address, m.NAddrs)
570 for j0 := 0; j0 < len(m.Addrs); j0++ {
571 m.Addrs[j0].Af = ip_types.AddressFamily(buf.DecodeUint8())
572 copy(m.Addrs[j0].Un.XXX_UnionData[:], buf.DecodeBytes(16))
577 // VrrpVrSetPeersReply defines message 'vrrp_vr_set_peers_reply'.
578 type VrrpVrSetPeersReply struct {
579 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
582 func (m *VrrpVrSetPeersReply) Reset() { *m = VrrpVrSetPeersReply{} }
583 func (*VrrpVrSetPeersReply) GetMessageName() string { return "vrrp_vr_set_peers_reply" }
584 func (*VrrpVrSetPeersReply) GetCrcString() string { return "e8d4e804" }
585 func (*VrrpVrSetPeersReply) GetMessageType() api.MessageType {
586 return api.ReplyMessage
589 func (m *VrrpVrSetPeersReply) Size() (size int) {
593 size += 4 // m.Retval
596 func (m *VrrpVrSetPeersReply) Marshal(b []byte) ([]byte, error) {
598 b = make([]byte, m.Size())
600 buf := codec.NewBuffer(b)
601 buf.EncodeInt32(m.Retval)
602 return buf.Bytes(), nil
604 func (m *VrrpVrSetPeersReply) Unmarshal(b []byte) error {
605 buf := codec.NewBuffer(b)
606 m.Retval = buf.DecodeInt32()
610 // VrrpVrStartStop defines message 'vrrp_vr_start_stop'.
611 type VrrpVrStartStop struct {
612 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
613 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
614 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
615 IsStart uint8 `binapi:"u8,name=is_start" json:"is_start,omitempty"`
618 func (m *VrrpVrStartStop) Reset() { *m = VrrpVrStartStop{} }
619 func (*VrrpVrStartStop) GetMessageName() string { return "vrrp_vr_start_stop" }
620 func (*VrrpVrStartStop) GetCrcString() string { return "0662a3b7" }
621 func (*VrrpVrStartStop) GetMessageType() api.MessageType {
622 return api.RequestMessage
625 func (m *VrrpVrStartStop) Size() (size int) {
629 size += 4 // m.SwIfIndex
631 size += 1 // m.IsIPv6
632 size += 1 // m.IsStart
635 func (m *VrrpVrStartStop) Marshal(b []byte) ([]byte, error) {
637 b = make([]byte, m.Size())
639 buf := codec.NewBuffer(b)
640 buf.EncodeUint32(uint32(m.SwIfIndex))
641 buf.EncodeUint8(m.VrID)
642 buf.EncodeUint8(m.IsIPv6)
643 buf.EncodeUint8(m.IsStart)
644 return buf.Bytes(), nil
646 func (m *VrrpVrStartStop) Unmarshal(b []byte) error {
647 buf := codec.NewBuffer(b)
648 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
649 m.VrID = buf.DecodeUint8()
650 m.IsIPv6 = buf.DecodeUint8()
651 m.IsStart = buf.DecodeUint8()
655 // VrrpVrStartStopReply defines message 'vrrp_vr_start_stop_reply'.
656 type VrrpVrStartStopReply struct {
657 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
660 func (m *VrrpVrStartStopReply) Reset() { *m = VrrpVrStartStopReply{} }
661 func (*VrrpVrStartStopReply) GetMessageName() string { return "vrrp_vr_start_stop_reply" }
662 func (*VrrpVrStartStopReply) GetCrcString() string { return "e8d4e804" }
663 func (*VrrpVrStartStopReply) GetMessageType() api.MessageType {
664 return api.ReplyMessage
667 func (m *VrrpVrStartStopReply) Size() (size int) {
671 size += 4 // m.Retval
674 func (m *VrrpVrStartStopReply) Marshal(b []byte) ([]byte, error) {
676 b = make([]byte, m.Size())
678 buf := codec.NewBuffer(b)
679 buf.EncodeInt32(m.Retval)
680 return buf.Bytes(), nil
682 func (m *VrrpVrStartStopReply) Unmarshal(b []byte) error {
683 buf := codec.NewBuffer(b)
684 m.Retval = buf.DecodeInt32()
688 // VrrpVrTrackIfAddDel defines message 'vrrp_vr_track_if_add_del'.
689 type VrrpVrTrackIfAddDel struct {
690 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
691 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
692 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
693 IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
694 NIfs uint8 `binapi:"u8,name=n_ifs" json:"-"`
695 Ifs []VrrpVrTrackIf `binapi:"vrrp_vr_track_if[n_ifs],name=ifs" json:"ifs,omitempty"`
698 func (m *VrrpVrTrackIfAddDel) Reset() { *m = VrrpVrTrackIfAddDel{} }
699 func (*VrrpVrTrackIfAddDel) GetMessageName() string { return "vrrp_vr_track_if_add_del" }
700 func (*VrrpVrTrackIfAddDel) GetCrcString() string { return "337f4ba4" }
701 func (*VrrpVrTrackIfAddDel) GetMessageType() api.MessageType {
702 return api.RequestMessage
705 func (m *VrrpVrTrackIfAddDel) Size() (size int) {
709 size += 4 // m.SwIfIndex
710 size += 1 // m.IsIPv6
714 for j1 := 0; j1 < len(m.Ifs); j1++ {
720 size += 4 // s1.SwIfIndex
721 size += 1 // s1.Priority
725 func (m *VrrpVrTrackIfAddDel) Marshal(b []byte) ([]byte, error) {
727 b = make([]byte, m.Size())
729 buf := codec.NewBuffer(b)
730 buf.EncodeUint32(uint32(m.SwIfIndex))
731 buf.EncodeUint8(m.IsIPv6)
732 buf.EncodeUint8(m.VrID)
733 buf.EncodeUint8(m.IsAdd)
734 buf.EncodeUint8(uint8(len(m.Ifs)))
735 for j0 := 0; j0 < len(m.Ifs); j0++ {
736 var v0 VrrpVrTrackIf // Ifs
740 buf.EncodeUint32(uint32(v0.SwIfIndex))
741 buf.EncodeUint8(v0.Priority)
743 return buf.Bytes(), nil
745 func (m *VrrpVrTrackIfAddDel) Unmarshal(b []byte) error {
746 buf := codec.NewBuffer(b)
747 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
748 m.IsIPv6 = buf.DecodeUint8()
749 m.VrID = buf.DecodeUint8()
750 m.IsAdd = buf.DecodeUint8()
751 m.NIfs = buf.DecodeUint8()
752 m.Ifs = make([]VrrpVrTrackIf, m.NIfs)
753 for j0 := 0; j0 < len(m.Ifs); j0++ {
754 m.Ifs[j0].SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
755 m.Ifs[j0].Priority = buf.DecodeUint8()
760 // VrrpVrTrackIfAddDelReply defines message 'vrrp_vr_track_if_add_del_reply'.
761 type VrrpVrTrackIfAddDelReply struct {
762 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
765 func (m *VrrpVrTrackIfAddDelReply) Reset() { *m = VrrpVrTrackIfAddDelReply{} }
766 func (*VrrpVrTrackIfAddDelReply) GetMessageName() string { return "vrrp_vr_track_if_add_del_reply" }
767 func (*VrrpVrTrackIfAddDelReply) GetCrcString() string { return "e8d4e804" }
768 func (*VrrpVrTrackIfAddDelReply) GetMessageType() api.MessageType {
769 return api.ReplyMessage
772 func (m *VrrpVrTrackIfAddDelReply) Size() (size int) {
776 size += 4 // m.Retval
779 func (m *VrrpVrTrackIfAddDelReply) Marshal(b []byte) ([]byte, error) {
781 b = make([]byte, m.Size())
783 buf := codec.NewBuffer(b)
784 buf.EncodeInt32(m.Retval)
785 return buf.Bytes(), nil
787 func (m *VrrpVrTrackIfAddDelReply) Unmarshal(b []byte) error {
788 buf := codec.NewBuffer(b)
789 m.Retval = buf.DecodeInt32()
793 // VrrpVrTrackIfDetails defines message 'vrrp_vr_track_if_details'.
794 type VrrpVrTrackIfDetails struct {
795 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
796 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
797 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
798 NIfs uint8 `binapi:"u8,name=n_ifs" json:"-"`
799 Ifs []VrrpVrTrackIf `binapi:"vrrp_vr_track_if[n_ifs],name=ifs" json:"ifs,omitempty"`
802 func (m *VrrpVrTrackIfDetails) Reset() { *m = VrrpVrTrackIfDetails{} }
803 func (*VrrpVrTrackIfDetails) GetMessageName() string { return "vrrp_vr_track_if_details" }
804 func (*VrrpVrTrackIfDetails) GetCrcString() string { return "99bcca9c" }
805 func (*VrrpVrTrackIfDetails) GetMessageType() api.MessageType {
806 return api.RequestMessage
809 func (m *VrrpVrTrackIfDetails) Size() (size int) {
813 size += 4 // m.SwIfIndex
815 size += 1 // m.IsIPv6
817 for j1 := 0; j1 < len(m.Ifs); j1++ {
823 size += 4 // s1.SwIfIndex
824 size += 1 // s1.Priority
828 func (m *VrrpVrTrackIfDetails) Marshal(b []byte) ([]byte, error) {
830 b = make([]byte, m.Size())
832 buf := codec.NewBuffer(b)
833 buf.EncodeUint32(uint32(m.SwIfIndex))
834 buf.EncodeUint8(m.VrID)
835 buf.EncodeUint8(m.IsIPv6)
836 buf.EncodeUint8(uint8(len(m.Ifs)))
837 for j0 := 0; j0 < len(m.Ifs); j0++ {
838 var v0 VrrpVrTrackIf // Ifs
842 buf.EncodeUint32(uint32(v0.SwIfIndex))
843 buf.EncodeUint8(v0.Priority)
845 return buf.Bytes(), nil
847 func (m *VrrpVrTrackIfDetails) Unmarshal(b []byte) error {
848 buf := codec.NewBuffer(b)
849 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
850 m.VrID = buf.DecodeUint8()
851 m.IsIPv6 = buf.DecodeUint8()
852 m.NIfs = buf.DecodeUint8()
853 m.Ifs = make([]VrrpVrTrackIf, m.NIfs)
854 for j0 := 0; j0 < len(m.Ifs); j0++ {
855 m.Ifs[j0].SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
856 m.Ifs[j0].Priority = buf.DecodeUint8()
861 // VrrpVrTrackIfDump defines message 'vrrp_vr_track_if_dump'.
862 type VrrpVrTrackIfDump struct {
863 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
864 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
865 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
866 DumpAll uint8 `binapi:"u8,name=dump_all" json:"dump_all,omitempty"`
869 func (m *VrrpVrTrackIfDump) Reset() { *m = VrrpVrTrackIfDump{} }
870 func (*VrrpVrTrackIfDump) GetMessageName() string { return "vrrp_vr_track_if_dump" }
871 func (*VrrpVrTrackIfDump) GetCrcString() string { return "a34dfc6d" }
872 func (*VrrpVrTrackIfDump) GetMessageType() api.MessageType {
873 return api.RequestMessage
876 func (m *VrrpVrTrackIfDump) Size() (size int) {
880 size += 4 // m.SwIfIndex
881 size += 1 // m.IsIPv6
883 size += 1 // m.DumpAll
886 func (m *VrrpVrTrackIfDump) Marshal(b []byte) ([]byte, error) {
888 b = make([]byte, m.Size())
890 buf := codec.NewBuffer(b)
891 buf.EncodeUint32(uint32(m.SwIfIndex))
892 buf.EncodeUint8(m.IsIPv6)
893 buf.EncodeUint8(m.VrID)
894 buf.EncodeUint8(m.DumpAll)
895 return buf.Bytes(), nil
897 func (m *VrrpVrTrackIfDump) Unmarshal(b []byte) error {
898 buf := codec.NewBuffer(b)
899 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
900 m.IsIPv6 = buf.DecodeUint8()
901 m.VrID = buf.DecodeUint8()
902 m.DumpAll = buf.DecodeUint8()
906 func init() { file_vrrp_binapi_init() }
907 func file_vrrp_binapi_init() {
908 api.RegisterMessage((*VrrpVrAddDel)(nil), "vrrp_vr_add_del_6dc4b881")
909 api.RegisterMessage((*VrrpVrAddDelReply)(nil), "vrrp_vr_add_del_reply_e8d4e804")
910 api.RegisterMessage((*VrrpVrDetails)(nil), "vrrp_vr_details_0412fa71")
911 api.RegisterMessage((*VrrpVrDump)(nil), "vrrp_vr_dump_f9e6675e")
912 api.RegisterMessage((*VrrpVrPeerDetails)(nil), "vrrp_vr_peer_details_abd9145e")
913 api.RegisterMessage((*VrrpVrPeerDump)(nil), "vrrp_vr_peer_dump_6fa3f7c4")
914 api.RegisterMessage((*VrrpVrSetPeers)(nil), "vrrp_vr_set_peers_baa2e52b")
915 api.RegisterMessage((*VrrpVrSetPeersReply)(nil), "vrrp_vr_set_peers_reply_e8d4e804")
916 api.RegisterMessage((*VrrpVrStartStop)(nil), "vrrp_vr_start_stop_0662a3b7")
917 api.RegisterMessage((*VrrpVrStartStopReply)(nil), "vrrp_vr_start_stop_reply_e8d4e804")
918 api.RegisterMessage((*VrrpVrTrackIfAddDel)(nil), "vrrp_vr_track_if_add_del_337f4ba4")
919 api.RegisterMessage((*VrrpVrTrackIfAddDelReply)(nil), "vrrp_vr_track_if_add_del_reply_e8d4e804")
920 api.RegisterMessage((*VrrpVrTrackIfDetails)(nil), "vrrp_vr_track_if_details_99bcca9c")
921 api.RegisterMessage((*VrrpVrTrackIfDump)(nil), "vrrp_vr_track_if_dump_a34dfc6d")
924 // Messages returns list of all messages in this module.
925 func AllMessages() []api.Message {
926 return []api.Message{
927 (*VrrpVrAddDel)(nil),
928 (*VrrpVrAddDelReply)(nil),
929 (*VrrpVrDetails)(nil),
931 (*VrrpVrPeerDetails)(nil),
932 (*VrrpVrPeerDump)(nil),
933 (*VrrpVrSetPeers)(nil),
934 (*VrrpVrSetPeersReply)(nil),
935 (*VrrpVrStartStop)(nil),
936 (*VrrpVrStartStopReply)(nil),
937 (*VrrpVrTrackIfAddDel)(nil),
938 (*VrrpVrTrackIfAddDelReply)(nil),
939 (*VrrpVrTrackIfDetails)(nil),
940 (*VrrpVrTrackIfDump)(nil),