f384bac844d8a5fd24d63df4ac691e46deb8fba6
[govpp.git] / binapi / vhost_user / vhost_user.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
6 // Package vhost_user contains generated bindings for API file vhost_user.api.
7 //
8 // Contents:
9 //   8 messages
10 //
11 package vhost_user
12
13 import (
14         api "git.fd.io/govpp.git/api"
15         ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types"
16         interface_types "git.fd.io/govpp.git/binapi/interface_types"
17         virtio_types "git.fd.io/govpp.git/binapi/virtio_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    = "vhost_user"
29         APIVersion = "4.0.1"
30         VersionCrc = 0x3df14dfe
31 )
32
33 // CreateVhostUserIf defines message 'create_vhost_user_if'.
34 type CreateVhostUserIf struct {
35         IsServer            bool                      `binapi:"bool,name=is_server" json:"is_server,omitempty"`
36         SockFilename        string                    `binapi:"string[256],name=sock_filename" json:"sock_filename,omitempty"`
37         Renumber            bool                      `binapi:"bool,name=renumber" json:"renumber,omitempty"`
38         DisableMrgRxbuf     bool                      `binapi:"bool,name=disable_mrg_rxbuf" json:"disable_mrg_rxbuf,omitempty"`
39         DisableIndirectDesc bool                      `binapi:"bool,name=disable_indirect_desc" json:"disable_indirect_desc,omitempty"`
40         EnableGso           bool                      `binapi:"bool,name=enable_gso" json:"enable_gso,omitempty"`
41         EnablePacked        bool                      `binapi:"bool,name=enable_packed" json:"enable_packed,omitempty"`
42         CustomDevInstance   uint32                    `binapi:"u32,name=custom_dev_instance" json:"custom_dev_instance,omitempty"`
43         UseCustomMac        bool                      `binapi:"bool,name=use_custom_mac" json:"use_custom_mac,omitempty"`
44         MacAddress          ethernet_types.MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
45         Tag                 string                    `binapi:"string[64],name=tag" json:"tag,omitempty"`
46 }
47
48 func (m *CreateVhostUserIf) Reset()               { *m = CreateVhostUserIf{} }
49 func (*CreateVhostUserIf) GetMessageName() string { return "create_vhost_user_if" }
50 func (*CreateVhostUserIf) GetCrcString() string   { return "c785c6fc" }
51 func (*CreateVhostUserIf) GetMessageType() api.MessageType {
52         return api.RequestMessage
53 }
54
55 func (m *CreateVhostUserIf) Size() (size int) {
56         if m == nil {
57                 return 0
58         }
59         size += 1     // m.IsServer
60         size += 256   // m.SockFilename
61         size += 1     // m.Renumber
62         size += 1     // m.DisableMrgRxbuf
63         size += 1     // m.DisableIndirectDesc
64         size += 1     // m.EnableGso
65         size += 1     // m.EnablePacked
66         size += 4     // m.CustomDevInstance
67         size += 1     // m.UseCustomMac
68         size += 1 * 6 // m.MacAddress
69         size += 64    // m.Tag
70         return size
71 }
72 func (m *CreateVhostUserIf) Marshal(b []byte) ([]byte, error) {
73         if b == nil {
74                 b = make([]byte, m.Size())
75         }
76         buf := codec.NewBuffer(b)
77         buf.EncodeBool(m.IsServer)
78         buf.EncodeString(m.SockFilename, 256)
79         buf.EncodeBool(m.Renumber)
80         buf.EncodeBool(m.DisableMrgRxbuf)
81         buf.EncodeBool(m.DisableIndirectDesc)
82         buf.EncodeBool(m.EnableGso)
83         buf.EncodeBool(m.EnablePacked)
84         buf.EncodeUint32(m.CustomDevInstance)
85         buf.EncodeBool(m.UseCustomMac)
86         buf.EncodeBytes(m.MacAddress[:], 6)
87         buf.EncodeString(m.Tag, 64)
88         return buf.Bytes(), nil
89 }
90 func (m *CreateVhostUserIf) Unmarshal(b []byte) error {
91         buf := codec.NewBuffer(b)
92         m.IsServer = buf.DecodeBool()
93         m.SockFilename = buf.DecodeString(256)
94         m.Renumber = buf.DecodeBool()
95         m.DisableMrgRxbuf = buf.DecodeBool()
96         m.DisableIndirectDesc = buf.DecodeBool()
97         m.EnableGso = buf.DecodeBool()
98         m.EnablePacked = buf.DecodeBool()
99         m.CustomDevInstance = buf.DecodeUint32()
100         m.UseCustomMac = buf.DecodeBool()
101         copy(m.MacAddress[:], buf.DecodeBytes(6))
102         m.Tag = buf.DecodeString(64)
103         return nil
104 }
105
106 // CreateVhostUserIfReply defines message 'create_vhost_user_if_reply'.
107 type CreateVhostUserIfReply struct {
108         Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
109         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
110 }
111
112 func (m *CreateVhostUserIfReply) Reset()               { *m = CreateVhostUserIfReply{} }
113 func (*CreateVhostUserIfReply) GetMessageName() string { return "create_vhost_user_if_reply" }
114 func (*CreateVhostUserIfReply) GetCrcString() string   { return "5383d31f" }
115 func (*CreateVhostUserIfReply) GetMessageType() api.MessageType {
116         return api.ReplyMessage
117 }
118
119 func (m *CreateVhostUserIfReply) Size() (size int) {
120         if m == nil {
121                 return 0
122         }
123         size += 4 // m.Retval
124         size += 4 // m.SwIfIndex
125         return size
126 }
127 func (m *CreateVhostUserIfReply) Marshal(b []byte) ([]byte, error) {
128         if b == nil {
129                 b = make([]byte, m.Size())
130         }
131         buf := codec.NewBuffer(b)
132         buf.EncodeInt32(m.Retval)
133         buf.EncodeUint32(uint32(m.SwIfIndex))
134         return buf.Bytes(), nil
135 }
136 func (m *CreateVhostUserIfReply) Unmarshal(b []byte) error {
137         buf := codec.NewBuffer(b)
138         m.Retval = buf.DecodeInt32()
139         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
140         return nil
141 }
142
143 // DeleteVhostUserIf defines message 'delete_vhost_user_if'.
144 type DeleteVhostUserIf struct {
145         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
146 }
147
148 func (m *DeleteVhostUserIf) Reset()               { *m = DeleteVhostUserIf{} }
149 func (*DeleteVhostUserIf) GetMessageName() string { return "delete_vhost_user_if" }
150 func (*DeleteVhostUserIf) GetCrcString() string   { return "f9e6675e" }
151 func (*DeleteVhostUserIf) GetMessageType() api.MessageType {
152         return api.RequestMessage
153 }
154
155 func (m *DeleteVhostUserIf) Size() (size int) {
156         if m == nil {
157                 return 0
158         }
159         size += 4 // m.SwIfIndex
160         return size
161 }
162 func (m *DeleteVhostUserIf) Marshal(b []byte) ([]byte, error) {
163         if b == nil {
164                 b = make([]byte, m.Size())
165         }
166         buf := codec.NewBuffer(b)
167         buf.EncodeUint32(uint32(m.SwIfIndex))
168         return buf.Bytes(), nil
169 }
170 func (m *DeleteVhostUserIf) Unmarshal(b []byte) error {
171         buf := codec.NewBuffer(b)
172         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
173         return nil
174 }
175
176 // DeleteVhostUserIfReply defines message 'delete_vhost_user_if_reply'.
177 type DeleteVhostUserIfReply struct {
178         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
179 }
180
181 func (m *DeleteVhostUserIfReply) Reset()               { *m = DeleteVhostUserIfReply{} }
182 func (*DeleteVhostUserIfReply) GetMessageName() string { return "delete_vhost_user_if_reply" }
183 func (*DeleteVhostUserIfReply) GetCrcString() string   { return "e8d4e804" }
184 func (*DeleteVhostUserIfReply) GetMessageType() api.MessageType {
185         return api.ReplyMessage
186 }
187
188 func (m *DeleteVhostUserIfReply) Size() (size int) {
189         if m == nil {
190                 return 0
191         }
192         size += 4 // m.Retval
193         return size
194 }
195 func (m *DeleteVhostUserIfReply) Marshal(b []byte) ([]byte, error) {
196         if b == nil {
197                 b = make([]byte, m.Size())
198         }
199         buf := codec.NewBuffer(b)
200         buf.EncodeInt32(m.Retval)
201         return buf.Bytes(), nil
202 }
203 func (m *DeleteVhostUserIfReply) Unmarshal(b []byte) error {
204         buf := codec.NewBuffer(b)
205         m.Retval = buf.DecodeInt32()
206         return nil
207 }
208
209 // ModifyVhostUserIf defines message 'modify_vhost_user_if'.
210 type ModifyVhostUserIf struct {
211         SwIfIndex         interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
212         IsServer          bool                           `binapi:"bool,name=is_server" json:"is_server,omitempty"`
213         SockFilename      string                         `binapi:"string[256],name=sock_filename" json:"sock_filename,omitempty"`
214         Renumber          bool                           `binapi:"bool,name=renumber" json:"renumber,omitempty"`
215         EnableGso         bool                           `binapi:"bool,name=enable_gso" json:"enable_gso,omitempty"`
216         EnablePacked      bool                           `binapi:"bool,name=enable_packed" json:"enable_packed,omitempty"`
217         CustomDevInstance uint32                         `binapi:"u32,name=custom_dev_instance" json:"custom_dev_instance,omitempty"`
218 }
219
220 func (m *ModifyVhostUserIf) Reset()               { *m = ModifyVhostUserIf{} }
221 func (*ModifyVhostUserIf) GetMessageName() string { return "modify_vhost_user_if" }
222 func (*ModifyVhostUserIf) GetCrcString() string   { return "0e71d40b" }
223 func (*ModifyVhostUserIf) GetMessageType() api.MessageType {
224         return api.RequestMessage
225 }
226
227 func (m *ModifyVhostUserIf) Size() (size int) {
228         if m == nil {
229                 return 0
230         }
231         size += 4   // m.SwIfIndex
232         size += 1   // m.IsServer
233         size += 256 // m.SockFilename
234         size += 1   // m.Renumber
235         size += 1   // m.EnableGso
236         size += 1   // m.EnablePacked
237         size += 4   // m.CustomDevInstance
238         return size
239 }
240 func (m *ModifyVhostUserIf) Marshal(b []byte) ([]byte, error) {
241         if b == nil {
242                 b = make([]byte, m.Size())
243         }
244         buf := codec.NewBuffer(b)
245         buf.EncodeUint32(uint32(m.SwIfIndex))
246         buf.EncodeBool(m.IsServer)
247         buf.EncodeString(m.SockFilename, 256)
248         buf.EncodeBool(m.Renumber)
249         buf.EncodeBool(m.EnableGso)
250         buf.EncodeBool(m.EnablePacked)
251         buf.EncodeUint32(m.CustomDevInstance)
252         return buf.Bytes(), nil
253 }
254 func (m *ModifyVhostUserIf) Unmarshal(b []byte) error {
255         buf := codec.NewBuffer(b)
256         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
257         m.IsServer = buf.DecodeBool()
258         m.SockFilename = buf.DecodeString(256)
259         m.Renumber = buf.DecodeBool()
260         m.EnableGso = buf.DecodeBool()
261         m.EnablePacked = buf.DecodeBool()
262         m.CustomDevInstance = buf.DecodeUint32()
263         return nil
264 }
265
266 // ModifyVhostUserIfReply defines message 'modify_vhost_user_if_reply'.
267 type ModifyVhostUserIfReply struct {
268         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
269 }
270
271 func (m *ModifyVhostUserIfReply) Reset()               { *m = ModifyVhostUserIfReply{} }
272 func (*ModifyVhostUserIfReply) GetMessageName() string { return "modify_vhost_user_if_reply" }
273 func (*ModifyVhostUserIfReply) GetCrcString() string   { return "e8d4e804" }
274 func (*ModifyVhostUserIfReply) GetMessageType() api.MessageType {
275         return api.ReplyMessage
276 }
277
278 func (m *ModifyVhostUserIfReply) Size() (size int) {
279         if m == nil {
280                 return 0
281         }
282         size += 4 // m.Retval
283         return size
284 }
285 func (m *ModifyVhostUserIfReply) Marshal(b []byte) ([]byte, error) {
286         if b == nil {
287                 b = make([]byte, m.Size())
288         }
289         buf := codec.NewBuffer(b)
290         buf.EncodeInt32(m.Retval)
291         return buf.Bytes(), nil
292 }
293 func (m *ModifyVhostUserIfReply) Unmarshal(b []byte) error {
294         buf := codec.NewBuffer(b)
295         m.Retval = buf.DecodeInt32()
296         return nil
297 }
298
299 // SwInterfaceVhostUserDetails defines message 'sw_interface_vhost_user_details'.
300 type SwInterfaceVhostUserDetails struct {
301         SwIfIndex       interface_types.InterfaceIndex        `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
302         InterfaceName   string                                `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"`
303         VirtioNetHdrSz  uint32                                `binapi:"u32,name=virtio_net_hdr_sz" json:"virtio_net_hdr_sz,omitempty"`
304         FeaturesFirst32 virtio_types.VirtioNetFeaturesFirst32 `binapi:"virtio_net_features_first_32,name=features_first_32" json:"features_first_32,omitempty"`
305         FeaturesLast32  virtio_types.VirtioNetFeaturesLast32  `binapi:"virtio_net_features_last_32,name=features_last_32" json:"features_last_32,omitempty"`
306         IsServer        bool                                  `binapi:"bool,name=is_server" json:"is_server,omitempty"`
307         SockFilename    string                                `binapi:"string[256],name=sock_filename" json:"sock_filename,omitempty"`
308         NumRegions      uint32                                `binapi:"u32,name=num_regions" json:"num_regions,omitempty"`
309         SockErrno       int32                                 `binapi:"i32,name=sock_errno" json:"sock_errno,omitempty"`
310 }
311
312 func (m *SwInterfaceVhostUserDetails) Reset()               { *m = SwInterfaceVhostUserDetails{} }
313 func (*SwInterfaceVhostUserDetails) GetMessageName() string { return "sw_interface_vhost_user_details" }
314 func (*SwInterfaceVhostUserDetails) GetCrcString() string   { return "98530df1" }
315 func (*SwInterfaceVhostUserDetails) GetMessageType() api.MessageType {
316         return api.ReplyMessage
317 }
318
319 func (m *SwInterfaceVhostUserDetails) Size() (size int) {
320         if m == nil {
321                 return 0
322         }
323         size += 4   // m.SwIfIndex
324         size += 64  // m.InterfaceName
325         size += 4   // m.VirtioNetHdrSz
326         size += 4   // m.FeaturesFirst32
327         size += 4   // m.FeaturesLast32
328         size += 1   // m.IsServer
329         size += 256 // m.SockFilename
330         size += 4   // m.NumRegions
331         size += 4   // m.SockErrno
332         return size
333 }
334 func (m *SwInterfaceVhostUserDetails) Marshal(b []byte) ([]byte, error) {
335         if b == nil {
336                 b = make([]byte, m.Size())
337         }
338         buf := codec.NewBuffer(b)
339         buf.EncodeUint32(uint32(m.SwIfIndex))
340         buf.EncodeString(m.InterfaceName, 64)
341         buf.EncodeUint32(m.VirtioNetHdrSz)
342         buf.EncodeUint32(uint32(m.FeaturesFirst32))
343         buf.EncodeUint32(uint32(m.FeaturesLast32))
344         buf.EncodeBool(m.IsServer)
345         buf.EncodeString(m.SockFilename, 256)
346         buf.EncodeUint32(m.NumRegions)
347         buf.EncodeInt32(m.SockErrno)
348         return buf.Bytes(), nil
349 }
350 func (m *SwInterfaceVhostUserDetails) Unmarshal(b []byte) error {
351         buf := codec.NewBuffer(b)
352         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
353         m.InterfaceName = buf.DecodeString(64)
354         m.VirtioNetHdrSz = buf.DecodeUint32()
355         m.FeaturesFirst32 = virtio_types.VirtioNetFeaturesFirst32(buf.DecodeUint32())
356         m.FeaturesLast32 = virtio_types.VirtioNetFeaturesLast32(buf.DecodeUint32())
357         m.IsServer = buf.DecodeBool()
358         m.SockFilename = buf.DecodeString(256)
359         m.NumRegions = buf.DecodeUint32()
360         m.SockErrno = buf.DecodeInt32()
361         return nil
362 }
363
364 // SwInterfaceVhostUserDump defines message 'sw_interface_vhost_user_dump'.
365 type SwInterfaceVhostUserDump struct {
366         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
367 }
368
369 func (m *SwInterfaceVhostUserDump) Reset()               { *m = SwInterfaceVhostUserDump{} }
370 func (*SwInterfaceVhostUserDump) GetMessageName() string { return "sw_interface_vhost_user_dump" }
371 func (*SwInterfaceVhostUserDump) GetCrcString() string   { return "f9e6675e" }
372 func (*SwInterfaceVhostUserDump) GetMessageType() api.MessageType {
373         return api.RequestMessage
374 }
375
376 func (m *SwInterfaceVhostUserDump) Size() (size int) {
377         if m == nil {
378                 return 0
379         }
380         size += 4 // m.SwIfIndex
381         return size
382 }
383 func (m *SwInterfaceVhostUserDump) Marshal(b []byte) ([]byte, error) {
384         if b == nil {
385                 b = make([]byte, m.Size())
386         }
387         buf := codec.NewBuffer(b)
388         buf.EncodeUint32(uint32(m.SwIfIndex))
389         return buf.Bytes(), nil
390 }
391 func (m *SwInterfaceVhostUserDump) Unmarshal(b []byte) error {
392         buf := codec.NewBuffer(b)
393         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
394         return nil
395 }
396
397 func init() { file_vhost_user_binapi_init() }
398 func file_vhost_user_binapi_init() {
399         api.RegisterMessage((*CreateVhostUserIf)(nil), "create_vhost_user_if_c785c6fc")
400         api.RegisterMessage((*CreateVhostUserIfReply)(nil), "create_vhost_user_if_reply_5383d31f")
401         api.RegisterMessage((*DeleteVhostUserIf)(nil), "delete_vhost_user_if_f9e6675e")
402         api.RegisterMessage((*DeleteVhostUserIfReply)(nil), "delete_vhost_user_if_reply_e8d4e804")
403         api.RegisterMessage((*ModifyVhostUserIf)(nil), "modify_vhost_user_if_0e71d40b")
404         api.RegisterMessage((*ModifyVhostUserIfReply)(nil), "modify_vhost_user_if_reply_e8d4e804")
405         api.RegisterMessage((*SwInterfaceVhostUserDetails)(nil), "sw_interface_vhost_user_details_98530df1")
406         api.RegisterMessage((*SwInterfaceVhostUserDump)(nil), "sw_interface_vhost_user_dump_f9e6675e")
407 }
408
409 // Messages returns list of all messages in this module.
410 func AllMessages() []api.Message {
411         return []api.Message{
412                 (*CreateVhostUserIf)(nil),
413                 (*CreateVhostUserIfReply)(nil),
414                 (*DeleteVhostUserIf)(nil),
415                 (*DeleteVhostUserIfReply)(nil),
416                 (*ModifyVhostUserIf)(nil),
417                 (*ModifyVhostUserIfReply)(nil),
418                 (*SwInterfaceVhostUserDetails)(nil),
419                 (*SwInterfaceVhostUserDump)(nil),
420         }
421 }