1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0
4 // VPP: 20.05.1-release
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 = 0x1903f1f1
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 "6dc4b881" }
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 "0412fa71" }
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 // VrrpVrPeerDetails defines message 'vrrp_vr_peer_details'.
402 type VrrpVrPeerDetails struct {
403 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
404 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
405 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
406 NPeerAddrs uint8 `binapi:"u8,name=n_peer_addrs" json:"-"`
407 PeerAddrs []ip_types.Address `binapi:"address[n_peer_addrs],name=peer_addrs" json:"peer_addrs,omitempty"`
410 func (m *VrrpVrPeerDetails) Reset() { *m = VrrpVrPeerDetails{} }
411 func (*VrrpVrPeerDetails) GetMessageName() string { return "vrrp_vr_peer_details" }
412 func (*VrrpVrPeerDetails) GetCrcString() string { return "abd9145e" }
413 func (*VrrpVrPeerDetails) GetMessageType() api.MessageType {
414 return api.RequestMessage
417 func (m *VrrpVrPeerDetails) Size() (size int) {
421 size += 4 // m.SwIfIndex
423 size += 1 // m.IsIPv6
424 size += 1 // m.NPeerAddrs
425 for j1 := 0; j1 < len(m.PeerAddrs); j1++ {
426 var s1 ip_types.Address
428 if j1 < len(m.PeerAddrs) {
432 size += 1 * 16 // s1.Un
436 func (m *VrrpVrPeerDetails) Marshal(b []byte) ([]byte, error) {
438 b = make([]byte, m.Size())
440 buf := codec.NewBuffer(b)
441 buf.EncodeUint32(uint32(m.SwIfIndex))
442 buf.EncodeUint8(m.VrID)
443 buf.EncodeUint8(m.IsIPv6)
444 buf.EncodeUint8(uint8(len(m.PeerAddrs)))
445 for j0 := 0; j0 < len(m.PeerAddrs); j0++ {
446 var v0 ip_types.Address // PeerAddrs
447 if j0 < len(m.PeerAddrs) {
450 buf.EncodeUint8(uint8(v0.Af))
451 buf.EncodeBytes(v0.Un.XXX_UnionData[:], 16)
453 return buf.Bytes(), nil
455 func (m *VrrpVrPeerDetails) Unmarshal(b []byte) error {
456 buf := codec.NewBuffer(b)
457 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
458 m.VrID = buf.DecodeUint8()
459 m.IsIPv6 = buf.DecodeUint8()
460 m.NPeerAddrs = buf.DecodeUint8()
461 m.PeerAddrs = make([]ip_types.Address, m.NPeerAddrs)
462 for j0 := 0; j0 < len(m.PeerAddrs); j0++ {
463 m.PeerAddrs[j0].Af = ip_types.AddressFamily(buf.DecodeUint8())
464 copy(m.PeerAddrs[j0].Un.XXX_UnionData[:], buf.DecodeBytes(16))
469 // VrrpVrPeerDump defines message 'vrrp_vr_peer_dump'.
470 type VrrpVrPeerDump struct {
471 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
472 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
473 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
476 func (m *VrrpVrPeerDump) Reset() { *m = VrrpVrPeerDump{} }
477 func (*VrrpVrPeerDump) GetMessageName() string { return "vrrp_vr_peer_dump" }
478 func (*VrrpVrPeerDump) GetCrcString() string { return "6fa3f7c4" }
479 func (*VrrpVrPeerDump) GetMessageType() api.MessageType {
480 return api.RequestMessage
483 func (m *VrrpVrPeerDump) Size() (size int) {
487 size += 4 // m.SwIfIndex
488 size += 1 // m.IsIPv6
492 func (m *VrrpVrPeerDump) Marshal(b []byte) ([]byte, error) {
494 b = make([]byte, m.Size())
496 buf := codec.NewBuffer(b)
497 buf.EncodeUint32(uint32(m.SwIfIndex))
498 buf.EncodeUint8(m.IsIPv6)
499 buf.EncodeUint8(m.VrID)
500 return buf.Bytes(), nil
502 func (m *VrrpVrPeerDump) Unmarshal(b []byte) error {
503 buf := codec.NewBuffer(b)
504 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
505 m.IsIPv6 = buf.DecodeUint8()
506 m.VrID = buf.DecodeUint8()
510 // VrrpVrSetPeers defines message 'vrrp_vr_set_peers'.
511 type VrrpVrSetPeers struct {
512 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
513 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
514 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
515 NAddrs uint8 `binapi:"u8,name=n_addrs" json:"-"`
516 Addrs []ip_types.Address `binapi:"address[n_addrs],name=addrs" json:"addrs,omitempty"`
519 func (m *VrrpVrSetPeers) Reset() { *m = VrrpVrSetPeers{} }
520 func (*VrrpVrSetPeers) GetMessageName() string { return "vrrp_vr_set_peers" }
521 func (*VrrpVrSetPeers) GetCrcString() string { return "baa2e52b" }
522 func (*VrrpVrSetPeers) GetMessageType() api.MessageType {
523 return api.RequestMessage
526 func (m *VrrpVrSetPeers) Size() (size int) {
530 size += 4 // m.SwIfIndex
532 size += 1 // m.IsIPv6
533 size += 1 // m.NAddrs
534 for j1 := 0; j1 < len(m.Addrs); j1++ {
535 var s1 ip_types.Address
537 if j1 < len(m.Addrs) {
541 size += 1 * 16 // s1.Un
545 func (m *VrrpVrSetPeers) Marshal(b []byte) ([]byte, error) {
547 b = make([]byte, m.Size())
549 buf := codec.NewBuffer(b)
550 buf.EncodeUint32(uint32(m.SwIfIndex))
551 buf.EncodeUint8(m.VrID)
552 buf.EncodeUint8(m.IsIPv6)
553 buf.EncodeUint8(uint8(len(m.Addrs)))
554 for j0 := 0; j0 < len(m.Addrs); j0++ {
555 var v0 ip_types.Address // Addrs
556 if j0 < len(m.Addrs) {
559 buf.EncodeUint8(uint8(v0.Af))
560 buf.EncodeBytes(v0.Un.XXX_UnionData[:], 16)
562 return buf.Bytes(), nil
564 func (m *VrrpVrSetPeers) Unmarshal(b []byte) error {
565 buf := codec.NewBuffer(b)
566 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
567 m.VrID = buf.DecodeUint8()
568 m.IsIPv6 = buf.DecodeUint8()
569 m.NAddrs = buf.DecodeUint8()
570 m.Addrs = make([]ip_types.Address, m.NAddrs)
571 for j0 := 0; j0 < len(m.Addrs); j0++ {
572 m.Addrs[j0].Af = ip_types.AddressFamily(buf.DecodeUint8())
573 copy(m.Addrs[j0].Un.XXX_UnionData[:], buf.DecodeBytes(16))
578 // VrrpVrSetPeersReply defines message 'vrrp_vr_set_peers_reply'.
579 type VrrpVrSetPeersReply struct {
580 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
583 func (m *VrrpVrSetPeersReply) Reset() { *m = VrrpVrSetPeersReply{} }
584 func (*VrrpVrSetPeersReply) GetMessageName() string { return "vrrp_vr_set_peers_reply" }
585 func (*VrrpVrSetPeersReply) GetCrcString() string { return "e8d4e804" }
586 func (*VrrpVrSetPeersReply) GetMessageType() api.MessageType {
587 return api.ReplyMessage
590 func (m *VrrpVrSetPeersReply) Size() (size int) {
594 size += 4 // m.Retval
597 func (m *VrrpVrSetPeersReply) Marshal(b []byte) ([]byte, error) {
599 b = make([]byte, m.Size())
601 buf := codec.NewBuffer(b)
602 buf.EncodeInt32(m.Retval)
603 return buf.Bytes(), nil
605 func (m *VrrpVrSetPeersReply) Unmarshal(b []byte) error {
606 buf := codec.NewBuffer(b)
607 m.Retval = buf.DecodeInt32()
611 // VrrpVrStartStop defines message 'vrrp_vr_start_stop'.
612 type VrrpVrStartStop struct {
613 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
614 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
615 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
616 IsStart uint8 `binapi:"u8,name=is_start" json:"is_start,omitempty"`
619 func (m *VrrpVrStartStop) Reset() { *m = VrrpVrStartStop{} }
620 func (*VrrpVrStartStop) GetMessageName() string { return "vrrp_vr_start_stop" }
621 func (*VrrpVrStartStop) GetCrcString() string { return "0662a3b7" }
622 func (*VrrpVrStartStop) GetMessageType() api.MessageType {
623 return api.RequestMessage
626 func (m *VrrpVrStartStop) Size() (size int) {
630 size += 4 // m.SwIfIndex
632 size += 1 // m.IsIPv6
633 size += 1 // m.IsStart
636 func (m *VrrpVrStartStop) Marshal(b []byte) ([]byte, error) {
638 b = make([]byte, m.Size())
640 buf := codec.NewBuffer(b)
641 buf.EncodeUint32(uint32(m.SwIfIndex))
642 buf.EncodeUint8(m.VrID)
643 buf.EncodeUint8(m.IsIPv6)
644 buf.EncodeUint8(m.IsStart)
645 return buf.Bytes(), nil
647 func (m *VrrpVrStartStop) Unmarshal(b []byte) error {
648 buf := codec.NewBuffer(b)
649 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
650 m.VrID = buf.DecodeUint8()
651 m.IsIPv6 = buf.DecodeUint8()
652 m.IsStart = buf.DecodeUint8()
656 // VrrpVrStartStopReply defines message 'vrrp_vr_start_stop_reply'.
657 type VrrpVrStartStopReply struct {
658 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
661 func (m *VrrpVrStartStopReply) Reset() { *m = VrrpVrStartStopReply{} }
662 func (*VrrpVrStartStopReply) GetMessageName() string { return "vrrp_vr_start_stop_reply" }
663 func (*VrrpVrStartStopReply) GetCrcString() string { return "e8d4e804" }
664 func (*VrrpVrStartStopReply) GetMessageType() api.MessageType {
665 return api.ReplyMessage
668 func (m *VrrpVrStartStopReply) Size() (size int) {
672 size += 4 // m.Retval
675 func (m *VrrpVrStartStopReply) Marshal(b []byte) ([]byte, error) {
677 b = make([]byte, m.Size())
679 buf := codec.NewBuffer(b)
680 buf.EncodeInt32(m.Retval)
681 return buf.Bytes(), nil
683 func (m *VrrpVrStartStopReply) Unmarshal(b []byte) error {
684 buf := codec.NewBuffer(b)
685 m.Retval = buf.DecodeInt32()
689 // VrrpVrTrackIfAddDel defines message 'vrrp_vr_track_if_add_del'.
690 type VrrpVrTrackIfAddDel struct {
691 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
692 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
693 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
694 IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
695 NIfs uint8 `binapi:"u8,name=n_ifs" json:"-"`
696 Ifs []VrrpVrTrackIf `binapi:"vrrp_vr_track_if[n_ifs],name=ifs" json:"ifs,omitempty"`
699 func (m *VrrpVrTrackIfAddDel) Reset() { *m = VrrpVrTrackIfAddDel{} }
700 func (*VrrpVrTrackIfAddDel) GetMessageName() string { return "vrrp_vr_track_if_add_del" }
701 func (*VrrpVrTrackIfAddDel) GetCrcString() string { return "337f4ba4" }
702 func (*VrrpVrTrackIfAddDel) GetMessageType() api.MessageType {
703 return api.RequestMessage
706 func (m *VrrpVrTrackIfAddDel) Size() (size int) {
710 size += 4 // m.SwIfIndex
711 size += 1 // m.IsIPv6
715 for j1 := 0; j1 < len(m.Ifs); j1++ {
721 size += 4 // s1.SwIfIndex
722 size += 1 // s1.Priority
726 func (m *VrrpVrTrackIfAddDel) Marshal(b []byte) ([]byte, error) {
728 b = make([]byte, m.Size())
730 buf := codec.NewBuffer(b)
731 buf.EncodeUint32(uint32(m.SwIfIndex))
732 buf.EncodeUint8(m.IsIPv6)
733 buf.EncodeUint8(m.VrID)
734 buf.EncodeUint8(m.IsAdd)
735 buf.EncodeUint8(uint8(len(m.Ifs)))
736 for j0 := 0; j0 < len(m.Ifs); j0++ {
737 var v0 VrrpVrTrackIf // Ifs
741 buf.EncodeUint32(uint32(v0.SwIfIndex))
742 buf.EncodeUint8(v0.Priority)
744 return buf.Bytes(), nil
746 func (m *VrrpVrTrackIfAddDel) Unmarshal(b []byte) error {
747 buf := codec.NewBuffer(b)
748 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
749 m.IsIPv6 = buf.DecodeUint8()
750 m.VrID = buf.DecodeUint8()
751 m.IsAdd = buf.DecodeUint8()
752 m.NIfs = buf.DecodeUint8()
753 m.Ifs = make([]VrrpVrTrackIf, m.NIfs)
754 for j0 := 0; j0 < len(m.Ifs); j0++ {
755 m.Ifs[j0].SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
756 m.Ifs[j0].Priority = buf.DecodeUint8()
761 // VrrpVrTrackIfAddDelReply defines message 'vrrp_vr_track_if_add_del_reply'.
762 type VrrpVrTrackIfAddDelReply struct {
763 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
766 func (m *VrrpVrTrackIfAddDelReply) Reset() { *m = VrrpVrTrackIfAddDelReply{} }
767 func (*VrrpVrTrackIfAddDelReply) GetMessageName() string { return "vrrp_vr_track_if_add_del_reply" }
768 func (*VrrpVrTrackIfAddDelReply) GetCrcString() string { return "e8d4e804" }
769 func (*VrrpVrTrackIfAddDelReply) GetMessageType() api.MessageType {
770 return api.ReplyMessage
773 func (m *VrrpVrTrackIfAddDelReply) Size() (size int) {
777 size += 4 // m.Retval
780 func (m *VrrpVrTrackIfAddDelReply) Marshal(b []byte) ([]byte, error) {
782 b = make([]byte, m.Size())
784 buf := codec.NewBuffer(b)
785 buf.EncodeInt32(m.Retval)
786 return buf.Bytes(), nil
788 func (m *VrrpVrTrackIfAddDelReply) Unmarshal(b []byte) error {
789 buf := codec.NewBuffer(b)
790 m.Retval = buf.DecodeInt32()
794 // VrrpVrTrackIfDetails defines message 'vrrp_vr_track_if_details'.
795 type VrrpVrTrackIfDetails struct {
796 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
797 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
798 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
799 NIfs uint8 `binapi:"u8,name=n_ifs" json:"-"`
800 Ifs []VrrpVrTrackIf `binapi:"vrrp_vr_track_if[n_ifs],name=ifs" json:"ifs,omitempty"`
803 func (m *VrrpVrTrackIfDetails) Reset() { *m = VrrpVrTrackIfDetails{} }
804 func (*VrrpVrTrackIfDetails) GetMessageName() string { return "vrrp_vr_track_if_details" }
805 func (*VrrpVrTrackIfDetails) GetCrcString() string { return "99bcca9c" }
806 func (*VrrpVrTrackIfDetails) GetMessageType() api.MessageType {
807 return api.RequestMessage
810 func (m *VrrpVrTrackIfDetails) Size() (size int) {
814 size += 4 // m.SwIfIndex
816 size += 1 // m.IsIPv6
818 for j1 := 0; j1 < len(m.Ifs); j1++ {
824 size += 4 // s1.SwIfIndex
825 size += 1 // s1.Priority
829 func (m *VrrpVrTrackIfDetails) Marshal(b []byte) ([]byte, error) {
831 b = make([]byte, m.Size())
833 buf := codec.NewBuffer(b)
834 buf.EncodeUint32(uint32(m.SwIfIndex))
835 buf.EncodeUint8(m.VrID)
836 buf.EncodeUint8(m.IsIPv6)
837 buf.EncodeUint8(uint8(len(m.Ifs)))
838 for j0 := 0; j0 < len(m.Ifs); j0++ {
839 var v0 VrrpVrTrackIf // Ifs
843 buf.EncodeUint32(uint32(v0.SwIfIndex))
844 buf.EncodeUint8(v0.Priority)
846 return buf.Bytes(), nil
848 func (m *VrrpVrTrackIfDetails) Unmarshal(b []byte) error {
849 buf := codec.NewBuffer(b)
850 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
851 m.VrID = buf.DecodeUint8()
852 m.IsIPv6 = buf.DecodeUint8()
853 m.NIfs = buf.DecodeUint8()
854 m.Ifs = make([]VrrpVrTrackIf, m.NIfs)
855 for j0 := 0; j0 < len(m.Ifs); j0++ {
856 m.Ifs[j0].SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
857 m.Ifs[j0].Priority = buf.DecodeUint8()
862 // VrrpVrTrackIfDump defines message 'vrrp_vr_track_if_dump'.
863 type VrrpVrTrackIfDump struct {
864 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
865 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
866 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
867 DumpAll uint8 `binapi:"u8,name=dump_all" json:"dump_all,omitempty"`
870 func (m *VrrpVrTrackIfDump) Reset() { *m = VrrpVrTrackIfDump{} }
871 func (*VrrpVrTrackIfDump) GetMessageName() string { return "vrrp_vr_track_if_dump" }
872 func (*VrrpVrTrackIfDump) GetCrcString() string { return "a34dfc6d" }
873 func (*VrrpVrTrackIfDump) GetMessageType() api.MessageType {
874 return api.RequestMessage
877 func (m *VrrpVrTrackIfDump) Size() (size int) {
881 size += 4 // m.SwIfIndex
882 size += 1 // m.IsIPv6
884 size += 1 // m.DumpAll
887 func (m *VrrpVrTrackIfDump) Marshal(b []byte) ([]byte, error) {
889 b = make([]byte, m.Size())
891 buf := codec.NewBuffer(b)
892 buf.EncodeUint32(uint32(m.SwIfIndex))
893 buf.EncodeUint8(m.IsIPv6)
894 buf.EncodeUint8(m.VrID)
895 buf.EncodeUint8(m.DumpAll)
896 return buf.Bytes(), nil
898 func (m *VrrpVrTrackIfDump) Unmarshal(b []byte) error {
899 buf := codec.NewBuffer(b)
900 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
901 m.IsIPv6 = buf.DecodeUint8()
902 m.VrID = buf.DecodeUint8()
903 m.DumpAll = buf.DecodeUint8()
907 func init() { file_vrrp_binapi_init() }
908 func file_vrrp_binapi_init() {
909 api.RegisterMessage((*VrrpVrAddDel)(nil), "vrrp_vr_add_del_6dc4b881")
910 api.RegisterMessage((*VrrpVrAddDelReply)(nil), "vrrp_vr_add_del_reply_e8d4e804")
911 api.RegisterMessage((*VrrpVrDetails)(nil), "vrrp_vr_details_0412fa71")
912 api.RegisterMessage((*VrrpVrDump)(nil), "vrrp_vr_dump_f9e6675e")
913 api.RegisterMessage((*VrrpVrPeerDetails)(nil), "vrrp_vr_peer_details_abd9145e")
914 api.RegisterMessage((*VrrpVrPeerDump)(nil), "vrrp_vr_peer_dump_6fa3f7c4")
915 api.RegisterMessage((*VrrpVrSetPeers)(nil), "vrrp_vr_set_peers_baa2e52b")
916 api.RegisterMessage((*VrrpVrSetPeersReply)(nil), "vrrp_vr_set_peers_reply_e8d4e804")
917 api.RegisterMessage((*VrrpVrStartStop)(nil), "vrrp_vr_start_stop_0662a3b7")
918 api.RegisterMessage((*VrrpVrStartStopReply)(nil), "vrrp_vr_start_stop_reply_e8d4e804")
919 api.RegisterMessage((*VrrpVrTrackIfAddDel)(nil), "vrrp_vr_track_if_add_del_337f4ba4")
920 api.RegisterMessage((*VrrpVrTrackIfAddDelReply)(nil), "vrrp_vr_track_if_add_del_reply_e8d4e804")
921 api.RegisterMessage((*VrrpVrTrackIfDetails)(nil), "vrrp_vr_track_if_details_99bcca9c")
922 api.RegisterMessage((*VrrpVrTrackIfDump)(nil), "vrrp_vr_track_if_dump_a34dfc6d")
925 // Messages returns list of all messages in this module.
926 func AllMessages() []api.Message {
927 return []api.Message{
928 (*VrrpVrAddDel)(nil),
929 (*VrrpVrAddDelReply)(nil),
930 (*VrrpVrDetails)(nil),
932 (*VrrpVrPeerDetails)(nil),
933 (*VrrpVrPeerDump)(nil),
934 (*VrrpVrSetPeers)(nil),
935 (*VrrpVrSetPeersReply)(nil),
936 (*VrrpVrStartStop)(nil),
937 (*VrrpVrStartStopReply)(nil),
938 (*VrrpVrTrackIfAddDel)(nil),
939 (*VrrpVrTrackIfAddDelReply)(nil),
940 (*VrrpVrTrackIfDetails)(nil),
941 (*VrrpVrTrackIfDump)(nil),