1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.5.0-dev
5 // source: .vppapi/core/bond.api.json
7 // Package bond contains generated bindings for API file bond.api.
20 api "git.fd.io/govpp.git/api"
21 codec "git.fd.io/govpp.git/codec"
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
33 VersionCrc = 0x69f583ad
36 // BondLbAlgo defines enum 'bond_lb_algo'.
37 type BondLbAlgo uint32
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
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",
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,
67 func (x BondLbAlgo) String() string {
68 s, ok := BondLbAlgo_name[uint32(x)]
72 return "BondLbAlgo(" + strconv.Itoa(int(x)) + ")"
75 // BondMode defines enum 'bond_mode'.
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
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",
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,
103 func (x BondMode) String() string {
104 s, ok := BondMode_name[uint32(x)]
108 return "BondMode(" + strconv.Itoa(int(x)) + ")"
111 // IfStatusFlags defines enum 'if_status_flags'.
112 type IfStatusFlags uint32
115 IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
116 IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
120 IfStatusFlags_name = map[uint32]string{
121 1: "IF_STATUS_API_FLAG_ADMIN_UP",
122 2: "IF_STATUS_API_FLAG_LINK_UP",
124 IfStatusFlags_value = map[string]uint32{
125 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
126 "IF_STATUS_API_FLAG_LINK_UP": 2,
130 func (x IfStatusFlags) String() string {
131 s, ok := IfStatusFlags_name[uint32(x)]
135 str := func(n uint32) string {
136 s, ok := IfStatusFlags_name[uint32(n)]
140 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
142 for i := uint32(0); i <= 32; i++ {
152 return str(uint32(x))
157 // IfType defines enum 'if_type'.
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
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",
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,
182 func (x IfType) String() string {
183 s, ok := IfType_name[uint32(x)]
187 return "IfType(" + strconv.Itoa(int(x)) + ")"
190 // LinkDuplex defines enum 'link_duplex'.
191 type LinkDuplex uint32
194 LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
195 LINK_DUPLEX_API_HALF LinkDuplex = 1
196 LINK_DUPLEX_API_FULL LinkDuplex = 2
200 LinkDuplex_name = map[uint32]string{
201 0: "LINK_DUPLEX_API_UNKNOWN",
202 1: "LINK_DUPLEX_API_HALF",
203 2: "LINK_DUPLEX_API_FULL",
205 LinkDuplex_value = map[string]uint32{
206 "LINK_DUPLEX_API_UNKNOWN": 0,
207 "LINK_DUPLEX_API_HALF": 1,
208 "LINK_DUPLEX_API_FULL": 2,
212 func (x LinkDuplex) String() string {
213 s, ok := LinkDuplex_name[uint32(x)]
217 return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
220 // MtuProto defines enum 'mtu_proto'.
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
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",
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,
248 func (x MtuProto) String() string {
249 s, ok := MtuProto_name[uint32(x)]
253 return "MtuProto(" + strconv.Itoa(int(x)) + ")"
256 // RxMode defines enum 'rx_mode'.
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
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",
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,
284 func (x RxMode) String() string {
285 s, ok := RxMode_name[uint32(x)]
289 return "RxMode(" + strconv.Itoa(int(x)) + ")"
292 // SubIfFlags defines enum 'sub_if_flags'.
293 type SubIfFlags uint32
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
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",
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,
335 func (x SubIfFlags) String() string {
336 s, ok := SubIfFlags_name[uint32(x)]
340 str := func(n uint32) string {
341 s, ok := SubIfFlags_name[uint32(n)]
345 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
347 for i := uint32(0); i <= 32; i++ {
357 return str(uint32(x))
362 // InterfaceIndex defines alias 'interface_index'.
363 type InterfaceIndex uint32
365 // MacAddress defines alias 'mac_address'.
366 type MacAddress [6]uint8
368 func ParseMacAddress(s string) (MacAddress, error) {
369 var macaddr MacAddress
370 mac, err := net.ParseMAC(s)
374 copy(macaddr[:], mac[:])
378 func (x MacAddress) ToMAC() net.HardwareAddr {
379 return net.HardwareAddr(x[:])
382 func (x MacAddress) String() string {
383 return x.ToMAC().String()
386 func (x *MacAddress) MarshalText() ([]byte, error) {
387 return []byte(x.String()), nil
390 func (x *MacAddress) UnmarshalText(text []byte) error {
391 mac, err := ParseMacAddress(string(text))
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"`
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
416 func (m *BondCreate) Size() (size int) {
421 size += 1 // m.UseCustomMac
422 size += 1 * 6 // m.MacAddress
425 size += 1 // m.NumaOnly
428 func (m *BondCreate) Marshal(b []byte) ([]byte, error) {
430 b = make([]byte, m.Size())
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
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()
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"`
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
465 func (m *BondCreateReply) Size() (size int) {
469 size += 4 // m.Retval
470 size += 4 // m.SwIfIndex
473 func (m *BondCreateReply) Marshal(b []byte) ([]byte, error) {
475 b = make([]byte, m.Size())
477 buf := codec.NewBuffer(b)
478 buf.EncodeInt32(m.Retval)
479 buf.EncodeUint32(uint32(m.SwIfIndex))
480 return buf.Bytes(), nil
482 func (m *BondCreateReply) Unmarshal(b []byte) error {
483 buf := codec.NewBuffer(b)
484 m.Retval = buf.DecodeInt32()
485 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
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"`
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
501 func (m *BondDelete) Size() (size int) {
505 size += 4 // m.SwIfIndex
508 func (m *BondDelete) Marshal(b []byte) ([]byte, error) {
510 b = make([]byte, m.Size())
512 buf := codec.NewBuffer(b)
513 buf.EncodeUint32(uint32(m.SwIfIndex))
514 return buf.Bytes(), nil
516 func (m *BondDelete) Unmarshal(b []byte) error {
517 buf := codec.NewBuffer(b)
518 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
522 // BondDeleteReply defines message 'bond_delete_reply'.
523 type BondDeleteReply struct {
524 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
534 func (m *BondDeleteReply) Size() (size int) {
538 size += 4 // m.Retval
541 func (m *BondDeleteReply) Marshal(b []byte) ([]byte, error) {
543 b = make([]byte, m.Size())
545 buf := codec.NewBuffer(b)
546 buf.EncodeInt32(m.Retval)
547 return buf.Bytes(), nil
549 func (m *BondDeleteReply) Unmarshal(b []byte) error {
550 buf := codec.NewBuffer(b)
551 m.Retval = buf.DecodeInt32()
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"`
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
567 func (m *BondDetachSlave) Size() (size int) {
571 size += 4 // m.SwIfIndex
574 func (m *BondDetachSlave) Marshal(b []byte) ([]byte, error) {
576 b = make([]byte, m.Size())
578 buf := codec.NewBuffer(b)
579 buf.EncodeUint32(uint32(m.SwIfIndex))
580 return buf.Bytes(), nil
582 func (m *BondDetachSlave) Unmarshal(b []byte) error {
583 buf := codec.NewBuffer(b)
584 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
588 // BondDetachSlaveReply defines message 'bond_detach_slave_reply'.
589 type BondDetachSlaveReply struct {
590 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
600 func (m *BondDetachSlaveReply) Size() (size int) {
604 size += 4 // m.Retval
607 func (m *BondDetachSlaveReply) Marshal(b []byte) ([]byte, error) {
609 b = make([]byte, m.Size())
611 buf := codec.NewBuffer(b)
612 buf.EncodeInt32(m.Retval)
613 return buf.Bytes(), nil
615 func (m *BondDetachSlaveReply) Unmarshal(b []byte) error {
616 buf := codec.NewBuffer(b)
617 m.Retval = buf.DecodeInt32()
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"`
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
636 func (m *BondEnslave) Size() (size int) {
640 size += 4 // m.SwIfIndex
641 size += 4 // m.BondSwIfIndex
642 size += 1 // m.IsPassive
643 size += 1 // m.IsLongTimeout
646 func (m *BondEnslave) Marshal(b []byte) ([]byte, error) {
648 b = make([]byte, m.Size())
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
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()
666 // BondEnslaveReply defines message 'bond_enslave_reply'.
667 type BondEnslaveReply struct {
668 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
678 func (m *BondEnslaveReply) Size() (size int) {
682 size += 4 // m.Retval
685 func (m *BondEnslaveReply) Marshal(b []byte) ([]byte, error) {
687 b = make([]byte, m.Size())
689 buf := codec.NewBuffer(b)
690 buf.EncodeInt32(m.Retval)
691 return buf.Bytes(), nil
693 func (m *BondEnslaveReply) Unmarshal(b []byte) error {
694 buf := codec.NewBuffer(b)
695 m.Retval = buf.DecodeInt32()
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"`
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
718 func (m *SwInterfaceBondDetails) Size() (size int) {
722 size += 4 // m.SwIfIndex
726 size += 1 // m.NumaOnly
727 size += 4 // m.ActiveSlaves
728 size += 4 // m.Slaves
729 size += 64 // m.InterfaceName
732 func (m *SwInterfaceBondDetails) Marshal(b []byte) ([]byte, error) {
734 b = make([]byte, m.Size())
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
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)
760 // SwInterfaceBondDump defines message 'sw_interface_bond_dump'.
761 type SwInterfaceBondDump struct{}
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
770 func (m *SwInterfaceBondDump) Size() (size int) {
776 func (m *SwInterfaceBondDump) Marshal(b []byte) ([]byte, error) {
778 b = make([]byte, m.Size())
780 buf := codec.NewBuffer(b)
781 return buf.Bytes(), nil
783 func (m *SwInterfaceBondDump) Unmarshal(b []byte) error {
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"`
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
800 func (m *SwInterfaceSetBondWeight) Size() (size int) {
804 size += 4 // m.SwIfIndex
805 size += 4 // m.Weight
808 func (m *SwInterfaceSetBondWeight) Marshal(b []byte) ([]byte, error) {
810 b = make([]byte, m.Size())
812 buf := codec.NewBuffer(b)
813 buf.EncodeUint32(uint32(m.SwIfIndex))
814 buf.EncodeUint32(m.Weight)
815 return buf.Bytes(), nil
817 func (m *SwInterfaceSetBondWeight) Unmarshal(b []byte) error {
818 buf := codec.NewBuffer(b)
819 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
820 m.Weight = buf.DecodeUint32()
824 // SwInterfaceSetBondWeightReply defines message 'sw_interface_set_bond_weight_reply'.
825 type SwInterfaceSetBondWeightReply struct {
826 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
829 func (m *SwInterfaceSetBondWeightReply) Reset() { *m = SwInterfaceSetBondWeightReply{} }
830 func (*SwInterfaceSetBondWeightReply) GetMessageName() string {
831 return "sw_interface_set_bond_weight_reply"
833 func (*SwInterfaceSetBondWeightReply) GetCrcString() string { return "e8d4e804" }
834 func (*SwInterfaceSetBondWeightReply) GetMessageType() api.MessageType {
835 return api.ReplyMessage
838 func (m *SwInterfaceSetBondWeightReply) Size() (size int) {
842 size += 4 // m.Retval
845 func (m *SwInterfaceSetBondWeightReply) Marshal(b []byte) ([]byte, error) {
847 b = make([]byte, m.Size())
849 buf := codec.NewBuffer(b)
850 buf.EncodeInt32(m.Retval)
851 return buf.Bytes(), nil
853 func (m *SwInterfaceSetBondWeightReply) Unmarshal(b []byte) error {
854 buf := codec.NewBuffer(b)
855 m.Retval = buf.DecodeInt32()
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"`
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
876 func (m *SwInterfaceSlaveDetails) Size() (size int) {
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
888 func (m *SwInterfaceSlaveDetails) Marshal(b []byte) ([]byte, error) {
890 b = make([]byte, m.Size())
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
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()
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"`
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
924 func (m *SwInterfaceSlaveDump) Size() (size int) {
928 size += 4 // m.SwIfIndex
931 func (m *SwInterfaceSlaveDump) Marshal(b []byte) ([]byte, error) {
933 b = make([]byte, m.Size())
935 buf := codec.NewBuffer(b)
936 buf.EncodeUint32(uint32(m.SwIfIndex))
937 return buf.Bytes(), nil
939 func (m *SwInterfaceSlaveDump) Unmarshal(b []byte) error {
940 buf := codec.NewBuffer(b)
941 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
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")
963 // Messages returns list of all messages in this module.
964 func AllMessages() []api.Message {
965 return []api.Message{
967 (*BondCreateReply)(nil),
969 (*BondDeleteReply)(nil),
970 (*BondDetachSlave)(nil),
971 (*BondDetachSlaveReply)(nil),
973 (*BondEnslaveReply)(nil),
974 (*SwInterfaceBondDetails)(nil),
975 (*SwInterfaceBondDump)(nil),
976 (*SwInterfaceSetBondWeight)(nil),
977 (*SwInterfaceSetBondWeightReply)(nil),
978 (*SwInterfaceSlaveDetails)(nil),
979 (*SwInterfaceSlaveDump)(nil),