binapigen: fix union size
[govpp.git] / binapi / bond / bond.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 // source: /usr/share/vpp/api/core/bond.api.json
6
7 // Package bond contains generated bindings for API file bond.api.
8 //
9 // Contents:
10 //   2 enums
11 //  14 messages
12 //
13 package bond
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         codec "git.fd.io/govpp.git/codec"
22 )
23
24 // This is a compile-time assertion to ensure that this generated file
25 // is compatible with the GoVPP api package it is being compiled against.
26 // A compilation error at this line likely means your copy of the
27 // GoVPP api package needs to be updated.
28 const _ = api.GoVppAPIPackageIsVersion2
29
30 const (
31         APIFile    = "bond"
32         APIVersion = "2.0.0"
33         VersionCrc = 0xa65a4a1e
34 )
35
36 // BondLbAlgo defines enum 'bond_lb_algo'.
37 type BondLbAlgo uint32
38
39 const (
40         BOND_API_LB_ALGO_L2  BondLbAlgo = 0
41         BOND_API_LB_ALGO_L34 BondLbAlgo = 1
42         BOND_API_LB_ALGO_L23 BondLbAlgo = 2
43         BOND_API_LB_ALGO_RR  BondLbAlgo = 3
44         BOND_API_LB_ALGO_BC  BondLbAlgo = 4
45         BOND_API_LB_ALGO_AB  BondLbAlgo = 5
46 )
47
48 var (
49         BondLbAlgo_name = map[uint32]string{
50                 0: "BOND_API_LB_ALGO_L2",
51                 1: "BOND_API_LB_ALGO_L34",
52                 2: "BOND_API_LB_ALGO_L23",
53                 3: "BOND_API_LB_ALGO_RR",
54                 4: "BOND_API_LB_ALGO_BC",
55                 5: "BOND_API_LB_ALGO_AB",
56         }
57         BondLbAlgo_value = map[string]uint32{
58                 "BOND_API_LB_ALGO_L2":  0,
59                 "BOND_API_LB_ALGO_L34": 1,
60                 "BOND_API_LB_ALGO_L23": 2,
61                 "BOND_API_LB_ALGO_RR":  3,
62                 "BOND_API_LB_ALGO_BC":  4,
63                 "BOND_API_LB_ALGO_AB":  5,
64         }
65 )
66
67 func (x BondLbAlgo) String() string {
68         s, ok := BondLbAlgo_name[uint32(x)]
69         if ok {
70                 return s
71         }
72         return "BondLbAlgo(" + strconv.Itoa(int(x)) + ")"
73 }
74
75 // BondMode defines enum 'bond_mode'.
76 type BondMode uint32
77
78 const (
79         BOND_API_MODE_ROUND_ROBIN   BondMode = 1
80         BOND_API_MODE_ACTIVE_BACKUP BondMode = 2
81         BOND_API_MODE_XOR           BondMode = 3
82         BOND_API_MODE_BROADCAST     BondMode = 4
83         BOND_API_MODE_LACP          BondMode = 5
84 )
85
86 var (
87         BondMode_name = map[uint32]string{
88                 1: "BOND_API_MODE_ROUND_ROBIN",
89                 2: "BOND_API_MODE_ACTIVE_BACKUP",
90                 3: "BOND_API_MODE_XOR",
91                 4: "BOND_API_MODE_BROADCAST",
92                 5: "BOND_API_MODE_LACP",
93         }
94         BondMode_value = map[string]uint32{
95                 "BOND_API_MODE_ROUND_ROBIN":   1,
96                 "BOND_API_MODE_ACTIVE_BACKUP": 2,
97                 "BOND_API_MODE_XOR":           3,
98                 "BOND_API_MODE_BROADCAST":     4,
99                 "BOND_API_MODE_LACP":          5,
100         }
101 )
102
103 func (x BondMode) String() string {
104         s, ok := BondMode_name[uint32(x)]
105         if ok {
106                 return s
107         }
108         return "BondMode(" + strconv.Itoa(int(x)) + ")"
109 }
110
111 // BondCreate defines message 'bond_create'.
112 type BondCreate struct {
113         ID           uint32                    `binapi:"u32,name=id,default=4294967295" json:"id,omitempty"`
114         UseCustomMac bool                      `binapi:"bool,name=use_custom_mac" json:"use_custom_mac,omitempty"`
115         MacAddress   ethernet_types.MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
116         Mode         BondMode                  `binapi:"bond_mode,name=mode" json:"mode,omitempty"`
117         Lb           BondLbAlgo                `binapi:"bond_lb_algo,name=lb" json:"lb,omitempty"`
118         NumaOnly     bool                      `binapi:"bool,name=numa_only" json:"numa_only,omitempty"`
119 }
120
121 func (m *BondCreate) Reset()               { *m = BondCreate{} }
122 func (*BondCreate) GetMessageName() string { return "bond_create" }
123 func (*BondCreate) GetCrcString() string   { return "48883c7e" }
124 func (*BondCreate) GetMessageType() api.MessageType {
125         return api.RequestMessage
126 }
127
128 func (m *BondCreate) Size() (size int) {
129         if m == nil {
130                 return 0
131         }
132         size += 4     // m.ID
133         size += 1     // m.UseCustomMac
134         size += 1 * 6 // m.MacAddress
135         size += 4     // m.Mode
136         size += 4     // m.Lb
137         size += 1     // m.NumaOnly
138         return size
139 }
140 func (m *BondCreate) Marshal(b []byte) ([]byte, error) {
141         if b == nil {
142                 b = make([]byte, m.Size())
143         }
144         buf := codec.NewBuffer(b)
145         buf.EncodeUint32(m.ID)
146         buf.EncodeBool(m.UseCustomMac)
147         buf.EncodeBytes(m.MacAddress[:], 6)
148         buf.EncodeUint32(uint32(m.Mode))
149         buf.EncodeUint32(uint32(m.Lb))
150         buf.EncodeBool(m.NumaOnly)
151         return buf.Bytes(), nil
152 }
153 func (m *BondCreate) Unmarshal(b []byte) error {
154         buf := codec.NewBuffer(b)
155         m.ID = buf.DecodeUint32()
156         m.UseCustomMac = buf.DecodeBool()
157         copy(m.MacAddress[:], buf.DecodeBytes(6))
158         m.Mode = BondMode(buf.DecodeUint32())
159         m.Lb = BondLbAlgo(buf.DecodeUint32())
160         m.NumaOnly = buf.DecodeBool()
161         return nil
162 }
163
164 // BondCreateReply defines message 'bond_create_reply'.
165 type BondCreateReply struct {
166         Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
167         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
168 }
169
170 func (m *BondCreateReply) Reset()               { *m = BondCreateReply{} }
171 func (*BondCreateReply) GetMessageName() string { return "bond_create_reply" }
172 func (*BondCreateReply) GetCrcString() string   { return "5383d31f" }
173 func (*BondCreateReply) GetMessageType() api.MessageType {
174         return api.ReplyMessage
175 }
176
177 func (m *BondCreateReply) Size() (size int) {
178         if m == nil {
179                 return 0
180         }
181         size += 4 // m.Retval
182         size += 4 // m.SwIfIndex
183         return size
184 }
185 func (m *BondCreateReply) Marshal(b []byte) ([]byte, error) {
186         if b == nil {
187                 b = make([]byte, m.Size())
188         }
189         buf := codec.NewBuffer(b)
190         buf.EncodeInt32(m.Retval)
191         buf.EncodeUint32(uint32(m.SwIfIndex))
192         return buf.Bytes(), nil
193 }
194 func (m *BondCreateReply) Unmarshal(b []byte) error {
195         buf := codec.NewBuffer(b)
196         m.Retval = buf.DecodeInt32()
197         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
198         return nil
199 }
200
201 // BondDelete defines message 'bond_delete'.
202 type BondDelete struct {
203         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
204 }
205
206 func (m *BondDelete) Reset()               { *m = BondDelete{} }
207 func (*BondDelete) GetMessageName() string { return "bond_delete" }
208 func (*BondDelete) GetCrcString() string   { return "f9e6675e" }
209 func (*BondDelete) GetMessageType() api.MessageType {
210         return api.RequestMessage
211 }
212
213 func (m *BondDelete) Size() (size int) {
214         if m == nil {
215                 return 0
216         }
217         size += 4 // m.SwIfIndex
218         return size
219 }
220 func (m *BondDelete) Marshal(b []byte) ([]byte, error) {
221         if b == nil {
222                 b = make([]byte, m.Size())
223         }
224         buf := codec.NewBuffer(b)
225         buf.EncodeUint32(uint32(m.SwIfIndex))
226         return buf.Bytes(), nil
227 }
228 func (m *BondDelete) Unmarshal(b []byte) error {
229         buf := codec.NewBuffer(b)
230         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
231         return nil
232 }
233
234 // BondDeleteReply defines message 'bond_delete_reply'.
235 type BondDeleteReply struct {
236         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
237 }
238
239 func (m *BondDeleteReply) Reset()               { *m = BondDeleteReply{} }
240 func (*BondDeleteReply) GetMessageName() string { return "bond_delete_reply" }
241 func (*BondDeleteReply) GetCrcString() string   { return "e8d4e804" }
242 func (*BondDeleteReply) GetMessageType() api.MessageType {
243         return api.ReplyMessage
244 }
245
246 func (m *BondDeleteReply) Size() (size int) {
247         if m == nil {
248                 return 0
249         }
250         size += 4 // m.Retval
251         return size
252 }
253 func (m *BondDeleteReply) Marshal(b []byte) ([]byte, error) {
254         if b == nil {
255                 b = make([]byte, m.Size())
256         }
257         buf := codec.NewBuffer(b)
258         buf.EncodeInt32(m.Retval)
259         return buf.Bytes(), nil
260 }
261 func (m *BondDeleteReply) Unmarshal(b []byte) error {
262         buf := codec.NewBuffer(b)
263         m.Retval = buf.DecodeInt32()
264         return nil
265 }
266
267 // BondDetachSlave defines message 'bond_detach_slave'.
268 type BondDetachSlave struct {
269         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
270 }
271
272 func (m *BondDetachSlave) Reset()               { *m = BondDetachSlave{} }
273 func (*BondDetachSlave) GetMessageName() string { return "bond_detach_slave" }
274 func (*BondDetachSlave) GetCrcString() string   { return "f9e6675e" }
275 func (*BondDetachSlave) GetMessageType() api.MessageType {
276         return api.RequestMessage
277 }
278
279 func (m *BondDetachSlave) Size() (size int) {
280         if m == nil {
281                 return 0
282         }
283         size += 4 // m.SwIfIndex
284         return size
285 }
286 func (m *BondDetachSlave) Marshal(b []byte) ([]byte, error) {
287         if b == nil {
288                 b = make([]byte, m.Size())
289         }
290         buf := codec.NewBuffer(b)
291         buf.EncodeUint32(uint32(m.SwIfIndex))
292         return buf.Bytes(), nil
293 }
294 func (m *BondDetachSlave) Unmarshal(b []byte) error {
295         buf := codec.NewBuffer(b)
296         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
297         return nil
298 }
299
300 // BondDetachSlaveReply defines message 'bond_detach_slave_reply'.
301 type BondDetachSlaveReply struct {
302         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
303 }
304
305 func (m *BondDetachSlaveReply) Reset()               { *m = BondDetachSlaveReply{} }
306 func (*BondDetachSlaveReply) GetMessageName() string { return "bond_detach_slave_reply" }
307 func (*BondDetachSlaveReply) GetCrcString() string   { return "e8d4e804" }
308 func (*BondDetachSlaveReply) GetMessageType() api.MessageType {
309         return api.ReplyMessage
310 }
311
312 func (m *BondDetachSlaveReply) Size() (size int) {
313         if m == nil {
314                 return 0
315         }
316         size += 4 // m.Retval
317         return size
318 }
319 func (m *BondDetachSlaveReply) Marshal(b []byte) ([]byte, error) {
320         if b == nil {
321                 b = make([]byte, m.Size())
322         }
323         buf := codec.NewBuffer(b)
324         buf.EncodeInt32(m.Retval)
325         return buf.Bytes(), nil
326 }
327 func (m *BondDetachSlaveReply) Unmarshal(b []byte) error {
328         buf := codec.NewBuffer(b)
329         m.Retval = buf.DecodeInt32()
330         return nil
331 }
332
333 // BondEnslave defines message 'bond_enslave'.
334 type BondEnslave struct {
335         SwIfIndex     interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
336         BondSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=bond_sw_if_index" json:"bond_sw_if_index,omitempty"`
337         IsPassive     bool                           `binapi:"bool,name=is_passive" json:"is_passive,omitempty"`
338         IsLongTimeout bool                           `binapi:"bool,name=is_long_timeout" json:"is_long_timeout,omitempty"`
339 }
340
341 func (m *BondEnslave) Reset()               { *m = BondEnslave{} }
342 func (*BondEnslave) GetMessageName() string { return "bond_enslave" }
343 func (*BondEnslave) GetCrcString() string   { return "076ecfa7" }
344 func (*BondEnslave) GetMessageType() api.MessageType {
345         return api.RequestMessage
346 }
347
348 func (m *BondEnslave) Size() (size int) {
349         if m == nil {
350                 return 0
351         }
352         size += 4 // m.SwIfIndex
353         size += 4 // m.BondSwIfIndex
354         size += 1 // m.IsPassive
355         size += 1 // m.IsLongTimeout
356         return size
357 }
358 func (m *BondEnslave) Marshal(b []byte) ([]byte, error) {
359         if b == nil {
360                 b = make([]byte, m.Size())
361         }
362         buf := codec.NewBuffer(b)
363         buf.EncodeUint32(uint32(m.SwIfIndex))
364         buf.EncodeUint32(uint32(m.BondSwIfIndex))
365         buf.EncodeBool(m.IsPassive)
366         buf.EncodeBool(m.IsLongTimeout)
367         return buf.Bytes(), nil
368 }
369 func (m *BondEnslave) Unmarshal(b []byte) error {
370         buf := codec.NewBuffer(b)
371         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
372         m.BondSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
373         m.IsPassive = buf.DecodeBool()
374         m.IsLongTimeout = buf.DecodeBool()
375         return nil
376 }
377
378 // BondEnslaveReply defines message 'bond_enslave_reply'.
379 type BondEnslaveReply struct {
380         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
381 }
382
383 func (m *BondEnslaveReply) Reset()               { *m = BondEnslaveReply{} }
384 func (*BondEnslaveReply) GetMessageName() string { return "bond_enslave_reply" }
385 func (*BondEnslaveReply) GetCrcString() string   { return "e8d4e804" }
386 func (*BondEnslaveReply) GetMessageType() api.MessageType {
387         return api.ReplyMessage
388 }
389
390 func (m *BondEnslaveReply) Size() (size int) {
391         if m == nil {
392                 return 0
393         }
394         size += 4 // m.Retval
395         return size
396 }
397 func (m *BondEnslaveReply) Marshal(b []byte) ([]byte, error) {
398         if b == nil {
399                 b = make([]byte, m.Size())
400         }
401         buf := codec.NewBuffer(b)
402         buf.EncodeInt32(m.Retval)
403         return buf.Bytes(), nil
404 }
405 func (m *BondEnslaveReply) Unmarshal(b []byte) error {
406         buf := codec.NewBuffer(b)
407         m.Retval = buf.DecodeInt32()
408         return nil
409 }
410
411 // SwInterfaceBondDetails defines message 'sw_interface_bond_details'.
412 type SwInterfaceBondDetails struct {
413         SwIfIndex     interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
414         ID            uint32                         `binapi:"u32,name=id" json:"id,omitempty"`
415         Mode          BondMode                       `binapi:"bond_mode,name=mode" json:"mode,omitempty"`
416         Lb            BondLbAlgo                     `binapi:"bond_lb_algo,name=lb" json:"lb,omitempty"`
417         NumaOnly      bool                           `binapi:"bool,name=numa_only" json:"numa_only,omitempty"`
418         ActiveSlaves  uint32                         `binapi:"u32,name=active_slaves" json:"active_slaves,omitempty"`
419         Slaves        uint32                         `binapi:"u32,name=slaves" json:"slaves,omitempty"`
420         InterfaceName string                         `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"`
421 }
422
423 func (m *SwInterfaceBondDetails) Reset()               { *m = SwInterfaceBondDetails{} }
424 func (*SwInterfaceBondDetails) GetMessageName() string { return "sw_interface_bond_details" }
425 func (*SwInterfaceBondDetails) GetCrcString() string   { return "f5ef2106" }
426 func (*SwInterfaceBondDetails) GetMessageType() api.MessageType {
427         return api.ReplyMessage
428 }
429
430 func (m *SwInterfaceBondDetails) Size() (size int) {
431         if m == nil {
432                 return 0
433         }
434         size += 4  // m.SwIfIndex
435         size += 4  // m.ID
436         size += 4  // m.Mode
437         size += 4  // m.Lb
438         size += 1  // m.NumaOnly
439         size += 4  // m.ActiveSlaves
440         size += 4  // m.Slaves
441         size += 64 // m.InterfaceName
442         return size
443 }
444 func (m *SwInterfaceBondDetails) Marshal(b []byte) ([]byte, error) {
445         if b == nil {
446                 b = make([]byte, m.Size())
447         }
448         buf := codec.NewBuffer(b)
449         buf.EncodeUint32(uint32(m.SwIfIndex))
450         buf.EncodeUint32(m.ID)
451         buf.EncodeUint32(uint32(m.Mode))
452         buf.EncodeUint32(uint32(m.Lb))
453         buf.EncodeBool(m.NumaOnly)
454         buf.EncodeUint32(m.ActiveSlaves)
455         buf.EncodeUint32(m.Slaves)
456         buf.EncodeString(m.InterfaceName, 64)
457         return buf.Bytes(), nil
458 }
459 func (m *SwInterfaceBondDetails) Unmarshal(b []byte) error {
460         buf := codec.NewBuffer(b)
461         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
462         m.ID = buf.DecodeUint32()
463         m.Mode = BondMode(buf.DecodeUint32())
464         m.Lb = BondLbAlgo(buf.DecodeUint32())
465         m.NumaOnly = buf.DecodeBool()
466         m.ActiveSlaves = buf.DecodeUint32()
467         m.Slaves = buf.DecodeUint32()
468         m.InterfaceName = buf.DecodeString(64)
469         return nil
470 }
471
472 // SwInterfaceBondDump defines message 'sw_interface_bond_dump'.
473 type SwInterfaceBondDump struct{}
474
475 func (m *SwInterfaceBondDump) Reset()               { *m = SwInterfaceBondDump{} }
476 func (*SwInterfaceBondDump) GetMessageName() string { return "sw_interface_bond_dump" }
477 func (*SwInterfaceBondDump) GetCrcString() string   { return "51077d14" }
478 func (*SwInterfaceBondDump) GetMessageType() api.MessageType {
479         return api.RequestMessage
480 }
481
482 func (m *SwInterfaceBondDump) Size() (size int) {
483         if m == nil {
484                 return 0
485         }
486         return size
487 }
488 func (m *SwInterfaceBondDump) Marshal(b []byte) ([]byte, error) {
489         if b == nil {
490                 b = make([]byte, m.Size())
491         }
492         buf := codec.NewBuffer(b)
493         return buf.Bytes(), nil
494 }
495 func (m *SwInterfaceBondDump) Unmarshal(b []byte) error {
496         return nil
497 }
498
499 // SwInterfaceSetBondWeight defines message 'sw_interface_set_bond_weight'.
500 type SwInterfaceSetBondWeight struct {
501         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
502         Weight    uint32                         `binapi:"u32,name=weight" json:"weight,omitempty"`
503 }
504
505 func (m *SwInterfaceSetBondWeight) Reset()               { *m = SwInterfaceSetBondWeight{} }
506 func (*SwInterfaceSetBondWeight) GetMessageName() string { return "sw_interface_set_bond_weight" }
507 func (*SwInterfaceSetBondWeight) GetCrcString() string   { return "deb510a0" }
508 func (*SwInterfaceSetBondWeight) GetMessageType() api.MessageType {
509         return api.RequestMessage
510 }
511
512 func (m *SwInterfaceSetBondWeight) Size() (size int) {
513         if m == nil {
514                 return 0
515         }
516         size += 4 // m.SwIfIndex
517         size += 4 // m.Weight
518         return size
519 }
520 func (m *SwInterfaceSetBondWeight) Marshal(b []byte) ([]byte, error) {
521         if b == nil {
522                 b = make([]byte, m.Size())
523         }
524         buf := codec.NewBuffer(b)
525         buf.EncodeUint32(uint32(m.SwIfIndex))
526         buf.EncodeUint32(m.Weight)
527         return buf.Bytes(), nil
528 }
529 func (m *SwInterfaceSetBondWeight) Unmarshal(b []byte) error {
530         buf := codec.NewBuffer(b)
531         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
532         m.Weight = buf.DecodeUint32()
533         return nil
534 }
535
536 // SwInterfaceSetBondWeightReply defines message 'sw_interface_set_bond_weight_reply'.
537 type SwInterfaceSetBondWeightReply struct {
538         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
539 }
540
541 func (m *SwInterfaceSetBondWeightReply) Reset() { *m = SwInterfaceSetBondWeightReply{} }
542 func (*SwInterfaceSetBondWeightReply) GetMessageName() string {
543         return "sw_interface_set_bond_weight_reply"
544 }
545 func (*SwInterfaceSetBondWeightReply) GetCrcString() string { return "e8d4e804" }
546 func (*SwInterfaceSetBondWeightReply) GetMessageType() api.MessageType {
547         return api.ReplyMessage
548 }
549
550 func (m *SwInterfaceSetBondWeightReply) Size() (size int) {
551         if m == nil {
552                 return 0
553         }
554         size += 4 // m.Retval
555         return size
556 }
557 func (m *SwInterfaceSetBondWeightReply) Marshal(b []byte) ([]byte, error) {
558         if b == nil {
559                 b = make([]byte, m.Size())
560         }
561         buf := codec.NewBuffer(b)
562         buf.EncodeInt32(m.Retval)
563         return buf.Bytes(), nil
564 }
565 func (m *SwInterfaceSetBondWeightReply) Unmarshal(b []byte) error {
566         buf := codec.NewBuffer(b)
567         m.Retval = buf.DecodeInt32()
568         return nil
569 }
570
571 // SwInterfaceSlaveDetails defines message 'sw_interface_slave_details'.
572 type SwInterfaceSlaveDetails struct {
573         SwIfIndex     interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
574         InterfaceName string                         `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"`
575         IsPassive     bool                           `binapi:"bool,name=is_passive" json:"is_passive,omitempty"`
576         IsLongTimeout bool                           `binapi:"bool,name=is_long_timeout" json:"is_long_timeout,omitempty"`
577         IsLocalNuma   bool                           `binapi:"bool,name=is_local_numa" json:"is_local_numa,omitempty"`
578         Weight        uint32                         `binapi:"u32,name=weight" json:"weight,omitempty"`
579 }
580
581 func (m *SwInterfaceSlaveDetails) Reset()               { *m = SwInterfaceSlaveDetails{} }
582 func (*SwInterfaceSlaveDetails) GetMessageName() string { return "sw_interface_slave_details" }
583 func (*SwInterfaceSlaveDetails) GetCrcString() string   { return "3c4a0e23" }
584 func (*SwInterfaceSlaveDetails) GetMessageType() api.MessageType {
585         return api.ReplyMessage
586 }
587
588 func (m *SwInterfaceSlaveDetails) Size() (size int) {
589         if m == nil {
590                 return 0
591         }
592         size += 4  // m.SwIfIndex
593         size += 64 // m.InterfaceName
594         size += 1  // m.IsPassive
595         size += 1  // m.IsLongTimeout
596         size += 1  // m.IsLocalNuma
597         size += 4  // m.Weight
598         return size
599 }
600 func (m *SwInterfaceSlaveDetails) Marshal(b []byte) ([]byte, error) {
601         if b == nil {
602                 b = make([]byte, m.Size())
603         }
604         buf := codec.NewBuffer(b)
605         buf.EncodeUint32(uint32(m.SwIfIndex))
606         buf.EncodeString(m.InterfaceName, 64)
607         buf.EncodeBool(m.IsPassive)
608         buf.EncodeBool(m.IsLongTimeout)
609         buf.EncodeBool(m.IsLocalNuma)
610         buf.EncodeUint32(m.Weight)
611         return buf.Bytes(), nil
612 }
613 func (m *SwInterfaceSlaveDetails) Unmarshal(b []byte) error {
614         buf := codec.NewBuffer(b)
615         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
616         m.InterfaceName = buf.DecodeString(64)
617         m.IsPassive = buf.DecodeBool()
618         m.IsLongTimeout = buf.DecodeBool()
619         m.IsLocalNuma = buf.DecodeBool()
620         m.Weight = buf.DecodeUint32()
621         return nil
622 }
623
624 // SwInterfaceSlaveDump defines message 'sw_interface_slave_dump'.
625 type SwInterfaceSlaveDump struct {
626         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
627 }
628
629 func (m *SwInterfaceSlaveDump) Reset()               { *m = SwInterfaceSlaveDump{} }
630 func (*SwInterfaceSlaveDump) GetMessageName() string { return "sw_interface_slave_dump" }
631 func (*SwInterfaceSlaveDump) GetCrcString() string   { return "f9e6675e" }
632 func (*SwInterfaceSlaveDump) GetMessageType() api.MessageType {
633         return api.RequestMessage
634 }
635
636 func (m *SwInterfaceSlaveDump) Size() (size int) {
637         if m == nil {
638                 return 0
639         }
640         size += 4 // m.SwIfIndex
641         return size
642 }
643 func (m *SwInterfaceSlaveDump) Marshal(b []byte) ([]byte, error) {
644         if b == nil {
645                 b = make([]byte, m.Size())
646         }
647         buf := codec.NewBuffer(b)
648         buf.EncodeUint32(uint32(m.SwIfIndex))
649         return buf.Bytes(), nil
650 }
651 func (m *SwInterfaceSlaveDump) Unmarshal(b []byte) error {
652         buf := codec.NewBuffer(b)
653         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
654         return nil
655 }
656
657 func init() { file_bond_binapi_init() }
658 func file_bond_binapi_init() {
659         api.RegisterMessage((*BondCreate)(nil), "bond_create_48883c7e")
660         api.RegisterMessage((*BondCreateReply)(nil), "bond_create_reply_5383d31f")
661         api.RegisterMessage((*BondDelete)(nil), "bond_delete_f9e6675e")
662         api.RegisterMessage((*BondDeleteReply)(nil), "bond_delete_reply_e8d4e804")
663         api.RegisterMessage((*BondDetachSlave)(nil), "bond_detach_slave_f9e6675e")
664         api.RegisterMessage((*BondDetachSlaveReply)(nil), "bond_detach_slave_reply_e8d4e804")
665         api.RegisterMessage((*BondEnslave)(nil), "bond_enslave_076ecfa7")
666         api.RegisterMessage((*BondEnslaveReply)(nil), "bond_enslave_reply_e8d4e804")
667         api.RegisterMessage((*SwInterfaceBondDetails)(nil), "sw_interface_bond_details_f5ef2106")
668         api.RegisterMessage((*SwInterfaceBondDump)(nil), "sw_interface_bond_dump_51077d14")
669         api.RegisterMessage((*SwInterfaceSetBondWeight)(nil), "sw_interface_set_bond_weight_deb510a0")
670         api.RegisterMessage((*SwInterfaceSetBondWeightReply)(nil), "sw_interface_set_bond_weight_reply_e8d4e804")
671         api.RegisterMessage((*SwInterfaceSlaveDetails)(nil), "sw_interface_slave_details_3c4a0e23")
672         api.RegisterMessage((*SwInterfaceSlaveDump)(nil), "sw_interface_slave_dump_f9e6675e")
673 }
674
675 // Messages returns list of all messages in this module.
676 func AllMessages() []api.Message {
677         return []api.Message{
678                 (*BondCreate)(nil),
679                 (*BondCreateReply)(nil),
680                 (*BondDelete)(nil),
681                 (*BondDeleteReply)(nil),
682                 (*BondDetachSlave)(nil),
683                 (*BondDetachSlaveReply)(nil),
684                 (*BondEnslave)(nil),
685                 (*BondEnslaveReply)(nil),
686                 (*SwInterfaceBondDetails)(nil),
687                 (*SwInterfaceBondDump)(nil),
688                 (*SwInterfaceSetBondWeight)(nil),
689                 (*SwInterfaceSetBondWeightReply)(nil),
690                 (*SwInterfaceSlaveDetails)(nil),
691                 (*SwInterfaceSlaveDump)(nil),
692         }
693 }