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