1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: .vppapi/core/bond.api.json
7 // Package bond contains generated bindings for API file bond.api.
17 api "git.fd.io/govpp.git/api"
18 codec "git.fd.io/govpp.git/codec"
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
32 VersionCrc = 0x69f583ad
35 // BondLbAlgo defines enum 'bond_lb_algo'.
36 type BondLbAlgo uint32
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
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",
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,
66 func (x BondLbAlgo) String() string {
67 s, ok := BondLbAlgo_name[uint32(x)]
71 return "BondLbAlgo(" + strconv.Itoa(int(x)) + ")"
74 // BondMode defines enum 'bond_mode'.
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
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",
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,
102 func (x BondMode) String() string {
103 s, ok := BondMode_name[uint32(x)]
107 return "BondMode(" + strconv.Itoa(int(x)) + ")"
110 // IfStatusFlags defines enum 'if_status_flags'.
111 type IfStatusFlags uint32
114 IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
115 IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
119 IfStatusFlags_name = map[uint32]string{
120 1: "IF_STATUS_API_FLAG_ADMIN_UP",
121 2: "IF_STATUS_API_FLAG_LINK_UP",
123 IfStatusFlags_value = map[string]uint32{
124 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
125 "IF_STATUS_API_FLAG_LINK_UP": 2,
129 func (x IfStatusFlags) String() string {
130 s, ok := IfStatusFlags_name[uint32(x)]
134 str := func(n uint32) string {
135 s, ok := IfStatusFlags_name[uint32(n)]
139 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
141 for i := uint32(0); i <= 32; i++ {
151 return str(uint32(x))
156 // IfType defines enum 'if_type'.
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
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",
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,
181 func (x IfType) String() string {
182 s, ok := IfType_name[uint32(x)]
186 return "IfType(" + strconv.Itoa(int(x)) + ")"
189 // LinkDuplex defines enum 'link_duplex'.
190 type LinkDuplex uint32
193 LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
194 LINK_DUPLEX_API_HALF LinkDuplex = 1
195 LINK_DUPLEX_API_FULL LinkDuplex = 2
199 LinkDuplex_name = map[uint32]string{
200 0: "LINK_DUPLEX_API_UNKNOWN",
201 1: "LINK_DUPLEX_API_HALF",
202 2: "LINK_DUPLEX_API_FULL",
204 LinkDuplex_value = map[string]uint32{
205 "LINK_DUPLEX_API_UNKNOWN": 0,
206 "LINK_DUPLEX_API_HALF": 1,
207 "LINK_DUPLEX_API_FULL": 2,
211 func (x LinkDuplex) String() string {
212 s, ok := LinkDuplex_name[uint32(x)]
216 return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
219 // MtuProto defines enum 'mtu_proto'.
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
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",
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,
247 func (x MtuProto) String() string {
248 s, ok := MtuProto_name[uint32(x)]
252 return "MtuProto(" + strconv.Itoa(int(x)) + ")"
255 // RxMode defines enum 'rx_mode'.
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
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",
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,
283 func (x RxMode) String() string {
284 s, ok := RxMode_name[uint32(x)]
288 return "RxMode(" + strconv.Itoa(int(x)) + ")"
291 // SubIfFlags defines enum 'sub_if_flags'.
292 type SubIfFlags uint32
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
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",
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,
334 func (x SubIfFlags) String() string {
335 s, ok := SubIfFlags_name[uint32(x)]
339 str := func(n uint32) string {
340 s, ok := SubIfFlags_name[uint32(n)]
344 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
346 for i := uint32(0); i <= 32; i++ {
356 return str(uint32(x))
361 // InterfaceIndex defines alias 'interface_index'.
362 type InterfaceIndex uint32
364 // MacAddress defines alias 'mac_address'.
365 type MacAddress [6]uint8
367 func ParseMacAddress(s string) (MacAddress, error) {
368 var macaddr MacAddress
369 mac, err := net.ParseMAC(s)
373 copy(macaddr[:], mac[:])
376 func (x MacAddress) ToMAC() net.HardwareAddr {
377 return net.HardwareAddr(x[:])
379 func (x MacAddress) String() string {
380 return x.ToMAC().String()
382 func (x *MacAddress) MarshalText() ([]byte, error) {
383 return []byte(x.String()), nil
385 func (x *MacAddress) UnmarshalText(text []byte) error {
386 mac, err := ParseMacAddress(string(text))
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"`
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
411 func (m *BondCreate) Size() (size int) {
416 size += 1 // m.UseCustomMac
417 size += 1 * 6 // m.MacAddress
420 size += 1 // m.NumaOnly
423 func (m *BondCreate) Marshal(b []byte) ([]byte, error) {
425 b = make([]byte, m.Size())
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
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()
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"`
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
460 func (m *BondCreateReply) Size() (size int) {
464 size += 4 // m.Retval
465 size += 4 // m.SwIfIndex
468 func (m *BondCreateReply) Marshal(b []byte) ([]byte, error) {
470 b = make([]byte, m.Size())
472 buf := codec.NewBuffer(b)
473 buf.EncodeInt32(m.Retval)
474 buf.EncodeUint32(uint32(m.SwIfIndex))
475 return buf.Bytes(), nil
477 func (m *BondCreateReply) Unmarshal(b []byte) error {
478 buf := codec.NewBuffer(b)
479 m.Retval = buf.DecodeInt32()
480 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
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"`
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
496 func (m *BondDelete) Size() (size int) {
500 size += 4 // m.SwIfIndex
503 func (m *BondDelete) Marshal(b []byte) ([]byte, error) {
505 b = make([]byte, m.Size())
507 buf := codec.NewBuffer(b)
508 buf.EncodeUint32(uint32(m.SwIfIndex))
509 return buf.Bytes(), nil
511 func (m *BondDelete) Unmarshal(b []byte) error {
512 buf := codec.NewBuffer(b)
513 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
517 // BondDeleteReply defines message 'bond_delete_reply'.
518 type BondDeleteReply struct {
519 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
529 func (m *BondDeleteReply) Size() (size int) {
533 size += 4 // m.Retval
536 func (m *BondDeleteReply) Marshal(b []byte) ([]byte, error) {
538 b = make([]byte, m.Size())
540 buf := codec.NewBuffer(b)
541 buf.EncodeInt32(m.Retval)
542 return buf.Bytes(), nil
544 func (m *BondDeleteReply) Unmarshal(b []byte) error {
545 buf := codec.NewBuffer(b)
546 m.Retval = buf.DecodeInt32()
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"`
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
562 func (m *BondDetachSlave) Size() (size int) {
566 size += 4 // m.SwIfIndex
569 func (m *BondDetachSlave) Marshal(b []byte) ([]byte, error) {
571 b = make([]byte, m.Size())
573 buf := codec.NewBuffer(b)
574 buf.EncodeUint32(uint32(m.SwIfIndex))
575 return buf.Bytes(), nil
577 func (m *BondDetachSlave) Unmarshal(b []byte) error {
578 buf := codec.NewBuffer(b)
579 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
583 // BondDetachSlaveReply defines message 'bond_detach_slave_reply'.
584 type BondDetachSlaveReply struct {
585 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
595 func (m *BondDetachSlaveReply) Size() (size int) {
599 size += 4 // m.Retval
602 func (m *BondDetachSlaveReply) Marshal(b []byte) ([]byte, error) {
604 b = make([]byte, m.Size())
606 buf := codec.NewBuffer(b)
607 buf.EncodeInt32(m.Retval)
608 return buf.Bytes(), nil
610 func (m *BondDetachSlaveReply) Unmarshal(b []byte) error {
611 buf := codec.NewBuffer(b)
612 m.Retval = buf.DecodeInt32()
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"`
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
631 func (m *BondEnslave) Size() (size int) {
635 size += 4 // m.SwIfIndex
636 size += 4 // m.BondSwIfIndex
637 size += 1 // m.IsPassive
638 size += 1 // m.IsLongTimeout
641 func (m *BondEnslave) Marshal(b []byte) ([]byte, error) {
643 b = make([]byte, m.Size())
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
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()
661 // BondEnslaveReply defines message 'bond_enslave_reply'.
662 type BondEnslaveReply struct {
663 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
673 func (m *BondEnslaveReply) Size() (size int) {
677 size += 4 // m.Retval
680 func (m *BondEnslaveReply) Marshal(b []byte) ([]byte, error) {
682 b = make([]byte, m.Size())
684 buf := codec.NewBuffer(b)
685 buf.EncodeInt32(m.Retval)
686 return buf.Bytes(), nil
688 func (m *BondEnslaveReply) Unmarshal(b []byte) error {
689 buf := codec.NewBuffer(b)
690 m.Retval = buf.DecodeInt32()
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"`
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
713 func (m *SwInterfaceBondDetails) Size() (size int) {
717 size += 4 // m.SwIfIndex
721 size += 1 // m.NumaOnly
722 size += 4 // m.ActiveSlaves
723 size += 4 // m.Slaves
724 size += 64 // m.InterfaceName
727 func (m *SwInterfaceBondDetails) Marshal(b []byte) ([]byte, error) {
729 b = make([]byte, m.Size())
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
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)
755 // SwInterfaceBondDump defines message 'sw_interface_bond_dump'.
756 type SwInterfaceBondDump struct{}
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
765 func (m *SwInterfaceBondDump) Size() (size int) {
771 func (m *SwInterfaceBondDump) Marshal(b []byte) ([]byte, error) {
773 b = make([]byte, m.Size())
775 buf := codec.NewBuffer(b)
776 return buf.Bytes(), nil
778 func (m *SwInterfaceBondDump) Unmarshal(b []byte) error {
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"`
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
795 func (m *SwInterfaceSetBondWeight) Size() (size int) {
799 size += 4 // m.SwIfIndex
800 size += 4 // m.Weight
803 func (m *SwInterfaceSetBondWeight) Marshal(b []byte) ([]byte, error) {
805 b = make([]byte, m.Size())
807 buf := codec.NewBuffer(b)
808 buf.EncodeUint32(uint32(m.SwIfIndex))
809 buf.EncodeUint32(m.Weight)
810 return buf.Bytes(), nil
812 func (m *SwInterfaceSetBondWeight) Unmarshal(b []byte) error {
813 buf := codec.NewBuffer(b)
814 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
815 m.Weight = buf.DecodeUint32()
819 // SwInterfaceSetBondWeightReply defines message 'sw_interface_set_bond_weight_reply'.
820 type SwInterfaceSetBondWeightReply struct {
821 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
824 func (m *SwInterfaceSetBondWeightReply) Reset() { *m = SwInterfaceSetBondWeightReply{} }
825 func (*SwInterfaceSetBondWeightReply) GetMessageName() string {
826 return "sw_interface_set_bond_weight_reply"
828 func (*SwInterfaceSetBondWeightReply) GetCrcString() string { return "e8d4e804" }
829 func (*SwInterfaceSetBondWeightReply) GetMessageType() api.MessageType {
830 return api.ReplyMessage
833 func (m *SwInterfaceSetBondWeightReply) Size() (size int) {
837 size += 4 // m.Retval
840 func (m *SwInterfaceSetBondWeightReply) Marshal(b []byte) ([]byte, error) {
842 b = make([]byte, m.Size())
844 buf := codec.NewBuffer(b)
845 buf.EncodeInt32(m.Retval)
846 return buf.Bytes(), nil
848 func (m *SwInterfaceSetBondWeightReply) Unmarshal(b []byte) error {
849 buf := codec.NewBuffer(b)
850 m.Retval = buf.DecodeInt32()
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"`
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
871 func (m *SwInterfaceSlaveDetails) Size() (size int) {
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
883 func (m *SwInterfaceSlaveDetails) Marshal(b []byte) ([]byte, error) {
885 b = make([]byte, m.Size())
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
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()
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"`
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
919 func (m *SwInterfaceSlaveDump) Size() (size int) {
923 size += 4 // m.SwIfIndex
926 func (m *SwInterfaceSlaveDump) Marshal(b []byte) ([]byte, error) {
928 b = make([]byte, m.Size())
930 buf := codec.NewBuffer(b)
931 buf.EncodeUint32(uint32(m.SwIfIndex))
932 return buf.Bytes(), nil
934 func (m *SwInterfaceSlaveDump) Unmarshal(b []byte) error {
935 buf := codec.NewBuffer(b)
936 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
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")
958 // Messages returns list of all messages in this module.
959 func AllMessages() []api.Message {
960 return []api.Message{
962 (*BondCreateReply)(nil),
964 (*BondDeleteReply)(nil),
965 (*BondDetachSlave)(nil),
966 (*BondDetachSlaveReply)(nil),
968 (*BondEnslaveReply)(nil),
969 (*SwInterfaceBondDetails)(nil),
970 (*SwInterfaceBondDump)(nil),
971 (*SwInterfaceSetBondWeight)(nil),
972 (*SwInterfaceSetBondWeightReply)(nil),
973 (*SwInterfaceSlaveDetails)(nil),
974 (*SwInterfaceSlaveDump)(nil),