1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: /usr/share/vpp/api/core/vhost_user.api.json
7 // Package vhost_user contains generated bindings for API file vhost_user.api.
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 virtio_types "git.fd.io/govpp.git/binapi/virtio_types"
19 codec "git.fd.io/govpp.git/codec"
22 // This is a compile-time assertion to ensure that this generated file
23 // is compatible with the GoVPP api package it is being compiled against.
24 // A compilation error at this line likely means your copy of the
25 // GoVPP api package needs to be updated.
26 const _ = api.GoVppAPIPackageIsVersion2
29 APIFile = "vhost_user"
31 VersionCrc = 0x3df14dfe
34 // CreateVhostUserIf defines message 'create_vhost_user_if'.
35 type CreateVhostUserIf struct {
36 IsServer bool `binapi:"bool,name=is_server" json:"is_server,omitempty"`
37 SockFilename string `binapi:"string[256],name=sock_filename" json:"sock_filename,omitempty"`
38 Renumber bool `binapi:"bool,name=renumber" json:"renumber,omitempty"`
39 DisableMrgRxbuf bool `binapi:"bool,name=disable_mrg_rxbuf" json:"disable_mrg_rxbuf,omitempty"`
40 DisableIndirectDesc bool `binapi:"bool,name=disable_indirect_desc" json:"disable_indirect_desc,omitempty"`
41 EnableGso bool `binapi:"bool,name=enable_gso" json:"enable_gso,omitempty"`
42 EnablePacked bool `binapi:"bool,name=enable_packed" json:"enable_packed,omitempty"`
43 CustomDevInstance uint32 `binapi:"u32,name=custom_dev_instance" json:"custom_dev_instance,omitempty"`
44 UseCustomMac bool `binapi:"bool,name=use_custom_mac" json:"use_custom_mac,omitempty"`
45 MacAddress ethernet_types.MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
46 Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"`
49 func (m *CreateVhostUserIf) Reset() { *m = CreateVhostUserIf{} }
50 func (*CreateVhostUserIf) GetMessageName() string { return "create_vhost_user_if" }
51 func (*CreateVhostUserIf) GetCrcString() string { return "c785c6fc" }
52 func (*CreateVhostUserIf) GetMessageType() api.MessageType {
53 return api.RequestMessage
56 func (m *CreateVhostUserIf) Size() (size int) {
60 size += 1 // m.IsServer
61 size += 256 // m.SockFilename
62 size += 1 // m.Renumber
63 size += 1 // m.DisableMrgRxbuf
64 size += 1 // m.DisableIndirectDesc
65 size += 1 // m.EnableGso
66 size += 1 // m.EnablePacked
67 size += 4 // m.CustomDevInstance
68 size += 1 // m.UseCustomMac
69 size += 1 * 6 // m.MacAddress
73 func (m *CreateVhostUserIf) Marshal(b []byte) ([]byte, error) {
75 b = make([]byte, m.Size())
77 buf := codec.NewBuffer(b)
78 buf.EncodeBool(m.IsServer)
79 buf.EncodeString(m.SockFilename, 256)
80 buf.EncodeBool(m.Renumber)
81 buf.EncodeBool(m.DisableMrgRxbuf)
82 buf.EncodeBool(m.DisableIndirectDesc)
83 buf.EncodeBool(m.EnableGso)
84 buf.EncodeBool(m.EnablePacked)
85 buf.EncodeUint32(m.CustomDevInstance)
86 buf.EncodeBool(m.UseCustomMac)
87 buf.EncodeBytes(m.MacAddress[:], 6)
88 buf.EncodeString(m.Tag, 64)
89 return buf.Bytes(), nil
91 func (m *CreateVhostUserIf) Unmarshal(b []byte) error {
92 buf := codec.NewBuffer(b)
93 m.IsServer = buf.DecodeBool()
94 m.SockFilename = buf.DecodeString(256)
95 m.Renumber = buf.DecodeBool()
96 m.DisableMrgRxbuf = buf.DecodeBool()
97 m.DisableIndirectDesc = buf.DecodeBool()
98 m.EnableGso = buf.DecodeBool()
99 m.EnablePacked = buf.DecodeBool()
100 m.CustomDevInstance = buf.DecodeUint32()
101 m.UseCustomMac = buf.DecodeBool()
102 copy(m.MacAddress[:], buf.DecodeBytes(6))
103 m.Tag = buf.DecodeString(64)
107 // CreateVhostUserIfReply defines message 'create_vhost_user_if_reply'.
108 type CreateVhostUserIfReply struct {
109 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
110 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
113 func (m *CreateVhostUserIfReply) Reset() { *m = CreateVhostUserIfReply{} }
114 func (*CreateVhostUserIfReply) GetMessageName() string { return "create_vhost_user_if_reply" }
115 func (*CreateVhostUserIfReply) GetCrcString() string { return "5383d31f" }
116 func (*CreateVhostUserIfReply) GetMessageType() api.MessageType {
117 return api.ReplyMessage
120 func (m *CreateVhostUserIfReply) Size() (size int) {
124 size += 4 // m.Retval
125 size += 4 // m.SwIfIndex
128 func (m *CreateVhostUserIfReply) Marshal(b []byte) ([]byte, error) {
130 b = make([]byte, m.Size())
132 buf := codec.NewBuffer(b)
133 buf.EncodeInt32(m.Retval)
134 buf.EncodeUint32(uint32(m.SwIfIndex))
135 return buf.Bytes(), nil
137 func (m *CreateVhostUserIfReply) Unmarshal(b []byte) error {
138 buf := codec.NewBuffer(b)
139 m.Retval = buf.DecodeInt32()
140 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
144 // DeleteVhostUserIf defines message 'delete_vhost_user_if'.
145 type DeleteVhostUserIf struct {
146 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
149 func (m *DeleteVhostUserIf) Reset() { *m = DeleteVhostUserIf{} }
150 func (*DeleteVhostUserIf) GetMessageName() string { return "delete_vhost_user_if" }
151 func (*DeleteVhostUserIf) GetCrcString() string { return "f9e6675e" }
152 func (*DeleteVhostUserIf) GetMessageType() api.MessageType {
153 return api.RequestMessage
156 func (m *DeleteVhostUserIf) Size() (size int) {
160 size += 4 // m.SwIfIndex
163 func (m *DeleteVhostUserIf) Marshal(b []byte) ([]byte, error) {
165 b = make([]byte, m.Size())
167 buf := codec.NewBuffer(b)
168 buf.EncodeUint32(uint32(m.SwIfIndex))
169 return buf.Bytes(), nil
171 func (m *DeleteVhostUserIf) Unmarshal(b []byte) error {
172 buf := codec.NewBuffer(b)
173 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
177 // DeleteVhostUserIfReply defines message 'delete_vhost_user_if_reply'.
178 type DeleteVhostUserIfReply struct {
179 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
182 func (m *DeleteVhostUserIfReply) Reset() { *m = DeleteVhostUserIfReply{} }
183 func (*DeleteVhostUserIfReply) GetMessageName() string { return "delete_vhost_user_if_reply" }
184 func (*DeleteVhostUserIfReply) GetCrcString() string { return "e8d4e804" }
185 func (*DeleteVhostUserIfReply) GetMessageType() api.MessageType {
186 return api.ReplyMessage
189 func (m *DeleteVhostUserIfReply) Size() (size int) {
193 size += 4 // m.Retval
196 func (m *DeleteVhostUserIfReply) Marshal(b []byte) ([]byte, error) {
198 b = make([]byte, m.Size())
200 buf := codec.NewBuffer(b)
201 buf.EncodeInt32(m.Retval)
202 return buf.Bytes(), nil
204 func (m *DeleteVhostUserIfReply) Unmarshal(b []byte) error {
205 buf := codec.NewBuffer(b)
206 m.Retval = buf.DecodeInt32()
210 // ModifyVhostUserIf defines message 'modify_vhost_user_if'.
211 type ModifyVhostUserIf struct {
212 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
213 IsServer bool `binapi:"bool,name=is_server" json:"is_server,omitempty"`
214 SockFilename string `binapi:"string[256],name=sock_filename" json:"sock_filename,omitempty"`
215 Renumber bool `binapi:"bool,name=renumber" json:"renumber,omitempty"`
216 EnableGso bool `binapi:"bool,name=enable_gso" json:"enable_gso,omitempty"`
217 EnablePacked bool `binapi:"bool,name=enable_packed" json:"enable_packed,omitempty"`
218 CustomDevInstance uint32 `binapi:"u32,name=custom_dev_instance" json:"custom_dev_instance,omitempty"`
221 func (m *ModifyVhostUserIf) Reset() { *m = ModifyVhostUserIf{} }
222 func (*ModifyVhostUserIf) GetMessageName() string { return "modify_vhost_user_if" }
223 func (*ModifyVhostUserIf) GetCrcString() string { return "0e71d40b" }
224 func (*ModifyVhostUserIf) GetMessageType() api.MessageType {
225 return api.RequestMessage
228 func (m *ModifyVhostUserIf) Size() (size int) {
232 size += 4 // m.SwIfIndex
233 size += 1 // m.IsServer
234 size += 256 // m.SockFilename
235 size += 1 // m.Renumber
236 size += 1 // m.EnableGso
237 size += 1 // m.EnablePacked
238 size += 4 // m.CustomDevInstance
241 func (m *ModifyVhostUserIf) Marshal(b []byte) ([]byte, error) {
243 b = make([]byte, m.Size())
245 buf := codec.NewBuffer(b)
246 buf.EncodeUint32(uint32(m.SwIfIndex))
247 buf.EncodeBool(m.IsServer)
248 buf.EncodeString(m.SockFilename, 256)
249 buf.EncodeBool(m.Renumber)
250 buf.EncodeBool(m.EnableGso)
251 buf.EncodeBool(m.EnablePacked)
252 buf.EncodeUint32(m.CustomDevInstance)
253 return buf.Bytes(), nil
255 func (m *ModifyVhostUserIf) Unmarshal(b []byte) error {
256 buf := codec.NewBuffer(b)
257 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
258 m.IsServer = buf.DecodeBool()
259 m.SockFilename = buf.DecodeString(256)
260 m.Renumber = buf.DecodeBool()
261 m.EnableGso = buf.DecodeBool()
262 m.EnablePacked = buf.DecodeBool()
263 m.CustomDevInstance = buf.DecodeUint32()
267 // ModifyVhostUserIfReply defines message 'modify_vhost_user_if_reply'.
268 type ModifyVhostUserIfReply struct {
269 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
272 func (m *ModifyVhostUserIfReply) Reset() { *m = ModifyVhostUserIfReply{} }
273 func (*ModifyVhostUserIfReply) GetMessageName() string { return "modify_vhost_user_if_reply" }
274 func (*ModifyVhostUserIfReply) GetCrcString() string { return "e8d4e804" }
275 func (*ModifyVhostUserIfReply) GetMessageType() api.MessageType {
276 return api.ReplyMessage
279 func (m *ModifyVhostUserIfReply) Size() (size int) {
283 size += 4 // m.Retval
286 func (m *ModifyVhostUserIfReply) Marshal(b []byte) ([]byte, error) {
288 b = make([]byte, m.Size())
290 buf := codec.NewBuffer(b)
291 buf.EncodeInt32(m.Retval)
292 return buf.Bytes(), nil
294 func (m *ModifyVhostUserIfReply) Unmarshal(b []byte) error {
295 buf := codec.NewBuffer(b)
296 m.Retval = buf.DecodeInt32()
300 // SwInterfaceVhostUserDetails defines message 'sw_interface_vhost_user_details'.
301 type SwInterfaceVhostUserDetails struct {
302 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
303 InterfaceName string `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"`
304 VirtioNetHdrSz uint32 `binapi:"u32,name=virtio_net_hdr_sz" json:"virtio_net_hdr_sz,omitempty"`
305 FeaturesFirst32 virtio_types.VirtioNetFeaturesFirst32 `binapi:"virtio_net_features_first_32,name=features_first_32" json:"features_first_32,omitempty"`
306 FeaturesLast32 virtio_types.VirtioNetFeaturesLast32 `binapi:"virtio_net_features_last_32,name=features_last_32" json:"features_last_32,omitempty"`
307 IsServer bool `binapi:"bool,name=is_server" json:"is_server,omitempty"`
308 SockFilename string `binapi:"string[256],name=sock_filename" json:"sock_filename,omitempty"`
309 NumRegions uint32 `binapi:"u32,name=num_regions" json:"num_regions,omitempty"`
310 SockErrno int32 `binapi:"i32,name=sock_errno" json:"sock_errno,omitempty"`
313 func (m *SwInterfaceVhostUserDetails) Reset() { *m = SwInterfaceVhostUserDetails{} }
314 func (*SwInterfaceVhostUserDetails) GetMessageName() string { return "sw_interface_vhost_user_details" }
315 func (*SwInterfaceVhostUserDetails) GetCrcString() string { return "98530df1" }
316 func (*SwInterfaceVhostUserDetails) GetMessageType() api.MessageType {
317 return api.ReplyMessage
320 func (m *SwInterfaceVhostUserDetails) Size() (size int) {
324 size += 4 // m.SwIfIndex
325 size += 64 // m.InterfaceName
326 size += 4 // m.VirtioNetHdrSz
327 size += 4 // m.FeaturesFirst32
328 size += 4 // m.FeaturesLast32
329 size += 1 // m.IsServer
330 size += 256 // m.SockFilename
331 size += 4 // m.NumRegions
332 size += 4 // m.SockErrno
335 func (m *SwInterfaceVhostUserDetails) Marshal(b []byte) ([]byte, error) {
337 b = make([]byte, m.Size())
339 buf := codec.NewBuffer(b)
340 buf.EncodeUint32(uint32(m.SwIfIndex))
341 buf.EncodeString(m.InterfaceName, 64)
342 buf.EncodeUint32(m.VirtioNetHdrSz)
343 buf.EncodeUint32(uint32(m.FeaturesFirst32))
344 buf.EncodeUint32(uint32(m.FeaturesLast32))
345 buf.EncodeBool(m.IsServer)
346 buf.EncodeString(m.SockFilename, 256)
347 buf.EncodeUint32(m.NumRegions)
348 buf.EncodeInt32(m.SockErrno)
349 return buf.Bytes(), nil
351 func (m *SwInterfaceVhostUserDetails) Unmarshal(b []byte) error {
352 buf := codec.NewBuffer(b)
353 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
354 m.InterfaceName = buf.DecodeString(64)
355 m.VirtioNetHdrSz = buf.DecodeUint32()
356 m.FeaturesFirst32 = virtio_types.VirtioNetFeaturesFirst32(buf.DecodeUint32())
357 m.FeaturesLast32 = virtio_types.VirtioNetFeaturesLast32(buf.DecodeUint32())
358 m.IsServer = buf.DecodeBool()
359 m.SockFilename = buf.DecodeString(256)
360 m.NumRegions = buf.DecodeUint32()
361 m.SockErrno = buf.DecodeInt32()
365 // SwInterfaceVhostUserDump defines message 'sw_interface_vhost_user_dump'.
366 type SwInterfaceVhostUserDump struct {
367 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
370 func (m *SwInterfaceVhostUserDump) Reset() { *m = SwInterfaceVhostUserDump{} }
371 func (*SwInterfaceVhostUserDump) GetMessageName() string { return "sw_interface_vhost_user_dump" }
372 func (*SwInterfaceVhostUserDump) GetCrcString() string { return "f9e6675e" }
373 func (*SwInterfaceVhostUserDump) GetMessageType() api.MessageType {
374 return api.RequestMessage
377 func (m *SwInterfaceVhostUserDump) Size() (size int) {
381 size += 4 // m.SwIfIndex
384 func (m *SwInterfaceVhostUserDump) Marshal(b []byte) ([]byte, error) {
386 b = make([]byte, m.Size())
388 buf := codec.NewBuffer(b)
389 buf.EncodeUint32(uint32(m.SwIfIndex))
390 return buf.Bytes(), nil
392 func (m *SwInterfaceVhostUserDump) Unmarshal(b []byte) error {
393 buf := codec.NewBuffer(b)
394 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
398 func init() { file_vhost_user_binapi_init() }
399 func file_vhost_user_binapi_init() {
400 api.RegisterMessage((*CreateVhostUserIf)(nil), "create_vhost_user_if_c785c6fc")
401 api.RegisterMessage((*CreateVhostUserIfReply)(nil), "create_vhost_user_if_reply_5383d31f")
402 api.RegisterMessage((*DeleteVhostUserIf)(nil), "delete_vhost_user_if_f9e6675e")
403 api.RegisterMessage((*DeleteVhostUserIfReply)(nil), "delete_vhost_user_if_reply_e8d4e804")
404 api.RegisterMessage((*ModifyVhostUserIf)(nil), "modify_vhost_user_if_0e71d40b")
405 api.RegisterMessage((*ModifyVhostUserIfReply)(nil), "modify_vhost_user_if_reply_e8d4e804")
406 api.RegisterMessage((*SwInterfaceVhostUserDetails)(nil), "sw_interface_vhost_user_details_98530df1")
407 api.RegisterMessage((*SwInterfaceVhostUserDump)(nil), "sw_interface_vhost_user_dump_f9e6675e")
410 // Messages returns list of all messages in this module.
411 func AllMessages() []api.Message {
412 return []api.Message{
413 (*CreateVhostUserIf)(nil),
414 (*CreateVhostUserIfReply)(nil),
415 (*DeleteVhostUserIf)(nil),
416 (*DeleteVhostUserIfReply)(nil),
417 (*ModifyVhostUserIf)(nil),
418 (*ModifyVhostUserIfReply)(nil),
419 (*SwInterfaceVhostUserDetails)(nil),
420 (*SwInterfaceVhostUserDump)(nil),