Improve binapi generator
[govpp.git] / binapi / lacp / lacp.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.4.0-dev
4 //  VPP:              20.05-release
5 // source: /usr/share/vpp/api/plugins/lacp.api.json
6
7 // Package lacp contains generated bindings for API file lacp.api.
8 //
9 // Contents:
10 //   2 messages
11 //
12 package lacp
13
14 import (
15         api "git.fd.io/govpp.git/api"
16         ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types"
17         interface_types "git.fd.io/govpp.git/binapi/interface_types"
18         codec "git.fd.io/govpp.git/codec"
19 )
20
21 // This is a compile-time assertion to ensure that this generated file
22 // is compatible with the GoVPP api package it is being compiled against.
23 // A compilation error at this line likely means your copy of the
24 // GoVPP api package needs to be updated.
25 const _ = api.GoVppAPIPackageIsVersion2
26
27 const (
28         APIFile    = "lacp"
29         APIVersion = "2.0.0"
30         VersionCrc = 0x461bf09e
31 )
32
33 // SwInterfaceLacpDetails defines message 'sw_interface_lacp_details'.
34 type SwInterfaceLacpDetails struct {
35         SwIfIndex             interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
36         InterfaceName         string                         `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"`
37         RxState               uint32                         `binapi:"u32,name=rx_state" json:"rx_state,omitempty"`
38         TxState               uint32                         `binapi:"u32,name=tx_state" json:"tx_state,omitempty"`
39         MuxState              uint32                         `binapi:"u32,name=mux_state" json:"mux_state,omitempty"`
40         PtxState              uint32                         `binapi:"u32,name=ptx_state" json:"ptx_state,omitempty"`
41         BondInterfaceName     string                         `binapi:"string[64],name=bond_interface_name" json:"bond_interface_name,omitempty"`
42         ActorSystemPriority   uint16                         `binapi:"u16,name=actor_system_priority" json:"actor_system_priority,omitempty"`
43         ActorSystem           ethernet_types.MacAddress      `binapi:"mac_address,name=actor_system" json:"actor_system,omitempty"`
44         ActorKey              uint16                         `binapi:"u16,name=actor_key" json:"actor_key,omitempty"`
45         ActorPortPriority     uint16                         `binapi:"u16,name=actor_port_priority" json:"actor_port_priority,omitempty"`
46         ActorPortNumber       uint16                         `binapi:"u16,name=actor_port_number" json:"actor_port_number,omitempty"`
47         ActorState            uint8                          `binapi:"u8,name=actor_state" json:"actor_state,omitempty"`
48         PartnerSystemPriority uint16                         `binapi:"u16,name=partner_system_priority" json:"partner_system_priority,omitempty"`
49         PartnerSystem         ethernet_types.MacAddress      `binapi:"mac_address,name=partner_system" json:"partner_system,omitempty"`
50         PartnerKey            uint16                         `binapi:"u16,name=partner_key" json:"partner_key,omitempty"`
51         PartnerPortPriority   uint16                         `binapi:"u16,name=partner_port_priority" json:"partner_port_priority,omitempty"`
52         PartnerPortNumber     uint16                         `binapi:"u16,name=partner_port_number" json:"partner_port_number,omitempty"`
53         PartnerState          uint8                          `binapi:"u8,name=partner_state" json:"partner_state,omitempty"`
54 }
55
56 func (m *SwInterfaceLacpDetails) Reset()               { *m = SwInterfaceLacpDetails{} }
57 func (*SwInterfaceLacpDetails) GetMessageName() string { return "sw_interface_lacp_details" }
58 func (*SwInterfaceLacpDetails) GetCrcString() string   { return "745ae0ba" }
59 func (*SwInterfaceLacpDetails) GetMessageType() api.MessageType {
60         return api.ReplyMessage
61 }
62
63 func (m *SwInterfaceLacpDetails) Size() int {
64         if m == nil {
65                 return 0
66         }
67         var size int
68         size += 4     // m.SwIfIndex
69         size += 64    // m.InterfaceName
70         size += 4     // m.RxState
71         size += 4     // m.TxState
72         size += 4     // m.MuxState
73         size += 4     // m.PtxState
74         size += 64    // m.BondInterfaceName
75         size += 2     // m.ActorSystemPriority
76         size += 1 * 6 // m.ActorSystem
77         size += 2     // m.ActorKey
78         size += 2     // m.ActorPortPriority
79         size += 2     // m.ActorPortNumber
80         size += 1     // m.ActorState
81         size += 2     // m.PartnerSystemPriority
82         size += 1 * 6 // m.PartnerSystem
83         size += 2     // m.PartnerKey
84         size += 2     // m.PartnerPortPriority
85         size += 2     // m.PartnerPortNumber
86         size += 1     // m.PartnerState
87         return size
88 }
89 func (m *SwInterfaceLacpDetails) Marshal(b []byte) ([]byte, error) {
90         var buf *codec.Buffer
91         if b == nil {
92                 buf = codec.NewBuffer(make([]byte, m.Size()))
93         } else {
94                 buf = codec.NewBuffer(b)
95         }
96         buf.EncodeUint32(uint32(m.SwIfIndex))
97         buf.EncodeString(m.InterfaceName, 64)
98         buf.EncodeUint32(uint32(m.RxState))
99         buf.EncodeUint32(uint32(m.TxState))
100         buf.EncodeUint32(uint32(m.MuxState))
101         buf.EncodeUint32(uint32(m.PtxState))
102         buf.EncodeString(m.BondInterfaceName, 64)
103         buf.EncodeUint16(uint16(m.ActorSystemPriority))
104         buf.EncodeBytes(m.ActorSystem[:], 6)
105         buf.EncodeUint16(uint16(m.ActorKey))
106         buf.EncodeUint16(uint16(m.ActorPortPriority))
107         buf.EncodeUint16(uint16(m.ActorPortNumber))
108         buf.EncodeUint8(uint8(m.ActorState))
109         buf.EncodeUint16(uint16(m.PartnerSystemPriority))
110         buf.EncodeBytes(m.PartnerSystem[:], 6)
111         buf.EncodeUint16(uint16(m.PartnerKey))
112         buf.EncodeUint16(uint16(m.PartnerPortPriority))
113         buf.EncodeUint16(uint16(m.PartnerPortNumber))
114         buf.EncodeUint8(uint8(m.PartnerState))
115         return buf.Bytes(), nil
116 }
117 func (m *SwInterfaceLacpDetails) Unmarshal(b []byte) error {
118         buf := codec.NewBuffer(b)
119         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
120         m.InterfaceName = buf.DecodeString(64)
121         m.RxState = buf.DecodeUint32()
122         m.TxState = buf.DecodeUint32()
123         m.MuxState = buf.DecodeUint32()
124         m.PtxState = buf.DecodeUint32()
125         m.BondInterfaceName = buf.DecodeString(64)
126         m.ActorSystemPriority = buf.DecodeUint16()
127         copy(m.ActorSystem[:], buf.DecodeBytes(6))
128         m.ActorKey = buf.DecodeUint16()
129         m.ActorPortPriority = buf.DecodeUint16()
130         m.ActorPortNumber = buf.DecodeUint16()
131         m.ActorState = buf.DecodeUint8()
132         m.PartnerSystemPriority = buf.DecodeUint16()
133         copy(m.PartnerSystem[:], buf.DecodeBytes(6))
134         m.PartnerKey = buf.DecodeUint16()
135         m.PartnerPortPriority = buf.DecodeUint16()
136         m.PartnerPortNumber = buf.DecodeUint16()
137         m.PartnerState = buf.DecodeUint8()
138         return nil
139 }
140
141 // SwInterfaceLacpDump defines message 'sw_interface_lacp_dump'.
142 type SwInterfaceLacpDump struct{}
143
144 func (m *SwInterfaceLacpDump) Reset()               { *m = SwInterfaceLacpDump{} }
145 func (*SwInterfaceLacpDump) GetMessageName() string { return "sw_interface_lacp_dump" }
146 func (*SwInterfaceLacpDump) GetCrcString() string   { return "51077d14" }
147 func (*SwInterfaceLacpDump) GetMessageType() api.MessageType {
148         return api.RequestMessage
149 }
150
151 func (m *SwInterfaceLacpDump) Size() int {
152         if m == nil {
153                 return 0
154         }
155         var size int
156         return size
157 }
158 func (m *SwInterfaceLacpDump) Marshal(b []byte) ([]byte, error) {
159         var buf *codec.Buffer
160         if b == nil {
161                 buf = codec.NewBuffer(make([]byte, m.Size()))
162         } else {
163                 buf = codec.NewBuffer(b)
164         }
165         return buf.Bytes(), nil
166 }
167 func (m *SwInterfaceLacpDump) Unmarshal(b []byte) error {
168         return nil
169 }
170
171 func init() { file_lacp_binapi_init() }
172 func file_lacp_binapi_init() {
173         api.RegisterMessage((*SwInterfaceLacpDetails)(nil), "sw_interface_lacp_details_745ae0ba")
174         api.RegisterMessage((*SwInterfaceLacpDump)(nil), "sw_interface_lacp_dump_51077d14")
175 }
176
177 // Messages returns list of all messages in this module.
178 func AllMessages() []api.Message {
179         return []api.Message{
180                 (*SwInterfaceLacpDetails)(nil),
181                 (*SwInterfaceLacpDump)(nil),
182         }
183 }