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() 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) {
203 var buf *codec.Buffer
205 buf = codec.NewBuffer(make([]byte, m.Size()))
207 buf = codec.NewBuffer(b)
209 buf.EncodeUint8(uint8(m.IsAdd))
210 buf.EncodeUint32(uint32(m.SwIfIndex))
211 buf.EncodeUint8(uint8(m.VrID))
212 buf.EncodeUint8(uint8(m.Priority))
213 buf.EncodeUint16(uint16(m.Interval))
214 buf.EncodeUint32(uint32(m.Flags))
215 buf.EncodeUint8(uint8(len(m.Addrs)))
216 for j0 := 0; j0 < len(m.Addrs); j0++ {
217 var v0 ip_types.Address
218 if j0 < len(m.Addrs) {
221 buf.EncodeUint8(uint8(v0.Af))
222 buf.EncodeBytes(v0.Un.XXX_UnionData[:], 0)
224 return buf.Bytes(), nil
226 func (m *VrrpVrAddDel) Unmarshal(b []byte) error {
227 buf := codec.NewBuffer(b)
228 m.IsAdd = buf.DecodeUint8()
229 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
230 m.VrID = buf.DecodeUint8()
231 m.Priority = buf.DecodeUint8()
232 m.Interval = buf.DecodeUint16()
233 m.Flags = VrrpVrFlags(buf.DecodeUint32())
234 m.NAddrs = buf.DecodeUint8()
235 m.Addrs = make([]ip_types.Address, int(m.NAddrs))
236 for j0 := 0; j0 < len(m.Addrs); j0++ {
237 m.Addrs[j0].Af = ip_types.AddressFamily(buf.DecodeUint8())
238 copy(m.Addrs[j0].Un.XXX_UnionData[:], buf.DecodeBytes(16))
243 // VrrpVrAddDelReply defines message 'vrrp_vr_add_del_reply'.
244 type VrrpVrAddDelReply struct {
245 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
248 func (m *VrrpVrAddDelReply) Reset() { *m = VrrpVrAddDelReply{} }
249 func (*VrrpVrAddDelReply) GetMessageName() string { return "vrrp_vr_add_del_reply" }
250 func (*VrrpVrAddDelReply) GetCrcString() string { return "e8d4e804" }
251 func (*VrrpVrAddDelReply) GetMessageType() api.MessageType {
252 return api.ReplyMessage
255 func (m *VrrpVrAddDelReply) Size() int {
260 size += 4 // m.Retval
263 func (m *VrrpVrAddDelReply) Marshal(b []byte) ([]byte, error) {
264 var buf *codec.Buffer
266 buf = codec.NewBuffer(make([]byte, m.Size()))
268 buf = codec.NewBuffer(b)
270 buf.EncodeUint32(uint32(m.Retval))
271 return buf.Bytes(), nil
273 func (m *VrrpVrAddDelReply) Unmarshal(b []byte) error {
274 buf := codec.NewBuffer(b)
275 m.Retval = int32(buf.DecodeUint32())
279 // VrrpVrDetails defines message 'vrrp_vr_details'.
280 type VrrpVrDetails struct {
281 Config VrrpVrConf `binapi:"vrrp_vr_conf,name=config" json:"config,omitempty"`
282 Runtime VrrpVrRuntime `binapi:"vrrp_vr_runtime,name=runtime" json:"runtime,omitempty"`
283 NAddrs uint8 `binapi:"u8,name=n_addrs" json:"-"`
284 Addrs []ip_types.Address `binapi:"address[n_addrs],name=addrs" json:"addrs,omitempty"`
287 func (m *VrrpVrDetails) Reset() { *m = VrrpVrDetails{} }
288 func (*VrrpVrDetails) GetMessageName() string { return "vrrp_vr_details" }
289 func (*VrrpVrDetails) GetCrcString() string { return "0412fa71" }
290 func (*VrrpVrDetails) GetMessageType() api.MessageType {
291 return api.ReplyMessage
294 func (m *VrrpVrDetails) Size() int {
299 size += 4 // m.Config.SwIfIndex
300 size += 1 // m.Config.VrID
301 size += 1 // m.Config.Priority
302 size += 2 // m.Config.Interval
303 size += 4 // m.Config.Flags
304 size += 4 // m.Runtime.State
305 size += 2 // m.Runtime.MasterAdvInt
306 size += 2 // m.Runtime.Skew
307 size += 2 // m.Runtime.MasterDownInt
308 size += 1 * 6 // m.Runtime.Mac
309 size += 4 // m.Runtime.Tracking.InterfacesDec
310 size += 1 // m.Runtime.Tracking.Priority
311 size += 1 // m.NAddrs
312 for j1 := 0; j1 < len(m.Addrs); j1++ {
313 var s1 ip_types.Address
315 if j1 < len(m.Addrs) {
319 size += 1 * 16 // s1.Un
323 func (m *VrrpVrDetails) Marshal(b []byte) ([]byte, error) {
324 var buf *codec.Buffer
326 buf = codec.NewBuffer(make([]byte, m.Size()))
328 buf = codec.NewBuffer(b)
330 buf.EncodeUint32(uint32(m.Config.SwIfIndex))
331 buf.EncodeUint8(uint8(m.Config.VrID))
332 buf.EncodeUint8(uint8(m.Config.Priority))
333 buf.EncodeUint16(uint16(m.Config.Interval))
334 buf.EncodeUint32(uint32(m.Config.Flags))
335 buf.EncodeUint32(uint32(m.Runtime.State))
336 buf.EncodeUint16(uint16(m.Runtime.MasterAdvInt))
337 buf.EncodeUint16(uint16(m.Runtime.Skew))
338 buf.EncodeUint16(uint16(m.Runtime.MasterDownInt))
339 buf.EncodeBytes(m.Runtime.Mac[:], 6)
340 buf.EncodeUint32(uint32(m.Runtime.Tracking.InterfacesDec))
341 buf.EncodeUint8(uint8(m.Runtime.Tracking.Priority))
342 buf.EncodeUint8(uint8(len(m.Addrs)))
343 for j0 := 0; j0 < len(m.Addrs); j0++ {
344 var v0 ip_types.Address
345 if j0 < len(m.Addrs) {
348 buf.EncodeUint8(uint8(v0.Af))
349 buf.EncodeBytes(v0.Un.XXX_UnionData[:], 0)
351 return buf.Bytes(), nil
353 func (m *VrrpVrDetails) Unmarshal(b []byte) error {
354 buf := codec.NewBuffer(b)
355 m.Config.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
356 m.Config.VrID = buf.DecodeUint8()
357 m.Config.Priority = buf.DecodeUint8()
358 m.Config.Interval = buf.DecodeUint16()
359 m.Config.Flags = VrrpVrFlags(buf.DecodeUint32())
360 m.Runtime.State = VrrpVrState(buf.DecodeUint32())
361 m.Runtime.MasterAdvInt = buf.DecodeUint16()
362 m.Runtime.Skew = buf.DecodeUint16()
363 m.Runtime.MasterDownInt = buf.DecodeUint16()
364 copy(m.Runtime.Mac[:], buf.DecodeBytes(6))
365 m.Runtime.Tracking.InterfacesDec = buf.DecodeUint32()
366 m.Runtime.Tracking.Priority = buf.DecodeUint8()
367 m.NAddrs = buf.DecodeUint8()
368 m.Addrs = make([]ip_types.Address, int(m.NAddrs))
369 for j0 := 0; j0 < len(m.Addrs); j0++ {
370 m.Addrs[j0].Af = ip_types.AddressFamily(buf.DecodeUint8())
371 copy(m.Addrs[j0].Un.XXX_UnionData[:], buf.DecodeBytes(16))
376 // VrrpVrDump defines message 'vrrp_vr_dump'.
377 type VrrpVrDump struct {
378 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
381 func (m *VrrpVrDump) Reset() { *m = VrrpVrDump{} }
382 func (*VrrpVrDump) GetMessageName() string { return "vrrp_vr_dump" }
383 func (*VrrpVrDump) GetCrcString() string { return "f9e6675e" }
384 func (*VrrpVrDump) GetMessageType() api.MessageType {
385 return api.RequestMessage
388 func (m *VrrpVrDump) Size() int {
393 size += 4 // m.SwIfIndex
396 func (m *VrrpVrDump) Marshal(b []byte) ([]byte, error) {
397 var buf *codec.Buffer
399 buf = codec.NewBuffer(make([]byte, m.Size()))
401 buf = codec.NewBuffer(b)
403 buf.EncodeUint32(uint32(m.SwIfIndex))
404 return buf.Bytes(), nil
406 func (m *VrrpVrDump) Unmarshal(b []byte) error {
407 buf := codec.NewBuffer(b)
408 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
412 // VrrpVrPeerDetails defines message 'vrrp_vr_peer_details'.
413 type VrrpVrPeerDetails struct {
414 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
415 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
416 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
417 NPeerAddrs uint8 `binapi:"u8,name=n_peer_addrs" json:"-"`
418 PeerAddrs []ip_types.Address `binapi:"address[n_peer_addrs],name=peer_addrs" json:"peer_addrs,omitempty"`
421 func (m *VrrpVrPeerDetails) Reset() { *m = VrrpVrPeerDetails{} }
422 func (*VrrpVrPeerDetails) GetMessageName() string { return "vrrp_vr_peer_details" }
423 func (*VrrpVrPeerDetails) GetCrcString() string { return "abd9145e" }
424 func (*VrrpVrPeerDetails) GetMessageType() api.MessageType {
425 return api.RequestMessage
428 func (m *VrrpVrPeerDetails) Size() int {
433 size += 4 // m.SwIfIndex
435 size += 1 // m.IsIPv6
436 size += 1 // m.NPeerAddrs
437 for j1 := 0; j1 < len(m.PeerAddrs); j1++ {
438 var s1 ip_types.Address
440 if j1 < len(m.PeerAddrs) {
444 size += 1 * 16 // s1.Un
448 func (m *VrrpVrPeerDetails) Marshal(b []byte) ([]byte, error) {
449 var buf *codec.Buffer
451 buf = codec.NewBuffer(make([]byte, m.Size()))
453 buf = codec.NewBuffer(b)
455 buf.EncodeUint32(uint32(m.SwIfIndex))
456 buf.EncodeUint8(uint8(m.VrID))
457 buf.EncodeUint8(uint8(m.IsIPv6))
458 buf.EncodeUint8(uint8(len(m.PeerAddrs)))
459 for j0 := 0; j0 < len(m.PeerAddrs); j0++ {
460 var v0 ip_types.Address
461 if j0 < len(m.PeerAddrs) {
464 buf.EncodeUint8(uint8(v0.Af))
465 buf.EncodeBytes(v0.Un.XXX_UnionData[:], 0)
467 return buf.Bytes(), nil
469 func (m *VrrpVrPeerDetails) Unmarshal(b []byte) error {
470 buf := codec.NewBuffer(b)
471 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
472 m.VrID = buf.DecodeUint8()
473 m.IsIPv6 = buf.DecodeUint8()
474 m.NPeerAddrs = buf.DecodeUint8()
475 m.PeerAddrs = make([]ip_types.Address, int(m.NPeerAddrs))
476 for j0 := 0; j0 < len(m.PeerAddrs); j0++ {
477 m.PeerAddrs[j0].Af = ip_types.AddressFamily(buf.DecodeUint8())
478 copy(m.PeerAddrs[j0].Un.XXX_UnionData[:], buf.DecodeBytes(16))
483 // VrrpVrPeerDump defines message 'vrrp_vr_peer_dump'.
484 type VrrpVrPeerDump struct {
485 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
486 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
487 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
490 func (m *VrrpVrPeerDump) Reset() { *m = VrrpVrPeerDump{} }
491 func (*VrrpVrPeerDump) GetMessageName() string { return "vrrp_vr_peer_dump" }
492 func (*VrrpVrPeerDump) GetCrcString() string { return "6fa3f7c4" }
493 func (*VrrpVrPeerDump) GetMessageType() api.MessageType {
494 return api.RequestMessage
497 func (m *VrrpVrPeerDump) Size() int {
502 size += 4 // m.SwIfIndex
503 size += 1 // m.IsIPv6
507 func (m *VrrpVrPeerDump) Marshal(b []byte) ([]byte, error) {
508 var buf *codec.Buffer
510 buf = codec.NewBuffer(make([]byte, m.Size()))
512 buf = codec.NewBuffer(b)
514 buf.EncodeUint32(uint32(m.SwIfIndex))
515 buf.EncodeUint8(uint8(m.IsIPv6))
516 buf.EncodeUint8(uint8(m.VrID))
517 return buf.Bytes(), nil
519 func (m *VrrpVrPeerDump) Unmarshal(b []byte) error {
520 buf := codec.NewBuffer(b)
521 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
522 m.IsIPv6 = buf.DecodeUint8()
523 m.VrID = buf.DecodeUint8()
527 // VrrpVrSetPeers defines message 'vrrp_vr_set_peers'.
528 type VrrpVrSetPeers struct {
529 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
530 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
531 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
532 NAddrs uint8 `binapi:"u8,name=n_addrs" json:"-"`
533 Addrs []ip_types.Address `binapi:"address[n_addrs],name=addrs" json:"addrs,omitempty"`
536 func (m *VrrpVrSetPeers) Reset() { *m = VrrpVrSetPeers{} }
537 func (*VrrpVrSetPeers) GetMessageName() string { return "vrrp_vr_set_peers" }
538 func (*VrrpVrSetPeers) GetCrcString() string { return "baa2e52b" }
539 func (*VrrpVrSetPeers) GetMessageType() api.MessageType {
540 return api.RequestMessage
543 func (m *VrrpVrSetPeers) Size() int {
548 size += 4 // m.SwIfIndex
550 size += 1 // m.IsIPv6
551 size += 1 // m.NAddrs
552 for j1 := 0; j1 < len(m.Addrs); j1++ {
553 var s1 ip_types.Address
555 if j1 < len(m.Addrs) {
559 size += 1 * 16 // s1.Un
563 func (m *VrrpVrSetPeers) Marshal(b []byte) ([]byte, error) {
564 var buf *codec.Buffer
566 buf = codec.NewBuffer(make([]byte, m.Size()))
568 buf = codec.NewBuffer(b)
570 buf.EncodeUint32(uint32(m.SwIfIndex))
571 buf.EncodeUint8(uint8(m.VrID))
572 buf.EncodeUint8(uint8(m.IsIPv6))
573 buf.EncodeUint8(uint8(len(m.Addrs)))
574 for j0 := 0; j0 < len(m.Addrs); j0++ {
575 var v0 ip_types.Address
576 if j0 < len(m.Addrs) {
579 buf.EncodeUint8(uint8(v0.Af))
580 buf.EncodeBytes(v0.Un.XXX_UnionData[:], 0)
582 return buf.Bytes(), nil
584 func (m *VrrpVrSetPeers) Unmarshal(b []byte) error {
585 buf := codec.NewBuffer(b)
586 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
587 m.VrID = buf.DecodeUint8()
588 m.IsIPv6 = buf.DecodeUint8()
589 m.NAddrs = buf.DecodeUint8()
590 m.Addrs = make([]ip_types.Address, int(m.NAddrs))
591 for j0 := 0; j0 < len(m.Addrs); j0++ {
592 m.Addrs[j0].Af = ip_types.AddressFamily(buf.DecodeUint8())
593 copy(m.Addrs[j0].Un.XXX_UnionData[:], buf.DecodeBytes(16))
598 // VrrpVrSetPeersReply defines message 'vrrp_vr_set_peers_reply'.
599 type VrrpVrSetPeersReply struct {
600 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
603 func (m *VrrpVrSetPeersReply) Reset() { *m = VrrpVrSetPeersReply{} }
604 func (*VrrpVrSetPeersReply) GetMessageName() string { return "vrrp_vr_set_peers_reply" }
605 func (*VrrpVrSetPeersReply) GetCrcString() string { return "e8d4e804" }
606 func (*VrrpVrSetPeersReply) GetMessageType() api.MessageType {
607 return api.ReplyMessage
610 func (m *VrrpVrSetPeersReply) Size() int {
615 size += 4 // m.Retval
618 func (m *VrrpVrSetPeersReply) Marshal(b []byte) ([]byte, error) {
619 var buf *codec.Buffer
621 buf = codec.NewBuffer(make([]byte, m.Size()))
623 buf = codec.NewBuffer(b)
625 buf.EncodeUint32(uint32(m.Retval))
626 return buf.Bytes(), nil
628 func (m *VrrpVrSetPeersReply) Unmarshal(b []byte) error {
629 buf := codec.NewBuffer(b)
630 m.Retval = int32(buf.DecodeUint32())
634 // VrrpVrStartStop defines message 'vrrp_vr_start_stop'.
635 type VrrpVrStartStop struct {
636 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
637 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
638 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
639 IsStart uint8 `binapi:"u8,name=is_start" json:"is_start,omitempty"`
642 func (m *VrrpVrStartStop) Reset() { *m = VrrpVrStartStop{} }
643 func (*VrrpVrStartStop) GetMessageName() string { return "vrrp_vr_start_stop" }
644 func (*VrrpVrStartStop) GetCrcString() string { return "0662a3b7" }
645 func (*VrrpVrStartStop) GetMessageType() api.MessageType {
646 return api.RequestMessage
649 func (m *VrrpVrStartStop) Size() int {
654 size += 4 // m.SwIfIndex
656 size += 1 // m.IsIPv6
657 size += 1 // m.IsStart
660 func (m *VrrpVrStartStop) Marshal(b []byte) ([]byte, error) {
661 var buf *codec.Buffer
663 buf = codec.NewBuffer(make([]byte, m.Size()))
665 buf = codec.NewBuffer(b)
667 buf.EncodeUint32(uint32(m.SwIfIndex))
668 buf.EncodeUint8(uint8(m.VrID))
669 buf.EncodeUint8(uint8(m.IsIPv6))
670 buf.EncodeUint8(uint8(m.IsStart))
671 return buf.Bytes(), nil
673 func (m *VrrpVrStartStop) Unmarshal(b []byte) error {
674 buf := codec.NewBuffer(b)
675 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
676 m.VrID = buf.DecodeUint8()
677 m.IsIPv6 = buf.DecodeUint8()
678 m.IsStart = buf.DecodeUint8()
682 // VrrpVrStartStopReply defines message 'vrrp_vr_start_stop_reply'.
683 type VrrpVrStartStopReply struct {
684 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
687 func (m *VrrpVrStartStopReply) Reset() { *m = VrrpVrStartStopReply{} }
688 func (*VrrpVrStartStopReply) GetMessageName() string { return "vrrp_vr_start_stop_reply" }
689 func (*VrrpVrStartStopReply) GetCrcString() string { return "e8d4e804" }
690 func (*VrrpVrStartStopReply) GetMessageType() api.MessageType {
691 return api.ReplyMessage
694 func (m *VrrpVrStartStopReply) Size() int {
699 size += 4 // m.Retval
702 func (m *VrrpVrStartStopReply) Marshal(b []byte) ([]byte, error) {
703 var buf *codec.Buffer
705 buf = codec.NewBuffer(make([]byte, m.Size()))
707 buf = codec.NewBuffer(b)
709 buf.EncodeUint32(uint32(m.Retval))
710 return buf.Bytes(), nil
712 func (m *VrrpVrStartStopReply) Unmarshal(b []byte) error {
713 buf := codec.NewBuffer(b)
714 m.Retval = int32(buf.DecodeUint32())
718 // VrrpVrTrackIfAddDel defines message 'vrrp_vr_track_if_add_del'.
719 type VrrpVrTrackIfAddDel struct {
720 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
721 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
722 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
723 IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
724 NIfs uint8 `binapi:"u8,name=n_ifs" json:"-"`
725 Ifs []VrrpVrTrackIf `binapi:"vrrp_vr_track_if[n_ifs],name=ifs" json:"ifs,omitempty"`
728 func (m *VrrpVrTrackIfAddDel) Reset() { *m = VrrpVrTrackIfAddDel{} }
729 func (*VrrpVrTrackIfAddDel) GetMessageName() string { return "vrrp_vr_track_if_add_del" }
730 func (*VrrpVrTrackIfAddDel) GetCrcString() string { return "337f4ba4" }
731 func (*VrrpVrTrackIfAddDel) GetMessageType() api.MessageType {
732 return api.RequestMessage
735 func (m *VrrpVrTrackIfAddDel) Size() int {
740 size += 4 // m.SwIfIndex
741 size += 1 // m.IsIPv6
745 for j1 := 0; j1 < len(m.Ifs); j1++ {
751 size += 4 // s1.SwIfIndex
752 size += 1 // s1.Priority
756 func (m *VrrpVrTrackIfAddDel) Marshal(b []byte) ([]byte, error) {
757 var buf *codec.Buffer
759 buf = codec.NewBuffer(make([]byte, m.Size()))
761 buf = codec.NewBuffer(b)
763 buf.EncodeUint32(uint32(m.SwIfIndex))
764 buf.EncodeUint8(uint8(m.IsIPv6))
765 buf.EncodeUint8(uint8(m.VrID))
766 buf.EncodeUint8(uint8(m.IsAdd))
767 buf.EncodeUint8(uint8(len(m.Ifs)))
768 for j0 := 0; j0 < len(m.Ifs); j0++ {
773 buf.EncodeUint32(uint32(v0.SwIfIndex))
774 buf.EncodeUint8(uint8(v0.Priority))
776 return buf.Bytes(), nil
778 func (m *VrrpVrTrackIfAddDel) Unmarshal(b []byte) error {
779 buf := codec.NewBuffer(b)
780 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
781 m.IsIPv6 = buf.DecodeUint8()
782 m.VrID = buf.DecodeUint8()
783 m.IsAdd = buf.DecodeUint8()
784 m.NIfs = buf.DecodeUint8()
785 m.Ifs = make([]VrrpVrTrackIf, int(m.NIfs))
786 for j0 := 0; j0 < len(m.Ifs); j0++ {
787 m.Ifs[j0].SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
788 m.Ifs[j0].Priority = buf.DecodeUint8()
793 // VrrpVrTrackIfAddDelReply defines message 'vrrp_vr_track_if_add_del_reply'.
794 type VrrpVrTrackIfAddDelReply struct {
795 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
798 func (m *VrrpVrTrackIfAddDelReply) Reset() { *m = VrrpVrTrackIfAddDelReply{} }
799 func (*VrrpVrTrackIfAddDelReply) GetMessageName() string { return "vrrp_vr_track_if_add_del_reply" }
800 func (*VrrpVrTrackIfAddDelReply) GetCrcString() string { return "e8d4e804" }
801 func (*VrrpVrTrackIfAddDelReply) GetMessageType() api.MessageType {
802 return api.ReplyMessage
805 func (m *VrrpVrTrackIfAddDelReply) Size() int {
810 size += 4 // m.Retval
813 func (m *VrrpVrTrackIfAddDelReply) Marshal(b []byte) ([]byte, error) {
814 var buf *codec.Buffer
816 buf = codec.NewBuffer(make([]byte, m.Size()))
818 buf = codec.NewBuffer(b)
820 buf.EncodeUint32(uint32(m.Retval))
821 return buf.Bytes(), nil
823 func (m *VrrpVrTrackIfAddDelReply) Unmarshal(b []byte) error {
824 buf := codec.NewBuffer(b)
825 m.Retval = int32(buf.DecodeUint32())
829 // VrrpVrTrackIfDetails defines message 'vrrp_vr_track_if_details'.
830 type VrrpVrTrackIfDetails struct {
831 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
832 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
833 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
834 NIfs uint8 `binapi:"u8,name=n_ifs" json:"-"`
835 Ifs []VrrpVrTrackIf `binapi:"vrrp_vr_track_if[n_ifs],name=ifs" json:"ifs,omitempty"`
838 func (m *VrrpVrTrackIfDetails) Reset() { *m = VrrpVrTrackIfDetails{} }
839 func (*VrrpVrTrackIfDetails) GetMessageName() string { return "vrrp_vr_track_if_details" }
840 func (*VrrpVrTrackIfDetails) GetCrcString() string { return "99bcca9c" }
841 func (*VrrpVrTrackIfDetails) GetMessageType() api.MessageType {
842 return api.RequestMessage
845 func (m *VrrpVrTrackIfDetails) Size() int {
850 size += 4 // m.SwIfIndex
852 size += 1 // m.IsIPv6
854 for j1 := 0; j1 < len(m.Ifs); j1++ {
860 size += 4 // s1.SwIfIndex
861 size += 1 // s1.Priority
865 func (m *VrrpVrTrackIfDetails) Marshal(b []byte) ([]byte, error) {
866 var buf *codec.Buffer
868 buf = codec.NewBuffer(make([]byte, m.Size()))
870 buf = codec.NewBuffer(b)
872 buf.EncodeUint32(uint32(m.SwIfIndex))
873 buf.EncodeUint8(uint8(m.VrID))
874 buf.EncodeUint8(uint8(m.IsIPv6))
875 buf.EncodeUint8(uint8(len(m.Ifs)))
876 for j0 := 0; j0 < len(m.Ifs); j0++ {
881 buf.EncodeUint32(uint32(v0.SwIfIndex))
882 buf.EncodeUint8(uint8(v0.Priority))
884 return buf.Bytes(), nil
886 func (m *VrrpVrTrackIfDetails) Unmarshal(b []byte) error {
887 buf := codec.NewBuffer(b)
888 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
889 m.VrID = buf.DecodeUint8()
890 m.IsIPv6 = buf.DecodeUint8()
891 m.NIfs = buf.DecodeUint8()
892 m.Ifs = make([]VrrpVrTrackIf, int(m.NIfs))
893 for j0 := 0; j0 < len(m.Ifs); j0++ {
894 m.Ifs[j0].SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
895 m.Ifs[j0].Priority = buf.DecodeUint8()
900 // VrrpVrTrackIfDump defines message 'vrrp_vr_track_if_dump'.
901 type VrrpVrTrackIfDump struct {
902 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
903 IsIPv6 uint8 `binapi:"u8,name=is_ipv6" json:"is_ipv6,omitempty"`
904 VrID uint8 `binapi:"u8,name=vr_id" json:"vr_id,omitempty"`
905 DumpAll uint8 `binapi:"u8,name=dump_all" json:"dump_all,omitempty"`
908 func (m *VrrpVrTrackIfDump) Reset() { *m = VrrpVrTrackIfDump{} }
909 func (*VrrpVrTrackIfDump) GetMessageName() string { return "vrrp_vr_track_if_dump" }
910 func (*VrrpVrTrackIfDump) GetCrcString() string { return "a34dfc6d" }
911 func (*VrrpVrTrackIfDump) GetMessageType() api.MessageType {
912 return api.RequestMessage
915 func (m *VrrpVrTrackIfDump) Size() int {
920 size += 4 // m.SwIfIndex
921 size += 1 // m.IsIPv6
923 size += 1 // m.DumpAll
926 func (m *VrrpVrTrackIfDump) Marshal(b []byte) ([]byte, error) {
927 var buf *codec.Buffer
929 buf = codec.NewBuffer(make([]byte, m.Size()))
931 buf = codec.NewBuffer(b)
933 buf.EncodeUint32(uint32(m.SwIfIndex))
934 buf.EncodeUint8(uint8(m.IsIPv6))
935 buf.EncodeUint8(uint8(m.VrID))
936 buf.EncodeUint8(uint8(m.DumpAll))
937 return buf.Bytes(), nil
939 func (m *VrrpVrTrackIfDump) Unmarshal(b []byte) error {
940 buf := codec.NewBuffer(b)
941 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
942 m.IsIPv6 = buf.DecodeUint8()
943 m.VrID = buf.DecodeUint8()
944 m.DumpAll = buf.DecodeUint8()
948 func init() { file_vrrp_binapi_init() }
949 func file_vrrp_binapi_init() {
950 api.RegisterMessage((*VrrpVrAddDel)(nil), "vrrp_vr_add_del_6dc4b881")
951 api.RegisterMessage((*VrrpVrAddDelReply)(nil), "vrrp_vr_add_del_reply_e8d4e804")
952 api.RegisterMessage((*VrrpVrDetails)(nil), "vrrp_vr_details_0412fa71")
953 api.RegisterMessage((*VrrpVrDump)(nil), "vrrp_vr_dump_f9e6675e")
954 api.RegisterMessage((*VrrpVrPeerDetails)(nil), "vrrp_vr_peer_details_abd9145e")
955 api.RegisterMessage((*VrrpVrPeerDump)(nil), "vrrp_vr_peer_dump_6fa3f7c4")
956 api.RegisterMessage((*VrrpVrSetPeers)(nil), "vrrp_vr_set_peers_baa2e52b")
957 api.RegisterMessage((*VrrpVrSetPeersReply)(nil), "vrrp_vr_set_peers_reply_e8d4e804")
958 api.RegisterMessage((*VrrpVrStartStop)(nil), "vrrp_vr_start_stop_0662a3b7")
959 api.RegisterMessage((*VrrpVrStartStopReply)(nil), "vrrp_vr_start_stop_reply_e8d4e804")
960 api.RegisterMessage((*VrrpVrTrackIfAddDel)(nil), "vrrp_vr_track_if_add_del_337f4ba4")
961 api.RegisterMessage((*VrrpVrTrackIfAddDelReply)(nil), "vrrp_vr_track_if_add_del_reply_e8d4e804")
962 api.RegisterMessage((*VrrpVrTrackIfDetails)(nil), "vrrp_vr_track_if_details_99bcca9c")
963 api.RegisterMessage((*VrrpVrTrackIfDump)(nil), "vrrp_vr_track_if_dump_a34dfc6d")
966 // Messages returns list of all messages in this module.
967 func AllMessages() []api.Message {
968 return []api.Message{
969 (*VrrpVrAddDel)(nil),
970 (*VrrpVrAddDelReply)(nil),
971 (*VrrpVrDetails)(nil),
973 (*VrrpVrPeerDetails)(nil),
974 (*VrrpVrPeerDump)(nil),
975 (*VrrpVrSetPeers)(nil),
976 (*VrrpVrSetPeersReply)(nil),
977 (*VrrpVrStartStop)(nil),
978 (*VrrpVrStartStopReply)(nil),
979 (*VrrpVrTrackIfAddDel)(nil),
980 (*VrrpVrTrackIfAddDelReply)(nil),
981 (*VrrpVrTrackIfDetails)(nil),
982 (*VrrpVrTrackIfDump)(nil),