Change module name to go.fd.io/govpp
[govpp.git] / binapi / flow / flow.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.6.0-dev
4 //  VPP:              22.02-release
5 // source: /usr/share/vpp/api/core/flow.api.json
6
7 // Package flow contains generated bindings for API file flow.api.
8 //
9 // Contents:
10 //   8 messages
11 //
12 package flow
13
14 import (
15         api "go.fd.io/govpp/api"
16         _ "go.fd.io/govpp/binapi/ethernet_types"
17         flow_types "go.fd.io/govpp/binapi/flow_types"
18         _ "go.fd.io/govpp/binapi/interface_types"
19         _ "go.fd.io/govpp/binapi/ip_types"
20         codec "go.fd.io/govpp/codec"
21 )
22
23 // This is a compile-time assertion to ensure that this generated file
24 // is compatible with the GoVPP api package it is being compiled against.
25 // A compilation error at this line likely means your copy of the
26 // GoVPP api package needs to be updated.
27 const _ = api.GoVppAPIPackageIsVersion2
28
29 const (
30         APIFile    = "flow"
31         APIVersion = "0.0.2"
32         VersionCrc = 0x140d3585
33 )
34
35 // FlowAdd defines message 'flow_add'.
36 // InProgress: the message form may change in the future versions
37 type FlowAdd struct {
38         Flow flow_types.FlowRule `binapi:"flow_rule,name=flow" json:"flow,omitempty"`
39 }
40
41 func (m *FlowAdd) Reset()               { *m = FlowAdd{} }
42 func (*FlowAdd) GetMessageName() string { return "flow_add" }
43 func (*FlowAdd) GetCrcString() string   { return "f946ed84" }
44 func (*FlowAdd) GetMessageType() api.MessageType {
45         return api.RequestMessage
46 }
47
48 func (m *FlowAdd) Size() (size int) {
49         if m == nil {
50                 return 0
51         }
52         size += 4      // m.Flow.Type
53         size += 4      // m.Flow.Index
54         size += 4      // m.Flow.Actions
55         size += 4      // m.Flow.MarkFlowID
56         size += 4      // m.Flow.RedirectNodeIndex
57         size += 4      // m.Flow.RedirectDeviceInputNextIndex
58         size += 4      // m.Flow.RedirectQueue
59         size += 4      // m.Flow.BufferAdvance
60         size += 1 * 82 // m.Flow.Flow
61         return size
62 }
63 func (m *FlowAdd) Marshal(b []byte) ([]byte, error) {
64         if b == nil {
65                 b = make([]byte, m.Size())
66         }
67         buf := codec.NewBuffer(b)
68         buf.EncodeUint32(uint32(m.Flow.Type))
69         buf.EncodeUint32(m.Flow.Index)
70         buf.EncodeUint32(uint32(m.Flow.Actions))
71         buf.EncodeUint32(m.Flow.MarkFlowID)
72         buf.EncodeUint32(m.Flow.RedirectNodeIndex)
73         buf.EncodeUint32(m.Flow.RedirectDeviceInputNextIndex)
74         buf.EncodeUint32(m.Flow.RedirectQueue)
75         buf.EncodeInt32(m.Flow.BufferAdvance)
76         buf.EncodeBytes(m.Flow.Flow.XXX_UnionData[:], 82)
77         return buf.Bytes(), nil
78 }
79 func (m *FlowAdd) Unmarshal(b []byte) error {
80         buf := codec.NewBuffer(b)
81         m.Flow.Type = flow_types.FlowType(buf.DecodeUint32())
82         m.Flow.Index = buf.DecodeUint32()
83         m.Flow.Actions = flow_types.FlowAction(buf.DecodeUint32())
84         m.Flow.MarkFlowID = buf.DecodeUint32()
85         m.Flow.RedirectNodeIndex = buf.DecodeUint32()
86         m.Flow.RedirectDeviceInputNextIndex = buf.DecodeUint32()
87         m.Flow.RedirectQueue = buf.DecodeUint32()
88         m.Flow.BufferAdvance = buf.DecodeInt32()
89         copy(m.Flow.Flow.XXX_UnionData[:], buf.DecodeBytes(82))
90         return nil
91 }
92
93 // FlowAddReply defines message 'flow_add_reply'.
94 // InProgress: the message form may change in the future versions
95 type FlowAddReply struct {
96         Retval    int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
97         FlowIndex uint32 `binapi:"u32,name=flow_index" json:"flow_index,omitempty"`
98 }
99
100 func (m *FlowAddReply) Reset()               { *m = FlowAddReply{} }
101 func (*FlowAddReply) GetMessageName() string { return "flow_add_reply" }
102 func (*FlowAddReply) GetCrcString() string   { return "8587dc85" }
103 func (*FlowAddReply) GetMessageType() api.MessageType {
104         return api.ReplyMessage
105 }
106
107 func (m *FlowAddReply) Size() (size int) {
108         if m == nil {
109                 return 0
110         }
111         size += 4 // m.Retval
112         size += 4 // m.FlowIndex
113         return size
114 }
115 func (m *FlowAddReply) Marshal(b []byte) ([]byte, error) {
116         if b == nil {
117                 b = make([]byte, m.Size())
118         }
119         buf := codec.NewBuffer(b)
120         buf.EncodeInt32(m.Retval)
121         buf.EncodeUint32(m.FlowIndex)
122         return buf.Bytes(), nil
123 }
124 func (m *FlowAddReply) Unmarshal(b []byte) error {
125         buf := codec.NewBuffer(b)
126         m.Retval = buf.DecodeInt32()
127         m.FlowIndex = buf.DecodeUint32()
128         return nil
129 }
130
131 // FlowDel defines message 'flow_del'.
132 // InProgress: the message form may change in the future versions
133 type FlowDel struct {
134         FlowIndex uint32 `binapi:"u32,name=flow_index" json:"flow_index,omitempty"`
135 }
136
137 func (m *FlowDel) Reset()               { *m = FlowDel{} }
138 func (*FlowDel) GetMessageName() string { return "flow_del" }
139 func (*FlowDel) GetCrcString() string   { return "b6b9b02c" }
140 func (*FlowDel) GetMessageType() api.MessageType {
141         return api.RequestMessage
142 }
143
144 func (m *FlowDel) Size() (size int) {
145         if m == nil {
146                 return 0
147         }
148         size += 4 // m.FlowIndex
149         return size
150 }
151 func (m *FlowDel) Marshal(b []byte) ([]byte, error) {
152         if b == nil {
153                 b = make([]byte, m.Size())
154         }
155         buf := codec.NewBuffer(b)
156         buf.EncodeUint32(m.FlowIndex)
157         return buf.Bytes(), nil
158 }
159 func (m *FlowDel) Unmarshal(b []byte) error {
160         buf := codec.NewBuffer(b)
161         m.FlowIndex = buf.DecodeUint32()
162         return nil
163 }
164
165 // FlowDelReply defines message 'flow_del_reply'.
166 // InProgress: the message form may change in the future versions
167 type FlowDelReply struct {
168         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
169 }
170
171 func (m *FlowDelReply) Reset()               { *m = FlowDelReply{} }
172 func (*FlowDelReply) GetMessageName() string { return "flow_del_reply" }
173 func (*FlowDelReply) GetCrcString() string   { return "e8d4e804" }
174 func (*FlowDelReply) GetMessageType() api.MessageType {
175         return api.ReplyMessage
176 }
177
178 func (m *FlowDelReply) Size() (size int) {
179         if m == nil {
180                 return 0
181         }
182         size += 4 // m.Retval
183         return size
184 }
185 func (m *FlowDelReply) Marshal(b []byte) ([]byte, error) {
186         if b == nil {
187                 b = make([]byte, m.Size())
188         }
189         buf := codec.NewBuffer(b)
190         buf.EncodeInt32(m.Retval)
191         return buf.Bytes(), nil
192 }
193 func (m *FlowDelReply) Unmarshal(b []byte) error {
194         buf := codec.NewBuffer(b)
195         m.Retval = buf.DecodeInt32()
196         return nil
197 }
198
199 // FlowDisable defines message 'flow_disable'.
200 // InProgress: the message form may change in the future versions
201 type FlowDisable struct {
202         FlowIndex uint32 `binapi:"u32,name=flow_index" json:"flow_index,omitempty"`
203         HwIfIndex uint32 `binapi:"u32,name=hw_if_index" json:"hw_if_index,omitempty"`
204 }
205
206 func (m *FlowDisable) Reset()               { *m = FlowDisable{} }
207 func (*FlowDisable) GetMessageName() string { return "flow_disable" }
208 func (*FlowDisable) GetCrcString() string   { return "2024be69" }
209 func (*FlowDisable) GetMessageType() api.MessageType {
210         return api.RequestMessage
211 }
212
213 func (m *FlowDisable) Size() (size int) {
214         if m == nil {
215                 return 0
216         }
217         size += 4 // m.FlowIndex
218         size += 4 // m.HwIfIndex
219         return size
220 }
221 func (m *FlowDisable) Marshal(b []byte) ([]byte, error) {
222         if b == nil {
223                 b = make([]byte, m.Size())
224         }
225         buf := codec.NewBuffer(b)
226         buf.EncodeUint32(m.FlowIndex)
227         buf.EncodeUint32(m.HwIfIndex)
228         return buf.Bytes(), nil
229 }
230 func (m *FlowDisable) Unmarshal(b []byte) error {
231         buf := codec.NewBuffer(b)
232         m.FlowIndex = buf.DecodeUint32()
233         m.HwIfIndex = buf.DecodeUint32()
234         return nil
235 }
236
237 // FlowDisableReply defines message 'flow_disable_reply'.
238 // InProgress: the message form may change in the future versions
239 type FlowDisableReply struct {
240         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
241 }
242
243 func (m *FlowDisableReply) Reset()               { *m = FlowDisableReply{} }
244 func (*FlowDisableReply) GetMessageName() string { return "flow_disable_reply" }
245 func (*FlowDisableReply) GetCrcString() string   { return "e8d4e804" }
246 func (*FlowDisableReply) GetMessageType() api.MessageType {
247         return api.ReplyMessage
248 }
249
250 func (m *FlowDisableReply) Size() (size int) {
251         if m == nil {
252                 return 0
253         }
254         size += 4 // m.Retval
255         return size
256 }
257 func (m *FlowDisableReply) Marshal(b []byte) ([]byte, error) {
258         if b == nil {
259                 b = make([]byte, m.Size())
260         }
261         buf := codec.NewBuffer(b)
262         buf.EncodeInt32(m.Retval)
263         return buf.Bytes(), nil
264 }
265 func (m *FlowDisableReply) Unmarshal(b []byte) error {
266         buf := codec.NewBuffer(b)
267         m.Retval = buf.DecodeInt32()
268         return nil
269 }
270
271 // FlowEnable defines message 'flow_enable'.
272 // InProgress: the message form may change in the future versions
273 type FlowEnable struct {
274         FlowIndex uint32 `binapi:"u32,name=flow_index" json:"flow_index,omitempty"`
275         HwIfIndex uint32 `binapi:"u32,name=hw_if_index" json:"hw_if_index,omitempty"`
276 }
277
278 func (m *FlowEnable) Reset()               { *m = FlowEnable{} }
279 func (*FlowEnable) GetMessageName() string { return "flow_enable" }
280 func (*FlowEnable) GetCrcString() string   { return "2024be69" }
281 func (*FlowEnable) GetMessageType() api.MessageType {
282         return api.RequestMessage
283 }
284
285 func (m *FlowEnable) Size() (size int) {
286         if m == nil {
287                 return 0
288         }
289         size += 4 // m.FlowIndex
290         size += 4 // m.HwIfIndex
291         return size
292 }
293 func (m *FlowEnable) Marshal(b []byte) ([]byte, error) {
294         if b == nil {
295                 b = make([]byte, m.Size())
296         }
297         buf := codec.NewBuffer(b)
298         buf.EncodeUint32(m.FlowIndex)
299         buf.EncodeUint32(m.HwIfIndex)
300         return buf.Bytes(), nil
301 }
302 func (m *FlowEnable) Unmarshal(b []byte) error {
303         buf := codec.NewBuffer(b)
304         m.FlowIndex = buf.DecodeUint32()
305         m.HwIfIndex = buf.DecodeUint32()
306         return nil
307 }
308
309 // FlowEnableReply defines message 'flow_enable_reply'.
310 // InProgress: the message form may change in the future versions
311 type FlowEnableReply struct {
312         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
313 }
314
315 func (m *FlowEnableReply) Reset()               { *m = FlowEnableReply{} }
316 func (*FlowEnableReply) GetMessageName() string { return "flow_enable_reply" }
317 func (*FlowEnableReply) GetCrcString() string   { return "e8d4e804" }
318 func (*FlowEnableReply) GetMessageType() api.MessageType {
319         return api.ReplyMessage
320 }
321
322 func (m *FlowEnableReply) Size() (size int) {
323         if m == nil {
324                 return 0
325         }
326         size += 4 // m.Retval
327         return size
328 }
329 func (m *FlowEnableReply) Marshal(b []byte) ([]byte, error) {
330         if b == nil {
331                 b = make([]byte, m.Size())
332         }
333         buf := codec.NewBuffer(b)
334         buf.EncodeInt32(m.Retval)
335         return buf.Bytes(), nil
336 }
337 func (m *FlowEnableReply) Unmarshal(b []byte) error {
338         buf := codec.NewBuffer(b)
339         m.Retval = buf.DecodeInt32()
340         return nil
341 }
342
343 func init() { file_flow_binapi_init() }
344 func file_flow_binapi_init() {
345         api.RegisterMessage((*FlowAdd)(nil), "flow_add_f946ed84")
346         api.RegisterMessage((*FlowAddReply)(nil), "flow_add_reply_8587dc85")
347         api.RegisterMessage((*FlowDel)(nil), "flow_del_b6b9b02c")
348         api.RegisterMessage((*FlowDelReply)(nil), "flow_del_reply_e8d4e804")
349         api.RegisterMessage((*FlowDisable)(nil), "flow_disable_2024be69")
350         api.RegisterMessage((*FlowDisableReply)(nil), "flow_disable_reply_e8d4e804")
351         api.RegisterMessage((*FlowEnable)(nil), "flow_enable_2024be69")
352         api.RegisterMessage((*FlowEnableReply)(nil), "flow_enable_reply_e8d4e804")
353 }
354
355 // Messages returns list of all messages in this module.
356 func AllMessages() []api.Message {
357         return []api.Message{
358                 (*FlowAdd)(nil),
359                 (*FlowAddReply)(nil),
360                 (*FlowDel)(nil),
361                 (*FlowDelReply)(nil),
362                 (*FlowDisable)(nil),
363                 (*FlowDisableReply)(nil),
364                 (*FlowEnable)(nil),
365                 (*FlowEnableReply)(nil),
366         }
367 }