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() int {
61 size += 1 // m.IsServer
62 size += 256 // m.SockFilename
63 size += 1 // m.Renumber
64 size += 1 // m.DisableMrgRxbuf
65 size += 1 // m.DisableIndirectDesc
66 size += 1 // m.EnableGso
67 size += 1 // m.EnablePacked
68 size += 4 // m.CustomDevInstance
69 size += 1 // m.UseCustomMac
70 size += 1 * 6 // m.MacAddress
74 func (m *CreateVhostUserIf) Marshal(b []byte) ([]byte, error) {
77 buf = codec.NewBuffer(make([]byte, m.Size()))
79 buf = codec.NewBuffer(b)
81 buf.EncodeBool(m.IsServer)
82 buf.EncodeString(m.SockFilename, 256)
83 buf.EncodeBool(m.Renumber)
84 buf.EncodeBool(m.DisableMrgRxbuf)
85 buf.EncodeBool(m.DisableIndirectDesc)
86 buf.EncodeBool(m.EnableGso)
87 buf.EncodeBool(m.EnablePacked)
88 buf.EncodeUint32(uint32(m.CustomDevInstance))
89 buf.EncodeBool(m.UseCustomMac)
90 buf.EncodeBytes(m.MacAddress[:], 6)
91 buf.EncodeString(m.Tag, 64)
92 return buf.Bytes(), nil
94 func (m *CreateVhostUserIf) Unmarshal(b []byte) error {
95 buf := codec.NewBuffer(b)
96 m.IsServer = buf.DecodeBool()
97 m.SockFilename = buf.DecodeString(256)
98 m.Renumber = buf.DecodeBool()
99 m.DisableMrgRxbuf = buf.DecodeBool()
100 m.DisableIndirectDesc = buf.DecodeBool()
101 m.EnableGso = buf.DecodeBool()
102 m.EnablePacked = buf.DecodeBool()
103 m.CustomDevInstance = buf.DecodeUint32()
104 m.UseCustomMac = buf.DecodeBool()
105 copy(m.MacAddress[:], buf.DecodeBytes(6))
106 m.Tag = buf.DecodeString(64)
110 // CreateVhostUserIfReply defines message 'create_vhost_user_if_reply'.
111 type CreateVhostUserIfReply struct {
112 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
113 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
116 func (m *CreateVhostUserIfReply) Reset() { *m = CreateVhostUserIfReply{} }
117 func (*CreateVhostUserIfReply) GetMessageName() string { return "create_vhost_user_if_reply" }
118 func (*CreateVhostUserIfReply) GetCrcString() string { return "5383d31f" }
119 func (*CreateVhostUserIfReply) GetMessageType() api.MessageType {
120 return api.ReplyMessage
123 func (m *CreateVhostUserIfReply) Size() int {
128 size += 4 // m.Retval
129 size += 4 // m.SwIfIndex
132 func (m *CreateVhostUserIfReply) Marshal(b []byte) ([]byte, error) {
133 var buf *codec.Buffer
135 buf = codec.NewBuffer(make([]byte, m.Size()))
137 buf = codec.NewBuffer(b)
139 buf.EncodeUint32(uint32(m.Retval))
140 buf.EncodeUint32(uint32(m.SwIfIndex))
141 return buf.Bytes(), nil
143 func (m *CreateVhostUserIfReply) Unmarshal(b []byte) error {
144 buf := codec.NewBuffer(b)
145 m.Retval = int32(buf.DecodeUint32())
146 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
150 // DeleteVhostUserIf defines message 'delete_vhost_user_if'.
151 type DeleteVhostUserIf struct {
152 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
155 func (m *DeleteVhostUserIf) Reset() { *m = DeleteVhostUserIf{} }
156 func (*DeleteVhostUserIf) GetMessageName() string { return "delete_vhost_user_if" }
157 func (*DeleteVhostUserIf) GetCrcString() string { return "f9e6675e" }
158 func (*DeleteVhostUserIf) GetMessageType() api.MessageType {
159 return api.RequestMessage
162 func (m *DeleteVhostUserIf) Size() int {
167 size += 4 // m.SwIfIndex
170 func (m *DeleteVhostUserIf) Marshal(b []byte) ([]byte, error) {
171 var buf *codec.Buffer
173 buf = codec.NewBuffer(make([]byte, m.Size()))
175 buf = codec.NewBuffer(b)
177 buf.EncodeUint32(uint32(m.SwIfIndex))
178 return buf.Bytes(), nil
180 func (m *DeleteVhostUserIf) Unmarshal(b []byte) error {
181 buf := codec.NewBuffer(b)
182 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
186 // DeleteVhostUserIfReply defines message 'delete_vhost_user_if_reply'.
187 type DeleteVhostUserIfReply struct {
188 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
191 func (m *DeleteVhostUserIfReply) Reset() { *m = DeleteVhostUserIfReply{} }
192 func (*DeleteVhostUserIfReply) GetMessageName() string { return "delete_vhost_user_if_reply" }
193 func (*DeleteVhostUserIfReply) GetCrcString() string { return "e8d4e804" }
194 func (*DeleteVhostUserIfReply) GetMessageType() api.MessageType {
195 return api.ReplyMessage
198 func (m *DeleteVhostUserIfReply) Size() int {
203 size += 4 // m.Retval
206 func (m *DeleteVhostUserIfReply) Marshal(b []byte) ([]byte, error) {
207 var buf *codec.Buffer
209 buf = codec.NewBuffer(make([]byte, m.Size()))
211 buf = codec.NewBuffer(b)
213 buf.EncodeUint32(uint32(m.Retval))
214 return buf.Bytes(), nil
216 func (m *DeleteVhostUserIfReply) Unmarshal(b []byte) error {
217 buf := codec.NewBuffer(b)
218 m.Retval = int32(buf.DecodeUint32())
222 // ModifyVhostUserIf defines message 'modify_vhost_user_if'.
223 type ModifyVhostUserIf struct {
224 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
225 IsServer bool `binapi:"bool,name=is_server" json:"is_server,omitempty"`
226 SockFilename string `binapi:"string[256],name=sock_filename" json:"sock_filename,omitempty"`
227 Renumber bool `binapi:"bool,name=renumber" json:"renumber,omitempty"`
228 EnableGso bool `binapi:"bool,name=enable_gso" json:"enable_gso,omitempty"`
229 EnablePacked bool `binapi:"bool,name=enable_packed" json:"enable_packed,omitempty"`
230 CustomDevInstance uint32 `binapi:"u32,name=custom_dev_instance" json:"custom_dev_instance,omitempty"`
233 func (m *ModifyVhostUserIf) Reset() { *m = ModifyVhostUserIf{} }
234 func (*ModifyVhostUserIf) GetMessageName() string { return "modify_vhost_user_if" }
235 func (*ModifyVhostUserIf) GetCrcString() string { return "0e71d40b" }
236 func (*ModifyVhostUserIf) GetMessageType() api.MessageType {
237 return api.RequestMessage
240 func (m *ModifyVhostUserIf) Size() int {
245 size += 4 // m.SwIfIndex
246 size += 1 // m.IsServer
247 size += 256 // m.SockFilename
248 size += 1 // m.Renumber
249 size += 1 // m.EnableGso
250 size += 1 // m.EnablePacked
251 size += 4 // m.CustomDevInstance
254 func (m *ModifyVhostUserIf) Marshal(b []byte) ([]byte, error) {
255 var buf *codec.Buffer
257 buf = codec.NewBuffer(make([]byte, m.Size()))
259 buf = codec.NewBuffer(b)
261 buf.EncodeUint32(uint32(m.SwIfIndex))
262 buf.EncodeBool(m.IsServer)
263 buf.EncodeString(m.SockFilename, 256)
264 buf.EncodeBool(m.Renumber)
265 buf.EncodeBool(m.EnableGso)
266 buf.EncodeBool(m.EnablePacked)
267 buf.EncodeUint32(uint32(m.CustomDevInstance))
268 return buf.Bytes(), nil
270 func (m *ModifyVhostUserIf) Unmarshal(b []byte) error {
271 buf := codec.NewBuffer(b)
272 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
273 m.IsServer = buf.DecodeBool()
274 m.SockFilename = buf.DecodeString(256)
275 m.Renumber = buf.DecodeBool()
276 m.EnableGso = buf.DecodeBool()
277 m.EnablePacked = buf.DecodeBool()
278 m.CustomDevInstance = buf.DecodeUint32()
282 // ModifyVhostUserIfReply defines message 'modify_vhost_user_if_reply'.
283 type ModifyVhostUserIfReply struct {
284 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
287 func (m *ModifyVhostUserIfReply) Reset() { *m = ModifyVhostUserIfReply{} }
288 func (*ModifyVhostUserIfReply) GetMessageName() string { return "modify_vhost_user_if_reply" }
289 func (*ModifyVhostUserIfReply) GetCrcString() string { return "e8d4e804" }
290 func (*ModifyVhostUserIfReply) GetMessageType() api.MessageType {
291 return api.ReplyMessage
294 func (m *ModifyVhostUserIfReply) Size() int {
299 size += 4 // m.Retval
302 func (m *ModifyVhostUserIfReply) Marshal(b []byte) ([]byte, error) {
303 var buf *codec.Buffer
305 buf = codec.NewBuffer(make([]byte, m.Size()))
307 buf = codec.NewBuffer(b)
309 buf.EncodeUint32(uint32(m.Retval))
310 return buf.Bytes(), nil
312 func (m *ModifyVhostUserIfReply) Unmarshal(b []byte) error {
313 buf := codec.NewBuffer(b)
314 m.Retval = int32(buf.DecodeUint32())
318 // SwInterfaceVhostUserDetails defines message 'sw_interface_vhost_user_details'.
319 type SwInterfaceVhostUserDetails struct {
320 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
321 InterfaceName string `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"`
322 VirtioNetHdrSz uint32 `binapi:"u32,name=virtio_net_hdr_sz" json:"virtio_net_hdr_sz,omitempty"`
323 FeaturesFirst32 virtio_types.VirtioNetFeaturesFirst32 `binapi:"virtio_net_features_first_32,name=features_first_32" json:"features_first_32,omitempty"`
324 FeaturesLast32 virtio_types.VirtioNetFeaturesLast32 `binapi:"virtio_net_features_last_32,name=features_last_32" json:"features_last_32,omitempty"`
325 IsServer bool `binapi:"bool,name=is_server" json:"is_server,omitempty"`
326 SockFilename string `binapi:"string[256],name=sock_filename" json:"sock_filename,omitempty"`
327 NumRegions uint32 `binapi:"u32,name=num_regions" json:"num_regions,omitempty"`
328 SockErrno int32 `binapi:"i32,name=sock_errno" json:"sock_errno,omitempty"`
331 func (m *SwInterfaceVhostUserDetails) Reset() { *m = SwInterfaceVhostUserDetails{} }
332 func (*SwInterfaceVhostUserDetails) GetMessageName() string { return "sw_interface_vhost_user_details" }
333 func (*SwInterfaceVhostUserDetails) GetCrcString() string { return "98530df1" }
334 func (*SwInterfaceVhostUserDetails) GetMessageType() api.MessageType {
335 return api.ReplyMessage
338 func (m *SwInterfaceVhostUserDetails) Size() int {
343 size += 4 // m.SwIfIndex
344 size += 64 // m.InterfaceName
345 size += 4 // m.VirtioNetHdrSz
346 size += 4 // m.FeaturesFirst32
347 size += 4 // m.FeaturesLast32
348 size += 1 // m.IsServer
349 size += 256 // m.SockFilename
350 size += 4 // m.NumRegions
351 size += 4 // m.SockErrno
354 func (m *SwInterfaceVhostUserDetails) Marshal(b []byte) ([]byte, error) {
355 var buf *codec.Buffer
357 buf = codec.NewBuffer(make([]byte, m.Size()))
359 buf = codec.NewBuffer(b)
361 buf.EncodeUint32(uint32(m.SwIfIndex))
362 buf.EncodeString(m.InterfaceName, 64)
363 buf.EncodeUint32(uint32(m.VirtioNetHdrSz))
364 buf.EncodeUint32(uint32(m.FeaturesFirst32))
365 buf.EncodeUint32(uint32(m.FeaturesLast32))
366 buf.EncodeBool(m.IsServer)
367 buf.EncodeString(m.SockFilename, 256)
368 buf.EncodeUint32(uint32(m.NumRegions))
369 buf.EncodeUint32(uint32(m.SockErrno))
370 return buf.Bytes(), nil
372 func (m *SwInterfaceVhostUserDetails) Unmarshal(b []byte) error {
373 buf := codec.NewBuffer(b)
374 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
375 m.InterfaceName = buf.DecodeString(64)
376 m.VirtioNetHdrSz = buf.DecodeUint32()
377 m.FeaturesFirst32 = virtio_types.VirtioNetFeaturesFirst32(buf.DecodeUint32())
378 m.FeaturesLast32 = virtio_types.VirtioNetFeaturesLast32(buf.DecodeUint32())
379 m.IsServer = buf.DecodeBool()
380 m.SockFilename = buf.DecodeString(256)
381 m.NumRegions = buf.DecodeUint32()
382 m.SockErrno = int32(buf.DecodeUint32())
386 // SwInterfaceVhostUserDump defines message 'sw_interface_vhost_user_dump'.
387 type SwInterfaceVhostUserDump struct {
388 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=%!s(float64=4.294967295e+09)" json:"sw_if_index,omitempty"`
391 func (m *SwInterfaceVhostUserDump) Reset() { *m = SwInterfaceVhostUserDump{} }
392 func (*SwInterfaceVhostUserDump) GetMessageName() string { return "sw_interface_vhost_user_dump" }
393 func (*SwInterfaceVhostUserDump) GetCrcString() string { return "f9e6675e" }
394 func (*SwInterfaceVhostUserDump) GetMessageType() api.MessageType {
395 return api.RequestMessage
398 func (m *SwInterfaceVhostUserDump) Size() int {
403 size += 4 // m.SwIfIndex
406 func (m *SwInterfaceVhostUserDump) Marshal(b []byte) ([]byte, error) {
407 var buf *codec.Buffer
409 buf = codec.NewBuffer(make([]byte, m.Size()))
411 buf = codec.NewBuffer(b)
413 buf.EncodeUint32(uint32(m.SwIfIndex))
414 return buf.Bytes(), nil
416 func (m *SwInterfaceVhostUserDump) Unmarshal(b []byte) error {
417 buf := codec.NewBuffer(b)
418 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
422 func init() { file_vhost_user_binapi_init() }
423 func file_vhost_user_binapi_init() {
424 api.RegisterMessage((*CreateVhostUserIf)(nil), "create_vhost_user_if_c785c6fc")
425 api.RegisterMessage((*CreateVhostUserIfReply)(nil), "create_vhost_user_if_reply_5383d31f")
426 api.RegisterMessage((*DeleteVhostUserIf)(nil), "delete_vhost_user_if_f9e6675e")
427 api.RegisterMessage((*DeleteVhostUserIfReply)(nil), "delete_vhost_user_if_reply_e8d4e804")
428 api.RegisterMessage((*ModifyVhostUserIf)(nil), "modify_vhost_user_if_0e71d40b")
429 api.RegisterMessage((*ModifyVhostUserIfReply)(nil), "modify_vhost_user_if_reply_e8d4e804")
430 api.RegisterMessage((*SwInterfaceVhostUserDetails)(nil), "sw_interface_vhost_user_details_98530df1")
431 api.RegisterMessage((*SwInterfaceVhostUserDump)(nil), "sw_interface_vhost_user_dump_f9e6675e")
434 // Messages returns list of all messages in this module.
435 func AllMessages() []api.Message {
436 return []api.Message{
437 (*CreateVhostUserIf)(nil),
438 (*CreateVhostUserIfReply)(nil),
439 (*DeleteVhostUserIf)(nil),
440 (*DeleteVhostUserIfReply)(nil),
441 (*ModifyVhostUserIf)(nil),
442 (*ModifyVhostUserIfReply)(nil),
443 (*SwInterfaceVhostUserDetails)(nil),
444 (*SwInterfaceVhostUserDump)(nil),