acee8b84c37af623b8c79a52a8937499d2ae72f7
[govpp.git] / internal / testbinapi / binapi2001 / 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.01
5 // source: .vppapi/core/bond.api.json
6
7 // Package bond contains generated bindings for API file bond.api.
8 //
9 // Contents:
10 //   2 aliases
11 //   8 enums
12 //  14 messages
13 //
14 package bond
15
16 import (
17         api "git.fd.io/govpp.git/api"
18         codec "git.fd.io/govpp.git/codec"
19         "net"
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 = 0x69f583ad
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 // IfStatusFlags defines enum 'if_status_flags'.
111 type IfStatusFlags uint32
112
113 const (
114         IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
115         IF_STATUS_API_FLAG_LINK_UP  IfStatusFlags = 2
116 )
117
118 var (
119         IfStatusFlags_name = map[uint32]string{
120                 1: "IF_STATUS_API_FLAG_ADMIN_UP",
121                 2: "IF_STATUS_API_FLAG_LINK_UP",
122         }
123         IfStatusFlags_value = map[string]uint32{
124                 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
125                 "IF_STATUS_API_FLAG_LINK_UP":  2,
126         }
127 )
128
129 func (x IfStatusFlags) String() string {
130         s, ok := IfStatusFlags_name[uint32(x)]
131         if ok {
132                 return s
133         }
134         str := func(n uint32) string {
135                 s, ok := IfStatusFlags_name[uint32(n)]
136                 if ok {
137                         return s
138                 }
139                 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
140         }
141         for i := uint32(0); i <= 32; i++ {
142                 val := uint32(x)
143                 if val&(1<<i) != 0 {
144                         if s != "" {
145                                 s += "|"
146                         }
147                         s += str(1 << i)
148                 }
149         }
150         if s == "" {
151                 return str(uint32(x))
152         }
153         return s
154 }
155
156 // IfType defines enum 'if_type'.
157 type IfType uint32
158
159 const (
160         IF_API_TYPE_HARDWARE IfType = 1
161         IF_API_TYPE_SUB      IfType = 2
162         IF_API_TYPE_P2P      IfType = 3
163         IF_API_TYPE_PIPE     IfType = 4
164 )
165
166 var (
167         IfType_name = map[uint32]string{
168                 1: "IF_API_TYPE_HARDWARE",
169                 2: "IF_API_TYPE_SUB",
170                 3: "IF_API_TYPE_P2P",
171                 4: "IF_API_TYPE_PIPE",
172         }
173         IfType_value = map[string]uint32{
174                 "IF_API_TYPE_HARDWARE": 1,
175                 "IF_API_TYPE_SUB":      2,
176                 "IF_API_TYPE_P2P":      3,
177                 "IF_API_TYPE_PIPE":     4,
178         }
179 )
180
181 func (x IfType) String() string {
182         s, ok := IfType_name[uint32(x)]
183         if ok {
184                 return s
185         }
186         return "IfType(" + strconv.Itoa(int(x)) + ")"
187 }
188
189 // LinkDuplex defines enum 'link_duplex'.
190 type LinkDuplex uint32
191
192 const (
193         LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
194         LINK_DUPLEX_API_HALF    LinkDuplex = 1
195         LINK_DUPLEX_API_FULL    LinkDuplex = 2
196 )
197
198 var (
199         LinkDuplex_name = map[uint32]string{
200                 0: "LINK_DUPLEX_API_UNKNOWN",
201                 1: "LINK_DUPLEX_API_HALF",
202                 2: "LINK_DUPLEX_API_FULL",
203         }
204         LinkDuplex_value = map[string]uint32{
205                 "LINK_DUPLEX_API_UNKNOWN": 0,
206                 "LINK_DUPLEX_API_HALF":    1,
207                 "LINK_DUPLEX_API_FULL":    2,
208         }
209 )
210
211 func (x LinkDuplex) String() string {
212         s, ok := LinkDuplex_name[uint32(x)]
213         if ok {
214                 return s
215         }
216         return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
217 }
218
219 // MtuProto defines enum 'mtu_proto'.
220 type MtuProto uint32
221
222 const (
223         MTU_PROTO_API_L3   MtuProto = 1
224         MTU_PROTO_API_IP4  MtuProto = 2
225         MTU_PROTO_API_IP6  MtuProto = 3
226         MTU_PROTO_API_MPLS MtuProto = 4
227         MTU_PROTO_API_N    MtuProto = 5
228 )
229
230 var (
231         MtuProto_name = map[uint32]string{
232                 1: "MTU_PROTO_API_L3",
233                 2: "MTU_PROTO_API_IP4",
234                 3: "MTU_PROTO_API_IP6",
235                 4: "MTU_PROTO_API_MPLS",
236                 5: "MTU_PROTO_API_N",
237         }
238         MtuProto_value = map[string]uint32{
239                 "MTU_PROTO_API_L3":   1,
240                 "MTU_PROTO_API_IP4":  2,
241                 "MTU_PROTO_API_IP6":  3,
242                 "MTU_PROTO_API_MPLS": 4,
243                 "MTU_PROTO_API_N":    5,
244         }
245 )
246
247 func (x MtuProto) String() string {
248         s, ok := MtuProto_name[uint32(x)]
249         if ok {
250                 return s
251         }
252         return "MtuProto(" + strconv.Itoa(int(x)) + ")"
253 }
254
255 // RxMode defines enum 'rx_mode'.
256 type RxMode uint32
257
258 const (
259         RX_MODE_API_UNKNOWN   RxMode = 0
260         RX_MODE_API_POLLING   RxMode = 1
261         RX_MODE_API_INTERRUPT RxMode = 2
262         RX_MODE_API_ADAPTIVE  RxMode = 3
263         RX_MODE_API_DEFAULT   RxMode = 4
264 )
265
266 var (
267         RxMode_name = map[uint32]string{
268                 0: "RX_MODE_API_UNKNOWN",
269                 1: "RX_MODE_API_POLLING",
270                 2: "RX_MODE_API_INTERRUPT",
271                 3: "RX_MODE_API_ADAPTIVE",
272                 4: "RX_MODE_API_DEFAULT",
273         }
274         RxMode_value = map[string]uint32{
275                 "RX_MODE_API_UNKNOWN":   0,
276                 "RX_MODE_API_POLLING":   1,
277                 "RX_MODE_API_INTERRUPT": 2,
278                 "RX_MODE_API_ADAPTIVE":  3,
279                 "RX_MODE_API_DEFAULT":   4,
280         }
281 )
282
283 func (x RxMode) String() string {
284         s, ok := RxMode_name[uint32(x)]
285         if ok {
286                 return s
287         }
288         return "RxMode(" + strconv.Itoa(int(x)) + ")"
289 }
290
291 // SubIfFlags defines enum 'sub_if_flags'.
292 type SubIfFlags uint32
293
294 const (
295         SUB_IF_API_FLAG_NO_TAGS           SubIfFlags = 1
296         SUB_IF_API_FLAG_ONE_TAG           SubIfFlags = 2
297         SUB_IF_API_FLAG_TWO_TAGS          SubIfFlags = 4
298         SUB_IF_API_FLAG_DOT1AD            SubIfFlags = 8
299         SUB_IF_API_FLAG_EXACT_MATCH       SubIfFlags = 16
300         SUB_IF_API_FLAG_DEFAULT           SubIfFlags = 32
301         SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
302         SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
303         SUB_IF_API_FLAG_MASK_VNET         SubIfFlags = 254
304         SUB_IF_API_FLAG_DOT1AH            SubIfFlags = 256
305 )
306
307 var (
308         SubIfFlags_name = map[uint32]string{
309                 1:   "SUB_IF_API_FLAG_NO_TAGS",
310                 2:   "SUB_IF_API_FLAG_ONE_TAG",
311                 4:   "SUB_IF_API_FLAG_TWO_TAGS",
312                 8:   "SUB_IF_API_FLAG_DOT1AD",
313                 16:  "SUB_IF_API_FLAG_EXACT_MATCH",
314                 32:  "SUB_IF_API_FLAG_DEFAULT",
315                 64:  "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
316                 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
317                 254: "SUB_IF_API_FLAG_MASK_VNET",
318                 256: "SUB_IF_API_FLAG_DOT1AH",
319         }
320         SubIfFlags_value = map[string]uint32{
321                 "SUB_IF_API_FLAG_NO_TAGS":           1,
322                 "SUB_IF_API_FLAG_ONE_TAG":           2,
323                 "SUB_IF_API_FLAG_TWO_TAGS":          4,
324                 "SUB_IF_API_FLAG_DOT1AD":            8,
325                 "SUB_IF_API_FLAG_EXACT_MATCH":       16,
326                 "SUB_IF_API_FLAG_DEFAULT":           32,
327                 "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64,
328                 "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128,
329                 "SUB_IF_API_FLAG_MASK_VNET":         254,
330                 "SUB_IF_API_FLAG_DOT1AH":            256,
331         }
332 )
333
334 func (x SubIfFlags) String() string {
335         s, ok := SubIfFlags_name[uint32(x)]
336         if ok {
337                 return s
338         }
339         str := func(n uint32) string {
340                 s, ok := SubIfFlags_name[uint32(n)]
341                 if ok {
342                         return s
343                 }
344                 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
345         }
346         for i := uint32(0); i <= 32; i++ {
347                 val := uint32(x)
348                 if val&(1<<i) != 0 {
349                         if s != "" {
350                                 s += "|"
351                         }
352                         s += str(1 << i)
353                 }
354         }
355         if s == "" {
356                 return str(uint32(x))
357         }
358         return s
359 }
360
361 // InterfaceIndex defines alias 'interface_index'.
362 type InterfaceIndex uint32
363
364 // MacAddress defines alias 'mac_address'.
365 type MacAddress [6]uint8
366
367 func ParseMacAddress(s string) (MacAddress, error) {
368         var macaddr MacAddress
369         mac, err := net.ParseMAC(s)
370         if err != nil {
371                 return macaddr, err
372         }
373         copy(macaddr[:], mac[:])
374         return macaddr, nil
375 }
376 func (x MacAddress) ToMAC() net.HardwareAddr {
377         return net.HardwareAddr(x[:])
378 }
379 func (x MacAddress) String() string {
380         return x.ToMAC().String()
381 }
382 func (x *MacAddress) MarshalText() ([]byte, error) {
383         return []byte(x.String()), nil
384 }
385 func (x *MacAddress) UnmarshalText(text []byte) error {
386         mac, err := ParseMacAddress(string(text))
387         if err != nil {
388                 return err
389         }
390         *x = mac
391         return nil
392 }
393
394 // BondCreate defines message 'bond_create'.
395 type BondCreate struct {
396         ID           uint32     `binapi:"u32,name=id" json:"id,omitempty"`
397         UseCustomMac bool       `binapi:"bool,name=use_custom_mac" json:"use_custom_mac,omitempty"`
398         MacAddress   MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
399         Mode         BondMode   `binapi:"bond_mode,name=mode" json:"mode,omitempty"`
400         Lb           BondLbAlgo `binapi:"bond_lb_algo,name=lb" json:"lb,omitempty"`
401         NumaOnly     bool       `binapi:"bool,name=numa_only" json:"numa_only,omitempty"`
402 }
403
404 func (m *BondCreate) Reset()               { *m = BondCreate{} }
405 func (*BondCreate) GetMessageName() string { return "bond_create" }
406 func (*BondCreate) GetCrcString() string   { return "48883c7e" }
407 func (*BondCreate) GetMessageType() api.MessageType {
408         return api.RequestMessage
409 }
410
411 func (m *BondCreate) Size() (size int) {
412         if m == nil {
413                 return 0
414         }
415         size += 4     // m.ID
416         size += 1     // m.UseCustomMac
417         size += 1 * 6 // m.MacAddress
418         size += 4     // m.Mode
419         size += 4     // m.Lb
420         size += 1     // m.NumaOnly
421         return size
422 }
423 func (m *BondCreate) Marshal(b []byte) ([]byte, error) {
424         if b == nil {
425                 b = make([]byte, m.Size())
426         }
427         buf := codec.NewBuffer(b)
428         buf.EncodeUint32(m.ID)
429         buf.EncodeBool(m.UseCustomMac)
430         buf.EncodeBytes(m.MacAddress[:], 6)
431         buf.EncodeUint32(uint32(m.Mode))
432         buf.EncodeUint32(uint32(m.Lb))
433         buf.EncodeBool(m.NumaOnly)
434         return buf.Bytes(), nil
435 }
436 func (m *BondCreate) Unmarshal(b []byte) error {
437         buf := codec.NewBuffer(b)
438         m.ID = buf.DecodeUint32()
439         m.UseCustomMac = buf.DecodeBool()
440         copy(m.MacAddress[:], buf.DecodeBytes(6))
441         m.Mode = BondMode(buf.DecodeUint32())
442         m.Lb = BondLbAlgo(buf.DecodeUint32())
443         m.NumaOnly = buf.DecodeBool()
444         return nil
445 }
446
447 // BondCreateReply defines message 'bond_create_reply'.
448 type BondCreateReply struct {
449         Retval    int32          `binapi:"i32,name=retval" json:"retval,omitempty"`
450         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
451 }
452
453 func (m *BondCreateReply) Reset()               { *m = BondCreateReply{} }
454 func (*BondCreateReply) GetMessageName() string { return "bond_create_reply" }
455 func (*BondCreateReply) GetCrcString() string   { return "5383d31f" }
456 func (*BondCreateReply) GetMessageType() api.MessageType {
457         return api.ReplyMessage
458 }
459
460 func (m *BondCreateReply) Size() (size int) {
461         if m == nil {
462                 return 0
463         }
464         size += 4 // m.Retval
465         size += 4 // m.SwIfIndex
466         return size
467 }
468 func (m *BondCreateReply) Marshal(b []byte) ([]byte, error) {
469         if b == nil {
470                 b = make([]byte, m.Size())
471         }
472         buf := codec.NewBuffer(b)
473         buf.EncodeInt32(m.Retval)
474         buf.EncodeUint32(uint32(m.SwIfIndex))
475         return buf.Bytes(), nil
476 }
477 func (m *BondCreateReply) Unmarshal(b []byte) error {
478         buf := codec.NewBuffer(b)
479         m.Retval = buf.DecodeInt32()
480         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
481         return nil
482 }
483
484 // BondDelete defines message 'bond_delete'.
485 type BondDelete struct {
486         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
487 }
488
489 func (m *BondDelete) Reset()               { *m = BondDelete{} }
490 func (*BondDelete) GetMessageName() string { return "bond_delete" }
491 func (*BondDelete) GetCrcString() string   { return "f9e6675e" }
492 func (*BondDelete) GetMessageType() api.MessageType {
493         return api.RequestMessage
494 }
495
496 func (m *BondDelete) Size() (size int) {
497         if m == nil {
498                 return 0
499         }
500         size += 4 // m.SwIfIndex
501         return size
502 }
503 func (m *BondDelete) Marshal(b []byte) ([]byte, error) {
504         if b == nil {
505                 b = make([]byte, m.Size())
506         }
507         buf := codec.NewBuffer(b)
508         buf.EncodeUint32(uint32(m.SwIfIndex))
509         return buf.Bytes(), nil
510 }
511 func (m *BondDelete) Unmarshal(b []byte) error {
512         buf := codec.NewBuffer(b)
513         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
514         return nil
515 }
516
517 // BondDeleteReply defines message 'bond_delete_reply'.
518 type BondDeleteReply struct {
519         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
520 }
521
522 func (m *BondDeleteReply) Reset()               { *m = BondDeleteReply{} }
523 func (*BondDeleteReply) GetMessageName() string { return "bond_delete_reply" }
524 func (*BondDeleteReply) GetCrcString() string   { return "e8d4e804" }
525 func (*BondDeleteReply) GetMessageType() api.MessageType {
526         return api.ReplyMessage
527 }
528
529 func (m *BondDeleteReply) Size() (size int) {
530         if m == nil {
531                 return 0
532         }
533         size += 4 // m.Retval
534         return size
535 }
536 func (m *BondDeleteReply) Marshal(b []byte) ([]byte, error) {
537         if b == nil {
538                 b = make([]byte, m.Size())
539         }
540         buf := codec.NewBuffer(b)
541         buf.EncodeInt32(m.Retval)
542         return buf.Bytes(), nil
543 }
544 func (m *BondDeleteReply) Unmarshal(b []byte) error {
545         buf := codec.NewBuffer(b)
546         m.Retval = buf.DecodeInt32()
547         return nil
548 }
549
550 // BondDetachSlave defines message 'bond_detach_slave'.
551 type BondDetachSlave struct {
552         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
553 }
554
555 func (m *BondDetachSlave) Reset()               { *m = BondDetachSlave{} }
556 func (*BondDetachSlave) GetMessageName() string { return "bond_detach_slave" }
557 func (*BondDetachSlave) GetCrcString() string   { return "f9e6675e" }
558 func (*BondDetachSlave) GetMessageType() api.MessageType {
559         return api.RequestMessage
560 }
561
562 func (m *BondDetachSlave) Size() (size int) {
563         if m == nil {
564                 return 0
565         }
566         size += 4 // m.SwIfIndex
567         return size
568 }
569 func (m *BondDetachSlave) Marshal(b []byte) ([]byte, error) {
570         if b == nil {
571                 b = make([]byte, m.Size())
572         }
573         buf := codec.NewBuffer(b)
574         buf.EncodeUint32(uint32(m.SwIfIndex))
575         return buf.Bytes(), nil
576 }
577 func (m *BondDetachSlave) Unmarshal(b []byte) error {
578         buf := codec.NewBuffer(b)
579         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
580         return nil
581 }
582
583 // BondDetachSlaveReply defines message 'bond_detach_slave_reply'.
584 type BondDetachSlaveReply struct {
585         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
586 }
587
588 func (m *BondDetachSlaveReply) Reset()               { *m = BondDetachSlaveReply{} }
589 func (*BondDetachSlaveReply) GetMessageName() string { return "bond_detach_slave_reply" }
590 func (*BondDetachSlaveReply) GetCrcString() string   { return "e8d4e804" }
591 func (*BondDetachSlaveReply) GetMessageType() api.MessageType {
592         return api.ReplyMessage
593 }
594
595 func (m *BondDetachSlaveReply) Size() (size int) {
596         if m == nil {
597                 return 0
598         }
599         size += 4 // m.Retval
600         return size
601 }
602 func (m *BondDetachSlaveReply) Marshal(b []byte) ([]byte, error) {
603         if b == nil {
604                 b = make([]byte, m.Size())
605         }
606         buf := codec.NewBuffer(b)
607         buf.EncodeInt32(m.Retval)
608         return buf.Bytes(), nil
609 }
610 func (m *BondDetachSlaveReply) Unmarshal(b []byte) error {
611         buf := codec.NewBuffer(b)
612         m.Retval = buf.DecodeInt32()
613         return nil
614 }
615
616 // BondEnslave defines message 'bond_enslave'.
617 type BondEnslave struct {
618         SwIfIndex     InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
619         BondSwIfIndex InterfaceIndex `binapi:"interface_index,name=bond_sw_if_index" json:"bond_sw_if_index,omitempty"`
620         IsPassive     bool           `binapi:"bool,name=is_passive" json:"is_passive,omitempty"`
621         IsLongTimeout bool           `binapi:"bool,name=is_long_timeout" json:"is_long_timeout,omitempty"`
622 }
623
624 func (m *BondEnslave) Reset()               { *m = BondEnslave{} }
625 func (*BondEnslave) GetMessageName() string { return "bond_enslave" }
626 func (*BondEnslave) GetCrcString() string   { return "076ecfa7" }
627 func (*BondEnslave) GetMessageType() api.MessageType {
628         return api.RequestMessage
629 }
630
631 func (m *BondEnslave) Size() (size int) {
632         if m == nil {
633                 return 0
634         }
635         size += 4 // m.SwIfIndex
636         size += 4 // m.BondSwIfIndex
637         size += 1 // m.IsPassive
638         size += 1 // m.IsLongTimeout
639         return size
640 }
641 func (m *BondEnslave) Marshal(b []byte) ([]byte, error) {
642         if b == nil {
643                 b = make([]byte, m.Size())
644         }
645         buf := codec.NewBuffer(b)
646         buf.EncodeUint32(uint32(m.SwIfIndex))
647         buf.EncodeUint32(uint32(m.BondSwIfIndex))
648         buf.EncodeBool(m.IsPassive)
649         buf.EncodeBool(m.IsLongTimeout)
650         return buf.Bytes(), nil
651 }
652 func (m *BondEnslave) Unmarshal(b []byte) error {
653         buf := codec.NewBuffer(b)
654         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
655         m.BondSwIfIndex = InterfaceIndex(buf.DecodeUint32())
656         m.IsPassive = buf.DecodeBool()
657         m.IsLongTimeout = buf.DecodeBool()
658         return nil
659 }
660
661 // BondEnslaveReply defines message 'bond_enslave_reply'.
662 type BondEnslaveReply struct {
663         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
664 }
665
666 func (m *BondEnslaveReply) Reset()               { *m = BondEnslaveReply{} }
667 func (*BondEnslaveReply) GetMessageName() string { return "bond_enslave_reply" }
668 func (*BondEnslaveReply) GetCrcString() string   { return "e8d4e804" }
669 func (*BondEnslaveReply) GetMessageType() api.MessageType {
670         return api.ReplyMessage
671 }
672
673 func (m *BondEnslaveReply) Size() (size int) {
674         if m == nil {
675                 return 0
676         }
677         size += 4 // m.Retval
678         return size
679 }
680 func (m *BondEnslaveReply) Marshal(b []byte) ([]byte, error) {
681         if b == nil {
682                 b = make([]byte, m.Size())
683         }
684         buf := codec.NewBuffer(b)
685         buf.EncodeInt32(m.Retval)
686         return buf.Bytes(), nil
687 }
688 func (m *BondEnslaveReply) Unmarshal(b []byte) error {
689         buf := codec.NewBuffer(b)
690         m.Retval = buf.DecodeInt32()
691         return nil
692 }
693
694 // SwInterfaceBondDetails defines message 'sw_interface_bond_details'.
695 type SwInterfaceBondDetails struct {
696         SwIfIndex     InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
697         ID            uint32         `binapi:"u32,name=id" json:"id,omitempty"`
698         Mode          BondMode       `binapi:"bond_mode,name=mode" json:"mode,omitempty"`
699         Lb            BondLbAlgo     `binapi:"bond_lb_algo,name=lb" json:"lb,omitempty"`
700         NumaOnly      bool           `binapi:"bool,name=numa_only" json:"numa_only,omitempty"`
701         ActiveSlaves  uint32         `binapi:"u32,name=active_slaves" json:"active_slaves,omitempty"`
702         Slaves        uint32         `binapi:"u32,name=slaves" json:"slaves,omitempty"`
703         InterfaceName string         `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"`
704 }
705
706 func (m *SwInterfaceBondDetails) Reset()               { *m = SwInterfaceBondDetails{} }
707 func (*SwInterfaceBondDetails) GetMessageName() string { return "sw_interface_bond_details" }
708 func (*SwInterfaceBondDetails) GetCrcString() string   { return "f5ef2106" }
709 func (*SwInterfaceBondDetails) GetMessageType() api.MessageType {
710         return api.ReplyMessage
711 }
712
713 func (m *SwInterfaceBondDetails) Size() (size int) {
714         if m == nil {
715                 return 0
716         }
717         size += 4  // m.SwIfIndex
718         size += 4  // m.ID
719         size += 4  // m.Mode
720         size += 4  // m.Lb
721         size += 1  // m.NumaOnly
722         size += 4  // m.ActiveSlaves
723         size += 4  // m.Slaves
724         size += 64 // m.InterfaceName
725         return size
726 }
727 func (m *SwInterfaceBondDetails) Marshal(b []byte) ([]byte, error) {
728         if b == nil {
729                 b = make([]byte, m.Size())
730         }
731         buf := codec.NewBuffer(b)
732         buf.EncodeUint32(uint32(m.SwIfIndex))
733         buf.EncodeUint32(m.ID)
734         buf.EncodeUint32(uint32(m.Mode))
735         buf.EncodeUint32(uint32(m.Lb))
736         buf.EncodeBool(m.NumaOnly)
737         buf.EncodeUint32(m.ActiveSlaves)
738         buf.EncodeUint32(m.Slaves)
739         buf.EncodeString(m.InterfaceName, 64)
740         return buf.Bytes(), nil
741 }
742 func (m *SwInterfaceBondDetails) Unmarshal(b []byte) error {
743         buf := codec.NewBuffer(b)
744         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
745         m.ID = buf.DecodeUint32()
746         m.Mode = BondMode(buf.DecodeUint32())
747         m.Lb = BondLbAlgo(buf.DecodeUint32())
748         m.NumaOnly = buf.DecodeBool()
749         m.ActiveSlaves = buf.DecodeUint32()
750         m.Slaves = buf.DecodeUint32()
751         m.InterfaceName = buf.DecodeString(64)
752         return nil
753 }
754
755 // SwInterfaceBondDump defines message 'sw_interface_bond_dump'.
756 type SwInterfaceBondDump struct{}
757
758 func (m *SwInterfaceBondDump) Reset()               { *m = SwInterfaceBondDump{} }
759 func (*SwInterfaceBondDump) GetMessageName() string { return "sw_interface_bond_dump" }
760 func (*SwInterfaceBondDump) GetCrcString() string   { return "51077d14" }
761 func (*SwInterfaceBondDump) GetMessageType() api.MessageType {
762         return api.RequestMessage
763 }
764
765 func (m *SwInterfaceBondDump) Size() (size int) {
766         if m == nil {
767                 return 0
768         }
769         return size
770 }
771 func (m *SwInterfaceBondDump) Marshal(b []byte) ([]byte, error) {
772         if b == nil {
773                 b = make([]byte, m.Size())
774         }
775         buf := codec.NewBuffer(b)
776         return buf.Bytes(), nil
777 }
778 func (m *SwInterfaceBondDump) Unmarshal(b []byte) error {
779         return nil
780 }
781
782 // SwInterfaceSetBondWeight defines message 'sw_interface_set_bond_weight'.
783 type SwInterfaceSetBondWeight struct {
784         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
785         Weight    uint32         `binapi:"u32,name=weight" json:"weight,omitempty"`
786 }
787
788 func (m *SwInterfaceSetBondWeight) Reset()               { *m = SwInterfaceSetBondWeight{} }
789 func (*SwInterfaceSetBondWeight) GetMessageName() string { return "sw_interface_set_bond_weight" }
790 func (*SwInterfaceSetBondWeight) GetCrcString() string   { return "deb510a0" }
791 func (*SwInterfaceSetBondWeight) GetMessageType() api.MessageType {
792         return api.RequestMessage
793 }
794
795 func (m *SwInterfaceSetBondWeight) Size() (size int) {
796         if m == nil {
797                 return 0
798         }
799         size += 4 // m.SwIfIndex
800         size += 4 // m.Weight
801         return size
802 }
803 func (m *SwInterfaceSetBondWeight) Marshal(b []byte) ([]byte, error) {
804         if b == nil {
805                 b = make([]byte, m.Size())
806         }
807         buf := codec.NewBuffer(b)
808         buf.EncodeUint32(uint32(m.SwIfIndex))
809         buf.EncodeUint32(m.Weight)
810         return buf.Bytes(), nil
811 }
812 func (m *SwInterfaceSetBondWeight) Unmarshal(b []byte) error {
813         buf := codec.NewBuffer(b)
814         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
815         m.Weight = buf.DecodeUint32()
816         return nil
817 }
818
819 // SwInterfaceSetBondWeightReply defines message 'sw_interface_set_bond_weight_reply'.
820 type SwInterfaceSetBondWeightReply struct {
821         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
822 }
823
824 func (m *SwInterfaceSetBondWeightReply) Reset() { *m = SwInterfaceSetBondWeightReply{} }
825 func (*SwInterfaceSetBondWeightReply) GetMessageName() string {
826         return "sw_interface_set_bond_weight_reply"
827 }
828 func (*SwInterfaceSetBondWeightReply) GetCrcString() string { return "e8d4e804" }
829 func (*SwInterfaceSetBondWeightReply) GetMessageType() api.MessageType {
830         return api.ReplyMessage
831 }
832
833 func (m *SwInterfaceSetBondWeightReply) Size() (size int) {
834         if m == nil {
835                 return 0
836         }
837         size += 4 // m.Retval
838         return size
839 }
840 func (m *SwInterfaceSetBondWeightReply) Marshal(b []byte) ([]byte, error) {
841         if b == nil {
842                 b = make([]byte, m.Size())
843         }
844         buf := codec.NewBuffer(b)
845         buf.EncodeInt32(m.Retval)
846         return buf.Bytes(), nil
847 }
848 func (m *SwInterfaceSetBondWeightReply) Unmarshal(b []byte) error {
849         buf := codec.NewBuffer(b)
850         m.Retval = buf.DecodeInt32()
851         return nil
852 }
853
854 // SwInterfaceSlaveDetails defines message 'sw_interface_slave_details'.
855 type SwInterfaceSlaveDetails struct {
856         SwIfIndex     InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
857         InterfaceName string         `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"`
858         IsPassive     bool           `binapi:"bool,name=is_passive" json:"is_passive,omitempty"`
859         IsLongTimeout bool           `binapi:"bool,name=is_long_timeout" json:"is_long_timeout,omitempty"`
860         IsLocalNuma   bool           `binapi:"bool,name=is_local_numa" json:"is_local_numa,omitempty"`
861         Weight        uint32         `binapi:"u32,name=weight" json:"weight,omitempty"`
862 }
863
864 func (m *SwInterfaceSlaveDetails) Reset()               { *m = SwInterfaceSlaveDetails{} }
865 func (*SwInterfaceSlaveDetails) GetMessageName() string { return "sw_interface_slave_details" }
866 func (*SwInterfaceSlaveDetails) GetCrcString() string   { return "3c4a0e23" }
867 func (*SwInterfaceSlaveDetails) GetMessageType() api.MessageType {
868         return api.ReplyMessage
869 }
870
871 func (m *SwInterfaceSlaveDetails) Size() (size int) {
872         if m == nil {
873                 return 0
874         }
875         size += 4  // m.SwIfIndex
876         size += 64 // m.InterfaceName
877         size += 1  // m.IsPassive
878         size += 1  // m.IsLongTimeout
879         size += 1  // m.IsLocalNuma
880         size += 4  // m.Weight
881         return size
882 }
883 func (m *SwInterfaceSlaveDetails) Marshal(b []byte) ([]byte, error) {
884         if b == nil {
885                 b = make([]byte, m.Size())
886         }
887         buf := codec.NewBuffer(b)
888         buf.EncodeUint32(uint32(m.SwIfIndex))
889         buf.EncodeString(m.InterfaceName, 64)
890         buf.EncodeBool(m.IsPassive)
891         buf.EncodeBool(m.IsLongTimeout)
892         buf.EncodeBool(m.IsLocalNuma)
893         buf.EncodeUint32(m.Weight)
894         return buf.Bytes(), nil
895 }
896 func (m *SwInterfaceSlaveDetails) Unmarshal(b []byte) error {
897         buf := codec.NewBuffer(b)
898         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
899         m.InterfaceName = buf.DecodeString(64)
900         m.IsPassive = buf.DecodeBool()
901         m.IsLongTimeout = buf.DecodeBool()
902         m.IsLocalNuma = buf.DecodeBool()
903         m.Weight = buf.DecodeUint32()
904         return nil
905 }
906
907 // SwInterfaceSlaveDump defines message 'sw_interface_slave_dump'.
908 type SwInterfaceSlaveDump struct {
909         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
910 }
911
912 func (m *SwInterfaceSlaveDump) Reset()               { *m = SwInterfaceSlaveDump{} }
913 func (*SwInterfaceSlaveDump) GetMessageName() string { return "sw_interface_slave_dump" }
914 func (*SwInterfaceSlaveDump) GetCrcString() string   { return "f9e6675e" }
915 func (*SwInterfaceSlaveDump) GetMessageType() api.MessageType {
916         return api.RequestMessage
917 }
918
919 func (m *SwInterfaceSlaveDump) Size() (size int) {
920         if m == nil {
921                 return 0
922         }
923         size += 4 // m.SwIfIndex
924         return size
925 }
926 func (m *SwInterfaceSlaveDump) Marshal(b []byte) ([]byte, error) {
927         if b == nil {
928                 b = make([]byte, m.Size())
929         }
930         buf := codec.NewBuffer(b)
931         buf.EncodeUint32(uint32(m.SwIfIndex))
932         return buf.Bytes(), nil
933 }
934 func (m *SwInterfaceSlaveDump) Unmarshal(b []byte) error {
935         buf := codec.NewBuffer(b)
936         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
937         return nil
938 }
939
940 func init() { file_bond_binapi_init() }
941 func file_bond_binapi_init() {
942         api.RegisterMessage((*BondCreate)(nil), "bond_create_48883c7e")
943         api.RegisterMessage((*BondCreateReply)(nil), "bond_create_reply_5383d31f")
944         api.RegisterMessage((*BondDelete)(nil), "bond_delete_f9e6675e")
945         api.RegisterMessage((*BondDeleteReply)(nil), "bond_delete_reply_e8d4e804")
946         api.RegisterMessage((*BondDetachSlave)(nil), "bond_detach_slave_f9e6675e")
947         api.RegisterMessage((*BondDetachSlaveReply)(nil), "bond_detach_slave_reply_e8d4e804")
948         api.RegisterMessage((*BondEnslave)(nil), "bond_enslave_076ecfa7")
949         api.RegisterMessage((*BondEnslaveReply)(nil), "bond_enslave_reply_e8d4e804")
950         api.RegisterMessage((*SwInterfaceBondDetails)(nil), "sw_interface_bond_details_f5ef2106")
951         api.RegisterMessage((*SwInterfaceBondDump)(nil), "sw_interface_bond_dump_51077d14")
952         api.RegisterMessage((*SwInterfaceSetBondWeight)(nil), "sw_interface_set_bond_weight_deb510a0")
953         api.RegisterMessage((*SwInterfaceSetBondWeightReply)(nil), "sw_interface_set_bond_weight_reply_e8d4e804")
954         api.RegisterMessage((*SwInterfaceSlaveDetails)(nil), "sw_interface_slave_details_3c4a0e23")
955         api.RegisterMessage((*SwInterfaceSlaveDump)(nil), "sw_interface_slave_dump_f9e6675e")
956 }
957
958 // Messages returns list of all messages in this module.
959 func AllMessages() []api.Message {
960         return []api.Message{
961                 (*BondCreate)(nil),
962                 (*BondCreateReply)(nil),
963                 (*BondDelete)(nil),
964                 (*BondDeleteReply)(nil),
965                 (*BondDetachSlave)(nil),
966                 (*BondDetachSlaveReply)(nil),
967                 (*BondEnslave)(nil),
968                 (*BondEnslaveReply)(nil),
969                 (*SwInterfaceBondDetails)(nil),
970                 (*SwInterfaceBondDump)(nil),
971                 (*SwInterfaceSetBondWeight)(nil),
972                 (*SwInterfaceSetBondWeightReply)(nil),
973                 (*SwInterfaceSlaveDetails)(nil),
974                 (*SwInterfaceSlaveDump)(nil),
975         }
976 }