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