1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
6 // Package vhost_user contains generated bindings for API file vhost_user.api.
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"
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
28 APIFile = "vhost_user"
30 VersionCrc = 0x3df14dfe
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"`
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
55 func (m *CreateVhostUserIf) Size() (size int) {
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
72 func (m *CreateVhostUserIf) Marshal(b []byte) ([]byte, error) {
74 b = make([]byte, m.Size())
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
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)
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"`
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
119 func (m *CreateVhostUserIfReply) Size() (size int) {
123 size += 4 // m.Retval
124 size += 4 // m.SwIfIndex
127 func (m *CreateVhostUserIfReply) Marshal(b []byte) ([]byte, error) {
129 b = make([]byte, m.Size())
131 buf := codec.NewBuffer(b)
132 buf.EncodeInt32(m.Retval)
133 buf.EncodeUint32(uint32(m.SwIfIndex))
134 return buf.Bytes(), nil
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())
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"`
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
155 func (m *DeleteVhostUserIf) Size() (size int) {
159 size += 4 // m.SwIfIndex
162 func (m *DeleteVhostUserIf) Marshal(b []byte) ([]byte, error) {
164 b = make([]byte, m.Size())
166 buf := codec.NewBuffer(b)
167 buf.EncodeUint32(uint32(m.SwIfIndex))
168 return buf.Bytes(), nil
170 func (m *DeleteVhostUserIf) Unmarshal(b []byte) error {
171 buf := codec.NewBuffer(b)
172 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
176 // DeleteVhostUserIfReply defines message 'delete_vhost_user_if_reply'.
177 type DeleteVhostUserIfReply struct {
178 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
188 func (m *DeleteVhostUserIfReply) Size() (size int) {
192 size += 4 // m.Retval
195 func (m *DeleteVhostUserIfReply) Marshal(b []byte) ([]byte, error) {
197 b = make([]byte, m.Size())
199 buf := codec.NewBuffer(b)
200 buf.EncodeInt32(m.Retval)
201 return buf.Bytes(), nil
203 func (m *DeleteVhostUserIfReply) Unmarshal(b []byte) error {
204 buf := codec.NewBuffer(b)
205 m.Retval = buf.DecodeInt32()
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"`
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
227 func (m *ModifyVhostUserIf) Size() (size int) {
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
240 func (m *ModifyVhostUserIf) Marshal(b []byte) ([]byte, error) {
242 b = make([]byte, m.Size())
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
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()
266 // ModifyVhostUserIfReply defines message 'modify_vhost_user_if_reply'.
267 type ModifyVhostUserIfReply struct {
268 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
278 func (m *ModifyVhostUserIfReply) Size() (size int) {
282 size += 4 // m.Retval
285 func (m *ModifyVhostUserIfReply) Marshal(b []byte) ([]byte, error) {
287 b = make([]byte, m.Size())
289 buf := codec.NewBuffer(b)
290 buf.EncodeInt32(m.Retval)
291 return buf.Bytes(), nil
293 func (m *ModifyVhostUserIfReply) Unmarshal(b []byte) error {
294 buf := codec.NewBuffer(b)
295 m.Retval = buf.DecodeInt32()
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"`
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
319 func (m *SwInterfaceVhostUserDetails) Size() (size int) {
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
334 func (m *SwInterfaceVhostUserDetails) Marshal(b []byte) ([]byte, error) {
336 b = make([]byte, m.Size())
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
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()
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"`
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
376 func (m *SwInterfaceVhostUserDump) Size() (size int) {
380 size += 4 // m.SwIfIndex
383 func (m *SwInterfaceVhostUserDump) Marshal(b []byte) ([]byte, error) {
385 b = make([]byte, m.Size())
387 buf := codec.NewBuffer(b)
388 buf.EncodeUint32(uint32(m.SwIfIndex))
389 return buf.Bytes(), nil
391 func (m *SwInterfaceVhostUserDump) Unmarshal(b []byte) error {
392 buf := codec.NewBuffer(b)
393 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
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")
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),