b8548281b6f86f2160215ca89211317c81618369
[govpp.git] / binapi / vrrp / vrrp.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.4.0-dev
4 //  VPP:              20.05-release
5
6 // Package vrrp contains generated bindings for API file vrrp.api.
7 //
8 // Contents:
9 //   2 enums
10 //   5 structs
11 //  14 messages
12 //
13 package vrrp
14
15 import (
16         "strconv"
17
18         api "git.fd.io/govpp.git/api"
19         ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types"
20         interface_types "git.fd.io/govpp.git/binapi/interface_types"
21         ip_types "git.fd.io/govpp.git/binapi/ip_types"
22         codec "git.fd.io/govpp.git/codec"
23 )
24
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
30
31 const (
32         APIFile    = "vrrp"
33         APIVersion = "1.0.1"
34         VersionCrc = 0x1903f1f1
35 )
36
37 // VrrpVrFlags defines enum 'vrrp_vr_flags'.
38 type VrrpVrFlags uint32
39
40 const (
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
45 )
46
47 var (
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",
53         }
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,
59         }
60 )
61
62 func (x VrrpVrFlags) String() string {
63         s, ok := VrrpVrFlags_name[uint32(x)]
64         if ok {
65                 return s
66         }
67         str := func(n uint32) string {
68                 s, ok := VrrpVrFlags_name[uint32(n)]
69                 if ok {
70                         return s
71                 }
72                 return "VrrpVrFlags(" + strconv.Itoa(int(n)) + ")"
73         }
74         for i := uint32(0); i <= 32; i++ {
75                 val := uint32(x)
76                 if val&(1<<i) != 0 {
77                         if s != "" {
78                                 s += "|"
79                         }
80                         s += str(1 << i)
81                 }
82         }
83         if s == "" {
84                 return str(uint32(x))
85         }
86         return s
87 }
88
89 // VrrpVrState defines enum 'vrrp_vr_state'.
90 type VrrpVrState uint32
91
92 const (
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
97 )
98
99 var (
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",
105         }
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,
111         }
112 )
113
114 func (x VrrpVrState) String() string {
115         s, ok := VrrpVrState_name[uint32(x)]
116         if ok {
117                 return s
118         }
119         return "VrrpVrState(" + strconv.Itoa(int(x)) + ")"
120 }
121
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"`
129 }
130
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"`
136 }
137
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"`
146 }
147
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"`
152 }
153
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"`
158 }
159
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"`
170 }
171
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
177 }
178
179 func (m *VrrpVrAddDel) Size() (size int) {
180         if m == nil {
181                 return 0
182         }
183         size += 1 // m.IsAdd
184         size += 4 // m.SwIfIndex
185         size += 1 // m.VrID
186         size += 1 // m.Priority
187         size += 2 // m.Interval
188         size += 4 // m.Flags
189         size += 1 // m.NAddrs
190         for j1 := 0; j1 < len(m.Addrs); j1++ {
191                 var s1 ip_types.Address
192                 _ = s1
193                 if j1 < len(m.Addrs) {
194                         s1 = m.Addrs[j1]
195                 }
196                 size += 1      // s1.Af
197                 size += 1 * 16 // s1.Un
198         }
199         return size
200 }
201 func (m *VrrpVrAddDel) Marshal(b []byte) ([]byte, error) {
202         if b == nil {
203                 b = make([]byte, m.Size())
204         }
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) {
216                         v0 = m.Addrs[j0]
217                 }
218                 buf.EncodeUint8(uint8(v0.Af))
219                 buf.EncodeBytes(v0.Un.XXX_UnionData[:], 16)
220         }
221         return buf.Bytes(), nil
222 }
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))
236         }
237         return nil
238 }
239
240 // VrrpVrAddDelReply defines message 'vrrp_vr_add_del_reply'.
241 type VrrpVrAddDelReply struct {
242         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
243 }
244
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
250 }
251
252 func (m *VrrpVrAddDelReply) Size() (size int) {
253         if m == nil {
254                 return 0
255         }
256         size += 4 // m.Retval
257         return size
258 }
259 func (m *VrrpVrAddDelReply) Marshal(b []byte) ([]byte, error) {
260         if b == nil {
261                 b = make([]byte, m.Size())
262         }
263         buf := codec.NewBuffer(b)
264         buf.EncodeInt32(m.Retval)
265         return buf.Bytes(), nil
266 }
267 func (m *VrrpVrAddDelReply) Unmarshal(b []byte) error {
268         buf := codec.NewBuffer(b)
269         m.Retval = buf.DecodeInt32()
270         return nil
271 }
272
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"`
279 }
280
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
286 }
287
288 func (m *VrrpVrDetails) Size() (size int) {
289         if m == nil {
290                 return 0
291         }
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
307                 _ = s1
308                 if j1 < len(m.Addrs) {
309                         s1 = m.Addrs[j1]
310                 }
311                 size += 1      // s1.Af
312                 size += 1 * 16 // s1.Un
313         }
314         return size
315 }
316 func (m *VrrpVrDetails) Marshal(b []byte) ([]byte, error) {
317         if b == nil {
318                 b = make([]byte, m.Size())
319         }
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) {
337                         v0 = m.Addrs[j0]
338                 }
339                 buf.EncodeUint8(uint8(v0.Af))
340                 buf.EncodeBytes(v0.Un.XXX_UnionData[:], 16)
341         }
342         return buf.Bytes(), nil
343 }
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))
363         }
364         return nil
365 }
366
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"`
370 }
371
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
377 }
378
379 func (m *VrrpVrDump) Size() (size int) {
380         if m == nil {
381                 return 0
382         }
383         size += 4 // m.SwIfIndex
384         return size
385 }
386 func (m *VrrpVrDump) Marshal(b []byte) ([]byte, error) {
387         if b == nil {
388                 b = make([]byte, m.Size())
389         }
390         buf := codec.NewBuffer(b)
391         buf.EncodeUint32(uint32(m.SwIfIndex))
392         return buf.Bytes(), nil
393 }
394 func (m *VrrpVrDump) Unmarshal(b []byte) error {
395         buf := codec.NewBuffer(b)
396         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
397         return nil
398 }
399
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"`
407 }
408
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
414 }
415
416 func (m *VrrpVrPeerDetails) Size() (size int) {
417         if m == nil {
418                 return 0
419         }
420         size += 4 // m.SwIfIndex
421         size += 1 // m.VrID
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
426                 _ = s1
427                 if j1 < len(m.PeerAddrs) {
428                         s1 = m.PeerAddrs[j1]
429                 }
430                 size += 1      // s1.Af
431                 size += 1 * 16 // s1.Un
432         }
433         return size
434 }
435 func (m *VrrpVrPeerDetails) Marshal(b []byte) ([]byte, error) {
436         if b == nil {
437                 b = make([]byte, m.Size())
438         }
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) {
447                         v0 = m.PeerAddrs[j0]
448                 }
449                 buf.EncodeUint8(uint8(v0.Af))
450                 buf.EncodeBytes(v0.Un.XXX_UnionData[:], 16)
451         }
452         return buf.Bytes(), nil
453 }
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))
464         }
465         return nil
466 }
467
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"`
473 }
474
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
480 }
481
482 func (m *VrrpVrPeerDump) Size() (size int) {
483         if m == nil {
484                 return 0
485         }
486         size += 4 // m.SwIfIndex
487         size += 1 // m.IsIPv6
488         size += 1 // m.VrID
489         return size
490 }
491 func (m *VrrpVrPeerDump) Marshal(b []byte) ([]byte, error) {
492         if b == nil {
493                 b = make([]byte, m.Size())
494         }
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
500 }
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()
506         return nil
507 }
508
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"`
516 }
517
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
523 }
524
525 func (m *VrrpVrSetPeers) Size() (size int) {
526         if m == nil {
527                 return 0
528         }
529         size += 4 // m.SwIfIndex
530         size += 1 // m.VrID
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
535                 _ = s1
536                 if j1 < len(m.Addrs) {
537                         s1 = m.Addrs[j1]
538                 }
539                 size += 1      // s1.Af
540                 size += 1 * 16 // s1.Un
541         }
542         return size
543 }
544 func (m *VrrpVrSetPeers) Marshal(b []byte) ([]byte, error) {
545         if b == nil {
546                 b = make([]byte, m.Size())
547         }
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) {
556                         v0 = m.Addrs[j0]
557                 }
558                 buf.EncodeUint8(uint8(v0.Af))
559                 buf.EncodeBytes(v0.Un.XXX_UnionData[:], 16)
560         }
561         return buf.Bytes(), nil
562 }
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))
573         }
574         return nil
575 }
576
577 // VrrpVrSetPeersReply defines message 'vrrp_vr_set_peers_reply'.
578 type VrrpVrSetPeersReply struct {
579         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
580 }
581
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
587 }
588
589 func (m *VrrpVrSetPeersReply) Size() (size int) {
590         if m == nil {
591                 return 0
592         }
593         size += 4 // m.Retval
594         return size
595 }
596 func (m *VrrpVrSetPeersReply) Marshal(b []byte) ([]byte, error) {
597         if b == nil {
598                 b = make([]byte, m.Size())
599         }
600         buf := codec.NewBuffer(b)
601         buf.EncodeInt32(m.Retval)
602         return buf.Bytes(), nil
603 }
604 func (m *VrrpVrSetPeersReply) Unmarshal(b []byte) error {
605         buf := codec.NewBuffer(b)
606         m.Retval = buf.DecodeInt32()
607         return nil
608 }
609
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"`
616 }
617
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
623 }
624
625 func (m *VrrpVrStartStop) Size() (size int) {
626         if m == nil {
627                 return 0
628         }
629         size += 4 // m.SwIfIndex
630         size += 1 // m.VrID
631         size += 1 // m.IsIPv6
632         size += 1 // m.IsStart
633         return size
634 }
635 func (m *VrrpVrStartStop) Marshal(b []byte) ([]byte, error) {
636         if b == nil {
637                 b = make([]byte, m.Size())
638         }
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
645 }
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()
652         return nil
653 }
654
655 // VrrpVrStartStopReply defines message 'vrrp_vr_start_stop_reply'.
656 type VrrpVrStartStopReply struct {
657         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
658 }
659
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
665 }
666
667 func (m *VrrpVrStartStopReply) Size() (size int) {
668         if m == nil {
669                 return 0
670         }
671         size += 4 // m.Retval
672         return size
673 }
674 func (m *VrrpVrStartStopReply) Marshal(b []byte) ([]byte, error) {
675         if b == nil {
676                 b = make([]byte, m.Size())
677         }
678         buf := codec.NewBuffer(b)
679         buf.EncodeInt32(m.Retval)
680         return buf.Bytes(), nil
681 }
682 func (m *VrrpVrStartStopReply) Unmarshal(b []byte) error {
683         buf := codec.NewBuffer(b)
684         m.Retval = buf.DecodeInt32()
685         return nil
686 }
687
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"`
696 }
697
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
703 }
704
705 func (m *VrrpVrTrackIfAddDel) Size() (size int) {
706         if m == nil {
707                 return 0
708         }
709         size += 4 // m.SwIfIndex
710         size += 1 // m.IsIPv6
711         size += 1 // m.VrID
712         size += 1 // m.IsAdd
713         size += 1 // m.NIfs
714         for j1 := 0; j1 < len(m.Ifs); j1++ {
715                 var s1 VrrpVrTrackIf
716                 _ = s1
717                 if j1 < len(m.Ifs) {
718                         s1 = m.Ifs[j1]
719                 }
720                 size += 4 // s1.SwIfIndex
721                 size += 1 // s1.Priority
722         }
723         return size
724 }
725 func (m *VrrpVrTrackIfAddDel) Marshal(b []byte) ([]byte, error) {
726         if b == nil {
727                 b = make([]byte, m.Size())
728         }
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
737                 if j0 < len(m.Ifs) {
738                         v0 = m.Ifs[j0]
739                 }
740                 buf.EncodeUint32(uint32(v0.SwIfIndex))
741                 buf.EncodeUint8(v0.Priority)
742         }
743         return buf.Bytes(), nil
744 }
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()
756         }
757         return nil
758 }
759
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"`
763 }
764
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
770 }
771
772 func (m *VrrpVrTrackIfAddDelReply) Size() (size int) {
773         if m == nil {
774                 return 0
775         }
776         size += 4 // m.Retval
777         return size
778 }
779 func (m *VrrpVrTrackIfAddDelReply) Marshal(b []byte) ([]byte, error) {
780         if b == nil {
781                 b = make([]byte, m.Size())
782         }
783         buf := codec.NewBuffer(b)
784         buf.EncodeInt32(m.Retval)
785         return buf.Bytes(), nil
786 }
787 func (m *VrrpVrTrackIfAddDelReply) Unmarshal(b []byte) error {
788         buf := codec.NewBuffer(b)
789         m.Retval = buf.DecodeInt32()
790         return nil
791 }
792
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"`
800 }
801
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
807 }
808
809 func (m *VrrpVrTrackIfDetails) Size() (size int) {
810         if m == nil {
811                 return 0
812         }
813         size += 4 // m.SwIfIndex
814         size += 1 // m.VrID
815         size += 1 // m.IsIPv6
816         size += 1 // m.NIfs
817         for j1 := 0; j1 < len(m.Ifs); j1++ {
818                 var s1 VrrpVrTrackIf
819                 _ = s1
820                 if j1 < len(m.Ifs) {
821                         s1 = m.Ifs[j1]
822                 }
823                 size += 4 // s1.SwIfIndex
824                 size += 1 // s1.Priority
825         }
826         return size
827 }
828 func (m *VrrpVrTrackIfDetails) Marshal(b []byte) ([]byte, error) {
829         if b == nil {
830                 b = make([]byte, m.Size())
831         }
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
839                 if j0 < len(m.Ifs) {
840                         v0 = m.Ifs[j0]
841                 }
842                 buf.EncodeUint32(uint32(v0.SwIfIndex))
843                 buf.EncodeUint8(v0.Priority)
844         }
845         return buf.Bytes(), nil
846 }
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()
857         }
858         return nil
859 }
860
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"`
867 }
868
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
874 }
875
876 func (m *VrrpVrTrackIfDump) Size() (size int) {
877         if m == nil {
878                 return 0
879         }
880         size += 4 // m.SwIfIndex
881         size += 1 // m.IsIPv6
882         size += 1 // m.VrID
883         size += 1 // m.DumpAll
884         return size
885 }
886 func (m *VrrpVrTrackIfDump) Marshal(b []byte) ([]byte, error) {
887         if b == nil {
888                 b = make([]byte, m.Size())
889         }
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
896 }
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()
903         return nil
904 }
905
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")
922 }
923
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),
930                 (*VrrpVrDump)(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),
941         }
942 }